-- -- (C) 2013-20 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path -- io.write ("Session:".._SESSION["session"].."\n") require "lua_utils" local page_utils = require("page_utils") local is_system_interface = page_utils.is_system_view() interface.select(ifname) if (is_system_interface) then print(ntop.httpRedirect(ntop.getHttpPrefix().."/lua/system_stats.lua")) return end if(ntop.isnEdge()) then package.path = dirs.installdir .. "/pro/scripts/lua/nedge/modules/?.lua;" .. package.path local nf_config = require("nf_config"):readable() if nf_config.isFirstStart() then print(ntop.httpRedirect(ntop.getHttpPrefix().."lua/pro/nedge/system_setup/interfaces.lua")) return end end if(ntop.isPro()) then if interface.isPcapDumpInterface() == false then print(ntop.httpRedirect(ntop.getHttpPrefix().."/lua/pro/dashboard.lua")) return else -- it doesn't make sense to show the dashboard for pcap files... print(ntop.httpRedirect(ntop.getHttpPrefix().."/lua/if_stats.lua?ifid="..getInterfaceId(ifname))) return end end sendHTTPContentTypeHeader('text/html') page_utils.set_active_menu_entry(page_utils.menu_entries.traffic_dashboard) -- NOTE: in the home page, footer.lua checks the ntopng version -- so in case we change it, footer.lua must also be updated dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") ifstats = interface.getStats() is_loopback = interface.isLoopback() iface_id = interface.name2id(ifname) -- Load from or set in redis the refresh frequency for the top flow sankey refresh = _GET["refresh"] refresh_key = 'ntopng.prefs.'.._SESSION["user"]..'.'..ifname..'.top_flow_refresh' if (refresh ~= nil) then ntop.setCache(refresh_key,refresh) else refresh = ntop.getCache(refresh_key) end -- Default frequency (ms) if (refresh == '') then refresh = 5000 end -- print([[