From 7d71de6485b91a112e05b59ea14f3b9ab8c0c39d Mon Sep 17 00:00:00 2001 From: wohainilaodou Date: Mon, 28 Oct 2024 18:29:12 +0800 Subject: [PATCH] [INLONG-11425][Dashboard] Data synchronization corrects the display problem of uncommitted data --- .../src/ui/pages/GroupDetail/DataStream/PreviewModal.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inlong-dashboard/src/ui/pages/GroupDetail/DataStream/PreviewModal.tsx b/inlong-dashboard/src/ui/pages/GroupDetail/DataStream/PreviewModal.tsx index 6593c59e6c3..4c90c80951d 100644 --- a/inlong-dashboard/src/ui/pages/GroupDetail/DataStream/PreviewModal.tsx +++ b/inlong-dashboard/src/ui/pages/GroupDetail/DataStream/PreviewModal.tsx @@ -89,8 +89,8 @@ const Comp: React.FC = ({ inlongGroupId, inlongStreamId, ...modalProps }) return; }; const timestampSorter = (a, b) => { - const dateA = dayjs(a.dt, 'YYYY-MM-DD HH:mm:ss'); - const dateB = dayjs(b.dt, 'YYYY-MM-DD HH:mm:ss'); + const dateA = dayjs(a?.dt, 'YYYY-MM-DD HH:mm:ss'); + const dateB = dayjs(b?.dt, 'YYYY-MM-DD HH:mm:ss'); return dateA.isBefore(dateB) ? -1 : dateA.isAfter(dateB) ? 1 : 0; }; const sortOrder: SortOrder = 'descend'; @@ -135,7 +135,8 @@ const Comp: React.FC = ({ inlongGroupId, inlongStreamId, ...modalProps }) }, {}); temp['id'] = temp['id'] ? temp['id'] : i; temp['headers'] = previewData?.[i]?.headers; - temp['body'] = previewData?.[i]?.body; + temp['preBody'] = previewData?.[i]?.body; + temp['attribute'] = previewData?.[i]?.attribute; temp['dt'] = dayjs(previewData?.[i]?.dt).format('YYYY-MM-DD HH:mm:ss'); result.push(temp); }