refactor(ui): unify account administration under Access

This commit is contained in:
sam committed 2026-10-16 02:57:13 +11:00
1 parent d3e2a67222
commit 7e3aafd534
11 files changed
+144 -136

No files matched your search

+2 -2
View File
@@ -20,14 +20,14 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
<div class="max-w-2xl space-y-6">
<PageHeader title="Your account" />
<p class="text-sm">{{accounts.status?.user?.display_name}}</p>
<p v-if="$route.query.welcome" class="rounded-lg border border-border bg-card p-4 text-sm">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/org">add accounts</RouterLink>, or <RouterLink class="underline" to="/settings/authentication">configure OIDC</RouterLink>.</p>
<p v-if="$route.query.welcome" class="rounded-lg border border-border bg-card p-4 text-sm">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/access">add accounts</RouterLink>, or <RouterLink class="underline" to="/access/authentication">configure OIDC</RouterLink>.</p>
<p v-if="error" role="alert" class="text-sm text-danger">{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></p>
<section class="rounded-lg border border-border bg-card p-5">
<h2 class="font-medium">Passkeys</h2>
<p class="mt-1 text-sm text-muted-foreground">Sign in with your device or security key.</p>
<ul class="mt-4 divide-y divide-border"><li v-for="key in keys" :key="key.id" class="flex items-center gap-3 py-2 text-sm"><span class="min-w-0 flex-1 truncate">{{key.name}}</span><Button variant="ghost" size="sm" :disabled="busy" @click="remove(key.id)">Remove</Button></li></ul>
<form v-if="eligible" class="mt-3 flex flex-wrap gap-2" @submit.prevent="enroll"><Input v-model="keyName" aria-label="Passkey name" placeholder="Passkey name (optional)" maxlength="200" class="min-w-40 flex-1"/><Button type="submit" :disabled="busy">Add passkey</Button></form>
<p v-else class="mt-3 text-sm text-muted-foreground">Open Archie at its configured HTTPS domain, or localhost, in a browser that supports passkeys. The instance URL is managed in <RouterLink class="underline" to="/settings/authentication">Authentication settings</RouterLink>.</p>
<p v-else class="mt-3 text-sm text-muted-foreground">Open Archie at its configured HTTPS domain, or localhost, in a browser that supports passkeys. The instance URL is managed in <RouterLink class="underline" to="/access/authentication">Authentication settings</RouterLink>.</p>
</section>
<section class="rounded-lg border border-border bg-card p-5 space-y-3">
<h2 class="font-medium">Recovery code</h2>
+1 -1
View File
@@ -25,7 +25,7 @@ async function save(){busy.value=true;error.value="";saved.value=false;try{await
<label for="oidc-client" class="block space-y-1 text-sm">Client ID<Input id="oidc-client" v-model="value.oidc_client_id" /></label>
<label for="oidc-audience" class="block space-y-1 text-sm">Access token audience<Input id="oidc-audience" v-model="value.oidc_audience" /></label>
<p class="break-all text-xs text-muted-foreground">Redirect URI: {{value.public_url.replace(/\/$/,'')}}/oauth2/callback</p>
<p class="text-xs text-muted-foreground">Add permitted people by their verified email or provider subject in <RouterLink class="underline" to="/org">Organisation members</RouterLink>. Clear the OIDC fields to disable provider sign-in.</p>
<p class="text-xs text-muted-foreground">Add permitted people by their verified email or provider subject in <RouterLink class="underline" to="/access">Access → Accounts</RouterLink>. Clear the OIDC fields to disable provider sign-in.</p>
</section>
<p v-if="saved" role="status" class="text-sm">Authentication settings saved.</p>
<Button type="submit" :disabled="busy">Save</Button>
+4 -5
View File
@@ -30,14 +30,13 @@ function flattenRoutes(list: NavRouteNode[]): NavRouteNode[] {
const table = flattenRoutes(routes as NavRouteNode[]);
// Six places. Configuration lives under Settings, grouped the way the
// settings sidebar groups it (docs/design/ui-redesign/README.md, section 2).
// Primary destinations; access administration has its own area.
const specs: NavSpec[] = [
{ kind: "link", path: "/" },
{ kind: "link", path: "/tasks" },
{ kind: "link", path: "/workflows" },
{ kind: "link", path: "/events" },
{ kind: "link", path: "/org" },
{ kind: "link", path: "/access" },
{ kind: "link", path: "/settings" },
];
@@ -82,13 +81,13 @@ const settings: NavSpec = {
"/settings/status",
],
},
{ paths: ["/settings/authentication", "/settings/appearance", "/settings/history"] },
{ paths: ["/settings/appearance", "/settings/history"] },
],
};
// Reached from the Dashboard's Logs button and the account menu, and by
// Jump to, but not from the bar.
const unlisted = ["/logs"];
const unlisted = ["/logs", "/account", "/access/policies", "/access/tokens", "/access/authentication", "/access/agents", "/access/workspaces", "/access/models"];
/** hiddenPaths lists the routes this composition cannot back. */
export function hiddenPaths(sections: CapabilitySections | null): string[] {
@@ -15,22 +15,14 @@ import { cn } from "@/lib/utils";
import NewOrgDialog from "./NewOrgDialog.vue";
import { useOrgStore } from "@/stores/org";
/**
* The Org area's shared frame: the org it is about, and the tab strip that
* moves between its sections. Each section is a route, so the strip is links
* and the address bar names the open section.
*
* The org name and id are a context bar rather than the page's heading: each
* section states its own, and /org/access is a moved page that still carries
* its own. An instance admin gets a switcher over every org in its place.
*/
const TABS = [
{ path: "/org", label: "Members" },
{ path: "/org/agents", label: "Agents" },
{ path: "/org/workspaces", label: "Workspaces" },
{ path: "/org/access", label: "Access", home: true },
{ path: "/org/tokens", label: "Tokens", home: true },
{ path: "/org/models", label: "Models", home: true, member: true },
{ path: "/access", label: "Accounts" },
{ path: "/access/policies", label: "Policies", home: true },
{ path: "/access/tokens", label: "Tokens", home: true },
{ path: "/access/authentication", label: "Authentication", home: true, admin: true },
{ path: "/access/agents", label: "Agents" },
{ path: "/access/workspaces", label: "Workspaces" },
{ path: "/access/models", label: "Models", home: true, member: true },
];
const route = useRoute();
@@ -38,17 +30,17 @@ const router = useRouter();
const orgStore = useOrgStore();
const { homeOrg, instanceAdmin, org, orgs } = storeToRefs(orgStore);
// Access and Tokens act on the caller's own org server-side, so they are
// Policies and tokens act on the caller's own org server-side, so they are
// hidden while an instance admin views another org rather than editing the
// wrong one.
const away = computed(() => !!org.value && org.value.id !== homeOrg.value);
// Models is an org's own; the system org configures models in Settings.
const tabs = computed(() =>
TABS.filter((tab) => !(away.value && tab.home) && !(tab.member && homeOrg.value === "org-sys")),
TABS.filter((tab) => !(tab.admin && !instanceAdmin.value) && !(away.value && tab.home) && !(tab.member && homeOrg.value === "org-sys")),
);
watch(away, (isAway) => {
watch([away, () => route.path], ([isAway]) => {
if (isAway && TABS.some((tab) => tab.home && route.path.startsWith(tab.path))) {
void router.replace("/org");
void router.replace("/access");
}
});
const error = ref("");
@@ -63,12 +55,13 @@ onMounted(async () => {
const currentPath = computed(() => route.path);
const current = (path: string) =>
path === "/org" ? currentPath.value === "/org" : currentPath.value.startsWith(path);
path === "/access" ? currentPath.value === "/access" : currentPath.value.startsWith(path);
</script>
<template>
<div>
<PageHeader :title="org?.name ?? 'Org'">
<PageHeader title="Access">
<span class="text-sm text-muted-foreground">{{ org?.name }}</span>
<template v-if="instanceAdmin">
<Select :model-value="org?.id" @update:model-value="(id) => orgStore.viewOrg(String(id))">
<SelectTrigger class="w-60" aria-label="Org">
@@ -82,7 +75,7 @@ const current = (path: string) =>
</template>
</PageHeader>
<nav aria-label="Org" class="mb-4 flex flex-wrap items-center gap-1 border-b border-border">
<nav aria-label="Access sections" class="mb-4 flex flex-wrap items-center gap-1 border-b border-border">
<RouterLink
v-for="tab in tabs"
:key="tab.path"
+42 -28
View File
@@ -5,7 +5,7 @@ import CuratorsPage from "@/curators/CuratorsPage.vue";
import DashboardPage from "@/dashboard/DashboardPage.vue";
import EventsPage from "@/events/EventsPage.vue";
import LogsPage from "@/logs/LogsPage.vue";
import OrgShell from "@/org/OrgShell.vue";
import AccessPage from "@/org/AccessPage.vue";
import OrgMembersPage from "@/org/OrgMembersPage.vue";
import OrgAgentsPage from "@/org/OrgAgentsPage.vue";
import OrgWorkspacesPage from "@/org/OrgWorkspacesPage.vue";
@@ -43,7 +43,7 @@ import WorkflowsPage from "@/workflows/WorkflowsPage.vue";
// navPath the navigation entry this route keeps current
const routes = [
{path:"/account",name:"account",component:()=>import("@/accounts/AccountPage.vue"),meta:{label:"Your account"}},
{path:"/settings/authentication",name:"authentication",component:()=>import("@/accounts/AuthenticationPage.vue"),meta:{label:"Authentication",settings:true,navPath:"/settings"}},
{path:"/settings/authentication",redirect:"/access/authentication",meta:{nav:false}},
{
path: "/",
name: "dashboard",
@@ -184,55 +184,69 @@ const routes = [
},
},
{
path: "/org",
component: OrgShell,
path: "/access",
component: AccessPage,
meta: {
label: "Org",
description: "Members, agents, workspaces, access, tokens.",
navPath: "/org",
label: "Access",
description: "Accounts, policies, tokens, authentication and organisation access.",
navPath: "/access",
},
children: [
{
path: "/access/authentication",
name: "authentication",
component: () => import("@/accounts/AuthenticationPage.vue"),
meta: { label: "Authentication", navPath: "/access" },
},
{
path: "",
name: "org-members",
name: "access-members",
component: OrgMembersPage,
meta: { label: "Members", navPath: "/org" },
meta: { label: "Accounts", navPath: "/access" },
},
{
path: "agents",
name: "org-agents",
path: "/access/agents",
name: "access-agents",
component: OrgAgentsPage,
meta: { label: "Agents", navPath: "/org" },
meta: { label: "Agents", navPath: "/access" },
},
{
path: "workspaces",
name: "org-workspaces",
path: "/access/workspaces",
name: "access-workspaces",
component: OrgWorkspacesPage,
meta: { label: "Workspaces", navPath: "/org" },
meta: { label: "Workspaces", navPath: "/access" },
},
{
path: "access",
name: "org-access",
path: "/access/policies",
name: "access-policies",
component: OrgAccessPage,
meta: { label: "Access", navPath: "/org" },
meta: { label: "Policies", navPath: "/access" },
},
{
path: "tokens",
name: "org-tokens",
path: "/access/tokens",
name: "access-tokens",
component: OrgTokensPage,
meta: { label: "Tokens", navPath: "/org" },
meta: { label: "Tokens", navPath: "/access" },
},
{
path: "models",
name: "org-models",
path: "/access/models",
name: "access-models",
component: OrgModelsPage,
meta: { label: "Models", navPath: "/org" },
meta: { label: "Models", navPath: "/access" },
},
],
},
// Identities and access policies moved into Org; old bookmarks still resolve.
{ path: "/settings/identities", redirect: "/org/agents", meta: { nav: false } },
{ path: "/settings/access-policies", redirect: "/org/access", meta: { nav: false } },
// Existing bookmarks resolve to the unified Access area.
{ path: "/settings/identities", redirect: "/access/agents", meta: { nav: false } },
{ path: "/settings/access-policies", redirect: "/access/policies", meta: { nav: false } },
...Object.entries({
"/org": "/access",
"/org/agents": "/access/agents",
"/org/workspaces": "/access/workspaces",
"/org/access": "/access/policies",
"/org/tokens": "/access/tokens",
"/org/models": "/access/models",
}).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })),
{
path: "/settings/channels",
name: "channels",
@@ -421,7 +435,7 @@ const routes = [
"/system/tasks": "/settings/task-execution",
"/system/models": "/settings/models",
"/system/repos": "/settings/repositories",
"/system/identities": "/org/agents",
"/system/identities": "/access/agents",
"/channels": "/settings/channels",
"/skills": "/settings/skills",
"/curators": "/settings/curators",