Skip to content

Commit f977ce8

Browse files
fetch data on chart zoom event
1 parent 220ae93 commit f977ce8

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

client/packages/lowcoder/src/pages/setting/audit/charts/eventTypesTime.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,16 @@ const EventTypeTimeChart = ({ data, eventTypeLabels, eventTypes, setDateRange }:
6262
}));
6363

6464
const handleChartEvents = (params: any) => {
65-
if (params.start !== undefined && params.end !== undefined) {
66-
const startIndex = Math.floor((params.start / 100) * (fullDateRange.length - 1));
67-
const endIndex = Math.floor((params.end / 100) * (fullDateRange.length - 1));
65+
// const {start, end} = params.batch?.[0];
66+
let {start, end} = params;
67+
if (params?.batch) {
68+
start = params.batch?.[0]?.start;
69+
end = params.batch?.[0]?.end;
70+
}
71+
if (start !== undefined && end !== undefined) {
72+
// debugger;
73+
const startIndex = Math.floor((start / 100) * (fullDateRange.length - 1));
74+
const endIndex = Math.floor((end / 100) * (fullDateRange.length - 1));
6875

6976
const fromDate = new Date(fullDateRange[startIndex] || fullDateRange[0]); // Keep start of day
7077
const toDate = new Date(fullDateRange[endIndex] || fullDateRange[fullDateRange.length - 1]);

client/packages/lowcoder/src/pages/setting/audit/dashboard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ export function AuditLogDashboard() {
221221
const endDate = dayjs(toTimestamp);
222222
form.setFieldsValue({ dateRange: [startDate, endDate] });
223223

224-
setPagination({ pageSize: 25, current: 1 });
224+
// setPagination({ pageSize: 25, current: 1 });
225225
setAllLogs([]);
226226
setCurrentPageLogs([]);
227-
fetchLogs(1, LOG_PAGE_SIZE, true);
227+
fetchLogs(1, total, true);
228228
};
229229

230230
// Debounce handler for input fields
@@ -477,6 +477,7 @@ export function AuditLogDashboard() {
477477
<Divider />
478478
<div style={{ overflowX: "auto", width: "100%" }}>
479479
<Table
480+
rowKey="id"
480481
columns={columns}
481482
dataSource={currentPageLogs}
482483
size="small" // Compact Layout

0 commit comments

Comments
 (0)