* fix(ui/topbar): replace Jump to with a command palette, drop filler chrome Jump to opens a shadcn-vue Command dialog that finds pages, tasks and workflows by name. The connection indicator shows only when the stream is lost, the dead documentation link is gone, and the profile menu label has no stray whitespace. * fix(ui): trim stray whitespace from template text and drop em dashes from copy Element text that started or ended with a line break rendered with leading and trailing spaces. Also removes the unused 'soon' nav state and the nav group components no route reaches. * fix(ui): drop the space a hidden spinner left before button text * fix(ui/status): one dense Status page, full-width settings, problems-only apply status Status drops its tabs and the duplicate health card; services list only what is wrong. Settings pages use the full width, the resizable sidebar handle is gone, and apply status shows only processes that have not applied a change. PageHeader puts the title and actions on one line. * refactor(ui): use shadcn ToggleGroup and Badge, drop SegmentedControl and StatusPill Status badges show only when a state needs attention: no Running, Enabled, Active, Listening or live pills next to healthy rows. Removes the unused pagination, radio-group and scroll-area components. * fix(ui/history): use the shadcn Table with fixed columns so nothing is clipped * fix(ui/workflows): apply ?workflow= only once the workflow is listed Selecting it before the definitions loaded opened an empty canvas. * refactor(ui/workflows): use shadcn Input, NativeSelect, Checkbox and Button in editors Replaces hand-rolled inputs, selects, the repository mode switch and icon buttons in the workflow editor, bind dialog, harness page, sources panel and review gate. Adds the upstream shadcn-vue NativeSelect. * style(ui): rounded-rectangle controls instead of pills Halves the radius scale so inputs, selects and buttons stop reading as pills, and badges and chips lose their full rounding. * fix(ui/alerts): centre the bell's failed state and stop it contradicting Needs you * fix(ui/tasks): one header line, aligned columns, no placeholder issue numbers Tasks puts its filters beside the title and drops the stat tiles the dashboard already shows. Sort headers align with their cells, chat tasks no longer show their synthetic issue number, and Logs and the task not-found page use the shared header. * fix(ui/dashboard): shared header and cards, empty cards stay silent Needs you uses the shadcn Card and drops its duplicate Open button; quality gates and token outlook render only when there is something to show; the throughput strip moves into the dashboard, its only user. * refactor(ui/stores): one Pinia store per feature Splits the site-wide control-plane store and the module-level refs into settings, workflows, tasks, events, org and session stores. Identity requests move into lib/api. Drops store fields nothing read: per-resource stream state, the states map and loadApplyStatus. * fix(ui/org): one header for the org area, sections drop their repeated titles The org name is the page title with the admin's org switcher and New org beside it; Members and Workspaces tables sit in cards like other pages. * fix(ui/events): shadcn Tabs for the capture, map and bind steps Replaces the numbered step strip with line tabs that carry each step's count; the Listening pill is gone and Capture off shows only when it is. * fix(ui/workflows): confirm a workflow delete in an AlertDialog, not window.confirm * style(ui/settings): denser setting rows
201 lines
6.2 KiB
Vue
201 lines
6.2 KiB
Vue
<script setup lang="ts">
|
|
import { computed, onMounted, ref } from "vue";
|
|
|
|
import { Badge } from "@/components/ui/badge";
|
|
import { Button } from "@/components/ui/button";
|
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
import {
|
|
Table,
|
|
TableBody,
|
|
TableCell,
|
|
TableHead,
|
|
TableHeader,
|
|
TableRow,
|
|
} from "@/components/ui/table";
|
|
import { ApiError, api } from "@/lib/api";
|
|
|
|
/**
|
|
* Per-component versions and the update that applies them.
|
|
*
|
|
* Everything behind this card already exists: /api/version reports what is
|
|
* running, what the check command claims, what is available, and the honest
|
|
* status between those (ok, update_available, drift, unknown); the install
|
|
* endpoint re-validates freshness and refuses a stale snapshot. This card
|
|
* only surfaces them.
|
|
*/
|
|
|
|
interface ComponentVersion {
|
|
id: string;
|
|
label: string;
|
|
install_type?: string;
|
|
reference?: string;
|
|
running_version?: string;
|
|
installed_claim?: string;
|
|
latest_available?: string;
|
|
status: "ok" | "update_available" | "drift" | "unknown";
|
|
}
|
|
|
|
const components = ref<ComponentVersion[]>([]);
|
|
const snapshot = ref<unknown>(null);
|
|
const available = ref<unknown[]>([]);
|
|
const canInstall = ref(false);
|
|
const notConfigured = ref(false);
|
|
const loading = ref(true);
|
|
const loadError = ref<string | null>(null);
|
|
const installing = ref(false);
|
|
const installProgress = ref<string[]>([]);
|
|
const installResult = ref<string | null>(null);
|
|
const installError = ref<string | null>(null);
|
|
|
|
const updateable = computed(() =>
|
|
components.value.filter((c) => c.status === "update_available"),
|
|
);
|
|
|
|
const statusKind: Record<
|
|
ComponentVersion["status"],
|
|
"ok" | "warn" | "danger" | "idle"
|
|
> = {
|
|
ok: "ok",
|
|
update_available: "warn",
|
|
drift: "danger",
|
|
unknown: "idle",
|
|
};
|
|
|
|
const statusLabel: Record<ComponentVersion["status"], string> = {
|
|
ok: "",
|
|
update_available: "Update available",
|
|
drift: "Version drift",
|
|
unknown: "Unknown",
|
|
};
|
|
|
|
async function load(): Promise<void> {
|
|
loading.value = true;
|
|
loadError.value = null;
|
|
try {
|
|
const [report, update] = await Promise.all([
|
|
api.version<{ components: ComponentVersion[] }>(),
|
|
api
|
|
.updateSnapshot<{ snapshot: unknown; available: unknown[] | null; can_install: boolean }>()
|
|
.catch((err) => {
|
|
if (err instanceof ApiError && err.status === 501) {
|
|
notConfigured.value = true;
|
|
return null;
|
|
}
|
|
throw err;
|
|
}),
|
|
]);
|
|
components.value = report.components;
|
|
if (update) {
|
|
snapshot.value = update.snapshot;
|
|
available.value = update.available ?? [];
|
|
canInstall.value = update.can_install;
|
|
}
|
|
} catch (err) {
|
|
loadError.value = err instanceof Error ? err.message : String(err);
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
}
|
|
|
|
// The snapshot the install endpoint demands is the one the operator saw --
|
|
// the endpoint re-checks freshness and answers 409 when releases moved.
|
|
function installableSnapshot(): unknown {
|
|
return snapshot.value && available.value.length ? snapshot.value : null;
|
|
}
|
|
|
|
async function install(): Promise<void> {
|
|
const snap = installableSnapshot();
|
|
if (!snap || installing.value) return;
|
|
installing.value = true;
|
|
installError.value = null;
|
|
installProgress.value = [];
|
|
installResult.value = null;
|
|
try {
|
|
const result = await api.updateInstall<{
|
|
progress?: string[];
|
|
result?: { installed?: Record<string, string> };
|
|
}>(snap);
|
|
installProgress.value = result.progress ?? [];
|
|
const installed = result.result?.installed;
|
|
installResult.value = installed
|
|
? Object.entries(installed)
|
|
.map(([id, version]) => `${id} → ${version}`)
|
|
.join(", ")
|
|
: "update finished";
|
|
await load();
|
|
} catch (err) {
|
|
installError.value = err instanceof Error ? err.message : String(err);
|
|
} finally {
|
|
installing.value = false;
|
|
}
|
|
}
|
|
|
|
onMounted(load);
|
|
</script>
|
|
|
|
<template>
|
|
<p v-if="notConfigured" class="text-sm text-fg-muted">Update checks not configured.</p>
|
|
<Card v-else>
|
|
<CardHeader>
|
|
<CardTitle>Versions</CardTitle>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<p v-if="loadError" class="text-sm text-danger">{{ loadError }}</p>
|
|
<p v-else-if="loading" class="text-sm text-fg-muted">Checking…</p>
|
|
<template v-else>
|
|
<Table>
|
|
<TableHeader>
|
|
<TableRow>
|
|
<TableHead>Component</TableHead>
|
|
<TableHead>Running</TableHead>
|
|
<TableHead>Available</TableHead>
|
|
<TableHead class="w-full"></TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody>
|
|
<TableRow v-for="component in components" :key="component.id">
|
|
<TableCell>{{ component.label || component.id }}</TableCell>
|
|
<TableCell class="font-mono text-fg-muted">{{
|
|
component.running_version || component.installed_claim
|
|
}}</TableCell>
|
|
<TableCell class="font-mono text-fg-muted">{{ component.latest_available }}</TableCell>
|
|
<TableCell>
|
|
<Badge v-if="component.status !== 'ok'" :variant="statusKind[component.status]">{{
|
|
statusLabel[component.status]
|
|
}}</Badge>
|
|
</TableCell>
|
|
</TableRow>
|
|
</TableBody>
|
|
</Table>
|
|
|
|
<div
|
|
v-if="canInstall && updateable.length"
|
|
class="mt-4 flex flex-col gap-2"
|
|
>
|
|
<Button class="self-start" :disabled="installing" @click="install">
|
|
{{
|
|
installing
|
|
? "Installing…"
|
|
: `Install ${updateable.map((c) => c.label || c.id).join(", ")}`
|
|
}}
|
|
</Button>
|
|
<p v-if="installing" class="text-xs text-fg-muted">You can leave this page; the restart continues here.</p>
|
|
</div>
|
|
|
|
<div
|
|
v-if="installProgress.length"
|
|
class="mt-3 rounded-sm border border-border bg-muted p-3 font-mono text-xs"
|
|
>
|
|
<p v-for="(line, i) in installProgress" :key="i">{{ line }}</p>
|
|
</div>
|
|
<p v-if="installResult" class="mt-2 text-sm text-ok">
|
|
{{ installResult }}
|
|
</p>
|
|
<p v-if="installError" class="mt-2 text-sm text-danger">
|
|
{{ installError }}
|
|
</p>
|
|
</template>
|
|
</CardContent>
|
|
</Card>
|
|
</template>
|