mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
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.
27 lines
594 B
Lua
27 lines
594 B
Lua
--
|
|
-- (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))
|