fix(webui): bind the container runtime document's keys, drop the blank Advanced page

ContainerRuntimePage still bound the Go field names the document carried
before archie-core-qna6 gave container-runtime-policies its own snake_case
shape. Every control read a key the document does not hold, so the fields
rendered empty and DurationInput warned on each mount; the page's Profiles
section wrote to a key the decoder drops. Bind image, max_concurrency,
max_uptime, volume_ttl, pull_policy and network, drop the dead Profiles
section (named profiles live in the agent-profiles resource, filed as
archie-core-x0wk), and pin the key list in a test the migration lacked.

Settings -> Advanced rendered nothing in any deployment: its only card needs
the sandbox dangerous-command authority, which has no implementation
(archie-core-sod1). Drop it from the sidebar, the router and the gateway's
dashboard page index; the page and its components stay in the tree for sod1.

Register CardAction in SetupPanel and EmptyDescription in TaskLogs, which Vue
was resolving to nothing, so the setup percentage and the log empty-state
descriptions render again.
This commit is contained in:
sam committed 2026-10-04 20:51:57 +11:00
1 parent a2a6ab3dfb
commit e45d69ef58
9 files changed
+148 -158

No files matched your search

+7 -1
View File
@@ -2,7 +2,13 @@
import { Check } from "@lucide/vue";
import { computed, ref, watch } from "vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import {
Card,
CardAction,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Progress } from "@/components/ui/progress";
import { setupPanelState, type SetupPanelState } from "./setup-preference";
import { setup } from "./state";
-1
View File
@@ -56,7 +56,6 @@ const settings: NavSpec = {
"/settings/container-runtime",
"/settings/harness",
"/settings/status",
"/settings/advanced",
],
},
{ paths: ["/settings/history"] },
-14
View File
@@ -14,7 +14,6 @@ import SchedulesPage from "@/settings/SchedulesPage.vue";
import ExtensionsPage from "@/settings/ExtensionsPage.vue";
import PluginsPage from "@/settings/PluginsPage.vue";
import ContainerRuntimePage from "@/settings/ContainerRuntimePage.vue";
import SystemAdvancedPage from "@/settings/SystemAdvancedPage.vue";
import SystemIdentitiesPage from "@/settings/SystemIdentitiesPage.vue";
import AccessPoliciesPage from "@/settings/AccessPoliciesPage.vue";
import SystemAppearancePage from "@/settings/SystemAppearancePage.vue";
@@ -322,18 +321,6 @@ const routes = [
section: "settings",
},
},
{
path: "/settings/advanced",
name: "system-advanced",
component: SystemAdvancedPage,
meta: {
navPath: "/settings",
settings: true,
label: "Advanced",
description: "Actions that stop or roll back archied.",
section: "settings",
},
},
{
path: "/settings/history",
name: "settings-history",
@@ -363,7 +350,6 @@ const routes = [
"/system/models": "/settings/models",
"/system/repos": "/settings/repositories",
"/system/identities": "/settings/identities",
"/system/advanced": "/settings/advanced",
"/channels": "/settings/channels",
"/skills": "/settings/skills",
"/curators": "/settings/curators",
+23 -82
View File
@@ -1,10 +1,8 @@
<script setup lang="ts">
import { computed, onMounted, ref } from "vue";
import { computed, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { Plus, Trash2 } from "@lucide/vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { DurationInput } from "@/components/ui/duration-input";
import { Input } from "@/components/ui/input";
import {
@@ -16,29 +14,22 @@ import {
} from "@/components/ui/number-field";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { SettingRow } from "@/components/ui/setting-row";
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from "@/components/ui/tags-input";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
const KIND = "container-runtime-policies";
// The document is config.ContainerConfig on the wire, so its keys are Go
// field names until archie-core-qna6 gives it a snake_case contract.
// The stored document is containerRuntimePolicies on the wire, with snake_case
// keys and durations as Go duration strings (archie-core-qna6). Named agent
// profiles are no longer part of it: they moved to the agent-profiles resource.
interface ContainerRuntime {
Image: string;
MaxConcurrency: number;
MaxUptime: string;
VolumeTTL: string;
PullPolicy: string;
Network: string;
Profiles: Record<string, { Image: string; Tools: string[] | null }> | null;
image: string;
max_concurrency: number;
max_uptime: string;
volume_ttl: string;
pull_policy: string;
network: string;
}
const store = useControlPlaneStore();
@@ -54,21 +45,11 @@ const pullPolicies = [
{ value: "always", label: "Always" },
];
const pullPolicy = computed({
get: () => runtime.value?.PullPolicy || "missing",
get: () => runtime.value?.pull_policy || "missing",
set: (value: string) => {
if (runtime.value) runtime.value.PullPolicy = value;
if (runtime.value) runtime.value.pull_policy = value;
},
});
const newProfile = ref("");
function addProfile() {
const name = newProfile.value.trim();
if (!runtime.value || !name) return;
runtime.value.Profiles ??= {};
if (runtime.value.Profiles[name]) return;
runtime.value.Profiles[name] = { Image: "", Tools: [] };
newProfile.value = "";
}
</script>
<template>
@@ -82,86 +63,46 @@ function addProfile() {
<template v-if="runtime">
<SettingRow label="Image" for="cr-image">
<div class="flex flex-wrap items-center gap-3">
<Input id="cr-image" v-model="runtime.Image" class="font-mono" />
<DraftHint :kind="KIND" path="Image" />
<Input id="cr-image" v-model="runtime.image" class="font-mono" />
<DraftHint :kind="KIND" path="image" />
</div>
</SettingRow>
<SettingRow label="Pull policy">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl v-model="pullPolicy" label="Pull policy" :options="pullPolicies" />
<DraftHint :kind="KIND" path="PullPolicy" />
<DraftHint :kind="KIND" path="pull_policy" />
</div>
</SettingRow>
<SettingRow label="Max concurrency" hint="0 = no limit.">
<div class="flex flex-wrap items-center gap-3">
<NumberField v-model="runtime.MaxConcurrency" :min="0" class="w-32">
<NumberField v-model="runtime.max_concurrency" :min="0" class="w-32">
<NumberFieldContent>
<NumberFieldDecrement />
<NumberFieldInput class="font-mono" aria-label="Max concurrency" />
<NumberFieldIncrement />
</NumberFieldContent>
</NumberField>
<DraftHint :kind="KIND" path="MaxConcurrency" />
<DraftHint :kind="KIND" path="max_concurrency" />
</div>
</SettingRow>
<SettingRow label="Max uptime" for="cr-uptime">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-uptime" v-model="runtime.MaxUptime" :units="['m', 'h']" />
<DraftHint :kind="KIND" path="MaxUptime" />
<DurationInput id="cr-uptime" v-model="runtime.max_uptime" :units="['m', 'h']" />
<DraftHint :kind="KIND" path="max_uptime" />
</div>
</SettingRow>
<SettingRow label="Volume retention" for="cr-ttl">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-ttl" v-model="runtime.VolumeTTL" :units="['h']" />
<DraftHint :kind="KIND" path="VolumeTTL" />
<DurationInput id="cr-ttl" v-model="runtime.volume_ttl" :units="['h']" />
<DraftHint :kind="KIND" path="volume_ttl" />
</div>
</SettingRow>
<SettingRow label="Network" for="cr-network" hint="Empty: auto-detect.">
<div class="flex flex-wrap items-center gap-3">
<Input id="cr-network" v-model="runtime.Network" class="max-w-sm font-mono" />
<DraftHint :kind="KIND" path="Network" />
<Input id="cr-network" v-model="runtime.network" class="max-w-sm font-mono" />
<DraftHint :kind="KIND" path="network" />
</div>
</SettingRow>
<h2 class="mt-10 mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase">Profiles</h2>
<section
v-for="(profile, name) in runtime.Profiles ?? {}"
:key="name"
class="mb-3 rounded-lg border border-border bg-card px-5 pt-3 pb-2"
:aria-label="`Profile ${name}`"
>
<header class="flex items-center">
<h3 class="flex-1 font-mono text-sm font-medium">{{ name }}</h3>
<Button variant="ghost" size="icon" :aria-label="`Remove profile ${name}`" @click="delete runtime.Profiles![name]"><Trash2 /></Button>
</header>
<SettingRow label="Image" :for="`prof-${name}-image`" hint="Empty: default image.">
<div class="flex flex-wrap items-center gap-3">
<Input :id="`prof-${name}-image`" v-model="profile.Image" class="font-mono" />
<DraftHint :kind="KIND" :path="`Profiles.${name}.Image`" />
</div>
</SettingRow>
<SettingRow label="Tools" hint="Empty allows all.">
<div class="flex flex-wrap items-center gap-3">
<TagsInput
:model-value="profile.Tools ?? []"
class="font-mono"
:aria-label="`Tools for ${name}`"
@update:model-value="(v) => (profile.Tools = v as string[])"
>
<TagsInputItem v-for="tool in profile.Tools ?? []" :key="tool" :value="tool">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="tool name" />
</TagsInput>
<DraftHint :kind="KIND" :path="`Profiles.${name}.Tools`" />
</div>
</SettingRow>
</section>
<div class="flex gap-2">
<Input v-model="newProfile" class="max-w-56 font-mono" placeholder="profile name" aria-label="New profile" @keydown.enter="addProfile" />
<Button variant="outline" size="sm" :disabled="!newProfile.trim()" @click="addProfile"><Plus data-icon="inline-start" /> Add profile</Button>
</div>
</template>
</div>
</template>
+6 -1
View File
@@ -3,7 +3,12 @@ import { computed } from "vue";
import LogRow from "@/base/LogRow.vue";
import { Button } from "@/components/ui/button";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import {
Empty,
EmptyDescription,
EmptyHeader,
EmptyTitle,
} from "@/components/ui/empty";
import { api } from "@/lib/api";
import { attemptFooter } from "@/lib/log";