Improve category editor labels and protocol navigation

This commit is contained in:
emanuele-f 2018-10-18 19:21:03 +02:00
parent 11e783bae1
commit 9f8a70e279
11 changed files with 215 additions and 101 deletions

View file

@ -15,6 +15,7 @@ local perPage = _GET["perPage"]
local sortColumn = _GET["sortColumn"]
local sortOrder = _GET["sortOrder"]
local proto_filter = _GET["l7proto"]
local category_filter = _GET["category"]
local sortPrefs = "ndpi_application_category"
@ -51,6 +52,10 @@ end
interface.select(ifname)
if category_filter ~= nil and starts(category_filter, "cat_") then
category_filter = split(category_filter, "cat_")[2]
end
local to_skip = (currentPage-1) * perPage
if(sortOrder == "desc") then sOrder = rev_insensitive else sOrder = asc_insensitive end
@ -98,6 +103,12 @@ for app, _ in pairsByValues(sorter, sOrder) do
end
end
if not isEmptyString(category_filter) then
if tostring(app.cat.id) ~= category_filter then
goto continue
end
end
cur_num = cur_num + 1
if cur_num <= to_skip then
goto continue