mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Add missing user scripts gui labels
This commit is contained in:
parent
d5638ef278
commit
481a00a2ad
14 changed files with 112 additions and 4 deletions
|
|
@ -478,7 +478,7 @@ function user_scripts.load(ifid, script_type, subdir, options)
|
|||
end
|
||||
|
||||
if((not user_script.gui) or (not user_script.gui.i18n_title) or (not user_script.gui.i18n_description)) then
|
||||
traceError(TRACE_DEBUG, TRACE_CONSOLE, string.format("Module '%s' does not define a gui", mod_fname))
|
||||
traceError(TRACE_WARNING, TRACE_CONSOLE, string.format("Module '%s' does not define a gui", mod_fname))
|
||||
end
|
||||
|
||||
-- Augument with additional attributes
|
||||
|
|
@ -751,7 +751,13 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
local cached_config_sets = nil
|
||||
|
||||
function user_scripts.getConfigsets()
|
||||
if cached_config_sets then
|
||||
return(cached_config_sets)
|
||||
end
|
||||
|
||||
local configsets = ntop.getHashAllCache(CONFIGSETS_KEY) or {}
|
||||
local rv = {}
|
||||
|
||||
|
|
@ -763,6 +769,9 @@ function user_scripts.getConfigsets()
|
|||
end
|
||||
end
|
||||
|
||||
-- Cache to avoid loading them again
|
||||
cached_config_sets = rv
|
||||
|
||||
return(rv)
|
||||
end
|
||||
|
||||
|
|
@ -934,6 +943,25 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- Returns true if a system script is enabled for some hook
|
||||
function user_scripts.isSystemScriptEnabled(script_key)
|
||||
local configsets = user_scripts.getConfigsets()
|
||||
local default_config = user_scripts.getDefaultConfig(configsets, "system")
|
||||
local script_config = default_config[script_key]
|
||||
|
||||
if(script_config) then
|
||||
for _, hook in pairs(script_config) do
|
||||
if(hook.enabled) then
|
||||
return(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return(false)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
local default_config = {
|
||||
enabled = false,
|
||||
script_conf = {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue