Added country to alert detail view

This commit is contained in:
MatteoBiscosi 2022-05-25 13:22:39 +02:00
parent 6921aa9dce
commit 7b99fc17b8

View file

@ -1861,7 +1861,7 @@ end
-- #####################################
function historical_flow_utils.getHistoricalFlowLabel(record, add_hyperlinks, add_hostnames)
function historical_flow_utils.getHistoricalFlowLabel(record, add_hyperlinks, add_hostnames, add_country_flags)
local label = ""
local info = historical_flow_utils.format_clickhouse_record(record)
@ -1877,6 +1877,10 @@ function historical_flow_utils.getHistoricalFlowLabel(record, add_hyperlinks, ad
label = label ..historical_flow_utils.get_historical_url(info.cli_ip.ip, "cli_ip", info.cli_ip.ip, add_hyperlinks, nil)
end
if info.cli_country and not isEmptyString(info.cli_country.value) then
label = label .. ' <img src="' + ntop.getHttpPrefix() + '/dist/images/blank.gif" class="flag flag-' + string.lower(info.cli_country.value) + '">'
end
if add_hyperlinks and info.cli_location and not isEmptyString(info.cli_location.label) then
label = label .. " " .. info.cli_location.label
end
@ -1913,6 +1917,10 @@ function historical_flow_utils.getHistoricalFlowLabel(record, add_hyperlinks, ad
label = label ..historical_flow_utils.get_historical_url(info.srv_ip.ip, "srv_ip", info.srv_ip.ip, add_hyperlinks, nil)
end
if info.srv_country and not isEmptyString(info.srv_country.value) then
label = label .. ' <img src="' .. ntop.getHttpPrefix() .. '/dist/images/blank.gif" class="flag flag-' .. string.lower(info.srv_country.value) .. '">'
end
if add_hyperlinks and info.srv_location and not isEmptyString(info.srv_location.label) then
label = label .. " " .. info.srv_location.label
end