Add back end autorefresh support. (#7733)

This commit is contained in:
Nicolo Maio 2023-08-05 00:37:43 +02:00
parent e019554856
commit e752919067
4 changed files with 63 additions and 10 deletions

View file

@ -320,6 +320,27 @@ end
-- **********************************************************
-- Function to retrieve hosts list to scan just for status_info
function vs_utils.check_in_progress_status()
local res_string = ntop.getCache(host_to_scan_key)
if not isEmptyString(res_string) and res_string ~= "[[]]" and res_string ~= "[]" then
local hosts_to_scan_details = json.decode(res_string) or {}
if hosts_to_scan_details then
for _,value in ipairs(hosts_to_scan_details) do
-- Check IN PROGRESS --> FIX ME with enums
if value.is_ok_last_scan == 4 then
return true
end
end
end
end
return false
end
-- **********************************************************
-- Function to retrieve last host scan result
function vs_utils.retrieve_hosts_scan_result(scan_type, host)
local path = get_report_path(scan_type, host)