_host_info", {
       96         hostinfo = host_info["host"],
       97         vlan = host_vlan
       98     }) .. "\n")
       99 end
      100 local host = interface.getHostInfo(host_info["host"], host_vlan)
      101 local tskey
      102 
      103 if _GET["tskey"] then
      104     tskey = _GET["tskey"]
      105 elseif host then
      106     tskey = host["tskey"]
      107 else
      108     tskey = host_key
      109 end
      110 
      111 local restoreFailed = false
      112 local restoreInProgress = false
      113 
      114 --[[
      115 -- Host restore disabled as persistency has been removed
      116 -- Note: enabling this, hosts can still be "restored" creating them with empty metadata
      117 if ((host == nil) and ((_GET["mode"] == "restore"))) then
      118     restoreFailed = not interface.restoreHost(host_info["host"], host_vlan)
      119 
      120     if (not restoreFailed) then
      121         restoreInProgress = true
      122     end
      123 end
      124 --]]
      125 
      126 -- #####################################################
      127 
      128 local function takeHistoricalBaseUrl(port)
      129     local extra_params = {
      130         srv_ip = {
      131             value = host_ip,
      132             operator = "eq"
      133         },
      134         srv_port = {
      135             value = port,
      136             operator = "eq"
      137         }
      138     }
      139     if host_vlan ~= 0 then
      140         extra_params.vlan_id = {
      141             value = host_vlan,
      142             operator = "eq"
      143         }
      144     end
      145 
      146     return add_historical_flow_explorer_button_ref(extra_params, true)
      147 end
      148 
      149 -- #####################################################
      150 
      151 local function printPort(port, proto, is_server_port)
      152     if is_server_port then
      153         local historical_base_url = takeHistoricalBaseUrl(port)
      154 
      155         if (historical_base_url and (historical_base_url ~= "")) then
      156             print('<li><A HREF="' .. historical_base_url .. '"><span class="badge bg-secondary">' .. port .. " (" ..
      157                       proto .. ")" .. "</span></A></li>\n")
      158         else
      159             print('<li><A HREF="/lua/flows_stats.lua?port=' .. port .. '"><span class="badge bg-secondary">' .. port ..
      160                       " (" .. proto .. ")" .. "</span></A></li>\n")
      161         end
      162     else
      163         print(
      164             '<li><A HREF="/lua/flows_stats.lua?port=' .. port .. '"><span class="badge bg-secondary">' .. port .. " (" ..
      165                 proto .. ")" .. "</span></A></li>\n")
      166     end
      167 end
      168 
      169 -- #####################################################
      170 
      171 local function printPorts(ports, is_server_port)
      172     if (table.len(ports) == 0) then
      173         print("<td colspan=2>" .. i18n("none") .. "</td></tr>")
      174     else
      175         local udp = {}
      176         local tcp = {}
      177         print("<th>UDP</th><th>TCP</th></tr>\n")
      178 
      179         for k, v in pairs(ports) do
      180             local res = split(k, ":")
      181 
      182             if tonumber(res[2]) then
      183                 if (res[1] == "udp") then
      184                     udp[tonumber(res[2])] = v
      185                 else
      186                     tcp[tonumber(res[2])] = v
      187                 end
      188             end
      189         end
      190 
      191         print("<tr><td valign=top><ul>")
      192         for port, proto in pairsByKeys(udp) do
      193             printPort(port, proto, is_server_port)
      194         end
      195 
      196         print("</ul></td><td valign=top><ul>")
      197         for port, proto in pa