Skip to content

Commit

Permalink
Merge pull request #8560 from DGabri/dev
Browse files Browse the repository at this point in the history
Removed shortenString from historical flow
  • Loading branch information
DGabri authored Jul 24, 2024
2 parents c2c3301 + f2eb716 commit c63f2be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion httpdocs/dist
Submodule dist updated 1 files
+2 −2 ntopng.js
1 change: 0 additions & 1 deletion scripts/lua/modules/alert_store/flow_alert_store.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,6 @@ function flow_alert_store:format_record(value, no_html, verbose)
if l4_protocol and l7_protocol and l4_protocol ~= l7_protocol then
proto_label = l4_protocol .. ":" .. l7_protocol
end

record[RNAME.L7_PROTO.name] = {
value = ternary(tonumber(value["l7_proto"]) ~= 0, value["l7_proto"], value["l7_master_proto"]) or "",
l4_label = l4_protocol or "",
Expand Down
22 changes: 11 additions & 11 deletions scripts/lua/modules/historical_flow_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ local function dt_format_l4_proto(proto)
local title = l4_proto_to_string(tonumber(proto))
local l4_proto = {
title = title,
label = shortenString(title, 12),
label = title,
value = tonumber(proto),
}

Expand Down Expand Up @@ -358,7 +358,7 @@ local function dt_format_dscp(dscp_id)

return ({
title = title,
label = shortenString(title, 20) or "",
label = title or "",
value = tonumber(dscp_id),
})
end
Expand All @@ -380,7 +380,7 @@ local function dt_format_l7_proto(l7_proto, record)
l7_proto = {
confidence = confidence,
title = title,
label = shortenString(title, 12),
label = title,
value = tonumber(l7_proto),
}
end
Expand Down Expand Up @@ -553,7 +553,7 @@ local function dt_format_flow_alert_id(flow_status)
end

record_status["title"] = stats_str
record_status["label"] = shortenString(stats_str, 32)
record_status["label"] = stats_str
record_status["value"] = flow_status
end

Expand Down Expand Up @@ -592,7 +592,7 @@ local function dt_format_l7_category(l7_category)
local title = getCategoryLabel(interface.getnDPICategoryName(tonumber(l7_category)), tonumber(l7_category))

formatted_cat["title"] = title
formatted_cat["label"] = shortenString(title, 12)
formatted_cat["label"] = title
formatted_cat["value"] = tonumber(l7_category)
end

Expand Down Expand Up @@ -781,23 +781,23 @@ end

local function simple_format_ip(value, record)
if not isEmptyString(record["HOST_LABEL"]) then
record["label"] = shortenString(record["HOST_LABEL"], 12)
record["label"] = record["HOST_LABEL"]
end
end

-- #####################################

local function simple_format_src_ip(value, record)
if not isEmptyString(record["SRC_LABEL"]) then
record["label"] = shortenString(record["SRC_LABEL"], 12)
record["label"] = record["SRC_LABEL"]
end
end

-- #####################################

local function simple_format_dst_ip(value, record)
if not isEmptyString(record["DST_LABEL"]) then
record["label"] = shortenString(record["DST_LABEL"], 12)
record["label"] = record["DST_LABEL"]
end
end

Expand All @@ -810,7 +810,7 @@ local function simple_format_asn(value, record)
if tonumber(value) == 0 then
record["label"] = "No ASN"
else
record["label"] = shortenString(ntop.getASName(ip), 12)
record["label"] = ntop.getASName(ip)
end
end
end
Expand All @@ -824,7 +824,7 @@ local function simple_format_src_asn(value, record)
if tonumber(value) == 0 then
record["label"] = "No ASN"
else
record["label"] = shortenString(ntop.getASName(ip), 12)
record["label"] = ntop.getASName(ip)
end
end
end
Expand All @@ -838,7 +838,7 @@ local function simple_format_dst_asn(value, record)
if tonumber(value) == 0 then
record["label"] = "No ASN"
else
record["label"] = shortenString(ntop.getASName(ip), 12)
record["label"] = ntop.getASName(ip)
end
end
end
Expand Down

0 comments on commit c63f2be

Please sign in to comment.