diff --git a/frontend/src/pages/Clients.tsx b/frontend/src/pages/Clients.tsx index 8f9734c..ecc3bf4 100644 --- a/frontend/src/pages/Clients.tsx +++ b/frontend/src/pages/Clients.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useState, type ReactNode } from 'react' +import { Link } from 'react-router-dom' import { Loader2, Pencil, Plus, RefreshCw, Trash2 } from 'lucide-react' import { toast } from 'sonner' import { api, ApiError, type Client, type ClientStatus, type Vlan } from '@/lib/api' @@ -53,6 +54,9 @@ export function Clients() { const [pageSize, setPageSize] = usePageSize() const [page, setPage] = useState(1) const pageCount = Math.max(1, Math.ceil(total / pageSize)) + // A device must be assigned to a VLAN group, so adding one is impossible + // until at least one VLAN exists. + const noVlans = !loading && vlans.length === 0 // Server-side pagination: fetch only the current page's rows. const load = useCallback(async () => { @@ -96,12 +100,23 @@ export function Clients() { - + {noVlans && ( +
+ No VLANs exist yet. Add a VLAN{' '} + before registering a device. +
+ )} +