From 01c2712941321ec72bfb67d887d14c585814ecb0 Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 18 Nov 2024 18:36:18 +0800 Subject: [PATCH] feat: Display task executor tooltip with json-view #3409 (#3467) ### What problem does this PR solve? feat: Display task executor tooltip with json-view #3409 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- .../setting-system/task-bar-chat.tsx | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/web/src/pages/user-setting/setting-system/task-bar-chat.tsx b/web/src/pages/user-setting/setting-system/task-bar-chat.tsx index 011e14577..5b080d506 100644 --- a/web/src/pages/user-setting/setting-system/task-bar-chat.tsx +++ b/web/src/pages/user-setting/setting-system/task-bar-chat.tsx @@ -14,6 +14,9 @@ import { import { formatDate, formatTime } from '@/utils/date'; import dayjs from 'dayjs'; import { get } from 'lodash'; +import JsonView from 'react18-json-view'; +import 'react18-json-view/src/style.css'; + import styles from './index.less'; interface IProps { @@ -28,20 +31,18 @@ const CustomTooltip = ({ active, payload, ...restProps }: any) => { {}, ); return ( -
-
- {formatDate(restProps.label)} +
+
+
+ {formatDate(restProps.label)} +
+ +
- {Object.entries(taskExecutorHeartbeatItem).map(([key, val], index) => { - return ( -
- {`${key}: `} - - {key === 'now' || key === 'boot_at' ? formatDate(val) : val} - -
- ); - })}
); } @@ -54,7 +55,6 @@ const TaskBarChat = ({ data }: IProps) => { const data = val.map((x) => ({ ...x, now: dayjs(x.now).valueOf(), - failed: 5, })); const firstItem = data[0]; const lastItem = data[data.length - 1]; @@ -69,7 +69,7 @@ const TaskBarChat = ({ data }: IProps) => { Pending: {lastItem.pending}
- + { tickMargin={20} /> - } /> + } + trigger="click" + /> } /> } />