--
-- (C) 2013-16 - ntop.org
--
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
if ( (dirs.scriptdir ~= nil) and (dirs.scriptdir ~= "")) then package.path = dirs.scriptdir .. "/lua/modules/?.lua;" .. package.path end
require "lua_utils"
require "prefs_utils"
if (ntop.isPro()) then
package.path = dirs.installdir .. "/scripts/lua/pro/?.lua;" .. package.path
require "report_utils"
end
sendHTTPHeader('text/html; charset=iso-8859-1')
if(haveAdminPrivileges()) then
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
active_page = "admin"
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
prefs = ntop.getPrefs()
print [[
Runtime Preferences
]]
subpage_active = _GET["subpage_active"]
report_active = ""
in_memory_active = ""
on_disk_rrds_active = ""
on_disk_dbs_active = ""
nbox_active = ""
alerts_active = ""
users_active = ""
logging_active = ""
if (subpage_active == nil or subpage_active == "") then
subpage_active = "users"
end
if (subpage_active == "report") then
report_active = "active"
end
if (subpage_active == "in_memory") then
in_memory_active = "active"
end
if (subpage_active == "on_disk_rrds") then
on_disk_rrds_active = "active"
end
if (subpage_active == "on_disk_dbs") then
on_disk_dbs_active = "active"
end
if (subpage_active == "nbox") then
nbox_active = "active"
end
if (subpage_active == "alerts") then
if not prefs.has_cmdl_disable_alerts then
alerts_active = "active"
else
report_active = "active" -- default
end
end
if (subpage_active == "users") then
users_active = "active"
end
if (subpage_active == "logging") then
if not prefs.has_cmdl_trace_lvl then
logging_active = "active"
else
-- cannot change logging level when it has been specified from the command line
report_active = "active" -- default
end
end
-- ================================================================================
function printReportVisualization()
print(' ]]
end
-- ================================================================================
function printTopTalkers()
print(' ]]
end
-- ================================================================================
function printStatsDatabases()
print(' ]]
end
-- ================================================================================
function printAlerts()
if prefs.has_cmdl_disable_alerts then return end
print(' ]]
end
-- ================================================================================
function printNbox()
print(' ]]
end
-- ================================================================================
function printUsers()
print('
]]
end
-- ================================================================================
function printInMemory()
print(' ]]
end
-- ================================================================================
function printStatsRrds()
print(' ]]
end
-- ================================================================================
function printLogging()
if prefs.has_cmdl_trace_lvl then return end
print('