@yuku123/z-team-component 0.2.58 → 0.2.60
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-Cstbioyw.js → ChangeLogView-VRWVzP0r.js} +1 -1
- package/dist/{ComponentDoc-MWEULbua.js → ComponentDoc-DjfucAFW.js} +1497 -1387
- package/dist/{InvitationManagementPage-DHomiF0D.js → InvitationManagementPage-BQ_4HcPk.js} +1 -1
- package/dist/{OnboardingPage-D4ccf9Rj.js → OnboardingPage-DM8emo6P.js} +2 -2
- package/dist/{ScheduledTasks-xjtP-eIJ.js → ScheduledTasks-BYxdbsSa.js} +8 -8
- package/dist/SystemShell-BEdMWZ8d.js +670 -0
- package/dist/{admin-logs-B9KS6VJz.js → admin-logs-DCYof_u5.js} +2 -2
- package/dist/{api-BAOITIl4.js → api-Bz4pq8m7.js} +1 -1
- package/dist/{api-CALqShkO.js → api-DWt94BcM.js} +584 -572
- package/dist/{createWorkspaceWsHandler-DP30xvug.js → createWorkspaceWsHandler-3aHkBZE9.js} +4 -4
- package/dist/{index-4YxdJwFm.js → index-4LNRkvy6.js} +3 -3
- package/dist/{index-CDFDjyHa.js → index-BHUK6MwQ.js} +1794 -1784
- package/dist/{index-C2Wkg1b5.js → index-BIdcTXZW.js} +3 -3
- package/dist/index-BVEvns4M.js +2858 -0
- package/dist/{index-m8V5TniT.js → index-BVh0W8ck.js} +15861 -15586
- package/dist/{index-C4-Sn2rx.js → index-C0rbeCoZ.js} +12 -12
- package/dist/{index-8gCovDDT.js → index-C6jp_1-U.js} +6 -6
- package/dist/index-CQSTQAPg.js +112 -0
- package/dist/{index-lftFkqfI.js → index-CTKf6h2u.js} +4 -4
- package/dist/{index-Ot_5dG_I.js → index-Cf7WJqfM.js} +20 -16
- package/dist/{index-Bw0a0nRQ.js → index-Cip94Q-G.js} +3 -3
- package/dist/{index-DKeYG0Fu.js → index-CrIIInfs.js} +4 -4
- package/dist/{index-UjMCPXHz.js → index-DbEvwIck.js} +3 -3
- package/dist/{index-CLWgeKwr.js → index-DtVBFjaJ.js} +2 -2
- package/dist/{index-CGWttFLb.js → index-Dvhocfyo.js} +4 -4
- package/dist/index-DyE5noq6.js +118 -0
- package/dist/{index-DHXxiZa9.js → index-KqKj9E7y.js} +3 -3
- package/dist/{index-aw72ID7y.js → index-NPxrK-81.js} +1 -1
- package/dist/{index-CinRd7Nz.js → index-VY-pgcyl.js} +1 -1
- package/dist/{index-DJOyOVn_.js → index-VxO9i5r6.js} +1 -1
- package/dist/{index-DniCNHNJ.js → index-_gGu4e-w.js} +1 -1
- package/dist/{index-C3B7CbHo.js → index-bsGAZKaU.js} +624 -613
- package/dist/{index-Dtm6ORr2.js → index-eGX5rkV8.js} +5 -5
- package/dist/{index-DET70T3j.js → index-i6Ejgpao.js} +1 -1
- package/dist/index-ncjLe3A0.js +93 -0
- package/dist/index.js +1 -1
- package/dist/{instance-f3C-1qYl.js → instance-CbkHlDr4.js} +1 -1
- package/dist/menuPermission-BWqugXIc.js +60 -0
- package/dist/pages.js +1 -1
- package/dist/schedule-BRvmKoDG.js +587 -0
- package/dist/{send-default-agent-team-message-d_ECdczr.js → send-default-agent-team-message-8wnVWO7H.js} +1 -1
- package/dist/{sso-user-HcsSzg8P.js → sso-user-QZNVhjpR.js} +1 -1
- package/dist/{training-DnNQN0An.js → training-DYo1pvX7.js} +1 -1
- package/dist/{useAppStore-kRZEA5WZ.js → useAppStore-BGOxWep2.js} +6 -2
- package/dist/{webide-BcRzJX-h.js → webide-CWTbQs4I.js} +4 -4
- package/dist/z-team-component.css +2 -2
- package/package.json +1 -1
- package/dist/SystemShell-XnTCunV0.js +0 -907
- package/dist/index-BPOiMJa1.js +0 -2841
- package/dist/index-C0EIMJI2.js +0 -112
- package/dist/index-DRrBkbr_.js +0 -100
- package/dist/schedule-DfkgwPdE.js +0 -497
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { CopyOutlined as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { u as
|
|
6
|
-
import { AgentAppList as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
2
|
+
import { CopyOutlined as oe, ReloadOutlined as ve, PlusOutlined as Te, DeleteOutlined as Oe, ClearOutlined as Ue, CloseOutlined as Re, SendOutlined as De, RobotOutlined as Se, CloudServerOutlined as He, MessageOutlined as Fe, KeyOutlined as je, ApiOutlined as qe, ToolOutlined as Ge, BarChartOutlined as Je } from "@ant-design/icons";
|
|
3
|
+
import { Tooltip as Y, Tabs as we, Input as pe, Button as D, Modal as ue, Drawer as Ae, Spin as X, Statistic as K, Table as Be, message as J, Tag as W, Select as We, Checkbox as Qe } from "antd";
|
|
4
|
+
import { useState as N, useEffect as Z, useCallback as j, useRef as he, useMemo as ze, Suspense as Ve, lazy as Ye } from "react";
|
|
5
|
+
import { u as Me } from "./useAppStore-BGOxWep2.js";
|
|
6
|
+
import { AgentAppList as Xe, McpPage as Ze, SkillMarket as et } from "@yuku123/z-agent-component";
|
|
7
|
+
const le = "ft_gateway_default_ak", Ie = "system-default", ee = "", ke = "";
|
|
8
|
+
function te(a = {}) {
|
|
9
9
|
const n = { Accept: "application/json", ...a };
|
|
10
10
|
try {
|
|
11
11
|
const r = localStorage.getItem("token");
|
|
@@ -14,7 +14,7 @@ function ee(a = {}) {
|
|
|
14
14
|
}
|
|
15
15
|
return n;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function tt(a) {
|
|
18
18
|
return {
|
|
19
19
|
modelName: String(a.modelName ?? a.model_name ?? a.service ?? ""),
|
|
20
20
|
service: String(a.service ?? a.modelName ?? ""),
|
|
@@ -23,12 +23,12 @@ function Ze(a) {
|
|
|
23
23
|
apiType: String(a.apiType ?? a.api_type ?? "OpenAPI")
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
async function
|
|
26
|
+
async function fe() {
|
|
27
27
|
let a;
|
|
28
28
|
try {
|
|
29
|
-
a = await fetch(`${
|
|
29
|
+
a = await fetch(`${ee}/api/scenario-instances/0/models`, {
|
|
30
30
|
credentials: "include",
|
|
31
|
-
headers:
|
|
31
|
+
headers: te({
|
|
32
32
|
Accept: "application/json",
|
|
33
33
|
"project-env": window.ENV_TYPE ?? "local"
|
|
34
34
|
})
|
|
@@ -47,11 +47,11 @@ async function pe() {
|
|
|
47
47
|
const r = n != null && n.success ? n.data : (n == null ? void 0 : n.data) ?? n;
|
|
48
48
|
if (!Array.isArray(r))
|
|
49
49
|
throw new Error("模型列表返回格式异常(非数组)");
|
|
50
|
-
return r.map(
|
|
50
|
+
return r.map(tt);
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
53
|
-
var
|
|
54
|
-
const
|
|
52
|
+
async function at(a, n, r, i) {
|
|
53
|
+
var z, O, w;
|
|
54
|
+
const u = await fetch(`${ke}/v1/chat/completions`, {
|
|
55
55
|
method: "POST",
|
|
56
56
|
headers: {
|
|
57
57
|
"Content-Type": "application/json",
|
|
@@ -65,35 +65,35 @@ async function et(a, n, r, i) {
|
|
|
65
65
|
}),
|
|
66
66
|
signal: i.signal
|
|
67
67
|
});
|
|
68
|
-
if (!
|
|
69
|
-
const
|
|
70
|
-
if (/<!doctype html/i.test(
|
|
68
|
+
if (!u.ok || !u.body) {
|
|
69
|
+
const C = await u.text().catch(() => "");
|
|
70
|
+
if (/<!doctype html/i.test(C.slice(0, 200)))
|
|
71
71
|
throw new Error("模型网关未接入(/v1/chat/completions 落到主壳 SPA,无网关响应)");
|
|
72
|
-
let
|
|
72
|
+
let v = `HTTP ${u.status}`;
|
|
73
73
|
try {
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const g = JSON.parse(C);
|
|
75
|
+
v = ((z = g == null ? void 0 : g.error) == null ? void 0 : z.message) ?? v;
|
|
76
76
|
} catch {
|
|
77
|
-
|
|
77
|
+
C && (v = C);
|
|
78
78
|
}
|
|
79
|
-
throw new Error(
|
|
79
|
+
throw new Error(v);
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
let
|
|
81
|
+
const f = u.body.getReader(), y = new TextDecoder();
|
|
82
|
+
let _ = "", p;
|
|
83
83
|
try {
|
|
84
84
|
for (; ; ) {
|
|
85
|
-
const { done:
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
const
|
|
85
|
+
const { done: C, value: v } = await f.read();
|
|
86
|
+
if (C) break;
|
|
87
|
+
_ += y.decode(v, { stream: !0 });
|
|
88
|
+
const g = _.split(`
|
|
89
89
|
|
|
90
90
|
`);
|
|
91
|
-
|
|
92
|
-
for (const c of
|
|
91
|
+
_ = g.pop() ?? "";
|
|
92
|
+
for (const c of g) {
|
|
93
93
|
let k = "";
|
|
94
|
-
for (const
|
|
94
|
+
for (const m of c.split(`
|
|
95
95
|
`))
|
|
96
|
-
|
|
96
|
+
m.startsWith("data:") && (k += m.slice(5).trim());
|
|
97
97
|
if (!k || k === "[DONE]") {
|
|
98
98
|
if (k === "[DONE]") {
|
|
99
99
|
i.onDone(p);
|
|
@@ -102,18 +102,18 @@ async function et(a, n, r, i) {
|
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
promptTokens:
|
|
109
|
-
completionTokens:
|
|
110
|
-
totalTokens:
|
|
105
|
+
const m = JSON.parse(k), A = m == null ? void 0 : m.choices;
|
|
106
|
+
if (m != null && m.usage) {
|
|
107
|
+
const I = {
|
|
108
|
+
promptTokens: m.usage.prompt_tokens ?? 0,
|
|
109
|
+
completionTokens: m.usage.completion_tokens ?? 0,
|
|
110
|
+
totalTokens: m.usage.total_tokens ?? 0
|
|
111
111
|
};
|
|
112
|
-
(!p ||
|
|
112
|
+
(!p || I.totalTokens > 0) && (p = I);
|
|
113
113
|
}
|
|
114
114
|
if (Array.isArray(A) && A.length > 0) {
|
|
115
|
-
const
|
|
116
|
-
|
|
115
|
+
const I = (O = A[0]) == null ? void 0 : O.delta;
|
|
116
|
+
I != null && I.content && i.onDelta(I.content);
|
|
117
117
|
continue;
|
|
118
118
|
}
|
|
119
119
|
i.onDone(p);
|
|
@@ -123,12 +123,12 @@ async function et(a, n, r, i) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
i.onDone(p);
|
|
126
|
-
} catch (
|
|
126
|
+
} catch (C) {
|
|
127
127
|
if ((w = i.signal) != null && w.aborted) return;
|
|
128
|
-
throw i.onError(
|
|
128
|
+
throw i.onError(C instanceof Error ? C : new Error(String(C))), C;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
async function
|
|
131
|
+
async function ne(a, n) {
|
|
132
132
|
const r = await a.text();
|
|
133
133
|
if (!a.ok)
|
|
134
134
|
throw new Error(`${n}失败 HTTP ${a.status}${r ? `: ${r.slice(0, 120)}` : ""}`);
|
|
@@ -140,7 +140,7 @@ async function ae(a, n) {
|
|
|
140
140
|
throw new Error(`${n}返回非 JSON:${r.slice(0, 120)}`);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function nt(a) {
|
|
144
144
|
const n = a.status === 1;
|
|
145
145
|
return {
|
|
146
146
|
id: Number(a.id),
|
|
@@ -162,10 +162,10 @@ function tt(a) {
|
|
|
162
162
|
secret: a.secret_key
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
async function
|
|
166
|
-
const i = await fetch(`${
|
|
165
|
+
async function be(a, n, r) {
|
|
166
|
+
const i = await fetch(`${ee}/api/ak/create`, {
|
|
167
167
|
method: "POST",
|
|
168
|
-
headers:
|
|
168
|
+
headers: te({ Accept: "application/json", "Content-Type": "application/json" }),
|
|
169
169
|
credentials: "include",
|
|
170
170
|
body: JSON.stringify({
|
|
171
171
|
akName: r || `AK-${n || a}`,
|
|
@@ -174,113 +174,113 @@ async function Ie(a, n, r) {
|
|
|
174
174
|
ownerUserId: a,
|
|
175
175
|
ownerUserName: n
|
|
176
176
|
})
|
|
177
|
-
}),
|
|
178
|
-
return
|
|
177
|
+
}), u = await ne(i, "创建 AK"), f = (u == null ? void 0 : u.data) ?? {}, y = f.accessKey ?? "", _ = f.secretKey ?? "";
|
|
178
|
+
return y && _ && ye(y, _), { apiKey: _, akPrefix: y, message: "AK 已创建,secretKey 仅创建时可见" };
|
|
179
179
|
}
|
|
180
|
-
async function
|
|
180
|
+
async function ie(a) {
|
|
181
181
|
const n = await fetch(
|
|
182
|
-
`${
|
|
183
|
-
{ headers:
|
|
184
|
-
), r = await
|
|
185
|
-
return (a ? i.filter((
|
|
182
|
+
`${ee}/api/ak/list`,
|
|
183
|
+
{ headers: te({ Accept: "application/json" }), credentials: "include" }
|
|
184
|
+
), r = await ne(n, "获取 AK 列表"), i = Array.isArray(r == null ? void 0 : r.data) ? r.data : [];
|
|
185
|
+
return (a ? i.filter((f) => (f.owner_user_id == null || f.owner_user_id === "" ? Ie : String(f.owner_user_id)) === String(a)) : i).filter((f) => (f.is_deleted ?? 0) === 0).map(nt);
|
|
186
186
|
}
|
|
187
|
-
async function
|
|
188
|
-
const n = await fetch(`${
|
|
187
|
+
async function st(a) {
|
|
188
|
+
const n = await fetch(`${ee}/api/ak/delete?id=${encodeURIComponent(String(a))}`, {
|
|
189
189
|
method: "POST",
|
|
190
|
-
headers:
|
|
190
|
+
headers: te({ Accept: "application/json" }),
|
|
191
191
|
credentials: "include"
|
|
192
192
|
});
|
|
193
|
-
await
|
|
193
|
+
await ne(n, "吊销 AK");
|
|
194
194
|
}
|
|
195
|
-
async function
|
|
196
|
-
var
|
|
195
|
+
async function Pe(a) {
|
|
196
|
+
var C, v;
|
|
197
197
|
const n = await fetch(
|
|
198
|
-
`${
|
|
199
|
-
{ headers:
|
|
200
|
-
), r = await
|
|
201
|
-
let
|
|
198
|
+
`${ee}/api/admin/llm-call-monitor/stats?hours=168`,
|
|
199
|
+
{ headers: te({ Accept: "application/json" }), credentials: "include" }
|
|
200
|
+
), r = await ne(n, "获取调用统计"), u = ((r == null ? void 0 : r.data) ?? {}).summary ?? {};
|
|
201
|
+
let f = [];
|
|
202
202
|
try {
|
|
203
|
-
const
|
|
204
|
-
`${
|
|
205
|
-
{ headers:
|
|
206
|
-
), c = await
|
|
207
|
-
|
|
208
|
-
const
|
|
203
|
+
const g = await fetch(
|
|
204
|
+
`${ee}/api/admin/llm-call-monitor/recent?page=1&size=20`,
|
|
205
|
+
{ headers: te({ Accept: "application/json" }), credentials: "include" }
|
|
206
|
+
), c = await ne(g, "获取调用明细");
|
|
207
|
+
f = (Array.isArray((C = c == null ? void 0 : c.data) == null ? void 0 : C.records) ? c.data.records : []).map((m, A) => {
|
|
208
|
+
const I = Number(m.promptTokens ?? 0), G = Number(m.completionTokens ?? 0);
|
|
209
209
|
return {
|
|
210
|
-
id: Number(
|
|
210
|
+
id: Number(m.id ?? A),
|
|
211
211
|
apiKeyId: a,
|
|
212
212
|
protocol: "chat/completions",
|
|
213
|
-
model: String(
|
|
214
|
-
stream: Number(
|
|
215
|
-
promptTokens:
|
|
216
|
-
completionTokens:
|
|
217
|
-
totalTokens: Number(
|
|
218
|
-
latencyMs: Number(
|
|
219
|
-
statusCode:
|
|
220
|
-
errorMsg:
|
|
221
|
-
createTime: String(
|
|
213
|
+
model: String(m.model ?? ""),
|
|
214
|
+
stream: Number(m.stream ?? 0),
|
|
215
|
+
promptTokens: I,
|
|
216
|
+
completionTokens: G,
|
|
217
|
+
totalTokens: Number(m.totalTokens ?? I + G),
|
|
218
|
+
latencyMs: Number(m.durationMs ?? 0),
|
|
219
|
+
statusCode: m.success === !1 || m.success === 0 ? 500 : 200,
|
|
220
|
+
errorMsg: m.errorType ?? null,
|
|
221
|
+
createTime: String(m.createTime ?? "").replace("T", " ").slice(0, 19)
|
|
222
222
|
};
|
|
223
223
|
});
|
|
224
224
|
} catch {
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
for (const
|
|
228
|
-
const c =
|
|
229
|
-
c[0] += 1, c[1] +=
|
|
230
|
-
const k = (
|
|
226
|
+
const y = {}, _ = {};
|
|
227
|
+
for (const g of f) {
|
|
228
|
+
const c = y[v = g.model] || (y[v] = [0, 0, 0]);
|
|
229
|
+
c[0] += 1, c[1] += g.promptTokens, c[2] += g.completionTokens;
|
|
230
|
+
const k = (g.createTime || "").slice(0, 10);
|
|
231
231
|
if (k) {
|
|
232
|
-
const
|
|
233
|
-
|
|
232
|
+
const m = _[k] || (_[k] = [0, 0, 0]);
|
|
233
|
+
m[0] += 1, m[1] += g.promptTokens, m[2] += g.completionTokens;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
const p = Number(
|
|
236
|
+
const p = Number(u.totalTokens ?? 0), z = f.reduce((g, c) => g + c.totalTokens, 0), O = f.reduce((g, c) => g + c.promptTokens, 0), w = f.reduce((g, c) => g + c.completionTokens, 0);
|
|
237
237
|
return {
|
|
238
|
-
totalRequests: Number(
|
|
238
|
+
totalRequests: Number(u.totalCount ?? 0),
|
|
239
239
|
// 汇总口径优先用后端整窗合计(后端 selectStats 才有 token 合计),
|
|
240
240
|
// 明细只有最近一页 ⇒ 只在汇总缺失时用明细兜底。
|
|
241
|
-
totalPromptTokens: Number(
|
|
242
|
-
totalCompletionTokens: Number(
|
|
243
|
-
totalTokens: p ||
|
|
244
|
-
avgLatencyMs: Number(
|
|
245
|
-
errorCount: Number(
|
|
246
|
-
daily:
|
|
247
|
-
models:
|
|
248
|
-
recent:
|
|
241
|
+
totalPromptTokens: Number(u.totalPromptTokens ?? 0) || O,
|
|
242
|
+
totalCompletionTokens: Number(u.totalCompletionTokens ?? 0) || w,
|
|
243
|
+
totalTokens: p || z,
|
|
244
|
+
avgLatencyMs: Number(u.avgDurationMs ?? 0),
|
|
245
|
+
errorCount: Number(u.failCount ?? 0),
|
|
246
|
+
daily: _,
|
|
247
|
+
models: y,
|
|
248
|
+
recent: f
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
return typeof window < "u" ? `${window.location.origin}${
|
|
251
|
+
function ot() {
|
|
252
|
+
return typeof window < "u" ? `${window.location.origin}${ke}` : ke;
|
|
253
253
|
}
|
|
254
|
-
const
|
|
255
|
-
function
|
|
254
|
+
const _e = "ft_gateway_ak_cache";
|
|
255
|
+
function ye(a, n) {
|
|
256
256
|
try {
|
|
257
|
-
const r = JSON.parse(localStorage.getItem(
|
|
258
|
-
r[a] = n, localStorage.setItem(
|
|
257
|
+
const r = JSON.parse(localStorage.getItem(_e) || "{}");
|
|
258
|
+
r[a] = n, localStorage.setItem(_e, JSON.stringify(r));
|
|
259
259
|
} catch {
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function rt(a) {
|
|
263
263
|
try {
|
|
264
|
-
return JSON.parse(localStorage.getItem(
|
|
264
|
+
return JSON.parse(localStorage.getItem(_e) || "{}")[a] || null;
|
|
265
265
|
} catch {
|
|
266
266
|
return null;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function lt() {
|
|
270
270
|
try {
|
|
271
|
-
const i = localStorage.getItem(
|
|
271
|
+
const i = localStorage.getItem(le);
|
|
272
272
|
if (i) return i;
|
|
273
273
|
} catch {
|
|
274
274
|
}
|
|
275
|
-
const n = (await
|
|
275
|
+
const n = (await ie("").catch(() => [])).find((i) => i.active && i.secret);
|
|
276
276
|
if (n != null && n.secret) {
|
|
277
277
|
try {
|
|
278
|
-
localStorage.setItem(
|
|
278
|
+
localStorage.setItem(le, n.secret);
|
|
279
279
|
} catch {
|
|
280
280
|
}
|
|
281
|
-
return n.akPrefix &&
|
|
281
|
+
return n.akPrefix && ye(n.akPrefix, n.secret), n.secret;
|
|
282
282
|
}
|
|
283
|
-
const r = await
|
|
283
|
+
const r = await be(
|
|
284
284
|
"system-default",
|
|
285
285
|
"系统默认",
|
|
286
286
|
"智能工作台默认AK(自动创建)"
|
|
@@ -288,103 +288,103 @@ async function ot() {
|
|
|
288
288
|
if (!r.apiKey)
|
|
289
289
|
throw new Error("AK 创建成功但未返回 secretKey");
|
|
290
290
|
try {
|
|
291
|
-
localStorage.setItem(
|
|
291
|
+
localStorage.setItem(le, r.apiKey);
|
|
292
292
|
} catch {
|
|
293
293
|
}
|
|
294
294
|
return r.apiKey;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Ke() {
|
|
297
297
|
try {
|
|
298
|
-
localStorage.removeItem(
|
|
298
|
+
localStorage.removeItem(le);
|
|
299
299
|
} catch {
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
container:
|
|
304
|
-
sidebar:
|
|
305
|
-
menuList:
|
|
306
|
-
menuItem:
|
|
307
|
-
menuItemActive:
|
|
308
|
-
menuIcon:
|
|
309
|
-
panelArea:
|
|
310
|
-
modelMgmtHeader:
|
|
311
|
-
modelMgmtTitle:
|
|
312
|
-
modelMgmtSubtitle:
|
|
313
|
-
modelGrid:
|
|
314
|
-
modelCard:
|
|
315
|
-
modelCardSelected:
|
|
316
|
-
modelCardHeader:
|
|
317
|
-
modelIconWrap:
|
|
318
|
-
modelCardInfo:
|
|
319
|
-
modelName:
|
|
320
|
-
modelTags:
|
|
321
|
-
modelEndpoint:
|
|
322
|
-
modelCardFooter:
|
|
323
|
-
modelCheckbox:
|
|
324
|
-
modelActionBar:
|
|
325
|
-
modelSelectionCount:
|
|
326
|
-
chatContainer:
|
|
327
|
-
chatHeader:
|
|
328
|
-
chatTitle:
|
|
329
|
-
chatPanels:
|
|
330
|
-
chatPanel:
|
|
331
|
-
chatPanelHeader:
|
|
332
|
-
chatPanelClose:
|
|
333
|
-
chatPanelBody:
|
|
334
|
-
chatMsgUser:
|
|
335
|
-
chatMsgAI:
|
|
336
|
-
chatMsgError:
|
|
337
|
-
chatStreamingCursor:
|
|
338
|
-
chatUsageBar:
|
|
339
|
-
chatThinkBlock:
|
|
340
|
-
chatInputBar:
|
|
341
|
-
chatInput:
|
|
342
|
-
addPanelBtn:
|
|
343
|
-
akContainer:
|
|
344
|
-
akIntegrationPanel:
|
|
345
|
-
akIntegrationTitle:
|
|
346
|
-
akIntegrationGrid:
|
|
347
|
-
akCodeBlock:
|
|
348
|
-
akCodeLabel:
|
|
349
|
-
akCard:
|
|
350
|
-
akCardRow:
|
|
351
|
-
akTitle:
|
|
352
|
-
akPrefixSmall:
|
|
353
|
-
akStatus:
|
|
354
|
-
akStatusActive:
|
|
355
|
-
akStatusRevoked:
|
|
356
|
-
akCardActions:
|
|
357
|
-
akCardRow2:
|
|
358
|
-
akMiniBar:
|
|
359
|
-
akMiniBarFill:
|
|
360
|
-
akUsageText:
|
|
361
|
-
akMetaText:
|
|
362
|
-
akEmpty:
|
|
363
|
-
akBaseUrlRow:
|
|
364
|
-
akBaseUrlItem:
|
|
365
|
-
akBaseUrlLabel:
|
|
366
|
-
akBaseUrlValue:
|
|
367
|
-
akCopyIcon:
|
|
368
|
-
usageDrawerContent:
|
|
369
|
-
usageStatsGrid:
|
|
370
|
-
usageSection:
|
|
371
|
-
usageSectionTitle:
|
|
372
|
-
usageBarChart:
|
|
373
|
-
usageBarCol:
|
|
374
|
-
usageBar:
|
|
375
|
-
usageBarLabel:
|
|
376
|
-
modelBreakdown:
|
|
377
|
-
modelBreakdownRow:
|
|
378
|
-
modelBreakdownName:
|
|
379
|
-
modelBreakdownBar:
|
|
380
|
-
modelBreakdownFill:
|
|
381
|
-
modelBreakdownCount:
|
|
382
|
-
usageEmpty:
|
|
302
|
+
const it = "_container_16zxg_7", ct = "_sidebar_16zxg_16", dt = "_menuList_16zxg_26", mt = "_menuItem_16zxg_35", ut = "_menuItemActive_16zxg_53", ht = "_menuIcon_16zxg_59", gt = "_panelArea_16zxg_66", pt = "_modelMgmtHeader_16zxg_78", kt = "_modelMgmtTitle_16zxg_82", _t = "_modelMgmtSubtitle_16zxg_89", ft = "_modelGrid_16zxg_95", yt = "_modelCard_16zxg_101", Ct = "_modelCardSelected_16zxg_130", Nt = "_modelCardHeader_16zxg_135", xt = "_modelIconWrap_16zxg_142", vt = "_modelCardInfo_16zxg_155", Tt = "_modelName_16zxg_160", St = "_modelTags_16zxg_169", wt = "_modelEndpoint_16zxg_185", At = "_modelCardFooter_16zxg_194", Bt = "_modelCheckbox_16zxg_202", zt = "_modelActionBar_16zxg_209", Mt = "_modelSelectionCount_16zxg_223", It = "_chatContainer_16zxg_232", bt = "_chatHeader_16zxg_239", Pt = "_chatTitle_16zxg_247", Kt = "_chatPanels_16zxg_254", Et = "_chatPanel_16zxg_254", $t = "_chatPanelHeader_16zxg_281", Lt = "_chatPanelClose_16zxg_291", Ot = "_chatPanelBody_16zxg_303", Ut = "_chatMsgUser_16zxg_312", Rt = "_chatMsgAI_16zxg_324", Dt = "_chatMsgError_16zxg_337", Ht = "_chatStreamingCursor_16zxg_347", Ft = "_chatUsageBar_16zxg_366", jt = "_chatThinkBlock_16zxg_376", qt = "_chatInputBar_16zxg_425", Gt = "_chatInput_16zxg_425", Jt = "_addPanelBtn_16zxg_438", Wt = "_akContainer_16zxg_467", Qt = "_akIntegrationPanel_16zxg_473", Vt = "_akIntegrationTitle_16zxg_480", Yt = "_akIntegrationGrid_16zxg_487", Xt = "_akCodeBlock_16zxg_493", Zt = "_akCodeLabel_16zxg_505", ea = "_akCard_16zxg_512", ta = "_akCardRow_16zxg_530", aa = "_akTitle_16zxg_537", na = "_akPrefixSmall_16zxg_547", sa = "_akStatus_16zxg_553", oa = "_akStatusActive_16zxg_559", ra = "_akStatusRevoked_16zxg_565", la = "_akCardActions_16zxg_571", ia = "_akCardRow2_16zxg_578", ca = "_akMiniBar_16zxg_584", da = "_akMiniBarFill_16zxg_593", ma = "_akUsageText_16zxg_600", ua = "_akMetaText_16zxg_607", ha = "_akEmpty_16zxg_613", ga = "_akBaseUrlRow_16zxg_621", pa = "_akBaseUrlItem_16zxg_627", ka = "_akBaseUrlLabel_16zxg_637", _a = "_akBaseUrlValue_16zxg_643", fa = "_akCopyIcon_16zxg_653", ya = "_usageDrawerContent_16zxg_667", Ca = "_usageStatsGrid_16zxg_673", Na = "_usageSection_16zxg_679", xa = "_usageSectionTitle_16zxg_683", va = "_usageBarChart_16zxg_693", Ta = "_usageBarCol_16zxg_702", Sa = "_usageBar_16zxg_693", wa = "_usageBarLabel_16zxg_725", Aa = "_modelBreakdown_16zxg_733", Ba = "_modelBreakdownRow_16zxg_739", za = "_modelBreakdownName_16zxg_745", Ma = "_modelBreakdownBar_16zxg_755", Ia = "_modelBreakdownFill_16zxg_763", ba = "_modelBreakdownCount_16zxg_770", Pa = "_usageEmpty_16zxg_777", t = {
|
|
303
|
+
container: it,
|
|
304
|
+
sidebar: ct,
|
|
305
|
+
menuList: dt,
|
|
306
|
+
menuItem: mt,
|
|
307
|
+
menuItemActive: ut,
|
|
308
|
+
menuIcon: ht,
|
|
309
|
+
panelArea: gt,
|
|
310
|
+
modelMgmtHeader: pt,
|
|
311
|
+
modelMgmtTitle: kt,
|
|
312
|
+
modelMgmtSubtitle: _t,
|
|
313
|
+
modelGrid: ft,
|
|
314
|
+
modelCard: yt,
|
|
315
|
+
modelCardSelected: Ct,
|
|
316
|
+
modelCardHeader: Nt,
|
|
317
|
+
modelIconWrap: xt,
|
|
318
|
+
modelCardInfo: vt,
|
|
319
|
+
modelName: Tt,
|
|
320
|
+
modelTags: St,
|
|
321
|
+
modelEndpoint: wt,
|
|
322
|
+
modelCardFooter: At,
|
|
323
|
+
modelCheckbox: Bt,
|
|
324
|
+
modelActionBar: zt,
|
|
325
|
+
modelSelectionCount: Mt,
|
|
326
|
+
chatContainer: It,
|
|
327
|
+
chatHeader: bt,
|
|
328
|
+
chatTitle: Pt,
|
|
329
|
+
chatPanels: Kt,
|
|
330
|
+
chatPanel: Et,
|
|
331
|
+
chatPanelHeader: $t,
|
|
332
|
+
chatPanelClose: Lt,
|
|
333
|
+
chatPanelBody: Ot,
|
|
334
|
+
chatMsgUser: Ut,
|
|
335
|
+
chatMsgAI: Rt,
|
|
336
|
+
chatMsgError: Dt,
|
|
337
|
+
chatStreamingCursor: Ht,
|
|
338
|
+
chatUsageBar: Ft,
|
|
339
|
+
chatThinkBlock: jt,
|
|
340
|
+
chatInputBar: qt,
|
|
341
|
+
chatInput: Gt,
|
|
342
|
+
addPanelBtn: Jt,
|
|
343
|
+
akContainer: Wt,
|
|
344
|
+
akIntegrationPanel: Qt,
|
|
345
|
+
akIntegrationTitle: Vt,
|
|
346
|
+
akIntegrationGrid: Yt,
|
|
347
|
+
akCodeBlock: Xt,
|
|
348
|
+
akCodeLabel: Zt,
|
|
349
|
+
akCard: ea,
|
|
350
|
+
akCardRow: ta,
|
|
351
|
+
akTitle: aa,
|
|
352
|
+
akPrefixSmall: na,
|
|
353
|
+
akStatus: sa,
|
|
354
|
+
akStatusActive: oa,
|
|
355
|
+
akStatusRevoked: ra,
|
|
356
|
+
akCardActions: la,
|
|
357
|
+
akCardRow2: ia,
|
|
358
|
+
akMiniBar: ca,
|
|
359
|
+
akMiniBarFill: da,
|
|
360
|
+
akUsageText: ma,
|
|
361
|
+
akMetaText: ua,
|
|
362
|
+
akEmpty: ha,
|
|
363
|
+
akBaseUrlRow: ga,
|
|
364
|
+
akBaseUrlItem: pa,
|
|
365
|
+
akBaseUrlLabel: ka,
|
|
366
|
+
akBaseUrlValue: _a,
|
|
367
|
+
akCopyIcon: fa,
|
|
368
|
+
usageDrawerContent: ya,
|
|
369
|
+
usageStatsGrid: Ca,
|
|
370
|
+
usageSection: Na,
|
|
371
|
+
usageSectionTitle: xa,
|
|
372
|
+
usageBarChart: va,
|
|
373
|
+
usageBarCol: Ta,
|
|
374
|
+
usageBar: Sa,
|
|
375
|
+
usageBarLabel: wa,
|
|
376
|
+
modelBreakdown: Aa,
|
|
377
|
+
modelBreakdownRow: Ba,
|
|
378
|
+
modelBreakdownName: za,
|
|
379
|
+
modelBreakdownBar: Ma,
|
|
380
|
+
modelBreakdownFill: Ia,
|
|
381
|
+
modelBreakdownCount: ba,
|
|
382
|
+
usageEmpty: Pa
|
|
383
383
|
};
|
|
384
|
-
function
|
|
384
|
+
function Ne(a) {
|
|
385
385
|
return a >= 1e6 ? `${(a / 1e6).toFixed(1)}M` : a >= 1e3 ? `${(a / 1e3).toFixed(1)}K` : `${a}`;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function Ka(a, n) {
|
|
388
388
|
return `# OpenAI 兼容
|
|
389
389
|
curl -X POST ${a}/v1/chat/completions \\
|
|
390
390
|
-H "Content-Type: application/json" \\
|
|
@@ -395,7 +395,7 @@ curl -X POST ${a}/v1/chat/completions \\
|
|
|
395
395
|
"stream": true
|
|
396
396
|
}'`;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Ea(a, n) {
|
|
399
399
|
return `# Anthropic 兼容
|
|
400
400
|
curl -X POST ${a}/v1/messages \\
|
|
401
401
|
-H "Content-Type: application/json" \\
|
|
@@ -405,57 +405,57 @@ curl -X POST ${a}/v1/messages \\
|
|
|
405
405
|
"messages": [{"role":"user","content":"你好"}]
|
|
406
406
|
}'`;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
const [a, n] =
|
|
410
|
-
|
|
411
|
-
let
|
|
412
|
-
return
|
|
413
|
-
!
|
|
408
|
+
function $a() {
|
|
409
|
+
const [a, n] = N("personal"), [r, i] = N([]), [u, f] = N([]), [y, _] = N(!0), [p, z] = N(!1), [O, w] = N(!1), [C, v] = N(""), [g, c] = N({ open: !1 }), [k, m] = N(null), [A, I] = N(null), [G, Q] = N(!1), H = Me((d) => d.currentUser), l = String((H == null ? void 0 : H.id) ?? ""), b = (H == null ? void 0 : H.username) ?? "", [U, o] = N(""), h = ot(), [S, P] = N("<model-name>");
|
|
410
|
+
Z(() => {
|
|
411
|
+
let d = !1;
|
|
412
|
+
return fe().then((T) => {
|
|
413
|
+
!d && T.length > 0 && P(T[0].modelName);
|
|
414
414
|
}).catch(() => {
|
|
415
415
|
}), () => {
|
|
416
|
-
|
|
416
|
+
d = !0;
|
|
417
417
|
};
|
|
418
418
|
}, []);
|
|
419
|
-
const
|
|
420
|
-
|
|
419
|
+
const B = j(async () => {
|
|
420
|
+
_(!0);
|
|
421
421
|
try {
|
|
422
|
-
const
|
|
423
|
-
|
|
422
|
+
const d = l ? await ie(l).catch(() => []) : [], [T] = await Promise.all([
|
|
423
|
+
ie("system-default").catch(() => [])
|
|
424
424
|
]);
|
|
425
|
-
i(
|
|
425
|
+
i(T), f(d);
|
|
426
426
|
} finally {
|
|
427
|
-
|
|
427
|
+
_(!1);
|
|
428
428
|
}
|
|
429
429
|
}, [l]);
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}, [
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
},
|
|
436
|
-
if (!
|
|
437
|
-
|
|
430
|
+
Z(() => {
|
|
431
|
+
B();
|
|
432
|
+
}, [B]);
|
|
433
|
+
const M = () => {
|
|
434
|
+
v(""), w(!0);
|
|
435
|
+
}, q = async () => {
|
|
436
|
+
if (!C.trim()) {
|
|
437
|
+
J.warning("请输入 AK 名称");
|
|
438
438
|
return;
|
|
439
439
|
}
|
|
440
440
|
if (!l) {
|
|
441
|
-
|
|
441
|
+
J.warning("登录态不可用,无法生成 AK");
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
|
-
|
|
444
|
+
z(!0);
|
|
445
445
|
try {
|
|
446
|
-
const
|
|
447
|
-
|
|
446
|
+
const d = await be(l, b, C.trim());
|
|
447
|
+
ye(d.akPrefix, d.apiKey), w(!1), c({
|
|
448
448
|
open: !0,
|
|
449
|
-
apiKey:
|
|
450
|
-
akPrefix:
|
|
451
|
-
}),
|
|
452
|
-
} catch (
|
|
453
|
-
|
|
449
|
+
apiKey: d.apiKey,
|
|
450
|
+
akPrefix: d.akPrefix
|
|
451
|
+
}), B();
|
|
452
|
+
} catch (d) {
|
|
453
|
+
J.error(d instanceof Error ? d.message : "创建 AK 失败");
|
|
454
454
|
} finally {
|
|
455
|
-
|
|
455
|
+
z(!1);
|
|
456
456
|
}
|
|
457
|
-
},
|
|
458
|
-
|
|
457
|
+
}, ce = (d) => {
|
|
458
|
+
ue.confirm({
|
|
459
459
|
title: "确认吊销此 AK?",
|
|
460
460
|
content: "吊销后此 AK 将立即失效,无法恢复。",
|
|
461
461
|
okText: "确认吊销",
|
|
@@ -463,75 +463,75 @@ function Ka() {
|
|
|
463
463
|
cancelText: "取消",
|
|
464
464
|
onOk: async () => {
|
|
465
465
|
try {
|
|
466
|
-
await
|
|
467
|
-
} catch (
|
|
468
|
-
|
|
466
|
+
await st(d), J.success("AK 已吊销"), B(), Ke();
|
|
467
|
+
} catch (T) {
|
|
468
|
+
J.error(T instanceof Error ? T.message : "吊销失败");
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
});
|
|
472
|
-
},
|
|
473
|
-
navigator.clipboard.writeText(
|
|
474
|
-
},
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
},
|
|
478
|
-
d
|
|
472
|
+
}, E = (d) => {
|
|
473
|
+
navigator.clipboard.writeText(d).then(() => J.success("已复制到剪贴板")).catch(() => J.warning("复制失败,请手动复制"));
|
|
474
|
+
}, F = (d) => {
|
|
475
|
+
const T = rt(d.akPrefix);
|
|
476
|
+
T ? E(T) : (E(d.akPrefix), J.info("完整 AK 未在本地缓存(可能在本设备外创建),已复制前缀"));
|
|
477
|
+
}, se = async (d) => {
|
|
478
|
+
m(d), Q(!0), I(null);
|
|
479
479
|
try {
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
} catch (
|
|
483
|
-
|
|
480
|
+
const T = await Pe(d.id);
|
|
481
|
+
I(T);
|
|
482
|
+
} catch (T) {
|
|
483
|
+
J.error(T instanceof Error ? T.message : "获取用量失败");
|
|
484
484
|
} finally {
|
|
485
|
-
|
|
485
|
+
Q(!1);
|
|
486
486
|
}
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
487
|
+
}, de = () => {
|
|
488
|
+
m(null), I(null);
|
|
489
|
+
}, Ee = (d) => {
|
|
490
|
+
const T = Object.entries(d);
|
|
491
|
+
if (T.length === 0)
|
|
492
492
|
return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
493
|
-
const V = Math.max(...
|
|
494
|
-
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children:
|
|
495
|
-
const
|
|
493
|
+
const V = Math.max(...T.map(([, $]) => $[1] + $[2]), 1);
|
|
494
|
+
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: T.map(([$, R]) => {
|
|
495
|
+
const x = R[1] + R[2], me = x / V * 100;
|
|
496
496
|
return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
|
|
497
|
-
/* @__PURE__ */ e(
|
|
497
|
+
/* @__PURE__ */ e(Y, { title: `${$}: ${R[0]}次 / ${x} tokens`, children: /* @__PURE__ */ e(
|
|
498
498
|
"div",
|
|
499
499
|
{
|
|
500
500
|
className: t.usageBar,
|
|
501
|
-
style: { height: `${Math.max(
|
|
501
|
+
style: { height: `${Math.max(me, 2)}%` }
|
|
502
502
|
}
|
|
503
503
|
) }),
|
|
504
|
-
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children:
|
|
505
|
-
] },
|
|
504
|
+
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children: $ })
|
|
505
|
+
] }, $);
|
|
506
506
|
}) });
|
|
507
|
-
},
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
507
|
+
}, $e = (d) => {
|
|
508
|
+
const T = Object.entries(d);
|
|
509
|
+
if (T.length === 0)
|
|
510
510
|
return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
511
|
-
const V = Math.max(...
|
|
512
|
-
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children:
|
|
513
|
-
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children:
|
|
511
|
+
const V = Math.max(...T.map(([, $]) => $[0]), 1);
|
|
512
|
+
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: T.sort(($, R) => R[1][0] - $[1][0]).map(([$, R]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
|
|
513
|
+
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: $ }),
|
|
514
514
|
/* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
|
|
515
515
|
"div",
|
|
516
516
|
{
|
|
517
517
|
className: t.modelBreakdownFill,
|
|
518
|
-
style: { width: `${
|
|
518
|
+
style: { width: `${R[0] / V * 100}%` }
|
|
519
519
|
}
|
|
520
520
|
) }),
|
|
521
521
|
/* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
|
|
522
|
-
|
|
522
|
+
R[0],
|
|
523
523
|
"次 / ",
|
|
524
|
-
|
|
524
|
+
R[1] + (R[2] || 0),
|
|
525
525
|
"tokens"
|
|
526
526
|
] })
|
|
527
|
-
] },
|
|
528
|
-
},
|
|
527
|
+
] }, $)) });
|
|
528
|
+
}, Le = [
|
|
529
529
|
{
|
|
530
530
|
title: "时间",
|
|
531
531
|
dataIndex: "createTime",
|
|
532
532
|
key: "createTime",
|
|
533
533
|
width: 160,
|
|
534
|
-
render: (
|
|
534
|
+
render: (d) => d ? new Date(d).toLocaleString("zh-CN") : "-"
|
|
535
535
|
},
|
|
536
536
|
{ title: "模型", dataIndex: "model", key: "model", width: 140 },
|
|
537
537
|
{
|
|
@@ -539,7 +539,7 @@ function Ka() {
|
|
|
539
539
|
dataIndex: "protocol",
|
|
540
540
|
key: "protocol",
|
|
541
541
|
width: 90,
|
|
542
|
-
render: (
|
|
542
|
+
render: (d) => /* @__PURE__ */ e(W, { children: d })
|
|
543
543
|
},
|
|
544
544
|
{
|
|
545
545
|
title: "输入",
|
|
@@ -564,59 +564,61 @@ function Ka() {
|
|
|
564
564
|
dataIndex: "latencyMs",
|
|
565
565
|
key: "latencyMs",
|
|
566
566
|
width: 70,
|
|
567
|
-
render: (
|
|
567
|
+
render: (d) => d ? `${d}ms` : "-"
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
570
|
title: "状态",
|
|
571
571
|
dataIndex: "statusCode",
|
|
572
572
|
key: "statusCode",
|
|
573
573
|
width: 60,
|
|
574
|
-
render: (
|
|
574
|
+
render: (d) => d ? /* @__PURE__ */ e(W, { color: d < 400 ? "green" : "red", children: d }) : "-"
|
|
575
575
|
}
|
|
576
|
-
],
|
|
577
|
-
const V = Array.isArray(
|
|
578
|
-
|
|
576
|
+
], Ce = (d, T) => {
|
|
577
|
+
const V = Array.isArray(d) ? d : [], $ = U.trim().toLowerCase(), R = $ ? V.filter(
|
|
578
|
+
(x) => `${x.description || ""} ${x.akPrefix || ""} ${x.defaultModel || ""}`.toLowerCase().includes($)
|
|
579
|
+
) : V;
|
|
580
|
+
return y ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ e(X, { tip: "加载中..." }) }) : V.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: T ? "暂无应用 AK" : "暂无个人 AK,点击上方按钮生成" }) : R.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "无匹配 AK" }) : /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: R.map((x) => /* @__PURE__ */ s(
|
|
579
581
|
"div",
|
|
580
582
|
{
|
|
581
583
|
className: t.akCard,
|
|
582
|
-
onClick: () =>
|
|
584
|
+
onClick: () => se(x),
|
|
583
585
|
children: [
|
|
584
586
|
/* @__PURE__ */ s("div", { className: t.akCardRow, children: [
|
|
585
|
-
/* @__PURE__ */ e("span", { className: t.akTitle, children:
|
|
586
|
-
/* @__PURE__ */ e("code", { className: t.akPrefixSmall, children:
|
|
587
|
+
/* @__PURE__ */ e("span", { className: t.akTitle, children: x.description || x.akPrefix.replace("...", "**") }),
|
|
588
|
+
/* @__PURE__ */ e("code", { className: t.akPrefixSmall, children: x.akPrefix.replace("...", "**") }),
|
|
587
589
|
/* @__PURE__ */ e(
|
|
588
590
|
"span",
|
|
589
591
|
{
|
|
590
|
-
className: `${t.akStatus} ${
|
|
591
|
-
children:
|
|
592
|
+
className: `${t.akStatus} ${x.active ? t.akStatusActive : t.akStatusRevoked}`,
|
|
593
|
+
children: x.active ? "活跃" : "已吊销"
|
|
592
594
|
}
|
|
593
595
|
),
|
|
594
|
-
|
|
596
|
+
x.defaultModel && /* @__PURE__ */ s(W, { style: { fontSize: 11 }, children: [
|
|
595
597
|
"默认: ",
|
|
596
|
-
|
|
598
|
+
x.defaultModel
|
|
597
599
|
] }),
|
|
598
600
|
/* @__PURE__ */ s(
|
|
599
601
|
"div",
|
|
600
602
|
{
|
|
601
603
|
className: t.akCardActions,
|
|
602
|
-
onClick: (
|
|
604
|
+
onClick: (me) => me.stopPropagation(),
|
|
603
605
|
children: [
|
|
604
|
-
/* @__PURE__ */ e(
|
|
605
|
-
|
|
606
|
+
/* @__PURE__ */ e(Y, { title: "复制完整 AK", children: /* @__PURE__ */ e(
|
|
607
|
+
D,
|
|
606
608
|
{
|
|
607
609
|
size: "small",
|
|
608
|
-
icon: /* @__PURE__ */ e(
|
|
609
|
-
onClick: () =>
|
|
610
|
+
icon: /* @__PURE__ */ e(oe, {}),
|
|
611
|
+
onClick: () => F(x),
|
|
610
612
|
children: "复制"
|
|
611
613
|
}
|
|
612
614
|
) }),
|
|
613
|
-
!
|
|
614
|
-
|
|
615
|
+
!T && x.active && /* @__PURE__ */ e(
|
|
616
|
+
D,
|
|
615
617
|
{
|
|
616
618
|
size: "small",
|
|
617
619
|
danger: !0,
|
|
618
|
-
icon: /* @__PURE__ */ e(
|
|
619
|
-
onClick: () =>
|
|
620
|
+
icon: /* @__PURE__ */ e(Oe, {}),
|
|
621
|
+
onClick: () => ce(x.id),
|
|
620
622
|
children: "吊销"
|
|
621
623
|
}
|
|
622
624
|
)
|
|
@@ -625,28 +627,28 @@ function Ka() {
|
|
|
625
627
|
)
|
|
626
628
|
] }),
|
|
627
629
|
/* @__PURE__ */ s("div", { className: t.akCardRow2, children: [
|
|
628
|
-
|
|
630
|
+
x.tokenQuota > 0 && /* @__PURE__ */ e("div", { className: t.akMiniBar, children: /* @__PURE__ */ e(
|
|
629
631
|
"div",
|
|
630
632
|
{
|
|
631
633
|
className: t.akMiniBarFill,
|
|
632
634
|
style: {
|
|
633
635
|
width: `${Math.min(
|
|
634
|
-
(
|
|
636
|
+
(x.totalTokens || 0) / x.tokenQuota * 100,
|
|
635
637
|
100
|
|
636
638
|
)}%`
|
|
637
639
|
}
|
|
638
640
|
}
|
|
639
641
|
) }),
|
|
640
642
|
/* @__PURE__ */ s("span", { className: t.akUsageText, children: [
|
|
641
|
-
|
|
642
|
-
|
|
643
|
+
Ne(x.totalTokens || 0),
|
|
644
|
+
x.tokenQuota > 0 ? ` / ${Ne(x.tokenQuota)}` : " tokens"
|
|
643
645
|
] }),
|
|
644
|
-
/* @__PURE__ */ e("span", { className: t.akMetaText, children:
|
|
645
|
-
/* @__PURE__ */ e("span", { className: t.akMetaText, children: new Date(
|
|
646
|
+
/* @__PURE__ */ e("span", { className: t.akMetaText, children: x.lastUsedAt ? `最近使用 ${x.lastUsedAt}` : "尚未使用" }),
|
|
647
|
+
/* @__PURE__ */ e("span", { className: t.akMetaText, children: new Date(x.createTime).toLocaleDateString("zh-CN") })
|
|
646
648
|
] })
|
|
647
649
|
]
|
|
648
650
|
},
|
|
649
|
-
|
|
651
|
+
x.id
|
|
650
652
|
)) });
|
|
651
653
|
};
|
|
652
654
|
return /* @__PURE__ */ s("div", { className: t.akContainer, children: [
|
|
@@ -655,23 +657,23 @@ function Ka() {
|
|
|
655
657
|
/* @__PURE__ */ s("div", { className: t.akBaseUrlRow, children: [
|
|
656
658
|
/* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
|
|
657
659
|
/* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "OpenAI 兼容" }),
|
|
658
|
-
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children:
|
|
659
|
-
/* @__PURE__ */ e(
|
|
660
|
-
|
|
660
|
+
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: h }),
|
|
661
|
+
/* @__PURE__ */ e(Y, { title: "复制 Base URL", children: /* @__PURE__ */ e(
|
|
662
|
+
oe,
|
|
661
663
|
{
|
|
662
664
|
className: t.akCopyIcon,
|
|
663
|
-
onClick: () =>
|
|
665
|
+
onClick: () => E(h)
|
|
664
666
|
}
|
|
665
667
|
) })
|
|
666
668
|
] }),
|
|
667
669
|
/* @__PURE__ */ s("div", { className: t.akBaseUrlItem, children: [
|
|
668
670
|
/* @__PURE__ */ e("span", { className: t.akBaseUrlLabel, children: "Anthropic 兼容" }),
|
|
669
|
-
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children:
|
|
670
|
-
/* @__PURE__ */ e(
|
|
671
|
-
|
|
671
|
+
/* @__PURE__ */ e("code", { className: t.akBaseUrlValue, children: h }),
|
|
672
|
+
/* @__PURE__ */ e(Y, { title: "复制 Base URL", children: /* @__PURE__ */ e(
|
|
673
|
+
oe,
|
|
672
674
|
{
|
|
673
675
|
className: t.akCopyIcon,
|
|
674
|
-
onClick: () =>
|
|
676
|
+
onClick: () => E(h)
|
|
675
677
|
}
|
|
676
678
|
) })
|
|
677
679
|
] })
|
|
@@ -679,11 +681,11 @@ function Ka() {
|
|
|
679
681
|
/* @__PURE__ */ s("div", { className: t.akIntegrationGrid, children: [
|
|
680
682
|
/* @__PURE__ */ s("div", { children: [
|
|
681
683
|
/* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "OpenAI 兼容 — curl 示例" }),
|
|
682
|
-
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children:
|
|
684
|
+
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: Ka(h, S) })
|
|
683
685
|
] }),
|
|
684
686
|
/* @__PURE__ */ s("div", { children: [
|
|
685
687
|
/* @__PURE__ */ e("p", { className: t.akCodeLabel, children: "Anthropic 兼容 — curl 示例" }),
|
|
686
|
-
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children:
|
|
688
|
+
/* @__PURE__ */ e("pre", { className: t.akCodeBlock, children: Ea(h, S) })
|
|
687
689
|
] })
|
|
688
690
|
] })
|
|
689
691
|
] }),
|
|
@@ -699,10 +701,10 @@ function Ka() {
|
|
|
699
701
|
},
|
|
700
702
|
children: [
|
|
701
703
|
/* @__PURE__ */ e(
|
|
702
|
-
|
|
704
|
+
we,
|
|
703
705
|
{
|
|
704
706
|
activeKey: a,
|
|
705
|
-
onChange: (
|
|
707
|
+
onChange: (d) => n(d),
|
|
706
708
|
items: [
|
|
707
709
|
{ key: "app", label: "应用 AK" },
|
|
708
710
|
{ key: "personal", label: "个人 AK" }
|
|
@@ -711,13 +713,22 @@ function Ka() {
|
|
|
711
713
|
}
|
|
712
714
|
),
|
|
713
715
|
/* @__PURE__ */ s("div", { style: { display: "flex", gap: 8 }, children: [
|
|
714
|
-
/* @__PURE__ */ e(
|
|
716
|
+
/* @__PURE__ */ e(
|
|
717
|
+
pe.Search,
|
|
718
|
+
{
|
|
719
|
+
allowClear: !0,
|
|
720
|
+
placeholder: "按名称 / 前缀过滤",
|
|
721
|
+
style: { width: 200 },
|
|
722
|
+
onChange: (d) => o(d.target.value)
|
|
723
|
+
}
|
|
724
|
+
),
|
|
725
|
+
/* @__PURE__ */ e(D, { icon: /* @__PURE__ */ e(ve, {}), onClick: B, size: "small", children: "刷新" }),
|
|
715
726
|
a === "personal" && /* @__PURE__ */ e(
|
|
716
|
-
|
|
727
|
+
D,
|
|
717
728
|
{
|
|
718
729
|
type: "primary",
|
|
719
|
-
icon: /* @__PURE__ */ e(
|
|
720
|
-
onClick:
|
|
730
|
+
icon: /* @__PURE__ */ e(Te, {}),
|
|
731
|
+
onClick: M,
|
|
721
732
|
loading: p,
|
|
722
733
|
children: "生成 AK"
|
|
723
734
|
}
|
|
@@ -726,15 +737,15 @@ function Ka() {
|
|
|
726
737
|
]
|
|
727
738
|
}
|
|
728
739
|
),
|
|
729
|
-
a === "app" ?
|
|
740
|
+
a === "app" ? Ce(r, !0) : Ce(u, !1)
|
|
730
741
|
] }),
|
|
731
742
|
/* @__PURE__ */ s(
|
|
732
|
-
|
|
743
|
+
ue,
|
|
733
744
|
{
|
|
734
|
-
open:
|
|
745
|
+
open: O,
|
|
735
746
|
title: "生成新 AK",
|
|
736
747
|
onCancel: () => w(!1),
|
|
737
|
-
onOk:
|
|
748
|
+
onOk: q,
|
|
738
749
|
okText: "确认生成",
|
|
739
750
|
cancelText: "取消",
|
|
740
751
|
confirmLoading: p,
|
|
@@ -751,12 +762,12 @@ function Ka() {
|
|
|
751
762
|
}
|
|
752
763
|
),
|
|
753
764
|
/* @__PURE__ */ e(
|
|
754
|
-
|
|
765
|
+
pe,
|
|
755
766
|
{
|
|
756
767
|
placeholder: "例如:测试用 AK、生产网关 AK",
|
|
757
|
-
value:
|
|
758
|
-
onChange: (
|
|
759
|
-
onPressEnter:
|
|
768
|
+
value: C,
|
|
769
|
+
onChange: (d) => v(d.target.value),
|
|
770
|
+
onPressEnter: q,
|
|
760
771
|
maxLength: 50,
|
|
761
772
|
autoFocus: !0
|
|
762
773
|
}
|
|
@@ -765,23 +776,23 @@ function Ka() {
|
|
|
765
776
|
}
|
|
766
777
|
),
|
|
767
778
|
/* @__PURE__ */ s(
|
|
768
|
-
|
|
779
|
+
ue,
|
|
769
780
|
{
|
|
770
|
-
open:
|
|
781
|
+
open: g.open,
|
|
771
782
|
title: "AK 创建成功",
|
|
772
783
|
onCancel: () => c({ open: !1 }),
|
|
773
784
|
footer: [
|
|
774
785
|
/* @__PURE__ */ e(
|
|
775
|
-
|
|
786
|
+
D,
|
|
776
787
|
{
|
|
777
|
-
icon: /* @__PURE__ */ e(
|
|
778
|
-
onClick: () =>
|
|
788
|
+
icon: /* @__PURE__ */ e(oe, {}),
|
|
789
|
+
onClick: () => g.apiKey && E(g.apiKey),
|
|
779
790
|
children: "复制 AK"
|
|
780
791
|
},
|
|
781
792
|
"copy"
|
|
782
793
|
),
|
|
783
794
|
/* @__PURE__ */ e(
|
|
784
|
-
|
|
795
|
+
D,
|
|
785
796
|
{
|
|
786
797
|
type: "primary",
|
|
787
798
|
onClick: () => c({ open: !1 }),
|
|
@@ -804,47 +815,47 @@ function Ka() {
|
|
|
804
815
|
wordBreak: "break-all",
|
|
805
816
|
userSelect: "all"
|
|
806
817
|
},
|
|
807
|
-
children:
|
|
818
|
+
children: g.apiKey
|
|
808
819
|
}
|
|
809
820
|
),
|
|
810
821
|
/* @__PURE__ */ s("div", { style: { marginTop: 8, fontSize: 12, color: "var(--text-muted)" }, children: [
|
|
811
822
|
"前缀: ",
|
|
812
|
-
|
|
823
|
+
g.akPrefix
|
|
813
824
|
] })
|
|
814
825
|
]
|
|
815
826
|
}
|
|
816
827
|
),
|
|
817
828
|
/* @__PURE__ */ e(
|
|
818
|
-
|
|
829
|
+
Ae,
|
|
819
830
|
{
|
|
820
831
|
title: k ? /* @__PURE__ */ s("span", { children: [
|
|
821
832
|
"AK 详情 — ",
|
|
822
833
|
/* @__PURE__ */ e("code", { children: k.akPrefix })
|
|
823
834
|
] }) : "AK 详情",
|
|
824
835
|
open: !!k,
|
|
825
|
-
onClose:
|
|
836
|
+
onClose: de,
|
|
826
837
|
size: "large",
|
|
827
|
-
children:
|
|
838
|
+
children: G ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载用量数据..." }) }) : A ? /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
|
|
828
839
|
/* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 12 }, children: "以下为网关全局调用统计(近 7 天窗口), 监控侧不按 AK 留存;该 AK 自身的累计消耗见下方「本 AK 累计 Token」。" }),
|
|
829
840
|
/* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
|
|
830
|
-
/* @__PURE__ */ e(
|
|
831
|
-
/* @__PURE__ */ e(
|
|
841
|
+
/* @__PURE__ */ e(K, { title: "总请求数", value: A.totalRequests }),
|
|
842
|
+
/* @__PURE__ */ e(K, { title: "总 Token", value: A.totalTokens }),
|
|
832
843
|
/* @__PURE__ */ e(
|
|
833
|
-
|
|
844
|
+
K,
|
|
834
845
|
{
|
|
835
846
|
title: "输入 Token",
|
|
836
847
|
value: A.totalPromptTokens
|
|
837
848
|
}
|
|
838
849
|
),
|
|
839
850
|
/* @__PURE__ */ e(
|
|
840
|
-
|
|
851
|
+
K,
|
|
841
852
|
{
|
|
842
853
|
title: "输出 Token",
|
|
843
854
|
value: A.totalCompletionTokens
|
|
844
855
|
}
|
|
845
856
|
),
|
|
846
857
|
/* @__PURE__ */ e(
|
|
847
|
-
|
|
858
|
+
K,
|
|
848
859
|
{
|
|
849
860
|
title: "平均耗时",
|
|
850
861
|
value: A.avgLatencyMs,
|
|
@@ -852,7 +863,7 @@ function Ka() {
|
|
|
852
863
|
}
|
|
853
864
|
),
|
|
854
865
|
/* @__PURE__ */ e(
|
|
855
|
-
|
|
866
|
+
K,
|
|
856
867
|
{
|
|
857
868
|
title: "错误数",
|
|
858
869
|
value: A.errorCount,
|
|
@@ -864,7 +875,7 @@ function Ka() {
|
|
|
864
875
|
}
|
|
865
876
|
),
|
|
866
877
|
/* @__PURE__ */ e(
|
|
867
|
-
|
|
878
|
+
K,
|
|
868
879
|
{
|
|
869
880
|
title: "本 AK 累计 Token",
|
|
870
881
|
value: (k == null ? void 0 : k.totalTokens) ?? 0
|
|
@@ -873,18 +884,18 @@ function Ka() {
|
|
|
873
884
|
] }),
|
|
874
885
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
875
886
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "每日调用曲线(按最近调用明细聚合)" }),
|
|
876
|
-
|
|
887
|
+
Ee(A.daily)
|
|
877
888
|
] }),
|
|
878
889
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
879
890
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "模型用量分布" }),
|
|
880
|
-
|
|
891
|
+
$e(A.models)
|
|
881
892
|
] }),
|
|
882
893
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
883
894
|
/* @__PURE__ */ e("h4", { className: t.usageSectionTitle, children: "最近调用记录" }),
|
|
884
895
|
/* @__PURE__ */ e(
|
|
885
|
-
|
|
896
|
+
Be,
|
|
886
897
|
{
|
|
887
|
-
columns:
|
|
898
|
+
columns: Le,
|
|
888
899
|
dataSource: A.recent,
|
|
889
900
|
rowKey: "id",
|
|
890
901
|
size: "small",
|
|
@@ -893,7 +904,7 @@ function Ka() {
|
|
|
893
904
|
size: "small",
|
|
894
905
|
showSizeChanger: !0,
|
|
895
906
|
pageSizeOptions: ["10", "20", "50", "100"],
|
|
896
|
-
showTotal: (
|
|
907
|
+
showTotal: (d) => `共 ${d} 条`
|
|
897
908
|
},
|
|
898
909
|
scroll: { x: 760 }
|
|
899
910
|
}
|
|
@@ -904,62 +915,62 @@ function Ka() {
|
|
|
904
915
|
)
|
|
905
916
|
] });
|
|
906
917
|
}
|
|
907
|
-
function
|
|
918
|
+
function La(a) {
|
|
908
919
|
const n = [];
|
|
909
920
|
if (!a) return n;
|
|
910
921
|
const r = /<(think|thinking|reasoning)>([\s\S]*?)<\/\1>/gi;
|
|
911
|
-
let i = 0,
|
|
912
|
-
for (; (
|
|
913
|
-
|
|
922
|
+
let i = 0, u;
|
|
923
|
+
for (; (u = r.exec(a)) !== null; )
|
|
924
|
+
u.index > i && n.push({ type: "text", text: a.slice(i, u.index) }), n.push({ type: "think", text: u[2] }), i = u.index + u[0].length;
|
|
914
925
|
return i < a.length && n.push({ type: "text", text: a.slice(i) }), n;
|
|
915
926
|
}
|
|
916
|
-
const
|
|
917
|
-
let
|
|
918
|
-
function
|
|
919
|
-
const [n, r] =
|
|
920
|
-
|
|
927
|
+
const re = 4;
|
|
928
|
+
let Oa = 0;
|
|
929
|
+
function Ua({ initialModels: a }) {
|
|
930
|
+
const [n, r] = N([]), [i, u] = N([]), [f, y] = N(!0), [_, p] = N(null), [z, O] = N(""), [w, C] = N(!1), v = he(""), g = he(/* @__PURE__ */ new Map()), c = he(/* @__PURE__ */ new Map());
|
|
931
|
+
Z(() => {
|
|
921
932
|
(async () => {
|
|
922
933
|
try {
|
|
923
|
-
const o = await
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
r(
|
|
934
|
+
const o = await fe();
|
|
935
|
+
u(o), y(!1);
|
|
936
|
+
const h = a.length > 0 ? a : o.slice(0, 1).map((S) => S.modelName);
|
|
937
|
+
r(h.slice(0, re).map((S) => ge(S)));
|
|
927
938
|
} catch (o) {
|
|
928
|
-
|
|
939
|
+
y(!1), p(o instanceof Error ? o.message : "模型列表加载失败");
|
|
929
940
|
}
|
|
930
941
|
})();
|
|
931
|
-
}, []),
|
|
942
|
+
}, []), Z(() => {
|
|
932
943
|
if (a.length > 0 && i.length > 0) {
|
|
933
|
-
const o = a.slice(0,
|
|
944
|
+
const o = a.slice(0, re).map((h) => ge(h));
|
|
934
945
|
r(o);
|
|
935
946
|
}
|
|
936
947
|
}, [a.join(",")]);
|
|
937
948
|
const k = j((o) => {
|
|
938
|
-
const
|
|
939
|
-
|
|
940
|
-
}, []),
|
|
941
|
-
(o,
|
|
942
|
-
r((
|
|
949
|
+
const h = c.current.get(o);
|
|
950
|
+
h && (h.scrollTop = h.scrollHeight);
|
|
951
|
+
}, []), m = j(
|
|
952
|
+
(o, h) => {
|
|
953
|
+
r((S) => S.map((P) => P.id === o ? h(P) : P));
|
|
943
954
|
},
|
|
944
955
|
[]
|
|
945
956
|
), A = j(async () => {
|
|
946
|
-
if (
|
|
947
|
-
const o = await
|
|
948
|
-
return
|
|
949
|
-
}, []),
|
|
950
|
-
const o =
|
|
957
|
+
if (v.current) return v.current;
|
|
958
|
+
const o = await lt();
|
|
959
|
+
return v.current = o, o;
|
|
960
|
+
}, []), I = j(async () => {
|
|
961
|
+
const o = z.trim();
|
|
951
962
|
if (!o || w) return;
|
|
952
|
-
let
|
|
963
|
+
let h;
|
|
953
964
|
try {
|
|
954
|
-
|
|
965
|
+
h = await A();
|
|
955
966
|
} catch {
|
|
956
967
|
return;
|
|
957
968
|
}
|
|
958
|
-
|
|
959
|
-
const
|
|
960
|
-
...
|
|
969
|
+
O(""), C(!0);
|
|
970
|
+
const S = n.map((M) => ({
|
|
971
|
+
...M,
|
|
961
972
|
messages: [
|
|
962
|
-
...
|
|
973
|
+
...M.messages,
|
|
963
974
|
{ role: "user", content: o },
|
|
964
975
|
{ role: "assistant", content: "" }
|
|
965
976
|
],
|
|
@@ -968,102 +979,102 @@ function La({ initialModels: a }) {
|
|
|
968
979
|
error: null,
|
|
969
980
|
usage: null
|
|
970
981
|
}));
|
|
971
|
-
r(
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
const
|
|
975
|
-
|
|
976
|
-
const
|
|
977
|
-
|
|
978
|
-
onDelta: (
|
|
979
|
-
|
|
982
|
+
r(S);
|
|
983
|
+
const P = S;
|
|
984
|
+
P.forEach((M) => {
|
|
985
|
+
const q = new AbortController();
|
|
986
|
+
g.current.set(M.id, q);
|
|
987
|
+
const ce = M.messages.slice(0, -1);
|
|
988
|
+
at(h, M.model, ce, {
|
|
989
|
+
onDelta: (E) => {
|
|
990
|
+
m(M.id, (F) => ({
|
|
980
991
|
...F,
|
|
981
|
-
streamingContent: F.streamingContent +
|
|
992
|
+
streamingContent: F.streamingContent + E,
|
|
982
993
|
messages: F.messages.map(
|
|
983
|
-
(
|
|
994
|
+
(se, de) => de === F.messages.length - 1 ? { ...se, content: F.streamingContent + E } : se
|
|
984
995
|
)
|
|
985
|
-
})), k(
|
|
996
|
+
})), k(M.id);
|
|
986
997
|
},
|
|
987
|
-
onDone: (
|
|
988
|
-
|
|
998
|
+
onDone: (E) => {
|
|
999
|
+
m(M.id, (F) => ({
|
|
989
1000
|
...F,
|
|
990
1001
|
isStreaming: !1,
|
|
991
|
-
usage:
|
|
992
|
-
promptTokens:
|
|
993
|
-
completionTokens:
|
|
994
|
-
totalTokens:
|
|
1002
|
+
usage: E ? {
|
|
1003
|
+
promptTokens: E.promptTokens,
|
|
1004
|
+
completionTokens: E.completionTokens,
|
|
1005
|
+
totalTokens: E.totalTokens
|
|
995
1006
|
} : null
|
|
996
|
-
})),
|
|
1007
|
+
})), g.current.delete(M.id);
|
|
997
1008
|
},
|
|
998
|
-
onError: (
|
|
999
|
-
(
|
|
1009
|
+
onError: (E) => {
|
|
1010
|
+
(E.message.includes("401") || E.message.includes("API key")) && (Ke(), v.current = ""), m(M.id, (F) => ({
|
|
1000
1011
|
...F,
|
|
1001
1012
|
isStreaming: !1,
|
|
1002
|
-
error:
|
|
1003
|
-
})),
|
|
1013
|
+
error: E.message
|
|
1014
|
+
})), g.current.delete(M.id);
|
|
1004
1015
|
},
|
|
1005
|
-
signal:
|
|
1016
|
+
signal: q.signal
|
|
1006
1017
|
}).catch(() => {
|
|
1007
1018
|
});
|
|
1008
1019
|
});
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
(
|
|
1012
|
-
) && (clearInterval(
|
|
1020
|
+
const B = setInterval(() => {
|
|
1021
|
+
P.every(
|
|
1022
|
+
(q) => !g.current.has(q.id)
|
|
1023
|
+
) && (clearInterval(B), C(!1));
|
|
1013
1024
|
}, 200);
|
|
1014
1025
|
setTimeout(() => {
|
|
1015
|
-
clearInterval(
|
|
1026
|
+
clearInterval(B), C(!1);
|
|
1016
1027
|
}, 300 * 1e3);
|
|
1017
|
-
}, [
|
|
1018
|
-
|
|
1019
|
-
}, []),
|
|
1020
|
-
var
|
|
1021
|
-
if (n.length >=
|
|
1022
|
-
const o = (
|
|
1023
|
-
o && r((
|
|
1028
|
+
}, [z, w, n, A, m, k]), G = j(() => {
|
|
1029
|
+
g.current.forEach((o) => o.abort()), g.current.clear(), r((o) => o.map((h) => ({ ...h, isStreaming: !1 }))), C(!1);
|
|
1030
|
+
}, []), Q = j(() => {
|
|
1031
|
+
var h;
|
|
1032
|
+
if (n.length >= re) return;
|
|
1033
|
+
const o = (h = i.find((S) => !n.some((P) => P.model === S.modelName))) == null ? void 0 : h.modelName;
|
|
1034
|
+
o && r((S) => [...S, ge(o)]);
|
|
1024
1035
|
}, [n, i]), H = j(() => {
|
|
1025
|
-
|
|
1026
|
-
(o) => o.map((
|
|
1027
|
-
...
|
|
1036
|
+
g.current.forEach((o) => o.abort()), g.current.clear(), r(
|
|
1037
|
+
(o) => o.map((h) => ({
|
|
1038
|
+
...h,
|
|
1028
1039
|
messages: [],
|
|
1029
1040
|
streamingContent: "",
|
|
1030
1041
|
isStreaming: !1,
|
|
1031
1042
|
error: null,
|
|
1032
1043
|
usage: null
|
|
1033
1044
|
}))
|
|
1034
|
-
),
|
|
1045
|
+
), C(!1);
|
|
1035
1046
|
}, [w, n]), l = j((o) => {
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1047
|
+
const h = g.current.get(o);
|
|
1048
|
+
h && h.abort(), g.current.delete(o), r((S) => S.filter((P) => P.id !== o));
|
|
1038
1049
|
}, []), b = j(
|
|
1039
|
-
(o,
|
|
1040
|
-
|
|
1050
|
+
(o, h) => {
|
|
1051
|
+
m(o, (S) => ({ ...S, model: h }));
|
|
1041
1052
|
},
|
|
1042
|
-
[
|
|
1043
|
-
),
|
|
1053
|
+
[m]
|
|
1054
|
+
), U = i.map((o) => ({
|
|
1044
1055
|
label: o.modelName,
|
|
1045
1056
|
value: o.modelName
|
|
1046
1057
|
}));
|
|
1047
|
-
return
|
|
1058
|
+
return f ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载模型列表..." }) }) : _ ? /* @__PURE__ */ s("div", { className: t.chatContainer, children: [
|
|
1048
1059
|
/* @__PURE__ */ e("div", { className: t.chatHeader, children: /* @__PURE__ */ e("h3", { className: t.chatTitle, children: "模型对话" }) }),
|
|
1049
1060
|
/* @__PURE__ */ s("div", { className: t.akEmpty, children: [
|
|
1050
1061
|
"模型列表加载失败:",
|
|
1051
|
-
|
|
1062
|
+
_
|
|
1052
1063
|
] })
|
|
1053
1064
|
] }) : /* @__PURE__ */ s("div", { className: t.chatContainer, children: [
|
|
1054
1065
|
/* @__PURE__ */ s("div", { className: t.chatHeader, children: [
|
|
1055
1066
|
/* @__PURE__ */ s("h3", { className: t.chatTitle, children: [
|
|
1056
1067
|
"模型对话",
|
|
1057
|
-
n.length > 1 && /* @__PURE__ */ s(
|
|
1068
|
+
n.length > 1 && /* @__PURE__ */ s(W, { color: "blue", style: { marginLeft: 12, fontSize: 12 }, children: [
|
|
1058
1069
|
n.length,
|
|
1059
1070
|
" 个模型对比"
|
|
1060
1071
|
] })
|
|
1061
1072
|
] }),
|
|
1062
1073
|
/* @__PURE__ */ e(
|
|
1063
|
-
|
|
1074
|
+
D,
|
|
1064
1075
|
{
|
|
1065
1076
|
size: "small",
|
|
1066
|
-
icon: /* @__PURE__ */ e(
|
|
1077
|
+
icon: /* @__PURE__ */ e(Ue, {}),
|
|
1067
1078
|
onClick: H,
|
|
1068
1079
|
disabled: w || n.every((o) => o.messages.length === 0),
|
|
1069
1080
|
children: "清空重新来"
|
|
@@ -1074,12 +1085,12 @@ function La({ initialModels: a }) {
|
|
|
1074
1085
|
n.map((o) => /* @__PURE__ */ s("div", { className: t.chatPanel, children: [
|
|
1075
1086
|
/* @__PURE__ */ s("div", { className: t.chatPanelHeader, children: [
|
|
1076
1087
|
/* @__PURE__ */ e(
|
|
1077
|
-
|
|
1088
|
+
We,
|
|
1078
1089
|
{
|
|
1079
1090
|
size: "small",
|
|
1080
1091
|
value: o.model,
|
|
1081
|
-
onChange: (
|
|
1082
|
-
options:
|
|
1092
|
+
onChange: (h) => b(o.id, h),
|
|
1093
|
+
options: U,
|
|
1083
1094
|
style: { minWidth: 140, flex: 1 },
|
|
1084
1095
|
showSearch: !0,
|
|
1085
1096
|
optionFilterProp: "label"
|
|
@@ -1090,7 +1101,7 @@ function La({ initialModels: a }) {
|
|
|
1090
1101
|
{
|
|
1091
1102
|
className: t.chatPanelClose,
|
|
1092
1103
|
onClick: () => l(o.id),
|
|
1093
|
-
children: /* @__PURE__ */ e(
|
|
1104
|
+
children: /* @__PURE__ */ e(Re, {})
|
|
1094
1105
|
}
|
|
1095
1106
|
)
|
|
1096
1107
|
] }),
|
|
@@ -1098,32 +1109,32 @@ function La({ initialModels: a }) {
|
|
|
1098
1109
|
"div",
|
|
1099
1110
|
{
|
|
1100
1111
|
className: t.chatPanelBody,
|
|
1101
|
-
ref: (
|
|
1102
|
-
c.current.set(o.id,
|
|
1112
|
+
ref: (h) => {
|
|
1113
|
+
c.current.set(o.id, h);
|
|
1103
1114
|
},
|
|
1104
1115
|
children: [
|
|
1105
|
-
o.messages.map((
|
|
1116
|
+
o.messages.map((h, S) => /* @__PURE__ */ s(
|
|
1106
1117
|
"div",
|
|
1107
1118
|
{
|
|
1108
|
-
className:
|
|
1119
|
+
className: h.role === "user" ? t.chatMsgUser : t.chatMsgAI,
|
|
1109
1120
|
children: [
|
|
1110
|
-
|
|
1111
|
-
(
|
|
1121
|
+
h.role === "assistant" ? La(h.content).map(
|
|
1122
|
+
(P, B) => P.type === "think" ? /* @__PURE__ */ s(
|
|
1112
1123
|
"details",
|
|
1113
1124
|
{
|
|
1114
1125
|
className: t.chatThinkBlock,
|
|
1115
1126
|
children: [
|
|
1116
1127
|
/* @__PURE__ */ e("summary", { children: "思考过程" }),
|
|
1117
|
-
/* @__PURE__ */ e("pre", { children:
|
|
1128
|
+
/* @__PURE__ */ e("pre", { children: P.text })
|
|
1118
1129
|
]
|
|
1119
1130
|
},
|
|
1120
|
-
|
|
1121
|
-
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children:
|
|
1122
|
-
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children:
|
|
1123
|
-
o.isStreaming &&
|
|
1131
|
+
B
|
|
1132
|
+
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: P.text }, B)
|
|
1133
|
+
) : /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap" }, children: h.content }),
|
|
1134
|
+
o.isStreaming && S === o.messages.length - 1 && h.role === "assistant" && /* @__PURE__ */ e("span", { className: t.chatStreamingCursor })
|
|
1124
1135
|
]
|
|
1125
1136
|
},
|
|
1126
|
-
|
|
1137
|
+
S
|
|
1127
1138
|
)),
|
|
1128
1139
|
o.error && /* @__PURE__ */ e("div", { className: t.chatMsgError, children: o.error }),
|
|
1129
1140
|
o.usage && /* @__PURE__ */ s("div", { className: t.chatUsageBar, children: [
|
|
@@ -1140,33 +1151,33 @@ function La({ initialModels: a }) {
|
|
|
1140
1151
|
}
|
|
1141
1152
|
)
|
|
1142
1153
|
] }, o.id)),
|
|
1143
|
-
n.length <
|
|
1154
|
+
n.length < re && /* @__PURE__ */ e(Y, { title: "添加面板", children: /* @__PURE__ */ e("div", { className: t.addPanelBtn, onClick: Q, children: /* @__PURE__ */ e(Te, {}) }) })
|
|
1144
1155
|
] }),
|
|
1145
1156
|
/* @__PURE__ */ s("div", { className: t.chatInputBar, children: [
|
|
1146
1157
|
/* @__PURE__ */ e(
|
|
1147
|
-
|
|
1158
|
+
pe.TextArea,
|
|
1148
1159
|
{
|
|
1149
1160
|
className: t.chatInput,
|
|
1150
|
-
value:
|
|
1151
|
-
onChange: (o) =>
|
|
1161
|
+
value: z,
|
|
1162
|
+
onChange: (o) => O(o.target.value),
|
|
1152
1163
|
placeholder: "输入消息,所有面板将同时收到并流式输出...",
|
|
1153
1164
|
autoSize: { minRows: 1, maxRows: 4 },
|
|
1154
1165
|
onPressEnter: (o) => {
|
|
1155
|
-
o.shiftKey || (o.preventDefault(),
|
|
1166
|
+
o.shiftKey || (o.preventDefault(), I());
|
|
1156
1167
|
},
|
|
1157
1168
|
disabled: w
|
|
1158
1169
|
}
|
|
1159
1170
|
),
|
|
1160
|
-
w ? /* @__PURE__ */ e(
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1171
|
+
w ? /* @__PURE__ */ e(D, { danger: !0, onClick: G, children: "停止" }) : /* @__PURE__ */ s(D, { type: "primary", onClick: I, disabled: !z.trim(), children: [
|
|
1172
|
+
/* @__PURE__ */ e(De, {}),
|
|
1162
1173
|
" 发送"
|
|
1163
1174
|
] })
|
|
1164
1175
|
] })
|
|
1165
1176
|
] });
|
|
1166
1177
|
}
|
|
1167
|
-
function
|
|
1178
|
+
function ge(a) {
|
|
1168
1179
|
return {
|
|
1169
|
-
id:
|
|
1180
|
+
id: ++Oa,
|
|
1170
1181
|
model: a,
|
|
1171
1182
|
messages: [],
|
|
1172
1183
|
streamingContent: "",
|
|
@@ -1175,40 +1186,40 @@ function ue(a) {
|
|
|
1175
1186
|
usage: null
|
|
1176
1187
|
};
|
|
1177
1188
|
}
|
|
1178
|
-
function
|
|
1179
|
-
const [n, r] =
|
|
1180
|
-
|
|
1181
|
-
r(c),
|
|
1189
|
+
function Ra({ onStartChat: a }) {
|
|
1190
|
+
const [n, r] = N([]), [i, u] = N(!0), [f, y] = N(null), [_, p] = N(/* @__PURE__ */ new Set()), z = () => {
|
|
1191
|
+
u(!0), y(null), fe().then((c) => {
|
|
1192
|
+
r(c), u(!1);
|
|
1182
1193
|
}).catch((c) => {
|
|
1183
|
-
r([]),
|
|
1194
|
+
r([]), y(c instanceof Error ? c.message : "加载失败"), u(!1);
|
|
1184
1195
|
});
|
|
1185
1196
|
};
|
|
1186
|
-
|
|
1187
|
-
|
|
1197
|
+
Z(() => {
|
|
1198
|
+
z();
|
|
1188
1199
|
}, []);
|
|
1189
|
-
const
|
|
1200
|
+
const O = (c) => {
|
|
1190
1201
|
p((k) => {
|
|
1191
|
-
const
|
|
1192
|
-
return
|
|
1202
|
+
const m = new Set(k);
|
|
1203
|
+
return m.has(c) ? m.delete(c) : m.add(c), m;
|
|
1193
1204
|
});
|
|
1194
|
-
}, w = Array.from(
|
|
1205
|
+
}, w = Array.from(_), C = (c) => {
|
|
1195
1206
|
a([c]);
|
|
1196
|
-
},
|
|
1207
|
+
}, v = () => {
|
|
1197
1208
|
w.length > 0 && a(w);
|
|
1198
|
-
},
|
|
1209
|
+
}, g = (c) => {
|
|
1199
1210
|
if (!c) return "default";
|
|
1200
1211
|
const k = c.toLowerCase();
|
|
1201
1212
|
return k.includes("aliyun") || k.includes("ali") ? "blue" : k.includes("zhipu") || k.includes("glm") ? "purple" : k.includes("moonshot") || k.includes("kimi") ? "cyan" : k.includes("minimax") ? "orange" : "default";
|
|
1202
1213
|
};
|
|
1203
|
-
return i ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(
|
|
1214
|
+
return i ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载模型列表..." }) }) : f ? /* @__PURE__ */ s("div", { children: [
|
|
1204
1215
|
/* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
|
|
1205
1216
|
/* @__PURE__ */ e("h3", { className: t.modelMgmtTitle, children: "模型管理" }),
|
|
1206
1217
|
/* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "数据库管理的可用模型,可选择单个或多个模型发起对话对比" })
|
|
1207
1218
|
] }),
|
|
1208
1219
|
/* @__PURE__ */ s("div", { className: t.akEmpty, children: [
|
|
1209
1220
|
"模型列表加载失败:",
|
|
1210
|
-
|
|
1211
|
-
/* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(
|
|
1221
|
+
f,
|
|
1222
|
+
/* @__PURE__ */ e("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ e(D, { type: "primary", onClick: z, children: "重试" }) })
|
|
1212
1223
|
] })
|
|
1213
1224
|
] }) : /* @__PURE__ */ s("div", { children: [
|
|
1214
1225
|
/* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
|
|
@@ -1217,48 +1228,48 @@ function Oa({ onStartChat: a }) {
|
|
|
1217
1228
|
] }),
|
|
1218
1229
|
n.length === 0 && /* @__PURE__ */ e("div", { className: t.akEmpty, children: "后端暂无启用模型(z_team_model_config 中 enable=1 的行),请先在数据库或网关配置中启用" }),
|
|
1219
1230
|
/* @__PURE__ */ e("div", { className: t.modelGrid, children: n.map((c) => {
|
|
1220
|
-
const k =
|
|
1231
|
+
const k = _.has(c.modelName);
|
|
1221
1232
|
return /* @__PURE__ */ s(
|
|
1222
1233
|
"div",
|
|
1223
1234
|
{
|
|
1224
1235
|
className: `${t.modelCard} ${k ? t.modelCardSelected : ""}`,
|
|
1225
|
-
onClick: () =>
|
|
1236
|
+
onClick: () => O(c.modelName),
|
|
1226
1237
|
children: [
|
|
1227
1238
|
/* @__PURE__ */ e(
|
|
1228
|
-
|
|
1239
|
+
Qe,
|
|
1229
1240
|
{
|
|
1230
1241
|
className: t.modelCheckbox,
|
|
1231
1242
|
checked: k,
|
|
1232
|
-
onChange: (
|
|
1233
|
-
|
|
1243
|
+
onChange: (m) => {
|
|
1244
|
+
m.stopPropagation(), O(c.modelName);
|
|
1234
1245
|
}
|
|
1235
1246
|
}
|
|
1236
1247
|
),
|
|
1237
1248
|
/* @__PURE__ */ s("div", { className: t.modelCardHeader, children: [
|
|
1238
|
-
/* @__PURE__ */ e("div", { className: t.modelIconWrap, children: /* @__PURE__ */ e(
|
|
1249
|
+
/* @__PURE__ */ e("div", { className: t.modelIconWrap, children: /* @__PURE__ */ e(Se, {}) }),
|
|
1239
1250
|
/* @__PURE__ */ s("div", { className: t.modelCardInfo, children: [
|
|
1240
1251
|
/* @__PURE__ */ e("h4", { className: t.modelName, children: c.modelName }),
|
|
1241
1252
|
/* @__PURE__ */ s("div", { className: t.modelTags, children: [
|
|
1242
1253
|
c.modelProvider && /* @__PURE__ */ e(
|
|
1243
|
-
|
|
1254
|
+
W,
|
|
1244
1255
|
{
|
|
1245
|
-
color:
|
|
1256
|
+
color: g(c.modelProvider),
|
|
1246
1257
|
style: { fontSize: 11, margin: 0 },
|
|
1247
1258
|
children: c.modelProvider
|
|
1248
1259
|
}
|
|
1249
1260
|
),
|
|
1250
|
-
/* @__PURE__ */ e(
|
|
1261
|
+
/* @__PURE__ */ e(W, { style: { fontSize: 11, margin: 0 }, children: c.apiType })
|
|
1251
1262
|
] })
|
|
1252
1263
|
] })
|
|
1253
1264
|
] }),
|
|
1254
1265
|
/* @__PURE__ */ e("p", { className: t.modelEndpoint, children: c.endpoint }),
|
|
1255
1266
|
/* @__PURE__ */ e("div", { className: t.modelCardFooter, children: /* @__PURE__ */ e(
|
|
1256
|
-
|
|
1267
|
+
D,
|
|
1257
1268
|
{
|
|
1258
1269
|
type: "link",
|
|
1259
1270
|
size: "small",
|
|
1260
|
-
onClick: (
|
|
1261
|
-
|
|
1271
|
+
onClick: (m) => {
|
|
1272
|
+
m.stopPropagation(), C(c.modelName);
|
|
1262
1273
|
},
|
|
1263
1274
|
children: "发起对话"
|
|
1264
1275
|
}
|
|
@@ -1275,10 +1286,10 @@ function Oa({ onStartChat: a }) {
|
|
|
1275
1286
|
" 个模型"
|
|
1276
1287
|
] }),
|
|
1277
1288
|
/* @__PURE__ */ e(
|
|
1278
|
-
|
|
1289
|
+
D,
|
|
1279
1290
|
{
|
|
1280
1291
|
type: "primary",
|
|
1281
|
-
onClick:
|
|
1292
|
+
onClick: v,
|
|
1282
1293
|
disabled: w.length === 0,
|
|
1283
1294
|
children: "批量对比"
|
|
1284
1295
|
}
|
|
@@ -1286,64 +1297,64 @@ function Oa({ onStartChat: a }) {
|
|
|
1286
1297
|
] })
|
|
1287
1298
|
] });
|
|
1288
1299
|
}
|
|
1289
|
-
const
|
|
1290
|
-
container:
|
|
1291
|
-
page:
|
|
1292
|
-
kpiGrid:
|
|
1293
|
-
kpiCard:
|
|
1294
|
-
sectionCard:
|
|
1295
|
-
sectionHead:
|
|
1296
|
-
sectionHint:
|
|
1297
|
-
akList:
|
|
1298
|
-
errorState:
|
|
1299
|
-
errorTitle:
|
|
1300
|
-
errorDetail:
|
|
1301
|
-
},
|
|
1300
|
+
const Da = "_container_15pgq_5", Ha = "_page_15pgq_10", Fa = "_kpiGrid_15pgq_16", ja = "_kpiCard_15pgq_22", qa = "_sectionCard_15pgq_29", Ga = "_sectionHead_15pgq_36", Ja = "_sectionHint_15pgq_42", Wa = "_akList_15pgq_47", Qa = "_errorState_15pgq_54", Va = "_errorTitle_15pgq_66", Ya = "_errorDetail_15pgq_72", L = {
|
|
1301
|
+
container: Da,
|
|
1302
|
+
page: Ha,
|
|
1303
|
+
kpiGrid: Fa,
|
|
1304
|
+
kpiCard: ja,
|
|
1305
|
+
sectionCard: qa,
|
|
1306
|
+
sectionHead: Ga,
|
|
1307
|
+
sectionHint: Ja,
|
|
1308
|
+
akList: Wa,
|
|
1309
|
+
errorState: Qa,
|
|
1310
|
+
errorTitle: Va,
|
|
1311
|
+
errorDetail: Ya
|
|
1312
|
+
}, Xa = Ye(
|
|
1302
1313
|
() => import("@yuku123/z-agent-component").then((a) => ({ default: a.AgentDashboard }))
|
|
1303
1314
|
);
|
|
1304
|
-
function
|
|
1315
|
+
function ae(a) {
|
|
1305
1316
|
return a >= 1e6 ? `${(a / 1e6).toFixed(2)}M` : a >= 1e3 ? `${(a / 1e3).toFixed(1)}K` : String(a ?? 0);
|
|
1306
1317
|
}
|
|
1307
|
-
function
|
|
1318
|
+
function Za({ daily: a }) {
|
|
1308
1319
|
const n = Object.entries(a);
|
|
1309
1320
|
if (n.length === 0) return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
1310
1321
|
const r = Math.max(...n.map(([, i]) => i[1] + i[2]), 1);
|
|
1311
|
-
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: n.map(([i,
|
|
1312
|
-
const
|
|
1322
|
+
return /* @__PURE__ */ e("div", { className: t.usageBarChart, children: n.map(([i, u]) => {
|
|
1323
|
+
const f = u[1] + u[2];
|
|
1313
1324
|
return /* @__PURE__ */ s("div", { className: t.usageBarCol, children: [
|
|
1314
|
-
/* @__PURE__ */ e(
|
|
1325
|
+
/* @__PURE__ */ e(Y, { title: `${i}: ${u[0]}次 / ${f} tokens`, children: /* @__PURE__ */ e(
|
|
1315
1326
|
"div",
|
|
1316
1327
|
{
|
|
1317
1328
|
className: t.usageBar,
|
|
1318
|
-
style: { height: `${Math.max(
|
|
1329
|
+
style: { height: `${Math.max(f / r * 100, 2)}%` }
|
|
1319
1330
|
}
|
|
1320
1331
|
) }),
|
|
1321
1332
|
/* @__PURE__ */ e("span", { className: t.usageBarLabel, children: i })
|
|
1322
1333
|
] }, i);
|
|
1323
1334
|
}) });
|
|
1324
1335
|
}
|
|
1325
|
-
function
|
|
1336
|
+
function xe({ models: a }) {
|
|
1326
1337
|
const n = Object.entries(a);
|
|
1327
1338
|
if (n.length === 0) return /* @__PURE__ */ e("span", { className: t.usageEmpty, children: "暂无数据" });
|
|
1328
1339
|
const r = Math.max(...n.map(([, i]) => i[0]), 1);
|
|
1329
|
-
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: n.sort((i,
|
|
1340
|
+
return /* @__PURE__ */ e("div", { className: t.modelBreakdown, children: n.sort((i, u) => u[1][0] - i[1][0]).map(([i, u]) => /* @__PURE__ */ s("div", { className: t.modelBreakdownRow, children: [
|
|
1330
1341
|
/* @__PURE__ */ e("span", { className: t.modelBreakdownName, children: i }),
|
|
1331
1342
|
/* @__PURE__ */ e("div", { className: t.modelBreakdownBar, children: /* @__PURE__ */ e(
|
|
1332
1343
|
"div",
|
|
1333
1344
|
{
|
|
1334
1345
|
className: t.modelBreakdownFill,
|
|
1335
|
-
style: { width: `${
|
|
1346
|
+
style: { width: `${u[0] / r * 100}%` }
|
|
1336
1347
|
}
|
|
1337
1348
|
) }),
|
|
1338
1349
|
/* @__PURE__ */ s("span", { className: t.modelBreakdownCount, children: [
|
|
1339
|
-
|
|
1350
|
+
u[0],
|
|
1340
1351
|
"次 / ",
|
|
1341
|
-
|
|
1352
|
+
ae(u[1] + (u[2] || 0)),
|
|
1342
1353
|
"tokens"
|
|
1343
1354
|
] })
|
|
1344
1355
|
] }, i)) });
|
|
1345
1356
|
}
|
|
1346
|
-
const
|
|
1357
|
+
const en = [
|
|
1347
1358
|
{
|
|
1348
1359
|
title: "时间",
|
|
1349
1360
|
dataIndex: "createTime",
|
|
@@ -1352,7 +1363,7 @@ const Xa = [
|
|
|
1352
1363
|
render: (a) => a ? new Date(a).toLocaleString("zh-CN") : "-"
|
|
1353
1364
|
},
|
|
1354
1365
|
{ title: "模型", dataIndex: "model", key: "model", width: 150 },
|
|
1355
|
-
{ title: "协议", dataIndex: "protocol", key: "protocol", width: 90, render: (a) => /* @__PURE__ */ e(
|
|
1366
|
+
{ title: "协议", dataIndex: "protocol", key: "protocol", width: 90, render: (a) => /* @__PURE__ */ e(W, { children: a }) },
|
|
1356
1367
|
{ title: "输入", dataIndex: "promptTokens", key: "promptTokens", width: 70 },
|
|
1357
1368
|
{ title: "输出", dataIndex: "completionTokens", key: "completionTokens", width: 70 },
|
|
1358
1369
|
{ title: "总Token", dataIndex: "totalTokens", key: "totalTokens", width: 80 },
|
|
@@ -1362,63 +1373,63 @@ const Xa = [
|
|
|
1362
1373
|
dataIndex: "statusCode",
|
|
1363
1374
|
key: "statusCode",
|
|
1364
1375
|
width: 60,
|
|
1365
|
-
render: (a) => a ? /* @__PURE__ */ e(
|
|
1376
|
+
render: (a) => a ? /* @__PURE__ */ e(W, { color: a < 400 ? "green" : "red", children: a }) : "-"
|
|
1366
1377
|
}
|
|
1367
1378
|
];
|
|
1368
|
-
function
|
|
1379
|
+
function tn(a) {
|
|
1369
1380
|
var n;
|
|
1370
1381
|
return ((n = a == null ? void 0 : a.stats) == null ? void 0 : n.recent) ?? [];
|
|
1371
1382
|
}
|
|
1372
|
-
function
|
|
1373
|
-
var k,
|
|
1374
|
-
const [a, n] =
|
|
1383
|
+
function an() {
|
|
1384
|
+
var k, m, A, I, G, Q, H;
|
|
1385
|
+
const [a, n] = N(!0), [r, i] = N(null), [u, f] = N([]), [y, _] = N(null), [p, z] = N(null), O = String(Me((l) => {
|
|
1375
1386
|
var b;
|
|
1376
1387
|
return ((b = l.currentUser) == null ? void 0 : b.id) ?? "";
|
|
1377
1388
|
})), w = Array.from(
|
|
1378
|
-
new Set([
|
|
1379
|
-
),
|
|
1389
|
+
new Set([O, Ie].filter((l) => l !== ""))
|
|
1390
|
+
), C = j(async () => {
|
|
1380
1391
|
n(!0), i(null);
|
|
1381
1392
|
try {
|
|
1382
1393
|
const l = await Promise.allSettled(
|
|
1383
|
-
w.map((
|
|
1384
|
-
), b = [],
|
|
1394
|
+
w.map((B) => ie(B))
|
|
1395
|
+
), b = [], U = /* @__PURE__ */ new Set();
|
|
1385
1396
|
let o = 0;
|
|
1386
|
-
for (const
|
|
1387
|
-
if (
|
|
1388
|
-
for (const
|
|
1389
|
-
const
|
|
1390
|
-
|
|
1397
|
+
for (const B of l)
|
|
1398
|
+
if (B.status === "fulfilled")
|
|
1399
|
+
for (const M of B.value) {
|
|
1400
|
+
const q = String(M.id ?? M.akPrefix ?? "");
|
|
1401
|
+
U.has(q) || (U.add(q), b.push(M));
|
|
1391
1402
|
}
|
|
1392
1403
|
else o += 1;
|
|
1393
1404
|
if (o === l.length)
|
|
1394
1405
|
throw new Error("网关不可达:无法获取 AK 列表");
|
|
1395
|
-
b.sort((
|
|
1396
|
-
let
|
|
1406
|
+
b.sort((B, M) => (B.id ?? 0) - (M.id ?? 0));
|
|
1407
|
+
let h = null, S = null;
|
|
1397
1408
|
try {
|
|
1398
|
-
|
|
1399
|
-
} catch (
|
|
1400
|
-
|
|
1409
|
+
h = await Pe(0);
|
|
1410
|
+
} catch (B) {
|
|
1411
|
+
S = B instanceof Error ? B.message : "获取用量失败";
|
|
1401
1412
|
}
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1404
|
-
key:
|
|
1405
|
-
stats:
|
|
1406
|
-
statsError:
|
|
1413
|
+
_(h);
|
|
1414
|
+
const P = b.map((B) => ({
|
|
1415
|
+
key: B,
|
|
1416
|
+
stats: h,
|
|
1417
|
+
statsError: S
|
|
1407
1418
|
}));
|
|
1408
|
-
|
|
1419
|
+
f(P);
|
|
1409
1420
|
} catch (l) {
|
|
1410
1421
|
i(l instanceof Error ? l.message : "加载失败");
|
|
1411
1422
|
} finally {
|
|
1412
1423
|
n(!1);
|
|
1413
1424
|
}
|
|
1414
1425
|
}, [w.join(",")]);
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
}, [
|
|
1418
|
-
const
|
|
1419
|
-
const l =
|
|
1420
|
-
for (const [
|
|
1421
|
-
b[
|
|
1426
|
+
Z(() => {
|
|
1427
|
+
C();
|
|
1428
|
+
}, [C]);
|
|
1429
|
+
const v = ze(() => {
|
|
1430
|
+
const l = y, b = {};
|
|
1431
|
+
for (const [U, o] of Object.entries((l == null ? void 0 : l.models) ?? {}))
|
|
1432
|
+
b[U] = [o[0] ?? 0, o[1] ?? 0, o[2] ?? 0];
|
|
1422
1433
|
return {
|
|
1423
1434
|
requests: (l == null ? void 0 : l.totalRequests) ?? 0,
|
|
1424
1435
|
tokens: (l == null ? void 0 : l.totalTokens) ?? 0,
|
|
@@ -1426,40 +1437,40 @@ function en() {
|
|
|
1426
1437
|
errors: (l == null ? void 0 : l.errorCount) ?? 0,
|
|
1427
1438
|
models: b
|
|
1428
1439
|
};
|
|
1429
|
-
}, [
|
|
1430
|
-
/* @__PURE__ */ e("div", { className:
|
|
1431
|
-
/* @__PURE__ */ e("div", { className:
|
|
1432
|
-
/* @__PURE__ */ e(
|
|
1433
|
-
] }) : /* @__PURE__ */ s("div", { className:
|
|
1434
|
-
/* @__PURE__ */ s("div", { className:
|
|
1435
|
-
/* @__PURE__ */ e("div", { className:
|
|
1436
|
-
/* @__PURE__ */ e("div", { className:
|
|
1437
|
-
/* @__PURE__ */ e("div", { className:
|
|
1438
|
-
/* @__PURE__ */ e("div", { className:
|
|
1439
|
-
|
|
1440
|
+
}, [y]), g = u.reduce((l, b) => l + (b.key.tokenQuota || 0), 0), c = () => a ? /* @__PURE__ */ e("div", { style: { textAlign: "center", padding: 60 }, children: /* @__PURE__ */ e(X, { tip: "加载监控数据..." }) }) : r ? /* @__PURE__ */ s("div", { className: L.errorState, children: [
|
|
1441
|
+
/* @__PURE__ */ e("div", { className: L.errorTitle, children: "模型监控数据加载失败" }),
|
|
1442
|
+
/* @__PURE__ */ e("div", { className: L.errorDetail, children: r }),
|
|
1443
|
+
/* @__PURE__ */ e(D, { icon: /* @__PURE__ */ e(ve, {}), onClick: C, type: "primary", children: "重试" })
|
|
1444
|
+
] }) : /* @__PURE__ */ s("div", { className: L.page, children: [
|
|
1445
|
+
/* @__PURE__ */ s("div", { className: L.kpiGrid, children: [
|
|
1446
|
+
/* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(K, { title: "总请求(近7天)", value: v.requests }) }),
|
|
1447
|
+
/* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(K, { title: "总 Tokens", value: ae(v.tokens) }) }),
|
|
1448
|
+
/* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(K, { title: "平均延迟", value: v.avgLatency, suffix: "ms" }) }),
|
|
1449
|
+
/* @__PURE__ */ e("div", { className: L.kpiCard, children: /* @__PURE__ */ e(
|
|
1450
|
+
K,
|
|
1440
1451
|
{
|
|
1441
1452
|
title: "错误数",
|
|
1442
|
-
value:
|
|
1443
|
-
valueStyle:
|
|
1453
|
+
value: v.errors,
|
|
1454
|
+
valueStyle: v.errors > 0 ? { color: "#ff4d4f" } : void 0
|
|
1444
1455
|
}
|
|
1445
1456
|
) })
|
|
1446
1457
|
] }),
|
|
1447
|
-
/* @__PURE__ */ s("div", { className:
|
|
1448
|
-
/* @__PURE__ */ s("div", { className:
|
|
1458
|
+
/* @__PURE__ */ s("div", { className: L.sectionCard, children: [
|
|
1459
|
+
/* @__PURE__ */ s("div", { className: L.sectionHead, children: [
|
|
1449
1460
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "AK 用量" }),
|
|
1450
|
-
|
|
1461
|
+
g > 0 && /* @__PURE__ */ s("span", { className: L.sectionHint, children: [
|
|
1451
1462
|
"合计额度 ",
|
|
1452
|
-
|
|
1463
|
+
ae(g),
|
|
1453
1464
|
" tokens"
|
|
1454
1465
|
] })
|
|
1455
1466
|
] }),
|
|
1456
|
-
|
|
1457
|
-
const b = l.key.totalTokens ?? 0,
|
|
1467
|
+
u.length === 0 ? /* @__PURE__ */ e("div", { className: t.akEmpty, children: "网关下暂无 AK" }) : /* @__PURE__ */ e("div", { className: L.akList, children: u.map((l) => {
|
|
1468
|
+
const b = l.key.totalTokens ?? 0, U = l.key.tokenQuota || 0, o = U > 0 ? Math.min(b / U * 100, 100) : 0;
|
|
1458
1469
|
return /* @__PURE__ */ s(
|
|
1459
1470
|
"div",
|
|
1460
1471
|
{
|
|
1461
1472
|
className: t.akCard,
|
|
1462
|
-
onClick: () =>
|
|
1473
|
+
onClick: () => z(l),
|
|
1463
1474
|
children: [
|
|
1464
1475
|
/* @__PURE__ */ s("div", { className: t.akCardRow, children: [
|
|
1465
1476
|
/* @__PURE__ */ e("span", { className: t.akTitle, children: l.key.description || l.key.userName || `AK #${l.key.id}` }),
|
|
@@ -1482,8 +1493,8 @@ function en() {
|
|
|
1482
1493
|
}
|
|
1483
1494
|
) }),
|
|
1484
1495
|
/* @__PURE__ */ s("span", { className: t.akUsageText, children: [
|
|
1485
|
-
|
|
1486
|
-
|
|
1496
|
+
ae(b),
|
|
1497
|
+
U > 0 ? ` / ${ae(U)}` : "",
|
|
1487
1498
|
" tokens"
|
|
1488
1499
|
] }),
|
|
1489
1500
|
/* @__PURE__ */ e("span", { className: t.akMetaText, children: l.statsError ? l.statsError : l.key.lastUsedAt ? `最近使用 ${l.key.lastUsedAt}` : "尚未使用" })
|
|
@@ -1494,18 +1505,18 @@ function en() {
|
|
|
1494
1505
|
);
|
|
1495
1506
|
}) })
|
|
1496
1507
|
] }),
|
|
1497
|
-
/* @__PURE__ */ s("div", { className:
|
|
1508
|
+
/* @__PURE__ */ s("div", { className: L.sectionCard, children: [
|
|
1498
1509
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布(网关全局)" }),
|
|
1499
|
-
/* @__PURE__ */ e(
|
|
1510
|
+
/* @__PURE__ */ e(xe, { models: v.models })
|
|
1500
1511
|
] })
|
|
1501
1512
|
] });
|
|
1502
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1513
|
+
return /* @__PURE__ */ s("div", { className: L.container, children: [
|
|
1503
1514
|
/* @__PURE__ */ s("div", { className: t.modelMgmtHeader, children: [
|
|
1504
1515
|
/* @__PURE__ */ e("h2", { className: t.modelMgmtTitle, children: "模型监控" }),
|
|
1505
1516
|
/* @__PURE__ */ e("p", { className: t.modelMgmtSubtitle, children: "大模型网关管控视图 — 网关全局聚合调用量、Tokens 与延迟(近 7 天)" })
|
|
1506
1517
|
] }),
|
|
1507
1518
|
/* @__PURE__ */ e(
|
|
1508
|
-
|
|
1519
|
+
we,
|
|
1509
1520
|
{
|
|
1510
1521
|
defaultActiveKey: "usage",
|
|
1511
1522
|
items: [
|
|
@@ -1513,59 +1524,59 @@ function en() {
|
|
|
1513
1524
|
{
|
|
1514
1525
|
key: "sessions",
|
|
1515
1526
|
label: "会话统计",
|
|
1516
|
-
children: /* @__PURE__ */ e(
|
|
1527
|
+
children: /* @__PURE__ */ e(Ve, { fallback: /* @__PURE__ */ e(X, { tip: "加载会话统计..." }), children: /* @__PURE__ */ e(Xa, {}) })
|
|
1517
1528
|
}
|
|
1518
1529
|
]
|
|
1519
1530
|
}
|
|
1520
1531
|
),
|
|
1521
1532
|
/* @__PURE__ */ e(
|
|
1522
|
-
|
|
1533
|
+
Ae,
|
|
1523
1534
|
{
|
|
1524
1535
|
title: p ? `AK 用量 — ${p.key.description || p.key.akPrefix}` : "",
|
|
1525
1536
|
width: 860,
|
|
1526
1537
|
open: !!p,
|
|
1527
|
-
onClose: () =>
|
|
1538
|
+
onClose: () => z(null),
|
|
1528
1539
|
destroyOnHidden: !0,
|
|
1529
1540
|
children: p && /* @__PURE__ */ s("div", { className: t.usageDrawerContent, children: [
|
|
1530
1541
|
/* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#8c8c8c", marginBottom: 12 }, children: "调用监控是网关全局维度(不按 AK 留存),以下统计覆盖全部 AK; 该 AK 自身的累计消耗见「本 AK 累计 Token」。" }),
|
|
1531
1542
|
/* @__PURE__ */ s("div", { className: t.usageStatsGrid, children: [
|
|
1532
|
-
/* @__PURE__ */ e(
|
|
1533
|
-
/* @__PURE__ */ e(
|
|
1534
|
-
/* @__PURE__ */ e(
|
|
1535
|
-
/* @__PURE__ */ e(
|
|
1536
|
-
/* @__PURE__ */ e(
|
|
1543
|
+
/* @__PURE__ */ e(K, { title: "总请求", value: ((k = p.stats) == null ? void 0 : k.totalRequests) ?? 0 }),
|
|
1544
|
+
/* @__PURE__ */ e(K, { title: "总 Tokens", value: ((m = p.stats) == null ? void 0 : m.totalTokens) ?? 0 }),
|
|
1545
|
+
/* @__PURE__ */ e(K, { title: "平均延迟", value: ((A = p.stats) == null ? void 0 : A.avgLatencyMs) ?? 0, suffix: "ms" }),
|
|
1546
|
+
/* @__PURE__ */ e(K, { title: "输入 Tokens", value: ((I = p.stats) == null ? void 0 : I.totalPromptTokens) ?? 0 }),
|
|
1547
|
+
/* @__PURE__ */ e(K, { title: "输出 Tokens", value: ((G = p.stats) == null ? void 0 : G.totalCompletionTokens) ?? 0 }),
|
|
1537
1548
|
/* @__PURE__ */ e(
|
|
1538
|
-
|
|
1549
|
+
K,
|
|
1539
1550
|
{
|
|
1540
1551
|
title: "本 AK 累计 Token",
|
|
1541
1552
|
value: p.key.totalTokens ?? 0
|
|
1542
1553
|
}
|
|
1543
1554
|
),
|
|
1544
1555
|
/* @__PURE__ */ e(
|
|
1545
|
-
|
|
1556
|
+
K,
|
|
1546
1557
|
{
|
|
1547
1558
|
title: "错误数",
|
|
1548
|
-
value: ((
|
|
1559
|
+
value: ((Q = p.stats) == null ? void 0 : Q.errorCount) ?? 0,
|
|
1549
1560
|
valueStyle: (((H = p.stats) == null ? void 0 : H.errorCount) ?? 0) > 0 ? { color: "#ff4d4f" } : void 0
|
|
1550
1561
|
}
|
|
1551
1562
|
)
|
|
1552
1563
|
] }),
|
|
1553
1564
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
1554
1565
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "每日用量(按最近调用明细聚合)" }),
|
|
1555
|
-
p.stats ? /* @__PURE__ */ e(
|
|
1566
|
+
p.stats ? /* @__PURE__ */ e(Za, { daily: p.stats.daily ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: p.statsError ?? "暂无数据" })
|
|
1556
1567
|
] }),
|
|
1557
1568
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
1558
1569
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "模型用量分布(按最近调用明细聚合)" }),
|
|
1559
|
-
p.stats ? /* @__PURE__ */ e(
|
|
1570
|
+
p.stats ? /* @__PURE__ */ e(xe, { models: p.stats.models ?? {} }) : /* @__PURE__ */ e("span", { className: t.usageEmpty, children: p.statsError ?? "暂无数据" })
|
|
1560
1571
|
] }),
|
|
1561
1572
|
/* @__PURE__ */ s("div", { className: t.usageSection, children: [
|
|
1562
1573
|
/* @__PURE__ */ e("span", { className: t.usageSectionTitle, children: "最近调用" }),
|
|
1563
1574
|
/* @__PURE__ */ e(
|
|
1564
|
-
|
|
1575
|
+
Be,
|
|
1565
1576
|
{
|
|
1566
1577
|
size: "small",
|
|
1567
|
-
columns:
|
|
1568
|
-
dataSource:
|
|
1578
|
+
columns: en,
|
|
1579
|
+
dataSource: tn(p),
|
|
1569
1580
|
rowKey: "id",
|
|
1570
1581
|
pagination: {
|
|
1571
1582
|
pageSize: 8,
|
|
@@ -1581,49 +1592,49 @@ function en() {
|
|
|
1581
1592
|
)
|
|
1582
1593
|
] });
|
|
1583
1594
|
}
|
|
1584
|
-
const
|
|
1585
|
-
{ key: "model-management", label: "模型管理", icon: /* @__PURE__ */ e(
|
|
1586
|
-
{ key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(
|
|
1587
|
-
{ key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(
|
|
1588
|
-
{ key: "agent-app", label: "Agent 应用", icon: /* @__PURE__ */ e(
|
|
1589
|
-
{ key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(
|
|
1590
|
-
{ key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(
|
|
1591
|
-
{ key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(
|
|
1595
|
+
const nn = [
|
|
1596
|
+
{ key: "model-management", label: "模型管理", icon: /* @__PURE__ */ e(He, {}) },
|
|
1597
|
+
{ key: "model-chat", label: "模型对话", icon: /* @__PURE__ */ e(Fe, {}) },
|
|
1598
|
+
{ key: "ak-management", label: "AK 管理", icon: /* @__PURE__ */ e(je, {}) },
|
|
1599
|
+
{ key: "agent-app", label: "Agent 应用", icon: /* @__PURE__ */ e(Se, {}) },
|
|
1600
|
+
{ key: "mcp-service", label: "MCP 服务", icon: /* @__PURE__ */ e(qe, {}) },
|
|
1601
|
+
{ key: "skill-market", label: "技能市场", icon: /* @__PURE__ */ e(Ge, {}) },
|
|
1602
|
+
{ key: "model-monitor", label: "模型监控", icon: /* @__PURE__ */ e(Je, {}) }
|
|
1592
1603
|
];
|
|
1593
|
-
function
|
|
1594
|
-
const [a, n] =
|
|
1595
|
-
i(
|
|
1596
|
-
},
|
|
1604
|
+
function mn() {
|
|
1605
|
+
const [a, n] = N("model-management"), [r, i] = N([]), u = (_) => {
|
|
1606
|
+
i(_), n("model-chat");
|
|
1607
|
+
}, f = ze(() => nn, []), y = (_, p, z = !1) => /* @__PURE__ */ e(
|
|
1597
1608
|
"div",
|
|
1598
1609
|
{
|
|
1599
1610
|
style: {
|
|
1600
|
-
display: a ===
|
|
1611
|
+
display: a === _ ? z ? "flex" : "block" : "none",
|
|
1601
1612
|
height: "100%",
|
|
1602
|
-
...
|
|
1613
|
+
...z ? { flexDirection: "column" } : {}
|
|
1603
1614
|
},
|
|
1604
1615
|
children: p
|
|
1605
1616
|
}
|
|
1606
1617
|
);
|
|
1607
1618
|
return /* @__PURE__ */ s("div", { className: t.container, children: [
|
|
1608
|
-
/* @__PURE__ */ e("aside", { className: t.sidebar, children: /* @__PURE__ */ e("nav", { className: t.menuList, children:
|
|
1619
|
+
/* @__PURE__ */ e("aside", { className: t.sidebar, children: /* @__PURE__ */ e("nav", { className: t.menuList, children: f.map((_) => /* @__PURE__ */ e(Y, { title: _.label, placement: "right", children: /* @__PURE__ */ e(
|
|
1609
1620
|
"div",
|
|
1610
1621
|
{
|
|
1611
|
-
className: `${t.menuItem} ${a ===
|
|
1612
|
-
onClick: () => n(
|
|
1613
|
-
children: /* @__PURE__ */ e("span", { className: t.menuIcon, children:
|
|
1622
|
+
className: `${t.menuItem} ${a === _.key ? t.menuItemActive : ""}`,
|
|
1623
|
+
onClick: () => n(_.key),
|
|
1624
|
+
children: /* @__PURE__ */ e("span", { className: t.menuIcon, children: _.icon })
|
|
1614
1625
|
}
|
|
1615
|
-
) },
|
|
1626
|
+
) }, _.key)) }) }),
|
|
1616
1627
|
/* @__PURE__ */ s("main", { className: t.panelArea, children: [
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1628
|
+
y("model-management", /* @__PURE__ */ e(Ra, { onStartChat: u })),
|
|
1629
|
+
y("model-chat", /* @__PURE__ */ e(Ua, { initialModels: r }), !0),
|
|
1630
|
+
y("ak-management", /* @__PURE__ */ e($a, {})),
|
|
1631
|
+
y("agent-app", /* @__PURE__ */ e(Xe, {})),
|
|
1632
|
+
y("mcp-service", /* @__PURE__ */ e(Ze, {})),
|
|
1633
|
+
y("skill-market", /* @__PURE__ */ e(et, {})),
|
|
1634
|
+
y("model-monitor", /* @__PURE__ */ e(an, {}))
|
|
1624
1635
|
] })
|
|
1625
1636
|
] });
|
|
1626
1637
|
}
|
|
1627
1638
|
export {
|
|
1628
|
-
|
|
1639
|
+
mn as default
|
|
1629
1640
|
};
|