diff --git a/ui/src/ui/views/overview.ts b/ui/src/ui/views/overview.ts index 6ebcb884ff6..1f74135a578 100644 --- a/ui/src/ui/views/overview.ts +++ b/ui/src/ui/views/overview.ts @@ -25,6 +25,9 @@ export type OverviewProps = { onSessionKeyChange: (next: string) => void; onConnect: () => void; onRefresh: () => void; + onOpenCortexPreview: () => void; + onOpenCortexConflicts: () => void; + onOpenCortexSync: () => void; }; export function renderOverview(props: OverviewProps) { @@ -33,6 +36,15 @@ export function renderOverview(props: OverviewProps) { uptimeMs?: number; policy?: { tickIntervalMs?: number }; authMode?: "none" | "token" | "password" | "trusted-proxy"; + cortex?: { + enabled?: boolean; + mode?: string; + graphPath?: string; + lastCaptureAtMs?: number; + lastCaptureReason?: string; + lastCaptureStored?: boolean; + lastSyncPlatforms?: string[]; + }; } | undefined; const uptime = snapshot?.uptimeMs ? formatDurationHuman(snapshot.uptimeMs) : t("common.na"); @@ -41,6 +53,15 @@ export function renderOverview(props: OverviewProps) { : t("common.na"); const authMode = snapshot?.authMode; const isTrustedProxy = authMode === "trusted-proxy"; + const cortex = snapshot?.cortex; + const cortexSummary = !cortex?.enabled + ? t("common.disabled") + : `${cortex.mode ?? t("common.enabled")} · ${cortex.lastCaptureStored ? "stored" : "idle"}`; + const cortexDetail = !cortex?.enabled + ? "Prompt bridge not enabled" + : `Last capture ${ + cortex.lastCaptureAtMs ? formatRelativeTimestamp(cortex.lastCaptureAtMs) : t("common.na") + }${cortex.lastCaptureReason ? ` · ${cortex.lastCaptureReason}` : ""}`; const pairingHint = (() => { if (!shouldShowPairingHint(props.connected, props.lastError, props.lastErrorCode)) { @@ -205,11 +226,7 @@ export function renderOverview(props: OverviewProps) { .value=${props.settings.gatewayUrl} @input=${(e: Event) => { const v = (e.target as HTMLInputElement).value; - props.onSettingsChange({ - ...props.settings, - gatewayUrl: v, - token: v.trim() === props.settings.gatewayUrl.trim() ? props.settings.token : "", - }); + props.onSettingsChange({ ...props.settings, gatewayUrl: v }); }} placeholder="ws://100.x.y.z:18789" /> @@ -303,6 +320,28 @@ export function renderOverview(props: OverviewProps) { ${props.lastChannelsRefresh ? formatRelativeTimestamp(props.lastChannelsRefresh) : t("common.na")} +
+
Cortex
+
${cortexSummary}
+
${cortexDetail}
+ ${ + cortex?.enabled + ? html` +
+ + + +
+ ` + : "" + } +
${ props.lastError