mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fixes periodicity changed description (#8853)
This commit is contained in:
parent
5faffe64bc
commit
a514dc9cdb
2 changed files with 6 additions and 32 deletions
|
|
@ -52,38 +52,12 @@ end
|
|||
-- @param alert_type_params Table `alert_type_params` as built in the `:init` method
|
||||
-- @return A human-readable string
|
||||
function alert_periodicity_changed.format(ifid, alert, alert_type_params)
|
||||
-- Extracting info field
|
||||
local info = ""
|
||||
local href = ""
|
||||
local flow_infos = {
|
||||
host = alert["cli_ip"],
|
||||
l7proto = ternary(tonumber(alert["l7_proto"]) ~= 0, alert["l7_proto"], alert["l7_master_proto"]),
|
||||
vlan_id = alert["vlan_id"]
|
||||
}
|
||||
local is_periodic = alert_type_params.is_periodic or false
|
||||
|
||||
if alert.json then
|
||||
info = json.decode(alert["json"])
|
||||
if not isEmptyString(info["info"]) then
|
||||
info = "[" .. info["info"] .. "]"
|
||||
else
|
||||
info = ""
|
||||
end
|
||||
end
|
||||
|
||||
if ntop.isEnterprise() and ntop.isAdministrator() then
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/pro/scripts/lua/enterprise/modules/?.lua;" .. package.path
|
||||
local graph_map_utils = require("graph_map_utils")
|
||||
|
||||
href = '<a href="' .. graph_map_utils.getMapUrl(flow_infos, interface.getId(), 'periodicity_map', 'graph') .. '"><i class="fas fa-lg fa-clock"></i></a>'
|
||||
end
|
||||
|
||||
if alert_type_params.is_periodic then
|
||||
return(i18n("alerts_dashboard.periodicity_is_periodic_descr", { info = info, href = href }))
|
||||
elseif alert_type_params.is_aperiodic then
|
||||
return(i18n("alerts_dashboard.periodicity_is_aperiodic_descr", { info = info, href = href }))
|
||||
if is_periodic then
|
||||
return(i18n("alerts_dashboard.periodicity_is_periodic_descr"))
|
||||
else
|
||||
return(i18n("alerts_dashboard.periodicity_changed_descr", { info = info, href = href }))
|
||||
return(i18n("alerts_dashboard.periodicity_is_aperiodic_descr"))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue