Add flow alerts score column

This commit is contained in:
emanuele-f 2020-02-10 11:34:04 +01:00
parent 8044aaa3a7
commit 9d59aa67be
2 changed files with 20 additions and 2 deletions

View file

@ -46,8 +46,12 @@ end
if(tonumber(_GET["currentPage"]) == nil) then _GET["currentPage"] = 1 end
if(tonumber(_GET["perPage"]) == nil) then _GET["perPage"] = getDefaultTableSize() end
if(isEmptyString(_GET["sortColumn"]) or (_GET["sortColumn"] == "column_") or (status ~= "historical" and _GET["sortColumn"] == "column_sort")) or (status ~= "historical-flows" and _GET["sortColumn"] == "column_count") then
if status ~= "historical-flows" and _GET["sortColumn"] == "column_count" then
if(isEmptyString(_GET["sortColumn"]) or (_GET["sortColumn"] == "column_") or
(status ~= "historical" and _GET["sortColumn"] == "column_sort")) or
(status ~= "historical-flows" and _GET["sortColumn"] == "column_count") or
(status ~= "historical-flows" and _GET["sortColumn"] == "column_score") then
if(status ~= "historical-flows" and _GET["sortColumn"] == "column_count") or
(status ~= "historical-flows" and _GET["sortColumn"] == "column_score") then
tablePreferences("sort_alerts", "column_")
end
_GET["sortColumn"] = getDefaultTableSort("alerts")
@ -113,6 +117,7 @@ for _key,_value in ipairs(alerts) do
local column_severity = alertSeverityLabel(tonumber(_value["alert_severity"]))
local column_type = alertTypeLabel(tonumber(_value["alert_type"]))
local column_count = format_utils.formatValue(tonumber(_value["alert_counter"]))
local column_score = format_utils.formatValue(tonumber(_value["score"]))
local column_msg = string.gsub(formatAlertMessage(ifid, _value), '"', "'")
local column_chart = nil
@ -161,6 +166,7 @@ for _key,_value in ipairs(alerts) do
record["column_subtype"] = _value["alert_subtype"]
record["column_granularity"] = _value["alert_granularity"]
record["column_count"] = column_count
record["column_score"] = column_score
record["column_type"] = column_type
record["column_type_id"] = tonumber(_value["alert_type"])
record["column_msg"] = column_msg