mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixed nil host stats
This commit is contained in:
parent
6cd2121091
commit
8e22dd451e
1 changed files with 7 additions and 2 deletions
|
|
@ -4330,12 +4330,11 @@ function builMapHREF(host_address, vlan_id, map, default_page)
|
|||
|
||||
-- Getting stats and formatting initial href
|
||||
if(stats == nil) then
|
||||
if isMacAddress(host_address) then
|
||||
if not isMacAddress(host_address) then
|
||||
stats = interface.getHostMinInfo(host_address, vlan_id)
|
||||
host = '<a href="'..ntop.getHttpPrefix()..'/lua/host_details.lua?host='..host_address
|
||||
else
|
||||
stats = interface.getMacInfo(host_address)
|
||||
host = '<a href="'..ntop.getHttpPrefix()..'/lua/mac_details.lua?host='..host_address
|
||||
end
|
||||
|
||||
cache[host_address] = { stats = stats }
|
||||
|
|
@ -4343,6 +4342,12 @@ function builMapHREF(host_address, vlan_id, map, default_page)
|
|||
stats = stats.stats
|
||||
end
|
||||
|
||||
if not isMacAddress(host_address) then
|
||||
host = '<a href="'..ntop.getHttpPrefix()..'/lua/host_details.lua?host='..host_address
|
||||
else
|
||||
host = '<a href="'..ntop.getHttpPrefix()..'/lua/mac_details.lua?host='..host_address
|
||||
end
|
||||
|
||||
-- Adding vlan if present
|
||||
if(vlan_id and (vlan_id ~= 0)) then
|
||||
res = res .. "@"..vlan_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue