修复白名单页面日期显示问题

This commit is contained in:
2025-11-21 15:35:26 +08:00
parent 532c24b7b0
commit 7391cd0a25
3 changed files with 9 additions and 10 deletions

View File

@@ -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
}

View File

@@ -205,7 +205,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
<div className="h-16 w-56 px-4 flex self-center">
<div className={merge(
`w-0 h-full border-x border-primary border-dashed relative`,
`after:absolute after:-left-[3px] after:bottom-0 after:w-[6px] after:h-[6px] after:rounded-full after:bg-primary`,
`after:absolute after:-left-[3px] after:bottom-0 after:w-1.5 after:h-1.5 after:rounded-full after:bg-primary`,
)}>
</div>
</div>
@@ -219,7 +219,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
<div className="h-16 w-56 px-4 flex self-center">
<div className={merge(
`w-0 h-full border-x border-primary border-dashed relative`,
`after:absolute after:-left-[3px] after:bottom-0 after:w-[6px] after:h-[6px] after:rounded-full after:bg-primary`,
`after:absolute after:-left-[3px] after:bottom-0 after:w-1.5 after:h-1.5 after:rounded-full after:bg-primary`,
)}>
</div>
</div>

View File

@@ -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}) => (
<div className="flex justify-end gap-2">
<Button
className="h-9 w-9"