mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Finalized active monitoring page
This commit is contained in:
parent
355e0d355f
commit
ddc6ce921a
10 changed files with 218 additions and 32 deletions
|
|
@ -368,6 +368,26 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- This function set the interface alias, return true if the
|
||||
-- alias is set, false otherwise
|
||||
function setInterfaceAlias(iface, alias)
|
||||
local ok = true
|
||||
|
||||
if (isEmptyString(iface)) then
|
||||
ok = false
|
||||
end
|
||||
|
||||
if (ok and (iface ~= alias) and not isEmptyString(alias)) then
|
||||
ntop.setCache(getInterfaceAliasKey(iface), alias)
|
||||
else
|
||||
ok = false
|
||||
end
|
||||
|
||||
return ok
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function getLocalNetworkAliasKey()
|
||||
return "ntopng.network_aliases"
|
||||
end
|
||||
|
|
@ -380,6 +400,15 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function getInterfaceAlias(ifid)
|
||||
if not ifid or not tonumber(ifid) then
|
||||
return ""
|
||||
end
|
||||
return ntop.getCache("ntopng.prefs.ifid_" .. tostring(ifid) .. ".name") or ""
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function getLocalNetworkAliasById(network)
|
||||
local network_consts = require "network_consts"
|
||||
|
||||
|
|
@ -564,8 +593,7 @@ function getHumanReadableInterfaceName(interface_name)
|
|||
interface_name = getInterfaceName(interface_id)
|
||||
end
|
||||
|
||||
local key = 'ntopng.prefs.ifid_' .. tostring(interface_id) .. '.name'
|
||||
local custom_name = ntop.getCache(key)
|
||||
local custom_name = getInterfaceAlias(interface_id)
|
||||
|
||||
if not isEmptyString(custom_name) then
|
||||
return (shortenCollapse(custom_name))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue