[]>(
() => [
{
id: "serverLabel",
accessorKey: "serverLabel",
header: ({ column }) => (
),
cell: ({ row }) => {
const b = row.original
return (
{b.serverLabel}
{b.multihop && (
multihop
)}
)
},
meta: {
headerTitle: "Роутер",
headerClassName: DATA_GRID_CELL_PAD_FIRST,
cellClassName: DATA_GRID_CELL_PAD_FIRST,
},
},
{
id: "iface",
accessorKey: "iface",
header: ({ column }) => ,
cell: ({ row }) => (
{row.original.iface || "—"}
),
meta: {
headerTitle: "Интерфейс",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: DATA_GRID_CELL_PAD,
},
},
{
id: "localAddr",
accessorKey: "localAddr",
header: ({ column }) => ,
cell: ({ row }) => (
{row.original.localAddr}
),
meta: {
headerTitle: "Локальный",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: DATA_GRID_CELL_PAD,
},
},
{
id: "remoteAddr",
accessorKey: "remoteAddr",
header: ({ column }) => ,
cell: ({ row }) => (
{row.original.remoteAddr}
),
meta: {
headerTitle: "Удалённый",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: DATA_GRID_CELL_PAD,
},
},
{
id: "state",
accessorKey: "state",
header: ({ column }) => ,
cell: ({ row }) => (
{row.original.state}
),
meta: {
headerTitle: "Состояние",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: DATA_GRID_CELL_PAD,
},
},
{
id: "uptime",
accessorKey: "uptime",
header: ({ column }) => ,
cell: ({ row }) => (
{row.original.uptime ?? "—"}
),
meta: {
headerTitle: "Uptime",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: DATA_GRID_CELL_PAD,
},
},
{
id: "intervals",
header: () => Tx / Rx,
enableSorting: false,
cell: ({ row }) => {
const b = row.original
return (
{fmtMs(b.interval)} / {fmtMs(b.rxInterval)}
)
},
meta: { headerClassName: DATA_GRID_CELL_PAD, cellClassName: DATA_GRID_CELL_PAD },
},
{
id: "holdTime",
accessorKey: "holdTime",
header: ({ column }) => ,
cell: ({ row }) => (
{fmtMs(row.original.holdTime)}
),
meta: {
headerTitle: "Hold",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: DATA_GRID_CELL_PAD,
},
},
{
id: "multiplier",
accessorKey: "multiplier",
header: ({ column }) => ,
cell: ({ row }) => (
{row.original.multiplier}
),
meta: {
headerTitle: "Mult",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: cn(DATA_GRID_CELL_PAD, "text-center"),
},
},
{
id: "packetsRx",
accessorKey: "packetsRx",
header: ({ column }) => (
),
cell: ({ row }) => (
{row.original.packetsRx.toLocaleString()}
),
meta: {
headerTitle: "Пакеты Rx",
headerClassName: cn(DATA_GRID_CELL_PAD, "text-right"),
cellClassName: cn(DATA_GRID_CELL_PAD, "text-right"),
},
},
{
id: "packetsTx",
accessorKey: "packetsTx",
header: ({ column }) => (
),
cell: ({ row }) => (
{row.original.packetsTx.toLocaleString()}
),
meta: {
headerTitle: "Пакеты Tx",
headerClassName: DATA_GRID_CELL_PAD,
cellClassName: cn(DATA_GRID_CELL_PAD, "text-right"),
},
},
{
id: "stateChanges",
accessorKey: "stateChanges",
header: ({ column }) => (
),
cell: ({ row }) => (
{row.original.stateChanges}
),
meta: {
headerTitle: "Переходы",
headerClassName: DATA_GRID_CELL_PAD_LAST,
cellClassName: cn(DATA_GRID_CELL_PAD_LAST, "text-right"),
},
},
],
[],
)
const table = useReactTable({
data: sessions,
columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getRowId: (row) => row.id,
})
if (sessions.length === 0) {
return (
}
title="BFD-сессий не обнаружено"
className="border-0 py-10"
/>
)
}
return (
)
}
export { OspfBfdDataGrid, type OspfBfdDataGridProps }