[VS] Add badge for in progress scans (#8008)

This commit is contained in:
Nicolo Maio 2023-11-10 13:06:15 +01:00
parent 9ad2291aee
commit 41bdec5489
2 changed files with 11 additions and 1 deletions

View file

@ -5,6 +5,7 @@
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/vulnerability_scan/?.lua;" .. package.path
-- trace_script_duration = true
@ -15,6 +16,7 @@ local callback_utils = require("callback_utils")
local recording_utils = require("recording_utils")
local rest_utils = require("rest_utils")
local auth = require "auth"
local vs_utils = require "vs_utils"
--
-- Read information about an interface
@ -301,7 +303,10 @@ function dumpBriefInterfaceStats(ifid)
res["drops"] = ifstats.stats_since_reset.drops
res["throughput_bps"] = ifstats.stats.throughput_bps;
if (vs_utils.is_available()) then
local total, total_in_progress = vs_utils.check_in_progress_status()
res["vs_in_progress"] = total_in_progress or 0
end
if prefs.is_dump_flows_enabled == true then
res["flow_export_drops"] = ifstats.stats_since_reset.flow_export_drops
res["flow_export_count"] = ifstats.stats_since_reset.flow_export_count