Added per user theme (#5539)

This commit is contained in:
MatteoBiscosi 2021-06-21 15:37:08 +02:00
parent 4e048b6433
commit 9023c0538a
6 changed files with 27 additions and 22 deletions

View file

@ -259,7 +259,7 @@ end
function page_utils.is_dark_mode_enabled(theme)
local dark_mode
local theme = theme or ntop.getPref("ntopng.prefs.theme")
local theme = theme or ntop.getPref("ntopng.user." .. _SESSION["user"] .. ".theme")
if (isEmptyString(theme)) then
dark_mode = false
@ -582,7 +582,7 @@ function page_utils.print_menubar()
logo_path = ntop.getHttpPrefix().."/img/custom_logo.png"
end
local navbar_style = _POST["toggle_theme"] or ntop.getPref("ntopng.prefs.theme")
local navbar_style = _POST["toggle_theme"] or ntop.getPref("ntopng.user." .. _SESSION["user"] .. ".theme")
if ((navbar_style == nil) or (navbar_style == "")) then
navbar_style = "default"