@yuku123/z-team-component 0.2.46 → 0.2.49

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.
@@ -1,11 +1,11 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { CopyOutlined as se, ReloadOutlined as Te, PlusOutlined as Se, DeleteOutlined as $e, ClearOutlined as Oe, CloseOutlined as De, SendOutlined as Le, RobotOutlined as Ce, CloudServerOutlined as ze, MessageOutlined as Re, KeyOutlined as Ue, ApiOutlined as He, ToolOutlined as je, BarChartOutlined as qe } from "@ant-design/icons";
3
- import { Tooltip as W, Tabs as Ae, Button as L, Modal as de, Input as we, Drawer as xe, Spin as V, Statistic as B, Table as Ke, message as J, Tag as Q, Select as Fe, Checkbox as Ge } from "antd";
4
- import { useState as S, useEffect as X, useCallback as H, useRef as me, useMemo as Me, Suspense as Je, lazy as Qe } from "react";
2
+ import { CopyOutlined as se, ReloadOutlined as Te, PlusOutlined as Se, DeleteOutlined as Oe, ClearOutlined as De, CloseOutlined as Le, SendOutlined as ze, RobotOutlined as Ce, CloudServerOutlined as Re, MessageOutlined as Ue, KeyOutlined as He, ApiOutlined as je, ToolOutlined as qe, BarChartOutlined as Fe } from "@ant-design/icons";
3
+ import { Tooltip as W, Tabs as Ae, Button as R, Modal as de, Input as we, Drawer as xe, Spin as V, Statistic as $, Table as Ke, message as J, Tag as Q, Select as Ge, Checkbox as Je } from "antd";
4
+ import { useState as S, useEffect as X, useCallback as q, useRef as me, useMemo as Me, Suspense as Qe, lazy as We } from "react";
5
5
  import { s as t } from "./SmartWorkbench.module-xRRmpTTw.js";
