@dijkspicy/opencode-stats-reporter 0.1.0
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/LICENSE +198 -0
- package/README.md +135 -0
- package/bin/opencode-stats-reporter.js +7 -0
- package/contrib/opencode-session-reporter/README.md +92 -0
- package/contrib/opencode-session-reporter/package.json +16 -0
- package/contrib/opencode-session-reporter/plugin-server.ts +14 -0
- package/contrib/opencode-session-reporter/reporter.test.ts +378 -0
- package/contrib/opencode-session-reporter/session-usage-reporter.ts +610 -0
- package/package.json +30 -0
- package/panel/config.example.js +35 -0
- package/panel/css/style.css +615 -0
- package/panel/index.html +398 -0
- package/panel/js/api.js +154 -0
- package/panel/js/app.js +1167 -0
- package/panel/js/charts.js +241 -0
- package/panel/js/config.js +125 -0
- package/panel/js/format.js +156 -0
- package/panel/js/sessions.js +412 -0
- package/src/cli.js +164 -0
- package/src/config.js +57 -0
- package/src/identity.js +34 -0
- package/src/paths.js +37 -0
- package/src/proxy.js +31 -0
- package/src/server.js +164 -0
- package/src/session-api.js +97 -0
- package/src/store.js +246 -0
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
/* BlueRegion Usage 面板样式:CSS 变量实现深浅主题 */
|
|
2
|
+
:root {
|
|
3
|
+
--bg: #f5f6f8;
|
|
4
|
+
--card-bg: #ffffff;
|
|
5
|
+
--text: #1f2329;
|
|
6
|
+
--text-secondary: #6b7280;
|
|
7
|
+
--border: #e5e7eb;
|
|
8
|
+
--accent: #3b7cff;
|
|
9
|
+
--accent-hover: #2f66d9;
|
|
10
|
+
--danger: #e5484d;
|
|
11
|
+
--warn-bg: #fff7e0;
|
|
12
|
+
--warn-text: #8a6116;
|
|
13
|
+
--quota-track-bg: #4c9aff;
|
|
14
|
+
--quota-fill: #36cfc9;
|
|
15
|
+
--quota-over: #f5a623;
|
|
16
|
+
--shadow: 0 1px 3px rgba(0,0,0,.08);
|
|
17
|
+
--skeleton: #e9ecef;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[data-theme="dark"] {
|
|
21
|
+
--bg: #16181d;
|
|
22
|
+
--card-bg: #1f2229;
|
|
23
|
+
--text: #e8e9eb;
|
|
24
|
+
--text-secondary: #9aa0a8;
|
|
25
|
+
--border: #33373f;
|
|
26
|
+
--accent: #5b8cff;
|
|
27
|
+
--accent-hover: #749dff;
|
|
28
|
+
--danger: #f2555a;
|
|
29
|
+
--warn-bg: #3a3220;
|
|
30
|
+
--warn-text: #e8c273;
|
|
31
|
+
--quota-track-bg: #4c9aff;
|
|
32
|
+
--quota-fill: #36cfc9;
|
|
33
|
+
--quota-over: #e8892c;
|
|
34
|
+
--shadow: 0 1px 3px rgba(0,0,0,.4);
|
|
35
|
+
--skeleton: #2c3038;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
* { box-sizing: border-box; }
|
|
39
|
+
|
|
40
|
+
body {
|
|
41
|
+
margin: 0;
|
|
42
|
+
font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
43
|
+
background: var(--bg);
|
|
44
|
+
color: var(--text);
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
transition: background .2s, color .2s;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.hidden { display: none !important; }
|
|
50
|
+
|
|
51
|
+
/* ---------- 通用按钮 ---------- */
|
|
52
|
+
.btn {
|
|
53
|
+
padding: 6px 14px;
|
|
54
|
+
border: 1px solid var(--border);
|
|
55
|
+
border-radius: 6px;
|
|
56
|
+
background: var(--card-bg);
|
|
57
|
+
color: var(--text);
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
transition: all .15s;
|
|
61
|
+
}
|
|
62
|
+
.btn:hover { border-color: var(--accent); color: var(--accent); }
|
|
63
|
+
.btn:disabled { opacity: .5; cursor: not-allowed; }
|
|
64
|
+
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
|
|
65
|
+
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
|
|
66
|
+
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
|
|
67
|
+
.btn-sm { padding: 3px 10px; font-size: 12px; }
|
|
68
|
+
.btn-block { width: 100%; padding: 10px; font-size: 15px; }
|
|
69
|
+
|
|
70
|
+
/* ---------- 安全横幅 ---------- */
|
|
71
|
+
.insecure-banner {
|
|
72
|
+
background: var(--warn-bg);
|
|
73
|
+
color: var(--warn-text);
|
|
74
|
+
text-align: center;
|
|
75
|
+
padding: 8px 12px;
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ---------- 引导视图 ---------- */
|
|
80
|
+
#view-onboarding {
|
|
81
|
+
min-height: 100vh;
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
padding: 24px;
|
|
86
|
+
}
|
|
87
|
+
.onboard-card {
|
|
88
|
+
width: 100%;
|
|
89
|
+
max-width: 400px;
|
|
90
|
+
background: var(--card-bg);
|
|
91
|
+
border: 1px solid var(--border);
|
|
92
|
+
border-radius: 12px;
|
|
93
|
+
box-shadow: var(--shadow);
|
|
94
|
+
padding: 32px;
|
|
95
|
+
}
|
|
96
|
+
.onboard-title { margin: 0 0 6px; font-size: 22px; }
|
|
97
|
+
.onboard-sub { margin: 0 0 20px; color: var(--text-secondary); font-size: 13px; }
|
|
98
|
+
.onboard-error {
|
|
99
|
+
background: rgba(229,72,77,.1);
|
|
100
|
+
color: var(--danger);
|
|
101
|
+
border: 1px solid rgba(229,72,77,.35);
|
|
102
|
+
border-radius: 6px;
|
|
103
|
+
padding: 8px 12px;
|
|
104
|
+
margin-bottom: 14px;
|
|
105
|
+
font-size: 13px;
|
|
106
|
+
}
|
|
107
|
+
.onboard-tip { margin: 14px 0 0; text-align: center; color: var(--text-secondary); font-size: 12px; }
|
|
108
|
+
|
|
109
|
+
.field { display: block; margin-bottom: 16px; }
|
|
110
|
+
.field-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
|
|
111
|
+
.field input, .field select {
|
|
112
|
+
width: 100%;
|
|
113
|
+
padding: 8px 10px;
|
|
114
|
+
border: 1px solid var(--border);
|
|
115
|
+
border-radius: 6px;
|
|
116
|
+
background: var(--card-bg);
|
|
117
|
+
color: var(--text);
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
}
|
|
120
|
+
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
|
|
121
|
+
.field-pwd { display: flex; gap: 8px; align-items: center; }
|
|
122
|
+
.field-pwd input { flex: 1; }
|
|
123
|
+
|
|
124
|
+
/* ---------- 面板 Header ---------- */
|
|
125
|
+
.panel-header {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 16px;
|
|
129
|
+
flex-wrap: wrap;
|
|
130
|
+
padding: 12px 24px;
|
|
131
|
+
background: var(--card-bg);
|
|
132
|
+
border-bottom: 1px solid var(--border);
|
|
133
|
+
position: sticky;
|
|
134
|
+
top: 0;
|
|
135
|
+
z-index: 10;
|
|
136
|
+
}
|
|
137
|
+
.header-left { display: flex; align-items: center; gap: 12px; }
|
|
138
|
+
.panel-title { margin: 0; font-size: 18px; }
|
|
139
|
+
|
|
140
|
+
/* 连通徽标:绿勾=已连接网关并拿到消费者 ID */
|
|
141
|
+
.conn-badge {
|
|
142
|
+
display: inline-flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 6px;
|
|
145
|
+
padding: 3px 10px;
|
|
146
|
+
border: 1px solid var(--border);
|
|
147
|
+
border-radius: 999px;
|
|
148
|
+
font-family: Consolas, monospace;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
color: var(--text-secondary);
|
|
151
|
+
max-width: 340px;
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
}
|
|
156
|
+
.conn-icon {
|
|
157
|
+
flex: none;
|
|
158
|
+
width: 14px;
|
|
159
|
+
height: 14px;
|
|
160
|
+
border-radius: 50%;
|
|
161
|
+
background: var(--text-secondary);
|
|
162
|
+
color: #fff;
|
|
163
|
+
font-size: 10px;
|
|
164
|
+
line-height: 14px;
|
|
165
|
+
text-align: center;
|
|
166
|
+
}
|
|
167
|
+
.conn-ok { color: #2ea043; border-color: rgba(46,160,67,.45); }
|
|
168
|
+
.conn-ok .conn-icon { background: #2ea043; }
|
|
169
|
+
.conn-ok .conn-icon::after { content: "✓"; }
|
|
170
|
+
.conn-fail { color: var(--danger); border-color: rgba(229,72,77,.45); }
|
|
171
|
+
.conn-fail .conn-icon { background: var(--danger); }
|
|
172
|
+
.conn-fail .conn-icon::after { content: "✕"; }
|
|
173
|
+
.conn-pending .conn-icon { animation: conn-pulse 1.1s ease-in-out infinite; }
|
|
174
|
+
@keyframes conn-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
|
|
175
|
+
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
176
|
+
.last-updated { font-size: 12px; color: var(--text-secondary); }
|
|
177
|
+
|
|
178
|
+
.seg-control {
|
|
179
|
+
display: inline-flex;
|
|
180
|
+
border: 1px solid var(--border);
|
|
181
|
+
border-radius: 6px;
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
}
|
|
184
|
+
.seg-control button {
|
|
185
|
+
border: none;
|
|
186
|
+
background: transparent;
|
|
187
|
+
color: var(--text-secondary);
|
|
188
|
+
padding: 6px 14px;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
font-size: 13px;
|
|
191
|
+
}
|
|
192
|
+
.seg-control button + button { border-left: 1px solid var(--border); }
|
|
193
|
+
.seg-control button.active { background: var(--accent); color: #fff; }
|
|
194
|
+
.seg-small button { padding: 4px 10px; font-size: 12px; }
|
|
195
|
+
|
|
196
|
+
.header-notice {
|
|
197
|
+
padding: 8px 24px;
|
|
198
|
+
font-size: 13px;
|
|
199
|
+
}
|
|
200
|
+
.notice-warn { background: var(--warn-bg); color: var(--warn-text); }
|
|
201
|
+
|
|
202
|
+
/* 头部醒目提示:常驻,告警配色 + 叹号圆标;文案较长,独占一排通铺居中 */
|
|
203
|
+
.header-tip {
|
|
204
|
+
order: 10;
|
|
205
|
+
flex-basis: 100%;
|
|
206
|
+
display: inline-flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
gap: 7px;
|
|
210
|
+
padding: 5px 14px;
|
|
211
|
+
border: 1px solid var(--warn-text);
|
|
212
|
+
border-radius: 999px;
|
|
213
|
+
background: var(--warn-bg);
|
|
214
|
+
color: var(--warn-text);
|
|
215
|
+
font-size: 13px;
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
}
|
|
218
|
+
.header-tip .tip-link {
|
|
219
|
+
white-space: nowrap;
|
|
220
|
+
}
|
|
221
|
+
.header-tip a {
|
|
222
|
+
color: var(--accent);
|
|
223
|
+
font-weight: 700;
|
|
224
|
+
text-decoration: underline;
|
|
225
|
+
text-underline-offset: 2px;
|
|
226
|
+
}
|
|
227
|
+
.header-tip a:hover {
|
|
228
|
+
color: var(--accent-hover);
|
|
229
|
+
}
|
|
230
|
+
.header-tip::before {
|
|
231
|
+
content: "!";
|
|
232
|
+
flex: none;
|
|
233
|
+
width: 16px;
|
|
234
|
+
height: 16px;
|
|
235
|
+
border-radius: 50%;
|
|
236
|
+
background: var(--warn-text);
|
|
237
|
+
color: var(--warn-bg);
|
|
238
|
+
font-size: 11px;
|
|
239
|
+
font-weight: 700;
|
|
240
|
+
line-height: 16px;
|
|
241
|
+
text-align: center;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* ---------- 主区域 ---------- */
|
|
245
|
+
.panel-main { max-width: 1280px; margin: 0 auto; padding: 16px 24px; }
|
|
246
|
+
|
|
247
|
+
/* KPI 卡片:8 卡(≥1200 一行 / <1200 4×2 / <768 2 列) */
|
|
248
|
+
.kpi-grid {
|
|
249
|
+
display: grid;
|
|
250
|
+
grid-template-columns: repeat(4, 1fr);
|
|
251
|
+
gap: 12px;
|
|
252
|
+
margin-bottom: 12px;
|
|
253
|
+
}
|
|
254
|
+
.kpi-card {
|
|
255
|
+
background: var(--card-bg);
|
|
256
|
+
border: 1px solid var(--border);
|
|
257
|
+
border-radius: 10px;
|
|
258
|
+
box-shadow: var(--shadow);
|
|
259
|
+
padding: 14px;
|
|
260
|
+
}
|
|
261
|
+
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; white-space: nowrap; }
|
|
262
|
+
.kpi-value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
|
|
263
|
+
.kpi-loading { color: var(--text-secondary); }
|
|
264
|
+
|
|
265
|
+
/* 环比徽章:升红降绿(A 股风格) */
|
|
266
|
+
.kpi-delta { min-height: 16px; margin-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
267
|
+
.delta-up { color: var(--danger); }
|
|
268
|
+
.delta-down { color: #2ea043; }
|
|
269
|
+
.delta-flat { color: var(--text-secondary); }
|
|
270
|
+
|
|
271
|
+
/* Credit 卡剩余额度子行:未超绿 / 超出红 */
|
|
272
|
+
.kpi-remain { min-height: 16px; margin-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
273
|
+
.kpi-remain-ok { color: #2ea043; }
|
|
274
|
+
.kpi-remain-over { color: var(--danger); }
|
|
275
|
+
.kpi-credit-limit { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
|
|
276
|
+
|
|
277
|
+
/* 图表卡片 */
|
|
278
|
+
.card {
|
|
279
|
+
position: relative;
|
|
280
|
+
background: var(--card-bg);
|
|
281
|
+
border: 1px solid var(--border);
|
|
282
|
+
border-radius: 10px;
|
|
283
|
+
box-shadow: var(--shadow);
|
|
284
|
+
padding: 14px;
|
|
285
|
+
}
|
|
286
|
+
.card-title { margin: 0 0 10px; font-size: 15px; }
|
|
287
|
+
|
|
288
|
+
.charts-grid {
|
|
289
|
+
display: grid;
|
|
290
|
+
gap: 12px;
|
|
291
|
+
margin-bottom: 12px;
|
|
292
|
+
grid-template-columns: 1fr;
|
|
293
|
+
grid-template-areas: "trend" "hourly" "model" "provider";
|
|
294
|
+
}
|
|
295
|
+
#card-trend { grid-area: trend; }
|
|
296
|
+
#card-hourly { grid-area: hourly; }
|
|
297
|
+
#card-model { grid-area: model; }
|
|
298
|
+
#card-provider { grid-area: provider; }
|
|
299
|
+
|
|
300
|
+
/* ≥1024px:2×2 均分网格(趋势|分时 一行、模型|供应商 一行);非今日无分时卡,趋势通铺 */
|
|
301
|
+
@media (min-width: 1024px) {
|
|
302
|
+
.charts-grid {
|
|
303
|
+
grid-template-columns: 1fr 1fr;
|
|
304
|
+
grid-template-areas:
|
|
305
|
+
"trend hourly"
|
|
306
|
+
"model provider";
|
|
307
|
+
}
|
|
308
|
+
.charts-grid.no-hourly {
|
|
309
|
+
grid-template-areas:
|
|
310
|
+
"trend trend"
|
|
311
|
+
"model provider";
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/* ≥1200px:KPI 8 卡一行 */
|
|
315
|
+
@media (min-width: 1200px) {
|
|
316
|
+
.kpi-grid { grid-template-columns: repeat(8, 1fr); }
|
|
317
|
+
}
|
|
318
|
+
/* <768px:KPI 两列 */
|
|
319
|
+
@media (max-width: 767px) {
|
|
320
|
+
.kpi-grid { grid-template-columns: repeat(2, 1fr); }
|
|
321
|
+
.panel-header { padding: 10px 14px; }
|
|
322
|
+
.panel-main { padding: 14px; }
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/* 图表卡片纵向 flex:图表撑满卡片剩余高度(行高不一致时消除空白) */
|
|
326
|
+
.chart-card { display: flex; flex-direction: column; }
|
|
327
|
+
.chart { width: 100%; }
|
|
328
|
+
.chart-tall { flex: 1; min-height: 260px; }
|
|
329
|
+
|
|
330
|
+
/* ---------- 卡片状态层 ---------- */
|
|
331
|
+
.card-state {
|
|
332
|
+
position: absolute;
|
|
333
|
+
inset: 46px 16px 16px;
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: column;
|
|
336
|
+
align-items: center;
|
|
337
|
+
justify-content: center;
|
|
338
|
+
gap: 10px;
|
|
339
|
+
background: var(--card-bg);
|
|
340
|
+
border-radius: 8px;
|
|
341
|
+
z-index: 2;
|
|
342
|
+
}
|
|
343
|
+
.state-text { color: var(--text-secondary); font-size: 13px; }
|
|
344
|
+
.state-error-text { color: var(--danger); }
|
|
345
|
+
|
|
346
|
+
.skeleton {
|
|
347
|
+
width: 90%;
|
|
348
|
+
height: 18px;
|
|
349
|
+
border-radius: 4px;
|
|
350
|
+
background: linear-gradient(90deg, var(--skeleton) 25%, var(--border) 50%, var(--skeleton) 75%);
|
|
351
|
+
background-size: 200% 100%;
|
|
352
|
+
animation: shimmer 1.4s infinite;
|
|
353
|
+
}
|
|
354
|
+
.sk-60 { width: 60%; }
|
|
355
|
+
.sk-40 { width: 40%; }
|
|
356
|
+
@keyframes shimmer {
|
|
357
|
+
0% { background-position: 200% 0; }
|
|
358
|
+
100% { background-position: -200% 0; }
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* ---------- 本月 Credit 进度条(月均 pacing) ---------- */
|
|
362
|
+
.quota-card { margin-bottom: 12px; }
|
|
363
|
+
.quota-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
|
|
364
|
+
.quota-head .card-title { margin: 0; }
|
|
365
|
+
.quota-sub { font-weight: 400; font-size: 12px; color: var(--text-secondary); margin-left: 6px; }
|
|
366
|
+
.quota-hint { font-size: 13px; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-text); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
|
|
367
|
+
.quota-form { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: var(--bg); }
|
|
368
|
+
.quota-form-row { display: flex; gap: 14px; flex-wrap: wrap; }
|
|
369
|
+
.quota-form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
|
|
370
|
+
.quota-form-row input { width: 150px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
|
|
371
|
+
.quota-form-row input:focus { outline: none; border-color: var(--accent); }
|
|
372
|
+
.quota-form-actions { display: flex; gap: 8px; margin-top: 10px; }
|
|
373
|
+
.quota-form-msg { font-size: 12px; color: var(--danger); margin-top: 8px; }
|
|
374
|
+
.quota-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
|
|
375
|
+
.quota-track { height: 14px; background: var(--quota-track-bg); border-radius: 7px; overflow: hidden; }
|
|
376
|
+
.quota-fill { height: 100%; width: 0; border-radius: 7px; background: var(--quota-fill); transition: width .35s ease; }
|
|
377
|
+
.quota-fill.over { background: var(--quota-over); animation: quota-blink 1s ease-in-out infinite; }
|
|
378
|
+
.quota-note { margin-top: 8px; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
|
|
379
|
+
.quota-note-ok { color: #2ea043; }
|
|
380
|
+
.quota-note-over { color: var(--quota-over); font-weight: 600; }
|
|
381
|
+
@keyframes quota-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
|
|
382
|
+
/* 光敏感 / 减弱动态效果用户:关闭闪烁动画,保留橙色静态告警 */
|
|
383
|
+
@media (prefers-reduced-motion: reduce) {
|
|
384
|
+
.quota-fill.over { animation: none; }
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* ---------- 可用模型目录(表格:模型 ID + Credit 系数,三对列紧凑排布) ---------- */
|
|
388
|
+
.card-catalog { margin-bottom: 12px; }
|
|
389
|
+
.catalog-count { font-weight: 400; font-size: 12px; color: var(--text-secondary); }
|
|
390
|
+
.catalog-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
391
|
+
.catalog-table th, .catalog-table td {
|
|
392
|
+
padding: 6px 12px;
|
|
393
|
+
text-align: left;
|
|
394
|
+
border-bottom: 1px solid var(--border);
|
|
395
|
+
white-space: nowrap;
|
|
396
|
+
}
|
|
397
|
+
.catalog-table th { color: var(--text-secondary); font-weight: 500; font-size: 12px; }
|
|
398
|
+
.catalog-table th.num, .catalog-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
399
|
+
.catalog-table td.mono { font-family: Consolas, monospace; font-size: 12px; }
|
|
400
|
+
.catalog-table tbody tr:last-child td { border-bottom: none; }
|
|
401
|
+
|
|
402
|
+
/* ---------- 明细表 ---------- */
|
|
403
|
+
.table-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
|
|
404
|
+
.table-head .card-title { margin: 0; }
|
|
405
|
+
.table-wrap { overflow-x: auto; }
|
|
406
|
+
#model-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
407
|
+
#model-table th, #model-table td {
|
|
408
|
+
padding: 8px 12px;
|
|
409
|
+
text-align: left;
|
|
410
|
+
border-bottom: 1px solid var(--border);
|
|
411
|
+
white-space: nowrap;
|
|
412
|
+
}
|
|
413
|
+
#model-table th {
|
|
414
|
+
color: var(--text-secondary);
|
|
415
|
+
font-weight: 500;
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
user-select: none;
|
|
418
|
+
}
|
|
419
|
+
#model-table th:hover { color: var(--accent); }
|
|
420
|
+
#model-table th.num, #model-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
421
|
+
#model-table th.sort-asc::after { content: " ▲"; font-size: 10px; }
|
|
422
|
+
#model-table th.sort-desc::after { content: " ▼"; font-size: 10px; }
|
|
423
|
+
#model-table tbody tr:hover { background: rgba(127,127,127,.06); }
|
|
424
|
+
|
|
425
|
+
/* ---------- 页脚 ---------- */
|
|
426
|
+
.panel-footer {
|
|
427
|
+
text-align: center;
|
|
428
|
+
color: var(--text-secondary);
|
|
429
|
+
font-size: 12px;
|
|
430
|
+
padding: 18px 0 26px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* ---------- 会话视图 ---------- */
|
|
434
|
+
.mono { font-family: Consolas, monospace; }
|
|
435
|
+
#view-sessions > .card { margin-bottom: 12px; }
|
|
436
|
+
|
|
437
|
+
/* 来源声明:客户端上报,非网关权威(与 header-tip 同一告警语言,常驻视图顶部) */
|
|
438
|
+
.session-source {
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: center;
|
|
441
|
+
gap: 7px;
|
|
442
|
+
padding: 8px 14px;
|
|
443
|
+
margin-bottom: 12px;
|
|
444
|
+
border: 1px solid var(--warn-text);
|
|
445
|
+
border-radius: 8px;
|
|
446
|
+
background: var(--warn-bg);
|
|
447
|
+
color: var(--warn-text);
|
|
448
|
+
font-size: 13px;
|
|
449
|
+
font-weight: 600;
|
|
450
|
+
}
|
|
451
|
+
.session-source::before {
|
|
452
|
+
content: "!";
|
|
453
|
+
flex: none;
|
|
454
|
+
width: 16px;
|
|
455
|
+
height: 16px;
|
|
456
|
+
border-radius: 50%;
|
|
457
|
+
background: var(--warn-text);
|
|
458
|
+
color: var(--warn-bg);
|
|
459
|
+
font-size: 11px;
|
|
460
|
+
font-weight: 700;
|
|
461
|
+
line-height: 16px;
|
|
462
|
+
text-align: center;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/* 列表标题旁的来源角标 */
|
|
466
|
+
.src-badge {
|
|
467
|
+
display: inline-block;
|
|
468
|
+
padding: 1px 8px;
|
|
469
|
+
border: 1px solid var(--warn-text);
|
|
470
|
+
border-radius: 999px;
|
|
471
|
+
background: var(--warn-bg);
|
|
472
|
+
color: var(--warn-text);
|
|
473
|
+
font-size: 11px;
|
|
474
|
+
font-weight: 600;
|
|
475
|
+
vertical-align: 2px;
|
|
476
|
+
margin-left: 6px;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* 对账卡:四个统计格(<768 两列) */
|
|
480
|
+
.sess-coverage .table-head { margin-bottom: 10px; }
|
|
481
|
+
.cover-grid {
|
|
482
|
+
display: grid;
|
|
483
|
+
grid-template-columns: repeat(4, 1fr);
|
|
484
|
+
gap: 12px;
|
|
485
|
+
margin-bottom: 10px;
|
|
486
|
+
}
|
|
487
|
+
@media (max-width: 767px) {
|
|
488
|
+
.cover-grid { grid-template-columns: repeat(2, 1fr); }
|
|
489
|
+
}
|
|
490
|
+
.sess-cov-note {
|
|
491
|
+
font-size: 12px;
|
|
492
|
+
color: var(--text-secondary);
|
|
493
|
+
font-variant-numeric: tabular-nums;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/* 筛选(模型 / 代理,服务端精确匹配) */
|
|
497
|
+
#card-session-list .table-head { flex-wrap: wrap; gap: 8px; }
|
|
498
|
+
.sess-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
499
|
+
.sess-filter-item {
|
|
500
|
+
display: inline-flex;
|
|
501
|
+
align-items: center;
|
|
502
|
+
gap: 6px;
|
|
503
|
+
font-size: 12px;
|
|
504
|
+
color: var(--text-secondary);
|
|
505
|
+
}
|
|
506
|
+
.sess-filter-item select {
|
|
507
|
+
padding: 4px 8px;
|
|
508
|
+
border: 1px solid var(--border);
|
|
509
|
+
border-radius: 6px;
|
|
510
|
+
background: var(--card-bg);
|
|
511
|
+
color: var(--text);
|
|
512
|
+
font-size: 12px;
|
|
513
|
+
max-width: 200px;
|
|
514
|
+
}
|
|
515
|
+
.sess-filter-item select:focus { outline: none; border-color: var(--accent); }
|
|
516
|
+
|
|
517
|
+
/* 会话表(列多,横向滚动由 .table-wrap 承担) */
|
|
518
|
+
#session-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
519
|
+
#session-table th, #session-table td {
|
|
520
|
+
padding: 8px 12px;
|
|
521
|
+
text-align: left;
|
|
522
|
+
border-bottom: 1px solid var(--border);
|
|
523
|
+
white-space: nowrap;
|
|
524
|
+
}
|
|
525
|
+
#session-table th { color: var(--text-secondary); font-weight: 500; font-size: 12px; }
|
|
526
|
+
#session-table th.num, #session-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
527
|
+
#session-table tbody tr:hover { background: rgba(127,127,127,.06); }
|
|
528
|
+
#session-table tbody tr:last-child td { border-bottom: none; }
|
|
529
|
+
|
|
530
|
+
/* 会话 ID:等宽截断,完整值在 title,点击进详情 */
|
|
531
|
+
.sess-id-btn {
|
|
532
|
+
display: inline-block;
|
|
533
|
+
max-width: 200px;
|
|
534
|
+
overflow: hidden;
|
|
535
|
+
text-overflow: ellipsis;
|
|
536
|
+
white-space: nowrap;
|
|
537
|
+
vertical-align: bottom;
|
|
538
|
+
padding: 0;
|
|
539
|
+
border: none;
|
|
540
|
+
background: transparent;
|
|
541
|
+
color: var(--accent);
|
|
542
|
+
font-family: Consolas, monospace;
|
|
543
|
+
font-size: 12px;
|
|
544
|
+
cursor: pointer;
|
|
545
|
+
}
|
|
546
|
+
.sess-id-btn:hover { color: var(--accent-hover); text-decoration: underline; }
|
|
547
|
+
.sess-id-btn:focus-visible { outline: 1px solid var(--accent); }
|
|
548
|
+
|
|
549
|
+
/* 列表脚部:计数 + 加载更多 */
|
|
550
|
+
.sess-list-foot {
|
|
551
|
+
display: flex;
|
|
552
|
+
align-items: center;
|
|
553
|
+
justify-content: space-between;
|
|
554
|
+
gap: 10px;
|
|
555
|
+
margin-top: 10px;
|
|
556
|
+
min-height: 26px;
|
|
557
|
+
}
|
|
558
|
+
.sess-count { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
|
|
559
|
+
|
|
560
|
+
/* 会话详情卡 */
|
|
561
|
+
.sess-detail-id {
|
|
562
|
+
font-size: 12px;
|
|
563
|
+
color: var(--text-secondary);
|
|
564
|
+
word-break: break-all;
|
|
565
|
+
margin-bottom: 12px;
|
|
566
|
+
}
|
|
567
|
+
.sess-detail-group { margin-bottom: 14px; }
|
|
568
|
+
.sess-detail-group:last-child { margin-bottom: 0; }
|
|
569
|
+
.sess-detail-heading {
|
|
570
|
+
font-size: 12px;
|
|
571
|
+
font-weight: 600;
|
|
572
|
+
color: var(--text-secondary);
|
|
573
|
+
margin-bottom: 8px;
|
|
574
|
+
}
|
|
575
|
+
.sess-detail-grid {
|
|
576
|
+
display: grid;
|
|
577
|
+
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
578
|
+
gap: 10px 16px;
|
|
579
|
+
}
|
|
580
|
+
.sess-detail-value {
|
|
581
|
+
font-size: 14px;
|
|
582
|
+
font-variant-numeric: tabular-nums;
|
|
583
|
+
word-break: break-all;
|
|
584
|
+
}
|
|
585
|
+
.sess-detail-value.mono { font-family: Consolas, monospace; font-size: 12px; }
|
|
586
|
+
|
|
587
|
+
/* ---------- 设置抽屉 ---------- */
|
|
588
|
+
.drawer-mask {
|
|
589
|
+
position: fixed;
|
|
590
|
+
inset: 0;
|
|
591
|
+
background: rgba(0,0,0,.4);
|
|
592
|
+
z-index: 90;
|
|
593
|
+
}
|
|
594
|
+
.drawer {
|
|
595
|
+
position: fixed;
|
|
596
|
+
top: 0;
|
|
597
|
+
right: 0;
|
|
598
|
+
bottom: 0;
|
|
599
|
+
width: 360px;
|
|
600
|
+
max-width: 92vw;
|
|
601
|
+
background: var(--card-bg);
|
|
602
|
+
border-left: 1px solid var(--border);
|
|
603
|
+
box-shadow: -4px 0 16px rgba(0,0,0,.15);
|
|
604
|
+
padding: 20px;
|
|
605
|
+
overflow-y: auto;
|
|
606
|
+
z-index: 100;
|
|
607
|
+
}
|
|
608
|
+
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
|
|
609
|
+
.drawer-head h2 { margin: 0; font-size: 17px; }
|
|
610
|
+
.drawer-masked { font-family: Consolas, monospace; font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
|
|
611
|
+
.drawer-message { border-radius: 6px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
|
|
612
|
+
.msg-ok { background: rgba(46,160,67,.12); color: #2ea043; border: 1px solid rgba(46,160,67,.35); }
|
|
613
|
+
.msg-error { background: rgba(229,72,77,.1); color: var(--danger); border: 1px solid rgba(229,72,77,.35); }
|
|
614
|
+
.drawer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
|
|
615
|
+
.drawer-tip { margin-top: 16px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
|