irsByKeys(tcp) do
      198             printPort(port, proto, is_server_port)
      199         end
      200         print("</td></tr>\n")
      201     end
      202 end
      203 
      204 -- #####################################################
      205 
      206 local function formatContacts(v)
      207     if not v then
      208         return ""
      209     end
      210 
      211     if (v > 5) then
      212         return ("<font color=red><b>" .. formatValue(v) .. "</b></font>")
      213     else
      214         return (formatValue(v))
      215     end
      216 end
      217 
      218 -- #####################################################
      219 
      220 local function scoreBreakdown(what)
      221     local score_category_network = what[0]
      222     local score_category_security = what[1]
      223     local tot = score_category_network + score_category_security
      224 
      225     if (tot > 0) then
      226         score_category_network = (score_category_network * 100) / tot
      227         score_category_security = 100 - score_category_network
      228 
      229         print('<span class="progress w-100 ms-1"><span class="progress-bar bg-warning" style="width: ' ..
      230                   score_category_network .. '%;">' .. i18n("flow_details.score_category_network"))
      231         print('</span><span class="progress-bar bg-success" style="width: ' .. score_category_security .. '%;">' ..
      232                   i18n("flow_details.score_category_security") .. '</span></span>\n')
      233     else
      234         print("&nbsp;")
      235     end
      236 end
      237 
      238 -- #####################################################
      239 
      240 local function printRestoreHostBanner(hidden)
      241     print('<div id=\"host_purged\" class=\"alert alert-danger\" ')
      242     if hidden then
      243         print('style=\"display:none;\"')
      244     end
      245     print('><i class="fas fa-exclamation-triangle"></i>')
      246     print [[<form class="form-inline" id="host_restore_form" method="get">]]
      247     print [[<input type="hidden" name="mode" value="restore">
      248    <input type="hidden" name="host" value="]]
      249     print(host_info["host"])
      250     print [[">]]
      251     if ((host_info["vlan"] ~= nil) and ifstats.vlan) then
      252         print [[<input type="hidden" name="vlan" value="]]
      253         print(tostring(host_info["vlan"]))
      254         print [[">]]
      255     end
      256     print [[</form>]]
      257     print [[ ]]
      258     print(i18n("host_details.restore_from_cache_message_v1", {
      259         host = hostinfo2hostkey(host_info),
      260         js_code = "\"javascript:void(0);\" onclick=\"$(\'#host_restore_form\').submit();\""
      261     }))
      262     print("</div>")
      263 end
      264 
      265 local host_pool_id = nil
      266 
      267 if (host ~= nil) then
      268     charts_available = charts_available and host["localhost"] and not host["is_multicast"]
      269 
      270     if (isAdministrator() and (_POST["pool"] ~= nil)) then
      271         host_pool_id = _POST["pool"]
      272         local prev_pool = tostring(host["host_pool_id"])
      273 
      274         if host_pool_id ~= prev_pool then
      275             local key = host2member(host["ip"], host["vlan"])
      276             if not host_pools_instance:bind_member(key, tonumber(host_pool_id)) then
      277                 host_pool_id = nil
      278             else
      279                 ntop.reloadHostPools()
      280             end
      281         end
      282 
      283     end
      284 
      285     if (host_pool_id == nil) then
      286         host_pool_id = tostring(host["host_pool_id"])
      287     end
      288 end
      289 
      290 local only_historical = (host == nil) and ((page == "historical") or (page == "config"))
      291 local h