mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Added support to labels and ext_labels in timeseries
This commit is contained in:
parent
abd4981023
commit
a9bc1a88ee
7 changed files with 76 additions and 33 deletions
|
|
@ -10,6 +10,7 @@ require "ntop_utils"
|
|||
local page_utils = require "page_utils"
|
||||
local json = require "dkjson"
|
||||
local template_utils = require("template_utils")
|
||||
local checks = require "checks"
|
||||
|
||||
sendHTTPContentTypeHeader('text/html')
|
||||
|
||||
|
|
@ -20,31 +21,64 @@ dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
|||
local page = _GET["page"]
|
||||
|
||||
page_utils.print_navbar(i18n("checks.network_configuration"),
|
||||
ntop.getHttpPrefix() .. "/lua/admin/network_configuration.lua", { {
|
||||
active = (page == nil or page =='assets_inventory'),
|
||||
page_name = "assets_inventory",
|
||||
label = "<i class=\"fas fa-lg fa-home\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" title=\"" ..
|
||||
i18n("checks.network_configuration") .. "\"></i>"
|
||||
}, {
|
||||
active = (page == "policy"),
|
||||
page_name = "policy",
|
||||
hidden = not ntop.isEnterpriseL(),
|
||||
label = i18n("network_configuration.network_policy")
|
||||
}})
|
||||
ntop.getHttpPrefix() .. "/lua/admin/network_configuration.lua", {{
|
||||
active = (page == nil or page == 'assets_inventory'),
|
||||
page_name = "assets_inventory",
|
||||
label = "<i class=\"fas fa-lg fa-home\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" title=\"" ..
|
||||
i18n("checks.network_configuration") .. "\"></i>"
|
||||
}, {
|
||||
active = (page == "policy"),
|
||||
page_name = "policy",
|
||||
hidden = not ntop.isEnterpriseL(),
|
||||
label = i18n("network_configuration.network_policy")
|
||||
}})
|
||||
|
||||
local context = {
|
||||
ifid = interface.getId(),
|
||||
csrf = ntop.getRandomCSRFValue()
|
||||
}
|
||||
|
||||
local json_context = json.encode(context)
|
||||
if (page == nil or page == 'assets_inventory') then
|
||||
local checks_config = checks.getConfigset()["config"]
|
||||
local interface_config = checks_config["interface"]
|
||||
local flow_config = checks_config["flow"]
|
||||
local is_check_enabled = false
|
||||
|
||||
if (flow_config) then
|
||||
-- Interface alerts
|
||||
if (flow_config["unexpected_dns"]) and (flow_config["unexpected_dns"]["all"]["enabled"]) or
|
||||
(flow_config["unexpected_ntp"]) and (flow_config["unexpected_ntp"]["all"]["enabled"]) or
|
||||
(flow_config["unexpected_smtp"]) and (flow_config["unexpected_smtp"]["all"]["enabled"]) or
|
||||
(flow_config["unexpected_gateway"]) and (flow_config["unexpected_gateway"]["all"]["enabled"]) or
|
||||
(flow_config["unexpected_dhcp"]) and (flow_config["unexpected_dhcp"]["all"]["enabled"]) then
|
||||
is_check_enabled = true
|
||||
end
|
||||
end
|
||||
|
||||
context.is_check_enabled = is_check_enabled
|
||||
local json_context = json.encode(context)
|
||||
|
||||
if (page == nil or page =='assets_inventory') then
|
||||
template_utils.render("pages/vue_page.template", {
|
||||
vue_page_name = "PageNetworkConfiguration",
|
||||
page_context = json_context
|
||||
|
||||
})
|
||||
else
|
||||
local checks_config = checks.getConfigset()["config"]
|
||||
local interface_config = checks_config["interface"]
|
||||
local flow_config = checks_config["flow"]
|
||||
local is_check_enabled = false
|
||||
|
||||
if (flow_config) then
|
||||
-- Interface alerts
|
||||
if (flow_config["host_policy"]) and (flow_config["host_policy"]["all"]["enabled"]) then
|
||||
is_check_enabled = true
|
||||
end
|
||||
end
|
||||
|
||||
context.is_check_enabled = is_check_enabled
|
||||
local json_context = json.encode(context)
|
||||
|
||||
template_utils.render("pages/vue_page.template", {
|
||||
vue_page_name = "PageNetworkPolicy",
|
||||
page_context = json_context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue