From 6e6bb7287c81fce247f4eb42b0ecb79957ce3588 Mon Sep 17 00:00:00 2001 From: GabrieleDeri <33870399+DGabri@users.noreply.github.com> Date: Mon, 22 Jun 2026 18:19:15 +0200 Subject: [PATCH] Ported menu, footer and topbar to vuejs (#10480) * Ported menu, footer and topbar to vuejs * Update dist --- assets/third-party-npm.js | 3 +- attic/scripts/lua/inc/footer.lua | 874 ++++++++ attic/scripts/lua/inc/menu.lua | 1431 ++++++++++++ http_src/components/sidebar/sidebar.scss | 2 +- http_src/extensions/extensions.js | 2 +- .../views/private/clients/white-mode.scss | 2 +- http_src/vue/app-footer.vue | 316 +++ http_src/vue/app-shell.vue | 1967 +++++++++++++++++ http_src/vue/components/search-box.vue | 86 +- http_src/vue/ntop_vue.js | 12 +- httpdocs/dist | 2 +- httpdocs/misc/menu_definition.json | 774 +++++++ package.json | 5 +- scripts/locales/en.lua | 23 + scripts/lua/flow_details.lua | 2 +- scripts/lua/inc/footer.lua | 906 +------- scripts/lua/inc/menu.lua | 1307 +---------- .../lua/modules/ntopng_menu_visibility.lua | 284 +++ scripts/lua/modules/page_utils.lua | 300 +-- scripts/lua/rest/v2/get/timeseries/batch.lua | 4 + 20 files changed, 5859 insertions(+), 2443 deletions(-) create mode 100644 attic/scripts/lua/inc/footer.lua create mode 100644 attic/scripts/lua/inc/menu.lua create mode 100644 http_src/vue/app-footer.vue create mode 100644 http_src/vue/app-shell.vue create mode 100644 httpdocs/misc/menu_definition.json create mode 100644 scripts/lua/modules/ntopng_menu_visibility.lua diff --git a/assets/third-party-npm.js b/assets/third-party-npm.js index f7a9898516..4f9242a9e9 100644 --- a/assets/third-party-npm.js +++ b/assets/third-party-npm.js @@ -70,5 +70,4 @@ import * as d3v7 from "d3v7"; window.d3v7 = { ...d3v7 -}; - +}; \ No newline at end of file diff --git a/attic/scripts/lua/inc/footer.lua b/attic/scripts/lua/inc/footer.lua new file mode 100644 index 0000000000..4c4363db09 --- /dev/null +++ b/attic/scripts/lua/inc/footer.lua @@ -0,0 +1,874 @@ +-- +-- (C) 2013-26 - 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() +local http_prefix = ntop.getHttpPrefix() +local random_csrf = ntop.getRandomCSRFValue() +local is_pcap_dump_iface = interface.isPcapDumpInterface() + +if not is_pcap_dump_iface 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 is_pcap_dump_iface == false + +if not info.oem then + + -- print ([[ + --