diff --git a/apps/web/src/routes/_auth/nodes.tsx b/apps/web/src/routes/_auth/nodes.tsx index da1f9e3..6fa4f1e 100644 --- a/apps/web/src/routes/_auth/nodes.tsx +++ b/apps/web/src/routes/_auth/nodes.tsx @@ -8,7 +8,6 @@ import type { ColumnDef } from '@tanstack/react-table' import type { Filter, FilterFieldConfig } from '@/components/reui/filters' import { CloudIcon, - MapPinIcon, PlusIcon, RefreshCwIcon, ServerIcon, @@ -75,12 +74,16 @@ const formSchema = z.object({ type FormValues = z.infer const ROLES: { value: NodeRole; label: string }[] = [ - { value: 'hub', label: 'hub' }, - { value: 'gw', label: 'gw' }, - { value: 'edge', label: 'edge' }, - { value: 'ix', label: 'ix' }, + { value: 'hub', label: 'Hub' }, + { value: 'gw', label: 'Gateway' }, + { value: 'edge', label: 'Edge' }, + { value: 'ix', label: 'IX' }, ] +const ROLE_LABEL: Record = Object.fromEntries( + ROLES.map((r) => [r.value, r.label]), +) as Record + function NodesPage() { const qc = useQueryClient() const { data: nodes = [], isLoading, isError, error, refetch } = useQuery( @@ -302,7 +305,10 @@ function NodesPage() { key: 'locationCode', label: 'Локация', type: 'select', - options: locations.map((l) => ({ value: l.code, label: l.code })), + options: locations.map((l) => ({ + value: l.code, + label: l.name, + })), }, { key: 'role', @@ -340,16 +346,35 @@ function NodesPage() { { accessorKey: 'locationCode', header: 'Локация', - cell: ({ row }) => ( - - - {row.original.locationCode ?? '—'} - - ), + cell: ({ row }) => { + const n = row.original + const loc = locations.find((l) => l.id === n.locationId) + const city = n.locationName ?? loc?.name ?? n.locationCode ?? '—' + const countryCode = loc?.country ?? undefined + return ( + + + {city} + {n.locationCode ? ( + + {n.locationCode} + + ) : null} + + ) + }, }, { accessorKey: 'role', header: 'Роль', + cell: ({ row }) => { + const role = row.original.role as NodeRole + return ( + + {ROLE_LABEL[role] ?? row.original.role} + + ) + }, }, { id: 'ip',