fix(dpi): Fix protocol display showing null suffix in LAN Flows
- Remove unused application field concatenation causing "TCPnull" display - Sort protocols by flow count instead of non-existent bytes field - Simplify protocol card to show protocol name and flow count only Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1fd249d19d
commit
69b5dca350
@ -171,7 +171,7 @@ return view.extend({
|
|||||||
|
|
||||||
var protocolsList = protocolsCard.querySelector('#protocols-list');
|
var protocolsList = protocolsCard.querySelector('#protocols-list');
|
||||||
var protocolsData = (protocols.protocols || []).sort(function(a, b) {
|
var protocolsData = (protocols.protocols || []).sort(function(a, b) {
|
||||||
return (b.bytes || 0) - (a.bytes || 0);
|
return (b.flows || 0) - (a.flows || 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (protocolsData.length === 0) {
|
if (protocolsData.length === 0) {
|
||||||
@ -181,21 +181,14 @@ return view.extend({
|
|||||||
} else {
|
} else {
|
||||||
protocolsData.forEach(function(proto) {
|
protocolsData.forEach(function(proto) {
|
||||||
var protoName = proto.protocol || 'Unknown';
|
var protoName = proto.protocol || 'Unknown';
|
||||||
var appName = proto.application || '';
|
var flowCount = proto.flows || 0;
|
||||||
var displayName = appName && appName !== 'Unknown' ? appName : protoName;
|
|
||||||
|
|
||||||
protocolsList.appendChild(E('div', {
|
protocolsList.appendChild(E('div', {
|
||||||
'style': 'background:#1a1a24;padding:0.75rem;border-radius:6px;margin-bottom:0.5rem;display:flex;justify-content:space-between;align-items:center;'
|
'style': 'background:#1a1a24;padding:0.75rem;border-radius:6px;margin-bottom:0.5rem;display:flex;justify-content:space-between;align-items:center;'
|
||||||
}, [
|
}, [
|
||||||
E('div', {}, [
|
E('span', { 'style': 'color:#fff;font-weight:500;' }, protoName),
|
||||||
E('span', { 'style': 'color:#fff;font-weight:500;' }, displayName),
|
|
||||||
appName && appName !== protoName ? E('span', {
|
|
||||||
'style': 'color:#808090;font-size:0.75rem;margin-left:0.5rem;'
|
|
||||||
}, '(' + protoName + ')') : null
|
|
||||||
]),
|
|
||||||
E('div', { 'style': 'text-align:right;' }, [
|
E('div', { 'style': 'text-align:right;' }, [
|
||||||
E('div', { 'style': 'color:#ffa500;font-size:0.85rem;' }, formatBytes(proto.bytes || 0)),
|
E('div', { 'style': 'color:#ffa500;font-size:0.85rem;' }, flowCount + ' flows')
|
||||||
E('div', { 'style': 'color:#808090;font-size:0.7rem;' }, (proto.flows || 0) + ' flows')
|
|
||||||
])
|
])
|
||||||
]));
|
]));
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user