mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Host alerts migration to new api
This commit is contained in:
parent
ad5113cee0
commit
ecdf88b8a0
8 changed files with 879 additions and 532 deletions
|
|
@ -143,6 +143,23 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function pairsByField(t, field, f)
|
||||
local a = {}
|
||||
for n in pairs(t) do table.insert(a, n) end
|
||||
|
||||
table.sort(a, function(x, y) return f(t[x][field], t[y][field]) end)
|
||||
local i = 0 -- iterator variable
|
||||
local iter = function () -- iterator function
|
||||
i = i + 1
|
||||
if a[i] == nil then return nil
|
||||
else return a[i], t[a[i]]
|
||||
end
|
||||
end
|
||||
return iter
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function asc(a,b)
|
||||
return (a < b)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue