mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Removed and fixes some dependencies
This commit is contained in:
parent
4b0767ca2e
commit
e597e83e15
22 changed files with 641 additions and 1078 deletions
|
|
@ -579,31 +579,6 @@ function aggregatePie(values, values_sum, edge, min_col)
|
|||
return aggr
|
||||
end
|
||||
|
||||
-- #################################
|
||||
|
||||
-- This function actively resolves an host if there is not information about it.
|
||||
-- NOTE: prefer the host2name on this function
|
||||
function resolveAddress(hostinfo, allow_empty, shorten_len)
|
||||
local alt_name = ip2label(hostinfo["host"], hostinfo["vlan"], shorten_len)
|
||||
|
||||
if(not isEmptyString(alt_name) and (alt_name ~= hostinfo["host"])) then
|
||||
-- The host label has priority
|
||||
return(alt_name)
|
||||
end
|
||||
|
||||
local hostname = ntop.resolveName(hostinfo["host"])
|
||||
if isEmptyString(hostname) then
|
||||
-- Not resolved
|
||||
if allow_empty == true then
|
||||
return hostname
|
||||
else
|
||||
-- this function will take care of formatting the IP
|
||||
return hostinfo2label(hostinfo, true, shorten_len)
|
||||
end
|
||||
end
|
||||
return hostinfo2label(hostinfo, true, shorten_len)
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
||||
function computeL7Stats(stats, show_breed, show_ndpi_category)
|
||||
|
|
@ -1025,32 +1000,6 @@ function setInterfaceRegreshRate(ifid, refreshrate)
|
|||
end
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
-- "Some Very Long String" -> "Some Ver...g String"
|
||||
function shortenCollapse(s, max_len)
|
||||
local replacement = "..."
|
||||
local r_len = string.len(replacement)
|
||||
local s_len = string.len(s)
|
||||
|
||||
if max_len == nil then
|
||||
max_len = ntop.getPref("ntopng.prefs.max_ui_strlen")
|
||||
max_len = tonumber(max_len)
|
||||
if(max_len == nil) then max_len = 24 end
|
||||
end
|
||||
|
||||
if max_len <= r_len then
|
||||
return replacement
|
||||
end
|
||||
|
||||
if s_len > max_len then
|
||||
local half = math.floor((max_len-r_len) / 2)
|
||||
return string.sub(s, 1, half) .. replacement .. string.sub(s, s_len-half+1)
|
||||
end
|
||||
|
||||
return s
|
||||
end
|
||||
|
||||
-- ###############################################
|
||||
|
||||
-- prints purged information for hosts / flows
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue