@yuku123/z-team-component 0.2.28 → 0.2.30
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/{ChangeLogView-CG-o5YP1.js → ChangeLogView-FLd1wS8H.js} +1 -1
- package/dist/{InvitationManagementPage-DpA3Xlq1.js → InvitationManagementPage-CttWZdu8.js} +87 -82
- package/dist/{OnboardingPage-DFRAwruv.js → OnboardingPage-CAI-P20Q.js} +2 -2
- package/dist/ProjectApp-ZR_QUlPs.js +3839 -0
- package/dist/{SystemShell-BLXTOqFb.js → SystemShell-BKNdXqXt.js} +1 -1
- package/dist/{admin-logs-C2V1ElH9.js → admin-logs-Dv86pFvY.js} +2 -2
- package/dist/{api--Fg0hL9Y.js → api-19TXED_O.js} +52 -39
- package/dist/api-BNwdLozd.js +20 -0
- package/dist/{createWorkspaceWsHandler-CqGqcTh_.js → createWorkspaceWsHandler-CBk4DqP4.js} +6 -5
- package/dist/{index-hPzswwk2.js → index-B5_xKK08.js} +1139 -1152
- package/dist/{index-D5u3BjCZ.js → index-BIJnjJd5.js} +2 -2
- package/dist/{index-BylksTyk.js → index-BKwpQ-HW.js} +136 -134
- package/dist/{index-bbwTcNjB.js → index-BTLD5gUt.js} +3 -3
- package/dist/{index-C9BOtjtQ.js → index-BTaLAs80.js} +9 -9
- package/dist/{index-CiMxCTOS.js → index-B_EBV24V.js} +1 -1
- package/dist/{index-BafC42Cl.js → index-Bd57t_yF.js} +1 -1
- package/dist/{index-C2aPiQSz.js → index-BjqYiZpC.js} +3 -3
- package/dist/{index-BaCiSbPR.js → index-BoGVJ0hC.js} +1 -1
- package/dist/{index-C01UUprh.js → index-BpuJ9Njb.js} +7016 -6946
- package/dist/{index-CcFJEYgr.js → index-C815hPWS.js} +55 -52
- package/dist/{index-DIxwe_pk.js → index-C8GK1bOQ.js} +358 -347
- package/dist/{index-DvIHX7lZ.js → index-CcpWacSZ.js} +243 -236
- package/dist/{index-Da7ls5q6.js → index-DOPkM2W8.js} +6 -6
- package/dist/index-DQNZE7Go.js +169 -0
- package/dist/{index-BYEx4vlI.js → index-DR_FCf71.js} +1134 -1132
- package/dist/{index-CTD7k9dP.js → index-DYgD6BuB.js} +4 -4
- package/dist/{index-dSnK7qcL.js → index-DdN9Apqq.js} +5 -5
- package/dist/{index-CPF3LS0x.js → index-DuGWlMWm.js} +3 -3
- package/dist/index-JMzBzwiO.js +1746 -0
- package/dist/{index-Dao4uqQd.js → index-x4-W5ClM.js} +4 -4
- package/dist/index.js +1 -1
- package/dist/{instance-1QEDBRqA.js → instance-D951fRuD.js} +1 -1
- package/dist/pages.js +5 -4
- package/dist/{schedule-C89oiqIR.js → schedule-DD50-7cs.js} +1 -1
- package/dist/{send-default-agent-team-message-CxkWi3XC.js → send-default-agent-team-message-Bbs2rMNf.js} +1 -1
- package/dist/{sso-user-BE1Ell5F.js → sso-user-BEY5ICaR.js} +1 -1
- package/dist/{training-o-vSBkqP.js → training-B-9tNFQw.js} +1 -1
- package/dist/{useAppStore-wgWaxcyc.js → useAppStore-BQN-26ns.js} +1 -1
- package/dist/{webide-BxD6cYe-.js → webide-P867RFZi.js} +4 -4
- package/dist/z-team-component.css +1 -1
- package/package.json +3 -3
- package/dist/ProjectApp-BquB_X7K.js +0 -4591
- package/dist/api-CX7MUpws.js +0 -19
- package/dist/index-CcTdM5kT.js +0 -178
- package/dist/index-pfzY68PH.js +0 -1408
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { CopyOutlined as Y, ReloadOutlined as
|
|
2
|
+
import { CopyOutlined as Y, ReloadOutlined as Ae, PlusOutlined as pe, DeleteOutlined as Ne, ClearOutlined as we, CloseOutlined as Te, SendOutlined as Ce, RobotOutlined as he, CloudServerOutlined as xe, MessageOutlined as Pe, KeyOutlined as Se, AppstoreOutlined as be, GiftOutlined as Ie, ApiOutlined as Me, ToolOutlined as Ke, BarChartOutlined as Oe, DesktopOutlined as Ee } from "@ant-design/icons";
|
|
3
3
|
import { useState as k, useCallback as $, useEffect as X, useRef as ne, useMemo as Be } from "react";
|
|
4
|
-
import { Tooltip as G, Tabs as De, Button as B, Modal as se, Input as ue, Drawer as $e, Spin as Q, Statistic as
|
|
4
|
+
import { Tooltip as G, Tabs as De, Button as B, Modal as se, Input as ue, Drawer as $e, Spin as Q, Statistic as q, Table as Le, message as _, Tag as F, Select as _e, Checkbox as ze } from "antd";
|
|
5
5
|
import { s as t } from "./SmartWorkbench.module-DzQskKT0.js";
|
|
6
|
-
import { AgentAppList as Re, AgentInstanceManager as Ue, TemplateMarket as
|
|
6
|
+
import { AgentAppList as Re, AgentInstanceManager as Ue, TemplateMarket as je, McpPage as qe, SkillMarket as Fe, AgentDashboard as He } from "@yuku123/z-agent-component";
|
|
7
7
|
import "@yuku123/z-frontend-common";
|
|
8
|
-
import "./ProjectApp-
|
|
8
|
+
import "./ProjectApp-ZR_QUlPs.js";
|
|
9
|
+
import "@yuku123/z-frontend-common/ui";
|
|
9
10
|
import { D as Ge } from "./DebugPlayground-cxffrMgF.js";
|
|
10
11
|
const oe = "ft_gateway_default_ak", Je = typeof window < "u" && window.ZTEAM_USE_KAPI === !0, ge = Je, We = `${ge ? "/kapi" : ""}/z-team`, z = ge ? "/kapi/z-team-agent-gateway" : "/gateway-api";
|
|
11
12
|
function Ye(a) {
|
|
@@ -173,13 +174,13 @@ async function Ve(a, o, c, d) {
|
|
|
173
174
|
signal: d.signal
|
|
174
175
|
});
|
|
175
176
|
if (!g.ok || !g.body) {
|
|
176
|
-
const
|
|
177
|
+
const i = await g.text().catch(() => "");
|
|
177
178
|
let p = `HTTP ${g.status}`;
|
|
178
179
|
try {
|
|
179
|
-
const h = JSON.parse(
|
|
180
|
+
const h = JSON.parse(i);
|
|
180
181
|
p = ((C = h == null ? void 0 : h.error) == null ? void 0 : C.message) ?? p;
|
|
181
182
|
} catch {
|
|
182
|
-
|
|
183
|
+
i && (p = i);
|
|
183
184
|
}
|
|
184
185
|
throw new Error(p);
|
|
185
186
|
}
|
|
@@ -187,8 +188,8 @@ async function Ve(a, o, c, d) {
|
|
|
187
188
|
let T = "";
|
|
188
189
|
try {
|
|
189
190
|
for (; ; ) {
|
|
190
|
-
const { done:
|
|
191
|
-
if (
|
|
191
|
+
const { done: i, value: p } = await D.read();
|
|
192
|
+
if (i) break;
|
|
192
193
|
T += w.decode(p, { stream: !0 });
|
|
193
194
|
const h = T.split(`
|
|
194
195
|
|
|
@@ -207,10 +208,10 @@ async function Ve(a, o, c, d) {
|
|
|
207
208
|
continue;
|
|
208
209
|
}
|
|
209
210
|
try {
|
|
210
|
-
const u = JSON.parse(M),
|
|
211
|
-
if (Array.isArray(
|
|
212
|
-
const K = (x =
|
|
213
|
-
if (K != null && K.content && d.onDelta(K.content), (b =
|
|
211
|
+
const u = JSON.parse(M), A = u == null ? void 0 : u.choices;
|
|
212
|
+
if (Array.isArray(A) && A.length > 0) {
|
|
213
|
+
const K = (x = A[0]) == null ? void 0 : x.delta;
|
|
214
|
+
if (K != null && K.content && d.onDelta(K.content), (b = A[0]) == null ? void 0 : b.finish_reason) {
|
|
214
215
|
const R = u != null && u.usage ? {
|
|
215
216
|
promptTokens: u.usage.prompt_tokens ?? 0,
|
|
216
217
|
completionTokens: u.usage.completion_tokens ?? 0,
|
|
@@ -234,15 +235,15 @@ async function Ve(a, o, c, d) {
|
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
d.onDone();
|
|
237
|
-
} catch (
|
|
238
|
+
} catch (i) {
|
|
238
239
|
if ((P = d.signal) != null && P.aborted) return;
|
|
239
|
-
throw d.onError(
|
|
240
|
+
throw d.onError(i instanceof Error ? i : new Error(String(i))), i;
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
243
|
async function ye(a, o, c) {
|
|
243
244
|
const d = await fetch(`${z}/v1/api-keys`, {
|
|
244
245
|
method: "POST",
|
|
245
|
-
headers: { "Content-Type": "application/json" },
|
|
246
|
+
headers: { Accept: "application/json", "Content-Type": "application/json" },
|
|
246
247
|
body: JSON.stringify({ userId: a, userName: o, description: c })
|
|
247
248
|
});
|
|
248
249
|
if (!d.ok) {
|
|
@@ -254,7 +255,7 @@ async function ye(a, o, c) {
|
|
|
254
255
|
async function ce(a) {
|
|
255
256
|
const o = await fetch(
|
|
256
257
|
`${z}/v1/api-keys?userId=${encodeURIComponent(a)}`,
|
|
257
|
-
{ headers: { "Content-Type": "application/json" } }
|
|
258
|
+
{ headers: { Accept: "application/json", "Content-Type": "application/json" } }
|
|
258
259
|
);
|
|
259
260
|
if (!o.ok) throw new Error(`获取 AK 列表失败 HTTP ${o.status}`);
|
|
260
261
|
const c = await o.json(), d = (c == null ? void 0 : c.apiKeys) ?? c;
|
|
@@ -262,12 +263,13 @@ async function ce(a) {
|
|
|
262
263
|
}
|
|
263
264
|
async function Xe(a) {
|
|
264
265
|
const o = await fetch(`${z}/v1/api-keys/${a}`, {
|
|
266
|
+
headers: { Accept: "application/json" },
|
|
265
267
|
method: "DELETE"
|
|
266
268
|
});
|
|
267
269
|
if (!o.ok) throw new Error(`吊销 AK 失败 HTTP ${o.status}`);
|
|
268
270
|
}
|
|
269
271
|
async function Qe(a) {
|
|
270
|
-
const o = await fetch(`${z}/v1/api-keys/${a}/usage
|
|
272
|
+
const o = await fetch(`${z}/v1/api-keys/${a}/usage`, { headers: { Accept: "application/json" } });
|
|
271
273
|
if (!o.ok) throw new Error(`获取用量统计失败 HTTP ${o.status}`);
|
|
272
274
|
const c = await o.json();
|
|
273
275
|
return (c == null ? void 0 : c.data) ?? c;
|
|
@@ -275,17 +277,17 @@ async function Qe(a) {
|
|
|
275
277
|
function et() {
|
|
276
278
|
return typeof window < "u" ? `${window.location.origin}${z}` : z;
|
|
277
279
|
}
|
|
278
|
-
const
|
|
280
|
+
const ie = "ft_gateway_ak_cache";
|
|
279
281
|
function tt(a, o) {
|
|
280
282
|
try {
|
|
281
|
-
const c = JSON.parse(localStorage.getItem(
|
|
282
|
-
c[a] = o, localStorage.setItem(
|
|
283
|
+
const c = JSON.parse(localStorage.getItem(ie) || "{}");
|
|
284
|
+
c[a] = o, localStorage.setItem(ie, JSON.stringify(c));
|
|
283
285
|
} catch {
|
|
284
286
|
}
|
|
285
287
|
}
|
|
286
288
|
function at(a) {
|
|
287
289
|
try {
|
|
288
|
-
return JSON.parse(localStorage.getItem(
|
|
290
|
+
return JSON.parse(localStorage.getItem(ie) || "{}")[a] || null;
|
|
289
291
|
} catch {
|
|
290
292
|
return null;
|
|
291
293
|
}
|
|
@@ -338,15 +340,15 @@ curl -X POST ${a}/v1/messages \\
|
|
|
338
340
|
"messages": [{"role":"user","content":"你好"}]
|
|
339
341
|
}'`;
|
|
340
342
|
}
|
|
341
|
-
function
|
|
342
|
-
const [a, o] = k("personal"), [c, d] = k([]), [g, D] = k([]), [w, T] = k(!0), [C, x] = k(!1), [b, P] = k(!1), [
|
|
343
|
+
function it() {
|
|
344
|
+
const [a, o] = k("personal"), [c, d] = k([]), [g, D] = k([]), [w, T] = k(!0), [C, x] = k(!1), [b, P] = k(!1), [i, p] = k(""), [h, I] = k({ open: !1 }), [M, u] = k(null), [A, K] = k(null), [J, R] = k(!1), H = "zifang", ee = "zifang", n = et(), r = $(async () => {
|
|
343
345
|
T(!0);
|
|
344
346
|
try {
|
|
345
|
-
const [
|
|
347
|
+
const [l, f] = await Promise.all([
|
|
346
348
|
ce("system-default").catch(() => []),
|
|
347
349
|
ce(H).catch(() => [])
|
|
348
350
|
]);
|
|
349
|
-
d(
|
|
351
|
+
d(l), D(f);
|
|
350
352
|
} finally {
|
|
351
353
|
T(!1);
|
|
352
354
|
}
|
|
@@ -354,27 +356,27 @@ function lt() {
|
|
|
354
356
|
X(() => {
|
|
355
357
|
r();
|
|
356
358
|
}, [r]);
|
|
357
|
-
const
|
|
359
|
+
const N = () => {
|
|
358
360
|
p(""), P(!0);
|
|
359
361
|
}, y = async () => {
|
|
360
|
-
if (!
|
|
362
|
+
if (!i.trim()) {
|
|
361
363
|
_.warning("请输入 AK 名称");
|
|
362
364
|
return;
|
|
363
365
|
}
|
|
364
366
|
x(!0);
|
|
365
367
|
try {
|
|
366
|
-
const
|
|
367
|
-
tt(
|
|
368
|
+
const l = await ye(H, ee, i.trim());
|
|
369
|
+
tt(l.akPrefix, l.apiKey), P(!1), I({
|
|
368
370
|
open: !0,
|
|
369
|
-
apiKey:
|
|
370
|
-
akPrefix:
|
|
371
|
+
apiKey: l.apiKey,
|
|
372
|
+
akPrefix: l.akPrefix
|
|
371
373
|
}), r();
|
|
372
|
-
} catch (
|
|
373
|
-
_.error(
|
|
374
|
+
} catch (l) {
|
|
375
|
+
_.error(l instanceof Error ? l.message : "创建 AK 失败");
|
|
374
376
|
} finally {
|
|
375
377
|
x(!1);
|
|
376
378
|
}
|
|
377
|
-
}, L = (
|
|
379
|
+
}, L = (l) => {
|
|
378
380
|
se.confirm({
|
|
379
381
|
title: "确认吊销此 AK?",
|
|
380
382
|
content: "吊销后此 AK 将立即失效,无法恢复。",
|
|
@@ -383,21 +385,21 @@ function lt() {
|
|
|
383
385
|
cancelText: "取消",
|
|
384
386
|
onOk: async () => {
|
|
385
387
|
try {
|
|
386
|
-
await Xe(
|
|
388
|
+
await Xe(l), _.success("AK 已吊销"), r(), ke();
|
|
387
389
|
} catch (f) {
|
|
388
390
|
_.error(f instanceof Error ? f.message : "吊销失败");
|
|
389
391
|
}
|
|
390
392
|
}
|
|
391
393
|
});
|
|
392
|
-
}, v = (
|
|
393
|
-
navigator.clipboard.writeText(
|
|
394
|
-
}, U = (
|
|
395
|
-
const f = at(
|
|
396
|
-
f ? v(f) : (v(
|
|
397
|
-
}, te = async (
|
|
398
|
-
u(
|
|
394
|
+
}, v = (l) => {
|
|
395
|
+
navigator.clipboard.writeText(l).then(() => _.success("已复制到剪贴板")).catch(() => _.warning("复制失败,请手动复制"));
|
|
396
|
+
}, U = (l) => {
|
|
397
|
+
const f = at(l.akPrefix);
|
|
398
|
+
f ? v(f) : (v(l.akPrefix), _.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
|
|
399
|
+
}, te = async (l) => {
|
|
400
|
+
u(l), R(!0), K(null);
|
|
399
401
|
try {
|
|
400
|
-
const f = await Qe(
|
|
402
|
+
const f = await Qe(l.id);
|
|
401
403
|
K(f);
|
|
402
404
|
} catch (f) {
|
|
403
405
|
_.error(f instanceof Error ? f.message : "获取用量失败");
|
|
@@ -406,13 +408,13 @@ function lt() {
|
|
|
406
408
|
}
|
|
407
409
|
}, S = () => {
|
|
408
410
|
u(null), K(null);
|
|
409
|
-
}, O = (
|
|
410
|
-
const f = Object.entries(
|
|
411
|
+
}, O = (l) => {
|
|
412
|
+
const f = Object.entries(l);
|
|
411
413
|
if (f.length === 0)
|
|
412
414
|
return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
413
|
-
const
|
|
415
|
+
const j = Math.max(...f.map(([, m]) => m[1] + m[2]), 1);
|
|
414
416
|
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: f.map(([m, E]) => {
|
|
415
|
-
const re = E[1] + E[2], ve = re /
|
|
417
|
+
const re = E[1] + E[2], ve = re / j * 100;
|
|
416
418
|
return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
|
|
417
419
|
/* @__PURE__ */ e(G, { title: `${m}: ${E[0]}次 / ${re} tokens`, children: /* @__PURE__ */ e(
|
|
418
420
|
"div",
|
|
@@ -424,18 +426,18 @@ function lt() {
|
|
|
424
426
|
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children: m })
|
|
425
427
|
] }, m);
|
|
426
428
|
}) });
|
|
427
|
-
}, W = (
|
|
428
|
-
const f = Object.entries(
|
|
429
|
+
}, W = (l) => {
|
|
430
|
+
const f = Object.entries(l);
|
|
429
431
|
if (f.length === 0)
|
|
430
432
|
return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
431
|
-
const
|
|
433
|
+
const j = Math.max(...f.map(([, m]) => m[0]), 1);
|
|
432
434
|
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: f.sort((m, E) => E[1][0] - m[1][0]).map(([m, E]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
|
|
433
435
|
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: m }),
|
|
434
436
|
/* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
|
|
435
437
|
"div",
|
|
436
438
|
{
|
|
437
439
|
className: t.modelBreakdownFill,
|
|
438
|
-
style: { width: `${E[0] /
|
|
440
|
+
style: { width: `${E[0] / j * 100}%` }
|
|
439
441
|
}
|
|
440
442
|
) }),
|
|
441
443
|
/* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
|
|
@@ -451,7 +453,7 @@ function lt() {
|
|
|
451
453
|
dataIndex: "createTime",
|
|
452
454
|
key: "createTime",
|
|
453
455
|
width: 160,
|
|
454
|
-
render: (
|
|
456
|
+
render: (l) => l ? new Date(l).toLocaleString("zh-CN") : "-"
|
|
455
457
|
},
|
|
456
458
|
{ title: "模型", dataIndex: "model", key: "model", width: 140 },
|
|
457
459
|
{
|
|
@@ -459,7 +461,7 @@ function lt() {
|
|
|
459
461
|
dataIndex: "protocol",
|
|
460
462
|
key: "protocol",
|
|
461
463
|
width: 90,
|
|
462
|
-
render: (
|
|
464
|
+
render: (l) => /* @__PURE__ */ e(F, { children: l })
|
|
463
465
|
},
|
|
464
466
|
{
|
|
465
467
|
title: "输入",
|
|
@@ -484,18 +486,18 @@ function lt() {
|
|
|
484
486
|
dataIndex: "latencyMs",
|
|
485
487
|
key: "latencyMs",
|
|
486
488
|
width: 70,
|
|
487
|
-
render: (
|
|
489
|
+
render: (l) => l ? `${l}ms` : "-"
|
|
488
490
|
},
|
|
489
491
|
{
|
|
490
492
|
title: "状态",
|
|
491
493
|
dataIndex: "statusCode",
|
|
492
494
|
key: "statusCode",
|
|
493
495
|
width: 60,
|
|
494
|
-
render: (
|
|
496
|
+
render: (l) => l ? /* @__PURE__ */ e(F, { color: l < 400 ? "green" : "red", children: l }) : "-"
|
|
495
497
|
}
|
|
496
|
-
],
|
|
497
|
-
const
|
|
498
|
-
return w ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(Q, { description: "加载中..." }) }) :
|
|
498
|
+
], le = (l, f) => {
|
|
499
|
+
const j = Array.isArray(l) ? l : [];
|
|
500
|
+
return w ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(Q, { description: "加载中..." }) }) : j.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: f ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: j.map((m) => /* @__PURE__ */ s(
|
|
499
501
|
"div",
|
|
500
502
|
{
|
|
501
503
|
className: t.akCard,
|
|
@@ -535,7 +537,7 @@ function lt() {
|
|
|
535
537
|
{
|
|
536
538
|
size: "small",
|
|
537
539
|
danger: !0,
|
|
538
|
-
icon: /* @__PURE__ */ e(
|
|
540
|
+
icon: /* @__PURE__ */ e(Ne, {}),
|
|
539
541
|
onClick: () => L(m.id),
|
|
540
542
|
children: "吊销"
|
|
541
543
|
}
|
|
@@ -627,7 +629,7 @@ function lt() {
|
|
|
627
629
|
De,
|
|
628
630
|
{
|
|
629
631
|
activeKey: a,
|
|
630
|
-
onChange: (
|
|
632
|
+
onChange: (l) => o(l),
|
|
631
633
|
items: [
|
|
632
634
|
{ key: "app", label: "应用 AK" },
|
|
633
635
|
{ key: "personal", label: "个人 AK" }
|
|
@@ -636,13 +638,13 @@ function lt() {
|
|
|
636
638
|
}
|
|
637
639
|
),
|
|
638
640
|
/* @__PURE__ */ s("div", { style: { display: "flex", gap: 8 }, children: [
|
|
639
|
-
/* @__PURE__ */ e(B, { icon: /* @__PURE__ */ e(
|
|
641
|
+
/* @__PURE__ */ e(B, { icon: /* @__PURE__ */ e(Ae, {}), onClick: r, size: "small", children: "刷新" }),
|
|
640
642
|
a === "personal" && /* @__PURE__ */ e(
|
|
641
643
|
B,
|
|
642
644
|
{
|
|
643
645
|
type: "primary",
|
|
644
646
|
icon: /* @__PURE__ */ e(pe, {}),
|
|
645
|
-
onClick:
|
|
647
|
+
onClick: N,
|
|
646
648
|
loading: C,
|
|
647
649
|
children: "生成 AK"
|
|
648
650
|
}
|
|
@@ -651,7 +653,7 @@ function lt() {
|
|
|
651
653
|
]
|
|
652
654
|
}
|
|
653
655
|
),
|
|
654
|
-
a === "app" ?
|
|
656
|
+
a === "app" ? le(c, !0) : le(g, !1)
|
|
655
657
|
] }),
|
|
656
658
|
/* @__PURE__ */ s(
|
|
657
659
|
se,
|
|
@@ -679,8 +681,8 @@ function lt() {
|
|
|
679
681
|
ue,
|
|
680
682
|
{
|
|
681
683
|
placeholder: "例如:测试用 AK、生产网关 AK",
|
|
682
|
-
value:
|
|
683
|
-
onChange: (
|
|
684
|
+
value: i,
|
|
685
|
+
onChange: (l) => p(l.target.value),
|
|
684
686
|
onPressEnter: y,
|
|
685
687
|
maxLength: 50,
|
|
686
688
|
autoFocus: !0
|
|
@@ -749,40 +751,40 @@ function lt() {
|
|
|
749
751
|
open: !!M,
|
|
750
752
|
onClose: S,
|
|
751
753
|
size: "large",
|
|
752
|
-
children: J ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Q, { description: "加载用量数据..." }) }) :
|
|
754
|
+
children: J ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Q, { description: "加载用量数据..." }) }) : A ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
|
|
753
755
|
/* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
|
|
754
|
-
/* @__PURE__ */ e(
|
|
755
|
-
/* @__PURE__ */ e(
|
|
756
|
+
/* @__PURE__ */ e(q, { title: "总请求数", value: A.totalRequests }),
|
|
757
|
+
/* @__PURE__ */ e(q, { title: "总 Token", value: A.totalTokens }),
|
|
756
758
|
/* @__PURE__ */ e(
|
|
757
|
-
|
|
759
|
+
q,
|
|
758
760
|
{
|
|
759
761
|
title: "输入 Token",
|
|
760
|
-
value:
|
|
762
|
+
value: A.totalPromptTokens
|
|
761
763
|
}
|
|
762
764
|
),
|
|
763
765
|
/* @__PURE__ */ e(
|
|
764
|
-
|
|
766
|
+
q,
|
|
765
767
|
{
|
|
766
768
|
title: "输出 Token",
|
|
767
|
-
value:
|
|
769
|
+
value: A.totalCompletionTokens
|
|
768
770
|
}
|
|
769
771
|
),
|
|
770
772
|
/* @__PURE__ */ e(
|
|
771
|
-
|
|
773
|
+
q,
|
|
772
774
|
{
|
|
773
775
|
title: "平均耗时",
|
|
774
|
-
value:
|
|
776
|
+
value: A.avgLatencyMs,
|
|
775
777
|
suffix: "ms"
|
|
776
778
|
}
|
|
777
779
|
),
|
|
778
780
|
/* @__PURE__ */ e(
|
|
779
|
-
|
|
781
|
+
q,
|
|
780
782
|
{
|
|
781
783
|
title: "错误数",
|
|
782
|
-
value:
|
|
784
|
+
value: A.errorCount,
|
|
783
785
|
styles: {
|
|
784
786
|
content: {
|
|
785
|
-
color:
|
|
787
|
+
color: A.errorCount > 0 ? "#ff4d4f" : void 0
|
|
786
788
|
}
|
|
787
789
|
}
|
|
788
790
|
}
|
|
@@ -790,11 +792,11 @@ function lt() {
|
|
|
790
792
|
] }),
|
|
791
793
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
792
794
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "每日调用曲线(近 30 天)" }),
|
|
793
|
-
O(
|
|
795
|
+
O(A.daily)
|
|
794
796
|
] }),
|
|
795
797
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
796
798
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "模型用量分布" }),
|
|
797
|
-
W(
|
|
799
|
+
W(A.models)
|
|
798
800
|
] }),
|
|
799
801
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
800
802
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "最近调用记录" }),
|
|
@@ -802,7 +804,7 @@ function lt() {
|
|
|
802
804
|
Le,
|
|
803
805
|
{
|
|
804
806
|
columns: ae,
|
|
805
|
-
dataSource:
|
|
807
|
+
dataSource: A.recent,
|
|
806
808
|
rowKey: "id",
|
|
807
809
|
size: "small",
|
|
808
810
|
pagination: { pageSize: 10, size: "small" },
|
|
@@ -815,7 +817,7 @@ function lt() {
|
|
|
815
817
|
)
|
|
816
818
|
] });
|
|
817
819
|
}
|
|
818
|
-
function
|
|
820
|
+
function lt(a) {
|
|
819
821
|
const o = [];
|
|
820
822
|
if (!a) return o;
|
|
821
823
|
const c = /<(think|thinking|reasoning)>([\s\S]*?)<\/\1>/gi;
|
|
@@ -827,14 +829,14 @@ function it(a) {
|
|
|
827
829
|
const Z = 4;
|
|
828
830
|
let rt = 0;
|
|
829
831
|
function ct({ initialModels: a }) {
|
|
830
|
-
const [o, c] = k([]), [d, g] = k([]), [D, w] = k(!0), [T, C] = k(""), [x, b] = k(!1), P = ne(""),
|
|
832
|
+
const [o, c] = k([]), [d, g] = k([]), [D, w] = k(!0), [T, C] = k(""), [x, b] = k(!1), P = ne(""), i = ne(/* @__PURE__ */ new Map()), p = ne(/* @__PURE__ */ new Map());
|
|
831
833
|
X(() => {
|
|
832
834
|
(async () => {
|
|
833
835
|
try {
|
|
834
836
|
const n = await fe();
|
|
835
837
|
g(n), w(!1);
|
|
836
|
-
const
|
|
837
|
-
c(
|
|
838
|
+
const N = (a.length > 0 ? a : n.length > 0 ? [n[0].modelName] : ["qwen3.6-flash"]).slice(0, Z).map((y) => V(y));
|
|
839
|
+
c(N);
|
|
838
840
|
} catch {
|
|
839
841
|
w(!1), c([V(a[0] || "qwen3.6-flash")]);
|
|
840
842
|
}
|
|
@@ -850,7 +852,7 @@ function ct({ initialModels: a }) {
|
|
|
850
852
|
r && (r.scrollTop = r.scrollHeight);
|
|
851
853
|
}, []), I = $(
|
|
852
854
|
(n, r) => {
|
|
853
|
-
c((
|
|
855
|
+
c((N) => N.map((y) => y.id === n ? r(y) : y));
|
|
854
856
|
},
|
|
855
857
|
[]
|
|
856
858
|
), M = $(async () => {
|
|
@@ -867,7 +869,7 @@ function ct({ initialModels: a }) {
|
|
|
867
869
|
return;
|
|
868
870
|
}
|
|
869
871
|
C(""), b(!0);
|
|
870
|
-
const
|
|
872
|
+
const N = o.map((v) => ({
|
|
871
873
|
...v,
|
|
872
874
|
messages: [
|
|
873
875
|
...v.messages,
|
|
@@ -879,11 +881,11 @@ function ct({ initialModels: a }) {
|
|
|
879
881
|
error: null,
|
|
880
882
|
usage: null
|
|
881
883
|
}));
|
|
882
|
-
c(
|
|
883
|
-
const y =
|
|
884
|
+
c(N);
|
|
885
|
+
const y = N;
|
|
884
886
|
y.forEach((v) => {
|
|
885
887
|
const U = new AbortController();
|
|
886
|
-
|
|
888
|
+
i.current.set(v.id, U);
|
|
887
889
|
const te = v.messages.slice(0, -1);
|
|
888
890
|
Ve(r, v.model, te, {
|
|
889
891
|
onDelta: (S) => {
|
|
@@ -904,14 +906,14 @@ function ct({ initialModels: a }) {
|
|
|
904
906
|
completionTokens: S.completionTokens,
|
|
905
907
|
totalTokens: S.totalTokens
|
|
906
908
|
} : null
|
|
907
|
-
})),
|
|
909
|
+
})), i.current.delete(v.id);
|
|
908
910
|
},
|
|
909
911
|
onError: (S) => {
|
|
910
912
|
(S.message.includes("401") || S.message.includes("API key")) && (ke(), P.current = ""), I(v.id, (O) => ({
|
|
911
913
|
...O,
|
|
912
914
|
isStreaming: !1,
|
|
913
915
|
error: S.message
|
|
914
|
-
})),
|
|
916
|
+
})), i.current.delete(v.id);
|
|
915
917
|
},
|
|
916
918
|
signal: U.signal
|
|
917
919
|
}).catch(() => {
|
|
@@ -919,21 +921,21 @@ function ct({ initialModels: a }) {
|
|
|
919
921
|
});
|
|
920
922
|
const L = setInterval(() => {
|
|
921
923
|
y.every(
|
|
922
|
-
(U) => !
|
|
924
|
+
(U) => !i.current.has(U.id)
|
|
923
925
|
) && (clearInterval(L), b(!1));
|
|
924
926
|
}, 200);
|
|
925
927
|
setTimeout(() => {
|
|
926
928
|
clearInterval(L), b(!1);
|
|
927
929
|
}, 300 * 1e3);
|
|
928
|
-
}, [T, x, o, M, I, h]),
|
|
929
|
-
|
|
930
|
+
}, [T, x, o, M, I, h]), A = $(() => {
|
|
931
|
+
i.current.forEach((n) => n.abort()), i.current.clear(), c((n) => n.map((r) => ({ ...r, isStreaming: !1 }))), b(!1);
|
|
930
932
|
}, []), K = $(() => {
|
|
931
|
-
var r,
|
|
933
|
+
var r, N;
|
|
932
934
|
if (o.length >= Z) return;
|
|
933
|
-
const n = ((r = d.find((y) => !o.some((L) => L.model === y.modelName))) == null ? void 0 : r.modelName) || ((
|
|
935
|
+
const n = ((r = d.find((y) => !o.some((L) => L.model === y.modelName))) == null ? void 0 : r.modelName) || ((N = d[0]) == null ? void 0 : N.modelName) || "qwen3.6-flash";
|
|
934
936
|
c((y) => [...y, V(n)]);
|
|
935
937
|
}, [o, d]), J = $(() => {
|
|
936
|
-
|
|
938
|
+
i.current.forEach((n) => n.abort()), i.current.clear(), c(
|
|
937
939
|
(n) => n.map((r) => ({
|
|
938
940
|
...r,
|
|
939
941
|
messages: [],
|
|
@@ -944,11 +946,11 @@ function ct({ initialModels: a }) {
|
|
|
944
946
|
}))
|
|
945
947
|
), b(!1);
|
|
946
948
|
}, [x, o]), R = $((n) => {
|
|
947
|
-
const r =
|
|
948
|
-
r && r.abort(),
|
|
949
|
+
const r = i.current.get(n);
|
|
950
|
+
r && r.abort(), i.current.delete(n), c((N) => N.filter((y) => y.id !== n));
|
|
949
951
|
}, []), H = $(
|
|
950
952
|
(n, r) => {
|
|
951
|
-
I(n, (
|
|
953
|
+
I(n, (N) => ({ ...N, model: r }));
|
|
952
954
|
},
|
|
953
955
|
[I]
|
|
954
956
|
), ee = d.map((n) => ({
|
|
@@ -1007,12 +1009,12 @@ function ct({ initialModels: a }) {
|
|
|
1007
1009
|
p.current.set(n.id, r);
|
|
1008
1010
|
},
|
|
1009
1011
|
children: [
|
|
1010
|
-
n.messages.map((r,
|
|
1012
|
+
n.messages.map((r, N) => /* @__PURE__ */ s(
|
|
1011
1013
|
"div",
|
|
1012
1014
|
{
|
|
1013
1015
|
className: r.role === "user" ? t.chatMsgUser : t.chatMsgAI,
|
|
1014
1016
|
children: [
|
|
1015
|
-
r.role === "assistant" ?
|
|
1017
|
+
r.role === "assistant" ? lt(r.content).map(
|
|
1016
1018
|
(y, L) => y.type === "think" ? /* @__PURE__ */ s(
|
|
1017
1019
|
"details",
|
|
1018
1020
|
{
|
|
@@ -1025,10 +1027,10 @@ function ct({ initialModels: a }) {
|
|
|
1025
1027
|
L
|
|
1026
1028
|
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: y.text }, L)
|
|
1027
1029
|
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: r.content }),
|
|
1028
|
-
n.isStreaming &&
|
|
1030
|
+
n.isStreaming && N === n.messages.length - 1 && r.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
|
|
1029
1031
|
]
|
|
1030
1032
|
},
|
|
1031
|
-
|
|
1033
|
+
N
|
|
1032
1034
|
)),
|
|
1033
1035
|
n.error && /* @__PURE__ */ e("div", { className: t.chatMsgError, children: n.error }),
|
|
1034
1036
|
n.usage && /* @__PURE__ */ s("div", { className: t.chatUsageBar, children: [
|
|
@@ -1062,7 +1064,7 @@ function ct({ initialModels: a }) {
|
|
|
1062
1064
|
disabled: x
|
|
1063
1065
|
}
|
|
1064
1066
|
),
|
|
1065
|
-
x ? /* @__PURE__ */ e(B, { danger: !0, onClick:
|
|
1067
|
+
x ? /* @__PURE__ */ e(B, { danger: !0, onClick: A, children: "停止" }) : /* @__PURE__ */ s(B, { type: "primary", onClick: u, disabled: !T.trim(), children: [
|
|
1066
1068
|
/* @__PURE__ */ e(Ce, {}),
|
|
1067
1069
|
" 发送"
|
|
1068
1070
|
] })
|
|
@@ -1083,30 +1085,30 @@ function V(a) {
|
|
|
1083
1085
|
function dt({ onStartChat: a }) {
|
|
1084
1086
|
const [o, c] = k([]), [d, g] = k(!0), [D, w] = k(/* @__PURE__ */ new Set());
|
|
1085
1087
|
X(() => {
|
|
1086
|
-
let
|
|
1088
|
+
let i = !1;
|
|
1087
1089
|
return (async () => {
|
|
1088
1090
|
try {
|
|
1089
1091
|
const p = await fe();
|
|
1090
|
-
|
|
1092
|
+
i || (c(p), g(!1));
|
|
1091
1093
|
} catch {
|
|
1092
|
-
|
|
1094
|
+
i || g(!1);
|
|
1093
1095
|
}
|
|
1094
1096
|
})(), () => {
|
|
1095
|
-
|
|
1097
|
+
i = !0;
|
|
1096
1098
|
};
|
|
1097
1099
|
}, []);
|
|
1098
|
-
const T = (
|
|
1100
|
+
const T = (i) => {
|
|
1099
1101
|
w((p) => {
|
|
1100
1102
|
const h = new Set(p);
|
|
1101
|
-
return h.has(
|
|
1103
|
+
return h.has(i) ? h.delete(i) : h.add(i), h;
|
|
1102
1104
|
});
|
|
1103
|
-
}, C = Array.from(D), x = (
|
|
1104
|
-
a([
|
|
1105
|
+
}, C = Array.from(D), x = (i) => {
|
|
1106
|
+
a([i]);
|
|
1105
1107
|
}, b = () => {
|
|
1106
1108
|
C.length > 0 && a(C);
|
|
1107
|
-
}, P = (
|
|
1108
|
-
if (!
|
|
1109
|
-
const p =
|
|
1109
|
+
}, P = (i) => {
|
|
1110
|
+
if (!i) return "default";
|
|
1111
|
+
const p = i.toLowerCase();
|
|
1110
1112
|
return p.includes("aliyun") || p.includes("ali") ? "blue" : p.includes("zhipu") || p.includes("glm") ? "purple" : p.includes("moonshot") || p.includes("kimi") ? "cyan" : p.includes("minimax") ? "orange" : "default";
|
|
1111
1113
|
};
|
|
1112
1114
|
return d ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(Q, { description: "加载模型列表..." }) }) : /* @__PURE__ */ s("div", { children: [
|
|
@@ -1114,13 +1116,13 @@ function dt({ onStartChat: a }) {
|
|
|
1114
1116
|
/* @__PURE__ */ e("h3", { className: t.modelMgmtTitle, children: "模型管理" }),
|
|
1115
1117
|
/* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "数据库管理的可用模型,可选择单个或多个模型发起对话对比" })
|
|
1116
1118
|
] }),
|
|
1117
|
-
/* @__PURE__ */ e("div", { className: t.modelGrid, children: o.map((
|
|
1118
|
-
const p = D.has(
|
|
1119
|
+
/* @__PURE__ */ e("div", { className: t.modelGrid, children: o.map((i) => {
|
|
1120
|
+
const p = D.has(i.modelName);
|
|
1119
1121
|
return /* @__PURE__ */ s(
|
|
1120
1122
|
"div",
|
|
1121
1123
|
{
|
|
1122
1124
|
className: `${t.modelCard} ${p ? t.modelCardSelected : ""}`,
|
|
1123
|
-
onClick: () => T(
|
|
1125
|
+
onClick: () => T(i.modelName),
|
|
1124
1126
|
children: [
|
|
1125
1127
|
/* @__PURE__ */ e(
|
|
1126
1128
|
ze,
|
|
@@ -1128,42 +1130,42 @@ function dt({ onStartChat: a }) {
|
|
|
1128
1130
|
className: t.modelCheckbox,
|
|
1129
1131
|
checked: p,
|
|
1130
1132
|
onChange: (h) => {
|
|
1131
|
-
h.stopPropagation(), T(
|
|
1133
|
+
h.stopPropagation(), T(i.modelName);
|
|
1132
1134
|
}
|
|
1133
1135
|
}
|
|
1134
1136
|
),
|
|
1135
1137
|
/* @__PURE__ */ s("div", { className: t.modelCardHeader, children: [
|
|
1136
1138
|
/* @__PURE__ */ e("div", { className: t.modelIconWrap, children: /* @__PURE__ */ e(he, {}) }),
|
|
1137
1139
|
/* @__PURE__ */ s("div", { className: t.modelCardInfo, children: [
|
|
1138
|
-
/* @__PURE__ */ e("h4", { className: t.modelName, children:
|
|
1140
|
+
/* @__PURE__ */ e("h4", { className: t.modelName, children: i.modelName }),
|
|
1139
1141
|
/* @__PURE__ */ s("div", { className: t.modelTags, children: [
|
|
1140
|
-
|
|
1142
|
+
i.modelProvider && /* @__PURE__ */ e(
|
|
1141
1143
|
F,
|
|
1142
1144
|
{
|
|
1143
|
-
color: P(
|
|
1145
|
+
color: P(i.modelProvider),
|
|
1144
1146
|
style: { fontSize: 11, margin: 0 },
|
|
1145
|
-
children:
|
|
1147
|
+
children: i.modelProvider
|
|
1146
1148
|
}
|
|
1147
1149
|
),
|
|
1148
|
-
/* @__PURE__ */ e(F, { style: { fontSize: 11, margin: 0 }, children:
|
|
1150
|
+
/* @__PURE__ */ e(F, { style: { fontSize: 11, margin: 0 }, children: i.apiType })
|
|
1149
1151
|
] })
|
|
1150
1152
|
] })
|
|
1151
1153
|
] }),
|
|
1152
|
-
/* @__PURE__ */ e("p", { className: t.modelEndpoint, children:
|
|
1154
|
+
/* @__PURE__ */ e("p", { className: t.modelEndpoint, children: i.endpoint }),
|
|
1153
1155
|
/* @__PURE__ */ e("div", { className: t.modelCardFooter, children: /* @__PURE__ */ e(
|
|
1154
1156
|
B,
|
|
1155
1157
|
{
|
|
1156
1158
|
type: "link",
|
|
1157
1159
|
size: "small",
|
|
1158
1160
|
onClick: (h) => {
|
|
1159
|
-
h.stopPropagation(), x(
|
|
1161
|
+
h.stopPropagation(), x(i.modelName);
|
|
1160
1162
|
},
|
|
1161
1163
|
children: "发起对话"
|
|
1162
1164
|
}
|
|
1163
1165
|
) })
|
|
1164
1166
|
]
|
|
1165
1167
|
},
|
|
1166
|
-
|
|
1168
|
+
i.modelName
|
|
1167
1169
|
);
|
|
1168
1170
|
}) }),
|
|
1169
1171
|
C.length > 0 && /* @__PURE__ */ s("div", { className: t.modelActionBar, children: [
|
|
@@ -1200,7 +1202,7 @@ const mt = [
|
|
|
1200
1202
|
{ key: "agent-dashboard", label: "Agent 监控", icon: /* @__PURE__ */ e(Oe, {}) },
|
|
1201
1203
|
{ key: "debug-console", label: "Debug 调试台", icon: /* @__PURE__ */ e(Ee, {}) }
|
|
1202
1204
|
];
|
|
1203
|
-
function
|
|
1205
|
+
function wt() {
|
|
1204
1206
|
const [a, o] = k("model-management"), [c, d] = k([]), g = (w) => {
|
|
1205
1207
|
d(w), o("model-chat");
|
|
1206
1208
|
}, D = Be(() => mt, []);
|
|
@@ -1246,7 +1248,7 @@ function At() {
|
|
|
1246
1248
|
display: a === "ak-management" ? "block" : "none",
|
|
1247
1249
|
height: "100%"
|
|
1248
1250
|
},
|
|
1249
|
-
children: /* @__PURE__ */ e(
|
|
1251
|
+
children: /* @__PURE__ */ e(it, {})
|
|
1250
1252
|
}
|
|
1251
1253
|
),
|
|
1252
1254
|
/* @__PURE__ */ e(
|
|
@@ -1276,7 +1278,7 @@ function At() {
|
|
|
1276
1278
|
display: a === "template-market" ? "block" : "none",
|
|
1277
1279
|
height: "100%"
|
|
1278
1280
|
},
|
|
1279
|
-
children: /* @__PURE__ */ e(
|
|
1281
|
+
children: /* @__PURE__ */ e(je, {})
|
|
1280
1282
|
}
|
|
1281
1283
|
),
|
|
1282
1284
|
/* @__PURE__ */ e(
|
|
@@ -1286,7 +1288,7 @@ function At() {
|
|
|
1286
1288
|
display: a === "mcp-service" ? "block" : "none",
|
|
1287
1289
|
height: "100%"
|
|
1288
1290
|
},
|
|
1289
|
-
children: /* @__PURE__ */ e(
|
|
1291
|
+
children: /* @__PURE__ */ e(qe, {})
|
|
1290
1292
|
}
|
|
1291
1293
|
),
|
|
1292
1294
|
/* @__PURE__ */ e(
|
|
@@ -1323,5 +1325,5 @@ function At() {
|
|
|
1323
1325
|
] });
|
|
1324
1326
|
}
|
|
1325
1327
|
export {
|
|
1326
|
-
|
|
1328
|
+
wt as default
|
|
1327
1329
|
};
|