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

@ -4002,6 +4002,33 @@ function buildHostHREF(ip_address, vlan_id, page)
end
end
function builServiceMapHREF(ip_address, vlan_id)
local stats = cache[ip_address]
if(stats == nil) then
stats = interface.getHostInfo(ip_address, vlan_id)
cache[ip_address] = { stats = stats }
else
stats = stats.stats
end
if(stats == nil) then
return(ip_address)
else
local name = stats.name
local res
if((name == nil) or (name == "")) then name = ip_address end
res = '<a href="'..ntop.getHttpPrefix()..'/lua/service_map.lua?host='..ip_address
if(vlan_id and (vlan_id ~= 0)) then res = res .. "@"..vlan_id end
res = res ..'&page=graph">'..name..'</A>'
return(res)
end
end
--
-- IMPORTANT
-- Leave it at the end so it can use the functions