feat(controlplane): runtime administration over the State Store's gRPC server
The Web UI and messaging channels now read and write Archie's runtime settings through one versioned, audited control-plane API hosted on the State Store's existing gRPC server: catalog, query, command, watch. Each feature owns its resource, validation and commands; storage only writes versions and audit records. Workflows move with it. Definitions become portable YAML compiled through a closed, typed step registry and stored as a control-plane resource, so the yaegi interpretation paths (internal/gate, wfeval, wfextract, gateeval, gateextract, skillbuild) are deleted rather than carried. The UI process reads definitions as data: the JSON projection lives in internal/domain/workflow/task so a dashboard decodes the stored collection without linking the workflow engine, which cmd/archie-ui's deletion gate forbids. Shipped definitions ride the catalog descriptor rather than a bespoke REST route, keeping the API to its four operations. archie-messaging gains -state-store-target/-state-store-token and reads channel settings from the database, failing closed when the State Store is unreachable: the database is authoritative for those settings.
This commit is contained in:
131 files changed
+8510
-3371
No files matched your search
@@ -0,0 +1,117 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, watch } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Field, FieldDescription, FieldGroup, FieldLabel } from "@/components/ui/field";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { useControlPlaneStore, type ResourceDescriptor } from "@/stores/control-plane";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
|
||||
interface JSONSchemaProperty {
|
||||
type?: "integer" | "number" | "string" | "boolean";
|
||||
title?: string;
|
||||
description?: string;
|
||||
minimum?: number;
|
||||
maximum?: number;
|
||||
enum?: Array<string | number>;
|
||||
}
|
||||
|
||||
const props = defineProps<{ descriptor: ResourceDescriptor }>();
|
||||
const store = useControlPlaneStore();
|
||||
const state = computed(() => store.stateFor(props.descriptor.kind));
|
||||
const draft = reactive<Record<string, unknown>>({});
|
||||
const touched = reactive<Record<string, boolean>>({});
|
||||
|
||||
const schema = computed(() => {
|
||||
try { return JSON.parse(props.descriptor.schema_json) as { properties?: Record<string, JSONSchemaProperty> }; }
|
||||
catch { return {}; }
|
||||
});
|
||||
const fields = computed(() => Object.entries(schema.value.properties ?? {}));
|
||||
|
||||
watch(() => state.value.resource, (resource) => {
|
||||
if (!resource) return;
|
||||
for (const key of Object.keys(draft)) delete draft[key];
|
||||
Object.assign(draft, resource.value as Record<string, unknown>);
|
||||
}, { immediate: true });
|
||||
|
||||
function label(key: string, property: JSONSchemaProperty): string {
|
||||
if (property.title) return property.title;
|
||||
const taskLabels: Record<string, string> = {
|
||||
max_model_tool_steps: "Max model steps",
|
||||
max_runtime_seconds: "Max runtime (seconds)",
|
||||
max_consecutive_gate_failures: "Max gate failures",
|
||||
};
|
||||
return taskLabels[key] ?? key.replaceAll("_", " ").replace(/^./, (value) => value.toUpperCase());
|
||||
}
|
||||
|
||||
function update(key: string, property: JSONSchemaProperty, value: unknown): void {
|
||||
touched[key] = true;
|
||||
if (property.type === "integer" || property.type === "number") draft[key] = Number(value);
|
||||
else if (property.type === "boolean") draft[key] = value === true || value === "true";
|
||||
else draft[key] = value;
|
||||
}
|
||||
|
||||
function invalid(key: string, property: JSONSchemaProperty): boolean {
|
||||
if (!touched[key]) return false;
|
||||
const value = draft[key];
|
||||
if ((property.type === "integer" || property.type === "number") && !Number.isFinite(value)) return true;
|
||||
if (typeof value === "number" && property.minimum !== undefined && value < property.minimum) return true;
|
||||
if (typeof value === "number" && property.maximum !== undefined && value > property.maximum) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
async function save(): Promise<void> {
|
||||
for (const [key] of fields.value) touched[key] = true;
|
||||
if (fields.value.some(([key, property]) => invalid(key, property))) return;
|
||||
if (await store.replace(props.descriptor.kind, { ...draft })) {
|
||||
for (const key of Object.keys(touched)) touched[key] = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard :title="descriptor.title">
|
||||
<form class="flex flex-col gap-5" @submit.prevent="save">
|
||||
<FieldGroup>
|
||||
<Field v-for="[key, property] in fields" :key="key" :data-invalid="invalid(key, property)">
|
||||
<FieldLabel :for="`${descriptor.kind}-${key}`">{{ label(key, property) }}</FieldLabel>
|
||||
<Select v-if="property.type === 'boolean' || property.enum" :model-value="String(draft[key])" @update:model-value="update(key, property, $event)">
|
||||
<SelectTrigger :id="`${descriptor.kind}-${key}`" :aria-invalid="invalid(key, property)"><SelectValue /></SelectTrigger>
|
||||
<SelectContent><SelectGroup>
|
||||
<SelectItem v-for="option in property.enum ?? ['true', 'false']" :key="String(option)" :value="String(option)">{{ option }}</SelectItem>
|
||||
</SelectGroup></SelectContent>
|
||||
</Select>
|
||||
<Input
|
||||
v-else
|
||||
:id="`${descriptor.kind}-${key}`"
|
||||
:model-value="draft[key] as string | number"
|
||||
:type="property.type === 'integer' || property.type === 'number' ? 'number' : 'text'"
|
||||
:min="property.minimum"
|
||||
:max="property.maximum"
|
||||
:step="property.type === 'integer' ? 1 : undefined"
|
||||
:aria-invalid="invalid(key, property)"
|
||||
autocomplete="off"
|
||||
@update:model-value="update(key, property, $event)"
|
||||
/>
|
||||
<FieldDescription v-if="property.description">{{ property.description }}</FieldDescription>
|
||||
<FieldDescription v-if="invalid(key, property)" class="text-destructive">Enter a valid value.</FieldDescription>
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
<p v-if="state.error" class="text-sm text-destructive" role="alert">{{ state.error }}</p>
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Badge :variant="state.stream === 'live' ? 'ok' : 'warn'">{{ state.stream === 'live' ? 'Live' : 'Connecting' }}</Badge>
|
||||
<Badge v-if="descriptor.apply_mode === 'restart-required'" variant="warn">Restart required</Badge>
|
||||
<span v-if="state.resource" class="text-xs text-muted-foreground">Version {{ state.resource.version }}</span>
|
||||
</div>
|
||||
<Button type="submit" :disabled="state.saving || state.loading">
|
||||
<Spinner v-if="state.saving" data-icon="inline-start" />
|
||||
Save changes
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { cloneControlPlaneValue, useControlPlaneStore, type ResourceDescriptor } from "@/stores/control-plane";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import StructuredValueEditor from "./StructuredValueEditor.vue";
|
||||
|
||||
const props = defineProps<{ descriptor: ResourceDescriptor; rootPath?: string }>();
|
||||
const store = useControlPlaneStore();
|
||||
const state = computed(() => store.stateFor(props.descriptor.kind));
|
||||
const draft = ref<unknown>({});
|
||||
|
||||
watch(() => state.value.resource, (resource) => {
|
||||
if (resource) draft.value = cloneControlPlaneValue(resource.value);
|
||||
}, { immediate: true });
|
||||
|
||||
async function save(): Promise<void> {
|
||||
await store.replace(props.descriptor.kind, cloneControlPlaneValue(draft.value));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigCard :title="descriptor.title">
|
||||
<form class="space-y-5" @submit.prevent="save">
|
||||
<StructuredValueEditor v-model="draft" :path="rootPath ?? descriptor.kind" />
|
||||
<p v-if="state.error" class="text-sm text-destructive" role="alert">{{ state.error }}</p>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Badge :variant="state.stream === 'live' ? 'ok' : 'warn'">{{ state.stream === 'live' ? 'Live' : 'Connecting' }}</Badge>
|
||||
<Badge v-if="descriptor.apply_mode === 'restart-required'" variant="warn">Restart required</Badge>
|
||||
<span v-if="state.resource" class="text-xs text-muted-foreground">Version {{ state.resource.version }}</span>
|
||||
</div>
|
||||
<Button type="submit" :disabled="state.saving || state.loading">
|
||||
<Spinner v-if="state.saving" data-icon="inline-start" /> Save changes
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</ConfigCard>
|
||||
</template>
|
||||
@@ -0,0 +1,124 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { Plus, Trash2 } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
modelValue: unknown;
|
||||
path?: string;
|
||||
locked?: boolean;
|
||||
}>(), { path: "value", locked: false });
|
||||
const emit = defineEmits<{ "update:modelValue": [value: unknown] }>();
|
||||
|
||||
const isArray = computed(() => Array.isArray(props.modelValue));
|
||||
const isObject = computed(() => props.modelValue !== null && typeof props.modelValue === "object" && !isArray.value);
|
||||
const entries = computed(() => Object.entries((props.modelValue ?? {}) as Record<string, unknown>));
|
||||
const readOnly = computed(() => props.locked || /(^|\.)(has_credential|credential_configured|headers_configured)$/.test(props.path));
|
||||
|
||||
function label(value: string): string {
|
||||
return value.replaceAll("_", " ").replace(/^./, (character) => character.toUpperCase());
|
||||
}
|
||||
|
||||
function setObject(key: string, value: unknown): void {
|
||||
emit("update:modelValue", { ...(props.modelValue as Record<string, unknown>), [key]: value });
|
||||
}
|
||||
|
||||
function renameObject(oldKey: string, newKey: string): void {
|
||||
const current = { ...(props.modelValue as Record<string, unknown>) };
|
||||
const value = current[oldKey];
|
||||
delete current[oldKey];
|
||||
current[newKey] = value;
|
||||
emit("update:modelValue", current);
|
||||
}
|
||||
|
||||
function removeObject(key: string): void {
|
||||
const current = { ...(props.modelValue as Record<string, unknown>) };
|
||||
delete current[key];
|
||||
emit("update:modelValue", current);
|
||||
}
|
||||
|
||||
function addObject(): void {
|
||||
const current = props.modelValue as Record<string, unknown>;
|
||||
let index = 1;
|
||||
while (`new_${index}` in current) index++;
|
||||
emit("update:modelValue", { ...current, [`new_${index}`]: "" });
|
||||
}
|
||||
|
||||
function setArray(index: number, value: unknown): void {
|
||||
const current = [...(props.modelValue as unknown[])];
|
||||
current[index] = value;
|
||||
emit("update:modelValue", current);
|
||||
}
|
||||
|
||||
function addArray(): void {
|
||||
const current = props.modelValue as unknown[];
|
||||
const sample = current[0];
|
||||
let value: unknown = Array.isArray(sample) ? [] : sample && typeof sample === "object" ? {} : "";
|
||||
if (props.path === "repositories") value = {
|
||||
owner: "", name: "", base: "main", gate: [], protect: [], ecosystem: "go", preflight: [], test_glob: "",
|
||||
persistent_storage: false, max_retries: 0, allow_concurrent: false, review_enabled: false,
|
||||
};
|
||||
else if (props.path.endsWith("mcp_servers")) value = {
|
||||
name: "", transport: "stdio", command: "", args: [], work_dir: "", url: "",
|
||||
sse_endpoint: "", message_endpoint: "", headers_configured: false,
|
||||
};
|
||||
else if (props.path.endsWith("gate") || props.path.endsWith("preflight")) value = [];
|
||||
else if (props.path.endsWith("allowed_user_ids")) value = 0;
|
||||
else if (props.path.endsWith("personas")) value = { name: "", prompt: "" };
|
||||
else if (props.path === "schedules") value = {
|
||||
id: "", pool: "sequential", detail: "", kind: "workflow",
|
||||
schedule: { kind: "interval", interval: 3600000000000, start: "0001-01-01T00:00:00Z" },
|
||||
target: {}, payload: { text: "" }, next_run: "0001-01-01T00:00:00Z",
|
||||
created: "0001-01-01T00:00:00Z", updated: "0001-01-01T00:00:00Z",
|
||||
};
|
||||
emit("update:modelValue", [...current, value]);
|
||||
}
|
||||
|
||||
function removeArray(index: number): void {
|
||||
emit("update:modelValue", (props.modelValue as unknown[]).filter((_, itemIndex) => itemIndex !== index));
|
||||
}
|
||||
|
||||
function scalar(value: string | number): void {
|
||||
emit("update:modelValue", typeof props.modelValue === "number" ? Number(value) : value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="isArray" class="space-y-2 rounded-lg border border-border/70 p-3">
|
||||
<div v-for="(item, index) in modelValue as unknown[]" :key="index" class="flex items-start gap-2">
|
||||
<div class="min-w-0 flex-1">
|
||||
<StructuredValueEditor :model-value="item" :path="`${path}.${index}`" @update:model-value="setArray(index, $event)" />
|
||||
</div>
|
||||
<Button type="button" variant="ghost" size="icon-sm" :aria-label="`Remove ${label(path)} row ${index + 1}`" @click="removeArray(index)">
|
||||
<Trash2 />
|
||||
</Button>
|
||||
</div>
|
||||
<Button type="button" variant="outline" size="sm" @click="addArray"><Plus /> Add row</Button>
|
||||
</div>
|
||||
|
||||
<fieldset v-else-if="isObject" class="space-y-4 rounded-lg border border-border/70 p-3">
|
||||
<div v-for="[key, value] in entries" :key="key" class="space-y-1.5">
|
||||
<div class="flex items-center gap-2">
|
||||
<Label :for="`${path}.${key}`" class="flex-1">{{ label(key) }}</Label>
|
||||
<template v-if="path.endsWith('_map') || path.endsWith('labels') || path === 'providers' || path === 'roles'">
|
||||
<Input class="h-7 max-w-48" :model-value="key" aria-label="Entry key" @change="renameObject(key, ($event.target as HTMLInputElement).value)" />
|
||||
<Button type="button" variant="ghost" size="icon-sm" :aria-label="`Remove ${key}`" @click="removeObject(key)"><Trash2 /></Button>
|
||||
</template>
|
||||
</div>
|
||||
<StructuredValueEditor :id="`${path}.${key}`" :model-value="value" :path="`${path}.${key}`" @update:model-value="setObject(key, $event)" />
|
||||
</div>
|
||||
<Button v-if="path.endsWith('_map') || path.endsWith('labels') || path === 'providers' || path === 'roles'" type="button" variant="outline" size="sm" @click="addObject"><Plus /> Add entry</Button>
|
||||
</fieldset>
|
||||
|
||||
<div v-else-if="typeof modelValue === 'boolean'" class="flex min-h-9 items-center gap-2">
|
||||
<Checkbox :id="path" :model-value="modelValue" :disabled="readOnly" @update:model-value="emit('update:modelValue', $event === true)" />
|
||||
<span v-if="readOnly" class="text-xs text-muted-foreground">Reported by Archie</span>
|
||||
</div>
|
||||
<Textarea v-else-if="path.endsWith('.prompt')" :id="path" :model-value="modelValue as string" :readonly="readOnly" autocomplete="off" @update:model-value="scalar" />
|
||||
<Input v-else :id="path" :model-value="modelValue as string | number" :type="typeof modelValue === 'number' ? 'number' : 'text'" :readonly="readOnly" autocomplete="off" @update:model-value="scalar" />
|
||||
</template>
|
||||
@@ -1,27 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import ConfigCard from "./ConfigCard.vue";
|
||||
import DangerousActionsCard from "./DangerousActionsCard.vue";
|
||||
import { ADVANCED_SECTIONS } from "./sections";
|
||||
import { configUnavailable, loadConfig, loadDangerous } from "./state";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
import { 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.
|
||||
*/
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "advanced"));
|
||||
async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadDangerous()]);
|
||||
await Promise.all([controlPlane.load(), loadDangerous()]);
|
||||
}
|
||||
|
||||
useLiveResource(null, () => void load());
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
@@ -29,10 +24,15 @@ onMounted(load);
|
||||
<div>
|
||||
<PageHeader title="Advanced" />
|
||||
|
||||
<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. -->
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">{{ catalogError }}</p>
|
||||
<StructuredResourceCard v-for="descriptor in resources" :key="descriptor.kind" :descriptor="descriptor" />
|
||||
<ConfigCard title="Managed elsewhere">
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Button as-child variant="outline"><RouterLink to="/captures">Captured events</RouterLink></Button>
|
||||
<Button as-child variant="outline"><RouterLink to="/mappings">Capture mappings</RouterLink></Button>
|
||||
<Button as-child variant="outline"><RouterLink to="/bindings">Capture bindings</RouterLink></Button>
|
||||
</div>
|
||||
</ConfigCard>
|
||||
<DangerousActionsCard />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { useIdentitiesStore, type Identity } from "@/stores/identities";
|
||||
|
||||
const store = useIdentitiesStore();
|
||||
const name = ref("");
|
||||
const kind = ref<Identity["kind"]>("bot");
|
||||
store.watch();
|
||||
|
||||
async function create(): Promise<void> { if (await store.create(name.value, kind.value)) name.value = ""; }
|
||||
async function rename(value: Identity): Promise<void> { const next = window.prompt("Display name", value.display_name); if (next && next !== value.display_name) await store.command(value, "rename", next); }
|
||||
async function retire(value: Identity): Promise<void> { if (window.confirm(`Retire ${value.display_name}? This cannot be undone.`)) await store.command(value, "retire"); }
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="page identities-page">
|
||||
<PageHeader title="Identities" />
|
||||
<p v-if="store.error" role="alert" class="error">{{ store.error }}</p>
|
||||
<form class="identity-create" @submit.prevent="create">
|
||||
<input v-model.trim="name" required aria-label="Display name" placeholder="Display name">
|
||||
<select v-model="kind" aria-label="Kind"><option value="bot">Bot</option><option value="service_account">Service account</option><option value="user">User</option></select>
|
||||
<button type="submit" :disabled="!name || !!store.busy">Create</button>
|
||||
</form>
|
||||
<section aria-label="Identity list" class="identity-list">
|
||||
<article v-for="value in store.identities" :key="value.id" class="identity-row">
|
||||
<div><strong>{{ value.display_name }}</strong><span>{{ value.kind.replace('_', ' ') }} · {{ value.lifecycle }}</span></div>
|
||||
<div v-if="value.kind !== 'system'" class="actions">
|
||||
<button :disabled="!!store.busy || value.lifecycle === 'retired'" @click="rename(value)">Rename</button>
|
||||
<button v-if="value.lifecycle === 'active'" :disabled="!!store.busy" @click="store.command(value, 'suspend')">Suspend</button>
|
||||
<button v-if="value.lifecycle === 'suspended'" :disabled="!!store.busy" @click="store.command(value, 'reactivate')">Reactivate</button>
|
||||
<button class="danger" :disabled="!!store.busy || value.lifecycle === 'retired'" @click="retire(value)">Retire</button>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.identities-page{max-width:960px}.identity-create{display:flex;gap:.75rem;margin:1.5rem 0}.identity-create input{flex:1}.identity-create input,.identity-create select,.identity-create button,.actions button{border:1px solid var(--border);border-radius:.5rem;background:var(--surface);color:inherit;padding:.6rem .8rem}.identity-list{border-top:1px solid var(--border)}.identity-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;border-bottom:1px solid var(--border)}.identity-row span{display:block;color:var(--muted-foreground);font-size:.85rem;margin-top:.2rem;text-transform:capitalize}.actions{display:flex;gap:.5rem}.actions .danger{color:var(--destructive)}.error{color:var(--destructive)}
|
||||
</style>
|
||||
@@ -1,26 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import ModelsCard from "./ModelsCard.vue";
|
||||
import { configUnavailable, loadConfig } from "./state";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
useLiveResource(null, () => void loadConfig());
|
||||
onMounted(loadConfig);
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "models"));
|
||||
onMounted(controlPlane.load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Models" />
|
||||
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<ModelsCard v-else />
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">{{ catalogError }}</p>
|
||||
<StructuredResourceCard
|
||||
v-for="descriptor in resources"
|
||||
:key="descriptor.kind"
|
||||
:descriptor="descriptor"
|
||||
:root-path="descriptor.kind === 'provider-settings' ? 'providers' : 'roles'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,24 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import RepositoriesCard from "./RepositoriesCard.vue";
|
||||
import { configUnavailable, loadConfig } from "./state";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
|
||||
/**
|
||||
* The repositories Archie watches, and the gate overrides each one carries.
|
||||
*/
|
||||
useLiveResource(null, () => void loadConfig());
|
||||
onMounted(loadConfig);
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "repositories"));
|
||||
onMounted(controlPlane.load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Repositories" />
|
||||
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<RepositoriesCard v-else />
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">{{ catalogError }}</p>
|
||||
<StructuredResourceCard v-for="descriptor in resources" :key="descriptor.kind" :descriptor="descriptor" root-path="repositories" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,22 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import { TASKS_SECTIONS } from "./sections";
|
||||
import { configUnavailable, loadConfig } from "./state";
|
||||
import { useControlPlaneStore } from "@/stores/control-plane";
|
||||
import { resourcesForPage } from "@/stores/control-plane";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
|
||||
useLiveResource(null, () => void loadConfig());
|
||||
onMounted(loadConfig);
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "tasks"));
|
||||
onMounted(controlPlane.load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Task settings" />
|
||||
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<ConfigSections v-else :ids="TASKS_SECTIONS" />
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">{{ catalogError }}</p>
|
||||
<StructuredResourceCard
|
||||
v-for="descriptor in resources"
|
||||
:key="descriptor.kind"
|
||||
:descriptor="descriptor"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user