diff --git a/src/actions/whitelist.ts b/src/actions/whitelist.ts index aba47cd..07af9a5 100644 --- a/src/actions/whitelist.ts +++ b/src/actions/whitelist.ts @@ -5,8 +5,8 @@ import {callByUser} from '@/actions/base' type Whitelist = { id: number host: string - createdAt: string - updatedAt: string + created_at: string + updated_at: string remark: string } diff --git a/src/app/admin/identify/page.tsx b/src/app/admin/identify/page.tsx index 739da06..f309770 100644 --- a/src/app/admin/identify/page.tsx +++ b/src/app/admin/identify/page.tsx @@ -205,7 +205,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
@@ -219,7 +219,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
diff --git a/src/app/admin/whitelist/page.tsx b/src/app/admin/whitelist/page.tsx index c9ed176..e79e360 100644 --- a/src/app/admin/whitelist/page.tsx +++ b/src/app/admin/whitelist/page.tsx @@ -22,6 +22,7 @@ import { } from '@/components/ui/alert-dialog' import Page from '@/components/page' import DataTable from '@/components/data-table' +import {format, parseISO} from 'date-fns' const schema = z.object({ host: z.string().min(1, {message: 'IP地址不能为空'}), @@ -253,18 +254,16 @@ export default function WhitelistPage(props: WhitelistPageProps) { }} columns={[ { - accessorKey: 'host', header: `IP 地址`, + header: `IP 地址`, accessorKey: 'host', }, { - accessorKey: 'remark', header: `备注`, + header: `备注`, accessorKey: 'remark', }, { - accessorKey: 'created_at', header: `添加时间`, + header: `添加时间`, cell: ({row}) => format(parseISO(row.original.created_at), 'yyyy-MM-dd HH:mm'), }, { - id: 'actions', - header: `操作`, - cell: ({row}) => ( + id: 'actions', header: `操作`, cell: ({row}) => (