mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Fix page_utils.is_dark_mode_enabled for backend requests
This commit is contained in:
parent
bf8782b8c0
commit
a42b38d995
1 changed files with 6 additions and 5 deletions
|
|
@ -959,12 +959,13 @@ end
|
|||
|
||||
function page_utils.is_dark_mode_enabled(theme)
|
||||
|
||||
local dark_mode
|
||||
local theme = theme or ntop.getPref("ntopng.user." .. _SESSION["user"] .. ".theme")
|
||||
local dark_mode = false
|
||||
|
||||
if (isEmptyString(theme)) then
|
||||
dark_mode = false
|
||||
else
|
||||
local user = "admin"
|
||||
if _SESSION["user"] then user = _SESSION["user"] end
|
||||
|
||||
local theme = theme or ntop.getPref("ntopng.user." .. user .. ".theme")
|
||||
if not isEmptyString(theme) then
|
||||
dark_mode = (theme == "dark")
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue