mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-04 09:50:09 +00:00
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:
parent
3f21f1e983
commit
5fa6e69038
6 changed files with 178 additions and 35 deletions
27
scripts/lua/service_map_handler.lua
Normal file
27
scripts/lua/service_map_handler.lua
Normal 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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue