Adds numFlows to flows retrieval for proper pagination

numFlows was suppressed in an earlier commit but this caused
issues with pagination of results.
This commit is contained in:
Simone Mainardi 2016-08-25 18:30:27 +02:00
parent 01172f94fc
commit fe5c6377aa
17 changed files with 48 additions and 30 deletions

View file

@ -62,7 +62,9 @@ if(sortOrder == nil) then
end
interface.select(ifname)
flows_stats = interface.getFlowsInfo()
local flows_stats = interface.getFlowsInfo()
local total = flows_stats["numFlows"]
flows_stats = flows_stats["flows"]
if (mode == "table") then
print ("{ \"currentPage\" : " .. currentPage .. ",\n \"data\" : [\n")
@ -70,12 +72,11 @@ if (mode == "table") then
end
total = 0
processes = {}
vals = {}
num = 0
for _key, value in pairs(flows_stats) do
for _key, value in ipairs(flows_stats) do
p = flows_stats[_key]
process = 1
client_process = 1
@ -283,7 +284,6 @@ if (mode == "table") then
end
end
total = total + 1
end -- for