style(ui): tidy org page layouts and empty states
Members and Workspaces get fixed column widths and their add forms move into labelled sections. Agents lists agents first and moves credential grants below. Access puts New policy in the card header. Tokens states when none exist.
This commit is contained in:
1 parent
47f75f71a7
commit
feba855326
7 files changed
+143
-126
No files matched your search
@@ -4,7 +4,7 @@ import { computed, onMounted, ref } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Select,
|
||||
@@ -99,13 +99,17 @@ onMounted(load);
|
||||
<div>
|
||||
<PageHeader title="Access policies" />
|
||||
|
||||
<p v-if="error" class="mb-4 text-sm text-destructive">{{ error }}</p>
|
||||
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{ error }}</p>
|
||||
|
||||
<Card class="mb-4">
|
||||
<CardHeader>
|
||||
<CardTitle>Policies</CardTitle>
|
||||
<CardAction>
|
||||
<Button size="sm" @click="editing = true">New policy</Button>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent class="flex flex-col gap-3">
|
||||
<p v-if="!policies.length" class="text-sm text-fg-subtle">No policies yet.</p>
|
||||
<div
|
||||
v-for="p in policies"
|
||||
:key="`${p.level}/${scope(p)}/${p.id}`"
|
||||
@@ -125,7 +129,6 @@ onMounted(load);
|
||||
<Button size="sm" variant="outline" @click="remove(p)">Delete</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Button v-if="!editing" class="self-start" @click="editing = true">New policy</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -126,13 +126,11 @@ const isAgent = (value: Identity) =>
|
||||
<div>
|
||||
<PageHeader title="Agents" />
|
||||
|
||||
<IdentityGrantsCard />
|
||||
|
||||
<p v-if="store.error || error" role="alert" class="mb-4 text-sm text-danger">
|
||||
{{ store.error || error }}
|
||||
</p>
|
||||
|
||||
<form class="mb-6 flex flex-wrap gap-2" @submit.prevent="create">
|
||||
<form class="mb-4 flex flex-wrap items-center gap-2" @submit.prevent="create">
|
||||
<Input v-model="name" class="max-w-64" placeholder="Display name" aria-label="Display name" required />
|
||||
<Select v-model="kind">
|
||||
<SelectTrigger class="w-44" aria-label="Kind"><SelectValue /></SelectTrigger>
|
||||
@@ -206,6 +204,10 @@ const isAgent = (value: Identity) =>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="mt-8">
|
||||
<IdentityGrantsCard />
|
||||
</div>
|
||||
|
||||
<AlertDialog :open="!!retiring" @update:open="(open) => !open && (retiring = null)">
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
|
||||
@@ -135,11 +135,11 @@ const remove = (member: Member) =>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Member</TableHead>
|
||||
<TableHead>Kind</TableHead>
|
||||
<TableHead>Workspace</TableHead>
|
||||
<TableHead>Role</TableHead>
|
||||
<TableHead class="text-right">Actions</TableHead>
|
||||
<TableHead class="w-full">Member</TableHead>
|
||||
<TableHead class="w-28">Kind</TableHead>
|
||||
<TableHead class="w-44">Workspace</TableHead>
|
||||
<TableHead class="w-44">Role</TableHead>
|
||||
<TableHead class="w-24 text-right">Actions</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -180,48 +180,56 @@ const remove = (member: Member) =>
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
<form class="mt-4 flex flex-wrap items-end gap-2" @submit.prevent="add">
|
||||
<Select v-model="picked">
|
||||
<SelectTrigger class="w-64" aria-label="Identity">
|
||||
<SelectValue placeholder="Add a member" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="identity in candidates" :key="identity.id" :value="identity.id">
|
||||
{{ identity.display_name }}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Select v-model="pickedRole">
|
||||
<SelectTrigger class="w-36" aria-label="Role">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="role in ROLES" :key="role" :value="role">{{ role }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button type="submit" size="sm" :disabled="!picked || busy !== ''">
|
||||
<Plus data-icon="inline-start" /> Add member
|
||||
</Button>
|
||||
</form>
|
||||
<section class="mt-8 grid gap-6 lg:grid-cols-2" aria-label="Add people">
|
||||
<div>
|
||||
<h2 class="mb-3 text-sm font-medium">Add an identity</h2>
|
||||
<form class="flex flex-wrap items-center gap-2" @submit.prevent="add">
|
||||
<Select v-model="picked">
|
||||
<SelectTrigger class="w-64" aria-label="Identity">
|
||||
<SelectValue placeholder="Choose an identity" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="identity in candidates" :key="identity.id" :value="identity.id">
|
||||
{{ identity.display_name }}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Select v-model="pickedRole">
|
||||
<SelectTrigger class="w-36" aria-label="Role">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="role in ROLES" :key="role" :value="role">{{ role }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button type="submit" size="sm" :disabled="!picked || busy !== ''">
|
||||
<Plus data-icon="inline-start" /> Add member
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form class="mt-4 flex flex-wrap items-end gap-2" @submit.prevent="addPerson">
|
||||
<Input
|
||||
v-model="person"
|
||||
class="w-64"
|
||||
aria-label="Email or provider subject"
|
||||
placeholder="Email or provider subject"
|
||||
/>
|
||||
<Select v-model="personRole">
|
||||
<SelectTrigger class="w-36" aria-label="Role for the new person">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="role in ROLES" :key="role" :value="role">{{ role }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button type="submit" size="sm" :disabled="!person.trim() || busy !== ''">
|
||||
<Plus data-icon="inline-start" /> Invite person
|
||||
</Button>
|
||||
</form>
|
||||
<div>
|
||||
<h2 class="mb-3 text-sm font-medium">Invite a person</h2>
|
||||
<form class="flex flex-wrap items-center gap-2" @submit.prevent="addPerson">
|
||||
<Input
|
||||
v-model="person"
|
||||
class="w-64"
|
||||
aria-label="Email or provider subject"
|
||||
placeholder="Email or provider subject"
|
||||
/>
|
||||
<Select v-model="personRole">
|
||||
<SelectTrigger class="w-36" aria-label="Role for the new person">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="role in ROLES" :key="role" :value="role">{{ role }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button type="submit" size="sm" :disabled="!person.trim() || busy !== ''">
|
||||
<Plus data-icon="inline-start" /> Invite person
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -80,9 +80,9 @@ async function create(): Promise<void> {
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>ID</TableHead>
|
||||
<TableHead>Name</TableHead>
|
||||
<TableHead>Environment</TableHead>
|
||||
<TableHead class="w-56">ID</TableHead>
|
||||
<TableHead class="w-full">Name</TableHead>
|
||||
<TableHead class="w-44">Environment</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -103,13 +103,16 @@ async function create(): Promise<void> {
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
<form class="mt-4 flex flex-wrap items-end gap-2" @submit.prevent="create">
|
||||
<Input v-model="id" class="w-40 font-mono" placeholder="id" aria-label="Workspace id" required />
|
||||
<Input v-model="name" class="w-56" placeholder="Name" aria-label="Workspace name" required />
|
||||
<Input v-model="environment" class="w-40" placeholder="Environment" aria-label="Environment" />
|
||||
<Button type="submit" size="sm" :disabled="!id.trim() || !name.trim() || busy">
|
||||
<Plus data-icon="inline-start" /> Create
|
||||
</Button>
|
||||
</form>
|
||||
<section class="mt-8" aria-labelledby="new-workspace">
|
||||
<h2 id="new-workspace" class="mb-3 text-sm font-medium">New workspace</h2>
|
||||
<form class="flex flex-wrap items-center gap-2" @submit.prevent="create">
|
||||
<Input v-model="id" class="w-40 font-mono" placeholder="id" aria-label="Workspace id" required />
|
||||
<Input v-model="name" class="w-56" placeholder="Name" aria-label="Workspace name" required />
|
||||
<Input v-model="environment" class="w-40" placeholder="Environment" aria-label="Environment" />
|
||||
<Button type="submit" size="sm" :disabled="!id.trim() || !name.trim() || busy">
|
||||
<Plus data-icon="inline-start" /> Create
|
||||
</Button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -74,6 +74,7 @@ onMounted(load);
|
||||
<p class="mb-2 text-xs">Copy this token now. It is not shown again.</p>
|
||||
<Input :model-value="created" readonly aria-label="New token" @focus="($event.target as HTMLInputElement).select()" />
|
||||
</div>
|
||||
<p v-if="available && !tokens.length && !busy && !error" class="text-sm text-fg-subtle">No tokens yet.</p>
|
||||
<ul v-if="tokens.length" class="divide-y divide-border rounded-lg border border-border bg-card" aria-label="API tokens">
|
||||
<li v-for="token in tokens" :key="token.id" class="flex items-center gap-3 px-4 py-2.5">
|
||||
<code class="flex-1 truncate text-xs">{{ token.id.slice(0, 12) }}</code>
|
||||
|
||||
Reference in new issue
Block a user