-- -- (C) 2013-17 - ntop.org -- dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path -- io.write ("Session:".._SESSION["session"].."\n") require "lua_utils" interface.select(ifname) 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') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") -- NOTE: in the home page, footer.lua checks the ntopng version -- so in case we change it, footer.lua must also be updated active_page = "home" dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") ifstats = interface.getStats() is_loopback = isLoopback(ifname) 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 -- page = _GET["page"] if(page == nil) then if(not(is_loopback)) then page = "TopFlowTalkers" else page = "TopHosts" end end if((ifstats ~= nil) and (ifstats.stats.packets > 0)) then -- Print tabbed header print('\n') if(page == "TopFlowTalkers") then print('