fixed notification keys set (#4662)

This commit is contained in:
gabryon99 2020-11-02 11:02:34 +01:00
parent 27ede60ea5
commit ee4733e2ed
8 changed files with 49 additions and 65 deletions

View file

@ -10,7 +10,7 @@ local page_utils = require("page_utils")
local template = require("template_utils")
local defined_notifications = require("defined_notifications")
local MAX_NOTIFICATIONS_TO_DISPLAY = 3
local MAX_NOTIFICATIONS_TO_DISPLAY = 2
-- Redis Key used to store the notification status
local REDIS_KEY = "ntopng.user.%s.dismissed_notifications.notification_%d"
@ -28,7 +28,7 @@ function notifications_manager.load_main_notifications()
local current_page = page_utils.get_active_entry()
local curent_subpage = _GET['page']
for _, notification in ipairs(defined_notifications) do
for _, notification in pairsByField(defined_notifications, 'id', asc) do
-- We can only show MAX_NOTIFICATIONS_TO_DISPLAY notifications inside the page,
-- in order to not overwhelm the user