codex-copilot-dx 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/bin/cli.mjs +28 -4
- package/docs/ARCHITECTURE.md +40 -7
- package/docs/README.md +2 -0
- package/docs/REFERENCE.md +174 -73
- package/package.json +1 -1
- package/src/adapter.mjs +17 -3
- package/src/browser-launch.mjs +22 -0
- package/src/claude-client-config.mjs +7 -2
- package/src/claude-gateway.mjs +18 -2
- package/src/cli-animation.mjs +1 -1
- package/src/cli-image.mjs +3 -0
- package/src/cli-m365.mjs +1 -1
- package/src/cli-options.mjs +7 -3
- package/src/cli-table.mjs +1 -1
- package/src/client-integration.mjs +5 -1
- package/src/dashboard/console.js +141 -0
- package/src/dashboard/index.html +102 -52
- package/src/dashboard/language.js +65 -0
- package/src/dashboard/status.js +27 -5
- package/src/dashboard/ui.css +44 -1
- package/src/dashboard/ui.js +7 -8
- package/src/dashboard-api.mjs +24 -0
- package/src/dashboard.mjs +1 -0
- package/src/http-transport.mjs +2 -1
- package/src/image-mcp.mjs +9 -6
- package/src/launcher.mjs +6 -6
- package/src/log.mjs +13 -11
- package/src/m365-settings.mjs +0 -2
- package/src/native-prediction-recovery.mjs +1 -0
- package/src/native-prediction.mjs +6 -2
- package/src/observability.mjs +8 -1
- package/src/optional-routes.mjs +2 -2
- package/src/provider-runtime.mjs +20 -13
- package/src/response-failures.mjs +1 -1
- package/src/service-control.mjs +60 -0
- package/src/startup-ui.mjs +37 -10
- package/src/terminal-console.mjs +114 -0
- package/src/usage-store.mjs +11 -1
- package/src/usage.mjs +1 -0
- package/src/user-settings.mjs +21 -0
package/src/cli-table.mjs
CHANGED
|
@@ -35,7 +35,7 @@ function graphemeWidth(segment) {
|
|
|
35
35
|
return width;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function displayWidth(value) {
|
|
38
|
+
export function displayWidth(value) {
|
|
39
39
|
if (SIMPLE_WIDTH.test(value)) return value.length;
|
|
40
40
|
graphemeSegmenter ||= new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
41
41
|
let width = 0;
|
|
@@ -116,7 +116,11 @@ export function createClientIntegration({ port, host, info = () => {}, warning =
|
|
|
116
116
|
}); },
|
|
117
117
|
pacUrl() { return native?.pacUrl || null; },
|
|
118
118
|
launched(route) { prediction.launch(route); },
|
|
119
|
-
|
|
119
|
+
setPredictionActive(value) {
|
|
120
|
+
const active = native?.setActive?.(value) ?? false;
|
|
121
|
+
return { active, state: active ? "active" : native ? "paused" : "needs_setup" };
|
|
122
|
+
},
|
|
123
|
+
snapshot() { return { prediction: { ...prediction.snapshot(), active: native?.enabled?.() === true } }; },
|
|
120
124
|
async close() { closed = true;try { await operation; } finally { await native?.close();native = null; } },
|
|
121
125
|
};
|
|
122
126
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const el = id => document.getElementById(id);
|
|
3
|
+
const label = (node, key, values = {}) => globalThis.ccdxLanguage.set(node, key, values);
|
|
4
|
+
const titles = { overview: "Overview", codex: "Codex", claude: "Claude", models: "Model services", usage: "Usage and diagnostics", system: "System and settings" };
|
|
5
|
+
let current = "overview", settings = null, settingsPending = false, stopped = false, timer = null, ticks = 0;
|
|
6
|
+
let sourceDirty = false, sourceGeneration = 0;
|
|
7
|
+
let settingsReadAt = null;
|
|
8
|
+
function navigate() {
|
|
9
|
+
const route = location.hash.slice(1), next = Object.hasOwn(titles, route) ? route : "overview";
|
|
10
|
+
current = next;
|
|
11
|
+
for (const view of document.querySelectorAll("[data-view]")) view.hidden = view.dataset.view !== next;
|
|
12
|
+
for (const item of document.querySelectorAll("[data-route]")) {
|
|
13
|
+
if (item.dataset.route === next) item.setAttribute("aria-current", "page");else item.removeAttribute("aria-current");
|
|
14
|
+
}
|
|
15
|
+
label(el("page-title"), titles[next]);
|
|
16
|
+
if (["codex", "models", "system"].includes(next)) void loadSettings();
|
|
17
|
+
if (next === "models") { void dashboardRefresh.refresh("models");void dashboardRefresh.refresh("auth"); }
|
|
18
|
+
if (next === "usage") void dashboardRefresh.refresh("usage");
|
|
19
|
+
if (next === "system") void dashboardRefresh.refresh("animation");
|
|
20
|
+
syncAnimationPreview();
|
|
21
|
+
}
|
|
22
|
+
async function api(body) {
|
|
23
|
+
const response = await fetch("/_ccdx/ui/settings", { method: body ? "POST" : "GET", cache: "no-store",
|
|
24
|
+
headers: { "X-CCDX-Dashboard": "1", ...(body ? { "Content-Type": "application/json" } : {}) },
|
|
25
|
+
...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(15000) });
|
|
26
|
+
const data = await response.json();if (!response.ok) throw new Error(data.error || `HTTP ${response.status}`);return data;
|
|
27
|
+
}
|
|
28
|
+
const states = { immediate: "Effective now", terminal_unavailable: "Terminal animation unavailable in this output mode", next_start: "Next CCDX start", next_call: "Applies to new calls", needs_setup: "Setup required",
|
|
29
|
+
next_config_request: "Next configuration request; cached suggestions may remain", needs_app_relaunch: "Reopen the client to finish", needs_service_restart: "Restart CCDX to finish" };
|
|
30
|
+
function applySettings(data) {
|
|
31
|
+
settings = data;
|
|
32
|
+
for (const key of ["terminal_animation_enabled", "open_webui", "image_enabled", "prediction_enabled"]) {
|
|
33
|
+
const input = el(`setting-${key}`), effective = data.effective[key];
|
|
34
|
+
input.checked = data.saved[key];input.disabled = Boolean(effective.locked);
|
|
35
|
+
label(el(`effect-${key}`), "Saved {saved} / effective {effective} / {state}", {
|
|
36
|
+
saved: { key: data.saved[key] ? "On" : "Off" }, effective: { key: effective.value ? "On" : "Off" },
|
|
37
|
+
state: { key: effective.locked ? "Controlled by environment" : states[effective.state] || effective.state } });
|
|
38
|
+
}
|
|
39
|
+
if (document.activeElement !== el("history-limit")) el("history-limit").value = data.history.maxBytes / 1048576;
|
|
40
|
+
el("history-limit").disabled = data.history.source === "environment";
|
|
41
|
+
el("save-history").disabled = data.history.source === "environment";
|
|
42
|
+
label(el("effect-history"), data.history.source === "environment" ? "Controlled by environment" : "Applies to new calls");
|
|
43
|
+
label(el("settings-note"), "Settings read from the running service.");
|
|
44
|
+
el("page-settings-note").textContent = "";
|
|
45
|
+
const state = data.providers;
|
|
46
|
+
if (state && !sourceDirty && el("source-provider").value !== state.codex_provider) {
|
|
47
|
+
el("source-provider").value = state.codex_provider;void loadSourceModels();
|
|
48
|
+
}
|
|
49
|
+
el("source-control-note").textContent = state ? `Codex → ${state.codex_provider} / Microsoft 365: ${state.m365.state}${state.m365.reason ? ` / ${state.m365.reason}` : ""}` : "—";
|
|
50
|
+
el("process-notice").textContent = data.terminal?.last_notice || "";
|
|
51
|
+
}
|
|
52
|
+
async function loadSettings() {
|
|
53
|
+
if (settingsPending) return;
|
|
54
|
+
settingsPending = true;
|
|
55
|
+
try { applySettings(await api());settingsReadAt = new Date().toLocaleTimeString(); }
|
|
56
|
+
catch (error) {
|
|
57
|
+
const detail = `${error.message}${settingsReadAt ? ` / ${settingsReadAt}` : ""}`;
|
|
58
|
+
el("settings-note").textContent = detail;el("page-settings-note").textContent = detail;
|
|
59
|
+
}
|
|
60
|
+
finally { settingsPending = false; }
|
|
61
|
+
}
|
|
62
|
+
async function change(body, button) {
|
|
63
|
+
if (settingsPending) return;
|
|
64
|
+
settingsPending = true;
|
|
65
|
+
const controls = [...document.querySelectorAll("[role=switch], #save-history, #clean-history, #fix-prediction, #apply-source, #m365-on, #m365-off")];
|
|
66
|
+
controls.forEach(input => { input.disabled = true; });
|
|
67
|
+
label(el("settings-note"), "Applying…");
|
|
68
|
+
if (button) button.setAttribute("aria-busy", "true");
|
|
69
|
+
try {
|
|
70
|
+
const data = await api(body);if (body.action === "provider" && body.operation === "switch") sourceDirty = false;
|
|
71
|
+
applySettings(data);await dashboardRefresh.refresh("status", { force: true });await dashboardRefresh.refresh("auth", { force: true });
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (settings) applySettings(settings);
|
|
75
|
+
el("settings-note").textContent = error.message;el("source-control-note").textContent = error.message;el("effect-history").textContent = error.message;
|
|
76
|
+
if (body.key) el(`effect-${body.key}`).textContent = error.message;
|
|
77
|
+
} finally {
|
|
78
|
+
settingsPending = false;controls.forEach(input => { input.disabled = false; });
|
|
79
|
+
if (settings) for (const [key, value] of Object.entries(settings.effective)) if (value.locked) el(`setting-${key}`).disabled = true;
|
|
80
|
+
if (settings?.history.source === "environment") el("save-history").disabled = true;
|
|
81
|
+
if (el("source-provider").value === "m365") el("apply-source").disabled = !el("source-model").value || !el("source-review").value;
|
|
82
|
+
button?.removeAttribute("aria-busy");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
for (const input of document.querySelectorAll("[role=switch]")) input.addEventListener("change", () => {
|
|
86
|
+
void change({ action: "preference", key: input.id.slice("setting-".length), value: input.checked }, input);
|
|
87
|
+
});
|
|
88
|
+
el("save-history").addEventListener("click", () => void change({ action: "history_limit", mib: Number(el("history-limit").value) }, el("save-history")));
|
|
89
|
+
el("clean-history").addEventListener("click", () => {
|
|
90
|
+
if (window.confirm(globalThis.ccdxLanguage.format("Clear inactive Codex conversation data? Older continuation IDs may stop working."))) void change({ action: "history_clean" }, el("clean-history"));
|
|
91
|
+
});
|
|
92
|
+
el("fix-prediction").addEventListener("click", () => void change({ action: "prediction_fix" }, el("fix-prediction")));
|
|
93
|
+
for (const operation of ["on", "off"]) el(`m365-${operation}`).addEventListener("click", () => void change({ action: "provider", operation }, el(`m365-${operation}`)));
|
|
94
|
+
async function loadSourceModels() {
|
|
95
|
+
const generation = ++sourceGeneration;
|
|
96
|
+
const m365 = el("source-provider").value === "m365";
|
|
97
|
+
el("source-model").disabled = el("source-review").disabled = !m365;
|
|
98
|
+
if (!m365) { el("apply-source").disabled = settingsPending;return; }
|
|
99
|
+
el("apply-source").disabled = true;
|
|
100
|
+
el("source-model").replaceChildren();el("source-review").replaceChildren();
|
|
101
|
+
try {
|
|
102
|
+
const response = await fetch("/_ccdx/ui/models/live?provider=m365", { headers: { "X-CCDX-Dashboard": "1" }, cache: "no-store", signal: AbortSignal.timeout(15000) });
|
|
103
|
+
const data = await response.json();if (!response.ok) throw new Error(data.error);
|
|
104
|
+
if (generation !== sourceGeneration) return;
|
|
105
|
+
const models = data.models.filter(model => model.selectable && model.clients.includes("codex"));
|
|
106
|
+
for (const [id, list] of [["source-model", models], ["source-review", models.filter(model => model.reasoning_efforts?.includes("low"))]]) {
|
|
107
|
+
el(id).replaceChildren(...list.map(model => { const option = document.createElement("option");option.value = model.id;option.textContent = model.id;return option; }));
|
|
108
|
+
const saved = settings?.providers?.m365?.preference?.[id === "source-model" ? "model" : "auto_review_model"];
|
|
109
|
+
if (!sourceDirty && saved && list.some(model => model.id === saved)) el(id).value = saved;
|
|
110
|
+
}
|
|
111
|
+
el("apply-source").disabled = !el("source-model").value || !el("source-review").value;
|
|
112
|
+
} catch (error) { if (generation === sourceGeneration) el("source-control-note").textContent = error.message; }
|
|
113
|
+
}
|
|
114
|
+
el("source-provider").addEventListener("change", () => { sourceDirty = true;void loadSourceModels(); });
|
|
115
|
+
for (const id of ["source-model", "source-review"]) el(id).addEventListener("change", () => { sourceDirty = true; });
|
|
116
|
+
el("apply-source").addEventListener("click", () => {
|
|
117
|
+
const provider = el("source-provider").value;
|
|
118
|
+
void change({ action: "provider", operation: "switch", provider, ...(provider === "m365" ? { model: el("source-model").value, auto_review_model: el("source-review").value } : {}) }, el("apply-source"));
|
|
119
|
+
});
|
|
120
|
+
// Only the small in-memory status snapshot is read at this cadence. Catalogs
|
|
121
|
+
// and retained usage keep their existing on-demand, bounded refresh policy.
|
|
122
|
+
function schedule() {
|
|
123
|
+
clearTimeout(timer);if (stopped) return;
|
|
124
|
+
timer = setTimeout(async () => {
|
|
125
|
+
if (document.visibilityState === "visible" && dashboardRefresh.automatic) {
|
|
126
|
+
await dashboardRefresh.refresh("status", { force: true });
|
|
127
|
+
if (++ticks % 8 === 0) {
|
|
128
|
+
await dashboardRefresh.refresh("auth", { force: true });
|
|
129
|
+
if (["codex", "models", "system"].includes(current)) await loadSettings();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
schedule();
|
|
133
|
+
}, 2000);
|
|
134
|
+
}
|
|
135
|
+
window.addEventListener("hashchange", navigate);
|
|
136
|
+
el("refresh").addEventListener("click", () => { if (["codex", "models", "system"].includes(current)) void loadSettings(); });
|
|
137
|
+
window.addEventListener("pagehide", () => { stopped = true;clearTimeout(timer); });
|
|
138
|
+
window.addEventListener("pageshow", () => { stopped = false;schedule(); });
|
|
139
|
+
el("open-animation").addEventListener("click", () => { location.hash = "system";navigate(); });
|
|
140
|
+
navigate();schedule();
|
|
141
|
+
})();
|
package/src/dashboard/index.html
CHANGED
|
@@ -12,50 +12,100 @@
|
|
|
12
12
|
<script src="/status.js" defer></script>
|
|
13
13
|
<script src="/usage.js" defer></script>
|
|
14
14
|
<script src="/ui.js" defer></script>
|
|
15
|
+
<script src="/console.js" defer></script>
|
|
15
16
|
<title data-i18n>CCDX · Local dashboard</title>
|
|
16
17
|
</head>
|
|
17
18
|
<body>
|
|
18
19
|
<div class="shell">
|
|
20
|
+
<aside class="sidebar">
|
|
21
|
+
<a class="sidebar-brand" href="#overview"><svg id="status-icon" class="status-icon" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><ellipse cx="32" cy="32" rx="26" ry="10"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(60 32 32)"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(120 32 32)"/></g><circle cx="32" cy="32" r="4.5" fill="currentColor"/></svg><span class="brand-name">CCDX</span><span class="brand-caption" data-i18n>LOCAL CONTROL</span></a>
|
|
22
|
+
<nav aria-label="Main navigation" data-i18n-label>
|
|
23
|
+
<a href="#overview" data-route="overview" aria-current="page" data-i18n>Overview</a>
|
|
24
|
+
<span class="nav-group" data-i18n>Clients</span>
|
|
25
|
+
<a href="#codex" data-route="codex">Codex</a>
|
|
26
|
+
<a href="#claude" data-route="claude">Claude</a>
|
|
27
|
+
<a href="#models" data-route="models" data-i18n>Model services</a>
|
|
28
|
+
<a href="#usage" data-route="usage" data-i18n>Usage and diagnostics</a>
|
|
29
|
+
<a href="#system" data-route="system" data-i18n>System and settings</a>
|
|
30
|
+
</nav>
|
|
31
|
+
<div class="sidebar-bottom"><button id="open-animation" type="button" aria-controls="animation-settings" aria-expanded="false" data-i18n>Terminal appearance</button><p data-i18n>Local service. Client-specific capabilities stay with their client.</p></div>
|
|
32
|
+
</aside>
|
|
33
|
+
|
|
19
34
|
<header class="topbar">
|
|
20
35
|
<div class="brand">CCDX <span class="brand-detail" data-i18n>/ LOCAL STATUS</span></div>
|
|
21
|
-
<div class="topbar-actions"><span id="connection" class="badge neutral" role="status" data-i18n>READING</span><button id="theme-toggle" class="icon-button" type="button" aria-label="Switch to light mode" title="Switch to light mode"><svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42"/></svg><svg class="icon-moon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 3A9 9 0 1 0 21 12 7 7 0 0 1 12 3Z"/></svg></button><button id="language-toggle" class="icon-button language-button" type="button" aria-label="Switch to Chinese" title="Switch to Chinese">中文</button><button id="
|
|
36
|
+
<div class="topbar-actions"><span id="connection" class="badge neutral" role="status" data-i18n>READING</span><button id="theme-toggle" class="icon-button" type="button" aria-label="Switch to light mode" title="Switch to light mode"><svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42"/></svg><svg class="icon-moon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 3A9 9 0 1 0 21 12 7 7 0 0 1 12 3Z"/></svg></button><button id="language-toggle" class="icon-button language-button" type="button" aria-label="Switch to Chinese" title="Switch to Chinese">中文</button><button id="auto-refresh" type="button" aria-pressed="true" data-i18n data-i18n-title title="Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open.">Auto refresh</button><button id="refresh" type="button" data-i18n>Refresh</button></div>
|
|
22
37
|
</header>
|
|
23
38
|
|
|
24
|
-
<main>
|
|
39
|
+
<main id="main-content" tabindex="-1">
|
|
25
40
|
<section class="intro">
|
|
26
|
-
<h1><
|
|
41
|
+
<h1><span id="page-title" data-i18n>Overview</span></h1>
|
|
27
42
|
<div class="snapshot-meta"><p id="auth-account" role="status" data-i18n data-i18n-title title="Provider status / authorization and inference are separate.">READING</p><p id="updated" data-i18n>Reading status…</p></div>
|
|
43
|
+
<p id="page-settings-note" class="hint" role="status"></p>
|
|
28
44
|
</section>
|
|
29
45
|
|
|
30
|
-
<section class="overview" aria-label="Overview" data-i18n-label>
|
|
31
|
-
<article class="card"><h2 data-i18n>ADAPTER</h2><strong id="version">—</strong><p id="uptime">—</p></article>
|
|
32
|
-
<article class="card"><h2 data-i18n>SOURCES</h2><strong id="source-summary">—</strong><p id="source-detail">—</p></article>
|
|
33
|
-
<article class="card"><h2 data-i18n>CODEX MODELS</h2><strong id="models">—</strong><p id="model-source">—</p></article>
|
|
34
|
-
<article class="card"><h2 data-i18n>CODEX REQUESTS</h2><strong id="requests">—</strong><p id="request-errors">—</p><p id="http-error-breakdown">—</p><p><span data-i18n>Per-request limits (active)</span><br><span id="body-limits">—</span></p></article>
|
|
35
|
-
</section>
|
|
36
|
-
|
|
37
|
-
<details class="panel dashboard-section" id="account-authorization">
|
|
38
|
-
<summary class="panel-heading"><h2 data-i18n>ACCOUNT AUTHORIZATION</h2><span data-i18n>BY PROVIDER</span></summary>
|
|
39
|
-
<p class="hint" data-i18n>Saved credentials, authorization, model access and client requests are separate evidence.</p>
|
|
40
|
-
<div class="table-wrap"><table><thead><tr><th data-i18n>Source</th><th data-i18n>ACCOUNT</th><th data-i18n>AUTHORIZATION</th><th data-i18n>SERVICE</th><th data-i18n>LAST VERIFIED</th><th>TTL</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
|
|
41
|
-
</details>
|
|
42
46
|
|
|
47
|
+
<div data-view="overview">
|
|
48
|
+
<section class="overview" aria-label="Overview" data-i18n-label><article class="card"><h2 data-i18n>ADAPTER</h2><strong id="version">—</strong><p id="uptime">—</p></article><article class="card"><h2 data-i18n>SOURCES</h2><strong id="source-summary">—</strong><p id="source-detail">—</p></article></section>
|
|
43
49
|
<details class="panel dashboard-section" id="client-features" open>
|
|
44
|
-
<summary class="panel-heading"><h2 data-i18n>CLIENT CONNECTIONS</h2><span data-i18n>
|
|
50
|
+
<summary class="panel-heading"><h2 data-i18n>CLIENT CONNECTIONS</h2><span data-i18n>CONFIGURATION + OBSERVATION</span></summary>
|
|
45
51
|
<div class="table-wrap"><table><thead><tr><th data-i18n>Source</th><th data-i18n>CLIENT</th><th data-i18n>STATE</th><th data-i18n>GATEWAY</th><th data-i18n>LAST REQUEST</th></tr></thead><tbody id="provider-clients"></tbody></table></div>
|
|
46
52
|
<div id="provider-requests" class="hint"></div>
|
|
47
|
-
|
|
53
|
+
</details>
|
|
54
|
+
<section class="panel dashboard-section"><h2 data-i18n>THIS RUN USAGE</h2><p id="runtime-usage" class="table-note"></p><p class="hint" data-i18n>Updated from returned usage, not a live bill. Pending usage is not included.</p></section>
|
|
55
|
+
</div>
|
|
56
|
+
<div data-view="codex" hidden>
|
|
57
|
+
<section class="overview client-overview"><article class="card"><h2 data-i18n>CODEX MODELS</h2><strong id="models">—</strong><p id="model-source">—</p></article></section>
|
|
58
|
+
<details class="panel dashboard-section" id="runtime-resources" open>
|
|
59
|
+
<summary data-i18n>CODEX CONVERSATIONS</summary>
|
|
60
|
+
<div class="details"><article class="panel">
|
|
61
|
+
<div class="panel-heading"><h2 data-i18n>MODEL OUTCOMES</h2><span>RESPONSES</span></div>
|
|
62
|
+
<dl class="stats"><div><dt data-i18n>Completed</dt><dd id="completed">—</dd></div><div><dt data-i18n>Incomplete</dt><dd id="incomplete">—</dd></div><div><dt data-i18n>Failed</dt><dd id="failed">—</dd></div><div><dt data-i18n>Cancelled</dt><dd id="cancelled">—</dd></div></dl>
|
|
63
|
+
<p class="hint" data-i18n>HTTP 2xx != model completed.</p>
|
|
64
|
+
<dl class="stats timing-stats"><div><dt data-i18n>First output</dt><dd id="ttft">—</dd></div><div><dt data-i18n>Output speed</dt><dd id="tpot">—</dd></div></dl>
|
|
65
|
+
<p class="hint" data-i18n>Codex Responses timing since startup. Output speed is estimated.</p>
|
|
66
|
+
</article><article class="panel">
|
|
67
|
+
<div class="panel-heading"><h2 data-i18n>CODEX CONVERSATION BUFFER</h2><span data-i18n>ACTIVE LIMIT</span></div>
|
|
68
|
+
<strong id="history">—</strong><progress id="history-meter" class="meter" max="100" value="0" aria-label="History cache usage" data-i18n-label></progress>
|
|
69
|
+
<p id="history-detail" class="hint">—</p>
|
|
70
|
+
</article></div>
|
|
71
|
+
<p class="hint" data-i18n>Temporary local data for Responses continuation, not a conversation archive.</p>
|
|
72
|
+
<div class="section-actions"><label><span data-i18n>Buffer limit MiB</span> <input id="history-limit" type="number" min="1" max="65536" step="1"></label><button id="save-history" type="button" data-i18n>Apply limit</button><button id="clean-history" type="button" data-i18n>Clear inactive buffer</button></div>
|
|
73
|
+
<p id="effect-history" class="hint" role="status"></p>
|
|
74
|
+
</details>
|
|
75
|
+
<details class="panel dashboard-section" id="prediction-settings" open>
|
|
76
|
+
<summary class="panel-heading"><h2 data-i18n>CODEX INPUT PREDICTIONS</h2><span data-i18n>CODEX ONLY</span></summary>
|
|
77
|
+
<dl class="stats"><div><dt data-i18n>Prediction integration setup</dt><dd id="prediction-preference">—</dd></div><div><dt data-i18n>Local bridge</dt><dd id="prediction-bridge">—</dd></div><div><dt data-i18n>Client route</dt><dd id="prediction-route">—</dd></div><div><dt data-i18n>Visible candidate</dt><dd id="prediction-candidate">—</dd></div></dl>
|
|
48
78
|
<p id="prediction-note" class="hint">—</p>
|
|
49
79
|
<p class="hint" data-i18n>Configured does not mean displayed. Use ccdx prediction status for details.</p>
|
|
80
|
+
<div class="setting-row"><label for="setting-prediction_enabled" data-i18n>Allow prediction configuration</label><input id="setting-prediction_enabled" type="checkbox" role="switch" disabled><span id="effect-prediction_enabled" class="hint" role="status"></span></div>
|
|
81
|
+
<div class="section-actions"><button id="fix-prediction" type="button" data-i18n>Check and repair</button></div>
|
|
82
|
+
<p class="hint" data-i18n>Pause keeps the existing trust and route. Codex may retain cached suggestions. First-time setup: quit Codex, then ccdx prediction on.</p>
|
|
50
83
|
</details>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
<details class="panel dashboard-section" id="additional-capabilities">
|
|
85
|
+
<summary data-i18n>CODEX IMAGE GENERATION</summary>
|
|
86
|
+
<article class="panel">
|
|
87
|
+
<div class="panel-heading"><h2 data-i18n>Image service</h2><span data-i18n>CODEX ONLY</span></div>
|
|
88
|
+
<strong id="image">—</strong><p id="image-detail" class="hint">—</p>
|
|
89
|
+
</article>
|
|
90
|
+
<div class="setting-row"><label for="setting-image_enabled" data-i18n>Allow new image calls</label><input id="setting-image_enabled" type="checkbox" role="switch" disabled><span id="effect-image_enabled" class="hint" role="status"></span></div>
|
|
91
|
+
<p class="hint" data-i18n>Pause keeps the provider configuration. Running calls can finish. First-time setup: ccdx enable-image.</p>
|
|
92
|
+
</details>
|
|
93
|
+
</div>
|
|
94
|
+
<div data-view="claude" hidden>
|
|
95
|
+
<section class="panel dashboard-section" aria-labelledby="claude-heading">
|
|
96
|
+
<div class="panel-heading"><h2 id="claude-heading">Claude App / Claude Code</h2><span>ANTHROPIC MESSAGES</span></div>
|
|
97
|
+
<p id="claude-route" class="table-note"></p>
|
|
98
|
+
<p id="claude-client-state" class="hint"></p>
|
|
99
|
+
<dl class="stats"><div><dt data-i18n>Completed</dt><dd id="claude-completed">—</dd></div><div><dt data-i18n>Incomplete</dt><dd id="claude-incomplete">—</dd></div><div><dt data-i18n>Failed</dt><dd id="claude-failed">—</dd></div><div><dt data-i18n>Cancelled</dt><dd id="claude-cancelled">—</dd></div><div><dt data-i18n>First output</dt><dd id="claude-ttft">—</dd></div><div><dt data-i18n>Output speed</dt><dd id="claude-speed">—</dd></div></dl>
|
|
100
|
+
<p class="hint" data-i18n>Since this service started. Configuration, authorization, model discovery and successful inference are separate evidence.</p>
|
|
101
|
+
</section>
|
|
102
|
+
</div>
|
|
103
|
+
<div data-view="models" hidden>
|
|
104
|
+
<details class="panel dashboard-section" id="account-authorization">
|
|
105
|
+
<summary class="panel-heading"><h2 data-i18n>ACCOUNT AUTHORIZATION</h2><span data-i18n>BY PROVIDER</span></summary>
|
|
106
|
+
<p class="hint" data-i18n>Saved credentials, authorization, model access and client requests are separate evidence.</p>
|
|
107
|
+
<div class="table-wrap"><table><thead><tr><th data-i18n>Source</th><th data-i18n>ACCOUNT</th><th data-i18n>AUTHORIZATION</th><th data-i18n>SERVICE</th><th data-i18n>LAST VERIFIED</th><th>TTL</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
|
|
57
108
|
</details>
|
|
58
|
-
|
|
59
109
|
<details class="panel dashboard-section" id="upstream-models" open>
|
|
60
110
|
<summary class="panel-heading"><h2 data-i18n>MODEL CATALOG</h2><span id="models-state" data-i18n>CHECKING LIVE</span></summary>
|
|
61
111
|
<div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label></div>
|
|
@@ -64,7 +114,15 @@
|
|
|
64
114
|
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n>MODEL</th><th scope="col" data-i18n>VENDOR</th><th scope="col" data-i18n>API</th><th scope="col" data-i18n>CLIENT</th><th scope="col" data-i18n>REASONING</th><th scope="col" data-i18n>STATE</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="6" data-i18n>Loading…</td></tr></tbody></table></div>
|
|
65
115
|
<p class="hint" data-i18n>Catalog listing does not guarantee inference access.</p>
|
|
66
116
|
</details>
|
|
67
|
-
|
|
117
|
+
<section class="panel dashboard-section" aria-labelledby="routing-heading">
|
|
118
|
+
<h2 id="routing-heading" data-i18n>CODEX MODEL SOURCE</h2>
|
|
119
|
+
<p class="hint" data-i18n>Catalog tabs only change the view. Apply explicitly to change the source for future Codex requests.</p>
|
|
120
|
+
<div class="section-actions"><label><span data-i18n>Source</span> <select id="source-provider"><option value="github">GitHub Copilot</option><option value="m365">Microsoft 365</option></select></label><label><span data-i18n>Model</span> <select id="source-model" disabled></select></label><label><span data-i18n>Auto-review model</span> <select id="source-review" disabled></select></label><button id="apply-source" type="button" data-i18n>Apply source</button></div>
|
|
121
|
+
<div class="section-actions"><span>Microsoft 365</span><button id="m365-on" type="button" data-i18n>Enable service</button><button id="m365-off" type="button" data-i18n>Disable service</button></div>
|
|
122
|
+
<p id="source-control-note" class="hint" role="status"></p>
|
|
123
|
+
</section>
|
|
124
|
+
</div>
|
|
125
|
+
<div data-view="usage" hidden>
|
|
68
126
|
<details class="panel dashboard-section" id="model-usage" open>
|
|
69
127
|
<summary class="panel-heading"><h2 data-i18n>USAGE</h2><span id="usage-state" data-i18n>READING LOG</span></summary>
|
|
70
128
|
<div class="section-actions"><label><span data-i18n>Source</span> <select id="usage-provider"><option value="" data-i18n>All providers</option></select></label><button id="clear-usage-day" type="button" hidden data-i18n>All history</button><button id="refresh-usage" type="button" data-i18n>Refresh</button></div>
|
|
@@ -89,43 +147,35 @@
|
|
|
89
147
|
<p id="analytics-selection" class="hint" role="status" data-i18n>Select a day to inspect its model totals. No history is distinct from zero recorded calls.</p>
|
|
90
148
|
</details>
|
|
91
149
|
</details>
|
|
92
|
-
|
|
93
150
|
<details class="lower" id="recent-failures" open>
|
|
94
|
-
<summary class="panel-heading"><h2 data-i18n>RECENT
|
|
151
|
+
<summary class="panel-heading"><h2 data-i18n>RECENT INFERENCE + HTTP FAILURES</h2><span id="failure-count">requests + events</span></summary>
|
|
95
152
|
<ol id="failures"><li class="empty" data-i18n>Reading…</li></ol>
|
|
96
153
|
<p class="hint" data-i18n>Upstream messages may contain sensitive text.</p>
|
|
97
154
|
</details>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
<div class="
|
|
102
|
-
|
|
103
|
-
<dl class="stats"><div><dt data-i18n>Completed</dt><dd id="completed">—</dd></div><div><dt data-i18n>Incomplete</dt><dd id="incomplete">—</dd></div><div><dt data-i18n>Failed</dt><dd id="failed">—</dd></div><div><dt data-i18n>Cancelled</dt><dd id="cancelled">—</dd></div></dl>
|
|
104
|
-
<p class="hint" data-i18n>HTTP 2xx != model completed.</p>
|
|
105
|
-
<dl class="stats timing-stats"><div><dt data-i18n>First output</dt><dd id="ttft">—</dd></div><div><dt data-i18n>Output speed</dt><dd id="tpot">—</dd></div></dl>
|
|
106
|
-
<p class="hint" data-i18n>Gateway timing. Output speed is estimated.</p>
|
|
107
|
-
</article><article class="panel">
|
|
108
|
-
<div class="panel-heading"><h2 data-i18n>LOCAL HISTORY</h2><span data-i18n>ACTIVE LIMIT</span></div>
|
|
109
|
-
<strong id="history">—</strong><progress id="history-meter" class="meter" max="100" value="0" aria-label="History cache usage" data-i18n-label></progress>
|
|
110
|
-
<p id="history-detail" class="hint">—</p>
|
|
111
|
-
</article></div>
|
|
112
|
-
</details>
|
|
113
|
-
|
|
114
|
-
<details class="panel dashboard-section" id="additional-capabilities">
|
|
115
|
-
<summary data-i18n>ADDITIONAL CAPABILITIES</summary>
|
|
116
|
-
<article class="panel">
|
|
117
|
-
<div class="panel-heading"><h2 data-i18n>IMAGE GENERATION</h2><span data-i18n>OPTIONAL</span></div>
|
|
118
|
-
<strong id="image">—</strong><p id="image-detail" class="hint">—</p>
|
|
119
|
-
</article>
|
|
155
|
+
<details class="panel dashboard-section" id="request-context">
|
|
156
|
+
<summary data-i18n>RECENT REQUEST CONTEXT</summary>
|
|
157
|
+
<p id="context-note" class="table-note">—</p>
|
|
158
|
+
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n>MODEL</th><th scope="col" data-i18n>WIRE MiB</th><th scope="col" data-i18n>IMAGES</th><th scope="col" data-i18n>INPUT TOKENS</th><th scope="col" data-i18n>MODEL WINDOW</th><th scope="col" data-i18n>INPUT / WINDOW</th><th scope="col" data-i18n>OUTCOME</th></tr></thead><tbody id="context-body"><tr><td colspan="7" data-i18n>No observed request metadata.</td></tr></tbody></table></div>
|
|
159
|
+
<p class="hint" data-i18n>Recent upstream request metadata, not exact live session occupancy. Missing values are unknown. No prompt or image content is retained.</p>
|
|
120
160
|
</details>
|
|
121
|
-
|
|
161
|
+
</div>
|
|
162
|
+
<div data-view="system" hidden>
|
|
163
|
+
<section class="panel dashboard-section"><h2 data-i18n>PROCESS + LISTENER</h2><p id="process-state" class="table-note"></p><p id="process-memory" class="hint"></p><p id="process-queues" class="hint"></p><p id="process-notice" class="hint" role="status"></p></section>
|
|
164
|
+
<section class="overview client-overview"><article class="card"><h2 data-i18n>HTTP TRAFFIC</h2><strong id="requests">—</strong><p id="request-errors">—</p><p id="http-error-breakdown">—</p><p><span data-i18n>Per-request limits (active)</span><br><span id="body-limits">—</span></p></article></section>
|
|
165
|
+
<section class="panel dashboard-section" aria-labelledby="settings-heading">
|
|
166
|
+
<h2 id="settings-heading" data-i18n>SERVICE SETTINGS</h2>
|
|
167
|
+
<p class="hint" data-i18n>Saved preference and effective state are separate. Environment overrides and client restarts are shown explicitly.</p>
|
|
168
|
+
<div class="setting-row"><label for="setting-terminal_animation_enabled" data-i18n>Terminal animation</label><input id="setting-terminal_animation_enabled" type="checkbox" role="switch" disabled><span id="effect-terminal_animation_enabled" class="hint" role="status"></span></div>
|
|
169
|
+
<div class="setting-row"><label for="setting-open_webui" data-i18n>Open WebUI at startup</label><input id="setting-open_webui" type="checkbox" role="switch" disabled><span id="effect-open_webui" class="hint" role="status"></span></div>
|
|
170
|
+
<p id="settings-note" class="hint" role="status" data-i18n>Reading settings…</p>
|
|
171
|
+
</section>
|
|
122
172
|
<details id="animation-settings" class="panel dashboard-section settings-panel">
|
|
123
173
|
<summary class="panel-heading"><h2 data-i18n>TERMINAL ANIMATION</h2><span id="animation-state" data-i18n>READING</span></summary>
|
|
124
174
|
<div id="animation-options" class="animation-options" role="group" aria-label="Animation theme" data-i18n-label></div>
|
|
125
|
-
<div class="section-actions"><button id="save-animation" type="button" disabled data-i18n>Save selection</button><span id="animation-note" role="status" data-i18n>Applies
|
|
175
|
+
<div class="section-actions"><button id="save-animation" type="button" disabled data-i18n>Save selection</button><span id="animation-note" role="status" data-i18n>Applies to the running terminal.</span></div>
|
|
126
176
|
</details>
|
|
177
|
+
</div>
|
|
127
178
|
</main>
|
|
128
|
-
|
|
129
179
|
<footer data-i18n>LOCAL ONLY / VISIBLE PAGE UPDATES</footer>
|
|
130
180
|
</div>
|
|
131
181
|
</body>
|
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const translations = {
|
|
3
|
+
"Codex body admission: active {active} / queued {queued} / queue limit {limit}": ["Codex body admission: active {active} / queued {queued} / queue limit {limit}", "Codex请求体:进行中{active}\n排队{queued} / 队列上限{limit}"],
|
|
4
|
+
"Terminal animation unavailable in this output mode": ["Terminal animation unavailable in this output mode", "当前输出模式不播放终端动效"],
|
|
5
|
+
"Prediction integration setup": ["Prediction integration setup", "预测集成配置"],
|
|
6
|
+
"Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open.": ["Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open.", "可见状态每2秒更新。\n目录和留存用量按需更新,\n展开时每30分钟刷新。"],
|
|
7
|
+
"Clients": ["Clients", "客户端"],
|
|
8
|
+
"Model services": ["Model services", "模型服务"],
|
|
9
|
+
"Usage and diagnostics": ["Usage and diagnostics", "用量与诊断"],
|
|
10
|
+
"System and settings": ["System and settings", "系统与设置"],
|
|
11
|
+
"Main navigation": ["Main navigation", "主导航"],
|
|
12
|
+
"LOCAL CONTROL": ["LOCAL CONTROL", "本机控制台"],
|
|
13
|
+
"Terminal appearance": ["Terminal appearance", "终端外观"],
|
|
14
|
+
"Local service. Client-specific capabilities stay with their client.": ["Local service. Client-specific capabilities stay with their client.", "本机服务;专属能力归属各自客户端。"],
|
|
15
|
+
"CONFIGURATION + OBSERVATION": ["CONFIGURATION + OBSERVATION", "配置与观察"],
|
|
16
|
+
"CODEX CONVERSATIONS": ["CODEX CONVERSATIONS", "Codex 对话与暂存"],
|
|
17
|
+
"CODEX CONVERSATION BUFFER": ["CODEX CONVERSATION BUFFER", "Codex 对话暂存"],
|
|
18
|
+
"CODEX INPUT PREDICTIONS": ["CODEX INPUT PREDICTIONS", "Codex 输入预测"],
|
|
19
|
+
"CODEX ONLY": ["CODEX ONLY", "Codex 专属"],
|
|
20
|
+
"CODEX IMAGE GENERATION": ["CODEX IMAGE GENERATION", "Codex 图片生成"],
|
|
21
|
+
"Image service": ["Image service", "生图服务"],
|
|
22
|
+
"Allow new image calls": ["Allow new image calls", "允许新的生图调用"],
|
|
23
|
+
"Allow prediction configuration": ["Allow prediction configuration", "允许预测配置适配"],
|
|
24
|
+
"Check and repair": ["Check and repair", "检查并修复"],
|
|
25
|
+
"Temporary local data for Responses continuation, not a conversation archive.": ["Temporary local data for Responses continuation, not a conversation archive.", "用于 Responses 对话续接的本机\n临时数据,并非聊天归档。"],
|
|
26
|
+
"Buffer limit MiB": ["Buffer limit MiB", "暂存上限 MiB"],
|
|
27
|
+
"Apply limit": ["Apply limit", "应用上限"],
|
|
28
|
+
"Clear inactive buffer": ["Clear inactive buffer", "清理未使用暂存"],
|
|
29
|
+
"Pause keeps the provider configuration. Running calls can finish. First-time setup: ccdx enable-image.": ["Pause keeps the provider configuration. Running calls can finish. First-time setup: ccdx enable-image.", "暂停保留 Provider 配置,进行中\n的调用可以完成。首次配置:ccdx\nenable-image。"],
|
|
30
|
+
"Pause keeps the existing trust and route. Codex may retain cached suggestions. First-time setup: quit Codex, then ccdx prediction on.": ["Pause keeps the existing trust and route. Codex may retain cached suggestions. First-time setup: quit Codex, then ccdx prediction on.", "暂停保留已有信任和路由,Codex 可能\n保留已缓存的建议。首次配置:退出\nCodex 后执行 ccdx\nprediction on。"],
|
|
31
|
+
"SERVICE SETTINGS": ["SERVICE SETTINGS", "服务设置"],
|
|
32
|
+
"Saved preference and effective state are separate. Environment overrides and client restarts are shown explicitly.": ["Saved preference and effective state are separate. Environment overrides and client restarts are shown explicitly.", "保存的偏好与实际生效状态分别显示;环境覆\n盖和客户端重启要求会明确标注。"],
|
|
33
|
+
"Terminal animation": ["Terminal animation", "终端动效"],
|
|
34
|
+
"Open WebUI at startup": ["Open WebUI at startup", "启动时打开 WebUI"],
|
|
35
|
+
"Reading settings…": ["Reading settings…", "正在读取设置…"],
|
|
36
|
+
"CODEX MODEL SOURCE": ["CODEX MODEL SOURCE", "Codex 模型来源"],
|
|
37
|
+
"Catalog tabs only change the view. Apply explicitly to change the source for future Codex requests.": ["Catalog tabs only change the view. Apply explicitly to change the source for future Codex requests.", "目录标签仅切换查看对象。点击应用才会改变\n后续 Codex 请求的来源。"],
|
|
38
|
+
"Auto-review model": ["Auto-review model", "自动审查模型"],
|
|
39
|
+
"Apply source": ["Apply source", "应用来源"],
|
|
40
|
+
"Enable service": ["Enable service", "启用服务"],
|
|
41
|
+
"Disable service": ["Disable service", "停用服务"],
|
|
42
|
+
"Since this service started. Configuration, authorization, model discovery and successful inference are separate evidence.": ["Since this service started. Configuration, authorization, model discovery and successful inference are separate evidence.", "自本次服务启动起统计。配置、授权、模型发\n现和成功推理是不同证据。"],
|
|
43
|
+
"PROCESS + LISTENER": ["PROCESS + LISTENER", "进程与监听器"],
|
|
44
|
+
"HTTP TRAFFIC": ["HTTP TRAFFIC", "主入口 HTTP 流量"],
|
|
45
|
+
"THIS RUN USAGE": ["THIS RUN USAGE", "本次运行用量"],
|
|
46
|
+
"Updated from returned usage, not a live bill. Pending usage is not included.": ["Updated from returned usage, not a live bill. Pending usage is not included.", "根据已返回的用量更新,不代表实时账单;尚\n未返回的用量不计入。"],
|
|
47
|
+
"Applies to the running terminal.": ["Applies to the running terminal.", "应用到运行中的终端。"],
|
|
48
|
+
"RECENT INFERENCE + HTTP FAILURES": ["RECENT INFERENCE + HTTP FAILURES", "近期推理与 HTTP 故障"],
|
|
49
|
+
"Codex Responses timing since startup. Output speed is estimated.": ["Codex Responses timing since startup. Output speed is estimated.", "自启动起的 Codex\nResponses 时序;输出速度为估计\n值。"],
|
|
50
|
+
"SERVICE REACHABLE": ["SERVICE REACHABLE", "服务可访问"],
|
|
51
|
+
"Saved choice applies to the running terminal.": ["Saved choice applies to the running terminal.", "保存后应用到运行中的终端。"],
|
|
52
|
+
"Effective now": ["Effective now", "即时生效"],
|
|
53
|
+
"Next CCDX start": ["Next CCDX start", "下次启动 CCDX 生效"],
|
|
54
|
+
"Applies to new calls": ["Applies to new calls", "对后续调用生效"],
|
|
55
|
+
"Setup required": ["Setup required", "需要先配置"],
|
|
56
|
+
"Next configuration request; cached suggestions may remain": ["Next configuration request; cached suggestions may remain", "对后续配置请求生效;已缓存建议可能仍存在"],
|
|
57
|
+
"Reopen the client to finish": ["Reopen the client to finish", "需要重新打开客户端"],
|
|
58
|
+
"Restart CCDX to finish": ["Restart CCDX to finish", "需要重启 CCDX"],
|
|
59
|
+
"Saved {saved} / effective {effective} / {state}": ["Saved {saved} / effective {effective} / {state}", "保存:{saved} / 实际:{effective} / {state}"],
|
|
60
|
+
"On": ["On", "开启"],
|
|
61
|
+
"Off": ["Off", "关闭"],
|
|
62
|
+
"Controlled by environment": ["Controlled by environment", "由环境变量控制"],
|
|
63
|
+
"Settings read from the running service.": ["Settings read from the running service.", "已读取运行中服务的设置。"],
|
|
64
|
+
"Applying…": ["Applying…", "正在应用…"],
|
|
65
|
+
"Clear inactive Codex conversation data? Older continuation IDs may stop working.": ["Clear inactive Codex conversation data? Older continuation IDs may stop working.", "清理未使用的 Codex 对话暂存?旧的\n续接 ID 可能失效。"],
|
|
66
|
+
"{records} usage records / input {input} / cache read {cached} / output {output}{partial}": ["{records} usage records / input {input} / cache read {cached} / output {output}{partial}", "{records} 条用量记录 / 输入 {input} / 缓存读取 {cached}\n / 输出 {output}{partial}"],
|
|
67
|
+
"RSS {rss} / heap {heap}": ["RSS {rss} / heap {heap}", "常驻内存 {rss} / 堆内存 {heap}"],
|
|
3
68
|
"CODEX MODELS": ["CODEX MODELS", "Codex 模型"],
|
|
4
69
|
"CODEX REQUESTS": ["CODEX REQUESTS", "Codex 请求"],
|
|
5
70
|
"{state} / {reason}": ["{state} / {reason}", "{state} / {reason}"],
|
package/src/dashboard/status.js
CHANGED
|
@@ -29,14 +29,15 @@
|
|
|
29
29
|
}
|
|
30
30
|
if (provider.requests) {
|
|
31
31
|
const item = document.createElement("p");
|
|
32
|
-
localize(item, "{provider}: {done} done / {incomplete} incomplete / {failed} failed", { provider: provider.name
|
|
32
|
+
localize(item, "{provider}: {done} done / {incomplete} incomplete / {failed} failed", { provider: `${provider.name} · ${provider.request_scope || "Claude Messages"}`,
|
|
33
33
|
done: number(provider.requests.completed), incomplete: number(provider.requests.incomplete), failed: number(provider.requests.failed) });
|
|
34
34
|
requests.append(item);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
text("source-summary", "{count} providers", { count: providers.filter(provider => provider.enabled).length });
|
|
38
38
|
element("source-detail").textContent = routes.join(" / ") || "—";
|
|
39
|
-
element("auth-account").textContent =
|
|
39
|
+
element("auth-account").textContent = providers.flatMap(provider => (provider.clients || [])
|
|
40
|
+
.filter(client => client.selected).map(client => `${client.name} → ${provider.name}`)).join(" / ") || "—";
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
function duration(value) {
|
|
@@ -174,12 +175,33 @@
|
|
|
174
175
|
? "active {active} / failed {failed} / delivery failures {delivery}"
|
|
175
176
|
: "Setup state unknown / ccdx image-status", { active: number(image?.active), failed: number(image?.failed), delivery: number(image?.delivery_failures) });
|
|
176
177
|
|
|
178
|
+
const claude = data.providers?.m365?.claude, claudeMetrics = claude?.requests?.performance;
|
|
179
|
+
const recentRequests = [...(data.stream_performance?.recent_requests || []), ...(claudeMetrics?.recent_requests || [])]
|
|
180
|
+
.sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0));
|
|
177
181
|
renderFailures([...(data.response_failures?.recent || []), ...(data.http_errors?.actionable_recent || data.http_errors?.recent || [])]
|
|
178
|
-
.sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0)),
|
|
179
|
-
renderContext(data.stream_performance);
|
|
182
|
+
.sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0)), recentRequests);
|
|
183
|
+
renderContext({ ...data.stream_performance, recent_requests: recentRequests });
|
|
184
|
+
if (element("claude-route")) {
|
|
185
|
+
element("claude-route").textContent = claude?.base_url || "—";
|
|
186
|
+
element("claude-client-state").textContent = Object.entries(claude?.clients || {}).map(([key, value]) => `${key}: ${value}`).join(" / ") || "—";
|
|
187
|
+
const totals = claudeMetrics?.by_route?.messages?.terminal_outcomes?.totals || claude?.requests || {};
|
|
188
|
+
for (const key of ["completed", "incomplete", "failed", "cancelled"]) text(`claude-${key}`, totals[key] === undefined ? "—" : number(totals[key]));
|
|
189
|
+
for (const [id, metric, unit] of [["claude-ttft", claudeMetrics?.by_route?.messages?.ttft_ms, "ms"], ["claude-speed", claudeMetrics?.by_route?.messages?.output_tokens_per_second, "token/s"]]) {
|
|
190
|
+
text(id, metric?.samples > 0 ? `${Number(metric.avg).toFixed(1)} ${unit} / ${metric.samples}` : "—");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (element("runtime-usage")) {
|
|
194
|
+
const usage = data.runtime_usage;
|
|
195
|
+
text("runtime-usage", usage ? "{records} usage records / input {input} / cache read {cached} / output {output}{partial}" : "—",
|
|
196
|
+
usage ? { records: number(usage.records), input: number(usage.input_tokens), cached: number(usage.cached_input_tokens), output: number(usage.output_tokens), partial: usage.partial_records ? " ~" : "" } : {});
|
|
197
|
+
element("process-state").textContent = `PID ${data.pid || "—"} / ${globalThis.location?.origin || ""}`;
|
|
198
|
+
text("process-memory", "RSS {rss} / heap {heap}", { rss: mib(data.process?.rss_bytes), heap: mib(data.process?.heap_used_bytes) });
|
|
199
|
+
text("process-queues", "Codex body admission: active {active} / queued {queued} / queue limit {limit}", {
|
|
200
|
+
active: number(data.admission?.activeRequests), queued: number(data.admission?.queued), limit: number(data.admission?.maxQueued) });
|
|
201
|
+
}
|
|
180
202
|
if (element("prediction-preference")) {
|
|
181
203
|
const prediction = data.client_integrations?.prediction;
|
|
182
|
-
text("prediction-preference", prediction ? prediction.configured ? "
|
|
204
|
+
text("prediction-preference", prediction ? prediction.configured ? "Configured" : "Not configured" : "Unknown");
|
|
183
205
|
text("prediction-bridge", ({ running: "Running", recovering: "Recovering", stopped: "Stopped", unavailable: "Unavailable" })[prediction?.bridge] || "Unknown");
|
|
184
206
|
text("prediction-route", prediction?.client_route === "observed" ? "Observed" : "Unknown");
|
|
185
207
|
text("prediction-candidate", "Unknown");
|
package/src/dashboard/ui.css
CHANGED
|
@@ -24,7 +24,7 @@ button:disabled { opacity: .55; cursor: wait; }
|
|
|
24
24
|
:root[data-theme="light"] .icon-moon { display: block; }
|
|
25
25
|
.intro { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 38px 0 25px; }
|
|
26
26
|
h1 { margin: 0; font-size: clamp(20px, 3vw, 27px); font-weight: 650; letter-spacing: -.035em; }
|
|
27
|
-
.status-icon { display:
|
|
27
|
+
.status-icon { display: block; grid-row: 1 / 3; width: 44px; height: 44px; color: var(--accent); }
|
|
28
28
|
.intro p { margin: 0; color: var(--subtle); font-size: 11px; }
|
|
29
29
|
.snapshot-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 8px 18px; min-width: 0; }
|
|
30
30
|
.intro .snapshot-meta p { margin: 0; overflow-wrap: anywhere; }
|
|
@@ -146,3 +146,46 @@ footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color:
|
|
|
146
146
|
#provider-auth td, #provider-clients td { overflow-wrap: anywhere; }
|
|
147
147
|
.details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
148
148
|
@media (max-width: 700px) { .details { grid-template-columns: 1fr; } }
|
|
149
|
+
|
|
150
|
+
/* Each view has one scope. The sidebar stays separate from business data. */
|
|
151
|
+
[hidden] { display: none !important; }
|
|
152
|
+
.shell { max-width: 1520px; display: grid; grid-template-columns: 204px minmax(0, 1fr); column-gap: 34px; padding: 0 28px; }
|
|
153
|
+
.sidebar { grid-row: 1 / 4; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 22px 24px 0; border-right: 1px solid var(--border); }
|
|
154
|
+
.sidebar-brand { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; column-gap: 12px; color: var(--accent); text-decoration: none; font-size: 23px; font-weight: 750; letter-spacing: .04em; }
|
|
155
|
+
.sidebar-brand .brand-caption { display: block; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .1em; margin-top: 8px; }
|
|
156
|
+
.sidebar nav { display: flex; flex-direction: column; gap: 5px; margin-top: 36px; }
|
|
157
|
+
.sidebar nav a { color: var(--muted); text-decoration: none; padding: 11px 12px; font-size: 13px; border-left: 2px solid transparent; }
|
|
158
|
+
.sidebar nav a:hover { background: var(--option-hover); color: var(--text); }
|
|
159
|
+
.sidebar nav a[aria-current="page"] { color: var(--accent); background: var(--selected-bg); border-left-color: var(--accent); }
|
|
160
|
+
.sidebar nav a:focus-visible, .sidebar-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
|
161
|
+
.nav-group { color: var(--subtle); font-size: 10px; padding: 18px 12px 4px; text-transform: uppercase; letter-spacing: .08em; }
|
|
162
|
+
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
|
|
163
|
+
.sidebar-bottom button { width: 100%; text-align: left; }
|
|
164
|
+
.sidebar-bottom p { color: var(--subtle); font-size: 11px; line-height: 1.7; }
|
|
165
|
+
.topbar, main, footer { grid-column: 2; min-width: 0; }
|
|
166
|
+
.topbar { min-height: 76px; gap: 14px; }
|
|
167
|
+
.brand { font-size: 12px; }
|
|
168
|
+
.topbar-actions { gap: 12px; }
|
|
169
|
+
.intro { display: block; padding: 32px 0 26px; }
|
|
170
|
+
.snapshot-meta { justify-content: flex-start; margin-top: 14px; line-height: 1.7; }
|
|
171
|
+
.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
172
|
+
.client-overview { grid-template-columns: 1fr; }
|
|
173
|
+
.card { min-height: 130px; }
|
|
174
|
+
.panel, .lower { padding: 22px; }
|
|
175
|
+
.panel h2, .lower h2, .panel > summary { font-size: 12px; letter-spacing: .045em; }
|
|
176
|
+
.hint, .table-note, td, th, .stats dt { font-size: 12px; line-height: 1.7; }
|
|
177
|
+
.section-actions { flex-wrap: wrap; align-items: end; }
|
|
178
|
+
.section-actions label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; max-width: 100%; }
|
|
179
|
+
.section-actions input, .section-actions select { max-width: 100%; min-height: 36px; }
|
|
180
|
+
input[type="number"] { width: 120px; font: inherit; color: var(--text); background: var(--page); border: 1px solid var(--border); padding: 7px; }
|
|
181
|
+
.setting-row { display: grid; grid-template-columns: minmax(160px, 1fr) 44px minmax(0, 1.4fr); align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
|
|
182
|
+
.setting-row .hint { margin: 0; }
|
|
183
|
+
input[role="switch"] { appearance: none; width: 38px; height: 22px; border: 1px solid var(--button-border); border-radius: 20px; background: var(--border); cursor: pointer; margin: 0; position: relative; }
|
|
184
|
+
input[role="switch"]::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); }
|
|
185
|
+
input[role="switch"]:checked { background: var(--selected-bg); border-color: var(--accent); }
|
|
186
|
+
input[role="switch"]:checked::before { left: 19px; background: var(--accent); }
|
|
187
|
+
input[role="switch"]:focus-visible, input[type="number"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
|
|
188
|
+
input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
189
|
+
#process-queues { overflow-wrap: anywhere; font-size: 11px; }
|
|
190
|
+
@media (max-width: 900px) { .shell { grid-template-columns: 170px minmax(0, 1fr); column-gap: 20px; padding: 0 20px; } .topbar .brand { display: none; } .topbar { justify-content: flex-end; } .setting-row { grid-template-columns: minmax(0, 1fr) 44px; } .setting-row .hint { grid-column: 1 / -1; } .overview { grid-template-columns: 1fr; } }
|
|
191
|
+
@media (max-width: 640px) { .shell { display: block; padding: 0 16px; } .sidebar { position: static; height: auto; padding: 20px 0 14px; border-right: 0; border-bottom: 1px solid var(--border); } .sidebar-brand { font-size: 20px; width: fit-content; } .sidebar-brand .brand-caption { margin-top: 4px; } .sidebar nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-top: 16px; } .sidebar nav a { padding: 9px 10px; font-size: 12px; border-left: 0; border-bottom: 2px solid transparent; } .sidebar nav a[aria-current="page"] { border-bottom-color: var(--accent); } .nav-group, .sidebar-bottom { display: none; } .topbar { min-height: 62px; justify-content: flex-start; } .topbar-actions { justify-content: flex-start; gap: 9px; } .intro { padding: 24px 0 18px; } .panel, .lower { padding: 17px; } .section-actions > label { width: 100%; } .stats { gap: 12px; } }
|