feat(webui): port the dashboard (Phases 3-5)
Every page from the deleted Preact dashboard, rebuilt in Vue 3 + shadcn-vue.
The navigation restructure landed earlier on this branch; this is the surfaces
behind it, and the two are now one app.
Dashboard, Tasks (list and detail), Configuration split six ways, Logs,
Inspector, Mappings, Bindings, Workflows, Skills, Curators, Channels, chat.
Components, not files: docs/prds/dashboard-port-brief.md requires one
component, one job, one file, with shared state in a module beside it. So a
page file composes and holds nothing, and a shape repeated across panes becomes
its own component (LogRow, PageHeader, PanelLoading, WorkflowBar).
Behaviour that had to survive, because each was a fix:
- Live activity's detail is clamped to one line with the payload on the title.
Unclamped, one row made the dashboard 7,481px tall.
- Each health card takes its own height. Equalising left a mostly-empty box
taking a quarter of the first screen once setup was done.
- Tasks: `tab`/`attempt` live in the query string and are written with
router.replace, so a tab click adds no history entry and does not remount.
The list's deep-link reveal honours prefers-reduced-motion.
- LOG_LEVELS is a wire contract (the server matches that CSV server-side), used
unchanged by both log panes.
- The chat panel's Phase 5 list: a FAB that is the only toggle, a morph whose
scale, radius and position interpolate together, no scrim, no close button,
Escape returning focus to the launcher, Stop only while streaming.
- Unconfigured is not broken. A 501 on /api/version or the log stream renders
what is true ("Not configured on this deployment") rather than blank, and a
read-only Configuration says so instead of offering controls that cannot work.
Three things the port decided rather than carried:
- Button gains an `attention` variant and Badge the five status tones, in the
project's own cva. The pill's dot did not come across: the Badge's shape is
the affordance, and the same tone now covers a trend indicator.
- The icon module is not ported. Its name-to-glyph lookup is the pattern
shadcn-vue's rules call out as wrong, so icons come from @lucide/vue at the
call site. The five bespoke glyphs have no consumer yet and become components
if a page draws them.
- The theme control left the topbar for /system/appearance, per the approved
navigation design. ThemeToggle.vue and Placeholder.vue are deleted rather
than orphaned: every route now resolves to a real page.
Also fixes the bundle freshness check failing on the first build after every
change. ui/dist is committed, so nothing ignores it and Tailwind's content
detection scanned it, making each build an input to the next.
This commit is contained in:
1 parent
5fe25045d1
commit
b9daa01b4b
276 files changed
+12888
-563
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
/**
|
||||
* One titled card of the System surface. Every card on the six pages opens the
|
||||
* same way -- a title, and the line that says what it covers -- so it is a
|
||||
* component rather than six copies of the same CardHeader markup.
|
||||
*
|
||||
* The card owns its own bottom margin: the pages stack cards directly, with
|
||||
* nothing between them.
|
||||
*/
|
||||
defineProps<{ title: string; description?: string }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card class="mb-4">
|
||||
<CardHeader>
|
||||
<CardTitle>{{ title }}</CardTitle>
|
||||
<CardDescription v-if="description">{{ description }}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<slot />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</template>
|
||||
@@ -0,0 +1,72 @@
|
||||
<script setup lang="ts">
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import type { ConfigFieldType } from "./types";
|
||||
|
||||
/**
|
||||
* The editor for one config field: a text input, or a select for the two types
|
||||
* whose value is a closed set.
|
||||
*
|
||||
* It owns focus -- the row mounts it the moment the row enters edit mode, so
|
||||
* the first keystroke lands in the control -- and reports Enter and Escape.
|
||||
* Saving and cancelling belong to the row, which is what knows whether what
|
||||
* was typed can be sent.
|
||||
*
|
||||
* Enter commits for the text input only. reka's select opens its listbox on
|
||||
* Enter, so a select commits through its own listbox and the row's Save.
|
||||
*/
|
||||
const props = defineProps<{
|
||||
modelValue: string;
|
||||
type: ConfigFieldType;
|
||||
options?: string[];
|
||||
disabled?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
"update:modelValue": [string];
|
||||
save: [];
|
||||
cancel: [];
|
||||
}>();
|
||||
|
||||
const BOOL_OPTIONS = ["true", "false"];
|
||||
|
||||
function update(value: unknown): void {
|
||||
emit("update:modelValue", String(value ?? ""));
|
||||
}
|
||||
|
||||
const vFocus = {
|
||||
mounted: (el: HTMLElement) => {
|
||||
el.focus();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Select
|
||||
v-if="props.type === 'bool' || props.type === 'enum'"
|
||||
:model-value="props.modelValue"
|
||||
:disabled="props.disabled"
|
||||
@update:model-value="update"
|
||||
>
|
||||
<SelectTrigger v-focus class="w-full" :aria-label="props.type === 'bool' ? 'Value' : 'Option'">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="option in props.type === 'bool' ? BOOL_OPTIONS : props.options || []" :key="option" :value="option">
|
||||
{{ option }}
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Input
|
||||
v-else
|
||||
v-focus
|
||||
:model-value="props.modelValue"
|
||||
:disabled="props.disabled"
|
||||
autocomplete="off"
|
||||
@update:model-value="update"
|
||||
@keydown.enter.prevent="emit('save')"
|
||||
@keydown.esc="emit('cancel')"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* The key/value grid the configuration rows sit in.
|
||||
*
|
||||
* The list owns the three column tracks and every row adopts them with
|
||||
* subgrid, so all values start at the same x (the widest label's edge) and
|
||||
* every action column lines up. A row that declared its own tracks cannot do
|
||||
* that: a `max-content` label track resolves per row and the values come out
|
||||
* ragged (the fault this layout was rewritten for).
|
||||
*
|
||||
* An engine without subgrid gets a single-column list, so each row is still a
|
||||
* full-width item and the row's own bounded tracks do the alignment instead.
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-1 min-[701px]:supports-[grid-template-columns:subgrid]:grid-cols-[max-content_minmax(0,1fr)_auto]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { config } from "./state";
|
||||
|
||||
/**
|
||||
* What the running configuration says about itself: whether the runtime
|
||||
* overlay is in effect, and whether the last reload was applied. The running
|
||||
* config is unchanged after a failed reload, so the notice is a statement
|
||||
* about state rather than a warning about the values below it.
|
||||
*/
|
||||
const overlayUnavailable = computed(() => config.value?.reload?.overlay_unavailable ?? "");
|
||||
const lastError = computed(() => config.value?.reload?.last_error ?? "");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Alert v-if="overlayUnavailable" class="mb-4">
|
||||
<AlertDescription>The runtime config overlay is not in effect: {{ overlayUnavailable }}</AlertDescription>
|
||||
</Alert>
|
||||
<Alert v-if="lastError" class="mb-4">
|
||||
<AlertDescription>The last config reload failed; the running config is unchanged: {{ lastError }}</AlertDescription>
|
||||
</Alert>
|
||||
</template>
|
||||
@@ -0,0 +1,148 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { parseEdit, valueText } from "./config-field";
|
||||
import ConfigControl from "./ConfigControl.vue";
|
||||
import { errorText, loadConfig } from "./state";
|
||||
import type { ConfigField } from "./types";
|
||||
|
||||
/**
|
||||
* One row of a key/value list: the label, the value the process is running
|
||||
* with, and -- when the field is editable and this process holds the write
|
||||
* path -- the edit and reset controls.
|
||||
*
|
||||
* A locked field shows its value and the reason instead of a control: those
|
||||
* keys are the daemon's own bootstrap inputs, and changing one from here could
|
||||
* break the next boot. A process serving a published snapshot has no write
|
||||
* path at all, so it renders every editable field as a value rather than a
|
||||
* control that would answer 503 (archie-core-ymut).
|
||||
*
|
||||
* Every row is a subgrid of the list's three tracks, so the columns line up
|
||||
* across rows; see ConfigList.
|
||||
*/
|
||||
const props = defineProps<{
|
||||
label: string;
|
||||
value?: unknown;
|
||||
/** The descriptor that makes the row editable. Absent for a value-only row,
|
||||
* which is what the provenance list uses. */
|
||||
field?: ConfigField;
|
||||
/** Whether the serving process can apply changes at all. */
|
||||
editable?: boolean;
|
||||
}>();
|
||||
|
||||
const text = computed(() => valueText(props.value));
|
||||
|
||||
const editing = ref(false);
|
||||
const draft = ref("");
|
||||
const error = ref<string | null>(null);
|
||||
const saving = ref(false);
|
||||
const resetting = ref(false);
|
||||
|
||||
const lockedReason = computed(() => props.field?.locked_reason ?? "");
|
||||
const overridden = computed(() => Boolean(props.field?.overridden));
|
||||
const canEdit = computed(() => Boolean(props.field?.editable) && props.editable !== false && !lockedReason.value);
|
||||
|
||||
function startEdit(): void {
|
||||
if (!props.field) return;
|
||||
draft.value = String(props.field.value ?? "");
|
||||
error.value = null;
|
||||
editing.value = true;
|
||||
}
|
||||
|
||||
async function save(): Promise<void> {
|
||||
const target = props.field;
|
||||
if (!target) return;
|
||||
const parsed = parseEdit(target.type, draft.value);
|
||||
if (parsed.error) {
|
||||
error.value = parsed.error;
|
||||
return;
|
||||
}
|
||||
saving.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
await api.configUpdate({ [target.key]: parsed.value });
|
||||
editing.value = false;
|
||||
await loadConfig();
|
||||
} catch (err) {
|
||||
error.value = errorText(err);
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function reset(): Promise<void> {
|
||||
const target = props.field;
|
||||
if (!target) return;
|
||||
resetting.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
await api.configReset(target.key);
|
||||
await loadConfig();
|
||||
} catch (err) {
|
||||
error.value = errorText(err);
|
||||
} finally {
|
||||
resetting.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="grid grid-cols-1 items-center gap-x-4 gap-y-1 border-t border-border py-2 first:border-t-0 hover:bg-muted/40 min-[701px]:grid-cols-[minmax(8rem,16rem)_minmax(0,1fr)_auto] min-[701px]:supports-[grid-template-columns:subgrid]:col-span-full min-[701px]:supports-[grid-template-columns:subgrid]:grid-cols-subgrid"
|
||||
>
|
||||
<!-- The field's own description is the row's tooltip: the line that
|
||||
explains a setting is the one place that explanation fits without
|
||||
pushing every row apart. -->
|
||||
<Tooltip v-if="field?.description">
|
||||
<TooltipTrigger as-child>
|
||||
<span class="text-sm text-fg-muted">{{ label }}</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent :side-offset="8" class="max-w-80">{{ field.description }}</TooltipContent>
|
||||
</Tooltip>
|
||||
<span v-else class="text-sm text-fg-muted">{{ label }}</span>
|
||||
|
||||
<template v-if="editing && field">
|
||||
<ConfigControl v-model="draft" :type="field.type" :options="field.options" :disabled="saving" @save="save" @cancel="editing = false" />
|
||||
<div class="flex items-center gap-2 justify-self-end">
|
||||
<Button size="sm" :disabled="saving" @click="save">Save</Button>
|
||||
<Button variant="outline" size="sm" :disabled="saving" @click="editing = false">Cancel</Button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- min-w-0 is load-bearing: a grid item refuses to shrink below its
|
||||
content by default, which is what pushed long paths into the action
|
||||
column and truncated them against the buttons. -->
|
||||
<slot name="value">
|
||||
<span
|
||||
:class="cn('min-w-0 break-words font-mono text-sm min-[701px]:truncate', text === '—' ? 'text-fg-subtle' : 'text-foreground', lockedReason && 'text-fg-muted')"
|
||||
:title="text"
|
||||
>{{ text }}</span>
|
||||
</slot>
|
||||
<!-- The controls sit in the row rather than appearing on hover: one that
|
||||
only exists on hover is invisible to touch and to anyone scanning
|
||||
for what is editable. -->
|
||||
<div v-if="canEdit" class="flex items-center gap-2 justify-self-end">
|
||||
<Badge v-if="overridden" variant="warn" title="Set from the dashboard; this shadows the value in the config file">overridden</Badge>
|
||||
<Button variant="ghost" size="sm" :title="`Edit ${label}`" @click="startEdit">Edit</Button>
|
||||
<Button
|
||||
v-if="overridden"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
title="Discard the dashboard value and fall back to the config file"
|
||||
:disabled="resetting"
|
||||
@click="reset"
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<span v-if="lockedReason" class="col-span-full text-xs text-fg-subtle min-[701px]:col-span-2 min-[701px]:col-start-2">{{ lockedReason }}</span>
|
||||
<span v-if="error" class="col-span-full text-xs text-danger min-[701px]:col-span-2 min-[701px]:col-start-2" role="alert">{{ error }}</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
import ConfigRow from "./ConfigRow.vue";
|
||||
import { sectionRows, sectionsFor } from "./sections";
|
||||
import { config, configEditable } from "./state";
|
||||
|
||||
/**
|
||||
* The generic schema rows for one page. The daemon serves one catalog of
|
||||
* sections (internal/webui/config_schema.go) and this renders the ones that
|
||||
* belong to the route it is handed, so a field added on the backend appears
|
||||
* here without a frontend change.
|
||||
*/
|
||||
const props = defineProps<{ ids: string[] }>();
|
||||
|
||||
const sections = computed(() => sectionsFor(config.value?.schema, props.ids));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard v-for="section in sections" :key="section.id" :title="section.label" :description="section.description">
|
||||
<ConfigList>
|
||||
<ConfigRow
|
||||
v-for="field in sectionRows(section)"
|
||||
:key="field.key"
|
||||
:label="field.label"
|
||||
:value="field.value"
|
||||
:field="field"
|
||||
:editable="configEditable"
|
||||
/>
|
||||
</ConfigList>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { configError } from "./state";
|
||||
|
||||
/**
|
||||
* What a System page shows in place of its content when there is none to
|
||||
* render: a failed read, or archied running without a config file wired into
|
||||
* the dashboard. The page renders this instead of its cards rather than beside
|
||||
* them -- half a page that quietly omitted the rest would read as the whole.
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card class="mb-4">
|
||||
<CardContent>
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>{{ configError ? "Cannot reach archied" : "No configuration loaded" }}</EmptyTitle>
|
||||
<EmptyDescription v-if="configError">{{ configError }}</EmptyDescription>
|
||||
<EmptyDescription v-else>
|
||||
archied is running without a config file wired into the dashboard, so there is nothing to show.
|
||||
</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</template>
|
||||
@@ -0,0 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Field, FieldLabel } from "@/components/ui/field";
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { requestDangerous } from "./state";
|
||||
import type { DangerCheckpoint } from "./types";
|
||||
|
||||
/**
|
||||
* Queues a rollback to a checkpoint. The request only asks: an approval has to
|
||||
* be granted in the list below before anything runs.
|
||||
*
|
||||
* A checkpoint's number and label arrive under either casing depending on the
|
||||
* source, so both are read.
|
||||
*/
|
||||
const props = defineProps<{ checkpoints: DangerCheckpoint[] }>();
|
||||
|
||||
const checkpoint = ref("");
|
||||
|
||||
const number = (cp: DangerCheckpoint): number | undefined => cp.Number ?? cp.number;
|
||||
const label = (cp: DangerCheckpoint): string => cp.Label ?? cp.label ?? "checkpoint";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Field orientation="horizontal">
|
||||
<FieldLabel class="sr-only" for="danger-checkpoint">Checkpoint</FieldLabel>
|
||||
<Select v-model="checkpoint">
|
||||
<SelectTrigger id="danger-checkpoint" class="w-full min-[701px]:max-w-80">
|
||||
<SelectValue placeholder="Select checkpoint" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="cp in props.checkpoints" :key="String(number(cp))" :value="String(number(cp))">
|
||||
{{ number(cp) }} — {{ label(cp) }}
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button variant="outline" :disabled="!checkpoint" @click="requestDangerous('rollback', checkpoint)">
|
||||
Request rollback
|
||||
</Button>
|
||||
</Field>
|
||||
</template>
|
||||
@@ -0,0 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Field, FieldLabel } from "@/components/ui/field";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { requestDangerous } from "./state";
|
||||
|
||||
/**
|
||||
* Queues a stop for a named process. Like every request here it only asks:
|
||||
* the approval decides whether it runs.
|
||||
*/
|
||||
const spec = ref("");
|
||||
const requested = computed(() => spec.value.trim().length > 0);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Field orientation="horizontal">
|
||||
<FieldLabel class="sr-only" for="danger-stop">Process name or id</FieldLabel>
|
||||
<Input
|
||||
id="danger-stop"
|
||||
v-model="spec"
|
||||
placeholder="Process name or id"
|
||||
autocomplete="off"
|
||||
class="w-full min-[701px]:max-w-80"
|
||||
/>
|
||||
<Button variant="outline" :disabled="!requested" @click="requestDangerous('stop', spec)">Request stop</Button>
|
||||
</Field>
|
||||
</template>
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { decideDangerous } from "./state";
|
||||
import type { DangerousAction } from "./types";
|
||||
|
||||
/**
|
||||
* One queued request: what it would do, and the decisions open on it. Approve
|
||||
* runs it once, "Approve for 24h" runs it for a day, and Deny drops it.
|
||||
*/
|
||||
const props = defineProps<{ action: DangerousAction }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 border-t border-hairline py-3">
|
||||
<span class="text-sm">{{ props.action.description }}</span>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Button variant="outline" @click="decideDangerous(props.action.id, 'approve')">Approve</Button>
|
||||
<Button variant="outline" @click="decideDangerous(props.action.id, 'permanent')">Approve for 24h</Button>
|
||||
<Button variant="outline" @click="decideDangerous(props.action.id, 'deny')">Deny</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import DangerRollbackRequest from "./DangerRollbackRequest.vue";
|
||||
import DangerStopRequest from "./DangerStopRequest.vue";
|
||||
import DangerousActionRow from "./DangerousActionRow.vue";
|
||||
import { dangerous } from "./state";
|
||||
|
||||
/**
|
||||
* Requests and adjudicates the actions that need approval.
|
||||
*
|
||||
* These controls used to sit in the chat panel, which is where they were first
|
||||
* built; installing an update and approving a dangerous action are things you
|
||||
* do to the deployment, not things you say to Archie, so they moved here with
|
||||
* Configuration's other operator controls (archie-core-tf20).
|
||||
*
|
||||
* Nothing here acts on its own: a request only queues an approval, and the
|
||||
* decision buttons are the only thing that lets one run. A deployment that did
|
||||
* not wire the capability answers 501, which leaves `dangerous` null and the
|
||||
* card absent rather than in an error state.
|
||||
*/
|
||||
const pending = computed(() => dangerous.value?.pending ?? []);
|
||||
const checkpoints = computed(() => dangerous.value?.checkpoints ?? []);
|
||||
const error = computed(() => dangerous.value?.error ?? "");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard
|
||||
v-if="dangerous"
|
||||
title="Dangerous actions"
|
||||
:description="
|
||||
error
|
||||
? 'Actions that need explicit approval before they run.'
|
||||
: 'Actions that need explicit approval before they run. Requesting one only queues it.'
|
||||
"
|
||||
>
|
||||
<p v-if="error" class="text-sm text-fg-muted">{{ error }}</p>
|
||||
<template v-else>
|
||||
<!-- Each request is its own row with its own input: they queue
|
||||
different kinds of approval and share nothing but the card. -->
|
||||
<div class="flex flex-col gap-3">
|
||||
<DangerRollbackRequest :checkpoints="checkpoints" />
|
||||
<DangerStopRequest />
|
||||
</div>
|
||||
<p v-if="!pending.length" class="mt-3 text-sm text-fg-muted">No pending dangerous actions.</p>
|
||||
<div v-else class="mt-3">
|
||||
<DangerousActionRow v-for="action in pending" :key="action.id" :action="action" />
|
||||
</div>
|
||||
</template>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import { Button, type ButtonVariants } from "@/components/ui/button";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
import ConfigRow from "./ConfigRow.vue";
|
||||
import type { LifecycleEntry } from "./types";
|
||||
|
||||
/**
|
||||
* The operator actions archied offers, shown as the control each one renders
|
||||
* as. They are disabled here: this is the vocabulary, not a task to act on,
|
||||
* and every one of them needs a task to mean anything.
|
||||
*/
|
||||
const props = defineProps<{ actions: LifecycleEntry[] }>();
|
||||
|
||||
/** A quiet action reads as a plain control, a dangerous one as a destructive
|
||||
* one, so the list shows the weight each action carries. */
|
||||
function actionVariant(kind?: string): ButtonVariants["variant"] {
|
||||
if (kind === "quiet") return "ghost";
|
||||
if (kind === "danger") return "destructive";
|
||||
return "outline";
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h3 class="mt-5 mb-2 text-sm font-semibold text-fg-muted">Actions</h3>
|
||||
<Empty v-if="!props.actions.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No actions reported</EmptyTitle>
|
||||
<EmptyDescription>The server did not return any operator actions.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ConfigList v-else>
|
||||
<ConfigRow v-for="action in props.actions" :key="action.id" :label="action.id">
|
||||
<template #value>
|
||||
<span>
|
||||
<Button :variant="actionVariant(action.kind)" size="xs" disabled>{{ action.label ?? action.id }}</Button>
|
||||
</span>
|
||||
</template>
|
||||
</ConfigRow>
|
||||
</ConfigList>
|
||||
</template>
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import LifecycleActionList from "./LifecycleActionList.vue";
|
||||
import LifecycleStatusList from "./LifecycleStatusList.vue";
|
||||
import { lifecycle, lifecycleError } from "./state";
|
||||
|
||||
/**
|
||||
* The work lifecycle archied ships: its task statuses and the operator actions
|
||||
* that act on them. Both lists come from the server (GET /api/task-meta), so a
|
||||
* status or action added on the backend appears here without a frontend change.
|
||||
*/
|
||||
const statuses = computed(() => lifecycle.value?.statuses ?? []);
|
||||
const actions = computed(() => lifecycle.value?.actions ?? []);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard
|
||||
v-if="lifecycleError"
|
||||
title="Work lifecycle"
|
||||
description="The task statuses and operator actions archied ships."
|
||||
>
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Lifecycle unavailable</EmptyTitle>
|
||||
<EmptyDescription>{{ lifecycleError }}</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</ConfigCard>
|
||||
<ConfigCard
|
||||
v-else
|
||||
title="Work lifecycle"
|
||||
description="The task statuses and operator actions archied ships. Add one on the backend and it appears here without a frontend change."
|
||||
>
|
||||
<LifecycleStatusList :statuses="statuses" />
|
||||
<LifecycleActionList :actions="actions" />
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import { statusKind, statusLabel } from "@/lib/task-meta";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
import ConfigRow from "./ConfigRow.vue";
|
||||
import type { LifecycleEntry } from "./types";
|
||||
|
||||
/**
|
||||
* The statuses a task can be in, each with the severity it carries. The
|
||||
* server's own label and kind win; a status it did not describe falls back to
|
||||
* the shared lifecycle vocabulary (lib/task-meta), which is what every other
|
||||
* surface names statuses by.
|
||||
*/
|
||||
const props = defineProps<{ statuses: LifecycleEntry[] }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h3 class="mt-5 mb-2 text-sm font-semibold text-fg-muted first:mt-0">Statuses</h3>
|
||||
<Empty v-if="!props.statuses.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No statuses reported</EmptyTitle>
|
||||
<EmptyDescription>The server did not return any lifecycle statuses.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ConfigList v-else>
|
||||
<ConfigRow v-for="status in props.statuses" :key="status.id" :label="status.id">
|
||||
<template #value>
|
||||
<span>
|
||||
<Badge :variant="(status.kind ?? statusKind(status.id)) as StatusKind">
|
||||
{{ status.label ?? statusLabel(status.id) }}
|
||||
</Badge>
|
||||
</span>
|
||||
</template>
|
||||
</ConfigRow>
|
||||
</ConfigList>
|
||||
</template>
|
||||
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
import ConfigRow from "./ConfigRow.vue";
|
||||
import { config } from "./state";
|
||||
|
||||
/**
|
||||
* Which model handles each stage of work. The role keys are the server's
|
||||
* (lowercase, underscored) and are read as words here.
|
||||
*/
|
||||
const entries = computed(() => Object.entries(config.value?.models ?? {}));
|
||||
|
||||
function roleLabel(role: string): string {
|
||||
if (!role) return "Unknown role";
|
||||
return role.charAt(0).toUpperCase() + role.slice(1).replace(/_/g, " ");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h3 class="mt-5 mb-2 text-sm font-semibold text-fg-muted first:mt-0">Model roles</h3>
|
||||
<Empty v-if="!entries.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No model roles configured</EmptyTitle>
|
||||
<EmptyDescription>Assign a model to at least one role (e.g. "builder") in [models].</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ConfigList v-else>
|
||||
<ConfigRow v-for="[role, model] in entries" :key="role" :label="roleLabel(role)" :value="model" />
|
||||
</ConfigList>
|
||||
</template>
|
||||
@@ -0,0 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import ModelRoleList from "./ModelRoleList.vue";
|
||||
import ProviderTable from "./ProviderTable.vue";
|
||||
|
||||
/**
|
||||
* Which model handles each stage of work, and which LLM providers back them.
|
||||
* One card with two lists: the providers exist to serve the roles, so reading
|
||||
* them apart would hide the pairing.
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard
|
||||
title="Models & providers"
|
||||
description="Which model handles each stage of work, and which LLM providers are wired up. Only the environment variable NAME is shown, never its value."
|
||||
>
|
||||
<ModelRoleList />
|
||||
<ProviderTable />
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
import ConfigRow from "./ConfigRow.vue";
|
||||
import { config } from "./state";
|
||||
|
||||
/**
|
||||
* The files that supplied the running configuration. The order is the
|
||||
* precedence order: applied from top to bottom, later entries override earlier
|
||||
* ones, which is the one thing a reader of this list needs to know.
|
||||
*/
|
||||
const origins = computed(() => config.value?.provenance ?? []);
|
||||
|
||||
const rows = computed(() =>
|
||||
origins.value.map((origin) => ({
|
||||
label: `${origin.layer} ${origin.role}${origin.feature ? ` (${origin.feature})` : ""}`,
|
||||
value: origin.path,
|
||||
})),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard
|
||||
title="Configuration sources"
|
||||
:description="
|
||||
origins.length
|
||||
? 'Applied from top to bottom; later entries take precedence over earlier ones.'
|
||||
: 'The files that supplied the running configuration.'
|
||||
"
|
||||
>
|
||||
<Empty v-if="!origins.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Source provenance is unavailable.</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ConfigList v-else>
|
||||
<ConfigRow v-for="(row, index) in rows" :key="index" :label="row.label" :value="row.value" />
|
||||
</ConfigList>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import { config } from "./state";
|
||||
|
||||
/**
|
||||
* The LLM providers wired up, and whether their credentials are actually
|
||||
* present. Only the environment variable NAME is shown, never its value; a
|
||||
* provider with no credential form set is not an error, just unusable, which
|
||||
* is what the status column says.
|
||||
*/
|
||||
const providers = computed(() => Object.entries(config.value?.providers ?? {}));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h3 class="mt-5 mb-2 text-sm font-semibold text-fg-muted">Providers</h3>
|
||||
<Empty v-if="!providers.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No providers configured</EmptyTitle>
|
||||
<EmptyDescription>Add a [providers.<name>] entry so a model role above has something to run on.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<Table v-else>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Provider</TableHead>
|
||||
<TableHead>Class</TableHead>
|
||||
<TableHead>Base URL</TableHead>
|
||||
<TableHead>API key env var</TableHead>
|
||||
<TableHead>Status</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-for="[name, provider] in providers" :key="name">
|
||||
<TableCell class="font-medium">{{ name }}</TableCell>
|
||||
<TableCell>{{ provider.class }}</TableCell>
|
||||
<TableCell class="font-mono">{{ provider.base_url || "default" }}</TableCell>
|
||||
<TableCell class="font-mono">{{ provider.api_key_env || "—" }}</TableCell>
|
||||
<TableCell>
|
||||
<Badge v-if="provider.configured" variant="ok">configured</Badge>
|
||||
<Badge v-else variant="warn">missing credentials</Badge>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</template>
|
||||
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { LockKeyhole } from "@lucide/vue";
|
||||
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { configEditable } from "./state";
|
||||
|
||||
/**
|
||||
* Says so when this process cannot write configuration.
|
||||
*
|
||||
* A process that only renders a published snapshot has no update path, so
|
||||
* every editable row on the page is a value and the PATCH routes answer 503.
|
||||
* A page that simply showed no controls would leave the reader guessing
|
||||
* whether a setting is immutable, read-only here, or broken -- so it states
|
||||
* which (archie-core-ymut).
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Alert v-if="!configEditable" class="mb-4">
|
||||
<LockKeyhole />
|
||||
<AlertTitle>Read-only here</AlertTitle>
|
||||
<AlertDescription>
|
||||
This process serves a published configuration snapshot and holds no write path, so the values below cannot be
|
||||
changed from this dashboard. Edit the config file on the host that owns it, or reach the dashboard that does.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
</template>
|
||||
@@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { TableCell } from "@/components/ui/table";
|
||||
import { api } from "@/lib/api";
|
||||
import { errorText, loadConfig } from "./state";
|
||||
import type { RepoView } from "./types";
|
||||
|
||||
/**
|
||||
* One boolean override on a repository row.
|
||||
*
|
||||
* The box moves before the write and moves back if the write is refused: a
|
||||
* checkbox that waits on a round trip reads as a dropped click. It follows the
|
||||
* repository's own value afterwards, so a reload that changed it elsewhere is
|
||||
* not hidden behind a stale local copy.
|
||||
*/
|
||||
const props = defineProps<{ repo: RepoView; field: "allow_concurrent" | "review_enabled"; editable: boolean }>();
|
||||
|
||||
const checked = ref(Boolean(props.repo[props.field]));
|
||||
const loading = ref(false);
|
||||
const error = ref<string | null>(null);
|
||||
|
||||
watch(
|
||||
() => props.repo[props.field],
|
||||
(next) => {
|
||||
checked.value = Boolean(next);
|
||||
},
|
||||
);
|
||||
|
||||
async function change(next: boolean | "indeterminate"): Promise<void> {
|
||||
const value = next === true;
|
||||
checked.value = value;
|
||||
loading.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
await api.configRepoUpdate(props.repo.owner, props.repo.name, props.field, value);
|
||||
await loadConfig();
|
||||
} catch (err) {
|
||||
checked.value = !value;
|
||||
error.value = errorText(err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableCell>
|
||||
<template v-if="editable">
|
||||
<Checkbox :model-value="checked" :disabled="loading" :aria-label="field" @update:model-value="change" />
|
||||
<span v-if="error" class="ml-2 text-xs text-danger" role="alert">{{ error }}</span>
|
||||
</template>
|
||||
<template v-else>{{ checked ? "yes" : "no" }}</template>
|
||||
</TableCell>
|
||||
</template>
|
||||
@@ -0,0 +1,68 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { TableCell } from "@/components/ui/table";
|
||||
import { api } from "@/lib/api";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { errorText, loadConfig } from "./state";
|
||||
import type { RepoView } from "./types";
|
||||
|
||||
/**
|
||||
* One integer override on a repository row. The value commits on blur or on
|
||||
* Enter, not on every keystroke: half-typed numbers are not configuration.
|
||||
*/
|
||||
const props = defineProps<{ repo: RepoView; field: "max_retries"; editable: boolean }>();
|
||||
|
||||
const draft = ref(String(props.repo[props.field] ?? 0));
|
||||
const loading = ref(false);
|
||||
const error = ref<string | null>(null);
|
||||
|
||||
watch(
|
||||
() => props.repo[props.field],
|
||||
(next) => {
|
||||
draft.value = String(next ?? 0);
|
||||
},
|
||||
);
|
||||
|
||||
function update(value: unknown): void {
|
||||
draft.value = String(value ?? "");
|
||||
}
|
||||
|
||||
async function commit(): Promise<void> {
|
||||
const parsed = parseInt(draft.value, 10);
|
||||
if (Number.isNaN(parsed)) {
|
||||
error.value = "Enter a whole number";
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
await api.configRepoUpdate(props.repo.owner, props.repo.name, props.field, parsed);
|
||||
await loadConfig();
|
||||
} catch (err) {
|
||||
error.value = errorText(err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableCell :class="cn({ 'font-mono': !editable })">
|
||||
<template v-if="editable">
|
||||
<Input
|
||||
:model-value="draft"
|
||||
:disabled="loading"
|
||||
:aria-label="field"
|
||||
class="w-24"
|
||||
autocomplete="off"
|
||||
@update:model-value="update"
|
||||
@blur="commit"
|
||||
@keydown.enter.prevent="($event.target as HTMLElement).blur()"
|
||||
/>
|
||||
<span v-if="error" class="ml-2 text-xs text-danger" role="alert">{{ error }}</span>
|
||||
</template>
|
||||
<template v-else>{{ draft }}</template>
|
||||
</TableCell>
|
||||
</template>
|
||||
@@ -0,0 +1,72 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import RepoBoolCell from "./RepoBoolCell.vue";
|
||||
import RepoIntCell from "./RepoIntCell.vue";
|
||||
import { config, configEditable } from "./state";
|
||||
|
||||
/**
|
||||
* Each repository Archie polls, and the quality gate a change must pass before
|
||||
* it opens a pull request.
|
||||
*
|
||||
* Concurrent tasks, retries and self-review are per-repository overrides,
|
||||
* written through PATCH /api/config/repos/{owner}/{name} rather than into
|
||||
* config.toml directly, so a change here takes effect without editing a file
|
||||
* on the host. A process with no write path renders those three as values: its
|
||||
* PATCH route answers 503 (archie-core-ymut).
|
||||
*/
|
||||
const repos = computed(() => config.value?.repositories ?? []);
|
||||
|
||||
/** The gate is shell argv lists, so it reads as the commands an operator would
|
||||
* type, joined by the arrow the pipeline follows. */
|
||||
function gateSummary(gate?: string[][]): string {
|
||||
if (!gate?.length) return "—";
|
||||
return gate.map((cmd) => cmd.join(" ")).join(" → ");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard v-if="!repos.length" title="Repositories" description="The repositories Archie polls for work.">
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No repositories configured</EmptyTitle>
|
||||
<EmptyDescription>Add a [[repos]] entry in config.toml so Archie has somewhere to work.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</ConfigCard>
|
||||
<ConfigCard
|
||||
v-else
|
||||
title="Repositories"
|
||||
description="Each repository Archie polls, and the quality gate a change must pass before it opens a pull request. Concurrent tasks, retries, and self-review are per-repository overrides -- PATCH /api/config/repos/{owner}/{name}, not the file config.toml directly."
|
||||
>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Repository</TableHead>
|
||||
<TableHead>Base branch</TableHead>
|
||||
<TableHead>Ecosystem</TableHead>
|
||||
<TableHead>Quality gate</TableHead>
|
||||
<TableHead>Protected paths</TableHead>
|
||||
<TableHead>Concurrent</TableHead>
|
||||
<TableHead>Max retries</TableHead>
|
||||
<TableHead>Self-review</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-for="(repo, index) in repos" :key="index">
|
||||
<TableCell class="font-medium">{{ repo.owner }}/{{ repo.name }}</TableCell>
|
||||
<TableCell class="font-mono">{{ repo.base }}</TableCell>
|
||||
<TableCell>{{ repo.ecosystem || "go" }}</TableCell>
|
||||
<TableCell class="font-mono">{{ gateSummary(repo.gate) }}</TableCell>
|
||||
<TableCell class="font-mono">{{ repo.protect?.length ? repo.protect.join(", ") : "—" }}</TableCell>
|
||||
<RepoBoolCell :repo="repo" field="allow_concurrent" :editable="configEditable" />
|
||||
<RepoIntCell :repo="repo" field="max_retries" :editable="configEditable" />
|
||||
<RepoBoolCell :repo="repo" field="review_enabled" :editable="configEditable" />
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,45 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import DangerousActionsCard from "./DangerousActionsCard.vue";
|
||||
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
|
||||
import { ADVANCED_SECTIONS } from "./sections";
|
||||
import { configUnavailable, loadConfig, loadDangerous } from "./state";
|
||||
|
||||
/**
|
||||
* The settings that change where archied keeps its state and how it isolates
|
||||
* task execution, who it is on the forge, and the actions that need explicit
|
||||
* approval before they run.
|
||||
*
|
||||
* These are the fields with the longest reach: identity is what commits are
|
||||
* attributed to, and the container fields decide what the agent runs in.
|
||||
*/
|
||||
async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadDangerous()]);
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Advanced" subtitle="Identity, storage and sandboxing, and dangerous actions.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
|
||||
<ReadOnlyNotice />
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<ConfigSections v-else :ids="ADVANCED_SECTIONS" />
|
||||
<!-- Dangerous actions come from the daemon's own endpoint, not the config
|
||||
projection, so a config that failed to load does not hide them. -->
|
||||
<DangerousActionsCard />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import ThemeCard from "./ThemeCard.vue";
|
||||
|
||||
/**
|
||||
* Appearance: how the dashboard looks, on this browser.
|
||||
*
|
||||
* The theme control moved here out of the topbar icon, and nothing else has
|
||||
* followed it yet (docs/prds/dashboard-navigation-groups.md).
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Appearance" subtitle="How the dashboard looks." />
|
||||
<ThemeCard />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import ModelsCard from "./ModelsCard.vue";
|
||||
import { configUnavailable, loadConfig } from "./state";
|
||||
|
||||
/**
|
||||
* Which model handles each stage of work, and which providers are wired up.
|
||||
* Nothing on this page is editable from the dashboard: a model role is a
|
||||
* structured field, and the server keeps those behind its own config path.
|
||||
*/
|
||||
onMounted(loadConfig);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Models" subtitle="Model roles, and the providers backing them.">
|
||||
<Button variant="outline" @click="loadConfig">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<ModelsCard v-else />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
|
||||
import RepositoriesCard from "./RepositoriesCard.vue";
|
||||
import { configUnavailable, loadConfig } from "./state";
|
||||
|
||||
/**
|
||||
* The repositories Archie watches, and the gate overrides each one carries.
|
||||
*/
|
||||
onMounted(loadConfig);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Repositories" subtitle="The repositories Archie polls, and their per-repo gate overrides.">
|
||||
<Button variant="outline" @click="loadConfig">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
|
||||
<ReadOnlyNotice />
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<RepositoriesCard v-else />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,55 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import ConfigNotices from "./ConfigNotices.vue";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import ProvenanceCard from "./ProvenanceCard.vue";
|
||||
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
|
||||
import { STATUS_SECTIONS } from "./sections";
|
||||
import { configUnavailable, loadConfig, loadUpdate, loadVersion } from "./state";
|
||||
import UpdateActionsCard from "./UpdateActionsCard.vue";
|
||||
import UpdateStatusCard from "./UpdateStatusCard.vue";
|
||||
|
||||
/**
|
||||
* What archied is running with right now: whether each component matches what
|
||||
* is installed, what is available to update, the files that supplied the
|
||||
* running configuration, and the dashboard's own listen address.
|
||||
*
|
||||
* The address arrives through the generic schema rows rather than a card of
|
||||
* its own: it is one field, and a section that grows another should not need a
|
||||
* new component here.
|
||||
*/
|
||||
async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadVersion(), loadUpdate()]);
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Status" subtitle="What archied is running with right now.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
|
||||
<!-- Only the configuration projection is gated on the config read: update
|
||||
checking and the reload notices come from other endpoints, so a config
|
||||
that failed to load says so without hiding them. -->
|
||||
<ReadOnlyNotice />
|
||||
<UpdateStatusCard />
|
||||
<UpdateActionsCard />
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<template v-else>
|
||||
<ConfigNotices />
|
||||
<ConfigSections :ids="STATUS_SECTIONS" />
|
||||
<ProvenanceCard />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import LifecycleCard from "./LifecycleCard.vue";
|
||||
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
|
||||
import { TASKS_SECTIONS } from "./sections";
|
||||
import { configUnavailable, loadConfig, loadLifecycle } from "./state";
|
||||
|
||||
/**
|
||||
* The work lifecycle: the statuses and operator actions archied ships, and the
|
||||
* budgets every autonomous stage runs under.
|
||||
*/
|
||||
async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadLifecycle()]);
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Task settings" subtitle="How work moves through archied, and what it is allowed to spend.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
|
||||
<ReadOnlyNotice />
|
||||
<LifecycleCard />
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<ConfigSections v-else :ids="TASKS_SECTIONS" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import { Field, FieldGroup, FieldTitle } from "@/components/ui/field";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { setTheme, theme, type Theme } from "@/lib/theme";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
|
||||
/**
|
||||
* The theme control, moved off the topbar icon and onto a page of its own so
|
||||
* the chrome carries no preference.
|
||||
*
|
||||
* It writes through lib/theme, which sets the attribute index.html reads before
|
||||
* the first paint and stores the choice in this browser: there is no
|
||||
* server-side appearance to save, and nothing here to submit. The density and
|
||||
* motion preferences this page exists for are not built yet
|
||||
* (docs/prds/dashboard-navigation-groups.md).
|
||||
*/
|
||||
function apply(value: unknown): void {
|
||||
if (value === "light" || value === "dark") setTheme(value as Theme);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard title="Appearance" description="How this browser renders the dashboard.">
|
||||
<FieldGroup>
|
||||
<Field orientation="horizontal">
|
||||
<FieldTitle id="theme-label">Theme</FieldTitle>
|
||||
<ToggleGroup :model-value="theme" aria-labelledby="theme-label" @update:model-value="apply">
|
||||
<ToggleGroupItem value="dark">Dark</ToggleGroupItem>
|
||||
<ToggleGroupItem value="light">Light</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import { deferUpdate, installUpdate, update } from "./state";
|
||||
|
||||
/**
|
||||
* The actionable half of update checking: what is available, and the two
|
||||
* decisions you can make about it. The read-only comparison of components and
|
||||
* versions is UpdateStatusCard.
|
||||
*
|
||||
* A deployment that did not wire update checking answers 501, which leaves
|
||||
* `update` null and this card absent rather than in an error state
|
||||
* (archie-core-tf20).
|
||||
*/
|
||||
const available = computed(() => update.value?.available ?? []);
|
||||
|
||||
const summary = computed(() => {
|
||||
const data = update.value;
|
||||
if (data?.error) return data.error;
|
||||
if (data?.snapshot?.deferred) return "Update deferred.";
|
||||
return "Archie is up to date.";
|
||||
});
|
||||
|
||||
function defer(): void {
|
||||
void deferUpdate(update.value?.snapshot);
|
||||
}
|
||||
|
||||
function install(): void {
|
||||
void installUpdate(update.value?.snapshot);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard v-if="update" title="Updates" description="Whether a newer release is available, and what to do about it.">
|
||||
<p class="text-sm text-fg-muted">
|
||||
<template v-if="available.length">
|
||||
{{ available.map((c) => `${c.Label || c.label}: ${c.Available || c.available}`).join(" · ") }}
|
||||
</template>
|
||||
<template v-else>{{ summary }}</template>
|
||||
</p>
|
||||
<div v-if="available.length" class="mt-3 flex flex-wrap gap-2">
|
||||
<Button variant="outline" @click="defer">Defer</Button>
|
||||
<!-- Installing restarts archied, so it is offered only when the server
|
||||
says it can perform one. -->
|
||||
<Button v-if="update.can_install" @click="install">Install update</Button>
|
||||
</div>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,96 @@
|
||||
<script setup lang="ts">
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import { versionComponents, versionError, versionMissing } from "./state";
|
||||
|
||||
/**
|
||||
* How each component is deployed, and whether what is running matches what is
|
||||
* installed. The comparison is read-only; what to do about an available update
|
||||
* is UpdateActionsCard's job.
|
||||
*/
|
||||
|
||||
const STATUS_LABELS: Record<string, string> = {
|
||||
ok: "OK",
|
||||
update_available: "Update available",
|
||||
drift: "Drift",
|
||||
unknown: "Unknown",
|
||||
};
|
||||
const STATUS_KINDS: Record<string, StatusKind> = {
|
||||
ok: "ok",
|
||||
update_available: "info",
|
||||
drift: "danger",
|
||||
unknown: "idle",
|
||||
};
|
||||
|
||||
/** The exact versions compared, shown on the row that compares them. */
|
||||
function basis(component: (typeof versionComponents.value)[number]): string {
|
||||
return [
|
||||
`Installed claim: ${component.installed_claim || "unknown"}`,
|
||||
`Running: ${component.running_version || "not observed"}`,
|
||||
component.reference ? `Reference: ${component.reference}` : null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- A 501 is a deployment that did not wire update checking, which is a
|
||||
legitimate state and a different thing from a broken one. Saying so once
|
||||
here covers the absent UpdateActionsCard too. -->
|
||||
<ConfigCard
|
||||
v-if="versionMissing"
|
||||
title="Update status"
|
||||
description="Not configured on this deployment, so there is nothing to check against."
|
||||
/>
|
||||
<Card v-else-if="versionError" class="mb-4">
|
||||
<CardContent>
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Update status unavailable</EmptyTitle>
|
||||
<EmptyDescription>{{ versionError }}</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<ConfigCard
|
||||
v-else
|
||||
title="Update status"
|
||||
description="How each component is deployed, and whether what's running matches what's installed. Hover a row for the exact versions compared."
|
||||
>
|
||||
<Empty v-if="!versionComponents.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No components reported</EmptyTitle>
|
||||
<EmptyDescription>The configured update-check command returned nothing.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<Table v-else>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Component</TableHead>
|
||||
<TableHead>Install type</TableHead>
|
||||
<TableHead>Running</TableHead>
|
||||
<TableHead>Latest available</TableHead>
|
||||
<TableHead>Status</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-for="component in versionComponents" :key="component.id || component.label" :title="basis(component)">
|
||||
<TableCell class="font-medium">{{ component.label || component.id }}</TableCell>
|
||||
<TableCell class="font-mono">{{ component.install_type || "—" }}</TableCell>
|
||||
<TableCell class="font-mono">{{ component.running_version || "—" }}</TableCell>
|
||||
<TableCell class="font-mono">{{ component.latest_available || "—" }}</TableCell>
|
||||
<TableCell>
|
||||
<Badge :variant="STATUS_KINDS[component.status || ''] || 'idle'">
|
||||
{{ STATUS_LABELS[component.status || ""] || component.status }}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,25 @@
|
||||
import type { ConfigFieldType } from "./types";
|
||||
|
||||
/** The empty marker. A value the server did not send is shown as an em dash,
|
||||
* which is a fact about the running config, not a missing render. */
|
||||
export function valueText(value: unknown): string {
|
||||
if (value === null || value === undefined || value === "") return "—";
|
||||
return String(value);
|
||||
}
|
||||
|
||||
/** parseEdit turns the editor's text back into the value the wire expects, or
|
||||
* says why it cannot. Types without a numeric or boolean form are sent as the
|
||||
* text as typed, which is what the daemon's own parser then validates. */
|
||||
export function parseEdit(type: ConfigFieldType, text: string): { value?: unknown; error?: string } {
|
||||
switch (type) {
|
||||
case "int": {
|
||||
const n = parseInt(text, 10);
|
||||
if (Number.isNaN(n)) return { error: "Enter a whole number" };
|
||||
return { value: n };
|
||||
}
|
||||
case "bool":
|
||||
return { value: text === "true" };
|
||||
default:
|
||||
return { value: text };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { ConfigField, ConfigSection } from "./types";
|
||||
|
||||
/**
|
||||
* Which schema section belongs to which Route.
|
||||
*
|
||||
* The daemon serves one catalog (internal/webui/config_schema.go); the split
|
||||
* of that catalog across six routes is the UI's, so the mapping lives here
|
||||
* rather than in a per-page filter. Sections whose only fields are structured
|
||||
* (repositories, models) are absent deliberately: their dedicated editors own
|
||||
* those, not the generic row renderer.
|
||||
*/
|
||||
|
||||
export const STATUS_SECTIONS = ["web"];
|
||||
export const TASKS_SECTIONS = ["budgets"];
|
||||
export const ADVANCED_SECTIONS = ["identity", "storage"];
|
||||
|
||||
/** sectionRows drops the structured fields: the generic renderer does not own
|
||||
* them, so a section left with none renders nothing at all. */
|
||||
export function sectionRows(section: ConfigSection): ConfigField[] {
|
||||
return section.fields.filter((f) => f.type !== "structured");
|
||||
}
|
||||
|
||||
/** sectionsFor returns the sections this page renders, in catalog order. */
|
||||
export function sectionsFor(schema: ConfigSection[] | undefined, ids: string[]): ConfigSection[] {
|
||||
return (schema ?? []).filter((s) => ids.includes(s.id) && sectionRows(s).length > 0);
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import { computed, ref } from "vue";
|
||||
|
||||
import { ApiError, api } from "@/lib/api";
|
||||
import type {
|
||||
ConfigView,
|
||||
DangerousActions,
|
||||
Lifecycle,
|
||||
UpdateStatus,
|
||||
VersionComponent,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* The System pages' shared state.
|
||||
*
|
||||
* Six routes read the same configuration projection, and several of them read
|
||||
* more than one endpoint, so the data lives in a module rather than being
|
||||
* threaded down through a chain of props. Each page calls the loaders it needs
|
||||
* and owns when; the cards read the refs.
|
||||
*/
|
||||
|
||||
/** How archied's own handlers report a failure: a plain-text reason in the
|
||||
* body, surfaced by lib/api as the Error's message. */
|
||||
export function errorText(err: unknown): string {
|
||||
return String((err as Error).message || err);
|
||||
}
|
||||
|
||||
function isMissing(err: unknown): boolean {
|
||||
// 501 is a deployment that did not wire the capability, which is a
|
||||
// legitimate state and a different thing from a broken one.
|
||||
return err instanceof ApiError && err.status === 501;
|
||||
}
|
||||
|
||||
// ── The configuration projection ────────────────────────────────────────────
|
||||
|
||||
export const config = ref<ConfigView | null>(null);
|
||||
export const configError = ref<string | null>(null);
|
||||
|
||||
/** Whether this process can apply configuration changes. False means every row
|
||||
* renders as a value: the write routes answer 503, so a control would only
|
||||
* invite a failure. An unknown config (still loading, or unreadable) is not
|
||||
* read-only, so only an explicit false is treated as one. */
|
||||
export const configEditable = computed(() => config.value?.editable !== false);
|
||||
|
||||
/** Nothing to render: either the read failed, or archied is running without a
|
||||
* config file wired into the dashboard. */
|
||||
export const configUnavailable = computed(
|
||||
() => Boolean(configError.value) || Object.keys(config.value ?? {}).length === 0,
|
||||
);
|
||||
|
||||
export async function loadConfig(): Promise<void> {
|
||||
try {
|
||||
config.value = await api.config<ConfigView>();
|
||||
configError.value = null;
|
||||
} catch (err) {
|
||||
configError.value = errorText(err);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Updates ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export const versionComponents = ref<VersionComponent[]>([]);
|
||||
export const versionError = ref<string | null>(null);
|
||||
/** Update checking is not wired on this deployment. */
|
||||
export const versionMissing = ref(false);
|
||||
|
||||
export async function loadVersion(): Promise<void> {
|
||||
try {
|
||||
const data = await api.version<{ components?: VersionComponent[] }>();
|
||||
versionComponents.value = data?.components || [];
|
||||
versionError.value = null;
|
||||
versionMissing.value = false;
|
||||
} catch (err) {
|
||||
versionMissing.value = isMissing(err);
|
||||
if (!versionMissing.value) versionError.value = errorText(err);
|
||||
}
|
||||
}
|
||||
|
||||
export const update = ref<UpdateStatus | null>(null);
|
||||
|
||||
export async function loadUpdate(): Promise<void> {
|
||||
try {
|
||||
update.value = await api.chatUpdate<UpdateStatus>();
|
||||
} catch (err) {
|
||||
// Absent rather than failed on a deployment that did not wire it: nothing
|
||||
// to show, not an error banner (archie-core-tf20).
|
||||
update.value = isMissing(err) ? null : { error: errorText(err) };
|
||||
}
|
||||
}
|
||||
|
||||
export async function deferUpdate(snapshot: unknown): Promise<void> {
|
||||
await api.chatUpdateDefer(snapshot);
|
||||
await loadUpdate();
|
||||
}
|
||||
|
||||
export async function installUpdate(snapshot: unknown): Promise<void> {
|
||||
await api.chatUpdateInstall(snapshot);
|
||||
await loadUpdate();
|
||||
}
|
||||
|
||||
// ── Dangerous actions ───────────────────────────────────────────────────────
|
||||
|
||||
export const dangerous = ref<DangerousActions | null>(null);
|
||||
|
||||
export async function loadDangerous(): Promise<void> {
|
||||
try {
|
||||
dangerous.value = await api.chatDangerous<DangerousActions>();
|
||||
} catch (err) {
|
||||
dangerous.value = isMissing(err) ? null : { error: errorText(err) };
|
||||
}
|
||||
}
|
||||
|
||||
export async function requestDangerous(kind: string, spec: unknown): Promise<void> {
|
||||
await api.chatDangerousRequest(kind, spec);
|
||||
await loadDangerous();
|
||||
}
|
||||
|
||||
export async function decideDangerous(id: string, decision: string): Promise<void> {
|
||||
await api.chatDangerousDecision(id, decision);
|
||||
await loadDangerous();
|
||||
}
|
||||
|
||||
// ── Work lifecycle ──────────────────────────────────────────────────────────
|
||||
|
||||
export const lifecycle = ref<Lifecycle | null>(null);
|
||||
export const lifecycleError = ref<string | null>(null);
|
||||
|
||||
export async function loadLifecycle(): Promise<void> {
|
||||
try {
|
||||
lifecycle.value = await api.taskMeta<Lifecycle>();
|
||||
lifecycleError.value = null;
|
||||
} catch (err) {
|
||||
lifecycleError.value = errorText(err);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
/**
|
||||
* What GET /api/config and the operator endpoints answer, as far as the six
|
||||
* System pages read them.
|
||||
*
|
||||
* Written by hand rather than generated: internal/webui/api_config.go's
|
||||
* ConfigView is an explicit allowlist whose whole purpose is to keep secrets
|
||||
* (forge tokens, provider API keys) out of this payload, so the type describes
|
||||
* what is served, not what config.Config holds.
|
||||
*/
|
||||
|
||||
/** How the generic renderer decides what control a field gets. A structured
|
||||
* field (repositories, models, providers) is owned by its own editor and
|
||||
* never appears in a generic row. */
|
||||
export type ConfigFieldType = "string" | "int" | "bool" | "duration" | "enum" | "structured";
|
||||
|
||||
export interface ConfigField {
|
||||
/** The dotted path PATCH /api/config accepts this value under. */
|
||||
key: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
type: ConfigFieldType;
|
||||
value?: unknown;
|
||||
/** The dashboard may change it. Distinct from locked_reason, which is a
|
||||
* runtime property of the running config rather than of the field. */
|
||||
editable: boolean;
|
||||
locked_reason?: string;
|
||||
overridden?: boolean;
|
||||
options?: string[];
|
||||
/** Changing it will not take effect until archied restarts. */
|
||||
restart_required?: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigSection {
|
||||
id: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
fields: ConfigField[];
|
||||
}
|
||||
|
||||
/** One file in the chain that produced the running configuration. */
|
||||
export interface ConfigOrigin {
|
||||
layer: string;
|
||||
role: string;
|
||||
feature?: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface ReloadStatus {
|
||||
overlay_unavailable?: string;
|
||||
last_error?: string;
|
||||
}
|
||||
|
||||
export interface RepoView {
|
||||
owner: string;
|
||||
name: string;
|
||||
base: string;
|
||||
gate: string[][];
|
||||
protect?: string[];
|
||||
ecosystem?: string;
|
||||
allow_concurrent: boolean;
|
||||
max_retries: number;
|
||||
review_enabled: boolean;
|
||||
}
|
||||
|
||||
/** A provider's shape, never its key: api_key_env is the NAME of an
|
||||
* environment variable, and configured says whether either credential form is
|
||||
* set without revealing which. */
|
||||
export interface ProviderView {
|
||||
class: string;
|
||||
base_url?: string;
|
||||
api_key_env?: string;
|
||||
configured: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigView {
|
||||
repositories?: RepoView[];
|
||||
models?: Record<string, string>;
|
||||
providers?: Record<string, ProviderView>;
|
||||
provenance?: ConfigOrigin[];
|
||||
reload?: ReloadStatus;
|
||||
/** Whether this process can apply configuration changes at all. False makes
|
||||
* the pages render values rather than controls, which is the honest offer
|
||||
* from a process serving a published snapshot: its write routes answer 503
|
||||
* (archie-core-ymut). */
|
||||
editable: boolean;
|
||||
schema?: ConfigSection[];
|
||||
}
|
||||
|
||||
/** One component as GET /api/version reports it. */
|
||||
export interface VersionComponent {
|
||||
id?: string;
|
||||
label?: string;
|
||||
install_type?: string;
|
||||
running_version?: string;
|
||||
latest_available?: string;
|
||||
status?: string;
|
||||
installed_claim?: string;
|
||||
reference?: string;
|
||||
}
|
||||
|
||||
/** What one available update carries. The server serves both spellings of
|
||||
* each key, so both are read -- see UpdateActionsCard. */
|
||||
export interface AvailableUpdate {
|
||||
Label?: string;
|
||||
label?: string;
|
||||
Available?: string;
|
||||
available?: string;
|
||||
}
|
||||
|
||||
export interface UpdateStatus {
|
||||
available?: AvailableUpdate[];
|
||||
can_install?: boolean;
|
||||
/** The version snapshot a defer or install decision is made against. The
|
||||
* server owns its shape; deferred is the one field the UI reads. */
|
||||
snapshot?: { deferred?: boolean };
|
||||
/** Set when the read failed rather than being unwired. */
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/** A rollback point a dangerous action can target. Number and Label arrive in
|
||||
* either case depending on the source, so both are carried. */
|
||||
export interface DangerCheckpoint {
|
||||
Number?: number;
|
||||
number?: number;
|
||||
Label?: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
export interface DangerousAction {
|
||||
id: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface DangerousActions {
|
||||
pending?: DangerousAction[];
|
||||
checkpoints?: DangerCheckpoint[];
|
||||
/** Set when the read failed rather than being unwired. */
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/** One lifecycle status or operator action, as GET /api/task-meta reports it.
|
||||
* A deployment that adds one on the backend shows it here without a frontend
|
||||
* change. */
|
||||
export interface LifecycleEntry {
|
||||
id: string;
|
||||
label?: string;
|
||||
kind?: string;
|
||||
}
|
||||
|
||||
export interface Lifecycle {
|
||||
statuses?: LifecycleEntry[];
|
||||
actions?: LifecycleEntry[];
|
||||
}
|
||||
Reference in new issue
Block a user