Files
archie/ui/src/dashboard/SetupPanel.vue
T
sam be3e78abc2 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.
2026-10-04 20:51:57 +11:00

72 lines
2.2 KiB
Vue

<script setup lang="ts">
import { Check } from "@lucide/vue";
import { computed, ref, watch } from "vue";
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";
/**
* The setup checklist, rendered only while there is setup work left.
*
* A fully configured daemon renders nothing: the old completion card ("Setup
* complete", with a check and a dismiss button) celebrated the absence of a
* problem and occupied a grid cell until dismissed. Setup regressing to
* incomplete brings the checklist back on its own.
*/
const panel = ref<SetupPanelState>(setupPanelState(setup.value));
watch(setup, () => {
panel.value = setupPanelState(setup.value);
});
const steps = computed(() => setup.value?.steps ?? []);
const pct = computed(() => {
const total = steps.value.length;
if (!total) return 0;
return Math.round(((total - panel.value.remaining.length) / total) * 100);
});
</script>
<template>
<Card v-if="panel.kind === 'incomplete'">
<CardHeader>
<CardTitle>Finish setting up</CardTitle>
<CardAction>
<span class="text-lg font-semibold text-link">{{ pct }}%</span>
</CardAction>
</CardHeader>
<CardContent>
<Progress :model-value="pct" class="mb-4" />
<ul class="flex flex-col gap-3">
<li v-for="(step, i) in steps" :key="i" class="flex items-start gap-3">
<span
class="mt-px grid size-[18px] flex-none place-items-center rounded-full border-[1.5px] border-border-strong text-xs text-fg-subtle"
:class="step.done ? 'border-transparent bg-ok-soft text-ok' : ''"
>
<Check v-if="step.done" class="size-3" />
</span>
<div>
<div
class="text-sm"
:class="step.done ? 'text-fg-muted line-through' : ''"
>
{{ step.title }}
</div>
<div v-if="step.detail" class="mt-0.5 text-xs text-fg-subtle">
{{ step.detail }}
</div>
</div>
</li>
</ul>
</CardContent>
</Card>
</template>