diff --git a/client/src/pages/api-tokens.tsx b/client/src/pages/api-tokens.tsx index 1d576d7..e2da0c6 100644 --- a/client/src/pages/api-tokens.tsx +++ b/client/src/pages/api-tokens.tsx @@ -61,6 +61,13 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; import { Checkbox } from "@/components/ui/checkbox"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { Loader2, Key, MoreVertical, Calendar, Copy, Info } from "lucide-react"; import { formatDistanceToNow, format } from "date-fns"; @@ -105,8 +112,9 @@ export default function ApiTokensPage() { mutationFn: async (data: z.infer) => { const tokenData: Partial = { name: data.name, - organizationId: currentOrganization?.id || 0, + organizationId: currentOrganization?.id || "", permissions: data.permissions, + role: data.role, isActive: true, }; @@ -226,6 +234,7 @@ export default function ApiTokensPage() { Name Token + Role Permissions Expires Status @@ -239,9 +248,14 @@ export default function ApiTokensPage() { {token.token.substring(0, 8)}... + + + {token.role || "readonly"} + +
- {token.permissions.map((permission) => ( + {token.permissions?.map((permission) => ( {permission} @@ -328,6 +342,40 @@ export default function ApiTokensPage() { )} /> + ( + + Role + + + Determines the level of access for this token + + + + )} + /> + Permissions - Select the permissions for this token + Select specific permissions for this token
{systemRoles.map((role) => (