refactor(ui): Empty, Spinner and Label replace hand-built equivalents
This commit is contained in:
1 parent
17c07a31fe
commit
a203cbc03b
37 files changed
+215
-193
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { computed, ref } from "vue";
|
||||
import { Card } from "@/components/ui/card";
|
||||
@@ -33,16 +34,16 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
|
||||
<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">
|
||||
<template v-if="setup&&step===1">
|
||||
<label class="block space-y-1.5 text-sm" for="organisation">Organisation name<Input id="organisation" v-model="organisation" autocomplete="organization" required maxlength="200" /></label>
|
||||
<label class="block space-y-1.5 text-sm" for="workspace">First workspace<Input id="workspace" v-model="workspace" required maxlength="200" /></label>
|
||||
<label class="block space-y-1.5 text-sm" for="public-url">Instance URL<Input id="public-url" v-model="publicURL" type="url" required autocomplete="url" /></label>
|
||||
<Label class="block space-y-1.5 text-sm" for="organisation">Organisation name<Input id="organisation" v-model="organisation" autocomplete="organization" required maxlength="200" /></Label>
|
||||
<Label class="block space-y-1.5 text-sm" for="workspace">First workspace<Input id="workspace" v-model="workspace" required maxlength="200" /></Label>
|
||||
<Label class="block space-y-1.5 text-sm" for="public-url">Instance URL<Input id="public-url" v-model="publicURL" type="url" required autocomplete="url" /></Label>
|
||||
<p class="text-xs text-fg-muted">Use the address people will visit. Passkeys require HTTPS and a domain name, or localhost for development.</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<label v-if="setup" class="block space-y-1.5 text-sm" for="account-name">Your name<Input id="account-name" v-model="name" autocomplete="name" required maxlength="200" /></label>
|
||||
<label class="block space-y-1.5 text-sm" for="account-email">Email<Input id="account-email" v-model="email" type="email" autocomplete="username" :spellcheck="false" required /></label>
|
||||
<label v-if="recovery" class="block space-y-1.5 text-sm" for="recovery-code">Recovery code<Input id="recovery-code" v-model="recoveryCode" autocomplete="off" required /></label>
|
||||
<label class="block space-y-1.5 text-sm" for="account-password">{{recovery?"New password":"Password"}}<Input id="account-password" v-model="password" type="password" :autocomplete="setup||recovery?'new-password':'current-password'" :minlength="setup||recovery?15:undefined" maxlength="1024" required /></label>
|
||||
<Label v-if="setup" class="block space-y-1.5 text-sm" for="account-name">Your name<Input id="account-name" v-model="name" autocomplete="name" required maxlength="200" /></Label>
|
||||
<Label class="block space-y-1.5 text-sm" for="account-email">Email<Input id="account-email" v-model="email" type="email" autocomplete="username" :spellcheck="false" required /></Label>
|
||||
<Label v-if="recovery" class="block space-y-1.5 text-sm" for="recovery-code">Recovery code<Input id="recovery-code" v-model="recoveryCode" autocomplete="off" required /></Label>
|
||||
<Label class="block space-y-1.5 text-sm" for="account-password">{{recovery?"New password":"Password"}}<Input id="account-password" v-model="password" type="password" :autocomplete="setup||recovery?'new-password':'current-password'" :minlength="setup||recovery?15:undefined" maxlength="1024" required /></Label>
|
||||
<p v-if="setup" class="text-xs text-fg-muted">At least 15 characters.</p>
|
||||
</template>
|
||||
<Alert v-if="error" variant="destructive"><AlertDescription>{{error}}</AlertDescription></Alert>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { ref } from "vue";
|
||||
import { Input } from "@/components/ui/input";
|
||||
@@ -16,10 +17,10 @@ async function create(){busy.value=true;error.value="";try{await api.createAccou
|
||||
<template>
|
||||
<Section title="Create a local account">
|
||||
<form class="grid gap-3 sm:grid-cols-2" @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>
|
||||
<div class="block space-y-1 text-sm"><label for="new-account-role">Role</label><Select v-model="role"><SelectTrigger id="new-account-role" class="w-full"><SelectValue /></SelectTrigger><SelectContent><SelectItem v-for="choice in assignable" :key="choice" :value="choice">{{ ROLE_LABELS[choice] }}</SelectItem></SelectContent></Select></div>
|
||||
<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>
|
||||
<div class="block space-y-1 text-sm"><Label for="new-account-role">Role</Label><Select v-model="role"><SelectTrigger id="new-account-role" class="w-full"><SelectValue /></SelectTrigger><SelectContent><SelectItem v-for="choice in assignable" :key="choice" :value="choice">{{ ROLE_LABELS[choice] }}</SelectItem></SelectContent></Select></div>
|
||||
<Alert v-if="error" variant="destructive" class="sm:col-span-2"><AlertDescription>{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></AlertDescription></Alert>
|
||||
<Button type="submit" :disabled="busy" class="justify-self-start sm:col-span-2">Create account</Button>
|
||||
</form>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { computed, ref } from "vue";
|
||||
import { Bell, CheckCheck, X } from "@lucide/vue";
|
||||
@@ -41,7 +42,7 @@ function failedDeliveries(alert: OperatorAlert): number {
|
||||
</PopoverTrigger>
|
||||
<PopoverContent align="end" :collision-padding="8" class="w-[calc(100vw-1rem)] max-w-none p-0 sm:w-96">
|
||||
<Alert v-if="failed" variant="destructive" class="px-3 py-6 text-center"><AlertDescription>Alerts could not be loaded.</AlertDescription></Alert>
|
||||
<p v-else-if="!groups.length" class="px-3 py-6 text-center text-sm text-fg-subtle">No alerts.</p>
|
||||
<Empty v-else-if="!groups.length" class="border-0"><EmptyHeader><EmptyTitle>No alerts</EmptyTitle></EmptyHeader></Empty>
|
||||
<div v-else class="relative max-h-[calc(100dvh-6rem)] overflow-y-auto">
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import {
|
||||
ClipboardPaste,
|
||||
Pencil,
|
||||
@@ -151,7 +152,7 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
<p v-if="eventTypesLoading" class="text-sm text-fg-muted" role="status">Loading event types…</p>
|
||||
<p v-if="eventTypesLoading" class="flex items-center gap-2 text-sm text-fg-muted"><Spinner />Loading event types…</p>
|
||||
|
||||
<Empty v-else-if="!eventTypesError && !proposals.length && !eventTypes.length">
|
||||
<EmptyHeader>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { CircleCheck, CircleX, LoaderCircle } from "@lucide/vue";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { CircleCheck, CircleX } from "@lucide/vue";
|
||||
import { computed } from "vue";
|
||||
|
||||
import { CodeBlock, CodeBlockContent } from "@/components/ui/code-block";
|
||||
@@ -85,7 +86,7 @@ const detail = computed(() =>
|
||||
<TraceLine :status="failed ? 'error' : running ? 'running' : undefined">
|
||||
<TraceIcon>
|
||||
<CircleX v-if="failed" />
|
||||
<LoaderCircle v-else-if="running" class="animate-spin" />
|
||||
<Spinner v-else-if="running" />
|
||||
<CircleCheck v-else class="text-success" />
|
||||
</TraceIcon>
|
||||
<span class="font-mono text-foreground">{{ name }}</span>
|
||||
@@ -102,7 +103,7 @@ const detail = computed(() =>
|
||||
<TraceLine v-else :status="failed ? 'error' : running ? 'running' : undefined">
|
||||
<TraceIcon>
|
||||
<CircleX v-if="failed" />
|
||||
<LoaderCircle v-else-if="running" class="animate-spin" />
|
||||
<Spinner v-else-if="running" />
|
||||
<CircleCheck v-else class="text-success" />
|
||||
</TraceIcon>
|
||||
<span class="font-mono text-foreground">{{ name }}</span>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { computed } from "vue";
|
||||
|
||||
import {
|
||||
@@ -35,7 +36,7 @@ const failureByField = computed(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p v-if="!fields.length" class="py-3 text-sm text-fg-muted">No fields bound.</p>
|
||||
<Empty v-if="!fields.length"><EmptyHeader><EmptyTitle>No fields bound</EmptyTitle></EmptyHeader></Empty>
|
||||
|
||||
<Table v-else>
|
||||
<TableHeader>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
@@ -108,8 +110,8 @@ onMounted(load);
|
||||
<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>
|
||||
<p v-if="loading" class="flex items-center gap-2 text-sm text-fg-muted"><Spinner />Loading policies…</p>
|
||||
<Empty v-else-if="!error && !policies.length"><EmptyHeader><EmptyTitle>No policies yet</EmptyTitle></EmptyHeader></Empty>
|
||||
<div
|
||||
v-for="p in policies"
|
||||
:key="`${p.level}/${scope(p)}/${p.id}`"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
@@ -71,7 +72,7 @@ const bound = computed(() => new Set(((store.draftValue("credential-bindings") a
|
||||
<template v-if="aliases">
|
||||
<Section title="Aliases">
|
||||
<div v-for="[alias, model] in aliasEntries" :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>
|
||||
<Label :for="`org-alias-${alias}`" class="w-28 font-mono text-sm font-medium">{{ alias }}</Label>
|
||||
<Input
|
||||
:id="`org-alias-${alias}`"
|
||||
:model-value="model ?? ''"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { computed, onUnmounted, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
@@ -80,7 +81,7 @@ const columns: DataTableColumn<ScheduleRun>[] = [
|
||||
storage-key="schedule-runs"
|
||||
:initial-sort="{ id: 'scheduled', desc: true }"
|
||||
>
|
||||
<template #empty><p class="py-4 text-center text-sm text-fg-subtle">No runs yet.</p></template>
|
||||
<template #empty><Empty><EmptyHeader><EmptyTitle>No runs yet</EmptyTitle></EmptyHeader></Empty></template>
|
||||
<template #cell-scheduled="{ row }"><Timestamp :at="row.scheduled_for" absolute /></template>
|
||||
<template #cell-started="{ row }"><Timestamp :at="row.started" absolute /></template>
|
||||
<template #cell-duration="{ row }"><span class="tabular-nums text-fg-muted">{{ runDuration(row) || "–" }}</span></template>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Plus } from "@lucide/vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
|
||||
@@ -116,7 +117,7 @@ const unavailable = computed(() => !!connection.value.type && !extensions.forges
|
||||
<SelectItem v-if="identity && !choosableIdentities(connection, org.activeIdentities, identity).some((a) => a.id === identity)" :value="identity">{{ org.identityName(identity) }} · unavailable</SelectItem>
|
||||
</SelectGroup></SelectContent>
|
||||
</Select>
|
||||
<label
|
||||
<Label
|
||||
v-for="operation in OPERATIONS"
|
||||
:key="operation"
|
||||
class="flex items-center gap-2 text-sm"
|
||||
@@ -127,7 +128,7 @@ const unavailable = computed(() => !!connection.value.type && !extensions.forges
|
||||
@update:model-value="(on: boolean) => (connection = toggleOperation(connection, identity, operation, on))"
|
||||
/>
|
||||
<span class="font-mono text-xs">{{ operation }}</span>
|
||||
</label>
|
||||
</Label>
|
||||
<Button variant="ghost" size="sm" @click="connection = removePermit(connection, identity)">
|
||||
Remove
|
||||
</Button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { computed, useId } from "vue";
|
||||
import { Trash2 } from "@lucide/vue";
|
||||
|
||||
@@ -76,10 +77,10 @@ const args = computed({
|
||||
</div>
|
||||
|
||||
<template v-if="transport === 'stdio'">
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">Command
|
||||
<Label class="grid gap-1 text-xs text-fg-subtle">Command
|
||||
<Input :model-value="server.command"
|
||||
@update:model-value="(value: string | number) => patch({ command: String(value) })" class="font-mono" placeholder="npx" />
|
||||
</label>
|
||||
</Label>
|
||||
<div class="grid gap-1 text-xs text-fg-subtle">
|
||||
<span :id="`${id}-args`">Arguments</span>
|
||||
<TagsInput v-model="args" :aria-labelledby="`${id}-args`" class="font-mono">
|
||||
@@ -90,29 +91,29 @@ const args = computed({
|
||||
<TagsInputInput placeholder="Add argument" />
|
||||
</TagsInput>
|
||||
</div>
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">Working directory
|
||||
<Label class="grid gap-1 text-xs text-fg-subtle">Working directory
|
||||
<Input :model-value="server.work_dir"
|
||||
@update:model-value="(value: string | number) => patch({ work_dir: String(value) })" class="font-mono" placeholder="the daemon's working directory" />
|
||||
</label>
|
||||
</Label>
|
||||
</template>
|
||||
<label v-else-if="transport === 'http'" class="grid gap-1 text-xs text-fg-subtle">URL
|
||||
<Label v-else-if="transport === 'http'" class="grid gap-1 text-xs text-fg-subtle">URL
|
||||
<Input :model-value="server.url"
|
||||
@update:model-value="(value: string | number) => patch({ url: String(value) })" class="font-mono" placeholder="https://host/mcp" />
|
||||
</label>
|
||||
</Label>
|
||||
<template v-else>
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">SSE endpoint
|
||||
<Label class="grid gap-1 text-xs text-fg-subtle">SSE endpoint
|
||||
<Input :model-value="server.sse_endpoint"
|
||||
@update:model-value="(value: string | number) => patch({ sse_endpoint: String(value) })" class="font-mono" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">Message endpoint
|
||||
</Label>
|
||||
<Label class="grid gap-1 text-xs text-fg-subtle">Message endpoint
|
||||
<Input :model-value="server.message_endpoint"
|
||||
@update:model-value="(value: string | number) => patch({ message_endpoint: String(value) })" class="font-mono" />
|
||||
</label>
|
||||
</Label>
|
||||
</template>
|
||||
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<Label class="flex items-center gap-2 text-sm">
|
||||
<Switch :model-value="server.parallel_tool_calls" @update:model-value="(value: boolean) => patch({ parallel_tool_calls: value })" />
|
||||
Parallel tool calls</label>
|
||||
Parallel tool calls</Label>
|
||||
</div>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { onMounted } from "vue";
|
||||
@@ -24,5 +25,5 @@ useIntervalFn(store.load, 15_000);
|
||||
<TableHeader><TableRow><TableHead>Engine</TableHead><TableHead>Version</TableHead><TableHead>Source</TableHead></TableRow></TableHeader>
|
||||
<TableBody><TableRow v-for="engine in store.engines" :key="engine.name"><TableCell class="font-mono">{{ engine.name }}</TableCell><TableCell class="font-mono">{{ engine.version || '–' }}</TableCell><TableCell>{{ engine.source }}</TableCell></TableRow></TableBody>
|
||||
</Table>
|
||||
<p v-else class="text-sm text-fg-subtle" role="status">Loading engine report…</p>
|
||||
<p v-else class="flex items-center gap-2 text-sm text-fg-subtle"><Spinner />Loading engine report…</p>
|
||||
</template>
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { useIntervalFn } from "@vueuse/core";
|
||||
|
||||
@@ -67,7 +68,7 @@ async function check() {
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="flex flex-wrap items-end gap-2">
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">Engine
|
||||
<Label class="grid gap-1 text-xs text-fg-subtle">Engine
|
||||
<Select :model-value="model.engine" :disabled="disabled" @update:model-value="(engine) => patch({ engine: String(engine ?? '') })">
|
||||
<SelectTrigger :id="`${idPrefix}-engine`" class="font-mono"><SelectValue placeholder="Choose engine" /></SelectTrigger>
|
||||
<SelectContent><SelectGroup>
|
||||
@@ -75,10 +76,10 @@ async function check() {
|
||||
<SelectItem v-if="model.engine && (missing || engines.engines === null)" :value="model.engine">{{ model.engine }}{{ missing ? ' · not installed' : '' }}</SelectItem>
|
||||
</SelectGroup></SelectContent>
|
||||
</Select>
|
||||
</label>
|
||||
<label class="grid min-w-48 flex-1 gap-1 text-xs text-fg-subtle">Key
|
||||
</Label>
|
||||
<Label class="grid min-w-48 flex-1 gap-1 text-xs text-fg-subtle">Key
|
||||
<Input :id="`${idPrefix}-key`" :model-value="model.key" class="font-mono" :disabled="disabled" @update:model-value="(key) => patch({ key: String(key) })" />
|
||||
</label>
|
||||
</Label>
|
||||
<Button variant="ghost" size="sm" @click="editing = false">Done</Button>
|
||||
</div>
|
||||
<p v-if="editing && engines.error" class="mt-1 text-xs text-danger" role="alert">{{ engines.error }}</p>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import ApplyStatusRows from "./ApplyStatusRows.vue";
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
@@ -170,7 +171,7 @@ function setAllowed(id: string, text: string) {
|
||||
<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 max-sm:w-full">{{ alias }}</label>
|
||||
<Label :for="`alias-${alias}`" class="w-28 text-sm font-medium max-sm:w-full">{{ alias }}</Label>
|
||||
<template v-if="alias === 'embedding'">
|
||||
<Select :model-value="embeddingProvider" @update:model-value="(v) => setEmbedding(String(v), embeddingModel)">
|
||||
<SelectTrigger class="w-44 font-mono" aria-label="Embedding provider"><SelectValue placeholder="unset" /></SelectTrigger>
|
||||
@@ -224,9 +225,9 @@ function setAllowed(id: string, text: string) {
|
||||
:aria-label="`Models ${o.name} may use`"
|
||||
@update:model-value="(v) => setAllowed(o.id, String(v))"
|
||||
/>
|
||||
<label class="flex items-center gap-2 text-xs text-fg-muted">
|
||||
<Label class="flex items-center gap-2 text-xs text-fg-muted">
|
||||
<Switch :model-value="policyFor(o.id).own_providers" @update:model-value="(v) => setPolicy(o.id, { own_providers: !!v })" />
|
||||
Own providers</label>
|
||||
Own providers</Label>
|
||||
<DraftHint kind="org-model-policy" :path="o.id" />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { firstLine } from "./first-line";
|
||||
import { computed, onMounted, ref, useId, watchEffect } from "vue";
|
||||
@@ -103,15 +104,15 @@ async function submit() {
|
||||
<Alert v-if="loadError" variant="destructive"><AlertDescription>{{ loadError }}</AlertDescription></Alert>
|
||||
|
||||
<div v-if="repoMode !== 'none'" class="grid gap-1.5">
|
||||
<label :for="`${uid}-repo`" class="text-label font-medium">Repository<span v-if="!repoRequired" class="font-normal text-fg-subtle"> (optional)</span>
|
||||
</label>
|
||||
<Label :for="`${uid}-repo`" class="text-label font-medium">Repository<span v-if="!repoRequired" class="font-normal text-fg-subtle"> (optional)</span>
|
||||
</Label>
|
||||
<SuggestInput :id="`${uid}-repo`" v-model="repository" class="font-mono" placeholder="owner/repository" :options="recentRepos" :required="repoRequired" />
|
||||
</div>
|
||||
|
||||
<div v-if="!props.workflow" class="grid gap-1.5">
|
||||
<span :id="`${uid}-wf`" class="text-label font-medium">Workflow</span>
|
||||
<RadioGroup v-model="workflow" :aria-labelledby="`${uid}-wf`" class="grid grid-cols-1 gap-2 sm:grid-cols-3" loop>
|
||||
<label
|
||||
<Label
|
||||
v-for="d in definitions"
|
||||
:key="d.id"
|
||||
class="flex cursor-pointer items-start gap-3 rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary has-data-checked:border-primary has-data-checked:bg-secondary"
|
||||
@@ -125,7 +126,7 @@ async function submit() {
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
</Label>
|
||||
</RadioGroup>
|
||||
<p v-if="!definitions.length && !loadError" class="text-xs text-fg-subtle">No enabled workflows.</p>
|
||||
</div>
|
||||
@@ -136,10 +137,10 @@ async function submit() {
|
||||
value is typed the way the workflow reads it. -->
|
||||
<div v-if="declared.length" class="grid gap-3">
|
||||
<div v-for="field in declared" :key="field.name" class="grid gap-1.5">
|
||||
<label :for="`${uid}-input-${field.name}`" class="text-label font-medium">
|
||||
<Label :for="`${uid}-input-${field.name}`" class="text-label font-medium">
|
||||
<span class="font-mono">{{ field.name }}</span>
|
||||
<span v-if="field.required" class="text-fg-subtle"> · required</span>
|
||||
</label>
|
||||
</Label>
|
||||
<Input
|
||||
:id="`${uid}-input-${field.name}`"
|
||||
:model-value="inputText[field.name]"
|
||||
@@ -152,11 +153,11 @@ async function submit() {
|
||||
</div>
|
||||
|
||||
<div class="grid gap-1.5">
|
||||
<label :for="`${uid}-title`" class="text-label font-medium">Title</label>
|
||||
<Label :for="`${uid}-title`" class="text-label font-medium">Title</Label>
|
||||
<Input :id="`${uid}-title`" v-model="title" maxlength="80" required />
|
||||
</div>
|
||||
<div class="grid gap-1.5">
|
||||
<label :for="`${uid}-instr`" class="text-label font-medium">Description</label>
|
||||
<Label :for="`${uid}-instr`" class="text-label font-medium">Description</Label>
|
||||
<Textarea :id="`${uid}-instr`" v-model="instructions" :rows="4" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
@@ -25,7 +26,7 @@ watch(() => props.task.review_gate, () => {
|
||||
<CardContent class="space-y-4">
|
||||
<ul class="divide-y divide-border rounded-md border border-border">
|
||||
<li v-for="entry in gate.findings" :key="entry.key" class="space-y-2 p-4">
|
||||
<label class="flex cursor-pointer items-start gap-3">
|
||||
<Label class="flex cursor-pointer items-start gap-3">
|
||||
<Checkbox
|
||||
:model-value="selected.includes(entry.key)"
|
||||
:aria-label="entry.finding.Title"
|
||||
@@ -36,7 +37,7 @@ watch(() => props.task.review_gate, () => {
|
||||
<span class="block text-sm font-medium">{{ entry.finding.Title }}</span>
|
||||
<span class="block break-all font-mono text-xs text-fg-muted">{{ entry.finding.File }}<template v-if="entry.finding.LineStart">:{{ entry.finding.LineStart }}<template v-if="entry.finding.LineEnd > entry.finding.LineStart">–{{ entry.finding.LineEnd }}</template></template></span>
|
||||
</span>
|
||||
</label>
|
||||
</Label>
|
||||
<div class="flex flex-wrap items-center gap-2 text-xs">
|
||||
<Badge variant="outline">{{ entry.finding.Severity }}</Badge>
|
||||
<Badge v-if="entry.finding.Blocking" variant="danger">Blocking</Badge>
|
||||
|
||||
@@ -378,7 +378,7 @@ function onConfirmationOpen(open: boolean) {
|
||||
aria-label="Retry worktree mode"
|
||||
loop
|
||||
>
|
||||
<label
|
||||
<Label
|
||||
v-for="option in retryOptions"
|
||||
:key="option.id"
|
||||
class="flex items-start gap-3 rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors"
|
||||
@@ -397,7 +397,7 @@ function onConfirmationOpen(open: boolean) {
|
||||
<span class="text-label font-medium">{{ option.label }}</span>
|
||||
<span class="text-xs text-fg-subtle">{{ option.description }}</span>
|
||||
</span>
|
||||
</label>
|
||||
</Label>
|
||||
</RadioGroup>
|
||||
<DialogFooter>
|
||||
<Button variant="ghost" :disabled="inFlight" @click="onRetryOpen(false)">Keep it parked</Button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SuggestInput } from "@/components/ui/suggest-input";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
@@ -261,7 +262,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
|
||||
<div v-if="loading" class="flex flex-1 items-center justify-center"><Spinner /></div>
|
||||
<form v-else class="flex-1 space-y-5 overflow-y-auto px-4 py-4" @submit.prevent="save">
|
||||
<section class="space-y-1.5">
|
||||
<label for="bind-source" class="text-xs font-medium text-fg-muted">Source</label>
|
||||
<Label for="bind-source" class="text-xs font-medium text-fg-muted">Source</Label>
|
||||
<OptionSelect id="bind-source" aria-label="Source" :model-value="source" :options="sourceOptions" class="w-full" :disabled="!!binding" @update:model-value="source = $event" />
|
||||
<Input
|
||||
v-if="source === NEW_SOURCE"
|
||||
@@ -276,7 +277,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
|
||||
<SourceSecret v-if="revealed" :source="revealed" @dismiss="revealed = null" />
|
||||
|
||||
<section v-if="sourcePath" class="space-y-1.5">
|
||||
<label for="bind-capture" class="text-xs font-medium text-fg-muted">Example event</label>
|
||||
<Label for="bind-capture" class="text-xs font-medium text-fg-muted">Example event</Label>
|
||||
<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>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { ArrowLeft } from "@lucide/vue";
|
||||
|
||||
@@ -189,7 +190,7 @@ async function remove(): Promise<void> {
|
||||
<div v-if="loading" class="flex flex-1 items-center justify-center"><Spinner /></div>
|
||||
<form v-else class="flex-1 space-y-5 overflow-y-auto px-4 py-4" @submit.prevent="save">
|
||||
<section class="space-y-1.5">
|
||||
<label for="schedule-trigger" class="text-xs font-medium text-fg-muted">Schedule</label>
|
||||
<Label for="schedule-trigger" class="text-xs font-medium text-fg-muted">Schedule</Label>
|
||||
<p v-if="loadError" class="text-xs text-danger" role="alert">{{ loadError }}</p>
|
||||
<OptionSelect v-else id="schedule-trigger" aria-label="Schedule" :model-value="scheduleId" :options="scheduleOptions" class="w-full" @update:model-value="pickSchedule" />
|
||||
</section>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { computed, ref, useId } from "vue";
|
||||
import { ChevronDown, CircleHelp, Plus, Trash2 } from "@lucide/vue";
|
||||
import { parse, stringify } from "yaml";
|
||||
@@ -158,10 +159,10 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
<p v-if="problem" class="rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger" role="alert">{{ problem }}</p>
|
||||
|
||||
<section v-if="branching" class="space-y-3">
|
||||
<label v-if="type === 'switch'" class="block space-y-1.5">
|
||||
<Label v-if="type === 'switch'" class="block space-y-1.5">
|
||||
<span class="text-xs font-medium text-fg-muted" title="The value whose case runs; a case named default runs when none matches">Switch on</span>
|
||||
<SuggestInput :model-value="branching.on" class="font-mono" placeholder="steps.assess.result.fit" :options="earlier.map((id) => `steps.${id}.result.`)" @change="setOn(($event.target as HTMLInputElement).value.trim())" />
|
||||
</label>
|
||||
</Label>
|
||||
<div class="text-xs font-medium text-fg-muted">{{ type === "switch" ? "Cases" : "Branches" }}</div>
|
||||
<div v-for="name in branches" :key="name" class="flex items-center gap-2">
|
||||
<Input :model-value="name" :class="type === 'switch' && 'font-mono'" :aria-label="`${type === 'switch' ? 'Case' : 'Branch'} ${name}`" @change="changeBranch('rename', name, ($event.target as HTMLInputElement).value.trim())" />
|
||||
@@ -276,7 +277,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
<section class="space-y-1.5">
|
||||
<p v-if="flowProblem" role="alert" class="text-xs text-danger">{{ flowProblem }}</p>
|
||||
<div class="divide-y divide-border rounded-md border border-border">
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label" title="Empty always runs. A field such as inputs.enabled, !inputs.skip, or steps.plan.result.ready == true">Run only when</span>
|
||||
<Input
|
||||
class="h-8 w-48 font-mono text-xs"
|
||||
@@ -285,12 +286,12 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
:model-value="(step.when as string) ?? ''"
|
||||
@update:model-value="(value) => setField('when', String(value))"
|
||||
/>
|
||||
</label>
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
</Label>
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label">If it fails</span>
|
||||
<OptionSelect class="w-36" aria-label="If it fails" :model-value="(step.on_failure as string) ?? ''" :options="ON_FAILURE" @update:model-value="setField('on_failure', $event || undefined)" />
|
||||
</label>
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
</Label>
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label">Attempts</span>
|
||||
<Input
|
||||
type="number"
|
||||
@@ -301,9 +302,9 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
:model-value="(step.retry as { attempts?: number } | undefined)?.attempts ?? ''"
|
||||
@update:model-value="(value) => setRetry({ attempts: String(value) === '' ? undefined : Number(String(value)) })"
|
||||
/>
|
||||
</label>
|
||||
</Label>
|
||||
<div class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<label :for="`${uid}-backoff`" class="flex-1 text-label">Retry backoff</label>
|
||||
<Label :for="`${uid}-backoff`" class="flex-1 text-label">Retry backoff</Label>
|
||||
<DurationInput
|
||||
:id="`${uid}-backoff`"
|
||||
:model-value="(step.retry as { backoff?: string } | undefined)?.backoff ?? ''"
|
||||
|
||||
@@ -449,7 +449,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
|
||||
</MoreMenu>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="runsLoading && !runs.length" class="text-xs text-fg-muted" role="status">Loading recent runs…</p>
|
||||
<p v-if="runsLoading && !runs.length" class="flex items-center gap-2 text-xs text-fg-muted"><Spinner />Loading recent runs…</p>
|
||||
<div v-else-if="runsError" class="text-sm text-danger" role="alert">
|
||||
<p>Could not load recent runs: {{ runsError }}</p>
|
||||
<Button type="button" variant="outline" size="sm" @click="refresh">Retry runs</Button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
@@ -80,7 +81,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
||||
<template>
|
||||
<div class="space-y-4 px-3 py-3">
|
||||
<div class="divide-y divide-border rounded-md border border-border">
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label">Runs as</span>
|
||||
<OptionSelect
|
||||
:key="String(identitiesLoading)"
|
||||
@@ -92,13 +93,13 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
||||
class="w-44"
|
||||
@update:model-value="set('identity', $event)"
|
||||
/>
|
||||
</label>
|
||||
</Label>
|
||||
<p v-if="identitiesError" role="alert" class="px-3 py-2 text-xs text-danger">{{ identitiesError }} <Button variant="link" size="xs" @click="loadAgents">Retry</Button></p>
|
||||
<p v-else-if="!identitiesLoading && !agents.length" class="px-3 py-2 text-xs text-fg-subtle">No active agents in your organisation.</p>
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label">Container profile</span>
|
||||
<OptionSelect :model-value="text('profile')" :options="profileOptions" aria-label="Container profile" class="w-44" @update:model-value="set('profile', $event || undefined)" />
|
||||
</label>
|
||||
</Label>
|
||||
<div class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label">Works on</span>
|
||||
<ToggleGroup
|
||||
@@ -112,11 +113,11 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
||||
<ToggleGroupItem v-for="mode in MODES" :key="mode.value" :value="mode.value" :title="mode.hint">{{ mode.label }}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
</div>
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label" title="Stages return structured output through capture tools">Captures</span>
|
||||
<Switch :model-value="needs.captures === true" @update:model-value="set('needs', { ...needs, captures: $event || undefined })" />
|
||||
</label>
|
||||
<label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
</Label>
|
||||
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
|
||||
<span class="flex-1 text-label">Gate retries</span>
|
||||
<Input
|
||||
type="number"
|
||||
@@ -126,11 +127,11 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
||||
:model-value="needs.gate_retries ?? ''"
|
||||
@update:model-value="(value) => set('needs', { ...needs, gate_retries: String(value) === '' ? undefined : Number(String(value)) })"
|
||||
/>
|
||||
</label>
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<section class="space-y-1.5">
|
||||
<label for="workflow-instructions" class="text-xs font-medium text-fg-muted">Instructions</label>
|
||||
<Label for="workflow-instructions" class="text-xs font-medium text-fg-muted">Instructions</Label>
|
||||
<Textarea
|
||||
id="workflow-instructions"
|
||||
:model-value="text('instructions')"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { Plus } from "@lucide/vue";
|
||||
@@ -176,7 +177,7 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
<p>{{ error || store.error }}</p>
|
||||
<Button variant="outline" size="sm" @click="load(); store.load()">Retry</Button>
|
||||
</div>
|
||||
<p v-if="loading || (!store.state.resource && !store.error)" class="text-sm text-fg-muted" role="status">Loading workflows…</p>
|
||||
<p v-if="loading || (!store.state.resource && !store.error)" class="flex items-center gap-2 text-sm text-fg-muted"><Spinner />Loading workflows…</p>
|
||||
|
||||
<div class="grid items-start gap-6 lg:grid-cols-[24rem_minmax(0,1fr)] max-md:min-h-0 max-md:flex-1 max-md:grid-rows-[minmax(0,1fr)]">
|
||||
<div class="hidden min-w-0 flex-col gap-1 lg:flex">
|
||||
@@ -244,7 +245,7 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
</template>
|
||||
</template>
|
||||
<template #runs>
|
||||
<p v-if="runsLoading" role="status" class="text-sm text-fg-muted">Loading runs…</p>
|
||||
<p v-if="runsLoading" class="flex items-center gap-2 text-sm text-fg-muted"><Spinner />Loading runs…</p>
|
||||
<div v-else-if="runsError" role="alert" class="text-sm text-danger">
|
||||
<p>{{ runsError }}</p>
|
||||
<Button variant="outline" size="sm" @click="loadWorkflowRuns">Retry</Button>
|
||||
|
||||
Reference in new issue
Block a user