codex-copilot-dx 1.2.7 → 1.2.9
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 +3 -3
- package/docs/ARCHITECTURE.md +15 -1
- package/docs/README.md +1 -0
- package/docs/REFERENCE.md +20 -15
- package/package.json +1 -1
- package/src/claude-gateway.mjs +2 -2
- package/src/dashboard/activity.js +27 -0
- package/src/dashboard/console.js +18 -7
- package/src/dashboard/index.html +80 -56
- package/src/dashboard/language.js +44 -3
- package/src/dashboard/status.js +49 -17
- package/src/dashboard/theme.js +3 -2
- package/src/dashboard/ui.css +78 -5
- package/src/dashboard/ui.js +16 -5
- package/src/dashboard.mjs +1 -0
- package/src/observability.mjs +7 -1
- package/src/optional-routes.mjs +1 -1
- package/src/stream-performance.mjs +7 -0
- package/src/terminal-colors.mjs +8 -3
- package/src/terminal-console.mjs +5 -3
- package/src/user-settings.mjs +2 -2
package/src/dashboard/index.html
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<script src="/refresh.js" defer></script>
|
|
12
12
|
<script src="/icons.js" defer></script>
|
|
13
13
|
<script src="/status.js" defer></script>
|
|
14
|
+
<script src="/activity.js" defer></script>
|
|
14
15
|
<script src="/usage.js" defer></script>
|
|
15
16
|
<script src="/updates.js" defer></script>
|
|
16
17
|
<script src="/ui.js" defer></script>
|
|
@@ -43,17 +44,20 @@
|
|
|
43
44
|
<main id="main-content" tabindex="-1">
|
|
44
45
|
<section class="intro">
|
|
45
46
|
<h1><span id="page-title" data-i18n="overview">Overview</span></h1>
|
|
46
|
-
<
|
|
47
|
+
<p id="page-description" class="page-description" data-i18n="page_overview_description">Service, app connections and usage this run.</p>
|
|
47
48
|
<p id="page-settings-note" class="hint" role="status"></p>
|
|
48
49
|
</section>
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
<div data-view="overview">
|
|
52
|
-
<
|
|
53
|
+
<div id="model-activity" class="model-activity" data-state="unknown" role="status" aria-label="Activity unknown" data-i18n-label="model_activity_unknown">
|
|
54
|
+
<span class="activity-lamp" aria-hidden="true"></span><span class="activity-dots" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span><span id="model-activity-label" class="activity-label" data-i18n="model_activity_unknown">Activity unknown</span>
|
|
55
|
+
</div>
|
|
56
|
+
<section class="overview" aria-label="Overview" data-i18n-label="overview"><article class="card"><h2 data-i18n="adapter">SERVICE</h2><strong id="version">—</strong><p id="uptime">—</p><p id="updated" class="refresh-time" data-i18n="reading_status">Reading status…</p></article><article class="card"><h2 data-i18n="sources">SOURCES</h2><strong id="source-summary">—</strong><p id="source-detail">—</p></article></section>
|
|
53
57
|
<details class="panel dashboard-section" id="client-features" open>
|
|
54
58
|
<summary class="panel-heading"><h2 data-i18n="client_connections">APP SETUP</h2><span data-i18n="configuration_observation">SETUP AND ACTIVITY</span></summary>
|
|
55
|
-
<div class="table-wrap"><table><thead><tr><th data-i18n="
|
|
56
|
-
<
|
|
59
|
+
<div class="table-wrap"><table><thead><tr><th data-i18n="client">APP</th><th data-i18n="current_source">Current source</th><th data-i18n="connection_setup">Setup</th><th data-i18n="local_bridge">Local service</th><th data-i18n="last_request">LAST REQUEST</th></tr></thead><tbody id="provider-clients"></tbody></table></div>
|
|
60
|
+
<p class="hint" data-i18n="configured_not_successful">Configured does not mean a request succeeded.</p>
|
|
57
61
|
</details>
|
|
58
62
|
<section class="panel dashboard-section"><h2 data-i18n="this_run_usage">THIS RUN</h2><p id="runtime-usage" class="table-note"></p><p class="table-note"><span data-i18n="approx_cache_hit_rate">Approx. cache hit rate</span>: <strong id="runtime-cache-hit" data-i18n-title="runtime_cache_hit_basis" title="Reused input / input tokens. ~ Partial counts. — Unknown or invalid.">—</strong></p><p class="hint" data-i18n="updated_from_returned_usage_not_a_live_bill_pending_usage_is_not">Counts returned usage only. Pending usage is not included. This is not a live bill.</p></section>
|
|
59
63
|
</div>
|
|
@@ -68,6 +72,8 @@
|
|
|
68
72
|
</div>
|
|
69
73
|
<p id="source-model-note" class="hint" data-i18n="github_model_in_codex">Choose your conversation model in Codex.</p>
|
|
70
74
|
<div id="source-control-note" class="hint" role="status"></div>
|
|
75
|
+
<p class="table-note model-summary"><span data-i18n="codex_models">CODEX MODELS</span>: <strong id="models">—</strong> · <span id="model-source">—</span></p>
|
|
76
|
+
<a class="section-link" href="#models" data-source-link="codex" data-i18n="view_model_list">View model list</a>
|
|
71
77
|
</section>
|
|
72
78
|
<section class="panel dashboard-section" aria-labelledby="review-heading">
|
|
73
79
|
<h2 id="review-heading" data-i18n="auto_review_settings">AUTO REVIEW</h2>
|
|
@@ -79,56 +85,68 @@
|
|
|
79
85
|
</div>
|
|
80
86
|
<p id="review-control-note" class="hint" role="status"></p>
|
|
81
87
|
</section>
|
|
82
|
-
<section class="overview client-overview"><article class="card"><h2 data-i18n="codex_models">CODEX MODELS</h2><strong id="models">—</strong><p id="model-source">—</p></article></section>
|
|
83
|
-
<details class="panel dashboard-section" id="runtime-resources" open>
|
|
84
|
-
<summary data-i18n="codex_conversations">CODEX CONVERSATIONS</summary>
|
|
85
|
-
<div class="details"><article class="panel">
|
|
86
|
-
<div class="panel-heading"><h2 data-i18n="model_outcomes">REQUEST RESULTS</h2><span>RESPONSES</span></div>
|
|
87
|
-
<dl class="stats"><div><dt data-i18n="completed">Completed</dt><dd id="completed">—</dd></div><div><dt data-i18n="incomplete">Incomplete</dt><dd id="incomplete">—</dd></div><div><dt data-i18n="failed">Failed</dt><dd id="failed">—</dd></div><div><dt data-i18n="cancelled">Cancelled</dt><dd id="cancelled">—</dd></div></dl>
|
|
88
|
-
<p class="hint" data-i18n="http_2xx_model_completed">HTTP success does not mean a complete reply.</p>
|
|
89
|
-
<dl class="stats timing-stats"><div><dt data-i18n="first_output">First output</dt><dd id="ttft">—</dd></div><div><dt data-i18n="output_speed">Output speed</dt><dd id="tpot">—</dd></div></dl>
|
|
90
|
-
<p class="hint" data-i18n="codex_responses_timing_since_startup_output_speed_is_estimated">Codex Responses timing since startup. Speed is estimated.</p>
|
|
91
|
-
</article><article class="panel">
|
|
92
|
-
<div class="panel-heading"><h2 data-i18n="codex_conversation_buffer">CONVERSATION BUFFER</h2><span data-i18n="active_limit">STORAGE LIMIT</span></div>
|
|
93
|
-
<strong id="history">—</strong><progress id="history-meter" class="meter" max="100" value="0" aria-label="Local history usage" data-i18n-label="history_cache_usage"></progress>
|
|
94
|
-
<p id="history-detail" class="hint">—</p>
|
|
95
|
-
</article></div>
|
|
96
|
-
<p class="hint" data-i18n="temporary_local_data_for_responses_continuation_not_a_conversati">Keeps temporary data to continue replies. Does not save a chat archive.</p>
|
|
97
|
-
<div class="section-actions"><label><span data-i18n="buffer_limit_mib">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">Save limit</button><button id="clean-history" type="button" data-i18n="clear_inactive_buffer">Clear conversation buffer</button></div>
|
|
98
|
-
<p id="effect-history" class="hint" role="status"></p>
|
|
99
|
-
</details>
|
|
100
88
|
<details class="panel dashboard-section" id="prediction-settings" open>
|
|
101
89
|
<summary class="panel-heading"><h2 data-i18n="codex_input_predictions">INPUT SUGGESTIONS</h2><span data-i18n="codex_only">CODEX ONLY</span></summary>
|
|
90
|
+
<div class="setting-row"><label for="setting-prediction_enabled" data-i18n="allow_prediction_configuration">Allow suggestion updates</label><input id="setting-prediction_enabled" type="checkbox" role="switch" disabled><span id="effect-prediction_enabled" class="hint" role="status"></span></div>
|
|
91
|
+
<details class="tool-details"><summary data-i18n="status_and_repair">Status and repair</summary>
|
|
102
92
|
<dl class="stats"><div><dt data-i18n="prediction_integration_setup">Suggestion setup</dt><dd id="prediction-preference">—</dd></div><div><dt data-i18n="local_bridge">Local service</dt><dd id="prediction-bridge">—</dd></div><div><dt data-i18n="client_route">App settings requests</dt><dd id="prediction-route">—</dd></div><div><dt data-i18n="visible_candidate">Suggestion displayed</dt><dd id="prediction-candidate">—</dd></div></dl>
|
|
103
93
|
<p id="prediction-note" class="hint">—</p>
|
|
104
94
|
<p class="hint" data-i18n="configured_does_not_mean_displayed_use_ccdx_prediction_status_fo">Enabled does not mean a suggestion appeared. Details: ccdx prediction status.</p>
|
|
105
|
-
|
|
95
|
+
|
|
106
96
|
<div class="section-actions"><button id="fix-prediction" type="button" data-i18n="check_and_repair">Check and repair</button></div>
|
|
107
97
|
<p class="hint" data-i18n="pause_keeps_the_existing_trust_and_route_codex_may_retain_cached">Pause keeps existing trust and routing. Cached suggestions may still appear. First quit Codex, then run ccdx prediction on.</p>
|
|
98
|
+
</details>
|
|
108
99
|
</details>
|
|
109
100
|
<details class="panel dashboard-section" id="additional-capabilities">
|
|
110
|
-
<summary data-i18n="codex_image_generation">IMAGE GENERATION</summary>
|
|
111
|
-
<
|
|
112
|
-
<div class="panel-heading"><h2 data-i18n="image_service">Image service</h2><span data-i18n="codex_only">CODEX ONLY</span></div>
|
|
113
|
-
<strong id="image">—</strong><p id="image-detail" class="hint">—</p>
|
|
114
|
-
</article>
|
|
101
|
+
<summary class="panel-heading"><h2 data-i18n="codex_image_generation">IMAGE GENERATION</h2><span data-i18n="codex_only">CODEX ONLY</span></summary>
|
|
102
|
+
<strong id="image">—</strong><p id="image-detail" class="hint">—</p>
|
|
115
103
|
<div class="setting-row"><label for="setting-image_enabled" data-i18n="allow_new_image_calls">Allow image requests</label><input id="setting-image_enabled" type="checkbox" role="switch" disabled><span id="effect-image_enabled" class="hint" role="status"></span></div>
|
|
116
104
|
<p class="hint" data-i18n="pause_keeps_the_provider_configuration_running_calls_can_finish_">Pause keeps your setup. Running image requests can finish. First setup: ccdx enable-image.</p>
|
|
117
105
|
</details>
|
|
106
|
+
<details class="panel dashboard-section" id="runtime-resources">
|
|
107
|
+
<summary data-i18n="codex_conversation_buffer">CONVERSATION BUFFER</summary>
|
|
108
|
+
<strong id="history">—</strong><progress id="history-meter" class="meter" max="100" value="0" aria-label="Local history usage" data-i18n-label="history_cache_usage"></progress>
|
|
109
|
+
<p id="history-detail" class="hint">—</p>
|
|
110
|
+
|
|
111
|
+
<p class="hint" data-i18n="temporary_local_data_for_responses_continuation_not_a_conversati">Keeps temporary data to continue replies. Does not save a chat archive.</p>
|
|
112
|
+
<div class="section-actions"><label><span data-i18n="buffer_limit_mib">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">Save limit</button><button id="clean-history" type="button" data-i18n="clear_inactive_buffer">Clear conversation buffer</button></div>
|
|
113
|
+
<p id="effect-history" class="hint" role="status"></p>
|
|
114
|
+
</details>
|
|
115
|
+
<details class="panel dashboard-section" id="codex-performance">
|
|
116
|
+
<summary data-i18n="request_performance">REQUEST PERFORMANCE</summary>
|
|
117
|
+
<dl class="stats"><div><dt data-i18n="completed">Completed</dt><dd id="completed">—</dd></div><div><dt data-i18n="incomplete">Incomplete</dt><dd id="incomplete">—</dd></div><div><dt data-i18n="failed">Failed</dt><dd id="failed">—</dd></div><div><dt data-i18n="cancelled">Cancelled</dt><dd id="cancelled">—</dd></div></dl>
|
|
118
|
+
<p class="hint" data-i18n="http_2xx_model_completed">HTTP success does not mean a complete reply.</p>
|
|
119
|
+
<dl class="stats timing-stats"><div><dt data-i18n="first_output">First output</dt><dd id="ttft">—</dd></div><div><dt data-i18n="output_speed">Output speed</dt><dd id="tpot">—</dd></div></dl>
|
|
120
|
+
<p class="hint" data-i18n="codex_responses_timing_since_startup_output_speed_is_estimated">Codex Responses timing since startup. Speed is estimated.</p>
|
|
121
|
+
<a class="section-link" href="#requests" data-i18n="view_request_details">View request details</a>
|
|
122
|
+
</details>
|
|
118
123
|
</div>
|
|
119
124
|
<div data-view="claude" hidden>
|
|
120
|
-
<section class="panel dashboard-section"
|
|
121
|
-
<
|
|
122
|
-
<
|
|
125
|
+
<section class="panel dashboard-section" id="claude-connections">
|
|
126
|
+
<h2 data-i18n="client_connections">APP SETUP</h2>
|
|
127
|
+
<div class="table-wrap"><table><thead><tr><th data-i18n="client">APP</th><th data-i18n="connection_setup">Setup</th><th data-i18n="local_bridge">Local service</th><th data-i18n="last_request">LAST REQUEST</th></tr></thead><tbody id="claude-clients"></tbody></table></div>
|
|
123
128
|
<p id="claude-client-state" class="hint"></p>
|
|
129
|
+
<p class="hint" data-i18n="local_service_not_app">Local service status does not confirm the app is open.</p>
|
|
130
|
+
</section>
|
|
131
|
+
<section class="panel dashboard-section">
|
|
132
|
+
<h2 data-i18n="source">Source</h2><p class="table-note">Microsoft 365</p>
|
|
133
|
+
<p class="hint" data-i18n="claude_shared_source">Account and source settings apply to both Claude apps.</p>
|
|
134
|
+
<a class="section-link" href="#models" data-source-link="m365" data-i18n="manage_source_account">Manage source and account</a>
|
|
135
|
+
<details class="tool-details"><summary data-i18n="connection_details">Connection details</summary><p id="claude-route" class="table-note"></p><p>Anthropic Messages</p></details>
|
|
136
|
+
</section>
|
|
137
|
+
<section class="panel dashboard-section" id="claude-performance">
|
|
138
|
+
<div class="panel-heading"><h2 data-i18n="request_performance">REQUEST PERFORMANCE</h2><span data-i18n="messages_combined_since_start">MESSAGES COMBINED / SINCE STARTUP</span></div>
|
|
124
139
|
<dl class="stats"><div><dt data-i18n="completed">Completed</dt><dd id="claude-completed">—</dd></div><div><dt data-i18n="incomplete">Incomplete</dt><dd id="claude-incomplete">—</dd></div><div><dt data-i18n="failed">Failed</dt><dd id="claude-failed">—</dd></div><div><dt data-i18n="cancelled">Cancelled</dt><dd id="claude-cancelled">—</dd></div><div><dt data-i18n="first_output">First output</dt><dd id="claude-ttft">—</dd></div><div><dt data-i18n="output_speed">Output speed</dt><dd id="claude-speed">—</dd></div></dl>
|
|
140
|
+
<p class="hint" data-i18n="claude_metrics_combined">These metrics are not separated by Claude app.</p>
|
|
125
141
|
<p class="hint" data-i18n="since_this_service_started_configuration_authorization_model_dis">Counts start with this service. Setup, sign-in, listed models and successful requests are separate checks.</p>
|
|
142
|
+
<a class="section-link" href="#requests" data-i18n="view_request_details">View request details</a>
|
|
126
143
|
</section>
|
|
127
144
|
</div>
|
|
128
145
|
<div data-view="models" hidden>
|
|
129
146
|
<div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label="model_providers"></div>
|
|
130
147
|
<p class="hint source-browse-note" data-i18n="tools_source_browse">Browsing a source does not change app settings.</p>
|
|
131
148
|
<div id="source-account-panel" role="tabpanel">
|
|
149
|
+
<p id="source-status-note" class="hint" role="status"></p>
|
|
132
150
|
<section class="panel dashboard-section" id="github-account">
|
|
133
151
|
<div class="panel-heading"><h2>GitHub Copilot</h2><span id="github-account-state"></span></div>
|
|
134
152
|
<p id="github-account-name" class="account-name">—</p><p id="github-account-hint" class="hint"></p>
|
|
@@ -169,7 +187,7 @@
|
|
|
169
187
|
<p class="hint" data-i18n="catalog_listing_does_not_guarantee_inference_access">Listed does not mean your account can use it.</p>
|
|
170
188
|
</details>
|
|
171
189
|
<details class="panel dashboard-section" id="account-authorization">
|
|
172
|
-
<summary
|
|
190
|
+
<summary data-i18n="source_access_details">SOURCE ACCESS DETAILS</summary>
|
|
173
191
|
<p class="hint" data-i18n="saved_credentials_authorization_model_access_and_client_requests">Saved sign-in, access, models and app requests are separate checks.</p>
|
|
174
192
|
<div class="table-wrap"><table><thead><tr><th data-i18n="source">Source</th><th data-i18n="account">ACCOUNT</th><th data-i18n="authorization">AUTHORIZATION</th><th data-i18n="service">SERVICE</th><th data-i18n="last_verified">LAST VERIFIED</th><th data-i18n="time_left">Time left</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
|
|
175
193
|
</details>
|
|
@@ -179,26 +197,35 @@
|
|
|
179
197
|
<section class="panel dashboard-section">
|
|
180
198
|
<h2 data-i18n="tools_checks_title">Checks & repairs</h2>
|
|
181
199
|
<p class="hint" data-i18n="tools_local_scope">Local checks do not contact external services.</p>
|
|
182
|
-
<div class="section-actions"><button id="check-local" type="button" data-i18n="tools_check_local">Check this computer</button
|
|
200
|
+
<div class="section-actions"><button id="check-local" type="button" data-i18n="tools_check_local">Check this computer</button></div>
|
|
183
201
|
<p id="checks-note" class="table-note" role="status" aria-live="polite" data-i18n="tools_checks_empty">Run a check to see the results.</p>
|
|
184
202
|
<div class="table-wrap"><table class="checks-table"><thead><tr><th data-i18n="tools_check_item">Check</th><th data-i18n="state">State</th><th data-i18n="tools_details">Details</th></tr></thead><tbody id="checks-body"></tbody></table></div>
|
|
185
203
|
</section>
|
|
204
|
+
<section class="panel dashboard-section">
|
|
205
|
+
<h2 data-i18n="account_access">ACCOUNT AND ACCESS</h2><p class="hint" data-i18n="account_management_location">Manage sign-in, accounts and models under Model sources.</p>
|
|
206
|
+
<div class="section-actions"><button id="check-account-link" type="button" data-i18n="check_github_connection">Check GitHub connection</button><a class="section-link" href="#models" data-source-link="m365" data-i18n="view_m365_account">View M365 account</a></div>
|
|
207
|
+
</section>
|
|
186
208
|
<section class="panel dashboard-section">
|
|
187
209
|
<h2 data-i18n="tools_codex_connection">Codex connection</h2><p class="hint" data-i18n="tools_config_scope">Review CCDX-managed fields before repair. Other settings are preserved.</p>
|
|
188
210
|
<div class="section-actions"><button id="preview-config-repair" type="button" data-i18n="tools_review_repair">Review repair</button></div>
|
|
189
211
|
<section id="config-repair-preview" class="tool-flow" hidden><h3 data-i18n="tools_repair_preview">Repair preview</h3><dl id="config-repair-fields" class="failure-detail"></dl><pre id="config-preview-details" class="tool-code"></pre><div class="section-actions"><button id="apply-config-repair" type="button" data-i18n="tools_apply_repair">Back up and repair</button><button id="cancel-config-repair" type="button" data-i18n="cancel">Cancel</button></div></section>
|
|
190
212
|
</section>
|
|
191
|
-
<details class="panel dashboard-section"><summary data-i18n="
|
|
213
|
+
<details class="panel dashboard-section" id="runtime-diagnostics"><summary data-i18n="runtime_details">RUNTIME DETAILS</summary>
|
|
214
|
+
<section class="diagnostic-section"><h2 data-i18n="process_listener">LOCAL SERVICE</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>
|
|
215
|
+
<section class="diagnostic-section"><h2 data-i18n="http_traffic">SERVICE 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">Per-request limits</span><br><span id="body-limits">—</span></p></section>
|
|
216
|
+
</details>
|
|
217
|
+
<details class="panel dashboard-section"><summary data-i18n="more_checks_reports">MORE CHECKS AND REPORTS</summary>
|
|
192
218
|
<div class="section-actions"><button id="check-network" type="button" data-i18n="tools_network_check">Network settings</button></div><p id="network-check-result" class="hint" role="status"></p>
|
|
193
219
|
<h3 data-i18n="tools_compatibility">Model compatibility</h3><p class="hint" data-i18n="tools_compatibility_scope">This test sends model requests and uses quota. Run it explicitly in your terminal:</p><pre class="tool-code">ccdx doctor --compat</pre>
|
|
194
|
-
<p class="hint" data-i18n="tools_report_scope">Reports omit credentials, account details and chat content.</p>
|
|
220
|
+
<div class="tool-details"><h3 data-i18n="diagnostic_report">Diagnostic report</h3><p class="hint" data-i18n="tools_report_scope">Reports omit credentials, account details and chat content.</p><div class="section-actions"><button id="export-report" type="button" data-i18n="tools_export_report">Export report</button></div></div>
|
|
195
221
|
</details>
|
|
196
222
|
</div>
|
|
197
223
|
<div data-view="usage" hidden>
|
|
224
|
+
<div class="section-actions usage-source-controls"><label><span data-i18n="source_entire_page">Source / entire page</span><select id="usage-provider"><option value="" data-i18n="all_providers">All providers</option></select></label><button id="refresh-usage" type="button" data-i18n="refresh_usage">Refresh usage</button></div>
|
|
198
225
|
|
|
199
226
|
<details class="panel dashboard-section" id="model-usage" open>
|
|
200
|
-
<summary class="panel-heading"><h2 data-i18n="
|
|
201
|
-
<div class="section-actions"><
|
|
227
|
+
<summary class="panel-heading"><h2 data-i18n="usage_totals">USAGE TOTALS</h2><span id="usage-state" data-i18n="reading_log">COUNTING</span></summary>
|
|
228
|
+
<div class="section-actions"><button id="clear-usage-day" type="button" hidden data-i18n="all_history">Show all</button></div>
|
|
202
229
|
<p id="usage-note" class="table-note" data-i18n="aggregating_local_usage_metadata">Counting local usage…</p>
|
|
203
230
|
<div class="table-wrap"><table class="usage-table"><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="calls">REQUESTS</th><th scope="col" data-i18n="input">INPUT USAGE</th><th scope="col" data-i18n="cache_read">REUSED INPUT</th><th scope="col" data-i18n="output">OUTPUT USAGE</th><th scope="col" data-i18n="total">TOTAL</th><th scope="col" data-i18n="cache_hit">REUSE RATE</th></tr></thead><tbody id="usage-body"><tr><td colspan="7" data-i18n="loading">Loading…</td></tr></tbody></table></div>
|
|
204
231
|
<p class="hint" data-i18n="cache_hit_recorded_cached_input_tokens_incomplete_history_unavai">Unit: Token. Reused input is part of input.
|
|
@@ -206,49 +233,48 @@
|
|
|
206
233
|
<details id="usage-analytics" class="analytics-section">
|
|
207
234
|
<summary data-i18n="usage_analytics">USAGE TRENDS</summary>
|
|
208
235
|
<div class="analytics-controls">
|
|
209
|
-
<label><span data-i18n="
|
|
210
|
-
<label><span data-i18n="daily_range">Date range</span> <select id="analytics-range"><option value="7" data-i18n="7_days">Last 7 days</option><option value="30" selected data-i18n="30_days">Last 30 days</option><option value="90" data-i18n="90_days">Last 90 days</option></select></label>
|
|
211
|
-
<label><span data-i18n="chart_view">Chart view</span> <select id="analytics-view"><option value="bars" selected data-i18n="bar_chart">Bar chart</option><option value="line" data-i18n="line_chart">Line chart</option></select></label>
|
|
212
|
-
<label><span data-i18n="activity">Measure</span> <select id="analytics-metric"><option value="requests" data-i18n="calls_b73a5">Requests</option><option value="tokens" data-i18n="tokens">Usage (Token)</option></select></label>
|
|
236
|
+
<label><span data-i18n="model_both_charts">Model / both charts</span> <select id="analytics-model"><option value="" data-i18n="all_models">All models</option></select></label>
|
|
213
237
|
</div>
|
|
214
238
|
<p id="analytics-note" class="table-note" role="status" data-i18n="open_to_read_retained_usage_history">Open to view usage trends.</p>
|
|
215
239
|
<p id="analytics-updated" class="refresh-time"></p>
|
|
216
|
-
<div class="chart-heading"><h3 data-i18n="daily_tokens">DAILY USAGE</h3><span data-i18n="
|
|
240
|
+
<div class="chart-heading"><h3 data-i18n="daily_tokens">DAILY USAGE</h3><div class="analytics-controls"><label><span data-i18n="daily_range">Date range</span> <select id="analytics-range"><option value="7" data-i18n="7_days">Last 7 days</option><option value="30" selected data-i18n="30_days">Last 30 days</option><option value="90" data-i18n="90_days">Last 90 days</option></select></label>
|
|
241
|
+
<label><span data-i18n="chart_view">Chart view</span> <select id="analytics-view"><option value="bars" selected data-i18n="bar_chart">Bar chart</option><option value="line" data-i18n="line_chart">Line chart</option></select></label></div></div><p class="hint" data-i18n="input_output_cache_included_in_input">INPUT + OUTPUT / REUSED INPUT IS PART OF INPUT</p>
|
|
217
242
|
<div id="daily-bars" class="daily-bars" aria-label="Daily usage in Token" data-i18n-label="daily_token_usage"></div>
|
|
218
243
|
<div class="daily-axis"><span id="daily-from"></span><span id="daily-to"></span></div>
|
|
219
244
|
<div class="chart-legend"><span class="legend-input" data-i18n="input_36ecb">Input usage</span><span class="legend-output" data-i18n="output_b2439">Output usage</span></div>
|
|
220
|
-
<div class="chart-heading"><h3 data-i18n="request_activity_365_days">ACTIVITY · LAST 365 DAYS</h3><span id="activity-scale">—</
|
|
245
|
+
<div class="chart-heading"><h3 data-i18n="request_activity_365_days">ACTIVITY · LAST 365 DAYS</h3><div class="analytics-controls"><label><span data-i18n="calendar_measure">Calendar measure</span> <select id="analytics-metric"><option value="requests" data-i18n="calls_b73a5">Requests</option><option value="tokens" data-i18n="tokens">Usage (Token)</option></select></label></div></div><p id="activity-scale" class="hint">—</p>
|
|
221
246
|
<div class="calendar-scroll"><div class="calendar-grid"><div id="calendar-months" class="calendar-months" aria-hidden="true"></div><div id="activity-calendar" class="activity-calendar" aria-label="Daily recorded activity over 365 days" data-i18n-label="daily_recorded_request_activity"></div></div></div>
|
|
222
247
|
<p id="analytics-selection" class="hint" role="status" data-i18n="select_a_day_to_inspect_its_model_totals_no_history_is_distinct_">Select a day for its usage. No records does not mean zero requests.</p>
|
|
223
248
|
</details>
|
|
224
249
|
</details>
|
|
225
250
|
</div>
|
|
226
251
|
<div data-view="requests" hidden>
|
|
227
|
-
<details class="panel dashboard-section" id="source-requests">
|
|
252
|
+
<details class="panel dashboard-section" id="source-requests" open>
|
|
228
253
|
<summary data-i18n="requests_by_source">REQUESTS BY SOURCE</summary>
|
|
229
254
|
<p class="hint" data-i18n="results_since_startup_partial_usage_is_marked_separately">Results since startup. Partial usage is marked separately.</p>
|
|
230
255
|
<div class="table-wrap"><table><thead><tr><th data-i18n="source">Source</th><th data-i18n="protocol">Protocol</th><th data-i18n="active">Active</th><th data-i18n="completed">Completed</th><th data-i18n="incomplete">Incomplete</th><th data-i18n="failed">Failed</th><th data-i18n="cancelled">Cancelled</th><th data-i18n="unknown">Unknown</th></tr></thead><tbody id="source-requests-body"></tbody></table></div>
|
|
256
|
+
<details class="tool-details"><summary data-i18n="source_summary_details">Source summaries</summary><div id="provider-requests" class="hint"></div></details>
|
|
231
257
|
</details>
|
|
232
|
-
<details class="
|
|
233
|
-
<summary class="panel-heading"><h2 data-i18n="recent_inference_http_failures">RECENT REQUEST ISSUES</h2><span id="failure-count">requests + events</span></summary>
|
|
234
|
-
<ol id="failures"><li class="empty" data-i18n="reading_874bf">Reading…</li></ol>
|
|
235
|
-
<p class="hint" data-i18n="upstream_messages_may_contain_sensitive_text">Error details may include private data.</p>
|
|
236
|
-
</details>
|
|
237
|
-
<details class="panel dashboard-section" id="request-context">
|
|
258
|
+
<details class="panel dashboard-section" id="request-context" open>
|
|
238
259
|
<summary data-i18n="recent_request_context">RECENT REQUESTS</summary>
|
|
239
260
|
<p id="context-note" class="table-note">—</p>
|
|
240
|
-
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="
|
|
261
|
+
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="time">Time</th><th scope="col" data-i18n="source">Source</th><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="outcome">RESULT</th><th scope="col" data-i18n="input_tokens">INPUT USAGE</th><th scope="col" data-i18n="tools_details">Details</th></tr></thead><tbody id="context-body"><tr><td colspan="6" data-i18n="no_observed_request_metadata">No request records yet.</td></tr></tbody></table></div>
|
|
241
262
|
<p class="hint" data-i18n="recent_upstream_request_metadata_not_exact_live_session_occupanc">Size: MiB. Usage: Token.
|
|
242
263
|
Request records do not show exact current-chat usage.
|
|
243
264
|
Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
244
265
|
</details>
|
|
266
|
+
<details class="lower" id="recent-failures" open>
|
|
267
|
+
<summary class="panel-heading"><h2 data-i18n="recent_inference_http_failures">RECENT REQUEST ISSUES</h2><span id="failure-count">requests + events</span></summary>
|
|
268
|
+
<ol id="failures"><li class="empty" data-i18n="reading_874bf">Reading…</li></ol>
|
|
269
|
+
<p class="hint" data-i18n="upstream_messages_may_contain_sensitive_text">Error details may include private data.</p>
|
|
270
|
+
</details>
|
|
245
271
|
</div>
|
|
246
272
|
<div data-view="system" hidden>
|
|
247
273
|
<section class="panel dashboard-section" aria-labelledby="web-appearance-title">
|
|
248
274
|
<h2 id="web-appearance-title" data-i18n="appearance_web_appearance">网页外观</h2>
|
|
249
275
|
<div class="appearance-row">
|
|
250
276
|
<div class="appearance-label"><label for="web-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_browser_scope">只影响当前浏览器。</p></div>
|
|
251
|
-
<select id="web-color-theme" class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option></select>
|
|
277
|
+
<select id="web-color-theme" class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option><option value="pink" data-i18n="appearance_soft_pink">淡粉色</option></select>
|
|
252
278
|
</div>
|
|
253
279
|
<p id="web-color-note" class="appearance-note" role="status" data-i18n="theme_saved_browser">选择后,网页立即换色。</p>
|
|
254
280
|
</section>
|
|
@@ -257,7 +283,7 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
257
283
|
<h2 id="terminal-appearance-title" data-i18n="terminal_appearance">终端外观</h2>
|
|
258
284
|
<div class="appearance-row">
|
|
259
285
|
<div class="appearance-label"><label for="terminal-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_terminal_scope">与网页主题分别设置。</p></div>
|
|
260
|
-
<select id="terminal-color-theme" disabled class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option></select>
|
|
286
|
+
<select id="terminal-color-theme" disabled class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option><option value="pink" data-i18n="appearance_soft_pink">淡粉色</option></select>
|
|
261
287
|
</div>
|
|
262
288
|
<p id="terminal-color-note" class="appearance-note" role="status" data-i18n="appearance_terminal_effect">表格即时换色,启动 Logo 下次生效。</p>
|
|
263
289
|
|
|
@@ -297,14 +323,12 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
297
323
|
</section>
|
|
298
324
|
|
|
299
325
|
<section class="panel dashboard-section" aria-labelledby="settings-heading">
|
|
300
|
-
<h2 id="settings-heading" data-i18n="
|
|
326
|
+
<h2 id="settings-heading" data-i18n="startup_preferences">STARTUP</h2>
|
|
301
327
|
<p class="hint" data-i18n="saved_preference_and_effective_state_are_separate_environment_ov">Saved choices and current behavior are shown separately. Startup overrides and required restarts are listed.</p>
|
|
302
328
|
<div class="setting-row"><label for="setting-open_webui" data-i18n="open_webui_at_startup">Open dashboard on startup</label><input id="setting-open_webui" type="checkbox" role="switch" disabled><span id="effect-open_webui" class="hint" role="status"></span></div>
|
|
303
329
|
<p id="settings-note" class="hint" role="status" data-i18n="reading_settings">Reading settings…</p>
|
|
304
330
|
</section>
|
|
305
331
|
|
|
306
|
-
<section class="panel dashboard-section"><h2 data-i18n="process_listener">LOCAL SERVICE</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>
|
|
307
|
-
<section class="overview client-overview"><article class="card"><h2 data-i18n="http_traffic">SERVICE 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">Per-request limits</span><br><span id="body-limits">—</span></p></article></section>
|
|
308
332
|
<section class="panel dashboard-section" id="version-updates" aria-labelledby="version-updates-title">
|
|
309
333
|
<div class="version-heading"><h2 id="version-updates-title" data-i18n="version_updates">VERSION & UPDATES</h2><button id="check-updates" type="button" data-i18n="check_updates">Check for updates</button></div>
|
|
310
334
|
<dl class="version-list"><div><dt data-i18n="current_version">Current version</dt><dd id="update-current-version">—</dd><dd id="update-current-date" class="hint">—</dd></div><div id="update-latest-row" hidden><dt data-i18n="available_update">Update available</dt><dd id="update-latest-version">—</dd><dd id="update-latest-date" class="hint">—</dd></div></dl>
|
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const translations = {
|
|
3
|
+
"page_overview_description": ["Service, app connections and usage this run.", "查看服务、应用和本次用量。"],
|
|
4
|
+
"page_codex_description": ["Set up Codex connections and features.", "配置 Codex 接入与专属功能。"],
|
|
5
|
+
"page_claude_description": ["Claude app connections and request performance.", "查看 Claude 接入与请求表现。"],
|
|
6
|
+
"page_models_description": ["Accounts, access checks and model lists.", "管理账号、访问权限和模型列表。"],
|
|
7
|
+
"page_usage_description": ["Usage totals, daily trends and annual activity.", "查看用量汇总、趋势与年度活动。"],
|
|
8
|
+
"page_requests_description": ["Recent requests, outcomes and issues.", "查看最近请求、处理结果和异常。"],
|
|
9
|
+
"page_checks_description": ["Check this computer and review connection repairs.", "检查本机环境,排查接入问题。"],
|
|
10
|
+
"page_settings_description": ["Appearance, terminal, startup and version.", "调整外观、启动行为和版本。"],
|
|
11
|
+
"current_source": ["Current source", "当前来源"],
|
|
12
|
+
"connection_setup": ["Setup", "接入配置"],
|
|
13
|
+
"configured_not_successful": ["Configured does not mean a request succeeded.", "已配置,不代表请求已成功。"],
|
|
14
|
+
"view_model_list": ["View model list", "查看模型列表"],
|
|
15
|
+
"view_request_details": ["View request details", "查看请求详情"],
|
|
16
|
+
"request_performance": ["REQUEST PERFORMANCE", "请求表现"],
|
|
17
|
+
"status_and_repair": ["Status and repair", "状态与修复"],
|
|
18
|
+
"local_service_not_app": ["Local service status does not confirm the app is open.", "本地服务运行,不代表应用已打开。"],
|
|
19
|
+
"claude_shared_source": ["Account and source settings apply to both Claude apps.", "账号与来源设置供两个应用共用。"],
|
|
20
|
+
"manage_source_account": ["Manage source and account", "管理来源与账号"],
|
|
21
|
+
"connection_details": ["Connection details", "连接详情"],
|
|
22
|
+
"messages_combined_since_start": ["MESSAGES COMBINED / SINCE STARTUP", "Messages 合计 / 本次启动"],
|
|
23
|
+
"claude_metrics_combined": ["These metrics are not separated by Claude app.", "当前统计不区分两个 Claude 应用。"],
|
|
24
|
+
"source_access_details": ["SOURCE ACCESS DETAILS", "来源访问详情"],
|
|
25
|
+
"account_access": ["ACCOUNT AND ACCESS", "账号与访问"],
|
|
26
|
+
"account_management_location": ["Manage sign-in, accounts and models under Model sources.", "登录、账号和模型在来源页管理。"],
|
|
27
|
+
"check_github_connection": ["Check GitHub connection", "检查 GitHub 连接"],
|
|
28
|
+
"view_m365_account": ["View M365 account", "查看 M365 账号"],
|
|
29
|
+
"more_checks_reports": ["MORE CHECKS AND REPORTS", "更多检查与报告"],
|
|
30
|
+
"diagnostic_report": ["Diagnostic report", "诊断报告"],
|
|
31
|
+
"runtime_details": ["RUNTIME DETAILS", "运行详情"],
|
|
32
|
+
"startup_preferences": ["STARTUP", "启动行为"],
|
|
33
|
+
"source_entire_page": ["Source / entire page", "来源 / 作用于整页"],
|
|
34
|
+
"refresh_usage": ["Refresh usage", "刷新用量"],
|
|
35
|
+
"usage_totals": ["USAGE TOTALS", "用量汇总"],
|
|
36
|
+
"model_both_charts": ["Model / both charts", "模型 / 作用于两张图"],
|
|
37
|
+
"calendar_measure": ["Measure / calendar only", "指标 / 仅作用于日历"],
|
|
38
|
+
"source_summary_details": ["Source summaries", "来源摘要"],
|
|
39
|
+
"request_metadata": ["Request metadata", "请求技术信息"],
|
|
3
40
|
"cancel": ["Cancel", "取消"],
|
|
4
41
|
"tools_checks_title": ["Checks & repairs", "检查与修复"],
|
|
5
42
|
"tools_source_browse": ["Browsing a source does not change app settings.", "切换标签只查看来源,不改变应用设置。"],
|
|
@@ -146,6 +183,10 @@
|
|
|
146
183
|
"appearance_browser_scope": ["This browser only.", "只影响当前浏览器。"],
|
|
147
184
|
"appearance_classic_green": ["Classic green (default)", "经典绿(默认)"],
|
|
148
185
|
"appearance_klein_blue": ["Klein blue", "克莱因蓝"],
|
|
186
|
+
"appearance_soft_pink": ["Soft pink", "淡粉色"],
|
|
187
|
+
"model_activity_active": ["Processing {count} requests", "正在处理 {count} 个请求"],
|
|
188
|
+
"model_activity_idle": ["No model requests", "暂无模型请求"],
|
|
189
|
+
"model_activity_unknown": ["Activity unknown", "活动状态未知"],
|
|
149
190
|
"appearance_terminal_scope": ["Independent of the webpage theme.", "与网页主题分别设置。"],
|
|
150
191
|
"appearance_terminal_effect": ["Table updates now. Startup logo changes next launch.", "表格即时换色,启动 Logo 下次生效。"],
|
|
151
192
|
"appearance_sample": ["Sample data", "示例数据"],
|
|
@@ -328,9 +369,9 @@
|
|
|
328
369
|
"local_ok": ["CONNECTED LOCALLY", "已连本机"],
|
|
329
370
|
"unavailable_eb0be": ["UNAVAILABLE", "无法读取"],
|
|
330
371
|
"refresh": ["Refresh", "刷新"],
|
|
331
|
-
"auto_refresh": ["Auto refresh", "
|
|
332
|
-
"auto_refresh_on": ["Auto refresh · ON", "
|
|
333
|
-
"auto_refresh_off": ["Auto refresh · OFF", "
|
|
372
|
+
"auto_refresh": ["Auto refresh", "自动刷新"],
|
|
373
|
+
"auto_refresh_on": ["Auto refresh · ON", "自动刷新 · 开"],
|
|
374
|
+
"auto_refresh_off": ["Auto refresh · OFF", "自动刷新 · 关"],
|
|
334
375
|
"every_30_minutes_while_visible_open_sections_update_on_demand": ["Refreshes every 30 minutes while visible. Opening a section also refreshes it.", "可见时每30分钟刷新。\n展开栏目也会刷新。"],
|
|
335
376
|
"local_only_visible_page_updates": ["THIS COMPUTER ONLY / UPDATES WHILE VISIBLE", "仅限本机/页面可见时更新"],
|
|
336
377
|
"updated_time": ["Updated {time}", "更新于{time}"],
|
package/src/dashboard/status.js
CHANGED
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
unknown: "unknown", unconfigured: "not_configured", ready: "ready", checking: "checking", unsupported: "unsupported",
|
|
13
13
|
configured: "configured", preserved: "existing_settings_kept", partially_preserved: "existing_settings_kept",
|
|
14
14
|
restored: "settings_restored", not_installed: "not_installed", configuration_unavailable: "setup_unavailable", not_configured: "unknown", standby: "standby" };
|
|
15
|
-
const auth = element("provider-auth"), clients = element("provider-clients"), requests = element("provider-requests");
|
|
16
|
-
auth.replaceChildren();clients.replaceChildren();requests.replaceChildren();
|
|
15
|
+
const auth = element("provider-auth"), clients = element("provider-clients"), requests = element("provider-requests"), claudeClients = element("claude-clients");
|
|
16
|
+
auth.replaceChildren();clients.replaceChildren();requests.replaceChildren();claudeClients?.replaceChildren();
|
|
17
|
+
const applications = new Map();
|
|
17
18
|
for (const provider of providers) {
|
|
18
19
|
sourceNames.set(provider.id, provider.name);
|
|
19
20
|
const identity = provider.auth || {};
|
|
20
21
|
const authRow = tableRow([provider.name, identity.account || "—", states[identity.state] || "unknown",
|
|
21
22
|
states[provider.state] || "unknown", identity.checked_at || "—", duration(identity.expires_in_ms)], { labels: [2, 3] });
|
|
23
|
+
authRow.setAttribute("data-provider", provider.id);
|
|
22
24
|
if (provider.reason) {
|
|
23
25
|
const network = provider.network_diagnostic;
|
|
24
26
|
localize(authRow.children[3], "state_reason", { state: phrase(states[provider.state] || "unknown"),
|
|
@@ -33,14 +35,9 @@
|
|
|
33
35
|
}
|
|
34
36
|
auth.append(authRow);
|
|
35
37
|
for (const client of provider.clients || []) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (globalThis.ccdxIcons) {
|
|
40
|
-
globalThis.ccdxIcons.set(row.children[2], client.reason ? "state_reason" : states[client.state] || client.state, globalThis.ccdxIcons.kind(client.state), client.reason ? { state: phrase(states[client.state] || "unknown"), reason: client.reason } : {});
|
|
41
|
-
if (["running", "unavailable"].includes(client.gateway)) globalThis.ccdxIcons.set(row.children[3], client.gateway, globalThis.ccdxIcons.kind(client.gateway));
|
|
42
|
-
}
|
|
43
|
-
clients.append(row);
|
|
38
|
+
const id = client.id || client.name;
|
|
39
|
+
if (!applications.has(id)) applications.set(id, []);
|
|
40
|
+
applications.get(id).push({ provider, client });
|
|
44
41
|
}
|
|
45
42
|
if (provider.requests) {
|
|
46
43
|
const item = document.createElement("p");
|
|
@@ -49,11 +46,32 @@
|
|
|
49
46
|
requests.append(item);
|
|
50
47
|
}
|
|
51
48
|
}
|
|
49
|
+
for (const entries of applications.values()) {
|
|
50
|
+
const selected = entries.find(entry => entry.client.selected === true) || (entries.length === 1 ? entries[0] : null);
|
|
51
|
+
const client = selected?.client || { name: entries[0].client.name, state: "unknown" };
|
|
52
|
+
const row = tableRow([client.name, selected?.provider.name || "—", states[client.state] || "unknown",
|
|
53
|
+
client.gateway || "—", client.last_request_at || "—"], { labels: [2, 3] });
|
|
54
|
+
if (client.reason) localize(row.children[2], "state_reason", { state: phrase(states[client.state] || "unknown"), reason: client.reason });
|
|
55
|
+
if (globalThis.ccdxIcons) {
|
|
56
|
+
globalThis.ccdxIcons.set(row.children[2], client.reason ? "state_reason" : states[client.state] || "unknown", globalThis.ccdxIcons.kind(client.state), client.reason ? { state: phrase(states[client.state] || "unknown"), reason: client.reason } : {});
|
|
57
|
+
if (["running", "unavailable"].includes(client.gateway)) globalThis.ccdxIcons.set(row.children[3], client.gateway, globalThis.ccdxIcons.kind(client.gateway));
|
|
58
|
+
}
|
|
59
|
+
clients.append(row);
|
|
60
|
+
if (String(client.id || "").startsWith("claude_")) {
|
|
61
|
+
const detail = tableRow([client.name, states[client.state] || "unknown", client.gateway || "—", client.last_request_at || "—"], { labels: [1, 2] });
|
|
62
|
+
if (client.reason) localize(detail.children[1], "state_reason", { state: phrase(states[client.state] || "unknown"), reason: client.reason });
|
|
63
|
+
if (globalThis.ccdxIcons) {
|
|
64
|
+
globalThis.ccdxIcons.set(detail.children[1], client.reason ? "state_reason" : states[client.state] || "unknown", globalThis.ccdxIcons.kind(client.state), client.reason ? { state: phrase(states[client.state] || "unknown"), reason: client.reason } : {});
|
|
65
|
+
if (["running", "unavailable"].includes(client.gateway)) globalThis.ccdxIcons.set(detail.children[2], client.gateway, globalThis.ccdxIcons.kind(client.gateway));
|
|
66
|
+
}
|
|
67
|
+
claudeClients?.append(detail);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (element("claude-client-state")) element("claude-client-state").hidden = Boolean(claudeClients?.children.length);
|
|
52
71
|
text("source-summary", "count_providers", { count: providers.length });
|
|
53
72
|
element("source-detail").replaceChildren(...providers.map(provider => {
|
|
54
73
|
const item = document.createElement("span");item.textContent = provider.name;return item;
|
|
55
74
|
}));
|
|
56
|
-
text("auth-account", "provider_status_scope");
|
|
57
75
|
}
|
|
58
76
|
|
|
59
77
|
function duration(value) {
|
|
@@ -162,6 +180,7 @@
|
|
|
162
180
|
}
|
|
163
181
|
|
|
164
182
|
function render(data) {
|
|
183
|
+
globalThis.ccdxDashboardActivity?.update(data.model_activity);
|
|
165
184
|
text("version", `v${data.version || "?"}`);
|
|
166
185
|
text("uptime", "pid_pid_uptime_duration", { pid: number(data.pid), duration: duration(data.uptime_ms) });
|
|
167
186
|
|
|
@@ -258,10 +277,11 @@
|
|
|
258
277
|
text("context-note", "20_latest_finished_requests_compactions_completed_completed_inco", {
|
|
259
278
|
completed: number(contextCompactions.completed), incomplete: number(contextCompactions.incomplete), failed: number(contextCompactions.failed),
|
|
260
279
|
});
|
|
261
|
-
if (element("request-context")?.open === false) return;
|
|
280
|
+
if (element("request-context")?.open === false || element("request-context")?.closest?.("[hidden]")) return;
|
|
262
281
|
const signature = JSON.stringify(contextRequests);
|
|
263
282
|
if (signature === contextSignature) return;
|
|
264
283
|
contextSignature = signature;
|
|
284
|
+
const expanded = new Set([...(body.querySelectorAll?.("details[open]") || [])].map(details => details.getAttribute("data-request-key")));
|
|
265
285
|
body.replaceChildren();
|
|
266
286
|
for (const request of contextRequests) {
|
|
267
287
|
const context = request.context || {};
|
|
@@ -269,12 +289,24 @@
|
|
|
269
289
|
? request.outcome[0].toUpperCase() + request.outcome.slice(1) : "unknown";
|
|
270
290
|
const ratio = finite(context.input_tokens) && finite(context.context_window_tokens) && Number(context.context_window_tokens) > 0
|
|
271
291
|
? `${(100 * Number(context.input_tokens) / Number(context.context_window_tokens)).toFixed(1)}%` : "—";
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
outcome], { labels: [
|
|
292
|
+
const at = Date.parse(request.at);
|
|
293
|
+
const row = tableRow([Number.isFinite(at) ? new Date(at).toLocaleTimeString() : "—",
|
|
294
|
+
String(sourceNames.get(request.provider) || request.provider || "—").slice(0, 80),
|
|
295
|
+
String(request.model || "unknown").slice(0, 80), outcome, number(context.input_tokens), ""], { labels: [3] });
|
|
296
|
+
if (globalThis.ccdxIcons) globalThis.ccdxIcons.set(row.children[3], outcome.toLowerCase(), globalThis.ccdxIcons.kind(outcome.toLowerCase()));
|
|
297
|
+
const details = document.createElement("details"), summary = document.createElement("summary"), fields = document.createElement("dl");
|
|
298
|
+
const key = String(request.request_id || `${request.at || ""}/${request.provider || ""}/${request.model || ""}`).slice(0, 256);
|
|
299
|
+
details.setAttribute?.("data-request-key", key);details.open = expanded.has(key);
|
|
300
|
+
details.className = "request-details";fields.className = "failure-detail";
|
|
301
|
+
localize(summary, "request_metadata");details.append(summary, fields);
|
|
302
|
+
for (const [key, value] of [["time", Number.isFinite(at) ? new Date(at).toLocaleString() : "—"],
|
|
303
|
+
["wire_mib", finite(context.payload_bytes) ? `${(Number(context.payload_bytes) / 1048576).toFixed(2)} MiB` : "—"],
|
|
304
|
+
["images", number(context.images)], ["model_window", number(context.context_window_tokens)], ["input_window", ratio]]) {
|
|
305
|
+
const term = document.createElement("dt"), detail = document.createElement("dd");localize(term, key);detail.textContent = value;fields.append(term, detail);
|
|
306
|
+
}
|
|
307
|
+
row.children[5].append(details);body.append(row);
|
|
276
308
|
}
|
|
277
|
-
if (!contextRequests.length) emptyTable("context-body",
|
|
309
|
+
if (!contextRequests.length) emptyTable("context-body", 6, "no_observed_request_metadata");
|
|
278
310
|
}
|
|
279
311
|
return { render, renderProviders, renderFailures, renderContext };
|
|
280
312
|
}
|
package/src/dashboard/theme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const key = "ccdx.dashboard.theme", paletteKey = "ccdx.dashboard.palette";
|
|
3
|
-
const valid = value => value === "green" || value === "klein";
|
|
3
|
+
const valid = value => value === "green" || value === "klein" || value === "pink";
|
|
4
4
|
let theme = "dark", palette = "green", saved = true;
|
|
5
5
|
try {
|
|
6
6
|
if (localStorage.getItem(key) === "light") theme = "light";
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
const applyTheme = () => {
|
|
19
19
|
document.documentElement.dataset.theme = theme;
|
|
20
20
|
document.documentElement.dataset.palette = palette;
|
|
21
|
-
const
|
|
21
|
+
const colors = { green: ["#a6f5a8", "#176b3a"], klein: ["#789aff", "#002fa7"], pink: ["#f3a8c8", "#a83e68"] };
|
|
22
|
+
const color = colors[palette][theme === "dark" ? 0 : 1];
|
|
22
23
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><g fill="none" stroke="${color}" 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="${color}"/></svg>`;
|
|
23
24
|
document.getElementById("favicon").href = `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
24
25
|
};
|