Fixed performaces regarding host name into maps

This commit is contained in:
Matteo Biscosi 2021-01-12 16:41:00 +01:00
parent 753f1591e5
commit 205db16bb5

View file

@ -1476,12 +1476,7 @@ function hostinfo2label(host_info)
-- Name info from C (e.g. DHCP name)
if not isEmptyString(host_info["name"]) then
return host_info["name"]
else
local name = interface.getHostName(ip, host_info["vlan"])
if name ~= nil and not isEmptyString(name) then
return name
end
return host_info["name"]
end
-- Try to get the resolved name
@ -4042,6 +4037,7 @@ function builMapHREF(ip_address, vlan_id, map, default_page)
return(ip_address)
else
local hinfo = hostkey2hostinfo(ip_address)
hinfo["name"] = interface.getHostName(hinfo.host, hinfo.vlan)
local name = hostinfo2label(hinfo)
local res