Fixes country flag not showing

This commit is contained in:
Matteo Biscosi 2021-04-13 10:16:46 +02:00
parent 7a527df9e2
commit 70a6d1e0e6
3 changed files with 5 additions and 8 deletions

View file

@ -346,7 +346,7 @@ end
function format_utils.formatAddressCategory(host)
local addr_category = ""
if host ~= nil then
if host ~= nil then
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,6 +376,10 @@ 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