mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Add query stats to alert queries
This commit is contained in:
parent
750bb8c2c0
commit
f81a45721b
10 changed files with 91 additions and 35 deletions
|
|
@ -38,7 +38,7 @@ end
|
|||
interface.select(ifid)
|
||||
|
||||
-- Fetch the results
|
||||
local alerts, recordsFiltered = network_alert_store:select_request()
|
||||
local alerts, recordsFiltered, info = network_alert_store:select_request()
|
||||
|
||||
for _, _value in ipairs(alerts or {}) do
|
||||
res[#res + 1] = network_alert_store:format_record(_value, no_html)
|
||||
|
|
@ -48,7 +48,12 @@ if no_html then
|
|||
res = network_alert_store:to_csv(res)
|
||||
rest_utils.vanilla_payload_response(rc, res, "text/csv")
|
||||
else
|
||||
rest_utils.extended_answer(rc, {records = res}, {
|
||||
local data = {
|
||||
records = res,
|
||||
stats = info,
|
||||
}
|
||||
|
||||
rest_utils.extended_answer(rc, data, {
|
||||
["draw"] = tonumber(_GET["draw"]),
|
||||
["recordsFiltered"] = recordsFiltered,
|
||||
["recordsTotal"] = #res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue