2025-12-30 18:35:37 +08:00
|
|
|
"use client"
|
2026-01-05 09:14:41 +08:00
|
|
|
import { format } from "date-fns"
|
2025-12-30 18:35:37 +08:00
|
|
|
import { Suspense } from "react"
|
|
|
|
|
import { getPageBatch } from "@/actions/batch"
|
|
|
|
|
import { DataTable, useDataTable } from "@/components/data-table"
|
2026-01-05 09:14:41 +08:00
|
|
|
import type { Batch } from "@/models/batch"
|
2025-12-30 18:35:37 +08:00
|
|
|
|
2026-01-05 09:14:41 +08:00
|
|
|
export default function BatchPage() {
|
|
|
|
|
const table = useDataTable<Batch>((page, size) =>
|
|
|
|
|
getPageBatch({ page, size }),
|
|
|
|
|
)
|
2025-12-30 18:35:37 +08:00
|
|
|
|
|
|
|
|
return (
|
2026-01-05 09:14:41 +08:00
|
|
|
<Suspense fallback={<div>Loading...</div>}>
|
|
|
|
|
<DataTable<Batch>
|
2025-12-30 18:35:37 +08:00
|
|
|
{...table}
|
|
|
|
|
columns={[
|
|
|
|
|
{ header: "ID", accessorKey: "id" },
|
|
|
|
|
{ header: "批次号", accessorKey: "batch_no" },
|
|
|
|
|
{ header: "省份", accessorKey: "prov" },
|
2026-01-05 09:14:41 +08:00
|
|
|
{ header: "城市", accessorKey: "city" },
|
2025-12-30 18:35:37 +08:00
|
|
|
{ header: "提取IP", accessorKey: "ip" },
|
|
|
|
|
{ header: "运营商", accessorKey: "isp" },
|
2026-01-05 09:14:41 +08:00
|
|
|
{ header: "提取数量", accessorKey: "count" },
|
|
|
|
|
{ header: "资源数量", accessorKey: "resource_id" },
|
|
|
|
|
{
|
|
|
|
|
header: "提取时间",
|
|
|
|
|
accessorKey: "time",
|
|
|
|
|
cell: ({ row }) =>
|
|
|
|
|
format(new Date(row.original.time), "yyyy-MM-dd HH:mm"),
|
|
|
|
|
},
|
2025-12-30 18:35:37 +08:00
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</Suspense>
|
|
|
|
|
)
|
|
|
|
|
}
|