traffic extraction jobs page to list and delete jobs, pcap download endpoint

This commit is contained in:
Alfredo Cardigliano 2018-10-16 17:29:08 +02:00
parent 7b269a28da
commit 2b565d1d63
13 changed files with 397 additions and 34 deletions

View file

@ -139,13 +139,25 @@ function dumpInterfaceStats(interface_name)
res["breed"] = stats["breeds"]
if isAdministrator() and recording_utils.isEnabled(ifstats.id) then
if recording_utils.isActive(ifstats.id) then
res["traffic_recording"] = "recording"
else
res["traffic_recording"] = "failed"
if recording_utils.isAvailable() then
if recording_utils.isEnabled(ifstats.id) then
if recording_utils.isActive(ifstats.id) then
res["traffic_recording"] = "recording"
else
res["traffic_recording"] = "failed"
end
end
if recording_utils.isEnabled(ifstats.id) then
local jobs_info = recording_utils.extractionJobsInfo(ifstats.id)
if jobs_info.ready > 0 then
res["traffic_extraction"] = "ready"
elseif jobs_info.total > 0 then
res["traffic_extraction"] = "processing"
end
end
end
end
return res
end