mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Rework alerts export to provide more endpoint control
This commit is contained in:
parent
73ebd51ce6
commit
23d7a2676a
13 changed files with 275 additions and 121 deletions
|
|
@ -2320,6 +2320,7 @@ end
|
|||
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")
|
||||
|
|
@ -2331,9 +2332,9 @@ function shortenCollapse(s, max_len)
|
|||
return replacement
|
||||
end
|
||||
|
||||
if string.len(s) > max_len then
|
||||
if s_len > max_len then
|
||||
local half = math.floor((max_len-r_len) / 2)
|
||||
return string.sub(s, 1, half) .. "..." .. string.sub(s, string.len(s)-half+1)
|
||||
return string.sub(s, 1, half) .. replacement .. string.sub(s, s_len-half+1)
|
||||
end
|
||||
|
||||
return s
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue