mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Return a standard json format for arrays
This commit is contained in:
parent
da44b8fb65
commit
6eec119083
8 changed files with 32 additions and 13 deletions
|
|
@ -34,9 +34,11 @@ interface.select(ifid)
|
|||
local flowstats = interface.getActiveFlowsStats()
|
||||
local l4_proto = flowstats["l4_protocols"]
|
||||
|
||||
res.counters = {}
|
||||
for k,v in pairs(l4_proto, asc) do
|
||||
res.counters[k] = v.count
|
||||
res[#res + 1] = {
|
||||
id = k,
|
||||
count = v.count,
|
||||
}
|
||||
end
|
||||
|
||||
print(rest_utils.rc(rc, res))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue