Skip to content

Commit

Permalink
[INLONG-11425][Dashboard] Data synchronization corrects the display p…
Browse files Browse the repository at this point in the history
…roblem of uncommitted data (#11428)
  • Loading branch information
wohainilaodou authored Oct 29, 2024
1 parent f78f45f commit 79d9430
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ const Comp: React.FC<Props> = ({ 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';
Expand Down Expand Up @@ -135,7 +135,8 @@ const Comp: React.FC<Props> = ({ 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);
}
Expand Down Expand Up @@ -187,11 +188,14 @@ const Comp: React.FC<Props> = ({ inlongGroupId, inlongStreamId, ...modalProps })
]}
>
<div>
<Card title="headers" bordered={false} style={{ width: 700 }}>
<Card title="atrributes" bordered={false} style={{ width: 700 }}>
<p style={{ margin: 0 }}>{JSON.stringify(originalModal?.record['attribute'])}</p>
</Card>
<Card title="headers" bordered={false} style={{ width: 700, marginTop: 10 }}>
<p style={{ margin: 0 }}>{JSON.stringify(originalModal?.record['headers'])}</p>
</Card>
<Card title="body" bordered={false} style={{ width: 700, marginTop: 10 }}>
<p style={{ margin: 0 }}>{originalModal?.record['body']}</p>
<p style={{ margin: 0 }}>{originalModal?.record['preBody']}</p>
</Card>
</div>
</Modal>
Expand Down

0 comments on commit 79d9430

Please sign in to comment.