Fixes #5162 missing host flag

This commit is contained in:
Matteo Biscosi 2021-04-13 11:00:01 +02:00
parent 1782734e0c
commit 05136ffb53

View file

@ -347,6 +347,10 @@ function format_utils.formatAddressCategory(host)
local addr_category = ""
if host ~= nil then
if(host["country"] and not isEmptyString(host["country"])) then
addr_category = addr_category .. " <a href='".. ntop.getHttpPrefix() .. "/lua/hosts_stats.lua?country="..host.country.."'><img src='".. ntop.getHttpPrefix() .. "/img/blank.gif' class='flag flag-".. string.lower(host.country) .."'></a>"
end
if(host["is_blacklisted"] == true) then
addr_category = addr_category .. " <i class=\'fas fa-ban fa-sm\' title=\'"..i18n("hosts_stats.blacklisted").."\'></i>"
end
@ -376,10 +380,6 @@ function format_utils.formatAddressCategory(host)
if(host["dhcpHost"] == true) then
addr_category = addr_category .. ' <i class=\"fas fa-bolt\" title=\"'..i18n("details.label_dhcp")..'\"></i>'
end
if(host["country"]) then
addr_category = addr_category .. " <a href='".. ntop.getHttpPrefix() .. "/lua/hosts_stats.lua?country="..host.country.."'><img src='".. ntop.getHttpPrefix() .. "/img/blank.gif' class='flag flag-".. string.lower(host.country) .."'></a>"
end
end
return addr_category