Skip to content

Commit

Permalink
NETOBSERV-1992: explain partial flows [backport 1.8] (#704)
Browse files Browse the repository at this point in the history
* NETOBSERV-1992: explain partial flows

* format
  • Loading branch information
jotak authored Jan 31, 2025
1 parent 13cab91 commit 3468c48
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/locales/en/plugin__netobserv-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"Switch {{name}} option": "Switch {{name}} option",
"Conversation event information": "Conversation event information",
"Flow information": "Flow information",
"This is a partial flow: it contains only enrichment data and is missing some basic information such as byte and packet counters, TCP flags or MAC addresses. This information can likely be found in adjacent flows.": "This is a partial flow: it contains only enrichment data and is missing some basic information such as byte and packet counters, TCP flags or MAC addresses. This information can likely be found in adjacent flows.",
"More info": "More info",
"Raw": "Raw",
"JSON": "JSON",
Expand Down
11 changes: 10 additions & 1 deletion web/src/components/drawer/record/record-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,13 @@ div.record-field-popover-body,
div.record-field-popover-footer {
white-space: pre-line;
word-break: break-word;
}
}

.record-panel-warning {
color: #2B9AF3;
margin-right: 5px;
}

#partial-flow-text {
margin-bottom: 10px;
}
11 changes: 11 additions & 0 deletions web/src/components/drawer/record/record-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
TextContent,
TextVariants
} from '@patternfly/react-core';
import { InfoCircleIcon } from '@patternfly/react-icons';
import _ from 'lodash';
import * as React from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -342,6 +343,8 @@ export const RecordPanel: React.FC<RecordDrawerProps> = ({
)
);

const isPartialFlow = !record.fields.Bytes && !record.fields.Packets;

return (
<DrawerPanelContent
data-test-id={id}
Expand Down Expand Up @@ -370,6 +373,14 @@ export const RecordPanel: React.FC<RecordDrawerProps> = ({
role="region"
>
<Tab className="drawer-tab" eventKey={'details'} title={<TabTitleText>{t('Details')}</TabTitleText>}>
{isPartialFlow && (
<Text id="partial-flow-text" component={TextVariants.p}>
<InfoCircleIcon className="record-panel-warning" />
{t(
'This is a partial flow: it contains only enrichment data and is missing some basic information such as byte and packet counters, TCP flags or MAC addresses. This information can likely be found in adjacent flows.'
)}
</Text>
)}
<Accordion asDefinitionList={false}>
{groups.map((g, i) =>
getGroup(
Expand Down

0 comments on commit 3468c48

Please sign in to comment.