diff --git a/internal/site/src/components/navbar.tsx b/internal/site/src/components/navbar.tsx index 09687151..09981084 100644 --- a/internal/site/src/components/navbar.tsx +++ b/internal/site/src/components/navbar.tsx @@ -125,15 +125,17 @@ export default function Navbar() { {AdminLinks} )} - { - setAddSystemDialogOpen(true) - }} - > - - Add {{ foo: systemTranslation }} - + {!isReadOnlyUser() && ( + { + setAddSystemDialogOpen(true) + }} + > + + Add {{ foo: systemTranslation }} + + )} @@ -217,10 +219,12 @@ export default function Navbar() { - + {!isReadOnlyUser() && ( + + )} ) diff --git a/internal/site/src/components/routes/system/smart-table.tsx b/internal/site/src/components/routes/system/smart-table.tsx index 3ceef84b..d6ec6730 100644 --- a/internal/site/src/components/routes/system/smart-table.tsx +++ b/internal/site/src/components/routes/system/smart-table.tsx @@ -36,7 +36,7 @@ import { Input } from "@/components/ui/input" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" -import { pb } from "@/lib/api" +import { isReadOnlyUser, pb } from "@/lib/api" import type { SmartDeviceRecord, SmartAttribute } from "@/types" import { formatBytes, @@ -492,7 +492,7 @@ export default function DisksTable({ systemId }: { systemId?: string }) { const tableColumns = useMemo(() => { const columns = createColumns(longestName, longestModel, longestDevice) const baseColumns = systemId ? columns.filter((col) => col.id !== "system") : columns - return [...baseColumns, actionColumn] + return isReadOnlyUser() ? baseColumns : [...baseColumns, actionColumn] }, [systemId, actionColumn, longestName, longestModel, longestDevice]) const table = useReactTable({