-- -- (C) 2013-26 - ntop.org -- -- Thin shell: emits JS globals block required by legacy page scripts, -- then mounts AppShell (sidebar + topbar combined) Vue component. -- All menu/topbar data is fetched by Vue from GET /lua/rest/v2/get/ntopng/menu.lua -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path package.path = dirs.installdir .. "/scripts/lua/modules/toasts/?.lua;" .. package.path require "lua_utils" local page_utils = require "page_utils" local toasts_manager = require "toasts_manager" local template_utils = require "template_utils" local json = require "dkjson" local is_admin = isAdministrator() local session_user = _SESSION["user"] local interface_id = interface.getId() if _GET["ifid"] and tostring(_GET["ifid"]) ~= tostring(interface_id) then interface_id = tonumber(_GET["ifid"]) or interface_id end local random_csrf = ntop.getRandomCSRFValue() local is_system_interface = toboolean(page_utils.is_system_view()) local http_prefix = ntop.getHttpPrefix() -- JS globals — consumed by legacy page scripts before Vue mounts print("
") print [[ ]] local boot_context = json.encode({ csrf = random_csrf, http_prefix = http_prefix, ifid = tostring(interface_id), is_system_interface = is_system_interface, is_admin = is_admin, username = session_user, active_section = page_utils.get_active_section() or "", active_entry = page_utils.get_active_entry() or "", }) -- AppShell: sidebar + topbar template_utils.render("pages/vue_page.template", { vue_page_name = "AppShell", page_context = boot_context, }) -- Open main content area print("
") toasts_manager.render_toasts("main-container", toasts_manager.load_main_toasts()) print("
") print('') print('') print("
")