Fix switch from system to infrastructure view

This commit is contained in:
Alfredo Cardigliano 2025-01-21 09:25:06 +01:00
parent aa93ddf9f9
commit ad345874a2
2 changed files with 14 additions and 12 deletions

View file

@ -18,9 +18,15 @@ local ifstats = interface.getStats()
-- ######################################
local is_system_interface = page_utils.is_system_view()
local template = _GET["template"]
local view = _GET["view"]
if is_system_interface then
-- ######################################
local infrastructure_view = view and view == 'infrastructure' and ntop.isEnterpriseM()
local is_system_interface = page_utils.is_system_view()
if is_system_interface and not infrastructure_view then
print(ntop.httpRedirect(ntop.getHttpPrefix().."/lua/system_stats.lua"))
return
end
@ -81,7 +87,11 @@ else
end
end
local template = _GET["template"] or default_template
template = template or default_template
if infrastructure_view then
template = "infrastructure"
end
-- ######################################
@ -90,14 +100,6 @@ dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
-- ######################################
local infrastructure_view = false
local view = _GET["view"]
local infrastructure_view = view and view == 'infrastructure' and ntop.isEnterpriseM()
if infrastructure_view then
template = "infrastructure"
end
local context = {
ifid = ifid,
page = "dashboard",