mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
parent
20bf30946e
commit
77d458c632
2 changed files with 46 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ local alert_consts = require("alert_consts")
|
|||
sendHTTPContentTypeHeader('application/json')
|
||||
|
||||
local subdir = _GET["script_subdir"] or "host"
|
||||
local confset_id = tonumber(_GET["confset_id"] or user_scripts.DEFAULT_CONFIGSET_ID)
|
||||
local confset_id = tonumber(_GET["confset_id"])
|
||||
local script_key = _GET["script_key"]
|
||||
|
||||
local script_type = user_scripts.getScriptType(subdir)
|
||||
|
|
@ -28,7 +28,14 @@ if(script_key == nil) then
|
|||
return
|
||||
end
|
||||
|
||||
local config_set = user_scripts.getConfigsets()[confset_id]
|
||||
local config_set
|
||||
if confset_id then
|
||||
-- If confset_id has been submitted, the user-configuration is returned
|
||||
config_set = user_scripts.getConfigsets()[confset_id]
|
||||
else
|
||||
-- If no confset_id has been submitted, the factory configuration is returned
|
||||
config_set = user_scripts.getFactoryConfig()
|
||||
end
|
||||
|
||||
if(config_set == nil) then
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Unknown configset ID: " .. confset_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue