More flows and hosts filters (#1007)

* Add active flows hosts filter

* Add hosts and flows filter by IP version

* Highlight active items

* Fix Unknown protocol filter
This commit is contained in:
Emanuele Faranda 2017-03-02 19:21:43 +01:00 committed by simonemainardi
parent b6adcdcb04
commit a624cda58d
9 changed files with 298 additions and 103 deletions

View file

@ -27,6 +27,8 @@ port = _GET["port"]
application = _GET["application"]
network_id = _GET["network"]
vhost = _GET["vhost"]
flowhosts_type = _GET["flowhosts_type"]
ipversion = _GET["version"]
-- System host parameters
hosts = _GET["hosts"]
@ -98,6 +100,26 @@ if application ~= nil and application ~= "" then
--print(paginfo["l7protoFilter"].." / "..application)
end
if not isEmptyString(flowhosts_type) then
if flowhosts_type == "local_origin_remote_target" then
paginfo["clientMode"] = "local"
paginfo["serverMode"] = "remote"
elseif flowhosts_type == "local_only" then
paginfo["clientMode"] = "local"
paginfo["serverMode"] = "local"
elseif flowhosts_type == "remote_origin_local_target" then
paginfo["clientMode"] = "remote"
paginfo["serverMode"] = "local"
elseif flowhosts_type == "remote_only" then
paginfo["clientMode"] = "remote"
paginfo["serverMode"] = "remote"
end
end
if not isEmptyString(ipversion) then
paginfo["ipVersion"] = tonumber(ipversion)
end
local flows_stats = interface.getFlowsInfo(host, paginfo)
local total = flows_stats["numFlows"]
flows_stats = flows_stats["flows"]