-- -- (C) 2013-24 - ntop.org -- require "os" require "lua_utils" local ts_utils = require("ts_utils_core") local template = require "template_utils" local stats_utils = require("stats_utils") local page_utils = require "page_utils" local have_nedge = ntop.isnEdge() local info = ntop.getInfo(true) local is_admin = isAdministrator() local maxSpeed local ifid = interface.getId() local _ifstats = interface.getStats() if not interface.isPcapDumpInterface() and not have_nedge then -- if the speed in not custom we try to read the speed from the interface -- and, as a final resort, we use 1Gbps if tonumber(_ifstats.speed) ~= nil then maxSpeed = tonumber(_ifstats.speed) * 1e6 else maxSpeed = 1000000000 -- 1 Gbit end end -- closes interface.isPcapDumpInterface() == false if not info.oem then -- print ([[ --
-- -- ]] -- else -- info.oem -- print[[
-- --
| ]] print(i18n("about.uptime")) print[[:
--
--
]] end local traffic_peity_width = "96" if ts_utils.getDriverName() == "influxdb" then local msg = ntop.getCache("ntopng.cache.influxdb.last_error") if not isEmptyString(msg) then print([[ ]]) end end -- Dismiss Notification Code and Toggle Dark theme print([[ ]]) -- Restart product code if (is_admin and ntop.isPackage() and not ntop.isWindows()) then print(template.gen("modal_confirm_dialog.html", { dialog = { id = 'restart-modal', action = 'restartService()', title = i18n("restart.restart_product", {product=info.product}), message = i18n("restart.confirm", {product=info.product}), custom_alert_class = 'alert alert-danger', confirm = i18n('restart.restart'), confirm_button = 'btn-danger' } })) print[[ ]] end -- render switchable system view print([[ ]]) print [[ ]]) -- ###################################### if have_nedge then print[[
]] print( template.gen("modal_confirm_dialog.html", { dialog={ id = "poweroff_dialog", action = "$('#powerOffForm').submit()", title = i18n("nedge.power_off"), message = i18n("nedge.power_off_confirm"), confirm = i18n("nedge.power_off"), } }) ) print( template.gen("modal_confirm_dialog.html", { dialog={ id = "reboot_dialog", action = "$('#rebootForm').submit()", title = i18n("nedge.reboot"), message = i18n("nedge.reboot_corfirm"), confirm = i18n("nedge.reboot"), } }) ) end print( template.gen("modal_confirm_dialog.html", { dialog={ id = "ext_link_dialog", title = i18n("external_link"), message = i18n("show_alerts.confirm_external_link"), confirm = i18n("redirect"), } }) ) print[[ ]] -- Updates submenu if hasSoftwareUpdatesSupport() then -- Updates check print[[ ]] end -- close wrapper print[[ ]]