From 57334af7477647e5fe11cb2283187be9f94ef710 Mon Sep 17 00:00:00 2001 From: Ryan Blenis Date: Fri, 3 Jan 2020 03:10:42 -0500 Subject: [PATCH] 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 --- pluginHandler.js | 2 +- sample-config.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index c0d595b4..a6779f7a 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -130,7 +130,7 @@ module.exports.pluginHandler = function (parent) { obj.refreshJS = function (req, res) { // to minimize server reboots when installing new plugins, we call the new data and overwrite the old pluginHandler on the front end res.set('Content-Type', 'text/javascript'); - res.send('pluginHandlerBuilder = ' + obj.prepExports() + ' pluginHandler = new pluginHandlerBuilder();'); + res.send('pluginHandlerBuilder = ' + obj.prepExports() + ' pluginHandler = new pluginHandlerBuilder(); pluginHandler.callHook("onWebUIStartupEnd");'); } obj.callHook = function (hookName, ...args) { diff --git a/sample-config.json b/sample-config.json index ca24bdf7..da0cd891 100644 --- a/sample-config.json +++ b/sample-config.json @@ -64,7 +64,10 @@ "meshcommander": "https://www.meshcommander.com/" }, "__MaxInvalidLogin": "Time in minutes, max amount of bad logins from a source IP in the time before logins are rejected.", - "MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 } + "MaxInvalidLogin": { "time": 10, "count": 10, "coolofftime": 10 }, + "_plugins": { + "enabled": true + } }, "_domains": { "": {