mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixes netflow devices c++ function not working
This commit is contained in:
parent
f8600d4e9d
commit
72ced2fcfd
10 changed files with 121 additions and 74 deletions
|
|
@ -283,57 +283,6 @@ function printTrafficTypeFilterDropdown(base_url, page_params)
|
|||
</ul>]]
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function printHostsDeviceFilterDropdown(base_url, page_params)
|
||||
-- Getting probes
|
||||
local flowdevs = interface.getFlowDevices() or {}
|
||||
local ordering_fun = pairsByKeys
|
||||
local cur_dev = _GET["deviceIP"]
|
||||
local cur_dev_filter = ''
|
||||
-- table.clone needed to modify some parameters while keeping the original unchanged
|
||||
local dev_params = table.clone(page_params)
|
||||
local devips = getProbesName(flowdevs)
|
||||
local devips_order = ntop.getPref("ntopng.prefs.flow_table_probe_order") == "1" -- Order by Probe Name
|
||||
|
||||
if devips_order then
|
||||
ordering_fun = pairsByValues
|
||||
end
|
||||
|
||||
if not isEmptyString(cur_dev) then
|
||||
cur_dev_filter = '<span class="fas fa-filter"></span>'
|
||||
end
|
||||
|
||||
dev_params["deviceIP"] = nil
|
||||
|
||||
print[[, '<div class="btn-group float-right">]]
|
||||
|
||||
print[[
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.device_ip")) print[[]] print(cur_dev_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-end scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
]]print('<li><a class="dropdown-item') print(page_params.deviceIP == nil and ' active' or '') print[[" href="]] print(getPageUrl(base_url, dev_params)) print[[">]] print(i18n("flows_page.all_devices")) print[[</a></li>\]]
|
||||
for interface, device_list in pairs(devips or {}) do
|
||||
for dev_ip, dev_resolved_name in ordering_fun(device_list, asc) do
|
||||
local dev_name = dev_ip
|
||||
|
||||
dev_params["deviceIP"] = dev_name
|
||||
|
||||
if not isEmptyString(dev_resolved_name) and dev_resolved_name ~= dev_name then
|
||||
dev_name = dev_name .. " ["..shortenString(dev_resolved_name).."]"
|
||||
end
|
||||
|
||||
print[[
|
||||
<li><a class="dropdown-item ]] print(dev_ip == cur_dev and 'active' or '') print[[" href="]] print(getPageUrl(base_url, dev_params)) print[[">]] print(i18n("flows_page.device_ip").." "..dev_name) print[[</a></li>\]]
|
||||
end
|
||||
end
|
||||
|
||||
print[[
|
||||
</ul>\
|
||||
]]
|
||||
|
||||
print[[</div>']]
|
||||
end
|
||||
|
||||
function processColor(proc)
|
||||
if(proc == nil) then
|
||||
return("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue