@yuku123/z-team-component 0.2.41 → 0.2.44
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/dist/{ComponentDoc-BztX6VlY.js → ComponentDoc-DWnW6JUe.js} +2 -2
- package/dist/{InvitationManagementPage-Bs9EVx4Z.js → InvitationManagementPage-B0b0PQD2.js} +1 -1
- package/dist/{OnboardingPage-b3GCxnH7.js → OnboardingPage-Ddb_NzR_.js} +2 -2
- package/dist/{SystemShell-j8IxtHjS.js → SystemShell-BUcxfXI4.js} +1 -1
- package/dist/{api-CBB4Fa8N.js → api-C0GU_eBD.js} +1 -1
- package/dist/{index-ClibxgPN.js → index-B_BXiKYP.js} +2 -2
- package/dist/{index-DyJp2kSb.js → index-BfRlRsfj.js} +1 -1
- package/dist/{index-D-xqQriS.js → index-CN68mjC6.js} +2 -2
- package/dist/{index-BapG4vu3.js → index-CmzNxi0H.js} +1 -1
- package/dist/{index-D-wT2z-O.js → index-Co4c3HUe.js} +2 -2
- package/dist/{index-ClJQ9FRS.js → index-DXyOudOi.js} +2 -2
- package/dist/{index-Cx9Yfc6I.js → index-QX_VEngE.js} +472 -466
- package/dist/{index-t109_mPP.js → index-c0IQjzQE.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/pages.js +1 -1
- package/dist/{webide-CTvdgMFE.js → webide-qCE8lM1s.js} +199 -197
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { CopyOutlined as se, ReloadOutlined as Ne, PlusOutlined as ve, DeleteOutlined as Pe, ClearOutlined as Ie, CloseOutlined as Be, SendOutlined as $e, RobotOutlined as Te, CloudServerOutlined as Oe, MessageOutlined as De, KeyOutlined as Le, ApiOutlined as
|
|
3
|
-
import { Tooltip as Q, Tabs as Ce, Button as z, Modal as ce, Input as Se, Drawer as we, Spin as V, Statistic as
|
|
4
|
-
import { useState as
|
|
2
|
+
import { CopyOutlined as se, ReloadOutlined as Ne, PlusOutlined as ve, DeleteOutlined as Pe, ClearOutlined as Ie, CloseOutlined as Be, SendOutlined as $e, RobotOutlined as Te, CloudServerOutlined as Oe, MessageOutlined as De, KeyOutlined as Le, ApiOutlined as ze, ToolOutlined as Re, BarChartOutlined as Ue } from "@ant-design/icons";
|
|
3
|
+
import { Tooltip as Q, Tabs as Ce, Button as z, Modal as ce, Input as Se, Drawer as we, Spin as V, Statistic as B, Table as Ae, message as F, Tag as G, Select as He, Checkbox as qe } from "antd";
|
|
4
|
+
import { useState as S, useCallback as H, useEffect as ae, useRef as de, useMemo as xe, Suspense as je, lazy as Fe } from "react";
|
|
5
5
|
import { s as t } from "./SmartWorkbench.module-xRRmpTTw.js";
|
|
6
6
|
import { AgentAppList as Ge, McpPage as Je, SkillMarket as Qe } from "@yuku123/z-agent-component";
|
|
7
7
|
const le = "ft_gateway_default_ak", X = "", ue = "";
|
|
@@ -23,7 +23,7 @@ function We(a) {
|
|
|
23
23
|
apiType: String(a.apiType ?? a.api_type ?? "OpenAPI")
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
async function
|
|
26
|
+
async function _e() {
|
|
27
27
|
let a;
|
|
28
28
|
try {
|
|
29
29
|
a = await fetch(`${X}/api/scenario-instances/0/models`, {
|
|
@@ -49,9 +49,9 @@ async function Me() {
|
|
|
49
49
|
throw new Error("模型列表返回格式异常(非数组)");
|
|
50
50
|
return l.map(We);
|
|
51
51
|
}
|
|
52
|
-
async function Ye(a, n, l,
|
|
53
|
-
var
|
|
54
|
-
const
|
|
52
|
+
async function Ye(a, n, l, o) {
|
|
53
|
+
var f, _, I, C;
|
|
54
|
+
const d = await fetch(`${ue}/v1/chat/completions`, {
|
|
55
55
|
method: "POST",
|
|
56
56
|
headers: {
|
|
57
57
|
"Content-Type": "application/json",
|
|
@@ -63,75 +63,75 @@ async function Ye(a, n, l, i) {
|
|
|
63
63
|
messages: l,
|
|
64
64
|
stream: !0
|
|
65
65
|
}),
|
|
66
|
-
signal:
|
|
66
|
+
signal: o.signal
|
|
67
67
|
});
|
|
68
|
-
if (!
|
|
69
|
-
const T = await
|
|
68
|
+
if (!d.ok || !d.body) {
|
|
69
|
+
const T = await d.text().catch(() => "");
|
|
70
70
|
if (/<!doctype html/i.test(T.slice(0, 200)))
|
|
71
71
|
throw new Error("模型网关未接入(/v1/chat/completions 落到主壳 SPA,无网关响应)");
|
|
72
|
-
let
|
|
72
|
+
let M = `HTTP ${d.status}`;
|
|
73
73
|
try {
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const p = JSON.parse(T);
|
|
75
|
+
M = ((f = p == null ? void 0 : p.error) == null ? void 0 : f.message) ?? M;
|
|
76
76
|
} catch {
|
|
77
|
-
T && (
|
|
77
|
+
T && (M = T);
|
|
78
78
|
}
|
|
79
|
-
throw new Error(
|
|
79
|
+
throw new Error(M);
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const N = d.body.getReader(), v = new TextDecoder();
|
|
82
82
|
let k = "";
|
|
83
83
|
try {
|
|
84
84
|
for (; ; ) {
|
|
85
|
-
const { done: T, value:
|
|
85
|
+
const { done: T, value: M } = await N.read();
|
|
86
86
|
if (T) break;
|
|
87
|
-
k +=
|
|
88
|
-
const
|
|
87
|
+
k += v.decode(M, { stream: !0 });
|
|
88
|
+
const p = k.split(`
|
|
89
89
|
|
|
90
90
|
`);
|
|
91
|
-
k =
|
|
92
|
-
for (const
|
|
93
|
-
let
|
|
94
|
-
for (const
|
|
91
|
+
k = p.pop() ?? "";
|
|
92
|
+
for (const c of p) {
|
|
93
|
+
let g = "";
|
|
94
|
+
for (const i of c.split(`
|
|
95
95
|
`))
|
|
96
|
-
|
|
97
|
-
if (!
|
|
98
|
-
if (
|
|
99
|
-
|
|
96
|
+
i.startsWith("data:") && (g += i.slice(5).trim());
|
|
97
|
+
if (!g || g === "[DONE]") {
|
|
98
|
+
if (g === "[DONE]") {
|
|
99
|
+
o.onDone();
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
|
-
const
|
|
106
|
-
if (Array.isArray(
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
promptTokens:
|
|
111
|
-
completionTokens:
|
|
112
|
-
totalTokens:
|
|
105
|
+
const i = JSON.parse(g), w = i == null ? void 0 : i.choices;
|
|
106
|
+
if (Array.isArray(w) && w.length > 0) {
|
|
107
|
+
const K = (_ = w[0]) == null ? void 0 : _.delta;
|
|
108
|
+
if (K != null && K.content && o.onDelta(K.content), (I = w[0]) == null ? void 0 : I.finish_reason) {
|
|
109
|
+
const m = i != null && i.usage ? {
|
|
110
|
+
promptTokens: i.usage.prompt_tokens ?? 0,
|
|
111
|
+
completionTokens: i.usage.completion_tokens ?? 0,
|
|
112
|
+
totalTokens: i.usage.total_tokens ?? 0
|
|
113
113
|
} : void 0;
|
|
114
|
-
|
|
114
|
+
o.onDone(m);
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
119
|
-
const
|
|
120
|
-
promptTokens:
|
|
121
|
-
completionTokens:
|
|
122
|
-
totalTokens:
|
|
118
|
+
if (i != null && i.usage) {
|
|
119
|
+
const K = {
|
|
120
|
+
promptTokens: i.usage.prompt_tokens ?? 0,
|
|
121
|
+
completionTokens: i.usage.completion_tokens ?? 0,
|
|
122
|
+
totalTokens: i.usage.total_tokens ?? 0
|
|
123
123
|
};
|
|
124
|
-
|
|
124
|
+
o.onDone(K);
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
} catch {
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
o.onDone();
|
|
132
132
|
} catch (T) {
|
|
133
|
-
if ((
|
|
134
|
-
throw
|
|
133
|
+
if ((C = o.signal) != null && C.aborted) return;
|
|
134
|
+
throw o.onError(T instanceof Error ? T : new Error(String(T))), T;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
async function ne(a, n) {
|
|
@@ -168,8 +168,8 @@ function Ve(a) {
|
|
|
168
168
|
secret: a.secret_key
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
async function
|
|
172
|
-
const
|
|
171
|
+
async function Me(a, n, l) {
|
|
172
|
+
const o = await fetch(`${X}/api/ak/create`, {
|
|
173
173
|
method: "POST",
|
|
174
174
|
headers: Z({ Accept: "application/json", "Content-Type": "application/json" }),
|
|
175
175
|
credentials: "include",
|
|
@@ -180,15 +180,15 @@ async function _e(a, n, l) {
|
|
|
180
180
|
ownerUserId: a,
|
|
181
181
|
ownerUserName: n
|
|
182
182
|
})
|
|
183
|
-
}),
|
|
184
|
-
return
|
|
183
|
+
}), d = await ne(o, "创建 AK"), N = (d == null ? void 0 : d.data) ?? {}, v = N.accessKey ?? "", k = N.secretKey ?? "";
|
|
184
|
+
return v && k && pe(v, k), { apiKey: k, akPrefix: v, message: "AK 已创建,secretKey 仅创建时可见" };
|
|
185
185
|
}
|
|
186
186
|
async function ie(a) {
|
|
187
187
|
const n = await fetch(
|
|
188
188
|
`${X}/api/ak/list`,
|
|
189
189
|
{ headers: Z({ Accept: "application/json" }), credentials: "include" }
|
|
190
|
-
), l = await ne(n, "获取 AK 列表"),
|
|
191
|
-
return (a ?
|
|
190
|
+
), l = await ne(n, "获取 AK 列表"), o = Array.isArray(l == null ? void 0 : l.data) ? l.data : [];
|
|
191
|
+
return (a ? o.filter((N) => !N.owner_user_id || String(N.owner_user_id) === String(a)) : o).filter((N) => (N.is_deleted ?? 0) === 0).map(Ve);
|
|
192
192
|
}
|
|
193
193
|
async function Xe(a) {
|
|
194
194
|
const n = await fetch(`${X}/api/ak/delete?id=${encodeURIComponent(String(a))}`, {
|
|
@@ -198,44 +198,60 @@ async function Xe(a) {
|
|
|
198
198
|
});
|
|
199
199
|
await ne(n, "吊销 AK");
|
|
200
200
|
}
|
|
201
|
-
async function
|
|
202
|
-
var
|
|
201
|
+
async function be(a) {
|
|
202
|
+
var T, M;
|
|
203
203
|
const n = await fetch(
|
|
204
|
-
`${X}/api/admin/llm-call-monitor/stats?hours=
|
|
204
|
+
`${X}/api/admin/llm-call-monitor/stats?hours=168`,
|
|
205
205
|
{ headers: Z({ Accept: "application/json" }), credentials: "include" }
|
|
206
|
-
), l = await ne(n, "获取调用统计"),
|
|
207
|
-
let
|
|
206
|
+
), l = await ne(n, "获取调用统计"), d = ((l == null ? void 0 : l.data) ?? {}).summary ?? {};
|
|
207
|
+
let N = [];
|
|
208
208
|
try {
|
|
209
|
-
const
|
|
209
|
+
const p = await fetch(
|
|
210
210
|
`${X}/api/admin/llm-call-monitor/recent?page=1&size=20`,
|
|
211
211
|
{ headers: Z({ Accept: "application/json" }), credentials: "include" }
|
|
212
|
-
),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
212
|
+
), c = await ne(p, "获取调用明细");
|
|
213
|
+
N = (Array.isArray((T = c == null ? void 0 : c.data) == null ? void 0 : T.records) ? c.data.records : []).map((i, w) => {
|
|
214
|
+
const K = Number(i.promptTokens ?? 0), q = Number(i.completionTokens ?? 0);
|
|
215
|
+
return {
|
|
216
|
+
id: Number(i.id ?? w),
|
|
217
|
+
apiKeyId: a,
|
|
218
|
+
protocol: "chat/completions",
|
|
219
|
+
model: String(i.model ?? ""),
|
|
220
|
+
stream: Number(i.stream ?? 0),
|
|
221
|
+
promptTokens: K,
|
|
222
|
+
completionTokens: q,
|
|
223
|
+
totalTokens: Number(i.totalTokens ?? K + q),
|
|
224
|
+
latencyMs: Number(i.durationMs ?? 0),
|
|
225
|
+
statusCode: i.success === !1 || i.success === 0 ? 500 : 200,
|
|
226
|
+
errorMsg: i.errorType ?? null,
|
|
227
|
+
createTime: String(i.createTime ?? "").replace("T", " ").slice(0, 19)
|
|
228
|
+
};
|
|
229
|
+
});
|
|
227
230
|
} catch {
|
|
228
231
|
}
|
|
232
|
+
const v = {}, k = {};
|
|
233
|
+
for (const p of N) {
|
|
234
|
+
const c = v[M = p.model] || (v[M] = [0, 0, 0]);
|
|
235
|
+
c[0] += 1, c[1] += p.promptTokens, c[2] += p.completionTokens;
|
|
236
|
+
const g = (p.createTime || "").slice(0, 10);
|
|
237
|
+
if (g) {
|
|
238
|
+
const i = k[g] || (k[g] = [0, 0, 0]);
|
|
239
|
+
i[0] += 1, i[1] += p.promptTokens, i[2] += p.completionTokens;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const f = Number(d.totalTokens ?? 0), _ = N.reduce((p, c) => p + c.totalTokens, 0), I = N.reduce((p, c) => p + c.promptTokens, 0), C = N.reduce((p, c) => p + c.completionTokens, 0);
|
|
229
243
|
return {
|
|
230
|
-
totalRequests: Number(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
244
|
+
totalRequests: Number(d.totalCount ?? 0),
|
|
245
|
+
// 汇总口径优先用后端整窗合计(后端 selectStats 才有 token 合计),
|
|
246
|
+
// 明细只有最近一页 ⇒ 只在汇总缺失时用明细兜底。
|
|
247
|
+
totalPromptTokens: Number(d.totalPromptTokens ?? 0) || I,
|
|
248
|
+
totalCompletionTokens: Number(d.totalCompletionTokens ?? 0) || C,
|
|
249
|
+
totalTokens: f || _,
|
|
250
|
+
avgLatencyMs: Number(d.avgDurationMs ?? 0),
|
|
251
|
+
errorCount: Number(d.failCount ?? 0),
|
|
252
|
+
daily: k,
|
|
253
|
+
models: v,
|
|
254
|
+
recent: N
|
|
239
255
|
};
|
|
240
256
|
}
|
|
241
257
|
function Ze() {
|
|
@@ -258,11 +274,11 @@ function et(a) {
|
|
|
258
274
|
}
|
|
259
275
|
async function tt() {
|
|
260
276
|
try {
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
277
|
+
const o = localStorage.getItem(le);
|
|
278
|
+
if (o) return o;
|
|
263
279
|
} catch {
|
|
264
280
|
}
|
|
265
|
-
const n = (await ie("").catch(() => [])).find((
|
|
281
|
+
const n = (await ie("").catch(() => [])).find((o) => o.active && o.secret);
|
|
266
282
|
if (n != null && n.secret) {
|
|
267
283
|
try {
|
|
268
284
|
localStorage.setItem(le, n.secret);
|
|
@@ -270,7 +286,7 @@ async function tt() {
|
|
|
270
286
|
}
|
|
271
287
|
return n.akPrefix && pe(n.akPrefix, n.secret), n.secret;
|
|
272
288
|
}
|
|
273
|
-
const l = await
|
|
289
|
+
const l = await Me(
|
|
274
290
|
"system-default",
|
|
275
291
|
"系统默认",
|
|
276
292
|
"智能工作台默认AK(自动创建)"
|
|
@@ -283,7 +299,7 @@ async function tt() {
|
|
|
283
299
|
}
|
|
284
300
|
return l.apiKey;
|
|
285
301
|
}
|
|
286
|
-
function
|
|
302
|
+
function Ke() {
|
|
287
303
|
try {
|
|
288
304
|
localStorage.removeItem(le);
|
|
289
305
|
} catch {
|
|
@@ -315,42 +331,42 @@ curl -X POST ${a}/v1/messages \\
|
|
|
315
331
|
}'`;
|
|
316
332
|
}
|
|
317
333
|
function st() {
|
|
318
|
-
const [a, n] =
|
|
334
|
+
const [a, n] = S("personal"), [l, o] = S([]), [d, N] = S([]), [v, k] = S(!0), [f, _] = S(!1), [I, C] = S(!1), [T, M] = S(""), [p, c] = S({ open: !1 }), [g, i] = S(null), [w, K] = S(null), [q, m] = S(!1), P = "zifang", D = "zifang", E = Ze(), j = H(async () => {
|
|
319
335
|
k(!0);
|
|
320
336
|
try {
|
|
321
|
-
const [
|
|
337
|
+
const [h, x] = await Promise.all([
|
|
322
338
|
ie("system-default").catch(() => []),
|
|
323
|
-
ie(
|
|
339
|
+
ie(P).catch(() => [])
|
|
324
340
|
]);
|
|
325
|
-
|
|
341
|
+
o(h), N(x);
|
|
326
342
|
} finally {
|
|
327
343
|
k(!1);
|
|
328
344
|
}
|
|
329
|
-
}, [
|
|
345
|
+
}, [P]);
|
|
330
346
|
ae(() => {
|
|
331
347
|
j();
|
|
332
348
|
}, [j]);
|
|
333
349
|
const r = () => {
|
|
334
|
-
|
|
335
|
-
},
|
|
350
|
+
M(""), C(!0);
|
|
351
|
+
}, u = async () => {
|
|
336
352
|
if (!T.trim()) {
|
|
337
353
|
F.warning("请输入 AK 名称");
|
|
338
354
|
return;
|
|
339
355
|
}
|
|
340
|
-
|
|
356
|
+
_(!0);
|
|
341
357
|
try {
|
|
342
|
-
const
|
|
343
|
-
pe(
|
|
358
|
+
const h = await Me(P, D, T.trim());
|
|
359
|
+
pe(h.akPrefix, h.apiKey), C(!1), c({
|
|
344
360
|
open: !0,
|
|
345
|
-
apiKey:
|
|
346
|
-
akPrefix:
|
|
361
|
+
apiKey: h.apiKey,
|
|
362
|
+
akPrefix: h.akPrefix
|
|
347
363
|
}), j();
|
|
348
|
-
} catch (
|
|
349
|
-
F.error(
|
|
364
|
+
} catch (h) {
|
|
365
|
+
F.error(h instanceof Error ? h.message : "创建 AK 失败");
|
|
350
366
|
} finally {
|
|
351
|
-
|
|
367
|
+
_(!1);
|
|
352
368
|
}
|
|
353
|
-
},
|
|
369
|
+
}, A = (h) => {
|
|
354
370
|
ce.confirm({
|
|
355
371
|
title: "确认吊销此 AK?",
|
|
356
372
|
content: "吊销后此 AK 将立即失效,无法恢复。",
|
|
@@ -359,75 +375,75 @@ function st() {
|
|
|
359
375
|
cancelText: "取消",
|
|
360
376
|
onOk: async () => {
|
|
361
377
|
try {
|
|
362
|
-
await Xe(
|
|
363
|
-
} catch (
|
|
364
|
-
F.error(
|
|
378
|
+
await Xe(h), F.success("AK 已吊销"), j(), Ke();
|
|
379
|
+
} catch (x) {
|
|
380
|
+
F.error(x instanceof Error ? x.message : "吊销失败");
|
|
365
381
|
}
|
|
366
382
|
}
|
|
367
383
|
});
|
|
368
|
-
},
|
|
369
|
-
navigator.clipboard.writeText(
|
|
370
|
-
}, J = (
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
},
|
|
374
|
-
|
|
384
|
+
}, b = (h) => {
|
|
385
|
+
navigator.clipboard.writeText(h).then(() => F.success("已复制到剪贴板")).catch(() => F.warning("复制失败,请手动复制"));
|
|
386
|
+
}, J = (h) => {
|
|
387
|
+
const x = et(h.akPrefix);
|
|
388
|
+
x ? b(x) : (b(h.akPrefix), F.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
|
|
389
|
+
}, $ = async (h) => {
|
|
390
|
+
i(h), m(!0), K(null);
|
|
375
391
|
try {
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
} catch (
|
|
379
|
-
F.error(
|
|
392
|
+
const x = await be(h.id);
|
|
393
|
+
K(x);
|
|
394
|
+
} catch (x) {
|
|
395
|
+
F.error(x instanceof Error ? x.message : "获取用量失败");
|
|
380
396
|
} finally {
|
|
381
|
-
|
|
397
|
+
m(!1);
|
|
382
398
|
}
|
|
383
399
|
}, W = () => {
|
|
384
|
-
|
|
385
|
-
}, oe = (
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
400
|
+
i(null), K(null);
|
|
401
|
+
}, oe = (h) => {
|
|
402
|
+
const x = Object.entries(h);
|
|
403
|
+
if (x.length === 0)
|
|
388
404
|
return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
389
|
-
const Y = Math.max(...
|
|
390
|
-
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children:
|
|
391
|
-
const ge =
|
|
405
|
+
const Y = Math.max(...x.map(([, y]) => y[1] + y[2]), 1);
|
|
406
|
+
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: x.map(([y, R]) => {
|
|
407
|
+
const ge = R[1] + R[2], Ee = ge / Y * 100;
|
|
392
408
|
return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
|
|
393
|
-
/* @__PURE__ */ e(Q, { title: `${
|
|
409
|
+
/* @__PURE__ */ e(Q, { title: `${y}: ${R[0]}次 / ${ge} tokens`, children: /* @__PURE__ */ e(
|
|
394
410
|
"div",
|
|
395
411
|
{
|
|
396
412
|
className: t.usageBar,
|
|
397
|
-
style: { height: `${Math.max(
|
|
413
|
+
style: { height: `${Math.max(Ee, 2)}%` }
|
|
398
414
|
}
|
|
399
415
|
) }),
|
|
400
|
-
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children:
|
|
401
|
-
] },
|
|
416
|
+
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children: y })
|
|
417
|
+
] }, y);
|
|
402
418
|
}) });
|
|
403
|
-
},
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
419
|
+
}, L = (h) => {
|
|
420
|
+
const x = Object.entries(h);
|
|
421
|
+
if (x.length === 0)
|
|
406
422
|
return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
407
|
-
const Y = Math.max(...
|
|
408
|
-
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children:
|
|
409
|
-
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children:
|
|
423
|
+
const Y = Math.max(...x.map(([, y]) => y[0]), 1);
|
|
424
|
+
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: x.sort((y, R) => R[1][0] - y[1][0]).map(([y, R]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
|
|
425
|
+
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: y }),
|
|
410
426
|
/* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
|
|
411
427
|
"div",
|
|
412
428
|
{
|
|
413
429
|
className: t.modelBreakdownFill,
|
|
414
|
-
style: { width: `${
|
|
430
|
+
style: { width: `${R[0] / Y * 100}%` }
|
|
415
431
|
}
|
|
416
432
|
) }),
|
|
417
433
|
/* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
|
|
418
|
-
|
|
434
|
+
R[0],
|
|
419
435
|
"次 / ",
|
|
420
|
-
|
|
436
|
+
R[1] + (R[2] || 0),
|
|
421
437
|
"tokens"
|
|
422
438
|
] })
|
|
423
|
-
] },
|
|
424
|
-
},
|
|
439
|
+
] }, y)) });
|
|
440
|
+
}, U = [
|
|
425
441
|
{
|
|
426
442
|
title: "时间",
|
|
427
443
|
dataIndex: "createTime",
|
|
428
444
|
key: "createTime",
|
|
429
445
|
width: 160,
|
|
430
|
-
render: (
|
|
446
|
+
render: (h) => h ? new Date(h).toLocaleString("zh-CN") : "-"
|
|
431
447
|
},
|
|
432
448
|
{ title: "模型", dataIndex: "model", key: "model", width: 140 },
|
|
433
449
|
{
|
|
@@ -435,7 +451,7 @@ function st() {
|
|
|
435
451
|
dataIndex: "protocol",
|
|
436
452
|
key: "protocol",
|
|
437
453
|
width: 90,
|
|
438
|
-
render: (
|
|
454
|
+
render: (h) => /* @__PURE__ */ e(G, { children: h })
|
|
439
455
|
},
|
|
440
456
|
{
|
|
441
457
|
title: "输入",
|
|
@@ -460,59 +476,59 @@ function st() {
|
|
|
460
476
|
dataIndex: "latencyMs",
|
|
461
477
|
key: "latencyMs",
|
|
462
478
|
width: 70,
|
|
463
|
-
render: (
|
|
479
|
+
render: (h) => h ? `${h}ms` : "-"
|
|
464
480
|
},
|
|
465
481
|
{
|
|
466
482
|
title: "状态",
|
|
467
483
|
dataIndex: "statusCode",
|
|
468
484
|
key: "statusCode",
|
|
469
485
|
width: 60,
|
|
470
|
-
render: (
|
|
486
|
+
render: (h) => h ? /* @__PURE__ */ e(G, { color: h < 400 ? "green" : "red", children: h }) : "-"
|
|
471
487
|
}
|
|
472
|
-
], ee = (
|
|
473
|
-
const Y = Array.isArray(
|
|
474
|
-
return
|
|
488
|
+
], ee = (h, x) => {
|
|
489
|
+
const Y = Array.isArray(h) ? h : [];
|
|
490
|
+
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: x ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: Y.map((y) => /* @__PURE__ */ s(
|
|
475
491
|
"div",
|
|
476
492
|
{
|
|
477
493
|
className: t.akCard,
|
|
478
|
-
onClick: () =>
|
|
494
|
+
onClick: () => $(y),
|
|
479
495
|
children: [
|
|
480
496
|
/* @__PURE__ */ s("div", { className: t.akCardRow, children: [
|
|
481
|
-
/* @__PURE__ */ e("span", { className: t.akTitle, children:
|
|
482
|
-
/* @__PURE__ */ e("code", { className: t.akPrefixSmall, children:
|
|
497
|
+
/* @__PURE__ */ e("span", { className: t.akTitle, children: y.description || y.akPrefix.replace("...", "**") }),
|
|
498
|
+
/* @__PURE__ */ e("code", { className: t.akPrefixSmall, children: y.akPrefix.replace("...", "**") }),
|
|
483
499
|
/* @__PURE__ */ e(
|
|
484
500
|
"span",
|
|
485
501
|
{
|
|
486
|
-
className: `${t.akStatus} ${
|
|
487
|
-
children:
|
|
502
|
+
className: `${t.akStatus} ${y.active ? t.akStatusActive : t.akStatusRevoked}`,
|
|
503
|
+
children: y.active ? "活跃" : "已吊销"
|
|
488
504
|
}
|
|
489
505
|
),
|
|
490
|
-
|
|
506
|
+
y.defaultModel && /* @__PURE__ */ s(G, { style: { fontSize: 11 }, children: [
|
|
491
507
|
"默认: ",
|
|
492
|
-
|
|
508
|
+
y.defaultModel
|
|
493
509
|
] }),
|
|
494
510
|
/* @__PURE__ */ s(
|
|
495
511
|
"div",
|
|
496
512
|
{
|
|
497
513
|
className: t.akCardActions,
|
|
498
|
-
onClick: (
|
|
514
|
+
onClick: (R) => R.stopPropagation(),
|
|
499
515
|
children: [
|
|
500
516
|
/* @__PURE__ */ e(Q, { title: "复制完整 AK", children: /* @__PURE__ */ e(
|
|
501
517
|
z,
|
|
502
518
|
{
|
|
503
519
|
size: "small",
|
|
504
520
|
icon: /* @__PURE__ */ e(se, {}),
|
|
505
|
-
onClick: () => J(
|
|
521
|
+
onClick: () => J(y),
|
|
506
522
|
children: "复制"
|
|
507
523
|
}
|
|
508
524
|
) }),
|
|
509
|
-
!
|
|
525
|
+
!x && y.active && /* @__PURE__ */ e(
|
|
510
526
|
z,
|
|
511
527
|
{
|
|
512
528
|
size: "small",
|
|
513
529
|
danger: !0,
|
|
514
530
|
icon: /* @__PURE__ */ e(Pe, {}),
|
|
515
|
-
onClick: () =>
|
|
531
|
+
onClick: () => A(y.id),
|
|
516
532
|
children: "吊销"
|
|
517
533
|
}
|
|
518
534
|
)
|
|
@@ -527,27 +543,27 @@ function st() {
|
|
|
527
543
|
className: t.akMiniBarFill,
|
|
528
544
|
style: {
|
|
529
545
|
width: `${Math.min(
|
|
530
|
-
(
|
|
546
|
+
(y.totalTokens || 0) / (y.tokenQuota || ke) * 100,
|
|
531
547
|
100
|
|
532
548
|
)}%`
|
|
533
549
|
}
|
|
534
550
|
}
|
|
535
551
|
) }),
|
|
536
552
|
/* @__PURE__ */ s("span", { className: t.akUsageText, children: [
|
|
537
|
-
fe(
|
|
553
|
+
fe(y.totalTokens || 0),
|
|
538
554
|
" /",
|
|
539
555
|
" ",
|
|
540
|
-
fe(
|
|
556
|
+
fe(y.tokenQuota || ke)
|
|
541
557
|
] }),
|
|
542
558
|
/* @__PURE__ */ s("span", { className: t.akMetaText, children: [
|
|
543
|
-
|
|
559
|
+
y.totalRequests || 0,
|
|
544
560
|
" 次请求"
|
|
545
561
|
] }),
|
|
546
|
-
/* @__PURE__ */ e("span", { className: t.akMetaText, children: new Date(
|
|
562
|
+
/* @__PURE__ */ e("span", { className: t.akMetaText, children: new Date(y.createTime).toLocaleDateString("zh-CN") })
|
|
547
563
|
] })
|
|
548
564
|
]
|
|
549
565
|
},
|
|
550
|
-
|
|
566
|
+
y.id
|
|
551
567
|
)) });
|
|
552
568
|
};
|
|
553
569
|
return /* @__PURE__ */ s("div", { className: t.akContainer, children: [
|
|
@@ -556,23 +572,23 @@ function st() {
|
|
|
556
572
|
/* @__PURE__ */ s("div", { className: t.akBaseUrlRow, children: [
|
|
557
573
|
/* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
|
|
558
574
|
/* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "OpenAI 兼容" }),
|
|
559
|
-
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children:
|
|
575
|
+
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: E }),
|
|
560
576
|
/* @__PURE__ */ e(Q, { title: "复制 Base URL", children: /* @__PURE__ */ e(
|
|
561
577
|
se,
|
|
562
578
|
{
|
|
563
579
|
className: t.akCopyIcon,
|
|
564
|
-
onClick: () =>
|
|
580
|
+
onClick: () => b(E)
|
|
565
581
|
}
|
|
566
582
|
) })
|
|
567
583
|
] }),
|
|
568
584
|
/* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
|
|
569
585
|
/* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "Anthropic 兼容" }),
|
|
570
|
-
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children:
|
|
586
|
+
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: E }),
|
|
571
587
|
/* @__PURE__ */ e(Q, { title: "复制 Base URL", children: /* @__PURE__ */ e(
|
|
572
588
|
se,
|
|
573
589
|
{
|
|
574
590
|
className: t.akCopyIcon,
|
|
575
|
-
onClick: () =>
|
|
591
|
+
onClick: () => b(E)
|
|
576
592
|
}
|
|
577
593
|
) })
|
|
578
594
|
] })
|
|
@@ -580,11 +596,11 @@ function st() {
|
|
|
580
596
|
/* @__PURE__ */ s("div", { className: t.akIntegrationGrid, children: [
|
|
581
597
|
/* @__PURE__ */ s("div", { children: [
|
|
582
598
|
/* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "OpenAI 兼容 — curl 示例" }),
|
|
583
|
-
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: at(
|
|
599
|
+
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: at(E) })
|
|
584
600
|
] }),
|
|
585
601
|
/* @__PURE__ */ s("div", { children: [
|
|
586
602
|
/* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "Anthropic 兼容 — curl 示例" }),
|
|
587
|
-
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: nt(
|
|
603
|
+
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: nt(E) })
|
|
588
604
|
] })
|
|
589
605
|
] })
|
|
590
606
|
] }),
|
|
@@ -603,7 +619,7 @@ function st() {
|
|
|
603
619
|
Ce,
|
|
604
620
|
{
|
|
605
621
|
activeKey: a,
|
|
606
|
-
onChange: (
|
|
622
|
+
onChange: (h) => n(h),
|
|
607
623
|
items: [
|
|
608
624
|
{ key: "app", label: "应用 AK" },
|
|
609
625
|
{ key: "personal", label: "个人 AK" }
|
|
@@ -619,7 +635,7 @@ function st() {
|
|
|
619
635
|
type: "primary",
|
|
620
636
|
icon: /* @__PURE__ */ e(ve, {}),
|
|
621
637
|
onClick: r,
|
|
622
|
-
loading:
|
|
638
|
+
loading: f,
|
|
623
639
|
children: "生成 AK"
|
|
624
640
|
}
|
|
625
641
|
)
|
|
@@ -627,18 +643,18 @@ function st() {
|
|
|
627
643
|
]
|
|
628
644
|
}
|
|
629
645
|
),
|
|
630
|
-
a === "app" ? ee(l, !0) : ee(
|
|
646
|
+
a === "app" ? ee(l, !0) : ee(d, !1)
|
|
631
647
|
] }),
|
|
632
648
|
/* @__PURE__ */ s(
|
|
633
649
|
ce,
|
|
634
650
|
{
|
|
635
|
-
open:
|
|
651
|
+
open: I,
|
|
636
652
|
title: "生成新 AK",
|
|
637
|
-
onCancel: () =>
|
|
638
|
-
onOk:
|
|
653
|
+
onCancel: () => C(!1),
|
|
654
|
+
onOk: u,
|
|
639
655
|
okText: "确认生成",
|
|
640
656
|
cancelText: "取消",
|
|
641
|
-
confirmLoading:
|
|
657
|
+
confirmLoading: f,
|
|
642
658
|
children: [
|
|
643
659
|
/* @__PURE__ */ e(
|
|
644
660
|
"div",
|
|
@@ -656,8 +672,8 @@ function st() {
|
|
|
656
672
|
{
|
|
657
673
|
placeholder: "例如:测试用 AK、生产网关 AK",
|
|
658
674
|
value: T,
|
|
659
|
-
onChange: (
|
|
660
|
-
onPressEnter:
|
|
675
|
+
onChange: (h) => M(h.target.value),
|
|
676
|
+
onPressEnter: u,
|
|
661
677
|
maxLength: 50,
|
|
662
678
|
autoFocus: !0
|
|
663
679
|
}
|
|
@@ -668,15 +684,15 @@ function st() {
|
|
|
668
684
|
/* @__PURE__ */ s(
|
|
669
685
|
ce,
|
|
670
686
|
{
|
|
671
|
-
open:
|
|
687
|
+
open: p.open,
|
|
672
688
|
title: "AK 创建成功",
|
|
673
|
-
onCancel: () =>
|
|
689
|
+
onCancel: () => c({ open: !1 }),
|
|
674
690
|
footer: [
|
|
675
691
|
/* @__PURE__ */ e(
|
|
676
692
|
z,
|
|
677
693
|
{
|
|
678
694
|
icon: /* @__PURE__ */ e(se, {}),
|
|
679
|
-
onClick: () =>
|
|
695
|
+
onClick: () => p.apiKey && b(p.apiKey),
|
|
680
696
|
children: "复制 AK"
|
|
681
697
|
},
|
|
682
698
|
"copy"
|
|
@@ -685,7 +701,7 @@ function st() {
|
|
|
685
701
|
z,
|
|
686
702
|
{
|
|
687
703
|
type: "primary",
|
|
688
|
-
onClick: () =>
|
|
704
|
+
onClick: () => c({ open: !1 }),
|
|
689
705
|
children: "我已保存"
|
|
690
706
|
},
|
|
691
707
|
"close"
|
|
@@ -705,12 +721,12 @@ function st() {
|
|
|
705
721
|
wordBreak: "break-all",
|
|
706
722
|
userSelect: "all"
|
|
707
723
|
},
|
|
708
|
-
children:
|
|
724
|
+
children: p.apiKey
|
|
709
725
|
}
|
|
710
726
|
),
|
|
711
727
|
/* @__PURE__ */ s("div", { style: { marginTop: 8, fontSize: 12, color: "var(--text-muted)" }, children: [
|
|
712
728
|
"前缀: ",
|
|
713
|
-
|
|
729
|
+
p.akPrefix
|
|
714
730
|
] })
|
|
715
731
|
]
|
|
716
732
|
}
|
|
@@ -718,47 +734,47 @@ function st() {
|
|
|
718
734
|
/* @__PURE__ */ e(
|
|
719
735
|
we,
|
|
720
736
|
{
|
|
721
|
-
title:
|
|
737
|
+
title: g ? /* @__PURE__ */ s("span", { children: [
|
|
722
738
|
"AK 详情 — ",
|
|
723
|
-
/* @__PURE__ */ e("code", { children:
|
|
739
|
+
/* @__PURE__ */ e("code", { children: g.akPrefix })
|
|
724
740
|
] }) : "AK 详情",
|
|
725
|
-
open: !!
|
|
741
|
+
open: !!g,
|
|
726
742
|
onClose: W,
|
|
727
743
|
size: "large",
|
|
728
|
-
children:
|
|
744
|
+
children: q ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载用量数据..." }) }) : w ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
|
|
729
745
|
/* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
|
|
730
|
-
/* @__PURE__ */ e(
|
|
731
|
-
/* @__PURE__ */ e(
|
|
746
|
+
/* @__PURE__ */ e(B, { title: "总请求数", value: w.totalRequests }),
|
|
747
|
+
/* @__PURE__ */ e(B, { title: "总 Token", value: w.totalTokens }),
|
|
732
748
|
/* @__PURE__ */ e(
|
|
733
|
-
|
|
749
|
+
B,
|
|
734
750
|
{
|
|
735
751
|
title: "输入 Token",
|
|
736
|
-
value:
|
|
752
|
+
value: w.totalPromptTokens
|
|
737
753
|
}
|
|
738
754
|
),
|
|
739
755
|
/* @__PURE__ */ e(
|
|
740
|
-
|
|
756
|
+
B,
|
|
741
757
|
{
|
|
742
758
|
title: "输出 Token",
|
|
743
|
-
value:
|
|
759
|
+
value: w.totalCompletionTokens
|
|
744
760
|
}
|
|
745
761
|
),
|
|
746
762
|
/* @__PURE__ */ e(
|
|
747
|
-
|
|
763
|
+
B,
|
|
748
764
|
{
|
|
749
765
|
title: "平均耗时",
|
|
750
|
-
value:
|
|
766
|
+
value: w.avgLatencyMs,
|
|
751
767
|
suffix: "ms"
|
|
752
768
|
}
|
|
753
769
|
),
|
|
754
770
|
/* @__PURE__ */ e(
|
|
755
|
-
|
|
771
|
+
B,
|
|
756
772
|
{
|
|
757
773
|
title: "错误数",
|
|
758
|
-
value:
|
|
774
|
+
value: w.errorCount,
|
|
759
775
|
styles: {
|
|
760
776
|
content: {
|
|
761
|
-
color:
|
|
777
|
+
color: w.errorCount > 0 ? "#ff4d4f" : void 0
|
|
762
778
|
}
|
|
763
779
|
}
|
|
764
780
|
}
|
|
@@ -766,19 +782,19 @@ function st() {
|
|
|
766
782
|
] }),
|
|
767
783
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
768
784
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "每日调用曲线(近 30 天)" }),
|
|
769
|
-
oe(
|
|
785
|
+
oe(w.daily)
|
|
770
786
|
] }),
|
|
771
787
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
772
788
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "模型用量分布" }),
|
|
773
|
-
|
|
789
|
+
L(w.models)
|
|
774
790
|
] }),
|
|
775
791
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
776
792
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "最近调用记录" }),
|
|
777
793
|
/* @__PURE__ */ e(
|
|
778
794
|
Ae,
|
|
779
795
|
{
|
|
780
|
-
columns:
|
|
781
|
-
dataSource:
|
|
796
|
+
columns: U,
|
|
797
|
+
dataSource: w.recent,
|
|
782
798
|
rowKey: "id",
|
|
783
799
|
size: "small",
|
|
784
800
|
pagination: {
|
|
@@ -786,7 +802,7 @@ function st() {
|
|
|
786
802
|
size: "small",
|
|
787
803
|
showSizeChanger: !0,
|
|
788
804
|
pageSizeOptions: ["10", "20", "50", "100"],
|
|
789
|
-
showTotal: (
|
|
805
|
+
showTotal: (h) => `共 ${h} 条`
|
|
790
806
|
},
|
|
791
807
|
scroll: { x: 760 }
|
|
792
808
|
}
|
|
@@ -801,58 +817,58 @@ function rt(a) {
|
|
|
801
817
|
const n = [];
|
|
802
818
|
if (!a) return n;
|
|
803
819
|
const l = /<(think|thinking|reasoning)>([\s\S]*?)<\/\1>/gi;
|
|
804
|
-
let
|
|
805
|
-
for (; (
|
|
806
|
-
|
|
807
|
-
return
|
|
820
|
+
let o = 0, d;
|
|
821
|
+
for (; (d = l.exec(a)) !== null; )
|
|
822
|
+
d.index > o && n.push({ type: "text", text: a.slice(o, d.index) }), n.push({ type: "think", text: d[2] }), o = d.index + d[0].length;
|
|
823
|
+
return o < a.length && n.push({ type: "text", text: a.slice(o) }), n;
|
|
808
824
|
}
|
|
809
825
|
const re = 4;
|
|
810
826
|
let lt = 0;
|
|
811
827
|
function it({ initialModels: a }) {
|
|
812
|
-
const [n, l] =
|
|
828
|
+
const [n, l] = S([]), [o, d] = S([]), [N, v] = S(!0), [k, f] = S(null), [_, I] = S(""), [C, T] = S(!1), M = de(""), p = de(/* @__PURE__ */ new Map()), c = de(/* @__PURE__ */ new Map());
|
|
813
829
|
ae(() => {
|
|
814
830
|
(async () => {
|
|
815
831
|
try {
|
|
816
|
-
const r = await
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
l(
|
|
832
|
+
const r = await _e();
|
|
833
|
+
d(r), v(!1);
|
|
834
|
+
const u = a.length > 0 ? a : r.slice(0, 1).map((A) => A.modelName);
|
|
835
|
+
l(u.slice(0, re).map((A) => me(A)));
|
|
820
836
|
} catch (r) {
|
|
821
|
-
|
|
837
|
+
v(!1), f(r instanceof Error ? r.message : "模型列表加载失败");
|
|
822
838
|
}
|
|
823
839
|
})();
|
|
824
840
|
}, []), ae(() => {
|
|
825
|
-
if (a.length > 0 &&
|
|
826
|
-
const r = a.slice(0, re).map((
|
|
841
|
+
if (a.length > 0 && o.length > 0) {
|
|
842
|
+
const r = a.slice(0, re).map((u) => me(u));
|
|
827
843
|
l(r);
|
|
828
844
|
}
|
|
829
845
|
}, [a.join(",")]);
|
|
830
|
-
const
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
}, []),
|
|
834
|
-
(r,
|
|
835
|
-
l((
|
|
846
|
+
const g = H((r) => {
|
|
847
|
+
const u = c.current.get(r);
|
|
848
|
+
u && (u.scrollTop = u.scrollHeight);
|
|
849
|
+
}, []), i = H(
|
|
850
|
+
(r, u) => {
|
|
851
|
+
l((A) => A.map((b) => b.id === r ? u(b) : b));
|
|
836
852
|
},
|
|
837
853
|
[]
|
|
838
|
-
),
|
|
839
|
-
if (
|
|
854
|
+
), w = H(async () => {
|
|
855
|
+
if (M.current) return M.current;
|
|
840
856
|
const r = await tt();
|
|
841
|
-
return
|
|
842
|
-
}, []),
|
|
843
|
-
const r =
|
|
844
|
-
if (!r ||
|
|
845
|
-
let
|
|
857
|
+
return M.current = r, r;
|
|
858
|
+
}, []), K = H(async () => {
|
|
859
|
+
const r = _.trim();
|
|
860
|
+
if (!r || C) return;
|
|
861
|
+
let u;
|
|
846
862
|
try {
|
|
847
|
-
|
|
863
|
+
u = await w();
|
|
848
864
|
} catch {
|
|
849
865
|
return;
|
|
850
866
|
}
|
|
851
|
-
|
|
852
|
-
const
|
|
853
|
-
|
|
867
|
+
I(""), T(!0);
|
|
868
|
+
const A = n.map(($) => ({
|
|
869
|
+
...$,
|
|
854
870
|
messages: [
|
|
855
|
-
|
|
871
|
+
...$.messages,
|
|
856
872
|
{ role: "user", content: r },
|
|
857
873
|
{ role: "assistant", content: "" }
|
|
858
874
|
],
|
|
@@ -861,63 +877,63 @@ function it({ initialModels: a }) {
|
|
|
861
877
|
error: null,
|
|
862
878
|
usage: null
|
|
863
879
|
}));
|
|
864
|
-
l(
|
|
865
|
-
const
|
|
866
|
-
|
|
880
|
+
l(A);
|
|
881
|
+
const b = A;
|
|
882
|
+
b.forEach(($) => {
|
|
867
883
|
const W = new AbortController();
|
|
868
|
-
|
|
869
|
-
const oe =
|
|
870
|
-
Ye(
|
|
871
|
-
onDelta: (
|
|
872
|
-
|
|
873
|
-
...
|
|
874
|
-
streamingContent:
|
|
875
|
-
messages:
|
|
876
|
-
(ee,
|
|
884
|
+
p.current.set($.id, W);
|
|
885
|
+
const oe = $.messages.slice(0, -1);
|
|
886
|
+
Ye(u, $.model, oe, {
|
|
887
|
+
onDelta: (L) => {
|
|
888
|
+
i($.id, (U) => ({
|
|
889
|
+
...U,
|
|
890
|
+
streamingContent: U.streamingContent + L,
|
|
891
|
+
messages: U.messages.map(
|
|
892
|
+
(ee, h) => h === U.messages.length - 1 ? { ...ee, content: U.streamingContent + L } : ee
|
|
877
893
|
)
|
|
878
|
-
})),
|
|
894
|
+
})), g($.id);
|
|
879
895
|
},
|
|
880
|
-
onDone: (
|
|
881
|
-
|
|
882
|
-
...
|
|
896
|
+
onDone: (L) => {
|
|
897
|
+
i($.id, (U) => ({
|
|
898
|
+
...U,
|
|
883
899
|
isStreaming: !1,
|
|
884
|
-
usage:
|
|
885
|
-
promptTokens:
|
|
886
|
-
completionTokens:
|
|
887
|
-
totalTokens:
|
|
900
|
+
usage: L ? {
|
|
901
|
+
promptTokens: L.promptTokens,
|
|
902
|
+
completionTokens: L.completionTokens,
|
|
903
|
+
totalTokens: L.totalTokens
|
|
888
904
|
} : null
|
|
889
|
-
})),
|
|
905
|
+
})), p.current.delete($.id);
|
|
890
906
|
},
|
|
891
|
-
onError: (
|
|
892
|
-
(
|
|
893
|
-
...
|
|
907
|
+
onError: (L) => {
|
|
908
|
+
(L.message.includes("401") || L.message.includes("API key")) && (Ke(), M.current = ""), i($.id, (U) => ({
|
|
909
|
+
...U,
|
|
894
910
|
isStreaming: !1,
|
|
895
|
-
error:
|
|
896
|
-
})),
|
|
911
|
+
error: L.message
|
|
912
|
+
})), p.current.delete($.id);
|
|
897
913
|
},
|
|
898
914
|
signal: W.signal
|
|
899
915
|
}).catch(() => {
|
|
900
916
|
});
|
|
901
917
|
});
|
|
902
918
|
const J = setInterval(() => {
|
|
903
|
-
|
|
904
|
-
(W) => !
|
|
919
|
+
b.every(
|
|
920
|
+
(W) => !p.current.has(W.id)
|
|
905
921
|
) && (clearInterval(J), T(!1));
|
|
906
922
|
}, 200);
|
|
907
923
|
setTimeout(() => {
|
|
908
924
|
clearInterval(J), T(!1);
|
|
909
925
|
}, 300 * 1e3);
|
|
910
|
-
}, [
|
|
911
|
-
|
|
912
|
-
}, []),
|
|
913
|
-
var
|
|
926
|
+
}, [_, C, n, w, i, g]), q = H(() => {
|
|
927
|
+
p.current.forEach((r) => r.abort()), p.current.clear(), l((r) => r.map((u) => ({ ...u, isStreaming: !1 }))), T(!1);
|
|
928
|
+
}, []), m = H(() => {
|
|
929
|
+
var u;
|
|
914
930
|
if (n.length >= re) return;
|
|
915
|
-
const r = (
|
|
916
|
-
r && l((
|
|
917
|
-
}, [n,
|
|
918
|
-
|
|
919
|
-
(r) => r.map((
|
|
920
|
-
...
|
|
931
|
+
const r = (u = o.find((A) => !n.some((b) => b.model === A.modelName))) == null ? void 0 : u.modelName;
|
|
932
|
+
r && l((A) => [...A, me(r)]);
|
|
933
|
+
}, [n, o]), P = H(() => {
|
|
934
|
+
p.current.forEach((r) => r.abort()), p.current.clear(), l(
|
|
935
|
+
(r) => r.map((u) => ({
|
|
936
|
+
...u,
|
|
921
937
|
messages: [],
|
|
922
938
|
streamingContent: "",
|
|
923
939
|
isStreaming: !1,
|
|
@@ -925,19 +941,19 @@ function it({ initialModels: a }) {
|
|
|
925
941
|
usage: null
|
|
926
942
|
}))
|
|
927
943
|
), T(!1);
|
|
928
|
-
}, [
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
}, []),
|
|
932
|
-
(r,
|
|
933
|
-
|
|
944
|
+
}, [C, n]), D = H((r) => {
|
|
945
|
+
const u = p.current.get(r);
|
|
946
|
+
u && u.abort(), p.current.delete(r), l((A) => A.filter((b) => b.id !== r));
|
|
947
|
+
}, []), E = H(
|
|
948
|
+
(r, u) => {
|
|
949
|
+
i(r, (A) => ({ ...A, model: u }));
|
|
934
950
|
},
|
|
935
|
-
[
|
|
936
|
-
), j =
|
|
951
|
+
[i]
|
|
952
|
+
), j = o.map((r) => ({
|
|
937
953
|
label: r.modelName,
|
|
938
954
|
value: r.modelName
|
|
939
955
|
}));
|
|
940
|
-
return
|
|
956
|
+
return N ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载模型列表..." }) }) : k ? /* @__PURE__ */ s("div", { className: t.chatContainer, children: [
|
|
941
957
|
/* @__PURE__ */ e("div", { className: t.chatHeader, children: /* @__PURE__ */ e("h3", { className: t.chatTitle, children: "模型对话" }) }),
|
|
942
958
|
/* @__PURE__ */ s("div", { className: t.akEmpty, children: [
|
|
943
959
|
"模型列表加载失败:",
|
|
@@ -957,8 +973,8 @@ function it({ initialModels: a }) {
|
|
|
957
973
|
{
|
|
958
974
|
size: "small",
|
|
959
975
|
icon: /* @__PURE__ */ e(Ie, {}),
|
|
960
|
-
onClick:
|
|
961
|
-
disabled:
|
|
976
|
+
onClick: P,
|
|
977
|
+
disabled: C || n.every((r) => r.messages.length === 0),
|
|
962
978
|
children: "清空重新来"
|
|
963
979
|
}
|
|
964
980
|
)
|
|
@@ -967,11 +983,11 @@ function it({ initialModels: a }) {
|
|
|
967
983
|
n.map((r) => /* @__PURE__ */ s("div", { className: t.chatPanel, children: [
|
|
968
984
|
/* @__PURE__ */ s("div", { className: t.chatPanelHeader, children: [
|
|
969
985
|
/* @__PURE__ */ e(
|
|
970
|
-
|
|
986
|
+
He,
|
|
971
987
|
{
|
|
972
988
|
size: "small",
|
|
973
989
|
value: r.model,
|
|
974
|
-
onChange: (
|
|
990
|
+
onChange: (u) => E(r.id, u),
|
|
975
991
|
options: j,
|
|
976
992
|
style: { minWidth: 140, flex: 1 },
|
|
977
993
|
showSearch: !0,
|
|
@@ -982,7 +998,7 @@ function it({ initialModels: a }) {
|
|
|
982
998
|
"span",
|
|
983
999
|
{
|
|
984
1000
|
className: t.chatPanelClose,
|
|
985
|
-
onClick: () =>
|
|
1001
|
+
onClick: () => D(r.id),
|
|
986
1002
|
children: /* @__PURE__ */ e(Be, {})
|
|
987
1003
|
}
|
|
988
1004
|
)
|
|
@@ -991,32 +1007,32 @@ function it({ initialModels: a }) {
|
|
|
991
1007
|
"div",
|
|
992
1008
|
{
|
|
993
1009
|
className: t.chatPanelBody,
|
|
994
|
-
ref: (
|
|
995
|
-
|
|
1010
|
+
ref: (u) => {
|
|
1011
|
+
c.current.set(r.id, u);
|
|
996
1012
|
},
|
|
997
1013
|
children: [
|
|
998
|
-
r.messages.map((
|
|
1014
|
+
r.messages.map((u, A) => /* @__PURE__ */ s(
|
|
999
1015
|
"div",
|
|
1000
1016
|
{
|
|
1001
|
-
className:
|
|
1017
|
+
className: u.role === "user" ? t.chatMsgUser : t.chatMsgAI,
|
|
1002
1018
|
children: [
|
|
1003
|
-
|
|
1004
|
-
(
|
|
1019
|
+
u.role === "assistant" ? rt(u.content).map(
|
|
1020
|
+
(b, J) => b.type === "think" ? /* @__PURE__ */ s(
|
|
1005
1021
|
"details",
|
|
1006
1022
|
{
|
|
1007
1023
|
className: t.chatThinkBlock,
|
|
1008
1024
|
children: [
|
|
1009
1025
|
/* @__PURE__ */ e("summary", { children: "思考过程" }),
|
|
1010
|
-
/* @__PURE__ */ e("pre", { children:
|
|
1026
|
+
/* @__PURE__ */ e("pre", { children: b.text })
|
|
1011
1027
|
]
|
|
1012
1028
|
},
|
|
1013
1029
|
J
|
|
1014
|
-
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children:
|
|
1015
|
-
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children:
|
|
1016
|
-
r.isStreaming &&
|
|
1030
|
+
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: b.text }, J)
|
|
1031
|
+
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: u.content }),
|
|
1032
|
+
r.isStreaming && A === r.messages.length - 1 && u.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
|
|
1017
1033
|
]
|
|
1018
1034
|
},
|
|
1019
|
-
|
|
1035
|
+
A
|
|
1020
1036
|
)),
|
|
1021
1037
|
r.error && /* @__PURE__ */ e("div", { className: t.chatMsgError, children: r.error }),
|
|
1022
1038
|
r.usage && /* @__PURE__ */ s("div", { className: t.chatUsageBar, children: [
|
|
@@ -1033,24 +1049,24 @@ function it({ initialModels: a }) {
|
|
|
1033
1049
|
}
|
|
1034
1050
|
)
|
|
1035
1051
|
] }, r.id)),
|
|
1036
|
-
n.length < re && /* @__PURE__ */ e(Q, { title: "添加面板", children: /* @__PURE__ */ e("div", { className: t.addPanelBtn, onClick:
|
|
1052
|
+
n.length < re && /* @__PURE__ */ e(Q, { title: "添加面板", children: /* @__PURE__ */ e("div", { className: t.addPanelBtn, onClick: m, children: /* @__PURE__ */ e(ve, {}) }) })
|
|
1037
1053
|
] }),
|
|
1038
1054
|
/* @__PURE__ */ s("div", { className: t.chatInputBar, children: [
|
|
1039
1055
|
/* @__PURE__ */ e(
|
|
1040
1056
|
Se.TextArea,
|
|
1041
1057
|
{
|
|
1042
1058
|
className: t.chatInput,
|
|
1043
|
-
value:
|
|
1044
|
-
onChange: (r) =>
|
|
1059
|
+
value: _,
|
|
1060
|
+
onChange: (r) => I(r.target.value),
|
|
1045
1061
|
placeholder: "输入消息,所有面板将同时收到并流式输出...",
|
|
1046
1062
|
autoSize: { minRows: 1, maxRows: 4 },
|
|
1047
1063
|
onPressEnter: (r) => {
|
|
1048
|
-
r.shiftKey || (r.preventDefault(),
|
|
1064
|
+
r.shiftKey || (r.preventDefault(), K());
|
|
1049
1065
|
},
|
|
1050
|
-
disabled:
|
|
1066
|
+
disabled: C
|
|
1051
1067
|
}
|
|
1052
1068
|
),
|
|
1053
|
-
|
|
1069
|
+
C ? /* @__PURE__ */ e(z, { danger: !0, onClick: q, children: "停止" }) : /* @__PURE__ */ s(z, { type: "primary", onClick: K, disabled: !_.trim(), children: [
|
|
1054
1070
|
/* @__PURE__ */ e($e, {}),
|
|
1055
1071
|
" 发送"
|
|
1056
1072
|
] })
|
|
@@ -1069,39 +1085,39 @@ function me(a) {
|
|
|
1069
1085
|
};
|
|
1070
1086
|
}
|
|
1071
1087
|
function ot({ onStartChat: a }) {
|
|
1072
|
-
const [n, l] =
|
|
1073
|
-
|
|
1074
|
-
l(
|
|
1075
|
-
}).catch((
|
|
1076
|
-
l([]),
|
|
1088
|
+
const [n, l] = S([]), [o, d] = S(!0), [N, v] = S(null), [k, f] = S(/* @__PURE__ */ new Set()), _ = () => {
|
|
1089
|
+
d(!0), v(null), _e().then((c) => {
|
|
1090
|
+
l(c), d(!1);
|
|
1091
|
+
}).catch((c) => {
|
|
1092
|
+
l([]), v(c instanceof Error ? c.message : "加载失败"), d(!1);
|
|
1077
1093
|
});
|
|
1078
1094
|
};
|
|
1079
1095
|
ae(() => {
|
|
1080
|
-
|
|
1096
|
+
_();
|
|
1081
1097
|
}, []);
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1098
|
+
const I = (c) => {
|
|
1099
|
+
f((g) => {
|
|
1100
|
+
const i = new Set(g);
|
|
1101
|
+
return i.has(c) ? i.delete(c) : i.add(c), i;
|
|
1086
1102
|
});
|
|
1087
|
-
},
|
|
1088
|
-
a([
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
},
|
|
1092
|
-
if (!
|
|
1093
|
-
const
|
|
1094
|
-
return
|
|
1103
|
+
}, C = Array.from(k), T = (c) => {
|
|
1104
|
+
a([c]);
|
|
1105
|
+
}, M = () => {
|
|
1106
|
+
C.length > 0 && a(C);
|
|
1107
|
+
}, p = (c) => {
|
|
1108
|
+
if (!c) return "default";
|
|
1109
|
+
const g = c.toLowerCase();
|
|
1110
|
+
return g.includes("aliyun") || g.includes("ali") ? "blue" : g.includes("zhipu") || g.includes("glm") ? "purple" : g.includes("moonshot") || g.includes("kimi") ? "cyan" : g.includes("minimax") ? "orange" : "default";
|
|
1095
1111
|
};
|
|
1096
|
-
return
|
|
1112
|
+
return o ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载模型列表..." }) }) : N ? /* @__PURE__ */ s("div", { children: [
|
|
1097
1113
|
/* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
|
|
1098
1114
|
/* @__PURE__ */ e("h3", { className: t.modelMgmtTitle, children: "模型管理" }),
|
|
1099
1115
|
/* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "数据库管理的可用模型,可选择单个或多个模型发起对话对比" })
|
|
1100
1116
|
] }),
|
|
1101
1117
|
/* @__PURE__ */ s("div", { className: t.akEmpty, children: [
|
|
1102
1118
|
"模型列表加载失败:",
|
|
1103
|
-
|
|
1104
|
-
/* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(z, { type: "primary", onClick:
|
|
1119
|
+
N,
|
|
1120
|
+
/* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(z, { type: "primary", onClick: _, children: "重试" }) })
|
|
1105
1121
|
] })
|
|
1106
1122
|
] }) : /* @__PURE__ */ s("div", { children: [
|
|
1107
1123
|
/* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
|
|
@@ -1109,77 +1125,77 @@ function ot({ onStartChat: a }) {
|
|
|
1109
1125
|
/* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "数据库管理的可用模型,可选择单个或多个模型发起对话对比" })
|
|
1110
1126
|
] }),
|
|
1111
1127
|
n.length === 0 && /* @__PURE__ */ e("div", { className: t.akEmpty, children: "后端暂无启用模型(z_team_model_config 中 enable=1 的行),请先在数据库或网关配置中启用" }),
|
|
1112
|
-
/* @__PURE__ */ e("div", { className: t.modelGrid, children: n.map((
|
|
1113
|
-
const
|
|
1128
|
+
/* @__PURE__ */ e("div", { className: t.modelGrid, children: n.map((c) => {
|
|
1129
|
+
const g = k.has(c.modelName);
|
|
1114
1130
|
return /* @__PURE__ */ s(
|
|
1115
1131
|
"div",
|
|
1116
1132
|
{
|
|
1117
|
-
className: `${t.modelCard} ${
|
|
1118
|
-
onClick: () =>
|
|
1133
|
+
className: `${t.modelCard} ${g ? t.modelCardSelected : ""}`,
|
|
1134
|
+
onClick: () => I(c.modelName),
|
|
1119
1135
|
children: [
|
|
1120
1136
|
/* @__PURE__ */ e(
|
|
1121
|
-
|
|
1137
|
+
qe,
|
|
1122
1138
|
{
|
|
1123
1139
|
className: t.modelCheckbox,
|
|
1124
|
-
checked:
|
|
1125
|
-
onChange: (
|
|
1126
|
-
|
|
1140
|
+
checked: g,
|
|
1141
|
+
onChange: (i) => {
|
|
1142
|
+
i.stopPropagation(), I(c.modelName);
|
|
1127
1143
|
}
|
|
1128
1144
|
}
|
|
1129
1145
|
),
|
|
1130
1146
|
/* @__PURE__ */ s("div", { className: t.modelCardHeader, children: [
|
|
1131
1147
|
/* @__PURE__ */ e("div", { className: t.modelIconWrap, children: /* @__PURE__ */ e(Te, {}) }),
|
|
1132
1148
|
/* @__PURE__ */ s("div", { className: t.modelCardInfo, children: [
|
|
1133
|
-
/* @__PURE__ */ e("h4", { className: t.modelName, children:
|
|
1149
|
+
/* @__PURE__ */ e("h4", { className: t.modelName, children: c.modelName }),
|
|
1134
1150
|
/* @__PURE__ */ s("div", { className: t.modelTags, children: [
|
|
1135
|
-
|
|
1151
|
+
c.modelProvider && /* @__PURE__ */ e(
|
|
1136
1152
|
G,
|
|
1137
1153
|
{
|
|
1138
|
-
color:
|
|
1154
|
+
color: p(c.modelProvider),
|
|
1139
1155
|
style: { fontSize: 11, margin: 0 },
|
|
1140
|
-
children:
|
|
1156
|
+
children: c.modelProvider
|
|
1141
1157
|
}
|
|
1142
1158
|
),
|
|
1143
|
-
/* @__PURE__ */ e(G, { style: { fontSize: 11, margin: 0 }, children:
|
|
1159
|
+
/* @__PURE__ */ e(G, { style: { fontSize: 11, margin: 0 }, children: c.apiType })
|
|
1144
1160
|
] })
|
|
1145
1161
|
] })
|
|
1146
1162
|
] }),
|
|
1147
|
-
/* @__PURE__ */ e("p", { className: t.modelEndpoint, children:
|
|
1163
|
+
/* @__PURE__ */ e("p", { className: t.modelEndpoint, children: c.endpoint }),
|
|
1148
1164
|
/* @__PURE__ */ e("div", { className: t.modelCardFooter, children: /* @__PURE__ */ e(
|
|
1149
1165
|
z,
|
|
1150
1166
|
{
|
|
1151
1167
|
type: "link",
|
|
1152
1168
|
size: "small",
|
|
1153
|
-
onClick: (
|
|
1154
|
-
|
|
1169
|
+
onClick: (i) => {
|
|
1170
|
+
i.stopPropagation(), T(c.modelName);
|
|
1155
1171
|
},
|
|
1156
1172
|
children: "发起对话"
|
|
1157
1173
|
}
|
|
1158
1174
|
) })
|
|
1159
1175
|
]
|
|
1160
1176
|
},
|
|
1161
|
-
|
|
1177
|
+
c.modelName
|
|
1162
1178
|
);
|
|
1163
1179
|
}) }),
|
|
1164
|
-
|
|
1180
|
+
C.length > 0 && /* @__PURE__ */ s("div", { className: t.modelActionBar, children: [
|
|
1165
1181
|
/* @__PURE__ */ s("span", { className: t.modelSelectionCount, children: [
|
|
1166
1182
|
"已选择 ",
|
|
1167
|
-
|
|
1183
|
+
C.length,
|
|
1168
1184
|
" 个模型"
|
|
1169
1185
|
] }),
|
|
1170
1186
|
/* @__PURE__ */ e(
|
|
1171
1187
|
z,
|
|
1172
1188
|
{
|
|
1173
1189
|
type: "primary",
|
|
1174
|
-
onClick:
|
|
1175
|
-
disabled:
|
|
1190
|
+
onClick: M,
|
|
1191
|
+
disabled: C.length === 0,
|
|
1176
1192
|
children: "批量对比"
|
|
1177
1193
|
}
|
|
1178
1194
|
)
|
|
1179
1195
|
] })
|
|
1180
1196
|
] });
|
|
1181
1197
|
}
|
|
1182
|
-
const ct = "_container_15pgq_5", dt = "_page_15pgq_10", mt = "_kpiGrid_15pgq_16", ut = "_kpiCard_15pgq_22", ht = "_sectionCard_15pgq_29", pt = "_sectionHead_15pgq_36", gt = "_sectionHint_15pgq_42", kt = "_akList_15pgq_47", ft = "_errorState_15pgq_54", yt = "_errorTitle_15pgq_66", Nt = "_errorDetail_15pgq_72",
|
|
1198
|
+
const ct = "_container_15pgq_5", dt = "_page_15pgq_10", mt = "_kpiGrid_15pgq_16", ut = "_kpiCard_15pgq_22", ht = "_sectionCard_15pgq_29", pt = "_sectionHead_15pgq_36", gt = "_sectionHint_15pgq_42", kt = "_akList_15pgq_47", ft = "_errorState_15pgq_54", yt = "_errorTitle_15pgq_66", Nt = "_errorDetail_15pgq_72", O = {
|
|
1183
1199
|
container: ct,
|
|
1184
1200
|
page: dt,
|
|
1185
1201
|
kpiGrid: mt,
|
|
@@ -1200,41 +1216,41 @@ function te(a) {
|
|
|
1200
1216
|
function Ct({ daily: a }) {
|
|
1201
1217
|
const n = Object.entries(a);
|
|
1202
1218
|
if (n.length === 0) return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
1203
|
-
const l = Math.max(...n.map(([,
|
|
1204
|
-
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: n.map(([
|
|
1205
|
-
const
|
|
1219
|
+
const l = Math.max(...n.map(([, o]) => o[1] + o[2]), 1);
|
|
1220
|
+
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: n.map(([o, d]) => {
|
|
1221
|
+
const N = d[1] + d[2];
|
|
1206
1222
|
return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
|
|
1207
|
-
/* @__PURE__ */ e(Q, { title: `${
|
|
1223
|
+
/* @__PURE__ */ e(Q, { title: `${o}: ${d[0]}次 / ${N} tokens`, children: /* @__PURE__ */ e(
|
|
1208
1224
|
"div",
|
|
1209
1225
|
{
|
|
1210
1226
|
className: t.usageBar,
|
|
1211
|
-
style: { height: `${Math.max(
|
|
1227
|
+
style: { height: `${Math.max(N / l * 100, 2)}%` }
|
|
1212
1228
|
}
|
|
1213
1229
|
) }),
|
|
1214
|
-
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children:
|
|
1215
|
-
] },
|
|
1230
|
+
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children: o })
|
|
1231
|
+
] }, o);
|
|
1216
1232
|
}) });
|
|
1217
1233
|
}
|
|
1218
1234
|
function ye({ models: a }) {
|
|
1219
1235
|
const n = Object.entries(a);
|
|
1220
1236
|
if (n.length === 0) return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
1221
|
-
const l = Math.max(...n.map(([,
|
|
1222
|
-
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: n.sort((
|
|
1223
|
-
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children:
|
|
1237
|
+
const l = Math.max(...n.map(([, o]) => o[0]), 1);
|
|
1238
|
+
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: n.sort((o, d) => d[1][0] - o[1][0]).map(([o, d]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
|
|
1239
|
+
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: o }),
|
|
1224
1240
|
/* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
|
|
1225
1241
|
"div",
|
|
1226
1242
|
{
|
|
1227
1243
|
className: t.modelBreakdownFill,
|
|
1228
|
-
style: { width: `${
|
|
1244
|
+
style: { width: `${d[0] / l * 100}%` }
|
|
1229
1245
|
}
|
|
1230
1246
|
) }),
|
|
1231
1247
|
/* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
|
|
1232
|
-
|
|
1248
|
+
d[0],
|
|
1233
1249
|
"次 / ",
|
|
1234
|
-
te(
|
|
1250
|
+
te(d[1] + (d[2] || 0)),
|
|
1235
1251
|
"tokens"
|
|
1236
1252
|
] })
|
|
1237
|
-
] },
|
|
1253
|
+
] }, o)) });
|
|
1238
1254
|
}
|
|
1239
1255
|
const St = [
|
|
1240
1256
|
{
|
|
@@ -1263,96 +1279,86 @@ function wt(a) {
|
|
|
1263
1279
|
return ((n = a == null ? void 0 : a.stats) == null ? void 0 : n.recent) ?? [];
|
|
1264
1280
|
}
|
|
1265
1281
|
function At() {
|
|
1266
|
-
var
|
|
1267
|
-
const [a, n] =
|
|
1268
|
-
n(!0),
|
|
1282
|
+
var p, c, g, i, w, K, q;
|
|
1283
|
+
const [a, n] = S(!0), [l, o] = S(null), [d, N] = S([]), [v, k] = S(null), [f, _] = S(null), I = H(async () => {
|
|
1284
|
+
n(!0), o(null);
|
|
1269
1285
|
try {
|
|
1270
1286
|
const m = await Promise.allSettled(
|
|
1271
|
-
Tt.map((
|
|
1272
|
-
),
|
|
1273
|
-
let
|
|
1274
|
-
for (const
|
|
1275
|
-
|
|
1276
|
-
if (
|
|
1287
|
+
Tt.map((u) => ie(u))
|
|
1288
|
+
), P = [];
|
|
1289
|
+
let D = 0;
|
|
1290
|
+
for (const u of m)
|
|
1291
|
+
u.status === "fulfilled" ? P.push(...u.value) : D += 1;
|
|
1292
|
+
if (D === m.length)
|
|
1277
1293
|
throw new Error("网关不可达:无法获取 AK 列表");
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
);
|
|
1292
|
-
v(L);
|
|
1294
|
+
P.sort((u, A) => (u.id ?? 0) - (A.id ?? 0));
|
|
1295
|
+
let E = null, j = null;
|
|
1296
|
+
try {
|
|
1297
|
+
E = await be(0);
|
|
1298
|
+
} catch (u) {
|
|
1299
|
+
j = u instanceof Error ? u.message : "获取用量失败";
|
|
1300
|
+
}
|
|
1301
|
+
k(E);
|
|
1302
|
+
const r = P.map((u) => ({
|
|
1303
|
+
key: u,
|
|
1304
|
+
stats: E,
|
|
1305
|
+
statsError: j
|
|
1306
|
+
}));
|
|
1307
|
+
N(r);
|
|
1293
1308
|
} catch (m) {
|
|
1294
|
-
|
|
1309
|
+
o(m instanceof Error ? m.message : "加载失败");
|
|
1295
1310
|
} finally {
|
|
1296
1311
|
n(!1);
|
|
1297
1312
|
}
|
|
1298
1313
|
}, []);
|
|
1299
1314
|
ae(() => {
|
|
1300
|
-
|
|
1301
|
-
}, [
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
const r = j.stats;
|
|
1307
|
-
if (r) {
|
|
1308
|
-
m += r.totalRequests ?? 0, B += r.totalTokens ?? 0, r.avgLatencyMs != null && r.totalRequests > 0 && (b += r.avgLatencyMs * r.totalRequests, L += r.totalRequests), P += r.errorCount ?? 0;
|
|
1309
|
-
for (const [h, w] of Object.entries(r.models ?? {})) {
|
|
1310
|
-
const A = I[h] ?? [0, 0];
|
|
1311
|
-
A[0] += w[0], A[1] += w[1], I[h] = A;
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
+
I();
|
|
1316
|
+
}, [I]);
|
|
1317
|
+
const C = xe(() => {
|
|
1318
|
+
const m = v, P = {};
|
|
1319
|
+
for (const [D, E] of Object.entries((m == null ? void 0 : m.models) ?? {}))
|
|
1320
|
+
P[D] = [E[0] ?? 0, E[1] ?? 0, E[2] ?? 0];
|
|
1315
1321
|
return {
|
|
1316
|
-
requests: m,
|
|
1317
|
-
tokens:
|
|
1318
|
-
avgLatency:
|
|
1319
|
-
errors:
|
|
1320
|
-
models:
|
|
1322
|
+
requests: (m == null ? void 0 : m.totalRequests) ?? 0,
|
|
1323
|
+
tokens: (m == null ? void 0 : m.totalTokens) ?? 0,
|
|
1324
|
+
avgLatency: (m == null ? void 0 : m.avgLatencyMs) ?? 0,
|
|
1325
|
+
errors: (m == null ? void 0 : m.errorCount) ?? 0,
|
|
1326
|
+
models: P
|
|
1321
1327
|
};
|
|
1322
|
-
}, [
|
|
1323
|
-
/* @__PURE__ */ e("div", { className:
|
|
1324
|
-
/* @__PURE__ */ e("div", { className:
|
|
1325
|
-
/* @__PURE__ */ e(z, { icon: /* @__PURE__ */ e(Ne, {}), onClick:
|
|
1326
|
-
] }) : /* @__PURE__ */ s("div", { className:
|
|
1327
|
-
/* @__PURE__ */ s("div", { className:
|
|
1328
|
-
/* @__PURE__ */ e("div", { className:
|
|
1329
|
-
/* @__PURE__ */ e("div", { className:
|
|
1330
|
-
/* @__PURE__ */ e("div", { className:
|
|
1331
|
-
/* @__PURE__ */ e("div", { className:
|
|
1332
|
-
|
|
1328
|
+
}, [v]), T = d.reduce((m, P) => m + (P.key.tokenQuota || 0), 0), M = () => a ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(V, { tip: "加载监控数据..." }) }) : l ? /* @__PURE__ */ s("div", { className: O.errorState, children: [
|
|
1329
|
+
/* @__PURE__ */ e("div", { className: O.errorTitle, children: "模型监控数据加载失败" }),
|
|
1330
|
+
/* @__PURE__ */ e("div", { className: O.errorDetail, children: l }),
|
|
1331
|
+
/* @__PURE__ */ e(z, { icon: /* @__PURE__ */ e(Ne, {}), onClick: I, type: "primary", children: "重试" })
|
|
1332
|
+
] }) : /* @__PURE__ */ s("div", { className: O.page, children: [
|
|
1333
|
+
/* @__PURE__ */ s("div", { className: O.kpiGrid, children: [
|
|
1334
|
+
/* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e(B, { title: "总请求(近7天)", value: C.requests }) }),
|
|
1335
|
+
/* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e(B, { title: "总 Tokens", value: te(C.tokens) }) }),
|
|
1336
|
+
/* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e(B, { title: "平均延迟", value: C.avgLatency, suffix: "ms" }) }),
|
|
1337
|
+
/* @__PURE__ */ e("div", { className: O.kpiCard, children: /* @__PURE__ */ e(
|
|
1338
|
+
B,
|
|
1333
1339
|
{
|
|
1334
1340
|
title: "错误数",
|
|
1335
|
-
value:
|
|
1336
|
-
valueStyle:
|
|
1341
|
+
value: C.errors,
|
|
1342
|
+
valueStyle: C.errors > 0 ? { color: "#ff4d4f" } : void 0
|
|
1337
1343
|
}
|
|
1338
1344
|
) })
|
|
1339
1345
|
] }),
|
|
1340
|
-
/* @__PURE__ */ s("div", { className:
|
|
1341
|
-
/* @__PURE__ */ s("div", { className:
|
|
1346
|
+
/* @__PURE__ */ s("div", { className: O.sectionCard, children: [
|
|
1347
|
+
/* @__PURE__ */ s("div", { className: O.sectionHead, children: [
|
|
1342
1348
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "AK 用量" }),
|
|
1343
|
-
|
|
1349
|
+
T > 0 && /* @__PURE__ */ s("span", { className: O.sectionHint, children: [
|
|
1344
1350
|
"合计额度 ",
|
|
1345
|
-
te(
|
|
1351
|
+
te(T),
|
|
1346
1352
|
" tokens"
|
|
1347
1353
|
] })
|
|
1348
1354
|
] }),
|
|
1349
|
-
|
|
1350
|
-
const
|
|
1355
|
+
d.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "网关下暂无 AK" }) : /* @__PURE__ */ e("div", { className: O.akList, children: d.map((m) => {
|
|
1356
|
+
const P = m.key.totalTokens ?? 0, D = m.key.tokenQuota || 0, E = D > 0 ? Math.min(P / D * 100, 100) : 0;
|
|
1351
1357
|
return /* @__PURE__ */ s(
|
|
1352
1358
|
"div",
|
|
1353
1359
|
{
|
|
1354
1360
|
className: t.akCard,
|
|
1355
|
-
onClick: () =>
|
|
1361
|
+
onClick: () => _(m),
|
|
1356
1362
|
children: [
|
|
1357
1363
|
/* @__PURE__ */ s("div", { className: t.akCardRow, children: [
|
|
1358
1364
|
/* @__PURE__ */ e("span", { className: t.akTitle, children: m.key.description || m.key.userName || `AK #${m.key.id}` }),
|
|
@@ -1371,15 +1377,15 @@ function At() {
|
|
|
1371
1377
|
"div",
|
|
1372
1378
|
{
|
|
1373
1379
|
className: t.akMiniBarFill,
|
|
1374
|
-
style: { width: `${
|
|
1380
|
+
style: { width: `${E}%` }
|
|
1375
1381
|
}
|
|
1376
1382
|
) }),
|
|
1377
1383
|
/* @__PURE__ */ s("span", { className: t.akUsageText, children: [
|
|
1378
|
-
te(
|
|
1379
|
-
|
|
1384
|
+
te(P),
|
|
1385
|
+
D > 0 ? ` / ${te(D)}` : "",
|
|
1380
1386
|
" tokens"
|
|
1381
1387
|
] }),
|
|
1382
|
-
/* @__PURE__ */ e("span", { className: t.akMetaText, children: m.
|
|
1388
|
+
/* @__PURE__ */ e("span", { className: t.akMetaText, children: m.statsError ? m.statsError : m.key.lastUsedAt ? `最近使用 ${m.key.lastUsedAt}` : "尚未使用" })
|
|
1383
1389
|
] })
|
|
1384
1390
|
]
|
|
1385
1391
|
},
|
|
@@ -1387,12 +1393,12 @@ function At() {
|
|
|
1387
1393
|
);
|
|
1388
1394
|
}) })
|
|
1389
1395
|
] }),
|
|
1390
|
-
/* @__PURE__ */ s("div", { className:
|
|
1391
|
-
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "
|
|
1392
|
-
/* @__PURE__ */ e(ye, { models:
|
|
1396
|
+
/* @__PURE__ */ s("div", { className: O.sectionCard, children: [
|
|
1397
|
+
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布(网关全局)" }),
|
|
1398
|
+
/* @__PURE__ */ e(ye, { models: C.models })
|
|
1393
1399
|
] })
|
|
1394
1400
|
] });
|
|
1395
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1401
|
+
return /* @__PURE__ */ s("div", { className: O.container, children: [
|
|
1396
1402
|
/* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
|
|
1397
1403
|
/* @__PURE__ */ e("h2", { className: t.modelMgmtTitle, children: "模型监控" }),
|
|
1398
1404
|
/* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "大模型网关管控视图 — 按 AK / 模型聚合调用量、Tokens 与延迟(近 30 天)" })
|
|
@@ -1402,7 +1408,7 @@ function At() {
|
|
|
1402
1408
|
{
|
|
1403
1409
|
defaultActiveKey: "usage",
|
|
1404
1410
|
items: [
|
|
1405
|
-
{ key: "usage", label: "模型用量", children:
|
|
1411
|
+
{ key: "usage", label: "模型用量", children: M() },
|
|
1406
1412
|
{
|
|
1407
1413
|
key: "sessions",
|
|
1408
1414
|
label: "会话统计",
|
|
@@ -1414,34 +1420,34 @@ function At() {
|
|
|
1414
1420
|
/* @__PURE__ */ e(
|
|
1415
1421
|
we,
|
|
1416
1422
|
{
|
|
1417
|
-
title:
|
|
1423
|
+
title: f ? `AK 用量 — ${f.key.description || f.key.akPrefix}` : "",
|
|
1418
1424
|
width: 860,
|
|
1419
|
-
open: !!
|
|
1420
|
-
onClose: () =>
|
|
1425
|
+
open: !!f,
|
|
1426
|
+
onClose: () => _(null),
|
|
1421
1427
|
destroyOnHidden: !0,
|
|
1422
|
-
children:
|
|
1428
|
+
children: f && /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
|
|
1423
1429
|
/* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
|
|
1424
|
-
/* @__PURE__ */ e(
|
|
1425
|
-
/* @__PURE__ */ e(
|
|
1426
|
-
/* @__PURE__ */ e(
|
|
1427
|
-
/* @__PURE__ */ e(
|
|
1428
|
-
/* @__PURE__ */ e(
|
|
1430
|
+
/* @__PURE__ */ e(B, { title: "总请求", value: ((p = f.stats) == null ? void 0 : p.totalRequests) ?? 0 }),
|
|
1431
|
+
/* @__PURE__ */ e(B, { title: "总 Tokens", value: ((c = f.stats) == null ? void 0 : c.totalTokens) ?? 0 }),
|
|
1432
|
+
/* @__PURE__ */ e(B, { title: "平均延迟", value: ((g = f.stats) == null ? void 0 : g.avgLatencyMs) ?? 0, suffix: "ms" }),
|
|
1433
|
+
/* @__PURE__ */ e(B, { title: "输入 Tokens", value: ((i = f.stats) == null ? void 0 : i.totalPromptTokens) ?? 0 }),
|
|
1434
|
+
/* @__PURE__ */ e(B, { title: "输出 Tokens", value: ((w = f.stats) == null ? void 0 : w.totalCompletionTokens) ?? 0 }),
|
|
1429
1435
|
/* @__PURE__ */ e(
|
|
1430
|
-
|
|
1436
|
+
B,
|
|
1431
1437
|
{
|
|
1432
1438
|
title: "错误数",
|
|
1433
|
-
value: ((
|
|
1434
|
-
valueStyle: (((
|
|
1439
|
+
value: ((K = f.stats) == null ? void 0 : K.errorCount) ?? 0,
|
|
1440
|
+
valueStyle: (((q = f.stats) == null ? void 0 : q.errorCount) ?? 0) > 0 ? { color: "#ff4d4f" } : void 0
|
|
1435
1441
|
}
|
|
1436
1442
|
)
|
|
1437
1443
|
] }),
|
|
1438
1444
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
1439
1445
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "每日用量(近 30 天)" }),
|
|
1440
|
-
|
|
1446
|
+
f.stats ? /* @__PURE__ */ e(Ct, { daily: f.stats.daily ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: f.statsError ?? "暂无数据" })
|
|
1441
1447
|
] }),
|
|
1442
1448
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
1443
1449
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布" }),
|
|
1444
|
-
|
|
1450
|
+
f.stats ? /* @__PURE__ */ e(ye, { models: f.stats.models ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: f.statsError ?? "暂无数据" })
|
|
1445
1451
|
] }),
|
|
1446
1452
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
1447
1453
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "最近调用" }),
|
|
@@ -1450,7 +1456,7 @@ function At() {
|
|
|
1450
1456
|
{
|
|
1451
1457
|
size: "small",
|
|
1452
1458
|
columns: St,
|
|
1453
|
-
dataSource: wt(
|
|
1459
|
+
dataSource: wt(f),
|
|
1454
1460
|
rowKey: "id",
|
|
1455
1461
|
pagination: {
|
|
1456
1462
|
pageSize: 8,
|
|
@@ -1471,26 +1477,26 @@ const xt = [
|
|
|
1471
1477
|
{ key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(De, {}) },
|
|
1472
1478
|
{ key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(Le, {}) },
|
|
1473
1479
|
{ key: "agent-app", label: "Agent 应用", icon: /* @__PURE__ */ e(Te, {}) },
|
|
1474
|
-
{ key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(
|
|
1475
|
-
{ key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(
|
|
1476
|
-
{ key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(
|
|
1480
|
+
{ key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(ze, {}) },
|
|
1481
|
+
{ key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(Re, {}) },
|
|
1482
|
+
{ key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(Ue, {}) }
|
|
1477
1483
|
];
|
|
1478
1484
|
function It() {
|
|
1479
|
-
const [a, n] =
|
|
1480
|
-
|
|
1481
|
-
},
|
|
1485
|
+
const [a, n] = S("model-management"), [l, o] = S([]), d = (k) => {
|
|
1486
|
+
o(k), n("model-chat");
|
|
1487
|
+
}, N = xe(() => xt, []), v = (k, f, _ = !1) => /* @__PURE__ */ e(
|
|
1482
1488
|
"div",
|
|
1483
1489
|
{
|
|
1484
1490
|
style: {
|
|
1485
|
-
display: a === k ?
|
|
1491
|
+
display: a === k ? _ ? "flex" : "block" : "none",
|
|
1486
1492
|
height: "100%",
|
|
1487
|
-
...
|
|
1493
|
+
..._ ? { flexDirection: "column" } : {}
|
|
1488
1494
|
},
|
|
1489
|
-
children:
|
|
1495
|
+
children: f
|
|
1490
1496
|
}
|
|
1491
1497
|
);
|
|
1492
1498
|
return /* @__PURE__ */ s("div", { className: t.container, children: [
|
|
1493
|
-
/* @__PURE__ */ e("aside", { className: t.sidebar, children: /* @__PURE__ */ e("nav", { className: t.menuList, children:
|
|
1499
|
+
/* @__PURE__ */ e("aside", { className: t.sidebar, children: /* @__PURE__ */ e("nav", { className: t.menuList, children: N.map((k) => /* @__PURE__ */ e(Q, { title: k.label, placement: "right", children: /* @__PURE__ */ e(
|
|
1494
1500
|
"div",
|
|
1495
1501
|
{
|
|
1496
1502
|
className: `${t.menuItem} ${a === k.key ? t.menuItemActive : ""}`,
|
|
@@ -1499,13 +1505,13 @@ function It() {
|
|
|
1499
1505
|
}
|
|
1500
1506
|
) }, k.key)) }) }),
|
|
1501
1507
|
/* @__PURE__ */ s("main", { className: t.panelArea, children: [
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1508
|
+
v("model-management", /* @__PURE__ */ e(ot, { onStartChat: d })),
|
|
1509
|
+
v("model-chat", /* @__PURE__ */ e(it, { initialModels: l }), !0),
|
|
1510
|
+
v("ak-management", /* @__PURE__ */ e(st, {})),
|
|
1511
|
+
v("agent-app", /* @__PURE__ */ e(Ge, {})),
|
|
1512
|
+
v("mcp-service", /* @__PURE__ */ e(Je, {})),
|
|
1513
|
+
v("skill-market", /* @__PURE__ */ e(Qe, {})),
|
|
1514
|
+
v("model-monitor", /* @__PURE__ */ e(At, {}))
|
|
1509
1515
|
] })
|
|
1510
1516
|
] });
|
|
1511
1517
|
}
|