ntopng/scripts/lua/as_overview.lua
2025-07-02 10:36:19 +02:00

45 lines
1.4 KiB
Lua

--
-- (C) 2013-24 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local json = require("dkjson")
local page_utils = require("page_utils")
local template_utils = require "template_utils"
local asn = _GET["asn"]
local a = interface.getASInfo(tonumber(asn))
local asn_name = asn
sendHTTPContentTypeHeader('text/html')
page_utils.print_header_and_set_active_menu_entry(page_utils.menu_entries.autonomous_systems)
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
if a then
asn_name = a.asname
end
page_utils.print_navbar(i18n("as_overview.asn",{asn=asn, asn_name = asn_name}), ntop.getHttpPrefix() .. "/lua/as_overview.lua", {{
active = true,
page_name = "overview",
label = "<i class=\"fas fa-lg fa-home\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" title=\"" ..
i18n("as_overview.asn",{asn=asn, asn_name = asn_name}) .. "\"></i>"
}, {
url = ntop.getHttpPrefix() .. "/lua/hosts_stats.lua?asn=" .. asn .. "",
active = page == "asn_hosts",
page_name = "asn_hosts",
label = i18n("as_overview.asn_hosts")
}})
template_utils.render("pages/vue_page.template", {
vue_page_name = "PageAsOverview",
page_context = json.encode({
csrf = ntop.getRandomCSRFValue(),
ifid = interface.getId()
})
})
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")