Updated pcap page

This commit is contained in:
Matteo Biscosi 2025-05-09 16:35:39 +02:00
parent 6cdfca5eca
commit 11ea46db7e
15 changed files with 268 additions and 66 deletions

View file

@ -18,6 +18,9 @@ local icmp_utils = require("icmp_utils")
local application = _GET["application"]
local ip_version_or_host = _GET["flowhosts_type"]
local ifid = _GET["ifid"] or interface.getId()
local current_ifid = interface.getId()
interface.select(ifid)
if not isEmptyString(application) then
if string.starts(application, "cat_") then
@ -294,6 +297,10 @@ for _, value in ipairs(flows_stats.flows) do
rsp[#rsp + 1] = record
end
if tostring(current_ifid) ~= tostring(ifid) then
interface.select(current_ifid)
end
rest_utils.extended_answer(rest_utils.consts.success.ok, rsp, {
["recordsTotal"] = flows_stats["numFlows"]
})