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
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { api } from "@/lib/api";
|
||||
@@ -26,7 +27,7 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
|
||||
</script>
|
||||
<template>
|
||||
<main class="mx-auto flex min-h-[90dvh] max-w-md flex-col justify-center px-5 py-10">
|
||||
<div class="rounded-xl border border-border bg-card p-6 shadow-sm">
|
||||
<Card class="gap-0 py-6 px-6 shadow-sm">
|
||||
<p class="mb-2 text-xs font-medium tracking-widest text-fg-muted">ARCHIE</p>
|
||||
<h1 class="text-2xl font-medium">{{setup?(step===1?'Set up your organisation':'Create your admin account'):recovery?'Recover your account':'Sign in'}}</h1>
|
||||
<form class="mt-6 space-y-4" @submit.prevent="submit">
|
||||
@@ -51,6 +52,6 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
|
||||
<Button v-if="accounts.status?.oidc" variant="outline" as-child><a href="/oauth2/login">Sign in with OIDC</a></Button>
|
||||
</div>
|
||||
<Button v-if="!setup" variant="link" class="mt-3" :disabled="busy" @click="recovery=!recovery;error=''">{{recovery?'Back to sign in':'Use a recovery code'}}</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</main>
|
||||
</template>
|
||||
@@ -2,6 +2,7 @@
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import PersonalTokensCard from "@/accounts/PersonalTokensCard.vue";
|
||||
import { Alert } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
@@ -22,7 +23,7 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
|
||||
<template>
|
||||
<div class="mx-auto max-w-[80ch]">
|
||||
<PageHeader title="Your account"><span class="text-sm text-fg-muted">{{accounts.status?.user?.display_name}}</span></PageHeader>
|
||||
<p v-if="$route.query.welcome" class="mb-4 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/members">add members</RouterLink>, or <RouterLink class="underline" to="/settings/authentication">configure OIDC</RouterLink>.</p>
|
||||
<Alert v-if="$route.query.welcome" class="mb-4">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/org/members">add members</RouterLink>, or <RouterLink class="underline" to="/settings/authentication">configure OIDC</RouterLink>.</Alert>
|
||||
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></p>
|
||||
<Section title="Passkeys">
|
||||
<ul v-if="keys.length" class="mb-3 divide-y divide-border"><li v-for="key in keys" :key="key.id" class="flex items-center gap-3 py-2"><span class="min-w-0 flex-1 truncate">{{key.name}}</span><Button variant="ghost" size="sm" class="text-danger" :disabled="busy" @click="remove(key.id)">Remove</Button></li></ul>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { api } from "@/lib/api";
|
||||
@@ -12,9 +13,8 @@ const name=ref("");const email=ref("");const password=ref("");const role=ref("vi
|
||||
async function create(){busy.value=true;error.value="";try{await api.createAccount({display_name:name.value,email:email.value,password:password.value,role:role.value});name.value=email.value=password.value="";emit("created")}catch(cause){error.value=String((cause as Error).message||cause)}finally{busy.value=false}}
|
||||
</script>
|
||||
<template>
|
||||
<section class="mt-6 max-w-md rounded-lg border border-border bg-card p-5">
|
||||
<h2 class="text-sm font-medium">Create a local account</h2>
|
||||
<form class="mt-4 space-y-3" @submit.prevent="create">
|
||||
<Section title="Create a local account" class="max-w-md">
|
||||
<form class="space-y-3" @submit.prevent="create">
|
||||
<label for="new-account-name" class="block space-y-1 text-sm">Name<Input id="new-account-name" v-model="name" required maxlength="200" autocomplete="off" /></label>
|
||||
<label for="new-account-email" class="block space-y-1 text-sm">Email<Input id="new-account-email" v-model="email" type="email" required autocomplete="off" :spellcheck="false" /></label>
|
||||
<label for="new-account-password" class="block space-y-1 text-sm">Initial password<Input id="new-account-password" v-model="password" type="password" required minlength="15" maxlength="1024" autocomplete="new-password" /></label>
|
||||
@@ -22,5 +22,5 @@ async function create(){busy.value=true;error.value="";try{await api.createAccou
|
||||
<p v-if="error" role="alert" class="text-sm text-danger">{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></p>
|
||||
<Button type="submit" :disabled="busy">Create account</Button>
|
||||
</form>
|
||||
</section>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { api } from "@/lib/api";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
interface PersonalToken {
|
||||
id: string;
|
||||
@@ -67,7 +68,7 @@ onMounted(load);
|
||||
<ul v-if="tokens.length" class="divide-y divide-border" aria-label="API tokens">
|
||||
<li v-for="token in tokens" :key="token.id" class="flex items-center gap-3 py-2">
|
||||
<code class="flex-1 truncate text-xs">{{ token.id.slice(0, 12) }}</code>
|
||||
<span class="text-xs text-fg-subtle">{{ new Date(token.created_at).toLocaleString() }}</span>
|
||||
<span class="text-xs text-fg-subtle"><Timestamp :at="token.created_at" /></span>
|
||||
<Button variant="ghost" size="sm" class="text-danger" :disabled="busy" @click="revoke(token.id)">Revoke</Button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { RouterLink } from "vue-router";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { groupBySeverity, type AlertSeverity, type OperatorAlert } from "./alerts";
|
||||
import { useAlerts } from "./use-alerts";
|
||||
|
||||
@@ -53,7 +53,7 @@ function failedDeliveries(alert: OperatorAlert): number {
|
||||
<CheckCheck class="size-4" aria-hidden="true" />
|
||||
</Button>
|
||||
<section v-for="group in groups" :key="group.severity" class="border-b p-3 last:border-b-0">
|
||||
<h3 class="mb-2 text-sm font-semibold">{{ group.label }}</h3>
|
||||
<h3 class="mb-2 text-caption font-semibold text-fg-subtle">{{ group.label }}</h3>
|
||||
<ul class="grid gap-4">
|
||||
<li v-for="alert in group.alerts" :key="alert.id" class="flex items-start justify-between gap-2">
|
||||
<component
|
||||
@@ -63,16 +63,11 @@ function failedDeliveries(alert: OperatorAlert): number {
|
||||
:class="alert.link && 'group'"
|
||||
@click="alert.link && (open = false)"
|
||||
>
|
||||
<span class="text-sm font-medium group-hover:underline">{{ alert.title }}</span>
|
||||
<span class="text-label font-medium group-hover:underline">{{ alert.title }}</span>
|
||||
<span v-if="alert.body" class="text-label leading-snug text-fg-muted">{{ alert.body }}</span>
|
||||
<span v-if="failedDeliveries(alert)" class="text-xs text-warn">Webhook delivery failed.</span>
|
||||
</component>
|
||||
<time
|
||||
class="mt-0.5 shrink-0 text-xs whitespace-nowrap text-fg-subtle"
|
||||
:datetime="alert.first_raised"
|
||||
:title="new Date(alert.first_raised).toLocaleString()"
|
||||
>{{ ago(alert.first_raised) }}</time
|
||||
>
|
||||
<Timestamp :at="alert.first_raised" class="mt-0.5 shrink-0 text-xs whitespace-nowrap text-fg-subtle" />
|
||||
<Button variant="ghost" size="icon-sm" class="-mr-2 shrink-0" :aria-label="`Dismiss ${alert.title}`" title="Dismiss" @click="dismiss(alert)"><X /></Button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -307,7 +307,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
|
||||
</FieldGroup>
|
||||
|
||||
<section v-if="props.binding" class="mt-4 flex flex-col gap-2">
|
||||
<h3 class="text-sm font-medium">Recent dispatches</h3>
|
||||
<h3 class="text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Recent dispatches</h3>
|
||||
<DispatchLinks kind="bindings" :id="props.binding.id" />
|
||||
</section>
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import { Check, Pause, Pencil, Play, Trash2 } from "@lucide/vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import BindingStatusBadge from "./BindingStatusBadge.vue";
|
||||
import { eventTypeLabel, type EventType } from "@/captures/event-types";
|
||||
@@ -90,31 +92,19 @@ const emit = defineEmits<{
|
||||
>
|
||||
<Check data-icon="inline-start" />
|
||||
Approve</Button>
|
||||
<Button
|
||||
v-if="props.binding.status === 'armed'"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="emit('pause', props.binding)"
|
||||
>
|
||||
<Pause data-icon="inline-start" />
|
||||
Pause</Button>
|
||||
<!-- Resuming returns the binding to pending approval, so it is
|
||||
approved again before it fires. -->
|
||||
<Button
|
||||
v-if="props.binding.status === 'paused'"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="emit('resume', props.binding)"
|
||||
>
|
||||
<Play data-icon="inline-start" />
|
||||
Resume</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="emit('delete', props.binding)"
|
||||
>
|
||||
<Trash2 data-icon="inline-start" />
|
||||
Delete</Button>
|
||||
<MoreMenu :label="`More actions for ${props.binding.name}`">
|
||||
<DropdownMenuItem
|
||||
v-if="props.binding.status === 'armed'"
|
||||
@select="emit('pause', props.binding)"
|
||||
><Pause />Pause</DropdownMenuItem>
|
||||
<!-- Resuming returns the binding to pending approval, so it is
|
||||
approved again before it fires. -->
|
||||
<DropdownMenuItem
|
||||
v-if="props.binding.status === 'paused'"
|
||||
@select="emit('resume', props.binding)"
|
||||
><Play />Resume</DropdownMenuItem>
|
||||
<DropdownMenuItem variant="destructive" @select="emit('delete', props.binding)"><Trash2 />Delete</DropdownMenuItem>
|
||||
</MoreMenu>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -65,8 +65,7 @@ const failureTitle = computed(() =>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
<Card v-else>
|
||||
<CardContent>
|
||||
<Section v-else>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -103,6 +102,5 @@ const failureTitle = computed(() =>
|
||||
</template>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
/**
|
||||
* The dispatch ledger rows for one binding, capture or task, each linking the
|
||||
@@ -76,7 +76,7 @@ const captureLink = (id: string) => ({
|
||||
>
|
||||
<span v-else>{{ d.reason || "claimed, no task recorded" }}</span>
|
||||
</template>
|
||||
<span>{{ ago(d.dispatched_at) }}</span>
|
||||
<Timestamp :at="d.dispatched_at" />
|
||||
</li>
|
||||
</ul>
|
||||
<p v-else-if="props.kind !== 'tasks'" class="text-xs text-fg-muted">No dispatches yet.</p>
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { captureSignature } from "./capture-signature";
|
||||
import CapturePayload from "./CapturePayload.vue";
|
||||
import DispatchLinks from "@/bindings/DispatchLinks.vue";
|
||||
@@ -54,13 +54,7 @@ const signature = computed(() =>
|
||||
const meta = computed(() => {
|
||||
const capture = selected.value;
|
||||
if (!capture) return "";
|
||||
return [
|
||||
ago(capture.received_at),
|
||||
capture.content_type || "no content type",
|
||||
capture.remote_addr,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" · ");
|
||||
return [capture.content_type || "no content type", capture.remote_addr].filter(Boolean).join(" · ");
|
||||
});
|
||||
|
||||
watch(selected, () => {
|
||||
@@ -79,7 +73,7 @@ watch(selected, () => {
|
||||
signature.label
|
||||
}}</Badge>
|
||||
</CardTitle>
|
||||
<CardDescription>{{ meta }}</CardDescription>
|
||||
<CardDescription><Timestamp :at="selected.received_at" /> · {{ meta }}</CardDescription>
|
||||
</CardHeader>
|
||||
<!-- Stacked there is no sibling to be bound by, so the panel caps itself
|
||||
the way the task log does rather than letting one large payload
|
||||
@@ -92,7 +86,7 @@ watch(selected, () => {
|
||||
<CapturePayload label="Payload" :raw="selected.body" />
|
||||
<CapturePayload label="Headers" :raw="selected.headers" />
|
||||
<section class="flex flex-col gap-2">
|
||||
<h3 class="text-sm font-medium">Dispatches</h3>
|
||||
<h3 class="text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Dispatches</h3>
|
||||
<DispatchLinks kind="captures" :id="selected.id" />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ const text = computed(() => prettyPrint(props.raw));
|
||||
<template>
|
||||
<section class="min-w-0">
|
||||
<h3
|
||||
class="mb-2 text-xs font-semibold tracking-[0.05em] text-fg-subtle uppercase"
|
||||
class="mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase"
|
||||
>
|
||||
{{ label }}
|
||||
</h3>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { computed } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { eventTypes } from "./event-type-state";
|
||||
import { captureIdentity } from "./event-types";
|
||||
import { captureSignature } from "./capture-signature";
|
||||
@@ -52,9 +52,7 @@ function open(): void {
|
||||
<TableCell class="font-mono">{{
|
||||
props.capture.source || "(unknown)"
|
||||
}}</TableCell>
|
||||
<TableCell :title="props.capture.received_at || ''">{{
|
||||
ago(props.capture.received_at)
|
||||
}}</TableCell>
|
||||
<TableCell><Timestamp :at="props.capture.received_at" /></TableCell>
|
||||
<!-- An unidentified capture is never dispatched. -->
|
||||
<TableCell>
|
||||
<div class="flex items-center gap-1">
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
|
||||
import { Section } from "@/components/ui/section";
|
||||
import CapturesList from "./CapturesList.vue";
|
||||
|
||||
/** The captured events panel, with the note that qualifies everything inside
|
||||
@@ -17,12 +11,7 @@ import CapturesList from "./CapturesList.vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Recent captures</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CapturesList />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Section title="Recent captures" class="mb-0">
|
||||
<CapturesList />
|
||||
</Section>
|
||||
</template>
|
||||
@@ -24,13 +24,7 @@ import {
|
||||
EmptyHeader,
|
||||
EmptyTitle,
|
||||
} from "@/components/ui/empty";
|
||||
import {
|
||||
Card,
|
||||
CardAction,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -65,16 +59,13 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card v-if="eventTypesEnabled">
|
||||
<CardHeader>
|
||||
<CardTitle>Event types</CardTitle>
|
||||
<CardAction>
|
||||
<Button variant="outline" size="sm" @click="pasteExample()"
|
||||
><ClipboardPaste />From payload</Button
|
||||
>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent class="flex flex-col gap-6">
|
||||
<Section v-if="eventTypesEnabled" title="Event types" class="mb-0">
|
||||
<template #action>
|
||||
<Button variant="outline" size="sm" @click="pasteExample()"
|
||||
><ClipboardPaste />From payload</Button
|
||||
>
|
||||
</template>
|
||||
<div class="flex flex-col gap-6">
|
||||
<Alert v-if="eventTypesError" variant="destructive">
|
||||
<TriangleAlert />
|
||||
<AlertTitle>Event types</AlertTitle>
|
||||
@@ -167,8 +158,8 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
|
||||
<EmptyTitle>No event types yet</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</Section>
|
||||
<EventTypeDialog />
|
||||
<AlertDialog
|
||||
:open="pendingDelete !== null"
|
||||
|
||||
@@ -3,7 +3,6 @@ import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
|
||||
import HistoryLink from "@/settings/HistoryLink.vue";
|
||||
import { computed, onMounted, reactive, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { Send } from "@lucide/vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -93,7 +92,7 @@ const opened = reactive({ telegram: false });
|
||||
const shown = (id: keyof typeof opened) => configured.value[id] || opened[id];
|
||||
|
||||
const channels = [
|
||||
{ id: "telegram", title: "Telegram", icon: Send },
|
||||
{ id: "telegram", title: "Telegram" },
|
||||
] as const;
|
||||
|
||||
const allowedUsers = computed({
|
||||
@@ -123,49 +122,32 @@ const models = computed({
|
||||
</p>
|
||||
|
||||
<template v-if="chat">
|
||||
<section
|
||||
v-for="channel in channels"
|
||||
:key="channel.id"
|
||||
class="mb-4 rounded-lg border border-border bg-card"
|
||||
:aria-labelledby="`ch-${channel.id}`"
|
||||
>
|
||||
<header class="flex items-center gap-3 px-5 py-4">
|
||||
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-fg-muted">
|
||||
<component :is="channel.icon" class="size-4" aria-hidden="true" />
|
||||
</span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<h2 :id="`ch-${channel.id}`" class="text-title font-medium">{{ channel.title }}</h2>
|
||||
<Section v-for="channel in channels" :key="channel.id" :title="channel.title" :class="!shown(channel.id) && 'gap-0'">
|
||||
<template #action>
|
||||
<div class="flex items-center gap-2">
|
||||
<Badge v-if="configured[channel.id] && statusOf(channel.id)" :variant="statusOf(channel.id)!.tone">{{
|
||||
statusOf(channel.id)!.label
|
||||
}}</Badge>
|
||||
<Button v-if="!configured[channel.id] && !opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">Set up</Button>
|
||||
</div>
|
||||
<Badge v-if="configured[channel.id] && statusOf(channel.id)" :variant="statusOf(channel.id)!.tone">{{
|
||||
statusOf(channel.id)!.label
|
||||
}}</Badge>
|
||||
<template v-if="!configured[channel.id]">
|
||||
<Button v-if="!opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">Set up</Button>
|
||||
</template>
|
||||
</header>
|
||||
</template>
|
||||
<template v-if="shown(channel.id) && channel.id === 'telegram'">
|
||||
<SettingRow label="Bot token" hint="Empty disables Telegram.">
|
||||
<SecretRefField v-model="chat.telegram.token_ref" id-prefix="tg-token" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Allowed users" hint="Everyone else is ignored.">
|
||||
<TagsInput v-model="allowedUsers" aria-label="Allowed users" class="font-mono">
|
||||
<TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="Add user ID" />
|
||||
</TagsInput>
|
||||
</SettingRow>
|
||||
</template>
|
||||
</Section>
|
||||
|
||||
<div v-if="shown(channel.id)" class="px-5 pb-2">
|
||||
<template v-if="channel.id === 'telegram'">
|
||||
<SettingRow label="Bot token" hint="Empty disables Telegram.">
|
||||
<SecretRefField
|
||||
v-model="chat.telegram.token_ref"
|
||||
id-prefix="tg-token"
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow label="Allowed users" hint="Everyone else is ignored.">
|
||||
<TagsInput v-model="allowedUsers" aria-label="Allowed users" class="font-mono">
|
||||
<TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="Add user ID" />
|
||||
</TagsInput>
|
||||
</SettingRow>
|
||||
</template>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<Section class="mt-8" title="Chat session defaults">
|
||||
<Section title="Chat session defaults">
|
||||
<SettingRow label="Workspace" for="cs-workspace" hint="Empty disables file tools.">
|
||||
<Input id="cs-workspace" v-model="chat.workspace" class="max-w-md font-mono" />
|
||||
</SettingRow>
|
||||
@@ -212,6 +194,5 @@ const models = computed({
|
||||
</SettingRow>
|
||||
</Section>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { useSessionStore } from "@/stores/session";
|
||||
|
||||
// Silent while the stream is live or opening for the first time; only a lost
|
||||
@@ -15,11 +16,7 @@ const { streamState } = storeToRefs(useSessionStore());
|
||||
class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden"
|
||||
:class="streamState === 'unavailable' ? 'text-danger' : 'text-warn'"
|
||||
>
|
||||
<span
|
||||
class="size-1.5 rounded-full"
|
||||
:class="streamState === 'unavailable' ? 'bg-danger' : 'bg-warn'"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<StatusDot :tone="streamState === 'unavailable' ? 'danger' : 'warn'" />
|
||||
{{ streamState === "unavailable" ? "Disconnected" : "Reconnecting" }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -38,7 +38,7 @@ watch(activePath, revealActive, { flush: "post" });
|
||||
:to="entry.path"
|
||||
:aria-current="activePath === entry.path ? 'page' : undefined"
|
||||
:data-current="activePath === entry.path ? '' : undefined"
|
||||
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
|
||||
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-label font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
|
||||
>{{ entry.label }}</RouterLink
|
||||
>
|
||||
</nav>
|
||||
|
||||
@@ -57,7 +57,7 @@ watch(() => route.path, () => (open.value = false));
|
||||
:to="entry.path"
|
||||
:aria-current="activePath === entry.path ? 'page' : undefined"
|
||||
:data-current="activePath === entry.path ? '' : undefined"
|
||||
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center gap-3 rounded-md px-3 text-sm font-medium transition-colors outline-none focus-visible:ring-[3px]"
|
||||
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center gap-3 rounded-md px-3 text-label font-medium transition-colors outline-none focus-visible:ring-[3px]"
|
||||
><component :is="icons[entry.path]" v-if="icons[entry.path]" class="size-4" aria-hidden="true" />{{ entry.label }}</RouterLink
|
||||
>
|
||||
</nav>
|
||||
|
||||
@@ -9,7 +9,7 @@ export interface CuratorActionEntry {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
const props = defineProps<{ action: CuratorActionEntry }>();
|
||||
</script>
|
||||
@@ -20,7 +20,7 @@ const props = defineProps<{ action: CuratorActionEntry }>();
|
||||
<span class="text-sm font-medium">{{
|
||||
props.action.type || "action"
|
||||
}}</span>
|
||||
<span class="text-xs text-fg-subtle">{{ ago(props.action.at) }}</span>
|
||||
<span class="text-xs text-fg-subtle"><Timestamp :at="props.action.at" /></span>
|
||||
</div>
|
||||
<p v-if="props.action.detail" class="mt-1 text-sm text-fg-muted">
|
||||
{{ props.action.detail }}
|
||||
|
||||
@@ -14,15 +14,9 @@ export interface Curator {
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} 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 { ago } from "@/lib/format";
|
||||
import CuratorAction from "./CuratorAction.vue";
|
||||
|
||||
const props = defineProps<{ curator: Curator }>();
|
||||
@@ -42,21 +36,18 @@ function healthKind(status: string | undefined): StatusKind {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{{ props.curator.name }}</CardTitle>
|
||||
<CardDescription>
|
||||
{{
|
||||
props.curator.last_run_at
|
||||
? `Last ran ${ago(props.curator.last_run_at)} · ${props.curator.last_run_actions} action${props.curator.last_run_actions === 1 ? "" : "s"}`
|
||||
: "Has not run yet"
|
||||
}}
|
||||
</CardDescription>
|
||||
<Section :title="props.curator.name" class="mb-0">
|
||||
<template #action>
|
||||
<Badge :variant="healthKind(props.curator.health?.status)">
|
||||
{{ props.curator.health?.status || "unknown" }}
|
||||
</Badge>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
</template>
|
||||
<p class="mb-3 text-xs text-fg-subtle">
|
||||
<template v-if="props.curator.last_run_at">
|
||||
Last ran <Timestamp :at="props.curator.last_run_at" /> · {{ props.curator.last_run_actions }} action{{ props.curator.last_run_actions === 1 ? "" : "s" }}
|
||||
</template>
|
||||
<template v-else>Has not run yet</template>
|
||||
</p>
|
||||
<p
|
||||
v-if="props.curator.health?.message"
|
||||
class="mb-3 text-sm text-fg-muted"
|
||||
@@ -78,6 +69,5 @@ function healthKind(status: string | undefined): StatusKind {
|
||||
<EmptyTitle>No activity</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { DurationInput } from "@/components/ui/duration-input";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
|
||||
@@ -73,8 +74,8 @@ onMounted(load);
|
||||
<div v-if="editing" class="mb-6">
|
||||
<form class="mb-4 flex gap-2" @submit.prevent="add"><Input v-model="newName" aria-label="Curator name" placeholder="Curator name" class="max-w-xs" /><Button type="submit" :disabled="!newName.trim() || definitions?.some(def => def.name === newName.trim())">Add curator</Button></form>
|
||||
<Empty v-if="!definitions?.length"><EmptyHeader><EmptyTitle>No custom curator definitions</EmptyTitle></EmptyHeader></Empty>
|
||||
<section v-for="(def, index) in definitions" :key="index" class="mb-6 border-t pt-4">
|
||||
<div class="flex items-center justify-between"><h2 class="font-mono text-sm">{{ def.name }}</h2><Button variant="ghost" size="sm" @click="definitions!.splice(index, 1)">Remove curator</Button></div>
|
||||
<Section v-for="(def, index) in definitions" :key="index" :title="def.name">
|
||||
<template #action><Button variant="ghost" size="sm" @click="definitions!.splice(index, 1)">Remove curator</Button></template>
|
||||
<SettingRow label="Enabled"><Switch v-model="def.enabled" :aria-label="`${def.name} enabled`" /></SettingRow>
|
||||
<SettingRow label="Instructions" :for="`curator-${index}-instructions`"><Textarea :id="`curator-${index}-instructions`" v-model="def.instructions" /></SettingRow>
|
||||
<SettingRow label="Interval"><DurationInput v-model="def.interval" :units="['s', 'm', 'h']" /></SettingRow>
|
||||
@@ -85,7 +86,7 @@ onMounted(load);
|
||||
<SettingRow label="Memory engine" :for="`curator-${index}-memory`"><Input :id="`curator-${index}-memory`" v-model="def.memory_engine" /></SettingRow>
|
||||
<SettingRow label="Conversations"><Switch v-model="def.conversations" :aria-label="`${def.name} conversations`" /></SettingRow>
|
||||
<SettingRow label="Model" :for="`curator-${index}-model`"><Input :id="`curator-${index}-model`" v-model="def.model" placeholder="Default model" /></SettingRow>
|
||||
</section>
|
||||
</Section>
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed } from "vue";
|
||||
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
import { activityDetail } from "./activity-detail";
|
||||
import { describeTimelineEvent } from "@/tasks/timeline-event";
|
||||
@@ -30,10 +30,6 @@ function open() {
|
||||
if (taskID.value > 0) emit("open", taskID.value);
|
||||
}
|
||||
|
||||
// A missing timestamp gets a dash, not a call to ago(): substituting
|
||||
// Date.now() would render "just now" for an event whose time the daemon never
|
||||
// recorded -- a claim the row cannot back.
|
||||
const when = computed(() => (props.event.at ? ago(props.event.at) : "\u2013"));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -59,6 +55,6 @@ const when = computed(() => (props.event.at ? ago(props.event.at) : "\u2013"));
|
||||
>{{ detail.text }}</span
|
||||
>
|
||||
</TableCell>
|
||||
<TableCell>{{ when }}</TableCell>
|
||||
<TableCell><Timestamp :at="event.at" /></TableCell>
|
||||
</TableRow>
|
||||
</template>
|
||||
@@ -5,13 +5,9 @@ import { useRouter } from "vue-router";
|
||||
|
||||
import { ChevronDown, ChevronRight } from "@lucide/vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Card,
|
||||
CardAction,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import {
|
||||
@@ -22,7 +18,6 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { ago } from "@/lib/format";
|
||||
import { useSessionStore } from "@/stores/session";
|
||||
import { useTasksStore } from "@/stores/tasks";
|
||||
import { useAlerts } from "@/alerts/use-alerts";
|
||||
@@ -89,26 +84,18 @@ function groupDetail(group: ActivityGroup) {
|
||||
return activityDetail(group.representative, identities.identityName);
|
||||
}
|
||||
|
||||
function groupWhen(group: ActivityGroup) {
|
||||
return group.representative.at ? ago(group.representative.at) : "\u2013";
|
||||
}
|
||||
|
||||
function openTask(taskID: number) {
|
||||
void router.push(`/tasks?task=${encodeURIComponent(taskID)}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Activity<span v-if="running" class="font-normal text-fg-subtle"> · {{ running }} running</span></CardTitle>
|
||||
<CardAction class="flex items-center gap-2">
|
||||
<Section :title="running ? `Activity · ${running} running` : 'Activity'" class="mb-0">
|
||||
<template #action>
|
||||
<ToggleGroup type="single" variant="outline" size="sm" :model-value="filter" aria-label="Filter activity" @update:model-value="(value) => { if (value) filter = value as typeof filter; }">
|
||||
<ToggleGroupItem v-for="option in ACTIVITY_FILTERS" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
</template>
|
||||
<!--
|
||||
role="region" names the table for landmark navigation; aria-live is
|
||||
polite, not assertive, because rows arrive constantly while the stream
|
||||
@@ -138,7 +125,7 @@ function openTask(taskID: number) {
|
||||
<TableRow v-for="alert in pinned" :key="`alert:${alert.id}`">
|
||||
<TableCell class="font-medium">
|
||||
<span class="inline-flex items-center gap-1.5">
|
||||
<span class="size-1.5 rounded-full bg-warn" aria-hidden="true" />Alert
|
||||
<StatusDot tone="warn" />Alert
|
||||
<Badge v-if="alert.count > 1" variant="idle">×{{ alert.count }}</Badge>
|
||||
</span>
|
||||
</TableCell>
|
||||
@@ -149,7 +136,7 @@ function openTask(taskID: number) {
|
||||
<RouterLink v-if="alert.link" :to="alert.link" class="shrink-0 text-warn hover:underline">Fix →</RouterLink>
|
||||
</span>
|
||||
</TableCell>
|
||||
<TableCell>{{ ago(alert.last_seen) }}</TableCell>
|
||||
<TableCell><Timestamp :at="alert.last_seen" /></TableCell>
|
||||
</TableRow>
|
||||
<TableRow v-if="!shown.length && !pinned.length">
|
||||
<TableCell colspan="4">
|
||||
@@ -225,7 +212,7 @@ function openTask(taskID: number) {
|
||||
>{{ groupDetail(group).text }}</span
|
||||
>
|
||||
</TableCell>
|
||||
<TableCell>{{ groupWhen(group) }}</TableCell>
|
||||
<TableCell><Timestamp :at="group.representative.at" /></TableCell>
|
||||
</TableRow>
|
||||
<template v-if="isOpen(group)">
|
||||
<ActivityRow
|
||||
@@ -242,6 +229,5 @@ function openTask(taskID: number) {
|
||||
</Table>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@ import { computed } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { attentionStatusIds, statusLabel } from "@/lib/task-meta";
|
||||
import TaskRowActions from "@/tasks/TaskRowActions.vue";
|
||||
import type { Task } from "@/tasks/TaskRow.vue";
|
||||
@@ -28,15 +28,11 @@ function meta(task: AttentionTask): string {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card v-if="waiting.length">
|
||||
<CardHeader>
|
||||
<CardTitle>Needs attention</CardTitle>
|
||||
<CardAction>
|
||||
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_you">All tasks</RouterLink></Button>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ul class="divide-y divide-border">
|
||||
<Section v-if="waiting.length" title="Needs attention" class="mb-0">
|
||||
<template #action>
|
||||
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_you">All tasks</RouterLink></Button>
|
||||
</template>
|
||||
<ul class="divide-y divide-border">
|
||||
<li v-for="task in waiting" :key="task.id" class="flex flex-wrap items-center gap-3 py-2">
|
||||
<Badge variant="warn">{{ statusLabel(task.status ?? "") }}</Badge>
|
||||
<div class="min-w-0 flex-1">
|
||||
@@ -47,7 +43,6 @@ function meta(task: AttentionTask): string {
|
||||
</div>
|
||||
<TaskRowActions :task="task" @done="loadDashboard" />
|
||||
</li>
|
||||
</ul>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</ul>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@ import { useRouter } from "vue-router";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select";
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { api } from "@/lib/api";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
@@ -78,9 +78,14 @@ async function run() {
|
||||
<form class="grid gap-1.5" @submit.prevent="run">
|
||||
<div class="flex gap-2 max-sm:flex-wrap">
|
||||
<Input v-model="prompt" class="min-w-0 flex-1" placeholder="Describe a task" aria-label="Task" />
|
||||
<NativeSelect v-model="workflow" aria-label="Workflow" class="text-label" :disabled="!definitions.length">
|
||||
<NativeSelectOption v-for="d in definitions" :key="d.id" :value="d.id">{{ d.name || d.id }}</NativeSelectOption>
|
||||
</NativeSelect>
|
||||
<Select v-model="workflow" :disabled="!definitions.length">
|
||||
<SelectTrigger class="w-48 max-sm:flex-1" aria-label="Workflow"><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="d in definitions" :key="d.id" :value="d.id">{{ d.name || d.id }}</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button type="submit" :disabled="!prompt.trim() || !workflow || submitting">
|
||||
<Spinner v-if="submitting" data-icon="inline-start" />Run
|
||||
</Button>
|
||||
|
||||
@@ -3,13 +3,7 @@ import { storeToRefs } from "pinia";
|
||||
import { Check, Circle } from "@lucide/vue";
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import {
|
||||
Card,
|
||||
CardAction,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { setupPanelState, type SetupPanelState } from "./setup-preference";
|
||||
import { useTasksStore } from "@/stores/tasks";
|
||||
|
||||
@@ -37,22 +31,17 @@ const pct = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card v-if="panel.kind === 'incomplete'" size="sm">
|
||||
<CardHeader>
|
||||
<CardTitle>Setup</CardTitle>
|
||||
<CardAction>
|
||||
<span class="text-sm font-semibold text-link tabular-nums">{{ pct }}%</span>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ul class="grid gap-2 text-sm">
|
||||
<li v-for="(step, i) in steps" :key="i" class="flex items-center gap-2">
|
||||
<Check v-if="step.done" class="size-3.5 shrink-0 text-ok" aria-label="Done" />
|
||||
<Circle v-else class="size-3.5 shrink-0 text-fg-subtle" aria-label="To do" />
|
||||
<RouterLink v-if="!step.done && step.path" :to="step.path" class="font-medium hover:underline">{{ step.title }}</RouterLink>
|
||||
<span v-else :class="step.done ? 'text-fg-muted' : 'font-medium'">{{ step.title }}</span>
|
||||
<Section v-if="panel.kind === 'incomplete'" title="Setup" class="mb-0">
|
||||
<template #action>
|
||||
<span class="text-label font-semibold text-link tabular-nums">{{ pct }}%</span>
|
||||
</template>
|
||||
<ul class="grid gap-2 text-label">
|
||||
<li v-for="(step, i) in steps" :key="i" class="flex items-center gap-2">
|
||||
<Check v-if="step.done" class="size-3.5 shrink-0 text-ok" aria-label="Done" />
|
||||
<Circle v-else class="size-3.5 shrink-0 text-fg-subtle" aria-label="To do" />
|
||||
<RouterLink v-if="!step.done && step.path" :to="step.path" class="font-medium hover:underline">{{ step.title }}</RouterLink>
|
||||
<span v-else :class="step.done ? 'text-fg-muted' : 'font-medium'">{{ step.title }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</ul>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -14,7 +14,8 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import type { BadgeVariants } from "@/components/ui/badge";
|
||||
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,
|
||||
@@ -99,12 +100,6 @@ function openTerminal(): void {
|
||||
terminalOpen.value = true;
|
||||
}
|
||||
|
||||
function formatTimestamp(value?: string): string {
|
||||
if (!value) return "–";
|
||||
const at = new Date(value);
|
||||
return Number.isNaN(at.getTime()) ? value : at.toLocaleString();
|
||||
}
|
||||
|
||||
function scopes(binding: HarnessBinding): string {
|
||||
return binding.scopes?.length ? binding.scopes.join(", ") : "–";
|
||||
}
|
||||
@@ -136,8 +131,8 @@ function scopes(binding: HarnessBinding): string {
|
||||
<AlertDescription>Start the daemon with a container runtime and a harness token to log in to a CLI from here.</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
<Card v-else class="mb-4">
|
||||
<CardContent class="flex flex-wrap items-end gap-3">
|
||||
<Section v-else>
|
||||
<div class="flex flex-wrap items-end gap-3">
|
||||
<div class="flex flex-col gap-1 text-sm">
|
||||
<Label for="harness-profile" class="text-fg-muted">Profile</Label>
|
||||
<Select v-model="profile" :disabled="!state.profiles.length">
|
||||
@@ -154,17 +149,14 @@ function scopes(binding: HarnessBinding): string {
|
||||
</Select>
|
||||
</div>
|
||||
<Button :disabled="!profile" @click="openTerminal">Open setup terminal</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Card v-if="terminalOpen && profile" class="mb-4">
|
||||
<CardContent class="h-96">
|
||||
<SetupTerminal :profile="profile" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Section v-if="terminalOpen && profile">
|
||||
<div class="h-96"><SetupTerminal :profile="profile" /></div>
|
||||
</Section>
|
||||
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Section>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -186,16 +178,13 @@ function scopes(binding: HarnessBinding): string {
|
||||
{{ statuses[bindingStatus(binding)].label }}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell>{{ formatTimestamp(binding.expires_at) }}</TableCell>
|
||||
<TableCell><Timestamp :at="binding.expires_at" absolute /></TableCell>
|
||||
<TableCell class="text-fg-muted">{{ scopes(binding) }}</TableCell>
|
||||
<TableCell class="text-fg-muted">
|
||||
{{ formatTimestamp(binding.updated_at) }}
|
||||
</TableCell>
|
||||
<TableCell class="text-fg-muted"><Timestamp :at="binding.updated_at" /></TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,13 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardFooter,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -53,29 +47,16 @@ function onOpenChange(open: boolean) {
|
||||
}}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<Card>
|
||||
<CardContent>
|
||||
<MappingForm />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Section class="mb-0">
|
||||
<MappingForm />
|
||||
</Section>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Bound fields</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<MappingFieldsTable />
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<Button variant="outline" @click="runPreview">Preview</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
<Section title="Bound fields" class="mb-0">
|
||||
<MappingFieldsTable />
|
||||
<Button variant="outline" class="mt-4" @click="runPreview">Preview</Button>
|
||||
</Section>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Payload</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section title="Payload" class="mb-0">
|
||||
<Alert v-if="draft.payloadError" variant="destructive">
|
||||
<AlertDescription>{{ draft.payloadError }}</AlertDescription>
|
||||
</Alert>
|
||||
@@ -85,8 +66,7 @@ function onOpenChange(open: boolean) {
|
||||
@pick="addField"
|
||||
/>
|
||||
<p v-else class="text-sm text-fg-muted">No event selected.</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
|
||||
<!-- Beside the buttons, not at the top: the dialog scrolls, and Save is
|
||||
clicked at the bottom, where a refusal must be seen. -->
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { eventTypeLabel } from "@/captures/event-types";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { matchCountLabel } from "./match-count";
|
||||
import { eventTypes, type Mapping } from "./state";
|
||||
|
||||
@@ -25,9 +25,7 @@ const emit = defineEmits<{
|
||||
mapping.fields?.length ?? 0
|
||||
}}</TableCell>
|
||||
<TableCell class="tabular-nums">{{ matchCountLabel(mapping) }}</TableCell>
|
||||
<TableCell class="text-fg-muted">{{
|
||||
mapping.match_count ? ago(mapping.last_matched_at) : "–"
|
||||
}}</TableCell>
|
||||
<TableCell class="text-fg-muted"><Timestamp :at="mapping.match_count ? mapping.last_matched_at : null" /></TableCell>
|
||||
<TableCell>
|
||||
<div class="flex justify-end gap-2">
|
||||
<Button variant="outline" size="xs" @click="emit('edit', mapping)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -50,8 +50,7 @@ import {
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
<Card v-else>
|
||||
<CardContent>
|
||||
<Section v-else>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -73,6 +72,5 @@ import {
|
||||
/>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@ import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Select,
|
||||
@@ -105,13 +105,9 @@ onMounted(load);
|
||||
|
||||
<div v-if="error" role="alert" class="mb-4 text-sm text-danger"><p>{{ error }}</p><Button variant="outline" size="sm" @click="load">Retry</Button></div>
|
||||
|
||||
<Card class="mb-4">
|
||||
<CardHeader>
|
||||
<CardAction>
|
||||
<Button size="sm" @click="editing = true">New policy</Button>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent class="flex flex-col gap-3">
|
||||
<Section>
|
||||
<template #action><Button size="sm" @click="editing = true">New policy</Button></template>
|
||||
<div class="flex flex-col gap-3">
|
||||
<p v-if="loading" role="status" class="text-sm text-fg-muted">Loading policies…</p>
|
||||
<p v-else-if="!error && !policies.length" class="text-sm text-fg-subtle">No policies yet.</p>
|
||||
<div
|
||||
@@ -133,14 +129,11 @@ onMounted(load);
|
||||
<Button size="sm" variant="outline" @click="remove(p)">Delete</Button>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Card v-if="editing">
|
||||
<CardHeader>
|
||||
<CardTitle>{{ draft.id ? draft.id : "New policy" }}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent class="flex flex-col gap-3">
|
||||
<Section v-if="editing" :title="draft.id ? draft.id : 'New policy'">
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Input v-model="draft.id" placeholder="policy id" class="w-56" />
|
||||
<Select v-model="draft.level">
|
||||
@@ -172,7 +165,7 @@ onMounted(load);
|
||||
<Button :disabled="!canSave || saving" @click="save">Save</Button>
|
||||
<Button variant="outline" @click="(editing = false), (draft = blank())">Cancel</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { api } from "@/lib/api";
|
||||
import { useOrgStore, type Identity } from "@/stores/org";
|
||||
|
||||
@@ -133,8 +134,9 @@ const isAgent = (value: Identity) =>
|
||||
<Button type="submit" size="sm" :disabled="!name.trim() || !!store.identityBusy"><Plus data-icon="inline-start" />Create</Button>
|
||||
</form>
|
||||
|
||||
<ul class="divide-y divide-border rounded-lg border border-border bg-card" aria-label="Agents">
|
||||
<li v-for="value in store.identities" :key="value.id" class="flex flex-wrap items-center gap-3 px-4 py-3">
|
||||
<Section>
|
||||
<ul class="divide-y divide-border" aria-label="Agents">
|
||||
<li v-for="value in store.identities" :key="value.id" class="flex flex-wrap items-center gap-3 py-3 first:pt-0 last:pb-0">
|
||||
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-fg-muted">
|
||||
<component :is="icons[value.kind]" class="size-4" aria-hidden="true" />
|
||||
</span>
|
||||
@@ -181,7 +183,7 @@ const isAgent = (value: Identity) =>
|
||||
<Button variant="ghost" size="sm" class="text-danger" :disabled="!!store.identityBusy" @click="retiring = value">Retire</Button>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="!store.identitiesLoaded" class="px-4 py-3 text-sm text-fg-muted" role="status">Loading agents…</li>
|
||||
<li v-if="!store.identitiesLoaded" class="py-3 text-sm text-fg-muted" role="status">Loading agents…</li>
|
||||
<li v-else-if="!store.identities.length && !store.identityError">
|
||||
<Empty class="py-6">
|
||||
<EmptyHeader>
|
||||
@@ -190,10 +192,9 @@ const isAgent = (value: Identity) =>
|
||||
</Empty>
|
||||
</li>
|
||||
</ul>
|
||||
</Section>
|
||||
|
||||
<div class="mt-8">
|
||||
<IdentityGrantsCard />
|
||||
</div>
|
||||
<IdentityGrantsCard />
|
||||
|
||||
<AlertDialog :open="!!retiring" @update:open="(open) => !open && (retiring = null)">
|
||||
<AlertDialogContent>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import CreateAccount from "@/accounts/CreateAccount.vue";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { Plus, Trash2 } from "@lucide/vue";
|
||||
@@ -138,8 +138,7 @@ const remove = (member: Member) =>
|
||||
|
||||
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{ error }}</p>
|
||||
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Section>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -191,13 +190,11 @@ const remove = (member: Member) =>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
|
||||
<CreateAccount v-if="org?.id===identities.homeOrg" @created="load" />
|
||||
<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>
|
||||
<div class="grid gap-4 lg:grid-cols-2">
|
||||
<Section title="Add an identity" class="mb-0">
|
||||
<form class="flex flex-wrap items-center gap-2" @submit.prevent="add">
|
||||
<Select v-model="picked">
|
||||
<SelectTrigger class="w-64" aria-label="Identity">
|
||||
@@ -220,10 +217,9 @@ const remove = (member: Member) =>
|
||||
<Button type="submit" size="sm" :disabled="!picked || busy !== ''">
|
||||
<Plus data-icon="inline-start" /> Add member</Button>
|
||||
</form>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<div>
|
||||
<h2 class="mb-3 text-sm font-medium">Invite a person</h2>
|
||||
<Section title="Invite a person" class="mb-0">
|
||||
<form class="flex flex-wrap items-center gap-2" @submit.prevent="addPerson">
|
||||
<Input
|
||||
v-model="person"
|
||||
@@ -242,7 +238,7 @@ const remove = (member: Member) =>
|
||||
<Button type="submit" size="sm" :disabled="!person.trim() || busy !== ''">
|
||||
<Plus data-icon="inline-start" /> Invite person</Button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</Section>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -4,6 +4,7 @@ import { computed, onMounted, ref } from "vue";
|
||||
import { Plus, Trash2 } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
import DraftHint from "@/settings/DraftHint.vue";
|
||||
@@ -46,7 +47,6 @@ function addProvider() {
|
||||
newProvider.value = "";
|
||||
}
|
||||
const bound = computed(() => new Set(((store.drafts["credential-bindings"]?.value as { service: string }[] | null) ?? []).map((b) => b.service)));
|
||||
const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -55,9 +55,8 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
<p v-for="e in errors" :key="String(e)" class="mb-4 text-sm text-danger" role="alert">{{ e }}</p>
|
||||
|
||||
<template v-if="aliases">
|
||||
<h2 :class="eyebrow">Aliases</h2>
|
||||
<div class="rounded-lg border border-border bg-card">
|
||||
<div v-for="(model, alias) in aliases" :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">
|
||||
<div v-for="(model, alias) in aliases" :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="`org-alias-${alias}`" class="w-28 font-mono text-sm font-medium">{{ alias }}</label>
|
||||
<Input
|
||||
:id="`org-alias-${alias}`"
|
||||
@@ -71,28 +70,27 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
<span v-if="issue(String(alias))" class="text-xs text-danger">{{ issue(String(alias))?.message }}</span>
|
||||
<Button variant="ghost" size="icon" class="ml-auto" :aria-label="`Remove alias ${alias}`" @click="delete aliases[alias]"><Trash2 /></Button>
|
||||
</div>
|
||||
<form class="flex gap-2 border-t border-border px-4 py-3" @submit.prevent="addAlias">
|
||||
<form class="flex gap-2 border-t border-border pt-3" @submit.prevent="addAlias">
|
||||
<Input v-model="newAlias" class="max-w-56 font-mono" placeholder="alias, e.g. default" 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="providers">
|
||||
<h2 :class="[eyebrow, 'mt-10']">Providers</h2>
|
||||
<div class="rounded-lg border border-border bg-card">
|
||||
<div v-for="(provider, name) in providers" :key="name" 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="Providers">
|
||||
<div v-for="(provider, name) in providers" :key="name" 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 font-mono text-sm font-medium">{{ name }}</span>
|
||||
<Input v-model="provider.class" class="w-36 font-mono" :aria-label="`Class for ${name}`" />
|
||||
<Input v-model="provider.base_url" class="max-w-md flex-1 font-mono max-sm:basis-full" placeholder="base URL (empty: class default)" :aria-label="`Base URL for ${name}`" />
|
||||
<RouterLink v-if="!bound.has(String(name))" to="/org/credential-bindings" class="text-xs text-warn hover:underline">Add a credential binding named "{{ name }}"</RouterLink>
|
||||
<Button variant="ghost" size="icon" class="ml-auto" :aria-label="`Remove provider ${name}`" @click="delete providers[name]"><Trash2 /></Button>
|
||||
</div>
|
||||
<form class="flex gap-2 border-t border-border px-4 py-3" @submit.prevent="addProvider">
|
||||
<form class="flex gap-2 border-t border-border pt-3" @submit.prevent="addProvider">
|
||||
<Input v-model="newProvider" class="max-w-56 font-mono" placeholder="provider name" aria-label="New provider" />
|
||||
<Button type="submit" variant="outline" size="sm" :disabled="!newProvider.trim()"><Plus data-icon="inline-start" />Add provider</Button>
|
||||
</form>
|
||||
</div>
|
||||
</Section>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { Plus } from "@lucide/vue";
|
||||
@@ -84,8 +84,7 @@ async function create(): Promise<void> {
|
||||
|
||||
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{ error }}</p>
|
||||
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Section>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -114,11 +113,9 @@ async function create(): Promise<void> {
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
|
||||
<section class="mt-8" aria-labelledby="new-workspace">
|
||||
<h2 id="new-workspace" class="mb-3 text-sm font-medium">New workspace</h2>
|
||||
<Section title="New workspace">
|
||||
<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 />
|
||||
@@ -126,6 +123,6 @@ async function create(): Promise<void> {
|
||||
<Button type="submit" size="sm" :disabled="!id.trim() || !name.trim() || busy">
|
||||
<Plus data-icon="inline-start" /> Create</Button>
|
||||
</form>
|
||||
</section>
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -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>
|
||||
@@ -10,27 +10,18 @@ export interface Skill {
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
|
||||
/** One catalogue entry: what it is, and where it came from. */
|
||||
const props = defineProps<{ skill: Skill }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{{ props.skill.name || "Untitled skill" }}</CardTitle>
|
||||
<CardDescription>{{
|
||||
props.skill.description || "No description provided."
|
||||
}}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section
|
||||
:title="props.skill.name || 'Untitled skill'"
|
||||
:description="props.skill.description || 'No description provided.'"
|
||||
class="mb-0"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<span class="text-xs text-fg-subtle">{{
|
||||
props.skill.source || "Unknown source"
|
||||
@@ -39,6 +30,5 @@ const props = defineProps<{ skill: Skill }>();
|
||||
props.skill.workflow
|
||||
}}</Badge>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -4,12 +4,7 @@ import { useSettingsStore } from "@/stores/settings";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -54,18 +49,16 @@ const filtered = computed(() => {
|
||||
<PageHeader title="Skills" />
|
||||
<ApplyStatusRows kind="skills" class="mb-4" />
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Catalogue</CardTitle>
|
||||
<Section title="Catalogue">
|
||||
<template #action>
|
||||
<Input
|
||||
v-model="search"
|
||||
type="search"
|
||||
placeholder="Search skills…"
|
||||
aria-label="Search skills"
|
||||
class="max-w-xs"
|
||||
class="w-56 max-w-full"
|
||||
/>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
</template>
|
||||
<div
|
||||
class="grid grid-cols-1 gap-4 lg:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]"
|
||||
>
|
||||
@@ -93,7 +86,6 @@ const filtered = computed(() => {
|
||||
:skill="skill"
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -5,7 +5,7 @@ import { onMounted, ref } from "vue";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Table,
|
||||
@@ -98,8 +98,7 @@ function url(source: Source): string {
|
||||
|
||||
<SourceSecret v-if="revealed" :source="revealed" @dismiss="revealed = null" />
|
||||
|
||||
<Card v-if="sources && sources.length">
|
||||
<CardContent>
|
||||
<Section v-if="sources && sources.length">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -220,7 +219,6 @@ function url(source: Source): string {
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
import ChangeFileTable from "./ChangeFileTable.vue";
|
||||
import { captureLinks, totalsLabel } from "./changed-files";
|
||||
@@ -27,9 +27,7 @@ const prNumber = computed(() => props.capture.pr_number);
|
||||
: "Captured"
|
||||
}}<span v-if="capture.stage"> in stage {{ capture.stage }}</span>
|
||||
</span>
|
||||
<span class="text-xs text-fg-muted">{{
|
||||
capture.captured_at ? ago(capture.captured_at) : ""
|
||||
}}</span>
|
||||
<span v-if="capture.captured_at" class="text-xs text-fg-muted"><Timestamp :at="capture.captured_at" /></span>
|
||||
</div>
|
||||
<div
|
||||
class="mt-2 mb-3 flex flex-wrap items-center gap-3 text-xs text-fg-muted"
|
||||
|
||||
@@ -21,6 +21,7 @@ import { statusKind, statusLabel } from "@/lib/task-meta";
|
||||
import { cn } from "@/lib/utils";
|
||||
import DispatchLinks from "@/bindings/DispatchLinks.vue";
|
||||
import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import StartNewRun from "./StartNewRun.vue";
|
||||
import TaskRowActions from "./TaskRowActions.vue";
|
||||
import { shownActionIds } from "./task-actions";
|
||||
@@ -145,25 +146,20 @@ const headerActions = computed(() =>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="description" class="mt-4">
|
||||
<h2 class="text-sm font-medium">Description</h2>
|
||||
<p class="mt-1 whitespace-pre-wrap break-words text-sm text-fg-muted">{{ description }}</p>
|
||||
</div>
|
||||
<Section v-if="description" title="Description" class="mt-4 mb-0">
|
||||
<p class="whitespace-pre-wrap break-words text-sm text-fg-muted">{{ description }}</p>
|
||||
</Section>
|
||||
|
||||
<div
|
||||
v-if="sections.length || run.attempts?.called_by"
|
||||
class="mt-3 flex w-fit max-w-full flex-wrap gap-x-10 gap-y-4 rounded-xl bg-card p-4 ring-1 ring-foreground/10"
|
||||
>
|
||||
<div v-if="sections.length || run.attempts?.called_by" class="mt-3 flex flex-wrap items-start gap-3">
|
||||
<p v-if="run.attempts?.called_by" class="text-xs text-fg-subtle">
|
||||
Called by
|
||||
<RouterLink :to="`/tasks/${run.attempts.called_by}`" class="font-mono text-fg-muted hover:text-foreground hover:underline"
|
||||
>task #{{ run.attempts.called_by }}</RouterLink
|
||||
>
|
||||
</p>
|
||||
<section v-for="section in sections" :key="section.title" :aria-label="section.title" class="min-w-0">
|
||||
<h2 class="mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">{{ section.title }}</h2>
|
||||
<Section v-for="section in sections" :key="section.title" :title="section.title" class="mb-0 min-w-0">
|
||||
<MetadataList :rows="section.rows" class="text-fg-muted" />
|
||||
</section>
|
||||
</Section>
|
||||
</div>
|
||||
|
||||
<Alert
|
||||
|
||||
+13
-16
@@ -2,12 +2,14 @@
|
||||
import { computed } from "vue";
|
||||
import { ArrowUpRight } from "@lucide/vue";
|
||||
|
||||
import { ago, compact } from "@/lib/format";
|
||||
import { compact } from "@/lib/format";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { stageStatusMeta } from "./stage-rail";
|
||||
import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import StageRail from "./StageRail.vue";
|
||||
import { STATUS_FILL } from "@/lib/status";
|
||||
import { useTaskRun } from "./use-task-run";
|
||||
import { duration } from "./timeline-event";
|
||||
|
||||
@@ -16,7 +18,7 @@ import { duration } from "./timeline-event";
|
||||
const run = useTaskRun();
|
||||
|
||||
const attempts = computed(() => [...(run.attempts?.attempts ?? [])].reverse());
|
||||
const dot = (status?: string) => STATUS_FILL[stageStatusMeta(status).kind];
|
||||
const tone = (status?: string) => stageStatusMeta(status).kind;
|
||||
const details = computed(() => {
|
||||
const task = run.task;
|
||||
if (!task) return [];
|
||||
@@ -28,14 +30,11 @@ const details = computed(() => {
|
||||
if (task.tokens_used) rows.push({ label: "Tokens", value: compact(task.tokens_used), mono: true });
|
||||
return rows;
|
||||
});
|
||||
const panel = "rounded-xl bg-card p-4 ring-1 ring-foreground/10";
|
||||
const heading = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<aside class="grid gap-4" aria-label="Task details">
|
||||
<section v-if="attempts.length" :class="panel" aria-labelledby="rail-attempts">
|
||||
<h2 id="rail-attempts" :class="heading">Attempts</h2>
|
||||
<Section v-if="attempts.length" title="Attempts" class="mb-0">
|
||||
<ul class="flex flex-col gap-0.5">
|
||||
<li v-for="a in attempts" :key="a.attempt">
|
||||
<button
|
||||
@@ -49,24 +48,22 @@ const heading = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
"
|
||||
@click="run.selectAttempt(Number(a.attempt))"
|
||||
>
|
||||
<span class="size-2 shrink-0 rounded-full" :class="dot(a.status)" aria-hidden="true" />
|
||||
<StatusDot :tone="tone(a.status)" />
|
||||
<span class="flex-1">Attempt {{ a.attempt }}</span>
|
||||
<span class="text-xs text-fg-subtle">{{ a.status ? stageStatusMeta(a.status).label : "" }}</span>
|
||||
</button>
|
||||
<p v-if="a.started_at" class="px-3 pb-1 pl-7 text-xs text-fg-subtle">
|
||||
{{ ago(a.started_at) }}<template v-if="a.duration_ms"> · {{ duration(a.duration_ms) }}</template>
|
||||
<Timestamp :at="a.started_at" /><template v-if="a.duration_ms"> · {{ duration(a.duration_ms) }}</template>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</Section>
|
||||
|
||||
<section :class="panel" aria-labelledby="rail-stages">
|
||||
<h2 id="rail-stages" :class="heading">Stages</h2>
|
||||
<Section title="Stages" class="mb-0">
|
||||
<StageRail :state="run.attempts" />
|
||||
</section>
|
||||
</Section>
|
||||
|
||||
<section v-if="run.task" :class="panel" aria-labelledby="rail-details">
|
||||
<h2 id="rail-details" :class="heading">Details</h2>
|
||||
<Section v-if="run.task" title="Details" class="mb-0">
|
||||
<MetadataList :rows="details">
|
||||
<template #value="{ row }">
|
||||
<a v-if="row.href" :href="row.href" target="_blank" rel="noreferrer" class="inline-flex items-center gap-0.5 hover:underline"
|
||||
@@ -75,6 +72,6 @@ const heading = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
|
||||
<template v-else>{{ row.value }}</template>
|
||||
</template>
|
||||
</MetadataList>
|
||||
</section>
|
||||
</Section>
|
||||
</aside>
|
||||
</template>
|
||||
@@ -46,6 +46,7 @@ import { RouterLink, useRouter } from "vue-router";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { ago } from "@/lib/format";
|
||||
import { statusKind, statusLabel } from "@/lib/task-meta";
|
||||
import TaskRowActions from "./TaskRowActions.vue";
|
||||
@@ -191,7 +192,7 @@ function open() {
|
||||
props.task.created_at ? `Created ${ago(props.task.created_at)}` : ''
|
||||
"
|
||||
>
|
||||
{{ ago(props.task.updated_at) }}
|
||||
<Timestamp :at="props.task.updated_at" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TaskRowActions :task="props.task" @done="emit('done', $event)" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { Ellipsis } from "@lucide/vue";
|
||||
import { computed, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { RadioGroupItem, RadioGroupRoot } from "reka-ui";
|
||||
@@ -24,12 +23,8 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { api, classifyActionError, type ActionErrorKind } from "@/lib/api";
|
||||
@@ -133,7 +128,6 @@ const linkControls = computed<Control[]>(() =>
|
||||
controls.value.filter((c) => c.kind === "link"),
|
||||
);
|
||||
|
||||
const menuOpen = ref(false);
|
||||
|
||||
const confirmingMeta = computed(() =>
|
||||
confirmingId.value ? actionFor(confirmingId.value) : null,
|
||||
@@ -271,14 +265,6 @@ function submitRetry(currentDefinition = false) {
|
||||
function onConfirmationOpen(open: boolean) {
|
||||
if (!open) confirming.value = null;
|
||||
}
|
||||
|
||||
// A menu item must close its menu before the dialog can take focus, so both
|
||||
// surfaces funnel through the same request() once the menu is down; the
|
||||
// inFlight disabling and the error handling stay identical either way.
|
||||
function requestFromMenu(id: string) {
|
||||
menuOpen.value = false;
|
||||
request(id);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -333,30 +319,17 @@ function requestFromMenu(id: string) {
|
||||
</Button>
|
||||
</template>
|
||||
|
||||
<DropdownMenu v-if="overflowControls.length" v-model:open="menuOpen">
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
aria-label="More actions"
|
||||
:disabled="inFlight"
|
||||
@click.stop
|
||||
>
|
||||
<Ellipsis :size="14" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<span v-if="overflowControls.length" class="contents" @click.stop><MoreMenu label="More actions">
|
||||
<DropdownMenuItem
|
||||
v-for="control in overflowControls"
|
||||
:key="control.id"
|
||||
:variant="control.kind === 'danger' ? 'destructive' : 'default'"
|
||||
:disabled="inFlight || (control.id === 'approve' && approveDisabled)"
|
||||
@click.stop="requestFromMenu(control.id)"
|
||||
@click.stop="request(control.id)"
|
||||
>
|
||||
{{ control.label }}
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</MoreMenu></span>
|
||||
</div>
|
||||
|
||||
<Dialog :open="rereviewOpen" @update:open="onRereviewOpen">
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { ago } from "@/lib/format";
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
import { describeTimelineEvent } from "./timeline-event";
|
||||
import type { TaskEvent } from "./task-run";
|
||||
@@ -21,11 +22,7 @@ const line = computed(() => describeTimelineEvent(props.event));
|
||||
|
||||
<template>
|
||||
<li class="flex items-start gap-3">
|
||||
<span
|
||||
class="mt-[5px] size-2 shrink-0 rounded-full"
|
||||
:class="line.tone === 'warn' ? 'bg-warn' : 'bg-primary'"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<StatusDot :tone="line.tone === 'warn' ? 'warn' : 'info'" class="mt-2" />
|
||||
<div>
|
||||
<div class="text-sm font-medium">{{ line.title }}</div>
|
||||
<div v-if="line.detail" class="mt-0.5 text-xs text-fg-muted">
|
||||
@@ -40,7 +37,7 @@ const line = computed(() => describeTimelineEvent(props.event));
|
||||
>{{ link.label }}</RouterLink
|
||||
>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-fg-subtle">{{ ago(event.at) }}</div>
|
||||
<div class="mt-0.5 text-xs text-fg-subtle"><Timestamp :at="event.at" /></div>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
@@ -5,6 +5,7 @@ import { computed, onMounted, ref, watch } from "vue";
|
||||
import { ArrowLeft, Braces, Type } from "@lucide/vue";
|
||||
|
||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
@@ -144,10 +145,6 @@ function resolved(name: string): { value?: string; failure?: string } {
|
||||
return name in values ? { value: shortValue(values[name]) } : {};
|
||||
}
|
||||
|
||||
function when(at?: string): string {
|
||||
return at ? new Date(at).toLocaleString(undefined, { dateStyle: "short", timeStyle: "short" }) : "";
|
||||
}
|
||||
|
||||
// A mapping another binding also reads is left as it is: the edit gets its own.
|
||||
function sharedMapping(id?: string): boolean {
|
||||
return bindings.value.some((b) => b.mapping_id === id && b.id !== props.binding?.id);
|
||||
@@ -282,7 +279,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
|
||||
<Select v-if="sourceCaptures.length" :model-value="captureId ?? undefined" @update:model-value="captureId = String($event)">
|
||||
<SelectTrigger id="bind-capture" size="sm" class="w-full" aria-label="Example event"><SelectValue placeholder="Pick an event" /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="c in sourceCaptures" :key="c.id" :value="String(c.id)">#{{ c.id }} · {{ when(c.received_at) }}{{ c.event_type ? "" : " · unidentified" }}</SelectItem>
|
||||
<SelectItem v-for="c in sourceCaptures" :key="c.id" :value="String(c.id)">#{{ c.id }} · <Timestamp :at="c.received_at" absolute />{{ c.event_type ? "" : " · unidentified" }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p v-else class="text-xs text-fg-subtle" :title="`Send an event to ${hookURL} and it appears here`">No events</p>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -27,11 +22,7 @@ const maxMs = computed(() => maxStageMs(props.stages));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Slowest stages</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section title="Slowest stages" class="mb-0">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -53,6 +44,5 @@ const maxMs = computed(() => maxStageMs(props.stages));
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -1,12 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Empty,
|
||||
EmptyHeader,
|
||||
@@ -31,11 +26,7 @@ const rows = computed(() => failingStages(props.stages));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Most failures</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section title="Most failures" class="mb-0">
|
||||
<Empty v-if="!rows.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No failures recorded</EmptyTitle>
|
||||
@@ -60,6 +51,5 @@ const rows = computed(() => failingStages(props.stages));
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -117,7 +117,7 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
|
||||
<p class="text-xs text-fg-muted">Agent's own report · {{ describeTimelineEvent(report).title }}</p>
|
||||
</div>
|
||||
<div v-if="group.tools.length" class="space-y-1">
|
||||
<h4 class="text-xs font-medium text-fg-muted">Tool calls · {{ group.tools.length }}</h4>
|
||||
<h4 class="text-caption font-medium uppercase text-fg-muted">Tool calls · {{ group.tools.length }}</h4>
|
||||
<ol class="divide-y divide-border rounded-md border border-border">
|
||||
<li v-for="(tool, i) in expanded ? group.tools : group.tools.slice(0, 12)" :key="i" class="px-3 py-2">
|
||||
<div class="flex justify-between gap-2 text-xs"><span class="font-mono">{{ tool.data?.tool }}</span><span :class="tool.data?.failed ? 'text-danger' : 'text-fg-muted'">{{ tool.data?.failed ? 'Failed' : 'Returned' }}</span></div>
|
||||
@@ -130,18 +130,18 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
|
||||
<p v-else-if="group.agents.length" class="text-xs text-fg-muted">{{ group.agents.reduce((sum, agent) => sum + agent.tokens_used, 0).toLocaleString() }} tokens recorded</p>
|
||||
</section>
|
||||
<section v-if="suppressed.length" class="space-y-1">
|
||||
<h3 class="text-xs font-medium text-fg-muted">Skipped in test run</h3>
|
||||
<h3 class="text-caption font-medium uppercase text-fg-muted">Skipped in test run</h3>
|
||||
<ul class="divide-y divide-border rounded-md border border-border">
|
||||
<li v-for="(event, i) in suppressed" :key="i" class="px-3 py-2 text-xs break-words whitespace-pre-wrap">{{ event.detail }}</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="space-y-3">
|
||||
<h3 class="text-xs font-medium text-fg-muted">Captured changes</h3>
|
||||
<h3 class="text-caption font-medium uppercase text-fg-muted">Captured changes</h3>
|
||||
<p v-if="changesError" role="alert" class="text-danger">{{ changesError }}</p>
|
||||
<ChangeCapture v-for="(capture, i) in captures" :key="i" :capture="capture" :task="task" />
|
||||
</section>
|
||||
<section class="space-y-2">
|
||||
<h3 class="text-xs font-medium text-fg-muted">Log</h3>
|
||||
<h3 class="text-caption font-medium uppercase text-fg-muted">Log</h3>
|
||||
<TaskLogs :state="scopedLogs" :attempt="attempt" :filterable="false" />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { cn } from "@/lib/utils";
|
||||
import WorkflowCanvas from "./WorkflowCanvas.vue";
|
||||
import { lineDiff, stepMarks, type WorkflowRevision } from "./workflow-revisions";
|
||||
@@ -50,7 +51,7 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
|
||||
<span class="font-mono text-xs text-fg-subtle">v{{ item.version }}</span>
|
||||
<Badge :variant="CHANGE_VARIANTS[item.change]">{{ item.change }}</Badge>
|
||||
</span>
|
||||
<span class="mt-0.5 block truncate text-xs text-fg-muted" :title="item.at">{{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · {{ ago(item.at) }}</span>
|
||||
<span class="mt-0.5 block truncate text-xs text-fg-muted" :title="item.at">{{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · <Timestamp :at="item.at" /></span>
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="!revisions.length" class="px-3 py-2 text-sm text-fg-muted">{{ error || "No recorded changes" }}</li>
|
||||
@@ -77,11 +78,11 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
|
||||
><span class="inline-block w-4 select-none text-fg-subtle">{{ line.kind === "add" ? "+" : line.kind === "del" ? "-" : "" }}</span>{{ line.text }}</span></code></pre>
|
||||
<div v-else class="grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2">
|
||||
<div class="flex min-h-0 flex-col gap-1">
|
||||
<span class="text-xs font-medium text-fg-muted">v{{ revision.version }}</span>
|
||||
<span class="text-caption font-medium uppercase text-fg-muted">v{{ revision.version }}</span>
|
||||
<div class="min-h-0 flex-1 max-md:h-72 max-md:flex-none"><WorkflowCanvas :yaml="then" :marks="thenMarks" /></div>
|
||||
</div>
|
||||
<div class="flex min-h-0 flex-col gap-1">
|
||||
<span class="text-xs font-medium text-fg-muted">Current</span>
|
||||
<span class="text-caption font-medium uppercase text-fg-muted">Current</span>
|
||||
<div class="min-h-0 flex-1 max-md:h-72 max-md:flex-none"><WorkflowCanvas :yaml="current" :marks="nowMarks" /></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,10 @@ import {
|
||||
EmptyTitle,
|
||||
} from "@/components/ui/empty";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { api } from "@/lib/api";
|
||||
import { delivered } from "@/lib/delivered";
|
||||
@@ -206,14 +209,14 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<section v-if="!selected && !loading && store.state.resource && !error" class="min-w-0 rounded-lg border border-border bg-card" aria-label="Workflow">
|
||||
<Section v-if="!selected && !loading && store.state.resource && !error" class="mb-0 min-w-0" role="region" aria-label="Workflow">
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No workflows</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</section>
|
||||
<section v-else-if="selected && store.state.resource" class="min-w-0 rounded-lg border border-border bg-card px-3 py-4 sm:px-5 max-md:flex max-md:h-full max-md:min-h-0 max-md:flex-col" aria-label="Workflow">
|
||||
</Section>
|
||||
<Card v-else-if="selected && store.state.resource" class="min-w-0 px-3 sm:px-5 max-md:flex max-md:h-full max-md:min-h-0 max-md:flex-col" role="region" aria-label="Workflow">
|
||||
<!-- Below lg the list is gone: this picks the workflow instead. -->
|
||||
<header class="mb-2 flex shrink-0 items-center gap-2 lg:hidden">
|
||||
<div class="min-w-0 flex-1"><WorkflowPicker class="w-full" :value="selected" :workflows="rows" label="Workflow" @pick="selected = $event" /></div>
|
||||
@@ -251,16 +254,18 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
<EmptyTitle>No runs yet</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ul v-else class="divide-y divide-border">
|
||||
<li v-for="t in workflowRuns" :key="t.id" class="flex items-center gap-3 py-2 text-sm">
|
||||
<RouterLink :to="`/tasks/${t.id}`" class="min-w-0 flex-1 truncate hover:underline">{{ t.title || `Task ${t.id}` }}</RouterLink>
|
||||
<span class="hidden font-mono text-xs text-fg-subtle sm:block">{{ t.owner && t.repo ? `${t.owner}/${t.repo}${t.issue_url && t.issue_number ? ` #${t.issue_number}` : ""}` : "" }}</span>
|
||||
<Badge :variant="statusKind(t.status ?? '')">{{ statusLabel(t.status ?? "") }}</Badge>
|
||||
</li>
|
||||
</ul>
|
||||
<Table v-else aria-label="Runs">
|
||||
<TableBody>
|
||||
<TableRow v-for="t in workflowRuns" :key="t.id">
|
||||
<TableCell class="w-full max-w-0 truncate"><RouterLink :to="`/tasks/${t.id}`" class="hover:underline">{{ t.title || `Task ${t.id}` }}</RouterLink></TableCell>
|
||||
<TableCell class="hidden font-mono text-xs text-fg-subtle sm:table-cell">{{ t.owner && t.repo ? `${t.owner}/${t.repo}${t.issue_url && t.issue_number ? ` #${t.issue_number}` : ""}` : "" }}</TableCell>
|
||||
<TableCell class="text-right"><Badge :variant="statusKind(t.status ?? '')">{{ statusLabel(t.status ?? "") }}</Badge></TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</template>
|
||||
</WorkflowEditor>
|
||||
</section>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user