+
{data.total} 个数据集 ·{" "}
{formatTime(data.synced_at, account?.timezone)}
@@ -373,7 +382,13 @@ export function DatasetPage({
{
+ setPageSize(size);
+ setPage(1);
+ }}
onPageChange={setPage}
/>
diff --git a/frontend/src/preparations/DataPreparationPage.tsx b/frontend/src/preparations/DataPreparationPage.tsx
index d267b08..8fe7f95 100644
--- a/frontend/src/preparations/DataPreparationPage.tsx
+++ b/frontend/src/preparations/DataPreparationPage.tsx
@@ -1,3 +1,4 @@
+import { WorkspaceTable as Table } from "../components/WorkspaceTable";
import { useEffect, useState } from "react";
import {
Banner,
@@ -5,7 +6,6 @@ import {
Input,
Modal,
Pagination,
- Table,
TextArea,
Toast,
Tabs,
@@ -34,6 +34,7 @@ export function DataPreparationPage({ active }: { active: boolean }) {
}),
[q, setQ] = useState(""),
[page, setPage] = useState(1),
+ [pageSize, setPageSize] = useState(25),
[rev, setRev] = useState(0);
const [selected, setSelected] = useState
>({}),
[scope, setScope] = useState(defaultScope),
@@ -60,18 +61,18 @@ export function DataPreparationPage({ active }: { active: boolean }) {
if (!active) return;
const c = new AbortController();
api>(
- `/data-preparations?${queryString({ q, offset: (page - 1) * 25, scope_key: scopeFilter ? scopeKey(scope) : undefined })}`,
+ `/data-preparations?${queryString({ q, limit: pageSize, offset: (page - 1) * pageSize, scope_key: scopeFilter ? scopeKey(scope) : undefined })}`,
{ signal: c.signal },
)
.then((r) => {
setData(r);
- setPage((p) => Math.min(p, Math.max(1, Math.ceil(r.total / 25))));
+ setPage((p) => Math.min(p, Math.max(1, Math.ceil(r.total / pageSize))));
})
.catch((e) => {
if (!c.signal.aborted) setError(e.message);
});
return () => c.abort();
- }, [active, q, page, rev, scopeFilter, scopeKey(scope)]);
+ }, [active, q, page, pageSize, rev, scopeFilter, scopeKey(scope)]);
useEffect(() => {
if (!detail) return;
const c = new AbortController();
@@ -169,11 +170,12 @@ export function DataPreparationPage({ active }: { active: boolean }) {
/>
)}
+ fill
rowKey="id"
size="small"
dataSource={data.items}
pagination={false}
- scroll={{ x: 1000, y: "100%" }}
+ scroll={{ x: 1140, y: "100%" }}
rowSelection={{
selectedRowKeys: Object.keys(selected),
onChange: (keys) =>
@@ -189,20 +191,32 @@ export function DataPreparationPage({ active }: { active: boolean }) {
columns={[
{
title: "集合名称",
+ width: 260,
render: (_, r) => (
-