6
- import { u as be } from "./useAppStore-ibJyVIAX.js";
7
- import { AgentAppList as We, McpPage as Ye, SkillMarket as Ve } from "@yuku123/z-agent-component";
8
- const le = "ft_gateway_default_ak", Z = "", he = "";
6
+ import { u as _e } from "./useAppStore-ibJyVIAX.js";
7
+ import { AgentAppList as Ye, McpPage as Ve, SkillMarket as Xe } from "@yuku123/z-agent-component";
8
+ const le = "ft_gateway_default_ak", be = "system-default", Z = "", he = "";
9
9
  function ee(a = {}) {
10
10
  const n = { Accept: "application/json", ...a };
11
11
  try {
@@ -15,7 +15,7 @@ function ee(a = {}) {
15
15
  }
16
16
  return n;
17
17
  }
18
- function Xe(a) {
18
+ function Ze(a) {
19
19
  return {
20
20
  modelName: String(a.modelName ?? a.model_name ?? a.service ?? ""),
21
21
  service: String(a.service ?? a.modelName ?? ""),
@@ -48,10 +48,10 @@ async function ge() {
48
48
  const l = n != null && n.success ? n.data : (n == null ? void 0 : n.data) ?? n;
49
49
  if (!Array.isArray(l))
50
50
  throw new Error("模型列表返回格式异常(非数组)");
51
- return l.map(Xe);
51
+ return l.map(Ze);
52
52
  }
53
- async function Ze(a, n, l, i) {
54
- var f, b, O, K;
53
+ async function et(a, n, l, i) {
54
+ var f, M, D, x;
55
55
  const m = await fetch(`${he}/v1/chat/completions`, {
56
56
  method: "POST",
57
57
  headers: {
@@ -67,25 +67,25 @@ async function Ze(a, n, l, i) {
67
67
  signal: i.signal
68
68
  });
69
69
  if (!m.ok || !m.body) {
70
- const v = await m.text().catch(() => "");
71
- if (/<!doctype html/i.test(v.slice(0, 200)))
70
+ const T = await m.text().catch(() => "");
71
+ if (/<!doctype html/i.test(T.slice(0, 200)))
72
72
  throw new Error("模型网关未接入(/v1/chat/completions 落到主壳 SPA,无网关响应)");
73
- let w = `HTTP ${m.status}`;
73
+ let A = `HTTP ${m.status}`;
74
74
  try {
75
- const h = JSON.parse(v);
76
- w = ((f = h == null ? void 0 : h.error) == null ? void 0 : f.message) ?? w;
75
+ const h = JSON.parse(T);
76
+ A = ((f = h == null ? void 0 : h.error) == null ? void 0 : f.message) ?? A;
77
77
  } catch {
78
- v && (w = v);
78
+ T && (A = T);
79
79
  }
80
- throw new Error(w);
80
+ throw new Error(A);
81
81
  }
82
- const N = m.body.getReader(), T = new TextDecoder();
82
+ const N = m.body.getReader(), v = new TextDecoder();
83
83
  let y = "";
84
84
  try {
85
85
  for (; ; ) {
86
- const { done: v, value: w } = await N.read();
87
- if (v) break;
88
- y += T.decode(w, { stream: !0 });
86
+ const { done: T, value: A } = await N.read();
87
+ if (T) break;
88
+ y += v.decode(A, { stream: !0 });
89
89
  const h = y.split(`
90
90
 
91
91
  `);
@@ -103,10 +103,10 @@ async function Ze(a, n, l, i) {
103
103
  continue;
104
104
  }
105
105
  try {
106
- const o = JSON.parse(g), M = o == null ? void 0 : o.choices;
107
- if (Array.isArray(M) && M.length > 0) {
108
- const _ = (b = M[0]) == null ? void 0 : b.delta;
109
- if (_ != null && _.content && i.onDelta(_.content), (O = M[0]) == null ? void 0 : O.finish_reason) {
106
+ const o = JSON.parse(g), K = o == null ? void 0 : o.choices;
107
+ if (Array.isArray(K) && K.length > 0) {
108
+ const E = (M = K[0]) == null ? void 0 : M.delta;
109
+ if (E != null && E.content && i.onDelta(E.content), (D = K[0]) == null ? void 0 : D.finish_reason) {
110
110
  const G = o != null && o.usage ? {
111
111
  promptTokens: o.usage.prompt_tokens ?? 0,
112
112
  completionTokens: o.usage.completion_tokens ?? 0,
@@ -117,12 +117,12 @@ async function Ze(a, n, l, i) {
117
117
  }
118
118
  }
119
119
  if (o != null && o.usage) {
120
- const _ = {
120
+ const E = {
121
121
  promptTokens: o.usage.prompt_tokens ?? 0,
122
122
  completionTokens: o.usage.completion_tokens ?? 0,
123
123
  totalTokens: o.usage.total_tokens ?? 0
124
124
  };
125
- i.onDone(_);
125
+ i.onDone(E);
126
126
  return;
127
127
  }
128
128
  } catch {
@@ -130,9 +130,9 @@ async function Ze(a, n, l, i) {
130
130
  }
131
131
  }
132
132
  i.onDone();
133
- } catch (v) {
134
- if ((K = i.signal) != null && K.aborted) return;
135
- throw i.onError(v instanceof Error ? v : new Error(String(v))), v;
133
+ } catch (T) {
134
+ if ((x = i.signal) != null && x.aborted) return;
135
+ throw i.onError(T instanceof Error ? T : new Error(String(T))), T;
136
136
  }
137
137
  }
138
138
  async function ae(a, n) {
@@ -147,7 +147,7 @@ async function ae(a, n) {
147
147
  throw new Error(`${n}返回非 JSON:${l.slice(0, 120)}`);
148
148
  }
149
149
  }
150
- function et(a) {
150
+ function tt(a) {
151
151
  const n = a.status === 1;
152
152
  return {
153
153
  id: Number(a.id),
@@ -169,7 +169,7 @@ function et(a) {
169
169
  secret: a.secret_key
170
170
  };
171
171
  }
172
- async function _e(a, n, l) {
172
+ async function Ee(a, n, l) {
173
173
  const i = await fetch(`${Z}/api/ak/create`, {
174
174
  method: "POST",
175
175
  headers: ee({ Accept: "application/json", "Content-Type": "application/json" }),
@@ -181,17 +181,17 @@ async function _e(a, n, l) {
181
181
  ownerUserId: a,
182
182
  ownerUserName: n
183
183
  })
184
- }), m = await ae(i, "创建 AK"), N = (m == null ? void 0 : m.data) ?? {}, T = N.accessKey ?? "", y = N.secretKey ?? "";
185
- return T && y && ke(T, y), { apiKey: y, akPrefix: T, message: "AK 已创建,secretKey 仅创建时可见" };
184
+ }), m = await ae(i, "创建 AK"), N = (m == null ? void 0 : m.data) ?? {}, v = N.accessKey ?? "", y = N.secretKey ?? "";
185
+ return v && y && ke(v, y), { apiKey: y, akPrefix: v, message: "AK 已创建,secretKey 仅创建时可见" };
186
186
  }
187
187
  async function oe(a) {
188
188
  const n = await fetch(
189
189
  `${Z}/api/ak/list`,
190
190
  { headers: ee({ Accept: "application/json" }), credentials: "include" }
191
191
  ), l = await ae(n, "获取 AK 列表"), i = Array.isArray(l == null ? void 0 : l.data) ? l.data : [];
192
- return (a ? i.filter((N) => !N.owner_user_id || String(N.owner_user_id) === String(a)) : i).filter((N) => (N.is_deleted ?? 0) === 0).map(et);
192
+ return (a ? i.filter((N) => (N.owner_user_id == null || N.owner_user_id === "" ? be : String(N.owner_user_id)) === String(a)) : i).filter((N) => (N.is_deleted ?? 0) === 0).map(tt);
193
193
  }
194
- async function tt(a) {
194
+ async function at(a) {
195
195
  const n = await fetch(`${Z}/api/ak/delete?id=${encodeURIComponent(String(a))}`, {
196
196
  method: "POST",
197
197
  headers: ee({ Accept: "application/json" }),
@@ -199,8 +199,8 @@ async function tt(a) {
199
199
  });
200
200
  await ae(n, "吊销 AK");
201
201
  }
202
- async function Ee(a) {
203
- var v, w;
202
+ async function Pe(a) {
203
+ var T, A;
204
204
  const n = await fetch(
205
205
  `${Z}/api/admin/llm-call-monitor/stats?hours=168`,
206
206
  { headers: ee({ Accept: "application/json" }), credentials: "include" }
@@ -211,17 +211,17 @@ async function Ee(a) {
211
211
  `${Z}/api/admin/llm-call-monitor/recent?page=1&size=20`,
212
212
  { headers: ee({ Accept: "application/json" }), credentials: "include" }
213
213
  ), d = await ae(h, "获取调用明细");
214
- N = (Array.isArray((v = d == null ? void 0 : d.data) == null ? void 0 : v.records) ? d.data.records : []).map((o, M) => {
215
- const _ = Number(o.promptTokens ?? 0), j = Number(o.completionTokens ?? 0);
214
+ N = (Array.isArray((T = d == null ? void 0 : d.data) == null ? void 0 : T.records) ? d.data.records : []).map((o, K) => {
215
+ const E = Number(o.promptTokens ?? 0), F = Number(o.completionTokens ?? 0);
216
216
  return {
217
- id: Number(o.id ?? M),
217
+ id: Number(o.id ?? K),
218
218
  apiKeyId: a,
219
219
  protocol: "chat/completions",
220
220
  model: String(o.model ?? ""),
221
221
  stream: Number(o.stream ?? 0),
222
- promptTokens: _,
223
- completionTokens: j,
224
- totalTokens: Number(o.totalTokens ?? _ + j),
222
+ promptTokens: E,
223
+ completionTokens: F,
224
+ totalTokens: Number(o.totalTokens ?? E + F),
225
225
  latencyMs: Number(o.durationMs ?? 0),
226
226
  statusCode: o.success === !1 || o.success === 0 ? 500 : 200,
227
227
  errorMsg: o.errorType ?? null,
@@ -230,9 +230,9 @@ async function Ee(a) {
230
230
  });
231
231
  } catch {
232
232
  }
233
- const T = {}, y = {};
233
+ const v = {}, y = {};
234
234
  for (const h of N) {
235
- const d = T[w = h.model] || (T[w] = [0, 0, 0]);
235
+ const d = v[A = h.model] || (v[A] = [0, 0, 0]);
236
236
  d[0] += 1, d[1] += h.promptTokens, d[2] += h.completionTokens;
237
237
  const g = (h.createTime || "").slice(0, 10);
238
238
  if (g) {
@@ -240,22 +240,22 @@ async function Ee(a) {
240
240
  o[0] += 1, o[1] += h.promptTokens, o[2] += h.completionTokens;
241
241
  }
242
242
  }
243
- const f = Number(m.totalTokens ?? 0), b = N.reduce((h, d) => h + d.totalTokens, 0), O = N.reduce((h, d) => h + d.promptTokens, 0), K = N.reduce((h, d) => h + d.completionTokens, 0);
243
+ const f = Number(m.totalTokens ?? 0), M = N.reduce((h, d) => h + d.totalTokens, 0), D = N.reduce((h, d) => h + d.promptTokens, 0), x = N.reduce((h, d) => h + d.completionTokens, 0);
244
244
  return {
245
245
  totalRequests: Number(m.totalCount ?? 0),
246
246
  // 汇总口径优先用后端整窗合计(后端 selectStats 才有 token 合计),
247
247
  // 明细只有最近一页 ⇒ 只在汇总缺失时用明细兜底。
248
- totalPromptTokens: Number(m.totalPromptTokens ?? 0) || O,
249
- totalCompletionTokens: Number(m.totalCompletionTokens ?? 0) || K,
250
- totalTokens: f || b,
248
+ totalPromptTokens: Number(m.totalPromptTokens ?? 0) || D,
249
+ totalCompletionTokens: Number(m.totalCompletionTokens ?? 0) || x,
250
+ totalTokens: f || M,
251
251
  avgLatencyMs: Number(m.avgDurationMs ?? 0),
252
252
  errorCount: Number(m.failCount ?? 0),
253
253
  daily: y,
254
- models: T,
254
+ models: v,
255
255
  recent: N
256
256
  };
257
257
  }
258
- function at() {
258
+ function nt() {
259
259
  return typeof window < "u" ? `${window.location.origin}${he}` : he;
260
260
  }
261
261
  const pe = "ft_gateway_ak_cache";
@@ -266,14 +266,14 @@ function ke(a, n) {
266
266
  } catch {
267
267
  }
268
268
  }
269
- function nt(a) {
269
+ function st(a) {
270
270
  try {
271
271
  return JSON.parse(localStorage.getItem(pe) || "{}")[a] || null;
272
272
  } catch {
273
273
  return null;
274
274
  }
275
275
  }
276
- async function st() {
276
+ async function rt() {
277
277
  try {
278
278
  const i = localStorage.getItem(le);
279
279
  if (i) return i;
@@ -287,7 +287,7 @@ async function st() {
287
287
  }
288
288
  return n.akPrefix && ke(n.akPrefix, n.secret), n.secret;
289
289
  }
290
- const l = await _e(
290
+ const l = await Ee(
291
291
  "system-default",
292
292
  "系统默认",
293
293
  "智能工作台默认AK(自动创建)"
@@ -300,7 +300,7 @@ async function st() {
300
300
  }
301
301
  return l.apiKey;
302
302
  }
303
- function Pe() {
303
+ function Ie() {
304
304
  try {
305
305
  localStorage.removeItem(le);
306
306
  } catch {
@@ -309,7 +309,7 @@ function Pe() {
309
309
  function Ne(a) {
310
310
  return a >= 1e6 ? `${(a / 1e6).toFixed(1)}M` : a >= 1e3 ? `${(a / 1e3).toFixed(1)}K` : `${a}`;
311
311
  }
312
- function rt(a, n) {
312
+ function lt(a, n) {
313
313
  return `# OpenAI 兼容
314
314
  curl -X POST ${a}/v1/chat/completions \\
315
315
  -H "Content-Type: application/json" \\
@@ -320,7 +320,7 @@ curl -X POST ${a}/v1/chat/completions \\
320
320
  "stream": true
321
321
  }'`;
322
322
  }
323
- function lt(a, n) {
323
+ function ot(a, n) {
324
324
  return `# Anthropic 兼容
325
325
  curl -X POST ${a}/v1/messages \\
326
326
  -H "Content-Type: application/json" \\
@@ -330,35 +330,35 @@ curl -X POST ${a}/v1/messages \\
330
330
  "messages": [{"role":"user","content":"你好"}]
331
331
  }'`;
332
332
  }
333
- function ot() {
334
- const [a, n] = S("personal"), [l, i] = S([]), [m, N] = S([]), [T, y] = S(!0), [f, b] = S(!1), [O, K] = S(!1), [v, w] = S(""), [h, d] = S({ open: !1 }), [g, o] = S(null), [M, _] = S(null), [j, G] = S(!1), R = be((u) => u.currentUser), c = String((R == null ? void 0 : R.id) ?? ""), E = (R == null ? void 0 : R.username) ?? "", P = at(), [r, p] = S("<model-name>");
333
+ function it() {
334
+ const [a, n] = S("personal"), [l, i] = S([]), [m, N] = S([]), [v, y] = S(!0), [f, M] = S(!1), [D, x] = S(!1), [T, A] = S(""), [h, d] = S({ open: !1 }), [g, o] = S(null), [K, E] = S(null), [F, G] = S(!1), H = _e((u) => u.currentUser), c = String((H == null ? void 0 : H.id) ?? ""), P = (H == null ? void 0 : H.username) ?? "", I = nt(), [r, p] = S("<model-name>");
335
335
  X(() => {
336
336
  let u = !1;
337
- return ge().then((x) => {
338
- !u && x.length > 0 && p(x[0].modelName);
337
+ return ge().then((w) => {
338
+ !u && w.length > 0 && p(w[0].modelName);
339
339
  }).catch(() => {
340
340
  }), () => {
341
341
  u = !0;
342
342
  };
343
343
  }, []);
344
- const A = H(async () => {
344
+ const C = q(async () => {
345
345
  y(!0);
346
346
  try {
347
- const u = c ? await oe(c).catch(() => []) : [], [x] = await Promise.all([
347
+ const u = c ? await oe(c).catch(() => []) : [], [w] = await Promise.all([
348
348
  oe("system-default").catch(() => [])
349
349
  ]);
350
- i(x), N(u);
350
+ i(w), N(u);
351
351
  } finally {
352
352
  y(!1);
353
353
  }
354
354
  }, [c]);
355
355
  X(() => {
356
- A();
357
- }, [A]);
358
- const C = () => {
359
- w(""), K(!0);
360
- }, q = async () => {
361
- if (!v.trim()) {
356
+ C();
357
+ }, [C]);
358
+ const B = () => {
359
+ A(""), x(!0);
360
+ }, b = async () => {
361
+ if (!T.trim()) {
362
362
  J.warning("请输入 AK 名称");
363
363
  return;
364
364
  }
@@ -366,20 +366,20 @@ function ot() {
366
366
  J.warning("登录态不可用,无法生成 AK");
367
367
  return;
368
368
  }
369
- b(!0);
369
+ M(!0);
370
370
  try {
371
- const u = await _e(c, E, v.trim());
372
- ke(u.akPrefix, u.apiKey), K(!1), d({
371
+ const u = await Ee(c, P, T.trim());
372
+ ke(u.akPrefix, u.apiKey), x(!1), d({
373
373
  open: !0,
374
374
  apiKey: u.apiKey,
375
375
  akPrefix: u.akPrefix
376
- }), A();
376
+ }), C();
377
377
  } catch (u) {
378
378
  J.error(u instanceof Error ? u.message : "创建 AK 失败");
379
379
  } finally {
380
- b(!1);
380
+ M(!1);
381
381
  }
382
- }, I = (u) => {
382
+ }, _ = (u) => {
383
383
  de.confirm({
384
384
  title: "确认吊销此 AK?",
385
385
  content: "吊销后此 AK 将立即失效,无法恢复。",
@@ -388,65 +388,65 @@ function ot() {
388
388
  cancelText: "取消",
389
389
  onOk: async () => {
390
390
  try {
391
- await tt(u), J.success("AK 已吊销"), A(), Pe();
392
- } catch (x) {
393
- J.error(x instanceof Error ? x.message : "吊销失败");
391
+ await at(u), J.success("AK 已吊销"), C(), Ie();
392
+ } catch (w) {
393
+ J.error(w instanceof Error ? w.message : "吊销失败");
394
394
  }
395
395
  }
396
396
  });
397
- }, F = (u) => {
397
+ }, L = (u) => {
398
398
  navigator.clipboard.writeText(u).then(() => J.success("已复制到剪贴板")).catch(() => J.warning("复制失败,请手动复制"));
399
399
  }, ie = (u) => {
400
- const x = nt(u.akPrefix);
401
- x ? F(x) : (F(u.akPrefix), J.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
402
- }, D = async (u) => {
403
- o(u), G(!0), _(null);
400
+ const w = st(u.akPrefix);
401
+ w ? L(w) : (L(u.akPrefix), J.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
402
+ }, z = async (u) => {
403
+ o(u), G(!0), E(null);
404
404
  try {
405
- const x = await Ee(u.id);
406
- _(x);
407
- } catch (x) {
408
- J.error(x instanceof Error ? x.message : "获取用量失败");
405
+ const w = await Pe(u.id);
406
+ E(w);
407
+ } catch (w) {
408
+ J.error(w instanceof Error ? w.message : "获取用量失败");
409
409
  } finally {
410
410
  G(!1);
411
411
  }
412
- }, U = () => {
413
- o(null), _(null);
412
+ }, j = () => {
413
+ o(null), E(null);
414
414
  }, ne = (u) => {
415
- const x = Object.entries(u);
416
- if (x.length === 0)
415
+ const w = Object.entries(u);
416
+ if (w.length === 0)
417
417
  return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
418
- const Y = Math.max(...x.map(([, k]) => k[1] + k[2]), 1);
419
- return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: x.map(([k, z]) => {
420
- const ye = z[1] + z[2], Ie = ye / Y * 100;
418
+ const Y = Math.max(...w.map(([, k]) => k[1] + k[2]), 1);
419
+ return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: w.map(([k, U]) => {
420
+ const ye = U[1] + U[2], $e = ye / Y * 100;
421
421
  return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
422
- /* @__PURE__ */ e(W, { title: `${k}: ${z[0]}次 / ${ye} tokens`, children: /* @__PURE__ */ e(
422
+ /* @__PURE__ */ e(W, { title: `${k}: ${U[0]}次 / ${ye} tokens`, children: /* @__PURE__ */ e(
423
423
  "div",
424
424
  {
425
425
  className: t.usageBar,
426
- style: { height: `${Math.max(Ie, 2)}%` }
426
+ style: { height: `${Math.max($e, 2)}%` }
427
427
  }
428
428
  ) }),
429
429
  /* @__PURE__ */ e("span", { className: t.usageBarLabel, children: k })
430
430
  ] }, k);
431
431
  }) });
432
432
  }, ce = (u) => {
433
- const x = Object.entries(u);
434
- if (x.length === 0)
433
+ const w = Object.entries(u);
434
+ if (w.length === 0)
435
435
  return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
436
- const Y = Math.max(...x.map(([, k]) => k[0]), 1);
437
- return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: x.sort((k, z) => z[1][0] - k[1][0]).map(([k, z]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
436
+ const Y = Math.max(...w.map(([, k]) => k[0]), 1);
437
+ return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: w.sort((k, U) => U[1][0] - k[1][0]).map(([k, U]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
438
438
  /* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: k }),
439
439
  /* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
440
440
  "div",
441
441
  {
442
442
  className: t.modelBreakdownFill,
443
- style: { width: `${z[0] / Y * 100}%` }
443
+ style: { width: `${U[0] / Y * 100}%` }
444
444
  }
445
445
  ) }),
446
446
  /* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
447
- z[0],
447
+ U[0],
448
448
  "次 / ",
449
- z[1] + (z[2] || 0),
449
+ U[1] + (U[2] || 0),
450
450
  "tokens"
451
451
  ] })
452
452
  ] }, k)) });
@@ -498,13 +498,13 @@ function ot() {
498
498
  width: 60,
499
499
  render: (u) => u ? /* @__PURE__ */ e(Q, { color: u < 400 ? "green" : "red", children: u }) : "-"
500
500
  }
501
- ], fe = (u, x) => {
501
+ ], fe = (u, w) => {
502
502
  const Y = Array.isArray(u) ? u : [];
503
- return T ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(V, { tip: "加载中..." }) }) : Y.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: x ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: Y.map((k) => /* @__PURE__ */ s(
503
+ return v ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(V, { tip: "加载中..." }) }) : Y.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: w ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: Y.map((k) => /* @__PURE__ */ s(
504
504
  "div",
505
505
  {
506
506
  className: t.akCard,
507
- onClick: () => D(k),
507
+ onClick: () => z(k),
508
508
  children: [
509
509
  /* @__PURE__ */ s("div", { className: t.akCardRow, children: [
510
510
  /* @__PURE__ */ e("span", { className: t.akTitle, children: k.description || k.akPrefix.replace("...", "**") }),
@@ -524,10 +524,10 @@ function ot() {
524
524
  "div",
525
525
  {
526
526
  className: t.akCardActions,
527
- onClick: (z) => z.stopPropagation(),
527
+ onClick: (U) => U.stopPropagation(),
528
528
  children: [
529
529
  /* @__PURE__ */ e(W, { title: "复制完整 AK", children: /* @__PURE__ */ e(
530
- L,
530
+ R,
531
531
  {
532
532
  size: "small",
533
533
  icon: /* @__PURE__ */ e(se, {}),
@@ -535,13 +535,13 @@ function ot() {
535
535
  children: "复制"
536
536
  }
537
537
  ) }),
538
- !x && k.active && /* @__PURE__ */ e(
539
- L,
538
+ !w && k.active && /* @__PURE__ */ e(
539
+ R,
540
540
  {
541
541
  size: "small",
542
542
  danger: !0,
543
- icon: /* @__PURE__ */ e($e, {}),
544
- onClick: () => I(k.id),
543
+ icon: /* @__PURE__ */ e(Oe, {}),
544
+ onClick: () => _(k.id),
545
545
  children: "吊销"
546
546
  }
547
547
  )
@@ -580,23 +580,23 @@ function ot() {
580
580
  /* @__PURE__ */ s("div", { className: t.akBaseUrlRow, children: [
581
581
  /* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
582
582
  /* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "OpenAI 兼容" }),
583
- /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: P }),
583
+ /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: I }),
584
584
  /* @__PURE__ */ e(W, { title: "复制 Base URL", children: /* @__PURE__ */ e(
585
585
  se,
586
586
  {
587
587
  className: t.akCopyIcon,
588
- onClick: () => F(P)
588
+ onClick: () => L(I)
589
589
  }
590
590
  ) })
591
591
  ] }),
592
592
  /* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
593
593
  /* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "Anthropic 兼容" }),
594
- /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: P }),
594
+ /* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: I }),
595
595
  /* @__PURE__ */ e(W, { title: "复制 Base URL", children: /* @__PURE__ */ e(
596
596
  se,
597
597
  {
598
598
  className: t.akCopyIcon,
599
- onClick: () => F(P)
599
+ onClick: () => L(I)
600
600
  }
601
601
  ) })
602
602
  ] })
@@ -604,11 +604,11 @@ function ot() {
604
604
  /* @__PURE__ */ s("div", { className: t.akIntegrationGrid, children: [
605
605
  /* @__PURE__ */ s("div", { children: [
606
606
  /* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "OpenAI 兼容 — curl 示例" }),
607
- /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: rt(P, r) })
607
+ /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: lt(I, r) })
608
608
  ] }),
609
609
  /* @__PURE__ */ s("div", { children: [
610
610
  /* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "Anthropic 兼容 — curl 示例" }),
611
- /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: lt(P, r) })
611
+ /* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: ot(I, r) })
612
612
  ] })
613
613
  ] })
614
614
  ] }),
@@ -636,13 +636,13 @@ function ot() {
636
636
  }
637
637
  ),
638
638
  /* @__PURE__ */ s("div", { style: { display: "flex", gap: 8 }, children: [
639
- /* @__PURE__ */ e(L, { icon: /* @__PURE__ */ e(Te, {}), onClick: A, size: "small", children: "刷新" }),
639
+ /* @__PURE__ */ e(R, { icon: /* @__PURE__ */ e(Te, {}), onClick: C, size: "small", children: "刷新" }),
640
640
  a === "personal" && /* @__PURE__ */ e(
641
- L,
641
+ R,
642
642
  {
643
643
  type: "primary",
644
644
  icon: /* @__PURE__ */ e(Se, {}),
645
- onClick: C,
645
+ onClick: B,
646
646
  loading: f,
647
647
  children: "生成 AK"
648
648
  }
@@ -656,10 +656,10 @@ function ot() {
656
656
  /* @__PURE__ */ s(
657
657
  de,
658
658
  {
659
- open: O,
659
+ open: D,
660
660
  title: "生成新 AK",
661
- onCancel: () => K(!1),
662
- onOk: q,
661
+ onCancel: () => x(!1),
662
+ onOk: b,
663
663
  okText: "确认生成",
664
664
  cancelText: "取消",
665
665
  confirmLoading: f,
@@ -679,9 +679,9 @@ function ot() {
679
679
  we,
680
680
  {
681
681
  placeholder: "例如:测试用 AK、生产网关 AK",
682
- value: v,
683
- onChange: (u) => w(u.target.value),
684
- onPressEnter: q,
682
+ value: T,
683
+ onChange: (u) => A(u.target.value),
684
+ onPressEnter: b,
685
685
  maxLength: 50,
686
686
  autoFocus: !0
687
687
  }
@@ -697,16 +697,16 @@ function ot() {
697
697
  onCancel: () => d({ open: !1 }),
698
698
  footer: [
699
699
  /* @__PURE__ */ e(
700
- L,
700
+ R,
701
701
  {
702
702
  icon: /* @__PURE__ */ e(se, {}),
703
- onClick: () => h.apiKey && F(h.apiKey),
703
+ onClick: () => h.apiKey && L(h.apiKey),
704
704
  children: "复制 AK"
705
705
  },
706
706
  "copy"
707
707
  ),
708
708
  /* @__PURE__ */ e(
709
- L,
709
+ R,
710
710
  {
711
711
  type: "primary",
712
712
  onClick: () => d({ open: !1 }),
@@ -747,49 +747,49 @@ function ot() {
747
747
  /* @__PURE__ */ e("code", { children: g.akPrefix })
748
748
  ] }) : "AK 详情",
749
749
  open: !!g,
750
- onClose: U,
750
+ onClose: j,
751
751
  size: "large",
752
- children: j ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载用量数据..." }) }) : M ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
752
+ children: F ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载用量数据..." }) }) : K ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
753
753
  /* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 12 }, children: "以下为网关全局调用统计(近 7 天窗口), 监控侧不按 AK 留存;该 AK 自身的累计消耗见下方「本 AK 累计 Token」。" }),
754
754
  /* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
755
- /* @__PURE__ */ e(B, { title: "总请求数", value: M.totalRequests }),
756
- /* @__PURE__ */ e(B, { title: "总 Token", value: M.totalTokens }),
755
+ /* @__PURE__ */ e($, { title: "总请求数", value: K.totalRequests }),
756
+ /* @__PURE__ */ e($, { title: "总 Token", value: K.totalTokens }),
757
757
  /* @__PURE__ */ e(
758
- B,
758
+ $,
759
759
  {
760
760
  title: "输入 Token",
761
- value: M.totalPromptTokens
761
+ value: K.totalPromptTokens
762
762
  }
763
763
  ),
764
764
  /* @__PURE__ */ e(
765
- B,
765
+ $,
766
766
  {
767
767
  title: "输出 Token",
768
- value: M.totalCompletionTokens
768
+ value: K.totalCompletionTokens
769
769
  }
770
770
  ),
771
771
  /* @__PURE__ */ e(
772
- B,
772
+ $,
773
773
  {
774
774
  title: "平均耗时",
775
- value: M.avgLatencyMs,
775
+ value: K.avgLatencyMs,
776
776
  suffix: "ms"
777
777
  }
778
778
  ),
779
779
  /* @__PURE__ */ e(
780
- B,
780
+ $,
781
781
  {
782
782
  title: "错误数",
783
- value: M.errorCount,
783
+ value: K.errorCount,
784
784
  styles: {
785
785
  content: {
786
- color: M.errorCount > 0 ? "#ff4d4f" : void 0
786
+ color: K.errorCount > 0 ? "#ff4d4f" : void 0
787
787
  }
788
788
  }
789
789
  }
790
790
  ),
791
791
  /* @__PURE__ */ e(
792
- B,
792
+ $,
793
793
  {
794
794
  title: "本 AK 累计 Token",
795
795
  value: (g == null ? void 0 : g.totalTokens) ?? 0
@@ -798,11 +798,11 @@ function ot() {
798
798
  ] }),
799
799
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
800
800
  /* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "每日调用曲线(按最近调用明细聚合)" }),
801
- ne(M.daily)
801
+ ne(K.daily)
802
802
  ] }),
803
803
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
804
804
  /* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "模型用量分布" }),
805
- ce(M.models)
805
+ ce(K.models)
806
806
  ] }),
807
807
  /* @__PURE__ */ s("div", { className: t.usageSection, children: [
808
808
  /* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "最近调用记录" }),
@@ -810,7 +810,7 @@ function ot() {
810
810
  Ke,
811
811
  {
812
812
  columns: Be,
813
- dataSource: M.recent,
813
+ dataSource: K.recent,
814
814
  rowKey: "id",
815
815
  size: "small",
816
816
  pagination: {
@@ -829,7 +829,7 @@ function ot() {
829
829
  )
830
830
  ] });
831
831
  }
832
- function it(a) {
832
+ function ct(a) {
833
833
  const n = [];
834
834
  if (!a) return n;
835
835
  const l = /<(think|thinking|reasoning)>([\s\S]*?)<\/\1>/gi;
@@ -839,18 +839,18 @@ function it(a) {
839
839
  return i < a.length && n.push({ type: "text", text: a.slice(i) }), n;
840
840
  }
841
841
  const re = 4;
842
- let ct = 0;
843
- function dt({ initialModels: a }) {
844
- const [n, l] = S([]), [i, m] = S([]), [N, T] = S(!0), [y, f] = S(null), [b, O] = S(""), [K, v] = S(!1), w = me(""), h = me(/* @__PURE__ */ new Map()), d = me(/* @__PURE__ */ new Map());
842
+ let dt = 0;
843
+ function mt({ initialModels: a }) {
844
+ const [n, l] = S([]), [i, m] = S([]), [N, v] = S(!0), [y, f] = S(null), [M, D] = S(""), [x, T] = S(!1), A = me(""), h = me(/* @__PURE__ */ new Map()), d = me(/* @__PURE__ */ new Map());
845
845
  X(() => {
846
846
  (async () => {
847
847
  try {
848
848
  const r = await ge();
849
- m(r), T(!1);
850
- const p = a.length > 0 ? a : r.slice(0, 1).map((A) => A.modelName);
851
- l(p.slice(0, re).map((A) => ue(A)));
849
+ m(r), v(!1);
850
+ const p = a.length > 0 ? a : r.slice(0, 1).map((C) => C.modelName);
851
+ l(p.slice(0, re).map((C) => ue(C)));
852
852
  } catch (r) {
853
- T(!1), f(r instanceof Error ? r.message : "模型列表加载失败");
853
+ v(!1), f(r instanceof Error ? r.message : "模型列表加载失败");
854
854
  }
855
855
  })();
856
856
  }, []), X(() => {
@@ -859,32 +859,32 @@ function dt({ initialModels: a }) {
859
859
  l(r);
860
860
  }
861
861
  }, [a.join(",")]);
862
- const g = H((r) => {
862
+ const g = q((r) => {
863
863
  const p = d.current.get(r);
864
864
  p && (p.scrollTop = p.scrollHeight);
865
- }, []), o = H(
865
+ }, []), o = q(
866
866
  (r, p) => {
867
- l((A) => A.map((C) => C.id === r ? p(C) : C));
867
+ l((C) => C.map((B) => B.id === r ? p(B) : B));
868
868
  },
869
869
  []
870
- ), M = H(async () => {
871
- if (w.current) return w.current;
872
- const r = await st();
873
- return w.current = r, r;
874
- }, []), _ = H(async () => {
875
- const r = b.trim();
876
- if (!r || K) return;
870
+ ), K = q(async () => {
871
+ if (A.current) return A.current;
872
+ const r = await rt();
873
+ return A.current = r, r;
874
+ }, []), E = q(async () => {
875
+ const r = M.trim();
876
+ if (!r || x) return;
877
877
  let p;
878
878
  try {
879
- p = await M();
879
+ p = await K();
880
880
  } catch {
881
881
  return;
882
882
  }
883
- O(""), v(!0);
884
- const A = n.map((I) => ({
885
- ...I,
883
+ D(""), T(!0);
884
+ const C = n.map((_) => ({
885
+ ..._,
886
886
  messages: [
887
- ...I.messages,
887
+ ..._.messages,
888
888
  { role: "user", content: r },
889
889
  { role: "assistant", content: "" }
890
890
  ],
@@ -893,60 +893,60 @@ function dt({ initialModels: a }) {
893
893
  error: null,
894
894
  usage: null
895
895
  }));
896
- l(A);
897
- const C = A;
898
- C.forEach((I) => {
899
- const F = new AbortController();
900
- h.current.set(I.id, F);
901
- const ie = I.messages.slice(0, -1);
902
- Ze(p, I.model, ie, {
903
- onDelta: (D) => {
904
- o(I.id, (U) => ({
905
- ...U,
906
- streamingContent: U.streamingContent + D,
907
- messages: U.messages.map(
908
- (ne, ce) => ce === U.messages.length - 1 ? { ...ne, content: U.streamingContent + D } : ne
896
+ l(C);
897
+ const B = C;
898
+ B.forEach((_) => {
899
+ const L = new AbortController();
900
+ h.current.set(_.id, L);
901
+ const ie = _.messages.slice(0, -1);
902
+ et(p, _.model, ie, {
903
+ onDelta: (z) => {
904
+ o(_.id, (j) => ({
905
+ ...j,
906
+ streamingContent: j.streamingContent + z,
907
+ messages: j.messages.map(
908
+ (ne, ce) => ce === j.messages.length - 1 ? { ...ne, content: j.streamingContent + z } : ne
909
909
  )
910
- })), g(I.id);
910
+ })), g(_.id);
911
911
  },
912
- onDone: (D) => {
913
- o(I.id, (U) => ({
914
- ...U,
912
+ onDone: (z) => {
913
+ o(_.id, (j) => ({
914
+ ...j,
915
915
  isStreaming: !1,
916
- usage: D ? {
917
- promptTokens: D.promptTokens,
918
- completionTokens: D.completionTokens,
919
- totalTokens: D.totalTokens
916
+ usage: z ? {
917
+ promptTokens: z.promptTokens,
918
+ completionTokens: z.completionTokens,
919
+ totalTokens: z.totalTokens
920
920
  } : null
921
- })), h.current.delete(I.id);
921
+ })), h.current.delete(_.id);
922
922
  },
923
- onError: (D) => {
924
- (D.message.includes("401") || D.message.includes("API key")) && (Pe(), w.current = ""), o(I.id, (U) => ({
925
- ...U,
923
+ onError: (z) => {
924
+ (z.message.includes("401") || z.message.includes("API key")) && (Ie(), A.current = ""), o(_.id, (j) => ({
925
+ ...j,
926
926
  isStreaming: !1,
927
- error: D.message
928
- })), h.current.delete(I.id);
927
+ error: z.message
928
+ })), h.current.delete(_.id);
929
929
  },
930
- signal: F.signal
930
+ signal: L.signal
931
931
  }).catch(() => {
932
932
  });
933
933
  });
934
- const q = setInterval(() => {
935
- C.every(
936
- (F) => !h.current.has(F.id)
937
- ) && (clearInterval(q), v(!1));
934
+ const b = setInterval(() => {
935
+ B.every(
936
+ (L) => !h.current.has(L.id)
937
+ ) && (clearInterval(b), T(!1));
938
938
  }, 200);
939
939
  setTimeout(() => {
940
- clearInterval(q), v(!1);
940
+ clearInterval(b), T(!1);
941
941
  }, 300 * 1e3);
942
- }, [b, K, n, M, o, g]), j = H(() => {
943
- h.current.forEach((r) => r.abort()), h.current.clear(), l((r) => r.map((p) => ({ ...p, isStreaming: !1 }))), v(!1);
944
- }, []), G = H(() => {
942
+ }, [M, x, n, K, o, g]), F = q(() => {
943
+ h.current.forEach((r) => r.abort()), h.current.clear(), l((r) => r.map((p) => ({ ...p, isStreaming: !1 }))), T(!1);
944
+ }, []), G = q(() => {
945
945
  var p;
946
946
  if (n.length >= re) return;
947
- const r = (p = i.find((A) => !n.some((C) => C.model === A.modelName))) == null ? void 0 : p.modelName;
948
- r && l((A) => [...A, ue(r)]);
949
- }, [n, i]), R = H(() => {
947
+ const r = (p = i.find((C) => !n.some((B) => B.model === C.modelName))) == null ? void 0 : p.modelName;
948
+ r && l((C) => [...C, ue(r)]);
949
+ }, [n, i]), H = q(() => {
950
950
  h.current.forEach((r) => r.abort()), h.current.clear(), l(
951
951
  (r) => r.map((p) => ({
952
952
  ...p,
@@ -956,16 +956,16 @@ function dt({ initialModels: a }) {
956
956
  error: null,
957
957
  usage: null
958
958
  }))
959
- ), v(!1);
960
- }, [K, n]), c = H((r) => {
959
+ ), T(!1);
960
+ }, [x, n]), c = q((r) => {
961
961
  const p = h.current.get(r);
962
- p && p.abort(), h.current.delete(r), l((A) => A.filter((C) => C.id !== r));
963
- }, []), E = H(
962
+ p && p.abort(), h.current.delete(r), l((C) => C.filter((B) => B.id !== r));
963
+ }, []), P = q(
964
964
  (r, p) => {
965
- o(r, (A) => ({ ...A, model: p }));
965
+ o(r, (C) => ({ ...C, model: p }));
966
966
  },
967
967
  [o]
968
- ), P = i.map((r) => ({
968
+ ), I = i.map((r) => ({
969
969
  label: r.modelName,
970
970
  value: r.modelName
971
971
  }));
@@ -985,12 +985,12 @@ function dt({ initialModels: a }) {
985
985
  ] })
986
986
  ] }),
987
987
  /* @__PURE__ */ e(
988
- L,
988
+ R,
989
989
  {
990
990
  size: "small",
991
- icon: /* @__PURE__ */ e(Oe, {}),
992
- onClick: R,
993
- disabled: K || n.every((r) => r.messages.length === 0),
991
+ icon: /* @__PURE__ */ e(De, {}),
992
+ onClick: H,
993
+ disabled: x || n.every((r) => r.messages.length === 0),
994
994
  children: "清空重新来"
995
995
  }
996
996
  )
@@ -999,12 +999,12 @@ function dt({ initialModels: a }) {
999
999
  n.map((r) => /* @__PURE__ */ s("div", { className: t.chatPanel, children: [
1000
1000
  /* @__PURE__ */ s("div", { className: t.chatPanelHeader, children: [
1001
1001
  /* @__PURE__ */ e(
1002
- Fe,
1002
+ Ge,
1003
1003
  {
1004
1004
  size: "small",
1005
1005
  value: r.model,
1006
- onChange: (p) => E(r.id, p),
1007
- options: P,
1006
+ onChange: (p) => P(r.id, p),
1007
+ options: I,
1008
1008
  style: { minWidth: 140, flex: 1 },
1009
1009
  showSearch: !0,
1010
1010
  optionFilterProp: "label"
@@ -1015,7 +1015,7 @@ function dt({ initialModels: a }) {
1015
1015
  {
1016
1016
  className: t.chatPanelClose,
1017
1017
  onClick: () => c(r.id),
1018
- children: /* @__PURE__ */ e(De, {})
1018
+ children: /* @__PURE__ */ e(Le, {})
1019
1019
  }
1020
1020
  )
1021
1021
  ] }),
@@ -1027,28 +1027,28 @@ function dt({ initialModels: a }) {
1027
1027
  d.current.set(r.id, p);
1028
1028
  },
1029
1029
  children: [
1030
- r.messages.map((p, A) => /* @__PURE__ */ s(
1030
+ r.messages.map((p, C) => /* @__PURE__ */ s(
1031
1031
  "div",
1032
1032
  {
1033
1033
  className: p.role === "user" ? t.chatMsgUser : t.chatMsgAI,
1034
1034
  children: [
1035
- p.role === "assistant" ? it(p.content).map(
1036
- (C, q) => C.type === "think" ? /* @__PURE__ */ s(
1035
+ p.role === "assistant" ? ct(p.content).map(
1036
+ (B, b) => B.type === "think" ? /* @__PURE__ */ s(
1037
1037
  "details",
1038
1038
  {
1039
1039
  className: t.chatThinkBlock,
1040
1040
  children: [
1041
1041
  /* @__PURE__ */ e("summary", { children: "思考过程" }),
1042
- /* @__PURE__ */ e("pre", { children: C.text })
1042
+ /* @__PURE__ */ e("pre", { children: B.text })
1043
1043
  ]
1044
1044
  },
1045
- q
1046
- ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: C.text }, q)
1045
+ b
1046
+ ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: B.text }, b)
1047
1047
  ) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: p.content }),
1048
- r.isStreaming && A === r.messages.length - 1 && p.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
1048
+ r.isStreaming && C === r.messages.length - 1 && p.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
1049
1049
  ]
1050
1050
  },
1051
- A
1051
+ C
1052
1052
  )),
1053
1053
  r.error && /* @__PURE__ */ e("div", { className: t.chatMsgError, children: r.error }),
1054
1054
  r.usage && /* @__PURE__ */ s("div", { className: t.chatUsageBar, children: [
@@ -1072,18 +1072,18 @@ function dt({ initialModels: a }) {
1072
1072
  we.TextArea,
1073
1073
  {
1074
1074
  className: t.chatInput,
1075
- value: b,
1076
- onChange: (r) => O(r.target.value),
1075
+ value: M,
1076
+ onChange: (r) => D(r.target.value),
1077
1077
  placeholder: "输入消息,所有面板将同时收到并流式输出...",
1078
1078
  autoSize: { minRows: 1, maxRows: 4 },
1079
1079
  onPressEnter: (r) => {
1080
- r.shiftKey || (r.preventDefault(), _());
1080
+ r.shiftKey || (r.preventDefault(), E());
1081
1081
  },
1082
- disabled: K
1082
+ disabled: x
1083
1083
  }
1084
1084
  ),
1085
- K ? /* @__PURE__ */ e(L, { danger: !0, onClick: j, children: "停止" }) : /* @__PURE__ */ s(L, { type: "primary", onClick: _, disabled: !b.trim(), children: [
1086
- /* @__PURE__ */ e(Le, {}),
1085
+ x ? /* @__PURE__ */ e(R, { danger: !0, onClick: F, children: "停止" }) : /* @__PURE__ */ s(R, { type: "primary", onClick: E, disabled: !M.trim(), children: [
1086
+ /* @__PURE__ */ e(ze, {}),
1087
1087
  " 发送"
1088
1088
  ] })
1089
1089
  ] })
@@ -1091,7 +1091,7 @@ function dt({ initialModels: a }) {
1091
1091
  }
1092
1092
  function ue(a) {
1093
1093
  return {
1094
- id: ++ct,
1094
+ id: ++dt,
1095
1095
  model: a,
1096
1096
  messages: [],
1097
1097
  streamingContent: "",
@@ -1100,26 +1100,26 @@ function ue(a) {
1100
1100
  usage: null
1101
1101
  };
1102
1102
  }
1103
- function mt({ onStartChat: a }) {
1104
- const [n, l] = S([]), [i, m] = S(!0), [N, T] = S(null), [y, f] = S(/* @__PURE__ */ new Set()), b = () => {
1105
- m(!0), T(null), ge().then((d) => {
1103
+ function ut({ onStartChat: a }) {
1104
+ const [n, l] = S([]), [i, m] = S(!0), [N, v] = S(null), [y, f] = S(/* @__PURE__ */ new Set()), M = () => {
1105
+ m(!0), v(null), ge().then((d) => {
1106
1106
  l(d), m(!1);
1107
1107
  }).catch((d) => {
1108
- l([]), T(d instanceof Error ? d.message : "加载失败"), m(!1);
1108
+ l([]), v(d instanceof Error ? d.message : "加载失败"), m(!1);
1109
1109
  });
1110
1110
  };
1111
1111
  X(() => {
1112
- b();
1112
+ M();
1113
1113
  }, []);
1114
- const O = (d) => {
1114
+ const D = (d) => {
1115
1115
  f((g) => {
1116
1116
  const o = new Set(g);
1117
1117
  return o.has(d) ? o.delete(d) : o.add(d), o;
1118
1118
  });
1119
- }, K = Array.from(y), v = (d) => {
1119
+ }, x = Array.from(y), T = (d) => {
1120
1120
  a([d]);
1121
- }, w = () => {
1122
- K.length > 0 && a(K);
1121
+ }, A = () => {
1122
+ x.length > 0 && a(x);
1123
1123
  }, h = (d) => {
1124
1124
  if (!d) return "default";
1125
1125
  const g = d.toLowerCase();
@@ -1133,7 +1133,7 @@ function mt({ onStartChat: a }) {
1133
1133
  /* @__PURE__ */ s("div", { className: t.akEmpty, children: [
1134
1134
  "模型列表加载失败:",
1135
1135
  N,
1136
- /* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(L, { type: "primary", onClick: b, children: "重试" }) })
1136
+ /* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(R, { type: "primary", onClick: M, children: "重试" }) })
1137
1137
  ] })
1138
1138
  ] }) : /* @__PURE__ */ s("div", { children: [
1139
1139
  /* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
@@ -1147,15 +1147,15 @@ function mt({ onStartChat: a }) {
1147
1147
  "div",
1148
1148
  {
1149
1149
  className: `${t.modelCard} ${g ? t.modelCardSelected : ""}`,
1150
- onClick: () => O(d.modelName),
1150
+ onClick: () => D(d.modelName),
1151
1151
  children: [
1152
1152
  /* @__PURE__ */ e(
1153
- Ge,
1153
+ Je,
1154
1154
  {
1155
1155
  className: t.modelCheckbox,
1156
1156
  checked: g,
1157
1157
  onChange: (o) => {
1158
- o.stopPropagation(), O(d.modelName);
1158
+ o.stopPropagation(), D(d.modelName);
1159
1159
  }
1160
1160
  }
1161
1161
  ),
@@ -1178,12 +1178,12 @@ function mt({ onStartChat: a }) {
1178
1178
  ] }),
1179
1179
  /* @__PURE__ */ e("p", { className: t.modelEndpoint, children: d.endpoint }),
1180
1180
  /* @__PURE__ */ e("div", { className: t.modelCardFooter, children: /* @__PURE__ */ e(
1181
- L,
1181
+ R,
1182
1182
  {
1183
1183
  type: "link",
1184
1184
  size: "small",
1185
1185
  onClick: (o) => {
1186
- o.stopPropagation(), v(d.modelName);
1186
+ o.stopPropagation(), T(d.modelName);
1187
1187
  },
1188
1188
  children: "发起对话"
1189
1189
  }
@@ -1193,39 +1193,39 @@ function mt({ onStartChat: a }) {
1193
1193
  d.modelName
1194
1194
  );
1195
1195
  }) }),
1196
- K.length > 0 && /* @__PURE__ */ s("div", { className: t.modelActionBar, children: [
1196
+ x.length > 0 && /* @__PURE__ */ s("div", { className: t.modelActionBar, children: [
1197
1197
  /* @__PURE__ */ s("span", { className: t.modelSelectionCount, children: [
1198
1198
  "已选择 ",
1199
- K.length,
1199
+ x.length,
1200
1200
  " 个模型"
1201
1201
  ] }),
1202
1202
  /* @__PURE__ */ e(
1203
- L,
1203
+ R,
1204
1204
  {
1205
1205
  type: "primary",
1206
- onClick: w,
1207
- disabled: K.length === 0,
1206
+ onClick: A,
1207
+ disabled: x.length === 0,
1208
1208
  children: "批量对比"
1209
1209
  }
1210
1210
  )
1211
1211
  ] })
1212
1212
  ] });
1213
1213
  }
1214
- const ut = "_container_15pgq_5", ht = "_page_15pgq_10", pt = "_kpiGrid_15pgq_16", gt = "_kpiCard_15pgq_22", kt = "_sectionCard_15pgq_29", ft = "_sectionHead_15pgq_36", yt = "_sectionHint_15pgq_42", Nt = "_akList_15pgq_47", vt = "_errorState_15pgq_54", Tt = "_errorTitle_15pgq_66", St = "_errorDetail_15pgq_72", $ = {
1215
- container: ut,
1216
- page: ht,
1217
- kpiGrid: pt,
1218
- kpiCard: gt,
1219
- sectionCard: kt,
1220
- sectionHead: ft,
1221
- sectionHint: yt,
1222
- akList: Nt,
1223
- errorState: vt,
1224
- errorTitle: Tt,
1225
- errorDetail: St
1226
- }, Ct = Qe(
1214
+ const ht = "_container_15pgq_5", pt = "_page_15pgq_10", gt = "_kpiGrid_15pgq_16", kt = "_kpiCard_15pgq_22", ft = "_sectionCard_15pgq_29", yt = "_sectionHead_15pgq_36", Nt = "_sectionHint_15pgq_42", vt = "_akList_15pgq_47", Tt = "_errorState_15pgq_54", St = "_errorTitle_15pgq_66", Ct = "_errorDetail_15pgq_72", O = {
1215
+ container: ht,
1216
+ page: pt,
1217
+ kpiGrid: gt,
1218
+ kpiCard: kt,
1219
+ sectionCard: ft,
1220
+ sectionHead: yt,
1221
+ sectionHint: Nt,
1222
+ akList: vt,
1223
+ errorState: Tt,
1224
+ errorTitle: St,
1225
+ errorDetail: Ct
1226
+ }, At = We(
1227
1227
  () => import("@yuku123/z-agent-component").then((a) => ({ default: a.AgentDashboard }))
1228
- ), At = "system-default";
1228
+ );
1229
1229
  function te(a) {
1230
1230
  return a >= 1e6 ? `${(a / 1e6).toFixed(2)}M` : a >= 1e3 ? `${(a / 1e3).toFixed(1)}K` : String(a ?? 0);
1231
1231
  }
@@ -1295,91 +1295,96 @@ function Kt(a) {
1295
1295
  return ((n = a == null ? void 0 : a.stats) == null ? void 0 : n.recent) ?? [];
1296
1296
  }
1297
1297
  function Mt() {
1298
- var g, o, M, _, j, G, R;
1299
- const [a, n] = S(!0), [l, i] = S(null), [m, N] = S([]), [T, y] = S(null), [f, b] = S(null), O = String(be((c) => {
1300
- var E;
1301
- return ((E = c.currentUser) == null ? void 0 : E.id) ?? "";
1302
- })), K = Array.from(
1303
- new Set([O, At].filter((c) => c !== ""))
1304
- ), v = H(async () => {
1298
+ var g, o, K, E, F, G, H;
1299
+ const [a, n] = S(!0), [l, i] = S(null), [m, N] = S([]), [v, y] = S(null), [f, M] = S(null), D = String(_e((c) => {
1300
+ var P;
1301
+ return ((P = c.currentUser) == null ? void 0 : P.id) ?? "";
1302
+ })), x = Array.from(
1303
+ new Set([D, be].filter((c) => c !== ""))
1304
+ ), T = q(async () => {
1305
1305
  n(!0), i(null);
1306
1306
  try {
1307
1307
  const c = await Promise.allSettled(
1308
- K.map((C) => oe(C))
1309
- ), E = [];
1310
- let P = 0;
1311
- for (const C of c)
1312
- C.status === "fulfilled" ? E.push(...C.value) : P += 1;
1313
- if (P === c.length)
1308
+ x.map((b) => oe(b))
1309
+ ), P = [], I = /* @__PURE__ */ new Set();
1310
+ let r = 0;
1311
+ for (const b of c)
1312
+ if (b.status === "fulfilled")
1313
+ for (const _ of b.value) {
1314
+ const L = String(_.id ?? _.akPrefix ?? "");
1315
+ I.has(L) || (I.add(L), P.push(_));
1316
+ }
1317
+ else r += 1;
1318
+ if (r === c.length)
1314
1319
  throw new Error("网关不可达:无法获取 AK 列表");
1315
- E.sort((C, q) => (C.id ?? 0) - (q.id ?? 0));
1316
- let r = null, p = null;
1320
+ P.sort((b, _) => (b.id ?? 0) - (_.id ?? 0));
1321
+ let p = null, C = null;
1317
1322
  try {
1318
- r = await Ee(0);
1319
- } catch (C) {
1320
- p = C instanceof Error ? C.message : "获取用量失败";
1323
+ p = await Pe(0);
1324
+ } catch (b) {
1325
+ C = b instanceof Error ? b.message : "获取用量失败";
1321
1326
  }
1322
- y(r);
1323
- const A = E.map((C) => ({
1324
- key: C,
1325
- stats: r,
1326
- statsError: p
1327
+ y(p);
1328
+ const B = P.map((b) => ({
1329
+ key: b,
1330
+ stats: p,
1331
+ statsError: C
1327
1332
  }));
1328
- N(A);
1333
+ N(B);
1329
1334
  } catch (c) {
1330
1335
  i(c instanceof Error ? c.message : "加载失败");
1331
1336
  } finally {
1332
1337
  n(!1);
1333
1338
  }
1334
- }, [K.join(",")]);
1339
+ }, [x.join(",")]);
1335
1340
  X(() => {
1336
- v();
1337
- }, [v]);
1338
- const w = Me(() => {
1339
- const c = T, E = {};
1340
- for (const [P, r] of Object.entries((c == null ? void 0 : c.models) ?? {}))
1341
- E[P] = [r[0] ?? 0, r[1] ?? 0, r[2] ?? 0];
1341
+ T();
1342
+ }, [T]);
1343
+ const A = Me(() => {
1344
+ const c = v, P = {};
1345
+ for (const [I, r] of Object.entries((c == null ? void 0 : c.models) ?? {}))
1346
+ P[I] = [r[0] ?? 0, r[1] ?? 0, r[2] ?? 0];
1342
1347
  return {
1343
1348
  requests: (c == null ? void 0 : c.totalRequests) ?? 0,
1344
1349
  tokens: (c == null ? void 0 : c.totalTokens) ?? 0,
1345
1350
  avgLatency: (c == null ? void 0 : c.avgLatencyMs) ?? 0,
1346
1351
  errors: (c == null ? void 0 : c.errorCount) ?? 0,
1347
- models: E
1352
+ models: P
1348
1353
  };
1349
- }, [T]), h = m.reduce((c, E) => c + (E.key.tokenQuota || 0), 0), d = () => a ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载监控数据..." }) }) : l ? /* @__PURE__ */ s("div", { className: $.errorState, children: [
1350
- /* @__PURE__ */ e("div", { className: $.errorTitle, children: "模型监控数据加载失败" }),
1351
- /* @__PURE__ */ e("div", { className: $.errorDetail, children: l }),
1352
- /* @__PURE__ */ e(L, { icon: /* @__PURE__ */ e(Te, {}), onClick: v, type: "primary", children: "重试" })
1353
- ] }) : /* @__PURE__ */ s("div", { className: $.page, children: [
1354
- /* @__PURE__ */ s("div", { className: $.kpiGrid, children: [
1355
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(B, { title: "总请求(近7天)", value: w.requests }) }),
1356
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(B, { title: "总 Tokens", value: te(w.tokens) }) }),
1357
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(B, { title: "平均延迟", value: w.avgLatency, suffix: "ms" }) }),
1358
- /* @__PURE__ */ e("div", { className: $.kpiCard, children: /* @__PURE__ */ e(
1359
- B,
1354
+ }, [v]), h = m.reduce((c, P) => c + (P.key.tokenQuota || 0), 0), d = () => a ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载监控数据..." }) }) : l ? /* @__PURE__ */ s("div", { className: O.errorState, children: [
1355
+ /* @__PURE__ */ e("div", { className: O.errorTitle, children: "模型监控数据加载失败" }),
1356
+ /* @__PURE__ */ e("div", { className: O.errorDetail, children: l }),
1357
+ /* @__PURE__ */ e(R, { icon: /* @__PURE__ */ e(Te, {}), onClick: T, type: "primary", children: "重试" })
1358
+ ] }) : /* @__PURE__ */ s("div", { className: O.page, children: [
1359
+ /* @__PURE__ */ s("div", { className: O.kpiGrid, children: [
1360
+ /* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e($, { title: "总请求(近7天)", value: A.requests }) }),
1361
+ /* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e($, { title: "总 Tokens", value: te(A.tokens) }) }),
1362
+ /* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e($, { title: "平均延迟", value: A.avgLatency, suffix: "ms" }) }),
1363
+ /* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e(
1364
+ $,
1360
1365
  {
1361
1366
  title: "错误数",
1362
- value: w.errors,
1363
- valueStyle: w.errors > 0 ? { color: "#ff4d4f" } : void 0
1367
+ value: A.errors,
1368
+ valueStyle: A.errors > 0 ? { color: "#ff4d4f" } : void 0
1364
1369
  }
1365
1370
  ) })
1366
1371
  ] }),
1367
- /* @__PURE__ */ s("div", { className: $.sectionCard, children: [
1368
- /* @__PURE__ */ s("div", { className: $.sectionHead, children: [
1372
+ /* @__PURE__ */ s("div", { className: O.sectionCard, children: [
1373
+ /* @__PURE__ */ s("div", { className: O.sectionHead, children: [
1369
1374
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "AK 用量" }),
1370
- h > 0 && /* @__PURE__ */ s("span", { className: $.sectionHint, children: [
1375
+ h > 0 && /* @__PURE__ */ s("span", { className: O.sectionHint, children: [
1371
1376
  "合计额度 ",
1372
1377
  te(h),
1373
1378
  " tokens"
1374
1379
  ] })
1375
1380
  ] }),
1376
- m.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "网关下暂无 AK" }) : /* @__PURE__ */ e("div", { className: $.akList, children: m.map((c) => {
1377
- const E = c.key.totalTokens ?? 0, P = c.key.tokenQuota || 0, r = P > 0 ? Math.min(E / P * 100, 100) : 0;
1381
+ m.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "网关下暂无 AK" }) : /* @__PURE__ */ e("div", { className: O.akList, children: m.map((c) => {
1382
+ const P = c.key.totalTokens ?? 0, I = c.key.tokenQuota || 0, r = I > 0 ? Math.min(P / I * 100, 100) : 0;
1378
1383
  return /* @__PURE__ */ s(
1379
1384
  "div",
1380
1385
  {
1381
1386
  className: t.akCard,
1382
- onClick: () => b(c),
1387
+ onClick: () => M(c),
1383
1388
  children: [
1384
1389
  /* @__PURE__ */ s("div", { className: t.akCardRow, children: [
1385
1390
  /* @__PURE__ */ e("span", { className: t.akTitle, children: c.key.description || c.key.userName || `AK #${c.key.id}` }),
@@ -1402,8 +1407,8 @@ function Mt() {
1402
1407
  }
1403
1408
  ) }),
1404
1409
  /* @__PURE__ */ s("span", { className: t.akUsageText, children: [
1405
- te(E),
1406
- P > 0 ? ` / ${te(P)}` : "",
1410
+ te(P),
1411
+ I > 0 ? ` / ${te(I)}` : "",
1407
1412
  " tokens"
1408
1413
  ] }),
1409
1414
  /* @__PURE__ */ e("span", { className: t.akMetaText, children: c.statsError ? c.statsError : c.key.lastUsedAt ? `最近使用 ${c.key.lastUsedAt}` : "尚未使用" })
@@ -1414,12 +1419,12 @@ function Mt() {
1414
1419
  );
1415
1420
  }) })
1416
1421
  ] }),
1417
- /* @__PURE__ */ s("div", { className: $.sectionCard, children: [
1422
+ /* @__PURE__ */ s("div", { className: O.sectionCard, children: [
1418
1423
  /* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布(网关全局)" }),
1419
- /* @__PURE__ */ e(ve, { models: w.models })
1424
+ /* @__PURE__ */ e(ve, { models: A.models })
1420
1425
  ] })
1421
1426
  ] });
1422
- return /* @__PURE__ */ s("div", { className: $.container, children: [
1427
+ return /* @__PURE__ */ s("div", { className: O.container, children: [
1423
1428
  /* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
1424
1429
  /* @__PURE__ */ e("h2", { className: t.modelMgmtTitle, children: "模型监控" }),
1425
1430
  /* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "大模型网关管控视图 — 网关全局聚合调用量、Tokens 与延迟(近 7 天)" })
@@ -1433,7 +1438,7 @@ function Mt() {
1433
1438
  {
1434
1439
  key: "sessions",
1435
1440
  label: "会话统计",
1436
- children: /* @__PURE__ */ e(Je, { fallback: /* @__PURE__ */ e(V, { tip: "加载会话统计..." }), children: /* @__PURE__ */ e(Ct, {}) })
1441
+ children: /* @__PURE__ */ e(Qe, { fallback: /* @__PURE__ */ e(V, { tip: "加载会话统计..." }), children: /* @__PURE__ */ e(At, {}) })
1437
1442
  }
1438
1443
  ]
1439
1444
  }
@@ -1444,29 +1449,29 @@ function Mt() {
1444
1449
  title: f ? `AK 用量 — ${f.key.description || f.key.akPrefix}` : "",
1445
1450
  width: 860,
1446
1451
  open: !!f,
1447
- onClose: () => b(null),
1452
+ onClose: () => M(null),
1448
1453
  destroyOnHidden: !0,
1449
1454
  children: f && /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
1450
1455
  /* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 12 }, children: "调用监控是网关全局维度(不按 AK 留存),以下统计覆盖全部 AK; 该 AK 自身的累计消耗见「本 AK 累计 Token」。" }),
1451
1456
  /* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
1452
- /* @__PURE__ */ e(B, { title: "总请求", value: ((g = f.stats) == null ? void 0 : g.totalRequests) ?? 0 }),
1453
- /* @__PURE__ */ e(B, { title: "总 Tokens", value: ((o = f.stats) == null ? void 0 : o.totalTokens) ?? 0 }),
1454
- /* @__PURE__ */ e(B, { title: "平均延迟", value: ((M = f.stats) == null ? void 0 : M.avgLatencyMs) ?? 0, suffix: "ms" }),
1455
- /* @__PURE__ */ e(B, { title: "输入 Tokens", value: ((_ = f.stats) == null ? void 0 : _.totalPromptTokens) ?? 0 }),
1456
- /* @__PURE__ */ e(B, { title: "输出 Tokens", value: ((j = f.stats) == null ? void 0 : j.totalCompletionTokens) ?? 0 }),
1457
+ /* @__PURE__ */ e($, { title: "总请求", value: ((g = f.stats) == null ? void 0 : g.totalRequests) ?? 0 }),
1458
+ /* @__PURE__ */ e($, { title: "总 Tokens", value: ((o = f.stats) == null ? void 0 : o.totalTokens) ?? 0 }),
1459
+ /* @__PURE__ */ e($, { title: "平均延迟", value: ((K = f.stats) == null ? void 0 : K.avgLatencyMs) ?? 0, suffix: "ms" }),
1460
+ /* @__PURE__ */ e($, { title: "输入 Tokens", value: ((E = f.stats) == null ? void 0 : E.totalPromptTokens) ?? 0 }),
1461
+ /* @__PURE__ */ e($, { title: "输出 Tokens", value: ((F = f.stats) == null ? void 0 : F.totalCompletionTokens) ?? 0 }),
1457
1462
  /* @__PURE__ */ e(
1458
- B,
1463
+ $,
1459
1464
  {
1460
1465
  title: "本 AK 累计 Token",
1461
1466
  value: f.key.totalTokens ?? 0
1462
1467
  }
1463
1468
  ),
1464
1469
  /* @__PURE__ */ e(
1465
- B,
1470
+ $,
1466
1471
  {
1467
1472
  title: "错误数",
1468
1473
  value: ((G = f.stats) == null ? void 0 : G.errorCount) ?? 0,
1469
- valueStyle: (((R = f.stats) == null ? void 0 : R.errorCount) ?? 0) > 0 ? { color: "#ff4d4f" } : void 0
1474
+ valueStyle: (((H = f.stats) == null ? void 0 : H.errorCount) ?? 0) > 0 ? { color: "#ff4d4f" } : void 0
1470
1475
  }
1471
1476
  )
1472
1477
  ] }),
@@ -1501,25 +1506,25 @@ function Mt() {
1501
1506
  )
1502
1507
  ] });
1503
1508
  }
1504
- const bt = [
1505
- { key: "model-management", label: "模型管理", icon: /* @__PURE__ */ e(ze, {}) },
1506
- { key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(Re, {}) },
1507
- { key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(Ue, {}) },
1509
+ const _t = [
1510
+ { key: "model-management", label: "模型管理", icon: /* @__PURE__ */ e(Re, {}) },
1511
+ { key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(Ue, {}) },
1512
+ { key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(He, {}) },
1508
1513
  { key: "agent-app", label: "Agent 应用", icon: /* @__PURE__ */ e(Ce, {}) },
1509
- { key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(He, {}) },
1510
- { key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(je, {}) },
1511
- { key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(qe, {}) }
1514
+ { key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(je, {}) },
1515
+ { key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(qe, {}) },
1516
+ { key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(Fe, {}) }
1512
1517
  ];
1513
1518
  function Dt() {
1514
1519
  const [a, n] = S("model-management"), [l, i] = S([]), m = (y) => {
1515
1520
  i(y), n("model-chat");
1516
- }, N = Me(() => bt, []), T = (y, f, b = !1) => /* @__PURE__ */ e(
1521
+ }, N = Me(() => _t, []), v = (y, f, M = !1) => /* @__PURE__ */ e(
1517
1522
  "div",
1518
1523
  {
1519
1524
  style: {
1520
- display: a === y ? b ? "flex" : "block" : "none",
1525
+ display: a === y ? M ? "flex" : "block" : "none",
1521
1526
  height: "100%",
1522
- ...b ? { flexDirection: "column" } : {}
1527
+ ...M ? { flexDirection: "column" } : {}
1523
1528
  },
1524
1529
  children: f
1525
1530
  }
@@ -1534,13 +1539,13 @@ function Dt() {
1534
1539
  }
1535
1540
  ) }, y.key)) }) }),
1536
1541
  /* @__PURE__ */ s("main", { className: t.panelArea, children: [
1537
- T("model-management", /* @__PURE__ */ e(mt, { onStartChat: m })),
1538
- T("model-chat", /* @__PURE__ */ e(dt, { initialModels: l }), !0),
1539
- T("ak-management", /* @__PURE__ */ e(ot, {})),
1540
- T("agent-app", /* @__PURE__ */ e(We, {})),
1541
- T("mcp-service", /* @__PURE__ */ e(Ye, {})),
1542
- T("skill-market", /* @__PURE__ */ e(Ve, {})),
1543
- T("model-monitor", /* @__PURE__ */ e(Mt, {}))
1542
+ v("model-management", /* @__PURE__ */ e(ut, { onStartChat: m })),
1543
+ v("model-chat", /* @__PURE__ */ e(mt, { initialModels: l }), !0),
1544
+ v("ak-management", /* @__PURE__ */ e(it, {})),
1545
+ v("agent-app", /* @__PURE__ */ e(Ye, {})),
1546
+ v("mcp-service", /* @__PURE__ */ e(Ve, {})),
1547
+ v("skill-market", /* @__PURE__ */ e(Xe, {})),
1548
+ v("model-monitor", /* @__PURE__ */ e(Mt, {}))
1544
1549
  ] })
1545
1550
  ] });
1546
1551
  }