Skip to content

Commit 674e0cf

Browse files
authored
NETOBSERV-671 UI: Fields / Overview tooltips (#252)
* table fields popover * overview info * fix * addressed feedback
1 parent 8886986 commit 674e0cf

File tree

6 files changed

+172
-38
lines changed

6 files changed

+172
-38
lines changed

web/locales/en/plugin__netobserv-plugin.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
"Filter on {{name}}": "Filter on {{name}}",
168168
"Flow information": "Flow information",
169169
"Details": "Details",
170+
"More info": "More info",
170171
"Raw": "Raw",
171172
"JSON": "JSON",
172173
"Kind not managed": "Kind not managed",
@@ -246,14 +247,35 @@
246247
"Kubernetes Objects": "Kubernetes Objects",
247248
"Owner Kubernetes Objects": "Owner Kubernetes Objects",
248249
"IPs & Ports": "IPs & Ports",
250+
"The {{group}} name of the related kubernetes resource.": "The {{group}} name of the related kubernetes resource.",
249251
"Kind": "Kind",
252+
"The {{group}} kind of the related kubernetes resource. Examples:": "The {{group}} kind of the related kubernetes resource. Examples:",
253+
"Pod": "Pod",
254+
"Service": "Service",
255+
"The {{group}} owner name of the related kubernetes resource.": "The {{group}} owner name of the related kubernetes resource.",
250256
"Owner Kind": "Owner Kind",
257+
"The {{group}} owner kind of the related kubernetes resource. Examples:": "The {{group}} owner kind of the related kubernetes resource. Examples:",
258+
"Deployment": "Deployment",
259+
"StatefulSet": "StatefulSet",
260+
"DaemonSet": "DaemonSet",
261+
"Job": "Job",
262+
"CronJob": "CronJob",
263+
"The {{group}} namespace of the related kubernetes resource.": "The {{group}} namespace of the related kubernetes resource.",
264+
"The {{group}} IP address. Can be either in IPv4 or IPv6 format.": "The {{group}} IP address. Can be either in IPv4 or IPv6 format.",
251265
"Port": "Port",
266+
"The {{group}} port number.": "The {{group}} port number.",
267+
"The {{group}} MAC address.": "The {{group}} MAC address.",
268+
"The {{group}} node IP address. Can be either in IPv4 or IPv6 format.": "The {{group}} node IP address. Can be either in IPv4 or IPv6 format.",
269+
"The {{group}} name of the node running the workload.": "The {{group}} name of the node running the workload.",
252270
"Kubernetes Object": "Kubernetes Object",
253271
"Owner Kubernetes Object": "Owner Kubernetes Object",
254272
"IP & Port": "IP & Port",
255273
"Protocol": "Protocol",
274+
"The value of the protocol number in the IP packet header": "The value of the protocol number in the IP packet header",
256275
"Direction": "Direction",
276+
"The direction of the Flow observed at the Observation Point.": "The direction of the Flow observed at the Observation Point.",
277+
"The total aggregated number of bytes.": "The total aggregated number of bytes.",
278+
"The total aggregated number of packets.": "The total aggregated number of packets.",
257279
"Duration": "Duration",
258280
"Time elapsed between flow Start Time and End Time.": "Time elapsed between flow Start Time and End Time.",
259281
"Collection Time": "Collection Time",
@@ -322,13 +344,14 @@
322344
"Top {{limit}} flow rates stacked": "Top {{limit}} flow rates stacked",
323345
"bars": "bars",
324346
"Top {{limit}} flow rates stacked with total": "Top {{limit}} flow rates stacked with total",
347+
"The top rates as bar compared to total as line over the selected interval": "The top rates as bar compared to total as line over the selected interval",
325348
"Top {{limit}} flow rates": "Top {{limit}} flow rates",
326349
"lines": "lines",
327350
"Top {{limit}} average rates": "Top {{limit}} average rates",
328351
"donut": "donut",
329-
"This is the average rate over the selected interval": "This is the average rate over the selected interval",
352+
"The average rate over the selected interval": "The average rate over the selected interval",
330353
"Top {{limit}} latest rates": "Top {{limit}} latest rates",
331-
"This is the last measured rate from the selected interval": "This is the last measured rate from the selected interval",
354+
"The last measured rate from the selected interval": "The last measured rate from the selected interval",
332355
"Top {{limit}} flows distribution": "Top {{limit}} flows distribution",
333356
"sankey": "sankey",
334357
"Total rate": "Total rate",

web/src/components/netflow-record/record-panel.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,26 @@ button.borderless-accordion {
6464

6565
#pf-tab-section-details-drawer-tabs,
6666
#pf-tab-section-raw-drawer-tabs {
67-
padding: var(--pf-c-drawer--child--PaddingTop) var(--pf-c-drawer--child--PaddingRight) var(--pf-c-drawer--child--PaddingBottom) var(--pf-c-drawer--child--PaddingLeft);
67+
padding: var(--pf-c-drawer--child--PaddingTop) var(--pf-c-drawer--child--PaddingRight) var(--pf-c-drawer--child--PaddingBottom) var(--pf-c-drawer--child--PaddingLeft);
68+
}
69+
70+
h4.record-field-title,
71+
button.record-field-title-popover-button {
72+
color: inherit !important;
73+
font-weight: inherit !important;
74+
margin-bottom: 3px !important;
75+
padding: 0 !important;
76+
}
77+
78+
button.record-field-title-popover-button {
79+
background-image: linear-gradient(to right, var(--pf-c-button--m-plain--Color) 33%, rgba(255, 255, 255, 0) 0%);
80+
background-position: bottom;
81+
background-size: 3px 1px;
82+
background-repeat: repeat-x;
83+
}
84+
85+
div.record-field-popover-body,
86+
div.record-field-popover-footer {
87+
white-space: pre-line;
88+
word-break: break-word;
6889
}

web/src/components/netflow-record/record-panel.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
AccordionContent,
44
AccordionItem,
55
AccordionToggle,
6+
Button,
67
ClipboardCopy,
78
ClipboardCopyVariant,
89
Divider,
@@ -11,6 +12,7 @@ import {
1112
DrawerHead,
1213
DrawerPanelBody,
1314
DrawerPanelContent,
15+
Popover,
1416
Tab,
1517
Tabs,
1618
TabTitleText,
@@ -251,7 +253,30 @@ export const RecordPanel: React.FC<RecordDrawerProps> = ({
251253
key={c.id}
252254
data-test-id={`drawer-field-${c.id}`}
253255
>
254-
<Text component={TextVariants.h4}>{c.name}</Text>
256+
{c.tooltip ? (
257+
<Popover
258+
headerContent={c.name}
259+
bodyContent={<div className="record-field-popover-body">{c.tooltip}</div>}
260+
footerContent={
261+
c.docURL ? (
262+
<div className="record-field-popover-footer">
263+
{`${t('More info')}: `}
264+
<a href={c.docURL} target="_blank" rel="noopener noreferrer">
265+
{c.docURL}
266+
</a>
267+
</div>
268+
) : undefined
269+
}
270+
>
271+
<Button variant="plain" className="record-field-title-popover-button">
272+
<Text component={TextVariants.h4}>{c.name}</Text>
273+
</Button>
274+
</Popover>
275+
) : (
276+
<Text component={TextVariants.h4} className="record-field-title">
277+
{c.name}
278+
</Text>
279+
)}
255280
<RecordField flow={record} column={c} filter={getFilter(c)} size={'s'} useLinks={true} />
256281
</TextContent>
257282
))}

web/src/components/netflow-table/netflow-table-header.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ export const NetflowTableHeader: React.FC<{
193193
onDragEnd={clearDragEffects}
194194
modifier="wrap"
195195
style={{ width: `${Math.floor((100 * c.width) / tableWidth)}%`, minWidth: columnSizes[c.id] }}
196-
info={c.tooltip ? { tooltip: c.tooltip } : undefined}
196+
info={
197+
[ColumnsId.starttime, ColumnsId.endtime, ColumnsId.collectiontime, ColumnsId.collectionlatency].includes(
198+
c.id
199+
) && c.tooltip
200+
? { tooltip: c.tooltip }
201+
: undefined
202+
}
197203
>
198204
{headersState.useNested ? c.name : getFullColumnName(c)}
199205
</Th>

0 commit comments

Comments
 (0)