mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Add VLAN filter (#7673)
This commit is contained in:
parent
fa045a3d4b
commit
d0fdcf6cc8
7 changed files with 243 additions and 6 deletions
|
|
@ -92,7 +92,7 @@ local isView = interface.isView()
|
|||
local x = 0
|
||||
-- Retrieve the flows
|
||||
local aggregated_info = interface.getProtocolFlowsStats(criteria_type_id, filters["page"], filters["sort_column"],
|
||||
filters["sort_order"], filters["start"], filters["length"], ternary(not isEmptyString(filters["map_search"]), filters["map_search"], nil) , ternary(filters["host"]~= "", filters["host"], nil))
|
||||
filters["sort_order"], filters["start"], filters["length"], ternary(not isEmptyString(filters["map_search"]), filters["map_search"], nil) , ternary(filters["host"]~= "", filters["host"], nil), vlan)
|
||||
|
||||
-- Formatting the data
|
||||
for _, data in pairs(aggregated_info or {}) do
|
||||
|
|
@ -110,8 +110,7 @@ for _, data in pairs(aggregated_info or {}) do
|
|||
local srv_port = nil
|
||||
|
||||
if (vlan) and
|
||||
(tonumber(vlan) ~= tonumber(data.vlan_id) or tonumber(vlan) ~= tonumber(data.cli_vlan_id) or tonumber(vlan) ~=
|
||||
tonumber(data.srv_vlan_id)) then
|
||||
(tonumber(vlan) ~= tonumber(data.vlan_id) ) then
|
||||
goto continue
|
||||
end
|
||||
|
||||
|
|
@ -201,6 +200,14 @@ for _, data in pairs(aggregated_info or {}) do
|
|||
}
|
||||
end
|
||||
|
||||
if add_server and (tonumber(vlan) ~=
|
||||
tonumber(data.srv_vlan_id)) then
|
||||
goto continue
|
||||
end
|
||||
if add_client and ( tonumber(vlan) ~= tonumber(data.cli_vlan_id)) then
|
||||
goto continue
|
||||
end
|
||||
|
||||
if (table.len(response) > 0 and response.add_info) then
|
||||
info = {
|
||||
label = data.info,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue