Show and revoke registered agents under Admin

An agent that registered itself was invisible, and withdrawing one meant
deleting rows or rotating the signing key. It now sits next to Users, with
the live-token count that tells an approved agent from one that only
registered.
This commit is contained in:
2026-08-16 16:36:48 +02:00
parent 570f0e4458
commit a1cb286661
2 changed files with 171 additions and 11 deletions
+24 -11
View File
@@ -5,8 +5,10 @@ import { Suspense } from "react"
import { type UserPublic, UsersService } from "@/client"
import AddUser from "@/components/Admin/AddUser"
import { columns, type UserTableData } from "@/components/Admin/columns"
import OAuthClients from "@/components/Admin/OAuthClients"
import { DataTable } from "@/components/Common/DataTable"
import PendingUsers from "@/components/Pending/PendingUsers"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import useAuth from "@/hooks/useAuth"
function getUsersQueryOptions() {
@@ -56,18 +58,29 @@ function UsersTable() {
}
function Admin() {
// Agents get in through the same door as people, so they are administered
// next to them rather than in a screen of their own.
return (
<div className="flex flex-col gap-6">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold tracking-tight">Users</h1>
<p className="text-muted-foreground">
Manage user accounts and permissions
</p>
<Tabs defaultValue="users" className="flex flex-col gap-6">
<TabsList>
<TabsTrigger value="users">Users</TabsTrigger>
<TabsTrigger value="agents">Agents</TabsTrigger>
</TabsList>
<TabsContent value="users" className="flex flex-col gap-6">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold tracking-tight">Users</h1>
<p className="text-muted-foreground">
Manage user accounts and permissions
</p>
</div>
<AddUser />
</div>
<AddUser />
</div>
<UsersTable />
</div>
<UsersTable />
</TabsContent>
<TabsContent value="agents">
<OAuthClients />
</TabsContent>
</Tabs>
)
}