Implements class Paginator to better handle results

A new Paginator class has been implemented. The class
is generic in the sense that it accepts lua tables as input
in order to cofigure, for exampe, the number of results per page
and so on.
This commit is contained in:
Simone Mainardi 2016-06-09 00:23:25 +02:00
parent 63879f9635
commit 5048f0d9af
11 changed files with 382 additions and 20 deletions

View file

@ -82,7 +82,10 @@ else
end
local total = 0
local flows = interface.getFlowsInfo(host_info["host"], nil, "column_bytes", host_stats_flows_num, 0, false)
local paginfo = {["sortColumn"]="column_bytes", ["a2zSortOrder"]=false,
["maxHits"]=host_stats_flows_num, ["toSkip"]=0, ["detailedResults"]=true}
--local flows = interface.getFlowsInfo(host_info["host"], nil, "column_bytes", host_stats_flows_num, 0, false)
local flows = interface.getFlowsInfo(host_info["host"], paginfo)
flows,total = aggregateFlowsStats(flows)
for i, fl in ipairs(flows) do
flows[i] = {