mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Fixed ASN Customer Breakdown (#9618)
This commit is contained in:
parent
6a2a56754b
commit
1dd5076118
5 changed files with 27 additions and 13 deletions
|
|
@ -60,4 +60,18 @@ function as_utils.getASNConfiguration(asn)
|
|||
end
|
||||
return res
|
||||
end
|
||||
|
||||
function as_utils.getCustomerAndSubCustomerASNs()
|
||||
local res = {}
|
||||
local sub_customer_asns = as_utils.getSubCustomerASNs()
|
||||
local my_asns = as_utils.getCustomerASNs()
|
||||
for k, v in pairs(sub_customer_asns) do
|
||||
res[k] = v
|
||||
end
|
||||
for k, v in pairs(my_asns) do
|
||||
res[k] = v
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
return as_utils
|
||||
|
|
|
|||
|
|
@ -44,20 +44,20 @@ end
|
|||
-- ##########################################
|
||||
|
||||
local function format_table(sections, query, table, max_sections)
|
||||
local remote_asn = {}
|
||||
local custumer_asns = {}
|
||||
local others = {
|
||||
label = i18n("others"),
|
||||
value = 0
|
||||
}
|
||||
if query.only_costumers == true then
|
||||
if query.only_custumers == true then
|
||||
local as_utils = require "as_utils"
|
||||
remote_asn = as_utils.getRemoteASNs()
|
||||
custumer_asns = as_utils.getCustomerAndSubCustomerASNs()
|
||||
end
|
||||
for _, value in pairs(table or {}) do
|
||||
local section_ref = value[query.section_ref]
|
||||
local value_ref = tonumber(value[query.value_ref])
|
||||
if query.only_costumers == nil or query.only_costumers == false or
|
||||
(query.only_costumers == true and remote_asn[section_ref] ~= nil) then
|
||||
if query.only_custumers == nil or query.only_custumers == false or
|
||||
(query.only_custumers == true and custumer_asns[section_ref] ~= nil) then
|
||||
if values_table[section_ref] ~= nil then
|
||||
update_section(sections, section_ref, value_ref, query.section_format)
|
||||
elseif #sections <= max_sections then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue