diff --git a/src/app/admin/extract/page.tsx b/src/app/admin/extract/page.tsx
index 85785e1..beddd6f 100644
--- a/src/app/admin/extract/page.tsx
+++ b/src/app/admin/extract/page.tsx
@@ -5,7 +5,7 @@ export type ExtractPageProps = {}
export default async function ExtractPage(props: ExtractPageProps) {
return (
-
+
)
diff --git a/src/app/admin/resources/page.tsx b/src/app/admin/resources/page.tsx
index be1b604..ecf8cbc 100644
--- a/src/app/admin/resources/page.tsx
+++ b/src/app/admin/resources/page.tsx
@@ -312,9 +312,6 @@ export default function ResourcesPage(props: ResourcesPageProps) {
),
},
]}
- classNames={{
- dataRow: `h-14`,
- }}
/>
)
diff --git a/src/app/admin/whitelist/page.tsx b/src/app/admin/whitelist/page.tsx
index f2f8833..80c9de5 100644
--- a/src/app/admin/whitelist/page.tsx
+++ b/src/app/admin/whitelist/page.tsx
@@ -24,6 +24,7 @@ import {
import {Pagination} from '@/components/ui/pagination'
import {Checkbox} from '@/components/ui/checkbox'
import Page from '@/components/page'
+import DataTable from '@/components/data-table'
const schema = z.object({
host: z.string().min(1, {message: 'IP地址不能为空'}),
@@ -72,17 +73,6 @@ export default function WhitelistPage(props: WhitelistPageProps) {
}
}
-
- // 处理分页
- const changePage = (newPage: number) => {
- refresh(newPage, data.size).then()
- }
-
- // 处理每页数量变化
- const changeSize = (newSize: number) => {
- refresh(1, newSize).then()
- }
-
// ======================
// 弹窗
// ======================
@@ -254,80 +244,49 @@ export default function WhitelistPage(props: WhitelistPageProps) {
{/* 数据表 */}
-
-
-
-
-
- toggleSelectAll()}/>
-
- IP
- 添加时间
- 备注
- 操作
-
-
-
-
- {wait && data.list.length === 0 ? (
-
-
-
-
-
- ) : data.list.length === 0 ? (
-
-
- 暂无数据
-
-
- ) : (
- data.list.map(item => (
-
-
- toggleSelect(item.id)}/>
-
- {item.host}
- {item.createdAt}
- {item.remark || '无'}
-
-
-
-
-
-
-
- ))
- )}
-
-
-
-
- {/* 分页器 */}
- {data.total > 0 && (
-
- )}
+ refresh(page, data.size),
+ onSizeChange: (size: number) => refresh(1, size),
+ }}
+ columns={[
+ {
+ accessorKey: 'host', header: `IP 地址`,
+ }, {
+ accessorKey: 'createdAt', header: `添加时间`,
+ }, {
+ accessorKey: 'remark', header: `备注`,
+ }, {
+ id: 'actions',
+ header: `操作`,
+ cell: ({row}) => (
+
+
+
+
+ ),
+ },
+ ]}
+ />
{/* 编辑表单 */}