mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Fixes #4750
This commit is contained in:
parent
7ec37014f9
commit
5a455386cb
2 changed files with 7 additions and 3 deletions
|
|
@ -2287,20 +2287,25 @@ function shortenCollapse(s, max_len)
|
|||
return s
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function getHumanReadableInterfaceName(interface_name)
|
||||
local interface_id = nil
|
||||
|
||||
if(interface_name == "__system__") then
|
||||
return(i18n("system"))
|
||||
elseif tonumber(interface_name) ~= nil then
|
||||
-- convert ID to name
|
||||
interface_id = tonumber(interface_name)
|
||||
interface_name = getInterfaceName(interface_name)
|
||||
else
|
||||
-- Parameter is a string, let's take it's id first
|
||||
local interface_id = getInterfaceId(interface_name)
|
||||
interface_id = getInterfaceId(interface_name)
|
||||
-- and then get the name
|
||||
interface_name = getInterfaceName(interface_id)
|
||||
end
|
||||
|
||||
local key = 'ntopng.prefs.ifid_'..tostring(getInterfaceId(interface_name))..'.name'
|
||||
local key = 'ntopng.prefs.ifid_'..tostring(interface_id)..'.name'
|
||||
local custom_name = ntop.getCache(key)
|
||||
|
||||
if not isEmptyString(custom_name) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue