mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
parent
d296210aa6
commit
19edceec4c
5 changed files with 37 additions and 28 deletions
|
|
@ -24,19 +24,16 @@ if (action == nil) then
|
|||
return
|
||||
end
|
||||
|
||||
local json_data = _POST["JSON"]
|
||||
local data = json.decode(json_data)
|
||||
|
||||
local response = {
|
||||
csrf = ntop.getRandomCSRFValue()
|
||||
}
|
||||
local endpoint_conf_name = _POST["endpoint_conf_name"]
|
||||
local response = {}
|
||||
|
||||
if (action == "add") then
|
||||
response.result = notification_endpoints.add_config(data.type, data.name, data.conf_params)
|
||||
local endpoint_conf_type = _POST["endpoint_conf_type"]
|
||||
response.result = notification_endpoints.add_config(endpoint_conf_type, endpoint_conf_name, _POST)
|
||||
elseif (action == "edit") then
|
||||
response.result = notification_endpoints.edit_config(data.name, data.conf_params)
|
||||
response.result = notification_endpoints.edit_config(endpoint_conf_name, _POST)
|
||||
elseif (action == "remove") then
|
||||
response.result = notification_endpoints.delete_config(data.name)
|
||||
response.result = notification_endpoints.delete_config(endpoint_conf_name)
|
||||
else
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Invalid 'action' parameter.")
|
||||
response.success = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue