mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Dedup code for alert rest endpoints
This commit is contained in:
parent
3fd216e8e8
commit
e4ff578117
8 changed files with 41 additions and 50 deletions
|
|
@ -20,7 +20,6 @@ local mac_alert_store = require "mac_alert_store".new()
|
|||
--
|
||||
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
|
||||
local ifid = _GET["ifid"]
|
||||
|
||||
|
|
@ -32,6 +31,6 @@ end
|
|||
|
||||
interface.select(ifid)
|
||||
|
||||
local count_by_severity_and_time = mac_alert_store:count_by_severity_and_time()
|
||||
local res = mac_alert_store:count_by_severity_and_time_request()
|
||||
|
||||
rest_utils.answer(rc, {series = {{ data = count_by_severity_and_time, name = i18n("alerts_dashboard.alerts") }}})
|
||||
rest_utils.answer(rc, res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue