mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 19:15:03 +00:00
Impoved alert formatting
This commit is contained in:
parent
bdbf22de07
commit
681d7703c9
1 changed files with 14 additions and 4 deletions
|
|
@ -62,7 +62,7 @@ local function formatRanking(ranking, prev_ranking, verbose)
|
|||
and (ranking[id].exporter_ip == prev_ranking[id].exporter_ip)
|
||||
and (ranking[id].interface_id == prev_ranking[id].interface_id)) then
|
||||
-- nothing changed
|
||||
else
|
||||
elseif(t.exporter_ip ~= nil) then
|
||||
local ex
|
||||
local ifname
|
||||
local volume = format_utils.bytesToSize(t.value)
|
||||
|
|
@ -82,18 +82,28 @@ local function formatRanking(ranking, prev_ranking, verbose)
|
|||
ex = "[rank "..tostring(id).."] <A HREF=\""..href.."\" target=\"_blank\">"..ex .. ":" .. ifname .. "</A>"
|
||||
|
||||
if(verbose) then
|
||||
ex = "<br>" .. ex .. " (".. volume ..")</br>"
|
||||
ex = ex .. " (".. volume ..")<br>\n"
|
||||
end
|
||||
|
||||
if result == "" then
|
||||
result = ex -- set
|
||||
else
|
||||
result = result..",".. ex -- append
|
||||
if(verbose) then
|
||||
result = result.." ".. ex .. "\n" -- append
|
||||
else
|
||||
result = result..",".. ex .. "\n"-- append
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if(result == "") then result = "<>" end
|
||||
if(result == "") then
|
||||
result = "<>"
|
||||
else
|
||||
if(verbose) then
|
||||
result = "<br>" .. result
|
||||
end
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue