Skip to content

Commit 7290c5d

Browse files
committed
Added last refresh tooltip
1 parent ea50c07 commit 7290c5d

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

web/locales/en/plugin__network-observability-plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
"{{count}} packets": "{{count}} packets",
168168
"{{count}} packets_plural": "{{count}} packets",
169169
"Filtered average speed": "Filtered average speed",
170-
"last refresh: {{time}}": "last refresh: {{time}}",
170+
"Last refresh: {{time}}": "Last refresh: {{time}}",
171171
"{{count}} IP(s)": "{{count}} IP(s)",
172172
"{{count}} IP(s)_plural": "{{count}} IP(s)",
173173
"{{count}} Port(s)": "{{count}} Port(s)",

web/src/components/query-summary/__tests__/query-summary.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('<QuerySummary />', () => {
2929
expect(wrapper.find('#bytesCount').last().text()).toBe('161 kB');
3030
expect(wrapper.find('#packetsCount').last().text()).toBe('1100 packets');
3131
expect(wrapper.find('#bpsCount').last().text()).toBe('538 Bps');
32-
expect(wrapper.find('#lastRefresh').last().text()).toBe('last refresh: ' + now.toLocaleTimeString());
32+
expect(wrapper.find('#lastRefresh').last().text()).toBe(now.toLocaleTimeString());
3333
});
3434

3535
it('should toggle panel', async () => {

web/src/components/query-summary/query-summary.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,19 @@ export const QuerySummaryContent: React.FC<{
7171
</Tooltip>
7272
</FlexItem>
7373
<FlexItem>
74-
<Text id="lastRefresh" component={TextVariants.p}>
75-
{t('last refresh: {{time}}', {
76-
time: lastRefresh ? lastRefresh.toLocaleTimeString() : ''
77-
})}
78-
</Text>
74+
<Tooltip
75+
content={
76+
<Text component={TextVariants.p}>
77+
{t('Last refresh: {{time}}', {
78+
time: lastRefresh ? lastRefresh.toLocaleString() : ''
79+
})}
80+
</Text>
81+
}
82+
>
83+
<Text id="lastRefresh" component={TextVariants.p}>
84+
{lastRefresh ? lastRefresh.toLocaleTimeString() : ''}
85+
</Text>
86+
</Tooltip>
7987
</FlexItem>
8088
</Flex>
8189
);

0 commit comments

Comments
 (0)