fix(ui): hand-rolled cards, headings, captions and empties use components/ui (#1759)
Captions move from text-xs to the text-caption type-scale token across the workflow/bind/schedule editors and curator card. The task page title uses PageHeader's h1 classes. Hand-rolled boxes become Card (token reveal, recovery code, pending extension update) or CodeView (install progress); the startup-settings key/value table becomes MetadataList; the harness empty row becomes TableEmpty; 'No tokens/dispatches/inputs/ removed' states become Empty; the step-editor problem line becomes a destructive Alert. The risky-row danger tint in ToolsPage and SystemReposPage now uses SettingRow tone="danger" instead of a hand-written before: overlay (DANGER_ROW deleted).
This commit is contained in:
18 files changed
+69
-74
No files matched your search
@@ -5,6 +5,7 @@ import { computed, onMounted, ref } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import PersonalTokensCard from "@/accounts/PersonalTokensCard.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Section } from "@/components/ui/section";
|
||||
@@ -34,7 +35,7 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
|
||||
<PersonalTokensCard />
|
||||
<Section title="Recovery code" description="Shown once. Use it to reset your password if you lose access. A new code replaces the old one.">
|
||||
<template #action><Button size="sm" :disabled="busy" @click="makeRecovery">Generate</Button></template>
|
||||
<p v-if="recovery" class="break-all rounded-md border border-border p-3 font-mono" role="status">{{recovery}}</p>
|
||||
<Card v-if="recovery" size="sm"><p class="break-all font-mono" role="status">{{recovery}}</p></Card>
|
||||
</Section>
|
||||
<Section title="Change password" description="Changing your password signs out all your sessions.">
|
||||
<form @submit.prevent="change">
|
||||
|
||||
@@ -4,6 +4,8 @@ import { onMounted, ref } from "vue";
|
||||
import { Copy, Plus, X } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { api } from "@/lib/api";
|
||||
@@ -86,15 +88,15 @@ onMounted(load);
|
||||
</template>
|
||||
<p v-if="!available && !busy && !error" class="text-fg-subtle">Personal tokens need a signed-in person.</p>
|
||||
<p v-if="error" role="alert" class="mb-3 text-danger">{{ error }}</p>
|
||||
<div v-if="created" class="mb-3 rounded-lg border border-border p-3">
|
||||
<p class="mb-2 text-xs">Copy this token now. It cannot be shown again.</p>
|
||||
<div class="flex gap-2">
|
||||
<Card v-if="created" size="sm" class="mb-3">
|
||||
<p class="text-caption text-fg-subtle">Copy this token now. It cannot be shown again.</p>
|
||||
<div class="mt-2 flex gap-2">
|
||||
<Input :model-value="created" readonly aria-label="New token" @focus="($event.target as HTMLInputElement).select()" />
|
||||
<Button variant="outline" size="sm" aria-label="Copy token" @click="copy"><Copy /></Button>
|
||||
<Button variant="ghost" size="sm" aria-label="Dismiss" @click="created = ''"><X /></Button>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="available && !tokens.length && !busy && !error" class="text-fg-subtle">No tokens yet.</p>
|
||||
</Card>
|
||||
<Empty v-if="available && !tokens.length && !busy && !error"><EmptyHeader><EmptyTitle>No tokens yet.</EmptyTitle></EmptyHeader></Empty>
|
||||
<ItemGroup v-if="tokens.length" aria-label="API tokens">
|
||||
<Item v-for="token in tokens" :key="token.id" as="li" variant="outline" size="xs">
|
||||
<span class="flex-1 truncate text-sm">{{ token.name || token.id.slice(0, 12) }}</span>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
/**
|
||||
@@ -79,5 +80,5 @@ const captureLink = (id: string) => ({
|
||||
<Timestamp :at="d.dispatched_at" />
|
||||
</li>
|
||||
</ul>
|
||||
<p v-else-if="props.kind !== 'tasks'" class="text-xs text-fg-muted">No dispatches yet.</p>
|
||||
<Empty v-else-if="props.kind !== 'tasks'"><EmptyHeader><EmptyTitle>No dispatches yet.</EmptyTitle></EmptyHeader></Empty>
|
||||
</template>
|
||||
@@ -11,7 +11,7 @@ const options = computed(() => selectorData.value.models ?? []);
|
||||
|
||||
<template>
|
||||
<div class="text-sm">
|
||||
<p class="font-medium">Choose a model</p>
|
||||
<p class="text-label font-medium">Choose a model</p>
|
||||
<p v-if="!options.length" class="mt-1 text-fg-muted">None configured.</p>
|
||||
<Select v-else :model-value="selectorData.active_model" class="mt-2" @update:model-value="(v) => void setModel(String(v))">
|
||||
<SelectTrigger class="w-full font-mono" aria-label="Model"><SelectValue placeholder="Choose a model" /></SelectTrigger>
|
||||
|
||||
@@ -42,7 +42,7 @@ function healthKind(status: string | undefined): StatusKind {
|
||||
{{ props.curator.health?.status || "unknown" }}
|
||||
</Badge>
|
||||
</template>
|
||||
<p class="mb-3 text-xs text-fg-subtle">
|
||||
<p class="mb-3 text-caption 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>
|
||||
|
||||
@@ -34,6 +34,7 @@ import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableEmpty,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
@@ -168,9 +169,7 @@ function scopes(binding: HarnessBinding): string {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-if="!state.bindings.length">
|
||||
<TableCell colspan="5" class="text-fg-muted">No credential bindings.</TableCell>
|
||||
</TableRow>
|
||||
<TableEmpty v-if="!state.bindings.length" :colspan="5">No credential bindings.</TableEmpty>
|
||||
<TableRow v-for="binding in state.bindings" :key="binding.service">
|
||||
<TableCell class="font-medium">{{ binding.service }}</TableCell>
|
||||
<TableCell>
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
@@ -115,13 +116,13 @@ const tones = {
|
||||
</Collapsible>
|
||||
</div>
|
||||
<Badge v-if="tones[stage(extension)].tone" :variant="tones[stage(extension)].tone">{{ tones[stage(extension)].label }}</Badge>
|
||||
<div v-if="extension.pending" class="w-full rounded-md border border-border px-3 py-2">
|
||||
<p class="text-xs font-medium">Update awaiting approval. It adds:</p>
|
||||
<ul class="font-mono text-xs">
|
||||
<Card v-if="extension.pending" size="sm" class="w-full">
|
||||
<p class="text-caption font-medium">Update awaiting approval. It adds:</p>
|
||||
<ul class="font-mono text-caption">
|
||||
<li v-for="line in grants(extension.pending.added).filter((l) => !l.startsWith('network:'))" :key="line">{{ line }}</li>
|
||||
</ul>
|
||||
<Button size="sm" class="mt-2" :disabled="!!store.busy" @click="store.approveUpdate(extension.name)">Approve</Button>
|
||||
</div>
|
||||
</Card>
|
||||
<Button
|
||||
v-if="updates.has(extension.name) && !extension.pending"
|
||||
variant="outline"
|
||||
|
||||
@@ -10,6 +10,7 @@ import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel } from "@/components/ui/field";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { api } from "@/lib/api";
|
||||
@@ -43,8 +44,6 @@ import DraftHint from "./DraftHint.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
|
||||
const KIND = "repository-policies";
|
||||
const DANGER_ROW =
|
||||
"relative isolate before:pointer-events-none before:absolute before:inset-y-0 before:-inset-x-3 before:-z-10 before:rounded-md before:border before:border-danger/40 before:bg-danger-soft";
|
||||
|
||||
interface Repo {
|
||||
connection: string;
|
||||
@@ -320,16 +319,16 @@ async function checkAccess(repo:Repo):Promise<void>{
|
||||
</Field>
|
||||
</form.Field>
|
||||
<form.Field v-slot="{ field }" :name="`${i}.allow_concurrent`">
|
||||
<Field orientation="responsive" :class="repo.allow_concurrent ? DANGER_ROW : undefined">
|
||||
<FieldContent>
|
||||
<FieldLabel>Concurrent tasks</FieldLabel>
|
||||
<FieldDescription>Only if worktrees cannot collide.</FieldDescription>
|
||||
</FieldContent>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1">
|
||||
<SettingRow
|
||||
:tone="repo.allow_concurrent ? 'danger' : 'default'"
|
||||
label="Concurrent tasks"
|
||||
hint="Only if worktrees cannot collide."
|
||||
>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3">
|
||||
<Switch :model-value="field.state.value" :aria-label="`Concurrent tasks for ${repo.name}`" @update:model-value="field.handleChange" />
|
||||
<DraftHint :kind="KIND" :path="`${i}.allow_concurrent`" />
|
||||
</div>
|
||||
</Field>
|
||||
</SettingRow>
|
||||
</form.Field>
|
||||
</FieldGroup>
|
||||
</template>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
import { onMounted, onUnmounted } from "vue";
|
||||
import { computed, onMounted, onUnmounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
|
||||
import CanaryStatusCard from "./CanaryStatusCard.vue";
|
||||
import ServicesCard from "./ServicesCard.vue";
|
||||
import UpdateSettingsCard from "./UpdateSettingsCard.vue";
|
||||
@@ -14,6 +14,9 @@ import { useSettingsStore } from "@/stores/settings";
|
||||
|
||||
const store = useSettingsStore();
|
||||
const { config } = storeToRefs(store);
|
||||
const bootstrapRows = computed(() =>
|
||||
Object.entries(config.value?.bootstrap ?? {}).map(([label, value]) => ({ label, value, mono: true })),
|
||||
);
|
||||
|
||||
let timer: ReturnType<typeof setInterval>;
|
||||
onMounted(() => {
|
||||
@@ -35,14 +38,7 @@ onUnmounted(() => clearInterval(timer));
|
||||
<UpdateSettingsCard />
|
||||
<CanaryStatusCard />
|
||||
<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">
|
||||
<TableCell class="font-mono">{{ key }}</TableCell>
|
||||
<TableCell class="w-full whitespace-normal text-fg-muted">{{ reason }}</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
<MetadataList :rows="bootstrapRows" />
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -12,6 +12,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { ByteSizeInput } from "@/components/ui/byte-size-input";
|
||||
import { DurationInput } from "@/components/ui/duration-input";
|
||||
import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel } from "@/components/ui/field";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
InputGroup,
|
||||
@@ -200,15 +201,12 @@ function looseNumber(value: string | number): number | string {
|
||||
</form.Field>
|
||||
|
||||
<form.Field v-slot="{ field }" name="web_fetch.allow_private_networks">
|
||||
<Field
|
||||
orientation="responsive"
|
||||
:class="field.state.value ? 'relative isolate before:pointer-events-none before:absolute before:inset-y-0 before:-inset-x-3 before:-z-10 before:rounded-md before:border before:border-danger/40 before:bg-danger-soft' : undefined"
|
||||
<SettingRow
|
||||
:tone="field.state.value ? 'danger' : 'default'"
|
||||
label="Allow private networks"
|
||||
hint="Host dashboard and Docker API access."
|
||||
>
|
||||
<FieldContent>
|
||||
<FieldLabel>Allow private networks</FieldLabel>
|
||||
<FieldDescription>Host dashboard and Docker API access.</FieldDescription>
|
||||
</FieldContent>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1">
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3">
|
||||
<Switch
|
||||
:model-value="field.state.value"
|
||||
aria-label="Allow private networks"
|
||||
@@ -217,7 +215,7 @@ function looseNumber(value: string | number): number | string {
|
||||
/>
|
||||
<DraftHint :kind="KIND" path="web_fetch.allow_private_networks" />
|
||||
</div>
|
||||
</Field>
|
||||
</SettingRow>
|
||||
</form.Field>
|
||||
</FieldGroup>
|
||||
</Section>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import CodeView from "@/base/CodeView.vue";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Table,
|
||||
@@ -197,12 +198,7 @@ useLiveResource("updates", () => void loadOutcome());
|
||||
|
||||
<Button class="mt-4 self-start" :disabled="installing" @click="install">{{ installing ? "Installing…" : `Install ${updateable.map((c) => c.label || c.id).join(", ")}`.trim() }}</Button>
|
||||
|
||||
<div
|
||||
v-if="installProgress.length"
|
||||
class="mt-3 rounded-sm border border-border bg-muted p-3 font-mono text-xs"
|
||||
>
|
||||
<p v-for="(line, i) in installProgress" :key="i">{{ line }}</p>
|
||||
</div>
|
||||
<CodeView v-if="installProgress.length" :code="installProgress.join('\n')" class="mt-3" />
|
||||
<p v-if="installResult" class="mt-2 text-sm text-ok">
|
||||
{{ installResult }}
|
||||
</p>
|
||||
|
||||
@@ -124,7 +124,7 @@ const headerActions = computed(() =>
|
||||
</Breadcrumb>
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-2xl font-semibold break-words text-balance">{{ title }}</h1>
|
||||
<h1 class="text-lg leading-tight font-semibold tracking-tight break-words text-balance sm:text-xl sm:leading-7">{{ title }}</h1>
|
||||
<div class="mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm">
|
||||
<Badge v-if="status" :variant="statusKind(status)">{{ statusLabel(status) }}</Badge>
|
||||
<Badge v-if="run.task?.approval" variant="outline">{{ approvalLabels[run.task.approval] ?? run.task.approval }}</Badge>
|
||||
|
||||
@@ -283,7 +283,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
|
||||
</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-caption 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"
|
||||
@@ -298,18 +298,18 @@ 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-caption 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>
|
||||
<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>
|
||||
<p v-else class="text-caption text-fg-subtle" :title="`Send an event to ${hookURL} and it appears here`">No events</p>
|
||||
</section>
|
||||
|
||||
<section class="space-y-1.5">
|
||||
<div class="text-xs font-medium text-fg-muted">Inputs</div>
|
||||
<div class="text-caption font-medium text-fg-muted">Inputs</div>
|
||||
<div class="divide-y divide-border rounded-md border border-border">
|
||||
<div v-for="[name, spec] in inputs" :key="name" class="space-y-1 px-3 py-2">
|
||||
<div class="flex items-center gap-1.5 text-xs">
|
||||
@@ -358,13 +358,13 @@ const resume = () => transition(api.bindingResume, "pending_approval");
|
||||
<Alert v-if="resolved(REPOSITORY_FIELD).failure" variant="destructive"><AlertDescription>{{ resolved(REPOSITORY_FIELD).failure }}</AlertDescription></Alert>
|
||||
<p v-else-if="resolved(REPOSITORY_FIELD).value !== undefined" class="truncate font-mono text-xs text-success">{{ resolved(REPOSITORY_FIELD).value }}</p>
|
||||
</div>
|
||||
<p v-if="!inputs.length && !repository" class="px-3 py-2 text-xs text-fg-subtle">No inputs.</p>
|
||||
<p v-if="!inputs.length && !repository" class="px-3 py-2 text-caption text-fg-subtle">No inputs.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="space-y-2">
|
||||
<Alert v-if="error" variant="destructive"><AlertDescription>{{ error }}</AlertDescription></Alert>
|
||||
<p v-else-if="blockers.length" class="text-xs text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
|
||||
<p v-else-if="blockers.length" class="text-caption text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Button type="submit" size="sm" :disabled="saving || !!blockers.length"><Spinner v-if="saving" />Save binding</Button>
|
||||
<Button v-if="binding && status === 'pending_approval'" type="button" size="sm" variant="outline" @click="approve">Approve</Button>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { ArrowLeft } from "@lucide/vue";
|
||||
@@ -191,13 +192,13 @@ 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-caption font-medium text-fg-muted">Schedule</Label>
|
||||
<Alert v-if="loadError" variant="destructive"><AlertDescription>{{ loadError }}</AlertDescription></Alert>
|
||||
<OptionSelect v-else id="schedule-trigger" aria-label="Schedule" :model-value="scheduleId" :options="scheduleOptions" class="w-full" @update:model-value="pickSchedule" />
|
||||
</section>
|
||||
|
||||
<section class="space-y-1.5">
|
||||
<div class="text-xs font-medium text-fg-muted">Inputs</div>
|
||||
<div class="text-caption font-medium text-fg-muted">Inputs</div>
|
||||
<div class="divide-y divide-border rounded-md border border-border">
|
||||
<div v-for="[name, spec] in inputs" :key="name" class="space-y-1 px-3 py-2">
|
||||
<div class="flex items-center gap-1.5 text-xs">
|
||||
@@ -208,13 +209,13 @@ async function remove(): Promise<void> {
|
||||
<OptionSelect :aria-label="`${name} source`" :model-value="rows[name]!.from" :options="fieldOptions" class="w-full" @update:model-value="rows[name]!.from = $event" />
|
||||
<Input v-if="rows[name]!.from === FIXED" v-model="rows[name]!.value" :aria-label="`${name} fixed value`" placeholder="fixed value" class="h-8 w-full font-mono text-xs" />
|
||||
</div>
|
||||
<p v-if="!inputs.length" class="px-3 py-2 text-xs text-fg-subtle">No inputs.</p>
|
||||
<Empty v-if="!inputs.length"><EmptyHeader><EmptyTitle>No inputs.</EmptyTitle></EmptyHeader></Empty>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="space-y-2">
|
||||
<Alert v-if="error" variant="destructive"><AlertDescription>{{ error }}</AlertDescription></Alert>
|
||||
<p v-else-if="blockers.length" class="text-xs text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
|
||||
<p v-else-if="blockers.length" class="text-caption text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Button type="submit" size="sm" :disabled="saving || !!blockers.length"><Spinner v-if="saving" />Save trigger</Button>
|
||||
<Button v-if="binding && status === 'pending_approval'" type="button" size="sm" variant="outline" @click="transition(api.bindingApprove, 'armed')">Approve</Button>
|
||||
|
||||
@@ -32,7 +32,7 @@ function add(): void {
|
||||
|
||||
<template>
|
||||
<section class="space-y-1.5">
|
||||
<div class="flex items-center text-xs font-medium text-fg-muted">
|
||||
<div class="flex items-center text-caption font-medium text-fg-muted">
|
||||
{{ field === "inputs" ? "Inputs" : "Outputs" }}
|
||||
<Button type="button" variant="ghost" size="xs" class="ml-auto" @click="add"><Plus data-icon="inline-start" />Add</Button>
|
||||
</div>
|
||||
|
||||
@@ -157,14 +157,14 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
|
||||
<template>
|
||||
<div class="space-y-4 px-3 py-3">
|
||||
<p v-if="problem" class="rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger" role="alert">{{ problem }}</p>
|
||||
<Alert v-if="problem" variant="destructive"><AlertDescription>{{ problem }}</AlertDescription></Alert>
|
||||
|
||||
<section v-if="branching" class="space-y-3">
|
||||
<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>
|
||||
<span class="text-caption 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>
|
||||
<div class="text-xs font-medium text-fg-muted">{{ type === "switch" ? "Cases" : "Branches" }}</div>
|
||||
<div class="text-caption 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())" />
|
||||
<Button type="button" variant="ghost" size="icon-sm" :aria-label="`Remove ${name}`" :disabled="branches.length <= minBranches" @click="changeBranch('delete', name)"><Trash2 /></Button>
|
||||
@@ -177,7 +177,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
</section>
|
||||
|
||||
<section v-if="fields.lead" class="space-y-1.5">
|
||||
<div class="flex items-center gap-1 text-xs font-medium text-fg-muted" :title="fields.lead.schema.description">
|
||||
<div class="flex items-center gap-1 text-caption font-medium text-fg-muted" :title="fields.lead.schema.description">
|
||||
{{ label(fields.lead.key, fields.lead.schema) }}
|
||||
<CircleHelp v-if="fields.lead.schema.description" class="size-3 text-fg-subtle" />
|
||||
</div>
|
||||
@@ -234,9 +234,9 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
|
||||
<template v-if="type === 'workflow.call' && callee">
|
||||
<section v-if="callInputs.length" class="space-y-3">
|
||||
<div class="text-xs font-medium text-fg-muted">Inputs</div>
|
||||
<div class="text-caption font-medium text-fg-muted">Inputs</div>
|
||||
<div v-for="[name, spec] in callInputs" :key="name" class="space-y-1.5">
|
||||
<div class="text-label">{{ name }}<span v-if="spec.required" class="text-danger"> *</span><span class="ml-2 text-xs text-fg-subtle">{{ spec.type }}</span></div>
|
||||
<div class="text-label">{{ name }}<span v-if="spec.required" class="text-danger"> *</span><span class="ml-2 text-caption text-fg-subtle">{{ spec.type }}</span></div>
|
||||
<OptionSelect
|
||||
v-if="!structured(spec)"
|
||||
class="w-full"
|
||||
@@ -251,16 +251,16 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
</div>
|
||||
</section>
|
||||
<section v-if="callOutputs.length" class="space-y-3">
|
||||
<div class="text-xs font-medium text-fg-muted">Outputs</div>
|
||||
<div class="text-caption font-medium text-fg-muted">Outputs</div>
|
||||
<div v-for="[name, spec] in callOutputs" :key="name" class="space-y-1.5">
|
||||
<div class="text-label">{{ name }}<span class="ml-2 text-xs text-fg-subtle">{{ spec.type }}</span></div>
|
||||
<div class="text-label">{{ name }}<span class="ml-2 text-caption text-fg-subtle">{{ spec.type }}</span></div>
|
||||
<OptionSelect class="w-full" :aria-label="`${name} output`" :disabled="settings.wait !== true" :model-value="outputMap[name] ?? ''" :options="[{ value: '', label: 'Do not publish' }, ...matching(callerOutputs, spec, 'outputs')]" @update:model-value="setSetting('outputs', { ...outputMap, [name]: $event || undefined })" />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<section v-for="field in fields.long" :key="field.key" class="space-y-1.5">
|
||||
<div class="flex items-center gap-1 text-xs font-medium text-fg-muted" :title="field.schema.description">
|
||||
<div class="flex items-center gap-1 text-caption font-medium text-fg-muted" :title="field.schema.description">
|
||||
{{ label(field.key, field.schema) }}
|
||||
<CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" />
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { RotateCcw } from "@lucide/vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { ago } from "@/lib/format";
|
||||
@@ -72,7 +73,7 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
|
||||
<Button type="button" size="sm" variant="outline" class="ml-auto" :disabled="then === null || identical" :title="then === null ? 'Workflow removed' : undefined" @click="emit('restore', then!)">
|
||||
<RotateCcw data-icon="inline-start" /> Restore this version</Button>
|
||||
</div>
|
||||
<p v-if="then === null" class="rounded-lg border border-border p-4 text-sm text-fg-muted">Workflow removed in this revision.</p>
|
||||
<Empty v-if="then === null"><EmptyHeader><EmptyTitle>Workflow removed in this revision.</EmptyTitle></EmptyHeader></Empty>
|
||||
<pre v-else-if="mode === 'yaml'" class="min-h-0 flex-1 overflow-auto rounded-lg border border-border pt-2 pb-[calc(0.5rem+var(--code-overscroll))] font-mono text-label leading-6"><code><span
|
||||
v-for="(line, i) in diff"
|
||||
:key="i"
|
||||
|
||||
@@ -96,7 +96,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
||||
/>
|
||||
</Label>
|
||||
<Alert v-if="identitiesError" variant="destructive" class="m-3"><AlertDescription>{{ identitiesError }} <Button variant="link" size="xs" @click="loadAgents">Retry</Button></AlertDescription></Alert>
|
||||
<p v-else-if="!identitiesLoading && !agents.length" class="px-3 py-2 text-xs text-fg-subtle">No active agents in your organisation.</p>
|
||||
<p v-else-if="!identitiesLoading && !agents.length" class="px-3 py-2 text-caption 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">
|
||||
<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)" />
|
||||
@@ -132,7 +132,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
||||
</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-caption font-medium text-fg-muted">Instructions</Label>
|
||||
<Textarea
|
||||
id="workflow-instructions"
|
||||
:model-value="text('instructions')"
|
||||
|
||||
Reference in new issue
Block a user