improvement on service_map page

The graph page has been set as the first page wehn a user navigates to
the service map page. When a user double clicks a node then the map will
be filtered with only the edges linked to the node. The flush data and
download buttons have been restored.
This commit is contained in:
gabryon99 2020-12-17 11:35:44 +01:00
parent 3f21f1e983
commit 5fa6e69038
6 changed files with 178 additions and 35 deletions

View file

@ -0,0 +1,27 @@
--
-- (C) 2020 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local json = require("dkjson")
local ifs = interface.getStats()
sendHTTPHeader('application/json')
local ifid = ifs.id
local REDIS_KEY = string.format("ntopng.prefs.service_map.%d.graph", ifid)
-- prepare response for the request
local res = {}
-- get the node position
local graph_view = _POST['JSON']
ntop.setPref(REDIS_KEY, graph_view)
res.success = true
res.message = "The graph view has been saved!"
print(json.encode(res))