mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Implement API to update the user scripts configuration
This commit is contained in:
parent
d59bd0e1df
commit
9fd1ced9fd
4 changed files with 91 additions and 2 deletions
|
|
@ -1121,6 +1121,25 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function user_scripts.updateScriptConfig(confid, script_key, subdir, new_config)
|
||||
local configsets = user_scripts.getConfigsets()
|
||||
|
||||
if(configsets[confid] == nil) then
|
||||
return false, i18n("configsets.unknown_id", {confid=confid})
|
||||
end
|
||||
|
||||
local config = configsets[confid].config
|
||||
|
||||
config[subdir] = config[subdir] or {}
|
||||
config[subdir][script_key] = new_config
|
||||
|
||||
saveConfigsets(configsets)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function user_scripts.loadDefaultConfig()
|
||||
local configsets = user_scripts.getConfigsets()
|
||||
local ifid = getSystemInterfaceId()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue