feat(webui): offer each organisation page only to callers its API write allows, and move appearance to the account menu

This commit is contained in:
sam committed 2026-10-27 10:47:14 +11:00
1 parent 8f6c010976
commit 930b21c36a
8 files changed
+101 -70

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ import {
<DropdownMenuSeparator />
<DropdownMenuItem as-child><RouterLink to="/account">Your account</RouterLink></DropdownMenuItem>
<DropdownMenuItem as-child>
<RouterLink to="/settings/appearance" class="w-full cursor-pointer">Appearance</RouterLink>
<RouterLink to="/account/appearance" class="w-full cursor-pointer">Appearance</RouterLink>
</DropdownMenuItem>
<DropdownMenuItem as-child>
<RouterLink to="/logs" class="w-full cursor-pointer">Logs</RouterLink>
+2 -2
View File
@@ -80,13 +80,13 @@ const settings: NavSpec = {
"/settings/status",
],
},
{ paths: ["/settings/authentication", "/settings/appearance", "/settings/audit"] },
{ paths: ["/settings/authentication", "/settings/audit"] },
],
};
// Reached from the Dashboard's Logs button and the account menu, and by
// Jump to, but not from the bar.
const unlisted = ["/logs", "/account"];
const unlisted = ["/logs", "/account", "/account/appearance"];
/** hiddenPaths lists the routes this composition cannot back. */
export function hiddenPaths(sections: CapabilitySections | null): string[] {
+10 -1
View File
@@ -1,9 +1,13 @@
<script setup lang="ts">
import { ArrowRight } from "@lucide/vue";
import { computed } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Card, CardHeader, CardTitle } from "@/components/ui/card";
import { hiddenPaths } from "@/lib/nav";
import { useSessionStore } from "@/stores/session";
/**
* The organisation home: where each kind of organisation configuration lives,
@@ -12,13 +16,18 @@ import { Card, CardHeader, CardTitle } from "@/components/ui/card";
* not proof a run will work, and that answer belongs to the service that
* consumes it.
*/
const areas = [
const allAreas = [
{ title: "Execution identities", to: "/org/agents" },
{ title: "Connections", to: "/org/connections" },
{ title: "Models", to: "/org/models" },
{ title: "Schedules and playbooks", to: "/org/schedules" },
{ title: "Members and access", to: "/org/members" },
];
const session = useSessionStore();
const areas = computed(() => {
const hidden = hiddenPaths(session.sections);
return allAreas.filter((area) => !hidden.includes(area.to));
});
</script>
<template>
+16 -22
View File
@@ -135,17 +135,10 @@ const routes = [
},
},
{
path: "/settings/appearance",
path: "/account/appearance",
name: "system-appearance",
component: SystemAppearancePage,
meta: {
navPath: "/settings",
settings: true,
// Not the instance's: a personal preference, open to any signed-in
// member of any org.
instance: false,
label: "Appearance",
},
meta: { label: "Appearance" },
},
{
path: "/settings/task-execution",
@@ -204,13 +197,13 @@ const routes = [
path: "members",
name: "org-members",
component: OrgMembersPage,
meta: { label: "Members", navPath: "/org" },
meta: { section: "org_members", label: "Members", navPath: "/org" },
},
{
path: "agents",
name: "org-agents",
component: OrgAgentsPage,
meta: { label: "Agents", navPath: "/org" },
meta: { section: "org_agents", label: "Agents", navPath: "/org" },
},
{
path: "workspaces",
@@ -222,43 +215,43 @@ const routes = [
path: "policies",
name: "org-policies",
component: OrgAccessPage,
meta: { label: "Policies", navPath: "/org" },
meta: { section: "org_policies", label: "Policies", navPath: "/org" },
},
{
path: "repositories",
name: "org-repositories",
component: SystemReposPage,
meta: { label: "Repositories", navPath: "/org", description: "Repository connections, access checks and execution policies." },
meta: { section: "org_config", label: "Repositories", navPath: "/org", description: "Repository connections, access checks and execution policies." },
},
{
path: "connections",
name: "org-connections",
component: ConnectionsPage,
meta: { label: "Connections", navPath: "/org" },
meta: { section: "org_config", label: "Connections", navPath: "/org" },
},
{
path: "credential-bindings",
name: "org-credential-bindings",
component: () => import("@/settings/CredentialBindingsPage.vue"),
meta: { label: "Credential bindings", navPath: "/org" },
meta: { section: "org_config", label: "Credential bindings", navPath: "/org" },
},
{
path: "models",
name: "org-models",
component: OrgModelsPage,
meta: { label: "Models", navPath: "/org" },
meta: { section: "org_config", label: "Models", navPath: "/org" },
},
{
path: "instructions",
name: "org-instructions",
component: InstructionsPage,
meta: { label: "Instructions", navPath: "/org" },
meta: { section: "org_config", label: "Instructions", navPath: "/org" },
},
{
path: "schedules",
name: "org-schedules",
component: () => import("@/schedules/SchedulesPage.vue"),
meta: { label: "Schedules", navPath: "/org" },
meta: { section: "org_config", label: "Schedules", navPath: "/org" },
},
{
path: "schedules/:id/runs",
@@ -276,19 +269,19 @@ const routes = [
path: "scheduling-policy",
name: "org-scheduling-policy",
component: SchedulingPolicyPage,
meta: { label: "Scheduling policy", navPath: "/org", description: "Work discovery and forge labels." },
meta: { section: "org_config", label: "Scheduling policy", navPath: "/org", description: "Work discovery and forge labels." },
},
{
path: "alerts",
name: "org-alerts",
component: () => import("@/settings/OrgAlertsPage.vue"),
meta: { label: "Alert webhook", navPath: "/org", description: "Where this organisation's alerts are sent." },
meta: { section: "org_config", label: "Alert webhook", navPath: "/org", description: "Where this organisation's alerts are sent." },
},
{
path: "playbooks",
name: "org-playbooks",
component: () => import("@/settings/PlaybooksPage.vue"),
meta: { label: "Playbooks", navPath: "/org" },
meta: { section: "org_config", label: "Playbooks", navPath: "/org" },
},
],
},
@@ -313,6 +306,7 @@ const routes = [
"/settings/playbooks": "/org/playbooks",
"/settings/scheduling-policy": "/org/scheduling-policy",
"/settings/channels": "/org/channels",
"/settings/appearance": "/account/appearance",
}).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })),
{
path: "/settings/tools",
@@ -416,7 +410,7 @@ const routes = [
// Paths from before Settings existed, kept for bookmarks and chat history.
...Object.entries({
"/system/status": "/settings/status",
"/system/appearance": "/settings/appearance",
"/system/appearance": "/account/appearance",
"/system/tasks": "/settings/task-execution",
"/system/models": "/settings/models",
"/system/repos": "/settings/repositories",