mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix other tabs being filtered
This commit is contained in:
parent
cc1eed312b
commit
ecca16e402
1 changed files with 26 additions and 1 deletions
|
|
@ -854,6 +854,7 @@ end
|
|||
function getNumAlerts(what, options)
|
||||
local num = 0
|
||||
local opts = getUnpagedAlertOptions(options or {})
|
||||
checkFilterOptions(opts)
|
||||
local res = performAlertsQuery("SELECT COUNT(*) AS count", what, opts)
|
||||
if((res ~= nil) and (#res == 1) and (res[1].count ~= nil)) then num = tonumber(res[1].count) end
|
||||
|
||||
|
|
@ -863,7 +864,8 @@ end
|
|||
-- #################################
|
||||
|
||||
function getAlerts(what, options)
|
||||
return performAlertsQuery("SELECT rowid, *", what, options)
|
||||
local opts = checkFilterOptions(options, true)
|
||||
return performAlertsQuery("SELECT rowid, *", what, opts)
|
||||
end
|
||||
|
||||
-- #################################
|
||||
|
|
@ -942,6 +944,29 @@ end
|
|||
|
||||
-- #################################
|
||||
|
||||
-- this removes filter options for tabs which are not the active one
|
||||
function checkFilterOptions(opts, clone)
|
||||
local res
|
||||
|
||||
if clone then
|
||||
res = {}
|
||||
for k,v in pairs(opts) do res[k] = v end
|
||||
else
|
||||
res = opts
|
||||
end
|
||||
|
||||
if not isEmptyString(_GET["status"]) then
|
||||
if _GET["status"] ~= what then
|
||||
res.alert_severity = nil
|
||||
res.alert_type = nil
|
||||
end
|
||||
end
|
||||
|
||||
return res
|
||||
end
|
||||
|
||||
-- #################################
|
||||
|
||||
function checkDeleteStoredAlerts()
|
||||
if((_GET["csrf"] ~= nil) and (_GET["status"] ~= nil)) then
|
||||
local delete_params = UrlToalertsQueryParameters(_GET)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue