mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Implements additional plugin hooks
The following plugin hooks have been implemented onEnable(hook, hook_config) onDisable(hook, hook_config) onUpdateConfig(hook, hook_config) onLoad(hook, hook_config) onUnload(hook, hook_config) Documentation is part of the commit. Implements #4451 Implements #4453 Implements #4454 Implements #4455
This commit is contained in:
parent
f83ccb70d5
commit
3ad4522e45
5 changed files with 146 additions and 40 deletions
|
|
@ -234,11 +234,6 @@ end
|
|||
local function load_plugin_file(full_path)
|
||||
local res = dofile(full_path)
|
||||
|
||||
if res and res.onLoad then
|
||||
-- Execute method onload, if available
|
||||
res.onLoad()
|
||||
end
|
||||
|
||||
return res
|
||||
end
|
||||
|
||||
|
|
@ -403,7 +398,11 @@ local function load_plugin_alert_endpoints(plugin)
|
|||
-- Execute the alert endpoint and call its method onLoad, if present
|
||||
local fname_path = os_utils.fixPath(endpoints_path .. "/" .. fname)
|
||||
local endpoint = load_plugin_file(fname_path)
|
||||
|
||||
|
||||
if endpoint and endpoint.onLoad then
|
||||
endpoint.onLoad()
|
||||
end
|
||||
|
||||
if not file_utils.copy_file(fname, endpoints_path, RUNTIME_PATHS.alert_endpoints) then
|
||||
return false
|
||||
end
|
||||
|
|
@ -620,7 +619,7 @@ function plugins_utils.loadPlugins(community_plugins_only)
|
|||
|
||||
-- Reload user scripts with their configurations
|
||||
local user_scripts = require "user_scripts"
|
||||
user_scripts.reloadUserScripts()
|
||||
user_scripts.loadUnloadUserScripts(true --[[ load --]])
|
||||
|
||||
return(true)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue