mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Updated for network configuration page
This commit is contained in:
parent
dfc25260f7
commit
342ead97c2
4 changed files with 30 additions and 34 deletions
|
|
@ -15,27 +15,11 @@ local post_data = _POST["payload"]
|
|||
|
||||
local res = {}
|
||||
|
||||
local config = _POST["config"]
|
||||
tprint(_POST)
|
||||
local payload = _POST["payload"]
|
||||
local data = json.decode(payload)
|
||||
|
||||
local data = json.decode(config)
|
||||
|
||||
-- data is:
|
||||
--[[
|
||||
asset_key = [ "gateway", "unexpected_dhcp", "unexpected_dns", "unexpected_ntp", "unexpected_smtp"]
|
||||
|
||||
{ "csrf":..., "config": [ {"asset_key": asset_key, "item": [ip1, ip2, ip3...]}, {"asset_key": asset_key_1, "item": [ip1, ip2, ip3...]}]}
|
||||
]]
|
||||
|
||||
-- local script_key = post_data["asset_key"] -- asset_key
|
||||
-- local redis_key = "ntopng.prefs." .. script_key .. "_ip_list"
|
||||
|
||||
-- for each element in respone: ntop.getCache(redis_key)
|
||||
|
||||
if isEmptyString(ifid) then
|
||||
rest_utils.answer(rest_utils.consts.err.invalid_interface)
|
||||
return
|
||||
for k,v in pairs(data.config) do
|
||||
ntop.setCache("ntopng.prefs.nw_config_".. v.key, v.value)
|
||||
end
|
||||
|
||||
|
||||
rest_utils.answer(rest_utils.consts.success.ok, res)
|
||||
rest_utils.answer(rest_utils.consts.success.ok, res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue