mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fixed but in host matrix where a nil could happen during host name conversion
If defines, mapped symbolic interface name in interfaces menu
This commit is contained in:
parent
4dd80d4778
commit
9e0907179e
3 changed files with 12 additions and 8 deletions
|
|
@ -1465,19 +1465,19 @@ function getInterfaceNameAlias(interface_name)
|
|||
end
|
||||
end
|
||||
|
||||
function getHumanReadableInterfaceName(interface_id)
|
||||
key = 'ntopng.prefs.'..interface_id..'.name'
|
||||
function getHumanReadableInterfaceName(interface_name)
|
||||
key = 'ntopng.prefs.'..interface_name..'.name'
|
||||
custom_name = ntop.getCache(key)
|
||||
|
||||
if((custom_name ~= nil) and (custom_name ~= "")) then
|
||||
return(custom_name)
|
||||
else
|
||||
interface.select(interface_id)
|
||||
interface.select(interface_name)
|
||||
_ifstats = aggregateInterfaceStats(interface.getStats())
|
||||
|
||||
-- print(interface_id.."=".._ifstats.name)
|
||||
-- print(interface_name.."=".._ifstats.name)
|
||||
|
||||
if((interface_id ~= _ifstats.description) and (_ifstats.description ~= "PF_RING")) then
|
||||
if((interface_name ~= _ifstats.description) and (_ifstats.description ~= "PF_RING")) then
|
||||
return(_ifstats.description)
|
||||
else
|
||||
return(_ifstats.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue