Add call to onWebUIStartupEnd when pluginHandler is refreshed, so new plugins can run their startups, if they have one. Add plugins option (disabled) to the sample config

Add call to onWebUIStartupEnd when pluginHandler is refreshed, so new plugins can run their startups, if they have one. Add plugins option (disabled) to the sample config

Ryan Blenis committed Jan 3, 2020 at 03:10 UTC 7ca65028d89f8c2cd1a90f5ee052181d8b492ca5
2 files changed +5 -2
pluginHandler.js
+1 -1
@@ -130,7 +130,7 @@ module.exports.pluginHandler = function (parent) {
130 obj.refreshJS = function (req, res) {
131 // to minimize server reboots when installing new plugins, we call the new data and overwrite the old pluginHandler on the front end
132 res.set('Content-Type', 'text/javascript');
133 - res.send('pluginHandlerBuilder = ' + obj.prepExports() + ' pluginHandler = new pluginHandlerBuilder();');
133 + res.send('pluginHandlerBuilder = ' + obj.prepExports() + ' pluginHandler = new pluginHandlerBuilder(); pluginHandler.callHook("onWebUIStartupEnd");');
134 }
135
136 obj.callHook = function (hookName, ...args) {
sample-config.json
+4 -1
@@ -64,7 +64,10 @@
64 "meshcommander": "https://www.meshcommander.com/"
65 },
66 "__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.",
67 - "MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 }
67 + "MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 },
68 + "_plugins": {
69 + "enabled": true
70 + }
71 },
72 "_domains": {
73 "": {