mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +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 l7_proto = flowstats["ndpi"]
|
||||
|
||||
res.counters = {}
|
||||
for k,v in pairsByKeys(l7_proto, asc) do
|
||||
res.counters[k] = v.num_flows
|
||||
res[#res + 1] = {
|
||||
id = k,
|
||||
count = v.num_flows,
|
||||
}
|
||||
end
|
||||
|
||||
print(rest_utils.rc(rc, res))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue