mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 17:00:10 +00:00
Possible fix for #6670
This commit is contained in:
parent
2885659195
commit
4d037e911b
4 changed files with 50 additions and 32 deletions
|
|
@ -49,6 +49,7 @@ function alert_binary_application_transfer.format(ifid, alert, alert_type_params
|
|||
|
||||
if (alert_type_params) and (alert_type_params.proto) and (alert_type_params.proto.http) and (alert_type_params.proto.http.last_url) then
|
||||
local url = alert_type_params.proto.http.last_url
|
||||
url = string.gsub(url, " ", "") -- Clean the URL from spaces and %20, spaces in html
|
||||
local href = format_external_link(url, url, false, interface.getnDPIProtoName(tonumber(alert["l7_master_proto"])))
|
||||
local type_icon = ''
|
||||
local info = ''
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ end
|
|||
|
||||
local function dt_format_info(info)
|
||||
if not isEmptyString(profile) then
|
||||
info = string.gsub(info, " ", "")
|
||||
info = formatTrafficProfile(profile) .. info
|
||||
end
|
||||
|
||||
|
|
@ -246,6 +247,30 @@ end
|
|||
|
||||
-- #####################################
|
||||
|
||||
local function dt_format_location(location)
|
||||
local location_tag = {
|
||||
label = '',
|
||||
}
|
||||
|
||||
if not location then
|
||||
return location_tag
|
||||
end
|
||||
|
||||
if(location == "0") then -- Remote
|
||||
location_tag["label"] = i18n("details.label_short_remote")
|
||||
elseif(location == "1") then -- Local
|
||||
location_tag["label"] = i18n("details.label_short_local_host")
|
||||
elseif(location == "2") then -- Multicast
|
||||
location_tag["label"] = i18n("short_multicast")
|
||||
end
|
||||
|
||||
location_tag["value"] = location
|
||||
|
||||
return location_tag
|
||||
end
|
||||
|
||||
-- #####################################
|
||||
|
||||
local function dt_format_ip(ip, name, location, prefix, record)
|
||||
local vlan_id = tonumber(record["VLAN_ID"] or "0")
|
||||
|
||||
|
|
@ -259,7 +284,6 @@ local function dt_format_ip(ip, name, location, prefix, record)
|
|||
ip = ip, -- IP address
|
||||
name = "", -- Symbolic hostname (leave empty if IP only)
|
||||
reference = hostinfo2detailshref({ip = ip, vlan = vlan_id}, nil, "<i class='fas fa-laptop'></i>", "", true, nil, false),
|
||||
location = location,
|
||||
}
|
||||
|
||||
if not isEmptyString(name) and name ~= ip then
|
||||
|
|
@ -552,32 +576,6 @@ end
|
|||
|
||||
-- #####################################
|
||||
|
||||
local function dt_format_location(location)
|
||||
local location_tag = {
|
||||
label = '',
|
||||
}
|
||||
|
||||
if not location then
|
||||
return location_tag
|
||||
end
|
||||
|
||||
location = tonumber(location or 0)
|
||||
|
||||
if(location == 0) then -- Remote
|
||||
location_tag["label"] = '<span class="badge bg-secondary">'..i18n("details.label_short_remote")..'</span>'
|
||||
elseif(location == 1) then -- Local
|
||||
location_tag["label"] = '<span class="badge bg-success">'..i18n("details.label_short_local_host")..'</span>'
|
||||
elseif(location == 2) then -- Multicast
|
||||
location_tag["label"] = "<span class='badge bg-primary'>" ..i18n("short_multicast").. "</span>"
|
||||
end
|
||||
|
||||
location_tag["value"] = location
|
||||
|
||||
return location_tag
|
||||
end
|
||||
|
||||
-- #####################################
|
||||
|
||||
local function dt_format_pool_id(id)
|
||||
local name = getPoolName(tonumber(id)) or id
|
||||
local pool_tag = {
|
||||
|
|
@ -761,7 +759,9 @@ local function dt_format_flow(processed_record, record)
|
|||
cli_ip["name"] = cli["name"] -- Host name
|
||||
cli_ip["label"] = cli["label"] -- Label - This can be shortened if required
|
||||
cli_ip["label_long"] = cli["title"] -- Label - This is not shortened
|
||||
cli_ip["reference"] = cli["reference"]
|
||||
cli_ip["reference"] = cli["reference"]
|
||||
cli_ip["location"] = dt_format_location(record["CLIENT_LOCATION"])
|
||||
|
||||
if processed_record["cli_country"] then
|
||||
cli_ip["country"] = processed_record["cli_country"]["value"]
|
||||
end
|
||||
|
|
@ -771,6 +771,8 @@ local function dt_format_flow(processed_record, record)
|
|||
srv_ip["label"] = srv["label"]
|
||||
srv_ip["label_long"] = srv["title"]
|
||||
srv_ip["reference"] = srv["reference"]
|
||||
srv_ip["location"] = dt_format_location(record["SERVER_LOCATION"])
|
||||
|
||||
if processed_record["srv_country"] then
|
||||
srv_ip["country"] = processed_record["srv_country"]["value"]
|
||||
end
|
||||
|
|
@ -1110,6 +1112,8 @@ function historical_flow_utils.get_tags()
|
|||
flow_defined_tags["snmp_interface"] = tag_utils.defined_tags["snmp_interface"]
|
||||
flow_defined_tags["country"] = tag_utils.defined_tags["country"]
|
||||
flow_defined_tags["l7_error_id"] = tag_utils.defined_tags["l7_error_id"]
|
||||
flow_defined_tags["cli_location"] = tag_utils.defined_tags["cli_location"]
|
||||
flow_defined_tags["srv_location"] = tag_utils.defined_tags["srv_location"]
|
||||
flow_defined_tags["traffic_direction"] = tag_utils.defined_tags["traffic_direction"]
|
||||
flow_defined_tags["confidence"] = tag_utils.defined_tags["confidence"]
|
||||
|
||||
|
|
@ -1347,6 +1351,7 @@ local function build_datatable_js_column_ip(name, data_name, label, order, hide)
|
|||
{name: ']] .. name .. [[', responsivePriority: 2, data: ']] .. data_name .. [[', className: 'no-wrap', render: (]] .. name .. [[, type) => {
|
||||
let html_ref = '';
|
||||
let location = '';
|
||||
debugger;
|
||||
if (type !== 'display') return ]] .. name .. [[;
|
||||
if (]] .. name .. [[ !== undefined) {
|
||||
if (]] .. name .. [[.reference !== undefined)
|
||||
|
|
|
|||
|
|
@ -5131,7 +5131,9 @@ function format_dns_query_info(dns_info)
|
|||
end
|
||||
|
||||
if dns_info.last_query then
|
||||
dns_info.last_query = i18n("external_link_url", { proto = 'https', url = dns_info["last_query"], url_name = dns_info["last_query"] })
|
||||
local url = dns_info["last_query"]
|
||||
url = string.gsub(url, " ", "") -- Clean the URL from spaces and %20, spaces in html
|
||||
dns_info.last_query = i18n("external_link_url", { proto = 'https', url = url, url_name = dns_info["last_query"] })
|
||||
end
|
||||
|
||||
return dns_info
|
||||
|
|
@ -5163,7 +5165,9 @@ function format_tls_info(tls_info)
|
|||
end
|
||||
|
||||
if tls_info.client_requested_server_name then
|
||||
tls_info["client_requested_server_name"] = i18n("external_link_url", { proto = 'https', url = tls_info["client_requested_server_name"], url_name = tls_info["client_requested_server_name"]})
|
||||
local url = tls_info["client_requested_server_name"]
|
||||
url = string.gsub(url, " ", "") -- Clean the URL from spaces and %20, spaces in html
|
||||
tls_info["client_requested_server_name"] = i18n("external_link_url", { proto = 'https', url = url, url_name = url})
|
||||
end
|
||||
|
||||
if tls_info["ja3.server_cipher"] then
|
||||
|
|
@ -5224,6 +5228,7 @@ function format_http_info(http_info)
|
|||
if string.find(http_info["last_url"], '^/') then
|
||||
url = (http_info["server_name"] or "") .. http_info["last_url"]
|
||||
end
|
||||
url = string.gsub(url, " ", "") -- Clean the URL from spaces and %20, spaces in html
|
||||
http_info["last_url"] = i18n("external_link_url", { proto = 'http', url = url, url_name = url})
|
||||
end
|
||||
|
||||
|
|
@ -5319,7 +5324,8 @@ function format_external_link(url, name, no_html, proto)
|
|||
|
||||
if no_html == false then
|
||||
if not isEmptyString(url) then
|
||||
external_field = i18n("external_link_url", { proto = proto, url = url, url_name = name})
|
||||
url = string.gsub(url, " ", "") -- Clean the URL from spaces and %20, spaces in html
|
||||
external_field = i18n("external_link_url", { proto = proto, url = url, url_name = name})
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue