refactor(ui): build settings, org, task, workflow and dashboard pages from the shared components
This commit is contained in:
77 files changed
+505
-744
No files matched your search
@@ -25,7 +25,7 @@ defineEmits<{ remove: [index: number] }>();
|
||||
v-for="(item, i) in items"
|
||||
:key="i"
|
||||
:value="String(i)"
|
||||
class="rounded-lg border border-border bg-card px-5 not-last:border-b"
|
||||
class="rounded-xl bg-card px-4 ring-1 ring-foreground/10 not-last:border-b-0"
|
||||
>
|
||||
<header class="flex items-center gap-2 [&>h3]:min-w-0 [&>h3]:flex-1">
|
||||
<AccordionTrigger class="min-w-0 flex-1 items-center text-title hover:no-underline" :class="mono && 'font-mono'">
|
||||
|
||||
@@ -19,6 +19,7 @@ import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { grants, stage, useExtensionsStore, type Extension } from "@/stores/extensions";
|
||||
import ApplyStatusRows from "./ApplyStatusRows.vue";
|
||||
@@ -75,8 +76,9 @@ const tones = {
|
||||
<TabsTrigger value="marketplace">Marketplace</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="installed">
|
||||
<ul class="divide-y divide-border rounded-lg border border-border bg-card" aria-label="Extensions">
|
||||
<li v-for="extension in store.extensions" :key="extension.name" class="flex flex-wrap items-center gap-3 px-4 py-3">
|
||||
<Section>
|
||||
<ul class="divide-y divide-border" aria-label="Extensions">
|
||||
<li v-for="extension in store.extensions" :key="extension.name" class="flex flex-wrap items-center gap-3 py-3 first:pt-0 last:pb-0">
|
||||
<div class="min-w-0 w-full lg:w-auto lg:flex-1">
|
||||
<p class="truncate text-sm font-medium">
|
||||
{{ extension.display_name || extension.name }}
|
||||
@@ -141,7 +143,7 @@ const tones = {
|
||||
><Trash2
|
||||
/></Button>
|
||||
</li>
|
||||
<li v-if="loading" class="px-4 py-3 text-sm text-fg-muted" role="status">Loading extensions…</li>
|
||||
<li v-if="loading" class="py-3 text-sm text-fg-muted" role="status">Loading extensions…</li>
|
||||
<li v-else-if="!store.extensions.length && !store.error">
|
||||
<Empty class="py-6">
|
||||
<EmptyHeader>
|
||||
@@ -150,13 +152,15 @@ const tones = {
|
||||
</Empty>
|
||||
</li>
|
||||
</ul>
|
||||
</Section>
|
||||
|
||||
<ApplyStatusRows :kind="KIND" class="mt-6 border-t border-border py-4" />
|
||||
</TabsContent>
|
||||
<TabsContent value="marketplace">
|
||||
<p v-if="store.catalogueError" class="text-sm text-fg-muted">{{ store.catalogueError }}</p>
|
||||
<ul v-else class="divide-y divide-border rounded-lg border border-border bg-card">
|
||||
<li v-for="entry in available" :key="entry.name" class="flex flex-wrap items-center gap-3 px-4 py-3">
|
||||
<Section v-else>
|
||||
<ul class="divide-y divide-border">
|
||||
<li v-for="entry in available" :key="entry.name" class="flex flex-wrap items-center gap-3 py-3 first:pt-0 last:pb-0">
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="truncate text-sm font-medium">
|
||||
{{ entry.name }}
|
||||
@@ -167,8 +171,9 @@ const tones = {
|
||||
<Button size="sm" :disabled="!!store.busy" @click="store.installFromCatalogue(entry.name)">
|
||||
<Plus data-icon="inline-start" /> Install</Button>
|
||||
</li>
|
||||
<li v-if="!available.length" class="px-4 py-3 text-sm text-fg-muted">Everything listed is installed.</li>
|
||||
<li v-if="!available.length" class="py-3 text-sm text-fg-muted">Everything listed is installed.</li>
|
||||
</ul>
|
||||
</Section>
|
||||
<details class="mt-3">
|
||||
<summary class="cursor-pointer text-xs text-fg-muted">Install by reference</summary>
|
||||
<form class="mt-2 flex flex-wrap gap-2" @submit.prevent="install">
|
||||
|
||||
@@ -5,7 +5,8 @@ import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import {
|
||||
Select,
|
||||
@@ -15,7 +16,6 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import { ago } from "@/lib/format";
|
||||
import { useSettingsStore, type AuditEntry } from "@/stores/settings";
|
||||
import { formatValue } from "@/lib/changes";
|
||||
import { filterHistory, historyEmptyTitle } from "./history";
|
||||
@@ -147,8 +147,7 @@ const restorable = (entry: AuditEntry) =>
|
||||
|
||||
<p v-if="restoreError" class="mb-2 text-sm text-danger" role="alert">{{ restoreError }}</p>
|
||||
<p v-if="error" class="text-sm text-danger" role="alert">{{ error }}</p>
|
||||
<Card v-else>
|
||||
<CardContent>
|
||||
<Section v-else>
|
||||
<Table class="table-fixed">
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -163,7 +162,7 @@ const restorable = (entry: AuditEntry) =>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-for="entry in rows" :key="entry.id" class="align-top">
|
||||
<TableCell class="text-fg-muted" :title="entry.at">{{ entry.at ? ago(entry.at) : "" }}</TableCell>
|
||||
<TableCell class="text-fg-muted"><Timestamp :at="entry.at" /></TableCell>
|
||||
<TableCell class="truncate">{{ titles.get(entry.record_key) ?? entry.record_key }}</TableCell>
|
||||
<TableCell class="truncate font-mono text-xs" :title="entry.field">{{ entry.field || "whole value" }}</TableCell>
|
||||
<TableCell class="font-mono text-xs whitespace-normal">
|
||||
@@ -203,7 +202,6 @@ const restorable = (entry: AuditEntry) =>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -4,6 +4,7 @@ import { Plus, X } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
@@ -44,25 +45,24 @@ function removeIdentity(id: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="mb-8" aria-labelledby="identity-grants">
|
||||
<h2 id="identity-grants" class="mb-3 text-sm font-medium">Credential grants</h2>
|
||||
<Section title="Credential grants">
|
||||
<p v-if="error" role="alert" class="mb-3 text-sm text-danger">{{ error }}</p>
|
||||
<div v-if="grants" class="divide-y divide-border rounded-lg border border-border bg-card">
|
||||
<div class="flex flex-wrap items-center gap-3 px-4 py-2.5">
|
||||
<div v-if="grants" class="divide-y divide-border">
|
||||
<div class="flex flex-wrap items-center gap-3 py-2.5">
|
||||
<span class="w-40 shrink-0 text-sm">Default</span>
|
||||
<ToggleGroup type="multiple" variant="outline" size="sm" :model-value="grants.root ?? []" aria-label="Default grants" @update:model-value="(v) => setRoot(v as string[])">
|
||||
<ToggleGroupItem v-for="service in store.credentialServices" :key="service" :value="service" class="font-mono text-xs">{{ service }}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
<DraftHint :kind="KIND" path="root" />
|
||||
</div>
|
||||
<div v-for="(services, id) in grants.identities" :key="id" class="flex flex-wrap items-center gap-3 px-4 py-2.5">
|
||||
<div v-for="(services, id) in grants.identities" :key="id" class="flex flex-wrap items-center gap-3 py-2.5">
|
||||
<span class="w-40 shrink-0 truncate text-sm">{{ org.identityName(String(id)) }}</span>
|
||||
<ToggleGroup type="multiple" variant="outline" size="sm" :model-value="services" :aria-label="`${org.identityName(String(id))} grants`" @update:model-value="(v) => setIdentity(String(id), v as string[])">
|
||||
<ToggleGroupItem v-for="service in store.credentialServices" :key="service" :value="service" class="font-mono text-xs">{{ service }}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
<Button variant="ghost" size="sm" class="ml-auto" :aria-label="`Remove ${org.identityName(String(id))}`" @click="removeIdentity(String(id))"><X /></Button>
|
||||
</div>
|
||||
<div v-if="addable.length" class="px-4 py-2.5">
|
||||
<div v-if="addable.length" class="py-2.5">
|
||||
<Select :model-value="undefined" @update:model-value="(id) => setIdentity(String(id), [])">
|
||||
<SelectTrigger class="w-56" aria-label="Add identity"><Plus class="size-4" /><SelectValue placeholder="Add identity" /></SelectTrigger>
|
||||
<SelectContent><SelectGroup>
|
||||
@@ -71,5 +71,5 @@ function removeIdentity(id: string) {
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -5,6 +5,7 @@ import { Trash2 } from "@lucide/vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import {
|
||||
TagsInput,
|
||||
@@ -50,7 +51,8 @@ const args = computed({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid gap-4 rounded-lg border border-border bg-card p-4">
|
||||
<Section class="mb-0">
|
||||
<div class="grid gap-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<Input
|
||||
:id="`${id}-name`"
|
||||
@@ -101,4 +103,5 @@ const args = computed({
|
||||
<Switch v-model="server.parallel_tool_calls" />
|
||||
Parallel tool calls</label>
|
||||
</div>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -18,6 +18,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
|
||||
import CardAccordion from "./CardAccordion.vue";
|
||||
import DraftHint from "./DraftHint.vue";
|
||||
@@ -119,7 +120,7 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
|
||||
|
||||
<CardAccordion v-model:open="open" :items="jobs" :title="(job) => job.detail || job.id || 'New schedule'" remove-label="Delete" @remove="jobs.splice($event, 1)">
|
||||
<template #aside="{ item: job }">
|
||||
<span v-if="job.next_run" class="text-xs text-fg-subtle">Next run {{ new Date(job.next_run).toLocaleString() }}</span>
|
||||
<span v-if="job.next_run" class="text-xs text-fg-subtle">Next run <Timestamp :at="job.next_run" absolute /></span>
|
||||
</template>
|
||||
<template #default="{ item: job, index: i }">
|
||||
<SettingRow label="Schedule name" :for="`job-${i}-name`" hint="Used as the task title for scheduled workflows.">
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
NumberFieldInput,
|
||||
} from "@/components/ui/number-field";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
|
||||
import DraftHint from "./DraftHint.vue";
|
||||
@@ -60,7 +61,7 @@ const labelIssue = computed(() => issue("label"));
|
||||
</p>
|
||||
|
||||
<template v-if="policy">
|
||||
<h2 class="mb-1 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Dispatch</h2>
|
||||
<Section title="Dispatch">
|
||||
<SettingRow label="Trigger">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<ToggleGroup type="single" variant="outline" size="sm" :model-value="policy.dispatch.trigger" aria-label="Trigger" @update:model-value="(value) => { if (value && policy) policy.dispatch.trigger = value as string; }">
|
||||
@@ -94,8 +95,9 @@ const labelIssue = computed(() => issue("label"));
|
||||
<DraftHint :kind="KIND" path="dispatch.ack_reaction" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
</Section>
|
||||
|
||||
<h2 class="mt-10 mb-1 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Retries and polling</h2>
|
||||
<Section title="Retries and polling">
|
||||
<SettingRow label="Max retries" hint="Then marked dead.">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<NumberField v-model="policy.max_retries" :min="0" class="w-32">
|
||||
@@ -115,7 +117,7 @@ const labelIssue = computed(() => issue("label"));
|
||||
</div>
|
||||
<p v-if="intervalIssue" class="mt-1.5 text-xs text-danger">{{ intervalIssue.message }}</p>
|
||||
</SettingRow>
|
||||
</Section>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -11,6 +11,8 @@ import {
|
||||
SheetHeader,
|
||||
SheetTitle,
|
||||
} from "@/components/ui/sheet";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
@@ -84,11 +86,7 @@ async function save() {
|
||||
aria-label="Unsaved changes"
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-3 px-4 py-3">
|
||||
<span
|
||||
class="size-2 shrink-0 rounded-full"
|
||||
:class="invalid.length ? 'bg-danger' : 'bg-primary'"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<StatusDot :tone="invalid.length ? 'danger' : 'warn'" />
|
||||
<p class="min-w-40 flex-1 text-sm">
|
||||
<span class="font-medium">{{ count }} unsaved settings {{ count === 1 ? "change" : "changes" }}</span>
|
||||
<span class="text-fg-subtle"> · {{ sections.map((s) => s.title).join(", ") }}</span>
|
||||
@@ -123,34 +121,25 @@ async function save() {
|
||||
role="alert"
|
||||
>
|
||||
{{ invalid.length }} invalid {{ invalid.length === 1 ? "field" : "fields" }} must be fixed before saving.</p>
|
||||
<section
|
||||
v-for="section in sections"
|
||||
:key="section.kind"
|
||||
class="rounded-lg border border-border bg-card"
|
||||
>
|
||||
<header class="flex items-center gap-2 border-b border-border px-3 py-2">
|
||||
<h3 class="flex-1 truncate text-sm font-medium">{{ section.title }}</h3>
|
||||
<Badge v-if="section.restart" variant="warn">After restart</Badge>
|
||||
<Button variant="ghost" size="sm" @click="store.resetDraft(section.kind)">Revert</Button>
|
||||
</header>
|
||||
<Section v-for="section in sections" :key="section.kind" :title="section.title" class="mb-0">
|
||||
<template #action>
|
||||
<div class="flex items-center gap-2">
|
||||
<Badge v-if="section.restart" variant="warn">After restart</Badge>
|
||||
<Button variant="ghost" size="sm" @click="store.resetDraft(section.kind)">Revert</Button>
|
||||
</div>
|
||||
</template>
|
||||
<ChangeList
|
||||
:changes="section.changes"
|
||||
:label="(path) => fieldLabel(section.kind, path)"
|
||||
@revert="(change) => store.revertDraftChange(section.kind, change)"
|
||||
/>
|
||||
<ul
|
||||
v-if="section.issues.length"
|
||||
class="space-y-0.5 border-t border-border px-3 py-2 text-xs text-danger"
|
||||
role="alert"
|
||||
>
|
||||
<ul v-if="section.issues.length" class="mt-2 space-y-0.5 text-xs text-danger" role="alert">
|
||||
<li v-for="issue in section.issues" :key="issue.path">
|
||||
<span class="font-medium">{{ issue.label }}</span>: {{ issue.message }}
|
||||
</li>
|
||||
</ul>
|
||||
<p v-if="section.error" class="border-t border-border px-3 py-2 text-sm text-danger" role="alert">
|
||||
{{ section.error }}
|
||||
</p>
|
||||
</section>
|
||||
<p v-if="section.error" class="mt-2 text-sm text-danger" role="alert">{{ section.error }}</p>
|
||||
</Section>
|
||||
</div>
|
||||
<SheetFooter class="flex-row justify-end gap-2 border-t border-border">
|
||||
<Button variant="ghost" @click="discardAll">Discard all</Button>
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
@@ -141,7 +142,6 @@ const allowedText = (id: string) => policyFor(id).allowed.join(", ");
|
||||
function setAllowed(id: string, text: string) {
|
||||
setPolicy(id, { allowed: text.split(",").map((ref) => ref.trim()).filter(Boolean) });
|
||||
}
|
||||
const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -156,13 +156,12 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
</p>
|
||||
|
||||
<template v-if="aliases">
|
||||
<h2 :class="eyebrow">Aliases</h2>
|
||||
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">Set the default alias.</p>
|
||||
<datalist id="alias-models">
|
||||
<option v-for="m in modelOptions" :key="m" :value="m" />
|
||||
</datalist>
|
||||
<div class="rounded-lg border border-border bg-card">
|
||||
<div v-for="alias in aliasNames" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border px-4 py-2.5 last-of-type:border-b-0">
|
||||
<Section title="Aliases">
|
||||
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">Set the default alias.</p>
|
||||
<div v-for="alias in aliasNames" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
|
||||
<label :for="`alias-${alias}`" class="w-28 text-sm font-medium">{{ alias }}</label>
|
||||
<template v-if="alias === 'embedding'">
|
||||
<Select :model-value="embeddingProvider" @update:model-value="(v) => setEmbedding(String(v), embeddingModel)">
|
||||
@@ -199,20 +198,19 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
<Trash2 />
|
||||
</Button>
|
||||
</div>
|
||||
<form class="flex flex-wrap gap-2 border-t border-border px-4 py-3" @submit.prevent="addAlias">
|
||||
<form class="flex flex-wrap gap-2 border-t border-border pt-3" @submit.prevent="addAlias">
|
||||
<Input v-model="newAlias" class="max-w-56 font-mono" placeholder="alias" aria-label="New alias" />
|
||||
<Button type="submit" variant="outline" size="sm" :disabled="!newAlias.trim()"><Plus data-icon="inline-start" />Add alias</Button>
|
||||
</form>
|
||||
</div>
|
||||
</Section>
|
||||
</template>
|
||||
|
||||
<template v-if="policies && otherOrgs.length">
|
||||
<h2 :class="[eyebrow, 'mt-10']">Org access</h2>
|
||||
<datalist id="org-allowed">
|
||||
<option v-for="m in [...providerWildcards, ...modelOptions]" :key="m" :value="m" />
|
||||
</datalist>
|
||||
<div class="rounded-lg border border-border bg-card">
|
||||
<div v-for="o in otherOrgs" :key="o.id" class="flex flex-wrap items-center gap-3 border-b border-border px-4 py-2.5 last-of-type:border-b-0">
|
||||
<Section title="Org access">
|
||||
<div v-for="o in otherOrgs" :key="o.id" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
|
||||
<span class="w-28 truncate text-sm font-medium" :title="o.id">{{ o.name }}</span>
|
||||
<Input
|
||||
:model-value="allowedText(o.id)"
|
||||
@@ -227,17 +225,16 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
Own providers</label>
|
||||
<DraftHint kind="org-model-policy" :path="o.id" />
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
</template>
|
||||
|
||||
<template v-if="providers">
|
||||
<h2 :class="[eyebrow, 'mt-10']">Providers</h2>
|
||||
<datalist id="available-providers">
|
||||
<option v-for="p in available" :key="p.id" :value="p.id">{{ p.name }}</option>
|
||||
</datalist>
|
||||
<div class="rounded-lg border border-border bg-card">
|
||||
<Section title="Providers">
|
||||
<Accordion type="multiple">
|
||||
<AccordionItem v-for="(provider, name) in providers" :key="name" :value="String(name)" class="px-4">
|
||||
<AccordionItem v-for="(provider, name) in providers" :key="name" :value="String(name)">
|
||||
<AccordionTrigger class="hover:no-underline">
|
||||
<span class="flex min-w-0 flex-1 flex-wrap items-center gap-x-3">
|
||||
<span class="w-28 text-left font-mono text-sm font-medium">{{ name }}</span>
|
||||
@@ -283,14 +280,14 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
<form class="flex flex-wrap items-center gap-2 border-t border-border px-4 py-3" @submit.prevent="addProvider">
|
||||
<form class="flex flex-wrap items-center gap-2 border-t border-border pt-3" @submit.prevent="addProvider">
|
||||
<Input v-model="newProvider" list="available-providers" class="max-w-56 font-mono" placeholder="provider" aria-label="New provider" />
|
||||
<Button type="submit" variant="outline" size="sm" :disabled="!newProvider.trim()"><Plus data-icon="inline-start" />Add provider</Button>
|
||||
<span v-if="available.length" class="text-xs text-fg-subtle">Available:
|
||||
<Button v-for="p in available" :key="p.id" type="button" variant="link" size="xs" class="h-auto px-1 font-mono text-fg-subtle" @click="newProvider = p.id; addProvider()">{{ p.id }}</Button>
|
||||
</span>
|
||||
</form>
|
||||
</div>
|
||||
</Section>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@ import { onMounted, onUnmounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
|
||||
import ServicesCard from "./ServicesCard.vue";
|
||||
import UpdateSettingsCard from "./UpdateSettingsCard.vue";
|
||||
@@ -24,19 +24,15 @@ onUnmounted(() => clearInterval(timer));
|
||||
|
||||
<template>
|
||||
<PageHeader title="Status" />
|
||||
<div class="flex flex-col gap-4">
|
||||
<Alert v-if="config?.reload?.last_error" variant="destructive">
|
||||
<div>
|
||||
<Alert v-if="config?.reload?.last_error" variant="destructive" class="mb-4">
|
||||
<AlertTitle>Configuration reload failed</AlertTitle>
|
||||
<AlertDescription>{{ config.reload.last_error }}</AlertDescription>
|
||||
</Alert>
|
||||
<ServicesCard />
|
||||
<VersionsCard />
|
||||
<UpdateSettingsCard />
|
||||
<Card v-if="config?.bootstrap && Object.keys(config.bootstrap).length">
|
||||
<CardHeader>
|
||||
<CardTitle>Startup settings</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section v-if="config?.bootstrap && Object.keys(config.bootstrap).length" title="Startup settings">
|
||||
<Table>
|
||||
<TableBody>
|
||||
<TableRow v-for="(reason, key) in config.bootstrap" :key="key">
|
||||
@@ -45,7 +41,6 @@ onUnmounted(() => clearInterval(timer));
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
InputGroupInput,
|
||||
InputGroupText,
|
||||
} from "@/components/ui/input-group";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
|
||||
@@ -85,7 +86,6 @@ watch(
|
||||
},
|
||||
);
|
||||
|
||||
const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -100,8 +100,8 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
|
||||
</p>
|
||||
|
||||
<template v-if="tools">
|
||||
<h2 :class="eyebrow">MCP servers</h2>
|
||||
<div class="grid gap-3 border-t border-border pt-4">
|
||||
<Section title="MCP servers">
|
||||
<div class="grid gap-3">
|
||||
<McpServerEditor
|
||||
v-for="server in shown"
|
||||
:key="keyOf(server)"
|
||||
@@ -114,12 +114,15 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
|
||||
<Plus data-icon="inline-start" /> Add MCP server</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<div class="mt-10 flex items-center gap-3">
|
||||
<h2 :class="[eyebrow, 'flex-1']">MiniMax</h2>
|
||||
<DraftHint :kind="KIND" path="minimax.enabled" />
|
||||
<Switch v-model="tools.minimax.enabled" aria-label="MiniMax enabled" />
|
||||
</div>
|
||||
<Section title="MiniMax">
|
||||
<template #action>
|
||||
<div class="flex items-center gap-3">
|
||||
<DraftHint :kind="KIND" path="minimax.enabled" />
|
||||
<Switch v-model="tools.minimax.enabled" aria-label="MiniMax enabled" />
|
||||
</div>
|
||||
</template>
|
||||
<SettingRow label="API key">
|
||||
<SecretRefField
|
||||
v-model="tools.minimax.api_key_ref"
|
||||
@@ -131,11 +134,15 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
|
||||
<SettingRow label="URL" for="minimax-url">
|
||||
<div class="flex flex-wrap items-center gap-3"><Input id="minimax-url" v-model="tools.minimax.base_url" class="max-w-md font-mono" /><DraftHint :kind="KIND" path="minimax.base_url" /></div>
|
||||
</SettingRow>
|
||||
<div class="mt-10 flex items-center gap-3">
|
||||
<h2 :class="[eyebrow, 'flex-1']">Web fetch</h2>
|
||||
<DraftHint :kind="KIND" path="web_fetch.enabled" />
|
||||
<Switch v-model="webFetchOn" aria-label="Web fetch enabled" />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section title="Web fetch">
|
||||
<template #action>
|
||||
<div class="flex items-center gap-3">
|
||||
<DraftHint :kind="KIND" path="web_fetch.enabled" />
|
||||
<Switch v-model="webFetchOn" aria-label="Web fetch enabled" />
|
||||
</div>
|
||||
</template>
|
||||
<SettingRow label="Max download" for="wf-bytes">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<ByteSizeInput id="wf-bytes" v-model="tools.web_fetch.max_bytes" :disabled="!webFetchOn" />
|
||||
@@ -162,8 +169,9 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
|
||||
<DraftHint :kind="KIND" path="web_fetch.allow_private_networks" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
</Section>
|
||||
|
||||
<h2 :class="[eyebrow, 'mt-10']">Tool output</h2>
|
||||
<Section title="Tool output">
|
||||
<SettingRow label="Max result length" for="tp-chars" :hint="`≈ ${Math.round(tools.policy.max_result_chars / 4).toLocaleString()} tokens`">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<InputGroup class="w-48">
|
||||
@@ -181,7 +189,7 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
|
||||
<DraftHint :kind="KIND" path="policy.spill_dir" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
</Section>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from "vue";
|
||||
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
@@ -30,11 +30,7 @@ const channel = computed({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card v-if="draft">
|
||||
<CardHeader>
|
||||
<CardTitle>Updates</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section v-if="draft" title="Updates">
|
||||
<p v-if="error" class="mb-2 text-sm text-danger" role="alert">{{ error }}</p>
|
||||
<SettingRow label="Release channel">
|
||||
<div class="flex justify-end">
|
||||
@@ -48,6 +44,5 @@ const channel = computed({
|
||||
<Input id="update-pin" v-model="draft.pin" class="max-w-40 font-mono" placeholder="1.48.0" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -3,7 +3,7 @@ import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -131,11 +131,7 @@ onMounted(load);
|
||||
|
||||
<template>
|
||||
<p v-if="notConfigured" class="text-sm text-fg-muted">Update checks not configured.</p>
|
||||
<Card v-else>
|
||||
<CardHeader>
|
||||
<CardTitle>Versions</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section v-else title="Versions">
|
||||
<p v-if="loadError" class="text-sm text-danger">{{ loadError }}</p>
|
||||
<p v-else-if="loading" class="text-sm text-fg-muted">Checking…</p>
|
||||
<template v-else>
|
||||
@@ -185,6 +181,5 @@ onMounted(load);
|
||||
{{ installError }}
|
||||
</p>
|
||||
</template>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
Reference in new issue
Block a user