Reworks user scripts UI with new host pools

This commit is contained in:
Simone Mainardi 2020-07-09 19:12:20 +02:00
parent 9339320f87
commit 2230673eb3
11 changed files with 89 additions and 267 deletions

View file

@ -72,35 +72,6 @@ elseif(action == "clone") then
else
result.config_id = err
end
elseif(action == "set_targets") then
local targets = _POST["confset_targets"]
local subdir = _POST["script_subdir"]
if(targets == nil) then
traceError(TRACE_ERROR, TRACE_CONSOLE, "Missing 'confset_targets' parameter")
return
end
if(subdir == nil) then
traceError(TRACE_ERROR, TRACE_CONSOLE, "Missing 'script_subdir' parameter")
return
end
local targets, err = http_lint.parseConfsetTargets(subdir, targets)
if(targets ~= nil) then
-- Validation ok
local success, err = user_scripts.setConfigsetTargets(subdir, confid, targets)
result.success = success
if not success then
result.error = err
end
else
-- Validation error
result.success = false
result.error = err
end
else
traceError(TRACE_ERROR, TRACE_CONSOLE, "Unknown action '".. action .. "'")
return