@yuku123/z-team-component 0.2.21 → 0.2.23
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/DebugPlayground-cxffrMgF.js +15 -0
- package/dist/{InvitationManagementPage-cXDD5J1f.js → InvitationManagementPage-BJ0izYip.js} +2 -2
- package/dist/{OnboardingPage-D7W1L7E7.js → OnboardingPage-Cde_2B_A.js} +2 -2
- package/dist/{ProjectApp-DgCJv9Qr.js → ProjectApp-CJfqACjb.js} +3 -3
- package/dist/SmartWorkbench.module-DzQskKT0.js +85 -0
- package/dist/SystemShell-Cm9eErqQ.js +593 -0
- package/dist/{admin-logs-96BMdLm3.js → admin-logs-C2V1ElH9.js} +34 -34
- package/dist/{api-DayyjL1e.js → api--Fg0hL9Y.js} +258 -258
- package/dist/{api-BzonkJ9O.js → api-DlnrjUut.js} +1 -1
- package/dist/{createWorkspaceWsHandler-Dgpag_y3.js → createWorkspaceWsHandler-CqGqcTh_.js} +27 -27
- package/dist/echarts-B1OU1xr4.js +16 -0
- package/dist/{index-BCnzwGPj.js → index-1xwvv2Q7.js} +3 -3
- package/dist/{index-BuGgpiDq.js → index-8V37FP9c.js} +4 -4
- package/dist/{index-gqKmHnTZ.js → index-B3ikipDf.js} +4 -4
- package/dist/{index-Cnw06MGB.js → index-BMRIUhOL.js} +3 -3
- package/dist/index-BaCiSbPR.js +956 -0
- package/dist/index-Bla8z6ok.js +6879 -0
- package/dist/index-Bsh58cwF.js +975 -0
- package/dist/index-C01UUprh.js +41705 -0
- package/dist/index-C0EIMJI2.js +112 -0
- package/dist/{index-BX-3TBsz.js → index-CGDpGIZC.js} +6 -6
- package/dist/index-CUVdeb8y.js +638 -0
- package/dist/{index-D3TdisV7.js → index-CW2B5_8f.js} +1616 -22092
- package/dist/{index-sGtg7MFg.js → index-D5u3BjCZ.js} +2 -2
- package/dist/{index-pJERGpTh.js → index-DK_aR-Vu.js} +5 -4
- package/dist/index-DKpz0o-l.js +1327 -0
- package/dist/index-DUbYCF9y.js +1171 -0
- package/dist/index-DvIHX7lZ.js +1657 -0
- package/dist/{index-BMOS7sE7.js → index-b1BIpgn7.js} +165 -163
- package/dist/{index-DHGvzWWQ.js → index-bbwTcNjB.js} +7 -7
- package/dist/index-hPzswwk2.js +5900 -0
- package/dist/index-pfzY68PH.js +1408 -0
- package/dist/index.js +1 -1
- package/dist/index.module-CAa-2T7m.js +72 -0
- package/dist/index.module-UI0iz8K0.js +42 -0
- package/dist/{instance-CNHJqTd1.js → instance-1QEDBRqA.js} +12 -12
- package/dist/pages.js +1 -1
- package/dist/schedule-C89oiqIR.js +239 -0
- package/dist/{send-default-agent-team-message-CRRwpv0q.js → send-default-agent-team-message-CxkWi3XC.js} +1 -1
- package/dist/{sso-user-D0JzsJeR.js → sso-user-BE1Ell5F.js} +1 -1
- package/dist/training-o-vSBkqP.js +450 -0
- package/dist/{useAppStore-BYXwTjW-.js → useAppStore-wgWaxcyc.js} +24 -24
- package/dist/webide-BxD6cYe-.js +8084 -0
- package/dist/z-team-component.css +2 -2
- package/package.json +1 -1
- package/dist/index-CJD6mLzs.js +0 -51451
|
@@ -0,0 +1,1657 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useNavigate as Pe, useLocation as Te, Navigate as S } from "react-router-dom";
|
|
3
|
+
import { useState as p, useEffect as G, useRef as H, useMemo as ie } from "react";
|
|
4
|
+
import { Spin as Re, Row as ze, Col as W, Card as M, Statistic as j, Space as x, Tag as I, Button as w, Alert as X, Table as re, Badge as we, Popconfirm as K, message as v, Select as Se, Drawer as $e, Tabs as Ne, Form as L, Modal as Ee, Input as te, InputNumber as ne } from "antd";
|
|
5
|
+
import { DashboardOutlined as D, ClusterOutlined as B, CloudServerOutlined as P, ContainerOutlined as Ce, ReloadOutlined as le, LockOutlined as Le, UnlockOutlined as Ge, PlayCircleOutlined as qe, PauseCircleOutlined as Be, ClearOutlined as xe, SendOutlined as Ie, EyeOutlined as De, DeleteOutlined as Oe, PlusOutlined as Fe, EditOutlined as He, DownOutlined as Me, RightOutlined as Ue, BranchesOutlined as de, RocketOutlined as Ke, AlertOutlined as We, FileTextOutlined as ae, DatabaseOutlined as V, CloudOutlined as je, DeploymentUnitOutlined as pe, UnorderedListOutlined as J, HistoryOutlined as Ve, ExperimentOutlined as Je, SettingOutlined as me, KeyOutlined as Z, AppstoreOutlined as se, SafetyCertificateOutlined as Ze, TeamOutlined as Qe, ProfileOutlined as ue, ApiOutlined as he, HddOutlined as ce, ApartmentOutlined as ye, InboxOutlined as ge, NodeIndexOutlined as Ye, TableOutlined as be, SearchOutlined as ke, ConsoleSqlOutlined as Xe, BookOutlined as Q, FundOutlined as et, CloudUploadOutlined as tt, TagsOutlined as nt, CodeOutlined as at } from "@ant-design/icons";
|
|
6
|
+
import { ConfigApp as st } from "@yuku123/z-config-component";
|
|
7
|
+
import { MistApp as ct } from "@yuku123/z-mist-component";
|
|
8
|
+
import { MetaApp as ot } from "@yuku123/z-meta-component";
|
|
9
|
+
import { MsgApp as rt } from "@yuku123/z-msg-component";
|
|
10
|
+
import { RpcApp as lt } from "@yuku123/z-rpc-component";
|
|
11
|
+
import { VectorApp as it } from "@yuku123/z-vector-component";
|
|
12
|
+
import { GraphApp as dt } from "@yuku123/z-graph-component";
|
|
13
|
+
import { GwApp as pt } from "@yuku123/z-gw-component";
|
|
14
|
+
import { CacheApp as mt } from "@yuku123/z-cache-component";
|
|
15
|
+
import { MqApp as ut } from "@yuku123/z-mq-component";
|
|
16
|
+
import { OssApp as ht } from "@yuku123/z-oss-component";
|
|
17
|
+
import { ZkbApp as yt } from "@yuku123/z-kb-component";
|
|
18
|
+
import { ScriptProductizationPage as U } from "@yuku123/z-agent-component";
|
|
19
|
+
const gt = "_shell_19t4h_6", bt = "_sidebar_19t4h_14", kt = "_menuList_19t4h_36", ft = "_menuGroup_19t4h_42", vt = "_menuGroupHeader_19t4h_46", wt = "_menuGroupIcon_19t4h_64", St = "_menuGroupLabel_19t4h_69", Ct = "_menuGroupArrow_19t4h_73", xt = "_menuSubList_19t4h_79", It = "_menuSubItem_19t4h_85", Ot = "_menuSubItemActive_19t4h_102", _t = "_menuSubItemIcon_19t4h_109", At = "_menuSubItemLabel_19t4h_114", Pt = "_menuSubItemWrap_19t4h_118", Tt = "_main_19t4h_122", Rt = "_empty_19t4h_129", zt = "_emptyIcon_19t4h_139", $t = "_emptyText_19t4h_144", f = {
|
|
20
|
+
shell: gt,
|
|
21
|
+
sidebar: bt,
|
|
22
|
+
menuList: kt,
|
|
23
|
+
menuGroup: ft,
|
|
24
|
+
menuGroupHeader: vt,
|
|
25
|
+
menuGroupIcon: wt,
|
|
26
|
+
menuGroupLabel: St,
|
|
27
|
+
menuGroupArrow: Ct,
|
|
28
|
+
menuSubList: xt,
|
|
29
|
+
menuSubItem: It,
|
|
30
|
+
menuSubItemActive: Ot,
|
|
31
|
+
menuSubItemIcon: _t,
|
|
32
|
+
menuSubItemLabel: At,
|
|
33
|
+
menuSubItemWrap: Pt,
|
|
34
|
+
main: Tt,
|
|
35
|
+
empty: Rt,
|
|
36
|
+
emptyIcon: zt,
|
|
37
|
+
emptyText: $t
|
|
38
|
+
}, Nt = "/z-team/ops/k8s";
|
|
39
|
+
async function _e(t, c) {
|
|
40
|
+
const i = `${Nt}${t}`, d = await fetch(i, {
|
|
41
|
+
headers: { "Content-Type": "application/json" },
|
|
42
|
+
...c
|
|
43
|
+
}), m = d.headers && d.headers.get("content-type") || "";
|
|
44
|
+
if (!/json/i.test(m))
|
|
45
|
+
throw new Error(`数据源不可达:GET ${i} 返回 ${d.status} ${m || "(无 content-type)"},不是 JSON —— 该前缀没有进到后端接口(K8s 管理 API 在 z-ops 仓,z-opc 宿主未注册)`);
|
|
46
|
+
const u = await d.json();
|
|
47
|
+
if (u && u.success === !1)
|
|
48
|
+
throw new Error(`后端 ${i} 返回 success=false:${u.message || "(无 message)"}`);
|
|
49
|
+
return u;
|
|
50
|
+
}
|
|
51
|
+
async function N(t, c) {
|
|
52
|
+
return _e(t, c);
|
|
53
|
+
}
|
|
54
|
+
async function Et() {
|
|
55
|
+
return N("/cluster/info");
|
|
56
|
+
}
|
|
57
|
+
async function Lt() {
|
|
58
|
+
return N("/nodes");
|
|
59
|
+
}
|
|
60
|
+
async function Gt(t) {
|
|
61
|
+
return N("/nodes/cordon", {
|
|
62
|
+
method: "POST",
|
|
63
|
+
body: JSON.stringify({ name: t })
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async function qt(t) {
|
|
67
|
+
return N("/nodes/uncordon", {
|
|
68
|
+
method: "POST",
|
|
69
|
+
body: JSON.stringify({ name: t })
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async function Bt(t = "*") {
|
|
73
|
+
return N(`/workloads/pods?namespace=${t}`);
|
|
74
|
+
}
|
|
75
|
+
async function Dt(t, c, i = 200) {
|
|
76
|
+
return N(`/workloads/pods/${t}/${c}/logs?tailLines=${i}`);
|
|
77
|
+
}
|
|
78
|
+
async function Ft(t, c) {
|
|
79
|
+
return N(`/workloads/pods/${t}/${c}/restart`, { method: "POST" });
|
|
80
|
+
}
|
|
81
|
+
async function Ht(t, c) {
|
|
82
|
+
return N(`/workloads/pods/${t}/${c}`, { method: "DELETE" });
|
|
83
|
+
}
|
|
84
|
+
async function Mt() {
|
|
85
|
+
return N("/namespaces");
|
|
86
|
+
}
|
|
87
|
+
const fe = () => {
|
|
88
|
+
var u, y;
|
|
89
|
+
const [t, c] = p(null), [i, d] = p(!0);
|
|
90
|
+
G(() => {
|
|
91
|
+
m();
|
|
92
|
+
const h = setInterval(m, 1e4);
|
|
93
|
+
return () => clearInterval(h);
|
|
94
|
+
}, []);
|
|
95
|
+
const m = async () => {
|
|
96
|
+
try {
|
|
97
|
+
const h = await Et();
|
|
98
|
+
h.success && c(h.data);
|
|
99
|
+
} catch (h) {
|
|
100
|
+
console.error("Failed to load cluster info", h);
|
|
101
|
+
} finally {
|
|
102
|
+
d(!1);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return i ? /* @__PURE__ */ e(Re, { size: "large" }) : /* @__PURE__ */ s("div", { style: { padding: 16 }, children: [
|
|
106
|
+
/* @__PURE__ */ s("h2", { style: { marginBottom: 24 }, children: [
|
|
107
|
+
/* @__PURE__ */ e(D, {}),
|
|
108
|
+
" 运维总览"
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ s(ze, { gutter: [16, 16], children: [
|
|
111
|
+
/* @__PURE__ */ e(W, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
|
+
j,
|
|
114
|
+
{
|
|
115
|
+
title: /* @__PURE__ */ s(x, { children: [
|
|
116
|
+
/* @__PURE__ */ e(B, {}),
|
|
117
|
+
" K8s 节点"
|
|
118
|
+
] }),
|
|
119
|
+
value: (t == null ? void 0 : t.readyNodes) ?? 0,
|
|
120
|
+
suffix: /* @__PURE__ */ s("span", { style: { color: "#999" }, children: [
|
|
121
|
+
" / ",
|
|
122
|
+
(t == null ? void 0 : t.nodeCount) ?? 0
|
|
123
|
+
] })
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ e(I, { color: (t == null ? void 0 : t.status) === "Healthy" ? "success" : "warning", children: (t == null ? void 0 : t.status) ?? "Unknown" })
|
|
127
|
+
] }) }),
|
|
128
|
+
/* @__PURE__ */ e(W, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
129
|
+
/* @__PURE__ */ e(
|
|
130
|
+
j,
|
|
131
|
+
{
|
|
132
|
+
title: /* @__PURE__ */ s(x, { children: [
|
|
133
|
+
/* @__PURE__ */ e(P, {}),
|
|
134
|
+
" CPU"
|
|
135
|
+
] }),
|
|
136
|
+
value: ((u = t == null ? void 0 : t.usedCpu) == null ? void 0 : u.toFixed(1)) ?? "0",
|
|
137
|
+
suffix: /* @__PURE__ */ s("span", { style: { color: "#999" }, children: [
|
|
138
|
+
" / ",
|
|
139
|
+
(t == null ? void 0 : t.totalCpu) ?? 0,
|
|
140
|
+
" cores"
|
|
141
|
+
] }),
|
|
142
|
+
precision: 1
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ s(I, { color: ((t == null ? void 0 : t.usedCpu) ?? 0) / ((t == null ? void 0 : t.totalCpu) ?? 1) > 0.8 ? "error" : "success", children: [
|
|
146
|
+
(((t == null ? void 0 : t.usedCpu) ?? 0) / ((t == null ? void 0 : t.totalCpu) ?? 1) * 100).toFixed(0),
|
|
147
|
+
"%"
|
|
148
|
+
] })
|
|
149
|
+
] }) }),
|
|
150
|
+
/* @__PURE__ */ e(W, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
151
|
+
/* @__PURE__ */ e(
|
|
152
|
+
j,
|
|
153
|
+
{
|
|
154
|
+
title: /* @__PURE__ */ s(x, { children: [
|
|
155
|
+
/* @__PURE__ */ e(D, {}),
|
|
156
|
+
" 内存"
|
|
157
|
+
] }),
|
|
158
|
+
value: ((y = t == null ? void 0 : t.usedMemory) == null ? void 0 : y.toFixed(1)) ?? "0",
|
|
159
|
+
suffix: /* @__PURE__ */ s("span", { style: { color: "#999" }, children: [
|
|
160
|
+
" / ",
|
|
161
|
+
(t == null ? void 0 : t.totalMemory) ?? 0,
|
|
162
|
+
" GB"
|
|
163
|
+
] }),
|
|
164
|
+
precision: 1
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ s(I, { color: ((t == null ? void 0 : t.usedMemory) ?? 0) / ((t == null ? void 0 : t.totalMemory) ?? 1) > 0.8 ? "error" : "success", children: [
|
|
168
|
+
(((t == null ? void 0 : t.usedMemory) ?? 0) / ((t == null ? void 0 : t.totalMemory) ?? 1) * 100).toFixed(0),
|
|
169
|
+
"%"
|
|
170
|
+
] })
|
|
171
|
+
] }) }),
|
|
172
|
+
/* @__PURE__ */ e(W, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
173
|
+
/* @__PURE__ */ e(
|
|
174
|
+
j,
|
|
175
|
+
{
|
|
176
|
+
title: /* @__PURE__ */ s(x, { children: [
|
|
177
|
+
/* @__PURE__ */ e(Ce, {}),
|
|
178
|
+
" Pods"
|
|
179
|
+
] }),
|
|
180
|
+
value: (t == null ? void 0 : t.runningPods) ?? 0,
|
|
181
|
+
suffix: /* @__PURE__ */ s("span", { style: { color: "#999" }, children: [
|
|
182
|
+
" / ",
|
|
183
|
+
(t == null ? void 0 : t.totalPods) ?? 0
|
|
184
|
+
] })
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ s(I, { color: "success", children: [
|
|
188
|
+
(t == null ? void 0 : t.namespaceCount) ?? 0,
|
|
189
|
+
" namespaces"
|
|
190
|
+
] })
|
|
191
|
+
] }) })
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ e(M, { title: "集群信息", style: { marginTop: 16 }, children: /* @__PURE__ */ s(x, { orientation: "vertical", children: [
|
|
194
|
+
/* @__PURE__ */ s("div", { children: [
|
|
195
|
+
/* @__PURE__ */ e("strong", { children: "K8s 版本:" }),
|
|
196
|
+
" ",
|
|
197
|
+
(t == null ? void 0 : t.version) ?? "Unknown"
|
|
198
|
+
] }),
|
|
199
|
+
/* @__PURE__ */ s("div", { children: [
|
|
200
|
+
/* @__PURE__ */ e("strong", { children: "集群状态:" }),
|
|
201
|
+
" ",
|
|
202
|
+
/* @__PURE__ */ e(I, { color: "success", children: t == null ? void 0 : t.status })
|
|
203
|
+
] }),
|
|
204
|
+
/* @__PURE__ */ s("div", { children: [
|
|
205
|
+
/* @__PURE__ */ e("strong", { children: "节点数:" }),
|
|
206
|
+
" ",
|
|
207
|
+
t == null ? void 0 : t.nodeCount,
|
|
208
|
+
" (Ready: ",
|
|
209
|
+
t == null ? void 0 : t.readyNodes,
|
|
210
|
+
")"
|
|
211
|
+
] }),
|
|
212
|
+
/* @__PURE__ */ s("div", { children: [
|
|
213
|
+
/* @__PURE__ */ e("strong", { children: "CPU 使用率:" }),
|
|
214
|
+
" ",
|
|
215
|
+
(((t == null ? void 0 : t.usedCpu) ?? 0) / ((t == null ? void 0 : t.totalCpu) ?? 1) * 100).toFixed(1),
|
|
216
|
+
"%"
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ s("div", { children: [
|
|
219
|
+
/* @__PURE__ */ e("strong", { children: "内存使用率:" }),
|
|
220
|
+
" ",
|
|
221
|
+
(((t == null ? void 0 : t.usedMemory) ?? 0) / ((t == null ? void 0 : t.totalMemory) ?? 1) * 100).toFixed(1),
|
|
222
|
+
"%"
|
|
223
|
+
] })
|
|
224
|
+
] }) })
|
|
225
|
+
] });
|
|
226
|
+
}, Ut = () => {
|
|
227
|
+
const [t, c] = p([]), [i, d] = p(!1), [m, u] = p("");
|
|
228
|
+
G(() => {
|
|
229
|
+
y();
|
|
230
|
+
}, []);
|
|
231
|
+
const y = async () => {
|
|
232
|
+
d(!0), u("");
|
|
233
|
+
try {
|
|
234
|
+
const a = await Lt();
|
|
235
|
+
c(Array.isArray(a.data) ? a.data : []);
|
|
236
|
+
} catch (a) {
|
|
237
|
+
c([]), u(String((a == null ? void 0 : a.message) || a));
|
|
238
|
+
} finally {
|
|
239
|
+
d(!1);
|
|
240
|
+
}
|
|
241
|
+
}, h = async (a) => {
|
|
242
|
+
try {
|
|
243
|
+
await Gt(a), v.success(`${a} 已封锁(停止调度)`), y();
|
|
244
|
+
} catch {
|
|
245
|
+
v.error("封锁失败");
|
|
246
|
+
}
|
|
247
|
+
}, C = async (a) => {
|
|
248
|
+
try {
|
|
249
|
+
await qt(a), v.success(`${a} 已解封`), y();
|
|
250
|
+
} catch {
|
|
251
|
+
v.error("解封失败");
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
255
|
+
/* @__PURE__ */ e(x, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(w, { icon: /* @__PURE__ */ e(le, {}), onClick: y, loading: i, children: "刷新" }) }),
|
|
256
|
+
m && /* @__PURE__ */ e(
|
|
257
|
+
X,
|
|
258
|
+
{
|
|
259
|
+
type: "error",
|
|
260
|
+
showIcon: !0,
|
|
261
|
+
style: { marginBottom: 12 },
|
|
262
|
+
message: "节点列表读取失败",
|
|
263
|
+
description: m
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ e(
|
|
267
|
+
re,
|
|
268
|
+
{
|
|
269
|
+
columns: [
|
|
270
|
+
{
|
|
271
|
+
title: "名称",
|
|
272
|
+
dataIndex: "name",
|
|
273
|
+
key: "name",
|
|
274
|
+
render: (a) => /* @__PURE__ */ e("strong", { children: a })
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
title: "IP",
|
|
278
|
+
dataIndex: "ip",
|
|
279
|
+
key: "ip",
|
|
280
|
+
render: (a) => /* @__PURE__ */ e("code", { children: a })
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
title: "状态",
|
|
284
|
+
dataIndex: "status",
|
|
285
|
+
key: "status",
|
|
286
|
+
render: (a) => /* @__PURE__ */ e(we, { status: a === "Ready" ? "success" : "error", text: a })
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
title: "角色",
|
|
290
|
+
dataIndex: "roles",
|
|
291
|
+
key: "roles",
|
|
292
|
+
render: (a) => a ? /* @__PURE__ */ e(I, { color: "blue", children: a }) : /* @__PURE__ */ e(I, { children: "worker" })
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
title: "CPU",
|
|
296
|
+
key: "cpu",
|
|
297
|
+
render: (a, o) => {
|
|
298
|
+
var O, _;
|
|
299
|
+
const r = o.cpuCapacity > 0 ? (o.cpuAllocatable - o.cpuCapacity + o.cpuCapacity) / o.cpuCapacity * 100 : 0;
|
|
300
|
+
return /* @__PURE__ */ s("span", { children: [
|
|
301
|
+
((O = o.cpuAllocatable) == null ? void 0 : O.toFixed(1)) ?? 0,
|
|
302
|
+
" / ",
|
|
303
|
+
((_ = o.cpuCapacity) == null ? void 0 : _.toFixed(0)) ?? 0,
|
|
304
|
+
" cores",
|
|
305
|
+
/* @__PURE__ */ s(I, { color: r > 80 ? "error" : "success", style: { marginLeft: 4 }, children: [
|
|
306
|
+
r.toFixed(0),
|
|
307
|
+
"%"
|
|
308
|
+
] })
|
|
309
|
+
] });
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
title: "内存",
|
|
314
|
+
key: "mem",
|
|
315
|
+
render: (a, o) => {
|
|
316
|
+
var _;
|
|
317
|
+
const r = o.memCapacity - o.memAllocatable, O = o.memCapacity > 0 ? r / o.memCapacity * 100 : 0;
|
|
318
|
+
return /* @__PURE__ */ s("span", { children: [
|
|
319
|
+
(r == null ? void 0 : r.toFixed(1)) ?? 0,
|
|
320
|
+
" / ",
|
|
321
|
+
((_ = o.memCapacity) == null ? void 0 : _.toFixed(0)) ?? 0,
|
|
322
|
+
" GB",
|
|
323
|
+
/* @__PURE__ */ s(I, { color: O > 80 ? "error" : "success", style: { marginLeft: 4 }, children: [
|
|
324
|
+
O.toFixed(0),
|
|
325
|
+
"%"
|
|
326
|
+
] })
|
|
327
|
+
] });
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{ title: "OS", dataIndex: "osImage", key: "osImage", ellipsis: !0, width: 200 },
|
|
331
|
+
{ title: "运行时", dataIndex: "containerRuntime", key: "containerRuntime", width: 160 },
|
|
332
|
+
{ title: "存活", dataIndex: "age", key: "age", width: 80 },
|
|
333
|
+
{
|
|
334
|
+
title: "操作",
|
|
335
|
+
key: "action",
|
|
336
|
+
width: 150,
|
|
337
|
+
render: (a, o) => /* @__PURE__ */ s(x, { children: [
|
|
338
|
+
/* @__PURE__ */ e(K, { title: `封锁 ${o.name}?`, onConfirm: () => h(o.name), children: /* @__PURE__ */ e(w, { size: "small", icon: /* @__PURE__ */ e(Le, {}), children: "Cordon" }) }),
|
|
339
|
+
/* @__PURE__ */ e(K, { title: `解封 ${o.name}?`, onConfirm: () => C(o.name), children: /* @__PURE__ */ e(w, { size: "small", icon: /* @__PURE__ */ e(Ge, {}), children: "Uncordon" }) })
|
|
340
|
+
] })
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
dataSource: t,
|
|
344
|
+
rowKey: "name",
|
|
345
|
+
loading: i,
|
|
346
|
+
pagination: !1,
|
|
347
|
+
scroll: { x: 1400 },
|
|
348
|
+
size: "middle"
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
] });
|
|
352
|
+
}, Kt = ({
|
|
353
|
+
namespace: t,
|
|
354
|
+
podName: c,
|
|
355
|
+
tailLines: i = 200
|
|
356
|
+
}) => {
|
|
357
|
+
const [d, m] = p([]), [u, y] = p(!1), [h, C] = p(!1), k = H(null), a = H(null), o = H(!1);
|
|
358
|
+
G(() => (r(), () => {
|
|
359
|
+
var g;
|
|
360
|
+
(g = k.current) == null || g.close();
|
|
361
|
+
}), [t, c]), G(() => {
|
|
362
|
+
var g;
|
|
363
|
+
h || (g = a.current) == null || g.scrollIntoView({ behavior: "smooth" });
|
|
364
|
+
}, [d, h]);
|
|
365
|
+
const r = () => {
|
|
366
|
+
const g = window.location.protocol === "https:" ? "wss:" : "ws:", n = window.location.host, b = `${g}//${n}/z-team/ops/k8s/ws/logs?namespace=${t}&name=${c}&tailLines=${i}`, A = new WebSocket(b);
|
|
367
|
+
k.current = A, A.onopen = () => {
|
|
368
|
+
y(!0), v.success("日志流已连接");
|
|
369
|
+
}, A.onmessage = (T) => {
|
|
370
|
+
o.current || m(($) => [...$.slice(-1e3), T.data]);
|
|
371
|
+
}, A.onclose = () => {
|
|
372
|
+
y(!1);
|
|
373
|
+
}, A.onerror = () => {
|
|
374
|
+
y(!1), v.error("WebSocket 连接错误");
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
return /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
378
|
+
/* @__PURE__ */ s(x, { style: { marginBottom: 8 }, children: [
|
|
379
|
+
/* @__PURE__ */ e(I, { color: u ? "success" : "error", children: u ? "● 已连接" : "● 已断开" }),
|
|
380
|
+
/* @__PURE__ */ e(
|
|
381
|
+
w,
|
|
382
|
+
{
|
|
383
|
+
size: "small",
|
|
384
|
+
icon: h ? /* @__PURE__ */ e(qe, {}) : /* @__PURE__ */ e(Be, {}),
|
|
385
|
+
onClick: () => {
|
|
386
|
+
o.current = !o.current, C(o.current);
|
|
387
|
+
},
|
|
388
|
+
children: h ? "继续" : "暂停"
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
/* @__PURE__ */ e(w, { size: "small", icon: /* @__PURE__ */ e(xe, {}), onClick: () => {
|
|
392
|
+
m([]);
|
|
393
|
+
}, children: "清空" }),
|
|
394
|
+
/* @__PURE__ */ e(w, { size: "small", onClick: () => {
|
|
395
|
+
var g;
|
|
396
|
+
(g = k.current) == null || g.close(), m([]), r();
|
|
397
|
+
}, children: "重连" })
|
|
398
|
+
] }),
|
|
399
|
+
/* @__PURE__ */ s("div", { style: {
|
|
400
|
+
flex: 1,
|
|
401
|
+
background: "#1e1e1e",
|
|
402
|
+
borderRadius: 8,
|
|
403
|
+
padding: 12,
|
|
404
|
+
overflow: "auto",
|
|
405
|
+
fontFamily: 'Menlo, Monaco, "Courier New", monospace',
|
|
406
|
+
fontSize: 12,
|
|
407
|
+
lineHeight: 1.5,
|
|
408
|
+
color: "#d4d4d4"
|
|
409
|
+
}, children: [
|
|
410
|
+
d.map((g, n) => /* @__PURE__ */ e("div", { style: {
|
|
411
|
+
color: g.includes("ERROR") ? "#f44336" : g.includes("WARN") ? "#ff9800" : g.includes("INFO") ? "#4caf50" : "#d4d4d4",
|
|
412
|
+
whiteSpace: "pre-wrap",
|
|
413
|
+
wordBreak: "break-all"
|
|
414
|
+
}, children: g }, n)),
|
|
415
|
+
/* @__PURE__ */ e("div", { ref: a })
|
|
416
|
+
] })
|
|
417
|
+
] });
|
|
418
|
+
}, Wt = ({
|
|
419
|
+
namespace: t,
|
|
420
|
+
podName: c
|
|
421
|
+
}) => {
|
|
422
|
+
const [i, d] = p(!1), [m, u] = p(""), [y, h] = p("sh"), [C, k] = p([]), a = H(null), o = H(null), r = H(null);
|
|
423
|
+
G(() => (t && c && O(), () => {
|
|
424
|
+
var n;
|
|
425
|
+
return (n = a.current) == null ? void 0 : n.close();
|
|
426
|
+
}), [t, c]);
|
|
427
|
+
const O = () => {
|
|
428
|
+
const n = window.location.protocol === "https:" ? "wss:" : "ws:", b = window.location.host, A = `${n}//${b}/z-team/ops/k8s/ws/exec?namespace=${t}&name=${c}&command=${y}`, T = new WebSocket(A);
|
|
429
|
+
a.current = T, T.onopen = () => {
|
|
430
|
+
d(!0), k(($) => [...$, `Connected to ${t}/${c} (${y})`]), v.success("终端已连接");
|
|
431
|
+
}, T.onmessage = ($) => {
|
|
432
|
+
k((ee) => [...ee.slice(-500), $.data]), setTimeout(() => {
|
|
433
|
+
o.current && (o.current.scrollTop = o.current.scrollHeight);
|
|
434
|
+
}, 50);
|
|
435
|
+
}, T.onclose = () => {
|
|
436
|
+
d(!1), k(($) => [...$, `
|
|
437
|
+
--- 连接已关闭 ---`]);
|
|
438
|
+
}, T.onerror = () => {
|
|
439
|
+
d(!1), v.error("WebSocket 连接错误");
|
|
440
|
+
};
|
|
441
|
+
}, _ = () => {
|
|
442
|
+
!m.trim() || !a.current || (a.current.readyState === WebSocket.OPEN ? (a.current.send(m), k((n) => [...n, `$ ${m}`]), u("")) : v.warning("WebSocket 未连接"));
|
|
443
|
+
}, q = (n) => {
|
|
444
|
+
var b;
|
|
445
|
+
n.key === "Enter" && _(), n.key === "Tab" && (n.preventDefault(), ((b = a.current) == null ? void 0 : b.readyState) === WebSocket.OPEN && a.current.send(" "));
|
|
446
|
+
}, g = () => k([]);
|
|
447
|
+
return /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
448
|
+
/* @__PURE__ */ s(x, { style: { marginBottom: 8 }, children: [
|
|
449
|
+
/* @__PURE__ */ e(I, { color: i ? "success" : "error", children: i ? "● 已连接" : "● 已断开" }),
|
|
450
|
+
/* @__PURE__ */ e(
|
|
451
|
+
Se,
|
|
452
|
+
{
|
|
453
|
+
value: y,
|
|
454
|
+
onChange: h,
|
|
455
|
+
size: "small",
|
|
456
|
+
style: { width: 100 },
|
|
457
|
+
options: ["sh", "bash", "/bin/sh", "/bin/bash"].map((n) => ({ label: n, value: n }))
|
|
458
|
+
}
|
|
459
|
+
),
|
|
460
|
+
/* @__PURE__ */ e(w, { size: "small", onClick: g, icon: /* @__PURE__ */ e(xe, {}), children: "清空" }),
|
|
461
|
+
/* @__PURE__ */ e(w, { size: "small", onClick: () => {
|
|
462
|
+
var n;
|
|
463
|
+
(n = a.current) == null || n.close(), setTimeout(O, 200);
|
|
464
|
+
}, children: "重连" })
|
|
465
|
+
] }),
|
|
466
|
+
/* @__PURE__ */ s(
|
|
467
|
+
"div",
|
|
468
|
+
{
|
|
469
|
+
ref: o,
|
|
470
|
+
style: {
|
|
471
|
+
flex: 1,
|
|
472
|
+
background: "#1a1a2e",
|
|
473
|
+
borderRadius: 8,
|
|
474
|
+
padding: 12,
|
|
475
|
+
overflow: "auto",
|
|
476
|
+
fontFamily: '"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace',
|
|
477
|
+
fontSize: 13,
|
|
478
|
+
lineHeight: 1.6,
|
|
479
|
+
color: "#00ff88",
|
|
480
|
+
marginBottom: 8,
|
|
481
|
+
minHeight: 300,
|
|
482
|
+
border: "1px solid #333"
|
|
483
|
+
},
|
|
484
|
+
children: [
|
|
485
|
+
C.map((n, b) => /* @__PURE__ */ e("div", { style: {
|
|
486
|
+
whiteSpace: "pre-wrap",
|
|
487
|
+
wordBreak: "break-all",
|
|
488
|
+
color: n.startsWith("$ ") ? "#00bfff" : n.startsWith("---") ? "#666" : n.includes("Error") || n.includes("error") ? "#ff4444" : "#00ff88"
|
|
489
|
+
}, children: n }, b)),
|
|
490
|
+
/* @__PURE__ */ e("span", { ref: r, style: {
|
|
491
|
+
display: "inline-block",
|
|
492
|
+
width: 8,
|
|
493
|
+
height: 16,
|
|
494
|
+
background: "#00ff88",
|
|
495
|
+
animation: "blink 1s step-end infinite",
|
|
496
|
+
verticalAlign: "middle"
|
|
497
|
+
} })
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ s(x.Compact, { style: { width: "100%" }, children: [
|
|
502
|
+
/* @__PURE__ */ s("span", { style: {
|
|
503
|
+
background: "#333",
|
|
504
|
+
color: "#00ff88",
|
|
505
|
+
padding: "4px 10px",
|
|
506
|
+
borderRadius: "8px 0 0 8px",
|
|
507
|
+
fontFamily: "monospace",
|
|
508
|
+
fontSize: 13,
|
|
509
|
+
lineHeight: "22px",
|
|
510
|
+
borderRight: "1px solid #555"
|
|
511
|
+
}, children: [
|
|
512
|
+
"$ ",
|
|
513
|
+
t,
|
|
514
|
+
"/",
|
|
515
|
+
c
|
|
516
|
+
] }),
|
|
517
|
+
/* @__PURE__ */ e(
|
|
518
|
+
"input",
|
|
519
|
+
{
|
|
520
|
+
value: m,
|
|
521
|
+
onChange: (n) => u(n.target.value),
|
|
522
|
+
onKeyDown: q,
|
|
523
|
+
placeholder: "输入命令后按 Enter...",
|
|
524
|
+
disabled: !i,
|
|
525
|
+
style: {
|
|
526
|
+
flex: 1,
|
|
527
|
+
background: "#1a1a2e",
|
|
528
|
+
color: "#00ff88",
|
|
529
|
+
border: "1px solid #555",
|
|
530
|
+
borderLeft: "none",
|
|
531
|
+
borderRight: "none",
|
|
532
|
+
padding: "4px 10px",
|
|
533
|
+
fontFamily: "monospace",
|
|
534
|
+
fontSize: 13,
|
|
535
|
+
outline: "none"
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
/* @__PURE__ */ e(
|
|
540
|
+
w,
|
|
541
|
+
{
|
|
542
|
+
type: "primary",
|
|
543
|
+
icon: /* @__PURE__ */ e(Ie, {}),
|
|
544
|
+
onClick: _,
|
|
545
|
+
disabled: !i,
|
|
546
|
+
children: "发送"
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
] })
|
|
550
|
+
] });
|
|
551
|
+
}, jt = (t) => {
|
|
552
|
+
switch (t) {
|
|
553
|
+
case "Running":
|
|
554
|
+
return "success";
|
|
555
|
+
case "Pending":
|
|
556
|
+
return "warning";
|
|
557
|
+
case "Succeeded":
|
|
558
|
+
return "default";
|
|
559
|
+
case "Failed":
|
|
560
|
+
return "error";
|
|
561
|
+
default:
|
|
562
|
+
return "default";
|
|
563
|
+
}
|
|
564
|
+
}, Vt = () => {
|
|
565
|
+
const [t, c] = p([]), [i, d] = p(!1), [m, u] = p(""), [y, h] = p("*"), [C, k] = p([]), [a, o] = p(!1), [r, O] = p(null), [_, q] = p("logs"), [g, n] = p("");
|
|
566
|
+
G(() => {
|
|
567
|
+
b();
|
|
568
|
+
}, []), G(() => {
|
|
569
|
+
A();
|
|
570
|
+
}, [y]);
|
|
571
|
+
const b = async () => {
|
|
572
|
+
try {
|
|
573
|
+
const l = await Mt();
|
|
574
|
+
k(Array.isArray(l.data) ? ["*", ...l.data] : ["*"]);
|
|
575
|
+
} catch {
|
|
576
|
+
k(["*"]);
|
|
577
|
+
}
|
|
578
|
+
}, A = async () => {
|
|
579
|
+
d(!0), u("");
|
|
580
|
+
try {
|
|
581
|
+
const l = await Bt(y);
|
|
582
|
+
c(Array.isArray(l.data) ? l.data : []);
|
|
583
|
+
} catch (l) {
|
|
584
|
+
c([]), u(String((l == null ? void 0 : l.message) || l));
|
|
585
|
+
} finally {
|
|
586
|
+
d(!1);
|
|
587
|
+
}
|
|
588
|
+
}, T = async (l) => {
|
|
589
|
+
var R;
|
|
590
|
+
O(l), q("logs"), o(!0);
|
|
591
|
+
try {
|
|
592
|
+
const E = await Dt(l.namespace, l.name, 200);
|
|
593
|
+
n(((R = E == null ? void 0 : E.data) == null ? void 0 : R.logs) ?? "");
|
|
594
|
+
} catch (E) {
|
|
595
|
+
n(`加载日志失败:${String((E == null ? void 0 : E.message) || E)}`);
|
|
596
|
+
}
|
|
597
|
+
}, $ = async (l) => {
|
|
598
|
+
try {
|
|
599
|
+
await Ft(l.namespace, l.name), v.success(`${l.name} 已重启`), A();
|
|
600
|
+
} catch {
|
|
601
|
+
v.error("重启失败");
|
|
602
|
+
}
|
|
603
|
+
}, ee = async (l) => {
|
|
604
|
+
try {
|
|
605
|
+
await Ht(l.namespace, l.name), v.success(`${l.name} 已删除`), A();
|
|
606
|
+
} catch {
|
|
607
|
+
v.error("删除失败");
|
|
608
|
+
}
|
|
609
|
+
}, Ae = [
|
|
610
|
+
{
|
|
611
|
+
title: "名称",
|
|
612
|
+
dataIndex: "name",
|
|
613
|
+
key: "name",
|
|
614
|
+
render: (l, R) => /* @__PURE__ */ e("a", { onClick: () => T(R), children: l })
|
|
615
|
+
},
|
|
616
|
+
{ title: "命名空间", dataIndex: "namespace", key: "namespace", width: 120 },
|
|
617
|
+
{ title: "节点", dataIndex: "nodeName", key: "nodeName", width: 130 },
|
|
618
|
+
{ title: "IP", dataIndex: "ip", key: "ip", width: 120 },
|
|
619
|
+
{
|
|
620
|
+
title: "状态",
|
|
621
|
+
dataIndex: "status",
|
|
622
|
+
key: "status",
|
|
623
|
+
width: 100,
|
|
624
|
+
render: (l) => /* @__PURE__ */ e(we, { status: jt(l), text: l })
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
title: "就绪",
|
|
628
|
+
dataIndex: "ready",
|
|
629
|
+
key: "ready",
|
|
630
|
+
width: 70,
|
|
631
|
+
render: (l) => l ? /* @__PURE__ */ e(I, { color: "success", children: "✓" }) : /* @__PURE__ */ e(I, { color: "error", children: "✗" })
|
|
632
|
+
},
|
|
633
|
+
{ title: "重启", dataIndex: "restartCount", key: "restartCount", width: 70 },
|
|
634
|
+
{ title: "存活", dataIndex: "age", key: "age", width: 80 },
|
|
635
|
+
{
|
|
636
|
+
title: "操作",
|
|
637
|
+
key: "action",
|
|
638
|
+
width: 200,
|
|
639
|
+
render: (l, R) => /* @__PURE__ */ s(x, { children: [
|
|
640
|
+
/* @__PURE__ */ e(w, { size: "small", icon: /* @__PURE__ */ e(De, {}), onClick: () => T(R), children: "日志" }),
|
|
641
|
+
/* @__PURE__ */ e(K, { title: "确认重启此 Pod?", onConfirm: () => $(R), children: /* @__PURE__ */ e(w, { size: "small", type: "primary", ghost: !0, children: "重启" }) }),
|
|
642
|
+
/* @__PURE__ */ e(K, { title: "确认删除此 Pod?", onConfirm: () => ee(R), children: /* @__PURE__ */ e(w, { size: "small", danger: !0, icon: /* @__PURE__ */ e(Oe, {}), children: "删除" }) })
|
|
643
|
+
] })
|
|
644
|
+
}
|
|
645
|
+
];
|
|
646
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
647
|
+
/* @__PURE__ */ s(x, { style: { marginBottom: 16 }, children: [
|
|
648
|
+
/* @__PURE__ */ e("span", { children: "命名空间:" }),
|
|
649
|
+
/* @__PURE__ */ e(
|
|
650
|
+
Se,
|
|
651
|
+
{
|
|
652
|
+
value: y,
|
|
653
|
+
onChange: h,
|
|
654
|
+
style: { width: 200 },
|
|
655
|
+
options: C.map((l) => ({ label: l, value: l }))
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ e(w, { icon: /* @__PURE__ */ e(le, {}), onClick: A, loading: i, children: "刷新" })
|
|
659
|
+
] }),
|
|
660
|
+
m && /* @__PURE__ */ e(
|
|
661
|
+
X,
|
|
662
|
+
{
|
|
663
|
+
type: "error",
|
|
664
|
+
showIcon: !0,
|
|
665
|
+
style: { marginBottom: 12 },
|
|
666
|
+
message: "Pod 列表读取失败",
|
|
667
|
+
description: m
|
|
668
|
+
}
|
|
669
|
+
),
|
|
670
|
+
/* @__PURE__ */ e(
|
|
671
|
+
re,
|
|
672
|
+
{
|
|
673
|
+
columns: Ae,
|
|
674
|
+
dataSource: t,
|
|
675
|
+
rowKey: "name",
|
|
676
|
+
loading: i,
|
|
677
|
+
pagination: { pageSize: 20, showSizeChanger: !0, showTotal: (l) => `共 ${l} 个 Pod` },
|
|
678
|
+
scroll: { x: 1e3 },
|
|
679
|
+
size: "middle"
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ e(
|
|
683
|
+
$e,
|
|
684
|
+
{
|
|
685
|
+
title: r ? `${r.name} (${r.namespace})` : "",
|
|
686
|
+
placement: "right",
|
|
687
|
+
size: "large",
|
|
688
|
+
open: a,
|
|
689
|
+
onClose: () => o(!1),
|
|
690
|
+
children: /* @__PURE__ */ e(
|
|
691
|
+
Ne,
|
|
692
|
+
{
|
|
693
|
+
activeKey: _,
|
|
694
|
+
onChange: q,
|
|
695
|
+
items: [
|
|
696
|
+
{
|
|
697
|
+
key: "logs",
|
|
698
|
+
label: "实时日志",
|
|
699
|
+
children: r ? /* @__PURE__ */ e(
|
|
700
|
+
Kt,
|
|
701
|
+
{
|
|
702
|
+
namespace: r.namespace,
|
|
703
|
+
podName: r.name
|
|
704
|
+
}
|
|
705
|
+
) : null
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
key: "exec",
|
|
709
|
+
label: "终端",
|
|
710
|
+
children: /* @__PURE__ */ e("div", { style: { padding: 20 }, children: /* @__PURE__ */ e(
|
|
711
|
+
Wt,
|
|
712
|
+
{
|
|
713
|
+
namespace: (r == null ? void 0 : r.namespace) ?? "",
|
|
714
|
+
podName: (r == null ? void 0 : r.name) ?? ""
|
|
715
|
+
}
|
|
716
|
+
) })
|
|
717
|
+
}
|
|
718
|
+
]
|
|
719
|
+
}
|
|
720
|
+
)
|
|
721
|
+
}
|
|
722
|
+
)
|
|
723
|
+
] });
|
|
724
|
+
};
|
|
725
|
+
async function Y(t, c) {
|
|
726
|
+
return _e(`/hpa${t}`, c);
|
|
727
|
+
}
|
|
728
|
+
const Jt = () => {
|
|
729
|
+
const [t, c] = p([]), [i, d] = p(!1), [m, u] = p(""), [y, h] = p(!1), [C, k] = p(!1), [a] = L.useForm();
|
|
730
|
+
G(() => {
|
|
731
|
+
o();
|
|
732
|
+
}, []);
|
|
733
|
+
const o = async () => {
|
|
734
|
+
d(!0), u("");
|
|
735
|
+
try {
|
|
736
|
+
const n = await Y("/list?namespace=*");
|
|
737
|
+
c(Array.isArray(n.data) ? n.data : []);
|
|
738
|
+
} catch (n) {
|
|
739
|
+
c([]), u(String((n == null ? void 0 : n.message) || n));
|
|
740
|
+
} finally {
|
|
741
|
+
d(!1);
|
|
742
|
+
}
|
|
743
|
+
}, r = () => {
|
|
744
|
+
k(!1), a.resetFields(), a.setFieldsValue({ minReplicas: 1, maxReplicas: 10, cpuTarget: 80 }), h(!0);
|
|
745
|
+
}, O = (n) => {
|
|
746
|
+
k(!0), a.setFieldsValue({
|
|
747
|
+
name: n.name,
|
|
748
|
+
namespace: n.namespace,
|
|
749
|
+
deploymentName: n.scaleTargetRef,
|
|
750
|
+
minReplicas: n.minReplicas,
|
|
751
|
+
maxReplicas: n.maxReplicas,
|
|
752
|
+
cpuTarget: n.cpuTarget
|
|
753
|
+
}), h(!0);
|
|
754
|
+
}, _ = async () => {
|
|
755
|
+
try {
|
|
756
|
+
const n = await a.validateFields();
|
|
757
|
+
C ? (await Y("/update", {
|
|
758
|
+
method: "POST",
|
|
759
|
+
body: JSON.stringify({
|
|
760
|
+
namespace: n.namespace,
|
|
761
|
+
name: n.name,
|
|
762
|
+
minReplicas: n.minReplicas,
|
|
763
|
+
maxReplicas: n.maxReplicas
|
|
764
|
+
})
|
|
765
|
+
}), v.success("HPA 更新成功")) : (await Y("/create", {
|
|
766
|
+
method: "POST",
|
|
767
|
+
body: JSON.stringify(n)
|
|
768
|
+
}), v.success("HPA 创建成功")), h(!1), o();
|
|
769
|
+
} catch {
|
|
770
|
+
v.error("操作失败");
|
|
771
|
+
}
|
|
772
|
+
}, q = async (n) => {
|
|
773
|
+
try {
|
|
774
|
+
await Y(`/delete/${n.namespace}/${n.name}`, { method: "DELETE" }), v.success("HPA 已删除"), o();
|
|
775
|
+
} catch {
|
|
776
|
+
v.error("删除失败");
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
780
|
+
/* @__PURE__ */ s(x, { style: { marginBottom: 16 }, children: [
|
|
781
|
+
/* @__PURE__ */ e(w, { type: "primary", icon: /* @__PURE__ */ e(Fe, {}), onClick: r, children: "新建 HPA" }),
|
|
782
|
+
/* @__PURE__ */ e(w, { icon: /* @__PURE__ */ e(le, {}), onClick: o, loading: i, children: "刷新" })
|
|
783
|
+
] }),
|
|
784
|
+
m && /* @__PURE__ */ e(
|
|
785
|
+
X,
|
|
786
|
+
{
|
|
787
|
+
type: "error",
|
|
788
|
+
showIcon: !0,
|
|
789
|
+
style: { marginBottom: 12 },
|
|
790
|
+
message: "HPA 列表读取失败",
|
|
791
|
+
description: m
|
|
792
|
+
}
|
|
793
|
+
),
|
|
794
|
+
/* @__PURE__ */ e(
|
|
795
|
+
re,
|
|
796
|
+
{
|
|
797
|
+
columns: [
|
|
798
|
+
{ title: "名称", dataIndex: "name", key: "name", render: (n) => /* @__PURE__ */ e("strong", { children: n }) },
|
|
799
|
+
{ title: "命名空间", dataIndex: "namespace", key: "namespace" },
|
|
800
|
+
{ title: "目标 Deployment", dataIndex: "scaleTargetRef", key: "target" },
|
|
801
|
+
{
|
|
802
|
+
title: "副本范围",
|
|
803
|
+
key: "replicas",
|
|
804
|
+
render: (n, b) => /* @__PURE__ */ s("span", { children: [
|
|
805
|
+
b.minReplicas,
|
|
806
|
+
" ~ ",
|
|
807
|
+
b.maxReplicas,
|
|
808
|
+
" (当前: ",
|
|
809
|
+
b.currentReplicas ?? "-",
|
|
810
|
+
")"
|
|
811
|
+
] })
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
title: "CPU 目标",
|
|
815
|
+
dataIndex: "cpuTarget",
|
|
816
|
+
key: "cpuTarget",
|
|
817
|
+
render: (n) => n ? /* @__PURE__ */ s(I, { color: "blue", children: [
|
|
818
|
+
n,
|
|
819
|
+
"%"
|
|
820
|
+
] }) : "-"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
title: "期望副本",
|
|
824
|
+
dataIndex: "desiredReplicas",
|
|
825
|
+
key: "desired",
|
|
826
|
+
render: (n) => n ? /* @__PURE__ */ e(I, { color: "green", children: n }) : "-"
|
|
827
|
+
},
|
|
828
|
+
{ title: "存活", dataIndex: "age", key: "age" },
|
|
829
|
+
{
|
|
830
|
+
title: "操作",
|
|
831
|
+
key: "action",
|
|
832
|
+
width: 150,
|
|
833
|
+
render: (n, b) => /* @__PURE__ */ s(x, { children: [
|
|
834
|
+
/* @__PURE__ */ e(w, { size: "small", icon: /* @__PURE__ */ e(He, {}), onClick: () => O(b), children: "编辑" }),
|
|
835
|
+
/* @__PURE__ */ e(K, { title: `删除 HPA ${b.name}?`, onConfirm: () => q(b), children: /* @__PURE__ */ e(w, { size: "small", danger: !0, icon: /* @__PURE__ */ e(Oe, {}), children: "删除" }) })
|
|
836
|
+
] })
|
|
837
|
+
}
|
|
838
|
+
],
|
|
839
|
+
dataSource: t,
|
|
840
|
+
rowKey: "name",
|
|
841
|
+
loading: i,
|
|
842
|
+
pagination: { pageSize: 20 },
|
|
843
|
+
size: "middle"
|
|
844
|
+
}
|
|
845
|
+
),
|
|
846
|
+
/* @__PURE__ */ e(
|
|
847
|
+
Ee,
|
|
848
|
+
{
|
|
849
|
+
title: C ? "编辑 HPA" : "新建 HPA",
|
|
850
|
+
open: y,
|
|
851
|
+
onOk: _,
|
|
852
|
+
onCancel: () => h(!1),
|
|
853
|
+
children: /* @__PURE__ */ s(L, { form: a, layout: "vertical", children: [
|
|
854
|
+
/* @__PURE__ */ e(L.Item, { name: "namespace", label: "命名空间", rules: [{ required: !0 }], children: /* @__PURE__ */ e(te, { disabled: C }) }),
|
|
855
|
+
/* @__PURE__ */ e(L.Item, { name: "name", label: "HPA 名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(te, { disabled: C }) }),
|
|
856
|
+
/* @__PURE__ */ e(L.Item, { name: "deploymentName", label: "目标 Deployment", rules: [{ required: !0 }], children: /* @__PURE__ */ e(te, { disabled: C, placeholder: "namespace/deploymentName" }) }),
|
|
857
|
+
/* @__PURE__ */ s(x, { children: [
|
|
858
|
+
/* @__PURE__ */ e(L.Item, { name: "minReplicas", label: "最小副本", rules: [{ required: !0 }], children: /* @__PURE__ */ e(ne, { min: 0, max: 100 }) }),
|
|
859
|
+
/* @__PURE__ */ e(L.Item, { name: "maxReplicas", label: "最大副本", rules: [{ required: !0 }], children: /* @__PURE__ */ e(ne, { min: 1, max: 100 }) })
|
|
860
|
+
] }),
|
|
861
|
+
/* @__PURE__ */ e(L.Item, { name: "cpuTarget", label: "CPU 目标 (%)", children: /* @__PURE__ */ e(ne, { min: 1, max: 100 }) })
|
|
862
|
+
] })
|
|
863
|
+
}
|
|
864
|
+
)
|
|
865
|
+
] });
|
|
866
|
+
}, oe = [
|
|
867
|
+
{
|
|
868
|
+
title: "DevOps 运维",
|
|
869
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
870
|
+
items: [
|
|
871
|
+
{
|
|
872
|
+
key: "devops-dashboard",
|
|
873
|
+
label: "运维总览",
|
|
874
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
875
|
+
path: "/ops/devops/dashboard",
|
|
876
|
+
desc: "集群概览与资源统计"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
key: "devops-nodes",
|
|
880
|
+
label: "节点管理",
|
|
881
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
882
|
+
path: "/ops/devops/nodes",
|
|
883
|
+
desc: "K8s 节点列表与状态"
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
key: "devops-pods",
|
|
887
|
+
label: "Pod 管理",
|
|
888
|
+
icon: /* @__PURE__ */ e(Ce, {}),
|
|
889
|
+
path: "/ops/devops/pods",
|
|
890
|
+
desc: "Pod 列表、日志、终端"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
key: "devops-hpa",
|
|
894
|
+
label: "弹性伸缩",
|
|
895
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
896
|
+
path: "/ops/devops/hpa",
|
|
897
|
+
desc: "HPA 自动扩缩容策略"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
key: "devops-registry",
|
|
901
|
+
label: "镜像仓库",
|
|
902
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
903
|
+
path: "/ops/devops/registry",
|
|
904
|
+
desc: "容器镜像统一管理"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
key: "devops-pipeline",
|
|
908
|
+
label: "流水线",
|
|
909
|
+
icon: /* @__PURE__ */ e(de, {}),
|
|
910
|
+
path: "/ops/devops/pipeline",
|
|
911
|
+
desc: "CI/CD 流水线编排"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
key: "devops-release",
|
|
915
|
+
label: "发布管理",
|
|
916
|
+
icon: /* @__PURE__ */ e(Ke, {}),
|
|
917
|
+
path: "/ops/devops/release",
|
|
918
|
+
desc: "应用发布与回滚"
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
key: "devops-monitor",
|
|
922
|
+
label: "监控告警",
|
|
923
|
+
icon: /* @__PURE__ */ e(We, {}),
|
|
924
|
+
path: "/ops/devops/monitor",
|
|
925
|
+
desc: "Prometheus/Grafana 监控"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
key: "devops-logs",
|
|
929
|
+
label: "日志管理",
|
|
930
|
+
icon: /* @__PURE__ */ e(ae, {}),
|
|
931
|
+
path: "/ops/devops/logs",
|
|
932
|
+
desc: "Loki 集中日志查询"
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
key: "devops-dba",
|
|
936
|
+
label: "DBA 工单",
|
|
937
|
+
icon: /* @__PURE__ */ e(V, {}),
|
|
938
|
+
path: "/ops/devops/dba",
|
|
939
|
+
desc: "数据库运维工单"
|
|
940
|
+
}
|
|
941
|
+
]
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
title: "基础设施",
|
|
945
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
946
|
+
items: [
|
|
947
|
+
{
|
|
948
|
+
key: "ops-channel",
|
|
949
|
+
label: "渠道管理",
|
|
950
|
+
icon: /* @__PURE__ */ e(je, {}),
|
|
951
|
+
path: "/ops/channel",
|
|
952
|
+
desc: "部署渠道配置与管理"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
key: "ops-env",
|
|
956
|
+
label: "环境管理",
|
|
957
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
958
|
+
path: "/ops/delivery",
|
|
959
|
+
desc: "运行环境配置与管理"
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
key: "ops-deploy",
|
|
963
|
+
label: "部署管理",
|
|
964
|
+
icon: /* @__PURE__ */ e(pe, {}),
|
|
965
|
+
path: "/ops/deployment",
|
|
966
|
+
desc: "应用部署与发布管理"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
key: "ops-repo",
|
|
970
|
+
label: "仓库管理",
|
|
971
|
+
icon: /* @__PURE__ */ e(V, {}),
|
|
972
|
+
path: "/ops/repo-mgmt",
|
|
973
|
+
desc: "代码仓库与镜像管理"
|
|
974
|
+
}
|
|
975
|
+
]
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
title: "配置中心",
|
|
979
|
+
icon: /* @__PURE__ */ e(me, {}),
|
|
980
|
+
items: [
|
|
981
|
+
{
|
|
982
|
+
key: "config-list",
|
|
983
|
+
label: "配置列表",
|
|
984
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
985
|
+
path: "/config/list",
|
|
986
|
+
desc: "集中配置项的查询、编辑与发布"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
key: "config-history",
|
|
990
|
+
label: "变更历史",
|
|
991
|
+
icon: /* @__PURE__ */ e(Ve, {}),
|
|
992
|
+
path: "/config/history",
|
|
993
|
+
desc: "配置变更记录与版本回溯"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
key: "config-service",
|
|
997
|
+
label: "服务列表",
|
|
998
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
999
|
+
path: "/config/service",
|
|
1000
|
+
desc: "接入配置的客户端服务管理"
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
key: "config-cluster",
|
|
1004
|
+
label: "集群概览",
|
|
1005
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1006
|
+
path: "/config/cluster",
|
|
1007
|
+
desc: "配置中心集群节点与状态总览"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
key: "config-namespace",
|
|
1011
|
+
label: "命名空间 / 灰度",
|
|
1012
|
+
icon: /* @__PURE__ */ e(Je, {}),
|
|
1013
|
+
path: "/config/namespace",
|
|
1014
|
+
desc: "命名空间与灰度发布(孵化中)"
|
|
1015
|
+
}
|
|
1016
|
+
]
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
title: "密钥中心",
|
|
1020
|
+
icon: /* @__PURE__ */ e(Z, {}),
|
|
1021
|
+
items: [
|
|
1022
|
+
{
|
|
1023
|
+
key: "mist-secret",
|
|
1024
|
+
label: "密钥管理",
|
|
1025
|
+
icon: /* @__PURE__ */ e(Z, {}),
|
|
1026
|
+
path: "/mist/secret",
|
|
1027
|
+
desc: "z-mist 密钥台账(只读孵化)"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
key: "mist-app",
|
|
1031
|
+
label: "应用接入",
|
|
1032
|
+
icon: /* @__PURE__ */ e(se, {}),
|
|
1033
|
+
path: "/mist/app",
|
|
1034
|
+
desc: "接入应用与 appSecret 台账"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
key: "mist-acl",
|
|
1038
|
+
label: "密钥授权",
|
|
1039
|
+
icon: /* @__PURE__ */ e(Ze, {}),
|
|
1040
|
+
path: "/mist/acl",
|
|
1041
|
+
desc: "哪个应用能读哪个密钥 + 在线校验"
|
|
1042
|
+
}
|
|
1043
|
+
]
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
title: "元数据中心",
|
|
1047
|
+
icon: /* @__PURE__ */ e(ye, {}),
|
|
1048
|
+
items: [
|
|
1049
|
+
{
|
|
1050
|
+
key: "meta-app",
|
|
1051
|
+
label: "应用元数据",
|
|
1052
|
+
icon: /* @__PURE__ */ e(se, {}),
|
|
1053
|
+
path: "/meta/app",
|
|
1054
|
+
desc: "z-meta 应用台账"
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
key: "meta-tenant",
|
|
1058
|
+
label: "租户管理",
|
|
1059
|
+
icon: /* @__PURE__ */ e(Qe, {}),
|
|
1060
|
+
path: "/meta/tenant",
|
|
1061
|
+
desc: "z-meta 租户台账"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
key: "meta-dict",
|
|
1065
|
+
label: "数据字典",
|
|
1066
|
+
icon: /* @__PURE__ */ e(ue, {}),
|
|
1067
|
+
path: "/meta/dict",
|
|
1068
|
+
desc: "字典类型与字典项"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
key: "meta-interface",
|
|
1072
|
+
label: "接口台账",
|
|
1073
|
+
icon: /* @__PURE__ */ e(he, {}),
|
|
1074
|
+
path: "/meta/interface",
|
|
1075
|
+
desc: "登记在册的业务接口"
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
key: "meta-private-config",
|
|
1079
|
+
label: "私有配置",
|
|
1080
|
+
icon: /* @__PURE__ */ e(me, {}),
|
|
1081
|
+
path: "/meta/private-config",
|
|
1082
|
+
desc: "应用私有键值配置"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
key: "meta-models",
|
|
1086
|
+
label: "业务模型",
|
|
1087
|
+
icon: /* @__PURE__ */ e(ce, {}),
|
|
1088
|
+
path: "/meta/models",
|
|
1089
|
+
desc: "结构化业务模型与字段"
|
|
1090
|
+
}
|
|
1091
|
+
]
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
title: "消息中心",
|
|
1095
|
+
icon: /* @__PURE__ */ e(Ie, {}),
|
|
1096
|
+
items: [
|
|
1097
|
+
{
|
|
1098
|
+
key: "msg-inbox",
|
|
1099
|
+
label: "站内信",
|
|
1100
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
1101
|
+
path: "/msg/inbox",
|
|
1102
|
+
desc: "当前用户的收件箱"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
key: "msg-template",
|
|
1106
|
+
label: "消息模板",
|
|
1107
|
+
icon: /* @__PURE__ */ e(ue, {}),
|
|
1108
|
+
path: "/msg/template",
|
|
1109
|
+
desc: "按渠道/业务类型维护模板"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
key: "msg-delivery",
|
|
1113
|
+
label: "投递日志",
|
|
1114
|
+
icon: /* @__PURE__ */ e(ae, {}),
|
|
1115
|
+
path: "/msg/delivery",
|
|
1116
|
+
desc: "投递结果、失败原因与统计"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
key: "msg-batch",
|
|
1120
|
+
label: "批量任务",
|
|
1121
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
1122
|
+
path: "/msg/batch",
|
|
1123
|
+
desc: "批量发送进度与成败"
|
|
1124
|
+
}
|
|
1125
|
+
]
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
title: "服务注册",
|
|
1129
|
+
icon: /* @__PURE__ */ e(Ye, {}),
|
|
1130
|
+
items: [
|
|
1131
|
+
{
|
|
1132
|
+
key: "rpc-service",
|
|
1133
|
+
label: "服务列表",
|
|
1134
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
1135
|
+
path: "/rpc/service",
|
|
1136
|
+
desc: "RPC 注册表(z-rpc 视角 / z-config naming 数据源)"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
key: "rpc-instance",
|
|
1140
|
+
label: "服务实例",
|
|
1141
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1142
|
+
path: "/rpc/instance",
|
|
1143
|
+
desc: "按服务名展开实例与健康状态"
|
|
1144
|
+
}
|
|
1145
|
+
]
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
title: "向量检索",
|
|
1149
|
+
icon: /* @__PURE__ */ e(V, {}),
|
|
1150
|
+
items: [
|
|
1151
|
+
{
|
|
1152
|
+
key: "vector-collection",
|
|
1153
|
+
label: "向量集合",
|
|
1154
|
+
icon: /* @__PURE__ */ e(be, {}),
|
|
1155
|
+
path: "/vector/collections",
|
|
1156
|
+
desc: "z-vector 集合台账:维度 / 度量 / 索引 / 向量数"
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
key: "vector-search",
|
|
1160
|
+
label: "向量检索",
|
|
1161
|
+
icon: /* @__PURE__ */ e(ke, {}),
|
|
1162
|
+
path: "/vector/search",
|
|
1163
|
+
desc: "top-k ANN 查询,渲染后端给的命中距离"
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
key: "vector-instance",
|
|
1167
|
+
label: "实例与端口",
|
|
1168
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1169
|
+
path: "/vector/instance",
|
|
1170
|
+
desc: "内嵌 Qdrant REST 服务的 bind 状态(区分「没起」和「没数据」)"
|
|
1171
|
+
}
|
|
1172
|
+
]
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
title: "图数据库",
|
|
1176
|
+
icon: /* @__PURE__ */ e(ye, {}),
|
|
1177
|
+
items: [
|
|
1178
|
+
{
|
|
1179
|
+
key: "graph-schema",
|
|
1180
|
+
label: "图 Schema",
|
|
1181
|
+
icon: /* @__PURE__ */ e(be, {}),
|
|
1182
|
+
path: "/graph/schema",
|
|
1183
|
+
desc: "z-graph 点类型 / 边类型 / 属性索引(/api/graph/meta/schema)"
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
key: "graph-query",
|
|
1187
|
+
label: "图查询",
|
|
1188
|
+
icon: /* @__PURE__ */ e(Xe, {}),
|
|
1189
|
+
path: "/graph/query",
|
|
1190
|
+
desc: "Cypher 执行 + 执行计划,写语句二次确认(/api/graph/query)"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
key: "graph-branches",
|
|
1194
|
+
label: "分支与提交",
|
|
1195
|
+
icon: /* @__PURE__ */ e(de, {}),
|
|
1196
|
+
path: "/graph/branches",
|
|
1197
|
+
desc: "Git 式版本面:分支 head 与全量 commit 图(/api/graph/meta/{branches,commits})"
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
key: "graph-instance",
|
|
1201
|
+
label: "实例与端口",
|
|
1202
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1203
|
+
path: "/graph/instance",
|
|
1204
|
+
desc: "内嵌 GraphControlServer 的 bind 状态 + 外来监听者判定(区分「没起」和「没数据」)"
|
|
1205
|
+
}
|
|
1206
|
+
]
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
title: "网关",
|
|
1210
|
+
icon: /* @__PURE__ */ e(he, {}),
|
|
1211
|
+
items: [
|
|
1212
|
+
{
|
|
1213
|
+
key: "gw-routes",
|
|
1214
|
+
label: "网关路由",
|
|
1215
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
1216
|
+
path: "/gw/routes",
|
|
1217
|
+
desc: "z-gw 在线路由表:谓词 / 过滤器 / order / 启停"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
key: "gw-metrics",
|
|
1221
|
+
label: "网关指标",
|
|
1222
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1223
|
+
path: "/gw/metrics",
|
|
1224
|
+
desc: "zgw.* 请求计数与平均 RT(附 micrometer 桥自证)"
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
key: "gw-instance",
|
|
1228
|
+
label: "实例与面",
|
|
1229
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1230
|
+
path: "/gw/instance",
|
|
1231
|
+
desc: "admin 面接没接通 / Netty 9090 通不通 / 指标桥看不看得见"
|
|
1232
|
+
}
|
|
1233
|
+
]
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
title: "缓存",
|
|
1237
|
+
icon: /* @__PURE__ */ e(V, {}),
|
|
1238
|
+
items: [
|
|
1239
|
+
{
|
|
1240
|
+
key: "cache-overview",
|
|
1241
|
+
label: "缓存总览",
|
|
1242
|
+
icon: /* @__PURE__ */ e(se, {}),
|
|
1243
|
+
path: "/cache/overview",
|
|
1244
|
+
desc: "z-cache 双路对账:进程内 MemoryStore ∥ zCacheClient,分歧即警报"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
key: "cache-keys",
|
|
1248
|
+
label: "键浏览",
|
|
1249
|
+
icon: /* @__PURE__ */ e(ke, {}),
|
|
1250
|
+
path: "/cache/keys",
|
|
1251
|
+
desc: "只读 SCAN/KEYS + TTL;命令名不接受外部输入(无 FLUSHALL 类按钮)"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
key: "cache-stats",
|
|
1255
|
+
label: "命中率与热键",
|
|
1256
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1257
|
+
path: "/cache/stats",
|
|
1258
|
+
desc: "hits/misses/evictions + accessCount/lfuCounter 热键视图"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
key: "cache-instance",
|
|
1262
|
+
label: "实例与端口",
|
|
1263
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1264
|
+
path: "/cache/instance",
|
|
1265
|
+
desc: "内嵌 RedisServer bind 上了没 / 6379 上应答的是谁"
|
|
1266
|
+
}
|
|
1267
|
+
]
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
title: "消息队列",
|
|
1271
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
1272
|
+
items: [
|
|
1273
|
+
{
|
|
1274
|
+
key: "mq-instance",
|
|
1275
|
+
label: "实例与端口",
|
|
1276
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1277
|
+
path: "/mq/instance",
|
|
1278
|
+
desc: "子进程活着 ≠ 端口归它:z-mq 内嵌是 spawn,归属按子进程 PID 判"
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
key: "mq-cluster",
|
|
1282
|
+
label: "集群与 Broker",
|
|
1283
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
1284
|
+
path: "/mq/cluster",
|
|
1285
|
+
desc: "NameServer 码 4 brokerAddrTable(记的是「谁发过心跳」,不是「谁在跑」)"
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
key: "mq-topics",
|
|
1289
|
+
label: "Topic 列表",
|
|
1290
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
1291
|
+
path: "/mq/topics",
|
|
1292
|
+
desc: "NameServer 码 8 ∥ Broker 码 8 并排 + 按需码 3 路由详情"
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
key: "mq-broker",
|
|
1296
|
+
label: "Broker 元数据",
|
|
1297
|
+
icon: /* @__PURE__ */ e(pe, {}),
|
|
1298
|
+
path: "/mq/broker",
|
|
1299
|
+
desc: "码 320/321/322/323/324;上游 MVP 恒空的那几格挂原文不挂假表"
|
|
1300
|
+
}
|
|
1301
|
+
]
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
title: "知识库",
|
|
1305
|
+
icon: /* @__PURE__ */ e(Q, {}),
|
|
1306
|
+
items: [
|
|
1307
|
+
{
|
|
1308
|
+
key: "kb-workspace",
|
|
1309
|
+
label: "工作空间",
|
|
1310
|
+
icon: /* @__PURE__ */ e(Q, {}),
|
|
1311
|
+
path: "/kb/workspaces",
|
|
1312
|
+
desc: "知识库工作空间管理"
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
key: "kb-documents",
|
|
1316
|
+
label: "文档管理",
|
|
1317
|
+
icon: /* @__PURE__ */ e(Q, {}),
|
|
1318
|
+
path: "/kb/documents",
|
|
1319
|
+
desc: "知识库文档列表与管理"
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
key: "kb-search",
|
|
1323
|
+
label: "知识搜索",
|
|
1324
|
+
icon: /* @__PURE__ */ e(Q, {}),
|
|
1325
|
+
path: "/kb/search",
|
|
1326
|
+
desc: "统一知识搜索"
|
|
1327
|
+
}
|
|
1328
|
+
]
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
title: "对象存储",
|
|
1332
|
+
icon: /* @__PURE__ */ e(ce, {}),
|
|
1333
|
+
items: [
|
|
1334
|
+
{
|
|
1335
|
+
key: "oss-buckets",
|
|
1336
|
+
label: "Bucket 列表",
|
|
1337
|
+
icon: /* @__PURE__ */ e(ce, {}),
|
|
1338
|
+
path: "/oss/buckets",
|
|
1339
|
+
desc: "GET /api/oss-admin/buckets · z-oss IOssBucketService#listUserBuckets(只读)"
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
key: "oss-objects",
|
|
1343
|
+
label: "对象浏览",
|
|
1344
|
+
icon: /* @__PURE__ */ e(ae, {}),
|
|
1345
|
+
path: "/oss/objects",
|
|
1346
|
+
desc: "对象数/总大小来自 IOssObjectService,physicalExists 来自 IOssBucketService,两栏分开显示"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
key: "oss-account",
|
|
1350
|
+
label: "访问身份",
|
|
1351
|
+
icon: /* @__PURE__ */ e(Z, {}),
|
|
1352
|
+
path: "/oss/account",
|
|
1353
|
+
desc: "平台账号 → z_oss_user 映射;未开户显式报 409,不退化成空表"
|
|
1354
|
+
}
|
|
1355
|
+
]
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
title: "脚本中心",
|
|
1359
|
+
icon: /* @__PURE__ */ e(at, {}),
|
|
1360
|
+
items: [
|
|
1361
|
+
{
|
|
1362
|
+
key: "script-keys",
|
|
1363
|
+
label: "API Key 台账",
|
|
1364
|
+
icon: /* @__PURE__ */ e(Z, {}),
|
|
1365
|
+
path: "/script/keys",
|
|
1366
|
+
desc: "GET /api/script/api-key/page · 刻意不渲染 api_key / api_secret_hash 两列(见 TASK-20260925-031)"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
key: "script-monitor",
|
|
1370
|
+
label: "调用监控",
|
|
1371
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1372
|
+
path: "/script/monitor",
|
|
1373
|
+
desc: "GET /api/script/invoke-log/page + /stats/trend · 实测 124 行日志 / 7 天趋势"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
key: "script-quota",
|
|
1377
|
+
label: "配额与用量",
|
|
1378
|
+
icon: /* @__PURE__ */ e(et, {}),
|
|
1379
|
+
path: "/script/quota",
|
|
1380
|
+
desc: "GET /api/script/quota/by-api-key/{id} · 日用量进度条(配额值是字符串,已 Number())"
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
key: "script-version",
|
|
1384
|
+
label: "脚本版本",
|
|
1385
|
+
icon: /* @__PURE__ */ e(tt, {}),
|
|
1386
|
+
path: "/script/version",
|
|
1387
|
+
desc: "GET /api/script/version/list/{scriptId} · 按脚本主表 ID 查,状态是字符串枚举"
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
key: "script-tag",
|
|
1391
|
+
label: "标签治理",
|
|
1392
|
+
icon: /* @__PURE__ */ e(nt, {}),
|
|
1393
|
+
path: "/script/tag",
|
|
1394
|
+
desc: "GET /api/script/tag/list · 3 条标签,颜色取 tag_color(回退 color)"
|
|
1395
|
+
}
|
|
1396
|
+
]
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
title: "资源管理",
|
|
1400
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1401
|
+
items: [
|
|
1402
|
+
{
|
|
1403
|
+
key: "resource",
|
|
1404
|
+
label: "资源管理",
|
|
1405
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
1406
|
+
path: "/resource/domain",
|
|
1407
|
+
desc: "域名、ECS、RDS、OSS 管理"
|
|
1408
|
+
}
|
|
1409
|
+
]
|
|
1410
|
+
}
|
|
1411
|
+
];
|
|
1412
|
+
function Zt() {
|
|
1413
|
+
return /* @__PURE__ */ s("div", { className: f.empty, children: [
|
|
1414
|
+
/* @__PURE__ */ e("div", { className: f.emptyIcon, children: "⚙️" }),
|
|
1415
|
+
/* @__PURE__ */ e("div", { className: f.emptyText, children: "请从左侧菜单选择运维模块" })
|
|
1416
|
+
] });
|
|
1417
|
+
}
|
|
1418
|
+
function F({ label: t }) {
|
|
1419
|
+
return /* @__PURE__ */ s("div", { style: { padding: 40, textAlign: "center", color: "#999" }, children: [
|
|
1420
|
+
/* @__PURE__ */ s("h2", { children: [
|
|
1421
|
+
"🚧 ",
|
|
1422
|
+
t
|
|
1423
|
+
] }),
|
|
1424
|
+
/* @__PURE__ */ e("p", { children: "功能开发中..." })
|
|
1425
|
+
] });
|
|
1426
|
+
}
|
|
1427
|
+
function Qt({ label: t, reason: c }) {
|
|
1428
|
+
return /* @__PURE__ */ s("div", { style: { padding: 40, textAlign: "center", color: "#999" }, children: [
|
|
1429
|
+
/* @__PURE__ */ s("h2", { children: [
|
|
1430
|
+
"🧪 ",
|
|
1431
|
+
t
|
|
1432
|
+
] }),
|
|
1433
|
+
/* @__PURE__ */ e("p", { style: { maxWidth: 760, margin: "0 auto", textAlign: "left", lineHeight: 1.7 }, children: c || "功能孵化中..." })
|
|
1434
|
+
] });
|
|
1435
|
+
}
|
|
1436
|
+
function Yt({ label: t, reason: c, message: i = "该页面未孵化,因为后端接口尚不可用" }) {
|
|
1437
|
+
return /* @__PURE__ */ s("div", { style: { padding: 40, maxWidth: 720, margin: "0 auto" }, children: [
|
|
1438
|
+
/* @__PURE__ */ s("h2", { style: { textAlign: "center" }, children: [
|
|
1439
|
+
"🧪 ",
|
|
1440
|
+
t
|
|
1441
|
+
] }),
|
|
1442
|
+
/* @__PURE__ */ e(
|
|
1443
|
+
X,
|
|
1444
|
+
{
|
|
1445
|
+
type: "warning",
|
|
1446
|
+
showIcon: !0,
|
|
1447
|
+
message: i,
|
|
1448
|
+
description: c
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1451
|
+
] });
|
|
1452
|
+
}
|
|
1453
|
+
function z({ label: t }) {
|
|
1454
|
+
return /* @__PURE__ */ e(
|
|
1455
|
+
Yt,
|
|
1456
|
+
{
|
|
1457
|
+
label: t,
|
|
1458
|
+
message: "该页面未孵化,因为组件从来不在本仓",
|
|
1459
|
+
reason: "组件从未迁进本仓:z-opc 的 src 目录下没有这个组件,历史上也没有任何提交 import 过它(OPS_ROUTES 里留着一个解析不到的标识符)。要恢复这一页,得先把组件从 z-ops 迁进来并接上它自己的后端;在那之前这里刻意不放假表格。"
|
|
1460
|
+
}
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
const ve = [
|
|
1464
|
+
// ─── 运维中心 ───
|
|
1465
|
+
// ⚠ 这一族路由的组件从来没有从 z-ops 迁进来(见 UnmigratedPage 注释)。原先直接写
|
|
1466
|
+
// <ChannelPage/> 之类会在**模块求值期**抛 ReferenceError 并白屏整个前端,不是只坏这一页。
|
|
1467
|
+
{ path: "/ops", element: /* @__PURE__ */ e(S, { to: "/ops/devops", replace: !0 }) },
|
|
1468
|
+
{ path: "/ops/channel", element: /* @__PURE__ */ e(z, { label: "渠道管理" }) },
|
|
1469
|
+
{ path: "/ops/delivery", element: /* @__PURE__ */ e(z, { label: "环境管理" }) },
|
|
1470
|
+
{ path: "/ops/deployment", element: /* @__PURE__ */ e(z, { label: "部署管理" }) },
|
|
1471
|
+
{ path: "/ops/deployment/:id", element: /* @__PURE__ */ e(z, { label: "部署管理" }) },
|
|
1472
|
+
{ path: "/ops/repo-mgmt", element: /* @__PURE__ */ e(z, { label: "仓库管理" }) },
|
|
1473
|
+
{ path: "/ops/git-platform", element: /* @__PURE__ */ e(z, { label: "仓库管理" }) },
|
|
1474
|
+
// ─── DevOps 子路由 (从 OpsK8s 直接渲染) ───
|
|
1475
|
+
{ path: "/ops/devops", element: /* @__PURE__ */ e(fe, {}) },
|
|
1476
|
+
{ path: "/ops/devops/dashboard", element: /* @__PURE__ */ e(fe, {}) },
|
|
1477
|
+
{ path: "/ops/devops/nodes", element: /* @__PURE__ */ e(Ut, {}) },
|
|
1478
|
+
{ path: "/ops/devops/pods", element: /* @__PURE__ */ e(Vt, {}) },
|
|
1479
|
+
{ path: "/ops/devops/hpa", element: /* @__PURE__ */ e(Jt, {}) },
|
|
1480
|
+
{ path: "/ops/devops/registry", element: /* @__PURE__ */ e(F, { label: "镜像仓库" }) },
|
|
1481
|
+
{ path: "/ops/devops/pipeline", element: /* @__PURE__ */ e(F, { label: "流水线" }) },
|
|
1482
|
+
{ path: "/ops/devops/release", element: /* @__PURE__ */ e(F, { label: "发布管理" }) },
|
|
1483
|
+
{ path: "/ops/devops/monitor", element: /* @__PURE__ */ e(F, { label: "监控告警" }) },
|
|
1484
|
+
{ path: "/ops/devops/logs", element: /* @__PURE__ */ e(F, { label: "日志管理" }) },
|
|
1485
|
+
{ path: "/ops/devops/dba", element: /* @__PURE__ */ e(F, { label: "DBA 工单" }) },
|
|
1486
|
+
// ─── 配置中心 ───
|
|
1487
|
+
// 精确条目在前 (菜单点击的精确 path, 优先命中以避免被通配覆盖)
|
|
1488
|
+
{ path: "/config", element: /* @__PURE__ */ e(S, { to: "/config/list", replace: !0 }) },
|
|
1489
|
+
// 配置中心 — 命名空间: 占位,但**理由是量出来的**(2026-10-22 复测,见 TASK-20260925-036):
|
|
1490
|
+
// ⚠️ 2026-10-22 之前这一格写的是"缺表 / 缺数据源",**那一版理由已作废**(实测反了),现况如下:
|
|
1491
|
+
// ① 数据源**已经有了**:GET /api/namespace/list 实测 200 ⇒ 1 行(namespace_id=DEFAULT_NAMESPACE);
|
|
1492
|
+
// 共享 oc 库里 z_namespace 等 8 张表 + z_config_info.encrypted_data_key 列都在
|
|
1493
|
+
// (z_namespace 的 information_schema create_time = 2026-10-03 23:02:14;
|
|
1494
|
+
// 2026-10-22 本卡把升级脚本的种子行也补齐了,见 TASK-20260925-036)。
|
|
1495
|
+
// ② 现在缺的不是数据,是**路由**:真正的命名空间页在 component 的 /z-config/namespace
|
|
1496
|
+
// (z-config-component/src/pages/namespace/NamespaceList.jsx);
|
|
1497
|
+
// 而 /config/* 这条链走的是 ConfigApp(z-config-component/src/pages/ConfigApp.jsx),
|
|
1498
|
+
// 它的 <Routes> 里**没有 namespace 这一条** ⇒ 这里只能占位。
|
|
1499
|
+
// 把占位换成真页面 = 给 ConfigApp 加一条 namespace 路由(z-config component 的路由改动,
|
|
1500
|
+
// 不在本卡授权范围,见该卡「交接」);另外那一页的列名还是 camelCase(namespaceId),
|
|
1501
|
+
// 而实测响应是 snake_case(namespace_id)⇒ 接真页面前要先修列名,否则又是一个恒空的假绿列。
|
|
1502
|
+
// ③ 灰度发布这一半仍然没有落点:L3 里灰度是 ZConfigTagRelation 那一族,
|
|
1503
|
+
// 而它就在「从未进制品」的那 9 个 controller 里。
|
|
1504
|
+
{
|
|
1505
|
+
path: "/config/namespace",
|
|
1506
|
+
element: /* @__PURE__ */ e(
|
|
1507
|
+
Qt,
|
|
1508
|
+
{
|
|
1509
|
+
label: "命名空间 / 灰度",
|
|
1510
|
+
reason: "缺的不是数据,是路由:命名空间的数据源已经有了 —— GET /api/namespace/list 实测 200 且有 1 行(共享 oc 库的 z_namespace 等 8 张表与 z_config_info.encrypted_data_key 列都在,z_namespace 的information_schema create_time = 2026-10-03 23:02:14;2026-10-22 又把升级脚本的种子行补齐,见 TASK-20260925-036)。真正的命名空间页在 component 的 /z-config/namespace,而 /config/* 走 ConfigApp(z-config-component/src/pages/ConfigApp.jsx),它的路由表里没有 namespace 这一条 ⇒ 这里只能占位;接真页面 = 给 ConfigApp 加一条 namespace 路由,详见 TASK-20260925-036。灰度发布这一半仍无落点:L3 里灰度是 ZConfigTagRelation 那一族,它就在「从未进制品」的那 9 个 controller 里。"
|
|
1511
|
+
}
|
|
1512
|
+
)
|
|
1513
|
+
},
|
|
1514
|
+
// 通配兜底: 其余 /config/* (list / history / service / cluster / edit / dashboard 等) 全部交给 ConfigApp 内部路由
|
|
1515
|
+
{ path: "/config/*", element: /* @__PURE__ */ e(st, {}) },
|
|
1516
|
+
// ─── 密钥中心 ───
|
|
1517
|
+
{ path: "/mist", element: /* @__PURE__ */ e(S, { to: "/mist/secret", replace: !0 }) },
|
|
1518
|
+
{ path: "/mist/*", element: /* @__PURE__ */ e(ct, {}) },
|
|
1519
|
+
// ─── 元数据中心 (z-meta) ───
|
|
1520
|
+
// 子模块自带相对路由 <Routes>, 由 /meta/* 通配把剩余路径交给它
|
|
1521
|
+
{ path: "/meta", element: /* @__PURE__ */ e(S, { to: "/meta/app", replace: !0 }) },
|
|
1522
|
+
{ path: "/meta/*", element: /* @__PURE__ */ e(ot, {}) },
|
|
1523
|
+
// ─── 消息中心 (z-msg) ───
|
|
1524
|
+
{ path: "/msg", element: /* @__PURE__ */ e(S, { to: "/msg/inbox", replace: !0 }) },
|
|
1525
|
+
{ path: "/msg/*", element: /* @__PURE__ */ e(rt, {}) },
|
|
1526
|
+
// ─── 服务注册 (z-rpc, 数据源是 z-config 的 naming) ───
|
|
1527
|
+
{ path: "/rpc", element: /* @__PURE__ */ e(S, { to: "/rpc/service", replace: !0 }) },
|
|
1528
|
+
{ path: "/rpc/*", element: /* @__PURE__ */ e(lt, {}) },
|
|
1529
|
+
// ─── 向量检索 (z-vector) ───
|
|
1530
|
+
// REST 面是内嵌 QdrantRestServer(非 Spring MVC),经 z-opc 的 /api/vector/** 代理出去
|
|
1531
|
+
{ path: "/vector", element: /* @__PURE__ */ e(S, { to: "/vector/collections", replace: !0 }) },
|
|
1532
|
+
{ path: "/vector/*", element: /* @__PURE__ */ e(it, {}) },
|
|
1533
|
+
// ─── 图数据库 (z-graph) ───
|
|
1534
|
+
// REST 面是内嵌 GraphControlServer(JDK HttpServer,非 Spring MVC),经 z-opc 的 /api/graph/** 代理出去
|
|
1535
|
+
// ⚠ 内嵌端口是 8091 不是 8090:8090 归一个外部进程,且被 BizKnowledgeGraphService 当业务依赖在用
|
|
1536
|
+
{ path: "/graph", element: /* @__PURE__ */ e(S, { to: "/graph/schema", replace: !0 }) },
|
|
1537
|
+
{ path: "/graph/*", element: /* @__PURE__ */ e(dt, {}) },
|
|
1538
|
+
// ─── 网关 (z-gw) ───
|
|
1539
|
+
// admin 面是 z-gw-admin 的原生 Spring MVC(pom 加 io.github.yuku123:z-gw-admin 后挂 /gw/admin/**,12 条 handler);
|
|
1540
|
+
// 页面不直连裸 /gw/admin(不在 sso.intercept-paths 内),一律走 z-opc 自己的环回代理 GET /api/gw/**
|
|
1541
|
+
{ path: "/gw", element: /* @__PURE__ */ e(S, { to: "/gw/routes", replace: !0 }) },
|
|
1542
|
+
{ path: "/gw/*", element: /* @__PURE__ */ e(pt, {}) },
|
|
1543
|
+
// ─── 缓存 (z-cache) ───
|
|
1544
|
+
// z-cache 只有 RESP over TCP(:6379),没有 HTTP 管理面 ⇒ /api/cache/** 不是转发器,
|
|
1545
|
+
// 是 CacheProxyController 在 JVM 内读 MemoryStore + 用现成 zCacheClient 发只读命令拼出来的结构化 JSON。
|
|
1546
|
+
{ path: "/cache", element: /* @__PURE__ */ e(S, { to: "/cache/overview", replace: !0 }) },
|
|
1547
|
+
{ path: "/cache/*", element: /* @__PURE__ */ e(mt, {}) },
|
|
1548
|
+
// ─── 消息队列 (z-mq) ───
|
|
1549
|
+
// :9877/:10912 是 z-mq-remoting 的 Netty 私有二进制协议(端口从 9876/10911 挪开,那两个被旧世代孤儿 JVM 占着)
|
|
1550
|
+
// ⇒ /api/mq/** 是「固定只读请求码 → JSON」的协议适配器,端点穷举,未列出的子路径一律 404 并回显可用清单
|
|
1551
|
+
{ path: "/mq", element: /* @__PURE__ */ e(S, { to: "/mq/instance", replace: !0 }) },
|
|
1552
|
+
{ path: "/mq/*", element: /* @__PURE__ */ e(ut, {}) },
|
|
1553
|
+
// ─── 知识库 (z-kb) — 主机侧确定性装配,接口真通(2026-09-25 实测) ───
|
|
1554
|
+
// 09-25 早先"页面在、/api/kb/** 全 404"的判断已被推翻:404 的根因是 z-kb 的自动装配清单错位
|
|
1555
|
+
// (4 条 .imports 路径不存在 + 2 份无 key 的 spring.factories + z-kb-web 压根没有登记),
|
|
1556
|
+
// 而不是"前端把 404 读成空列表"——src/kb/services/api.js 有自己的 fetch 包装,!res.ok 直接 throw,
|
|
1557
|
+
// 三个页面都渲染"接口错误:{message}"。
|
|
1558
|
+
// 现由 KbAssemblyConfig 在 host 侧 @Import 五个 AutoConfiguration + @ComponentScan controller,
|
|
1559
|
+
// 并用一个 BFPP 把 z-kb 的 @Bean 产物改名(避让别的模块按 @Resource 字段名注入到同名 bean 上)。
|
|
1560
|
+
// 实测:/kb/workspaces 1 行(314 篇/8746 实体/60479 关系)、/kb/documents 服务端分页 20 条 × 16 页、
|
|
1561
|
+
// /kb/search FUSION 10 命中 + GRAPH 4 命中;向量召回恒 0 是 L3 读写两侧集合名不一致(见 SearchPage 的告警条)。
|
|
1562
|
+
{ path: "/kb", element: /* @__PURE__ */ e(S, { to: "/kb/workspaces", replace: !0 }) },
|
|
1563
|
+
{ path: "/kb/*", element: /* @__PURE__ */ e(yt, {}) },
|
|
1564
|
+
// ─── 对象存储 (z-oss) — TASK-003: 走 z-opc 侧 /api/oss-admin/**,不再需要 AK/SK 下发 ───
|
|
1565
|
+
// z-oss 原生 /api/v1/** 的 AuthenticationInterceptor 要 X-Zoss-Access-Key/Secret-Key(实测带平台会话仍 401),
|
|
1566
|
+
// 浏览器侧没有凭证下发通道;OssAdminController 改为在同一 JVM 内直接调 IOssBucketService/IOssObjectService,
|
|
1567
|
+
// 鉴权用平台 SSO + username→z_oss_user 映射,且只有 @GetMapping(无写入口)。
|
|
1568
|
+
// 刻意不接 E2EAliasController 的 /api/oss/list(异常吞成空列表)与 /api/oss/{bucket}(硬编码 stub 零值)。
|
|
1569
|
+
{ path: "/oss", element: /* @__PURE__ */ e(S, { to: "/oss/buckets", replace: !0 }) },
|
|
1570
|
+
{ path: "/oss/*", element: /* @__PURE__ */ e(ht, {}) },
|
|
1571
|
+
// ─── 脚本中心 (z-script) ───
|
|
1572
|
+
// 组件自带 5 个 Tab,这里按"一个能力一条菜单"把 Tab 键透传成 initialTab,
|
|
1573
|
+
// 而不是给每个 Tab 复刻一份页面组件。
|
|
1574
|
+
// ⚠️ 只挂这 5 个 Tab:脚本清单页(System 面的 /script/manage)刻意不接进运维面 ——
|
|
1575
|
+
// 它的数据源 /api/script/list 在部署制品里被 z-script 自己的 ApiKeyAuthInterceptor 拦着,
|
|
1576
|
+
// 带平台会话也是 401,而共用 axios 拦截器把任何 401 当会话过期 ⇒ 一点进来就被踢到 /login。
|
|
1577
|
+
// 在那条链修好之前(TASK-20260925-032),把它放进菜单等于在运维面埋一个登出陷阱。
|
|
1578
|
+
{ path: "/script", element: /* @__PURE__ */ e(S, { to: "/script/monitor", replace: !0 }) },
|
|
1579
|
+
{ path: "/script/keys", element: /* @__PURE__ */ e(U, { initialTab: "apikey" }) },
|
|
1580
|
+
{ path: "/script/monitor", element: /* @__PURE__ */ e(U, { initialTab: "monitor" }) },
|
|
1581
|
+
{ path: "/script/quota", element: /* @__PURE__ */ e(U, { initialTab: "quota" }) },
|
|
1582
|
+
{ path: "/script/version", element: /* @__PURE__ */ e(U, { initialTab: "version" }) },
|
|
1583
|
+
{ path: "/script/tag", element: /* @__PURE__ */ e(U, { initialTab: "tag" }) },
|
|
1584
|
+
{ path: "/script/*", element: /* @__PURE__ */ e(S, { to: "/script/monitor", replace: !0 }) },
|
|
1585
|
+
// ─── 资源管理 ───
|
|
1586
|
+
{ path: "/resource", element: /* @__PURE__ */ e(S, { to: "/resource/domain", replace: !0 }) },
|
|
1587
|
+
{ path: "/resource/domain", element: /* @__PURE__ */ e(z, { label: "域名管理" }) },
|
|
1588
|
+
{ path: "/resource/ecs", element: /* @__PURE__ */ e(z, { label: "ECS 管理" }) },
|
|
1589
|
+
{ path: "/resource/rds", element: /* @__PURE__ */ e(z, { label: "RDS 管理" }) },
|
|
1590
|
+
{ path: "/resource/oss", element: /* @__PURE__ */ e(z, { label: "OSS 管理" }) }
|
|
1591
|
+
];
|
|
1592
|
+
function Xt(t) {
|
|
1593
|
+
for (const c of ve)
|
|
1594
|
+
if (c.path === t) return c.element;
|
|
1595
|
+
for (const c of ve)
|
|
1596
|
+
if (c.path.includes("*") || c.path.includes(":")) {
|
|
1597
|
+
const i = "^" + c.path.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, "[^/]+") + "$";
|
|
1598
|
+
if (new RegExp(i).test(t)) return c.element;
|
|
1599
|
+
}
|
|
1600
|
+
return /* @__PURE__ */ e(Zt, {});
|
|
1601
|
+
}
|
|
1602
|
+
function fn({
|
|
1603
|
+
activePathOverride: t,
|
|
1604
|
+
menuOnly: c = !1
|
|
1605
|
+
} = {}) {
|
|
1606
|
+
const i = Pe(), { pathname: d } = Te(), [m, u] = p(
|
|
1607
|
+
new Set(oe.map((a) => a.title))
|
|
1608
|
+
), y = ie(() => {
|
|
1609
|
+
const a = t ?? d;
|
|
1610
|
+
for (const o of oe)
|
|
1611
|
+
for (const r of o.items)
|
|
1612
|
+
if (r.path === a) return r.key;
|
|
1613
|
+
return null;
|
|
1614
|
+
}, [t, d]), h = (a) => {
|
|
1615
|
+
u((o) => {
|
|
1616
|
+
const r = new Set(o);
|
|
1617
|
+
return r.has(a) ? r.delete(a) : r.add(a), r;
|
|
1618
|
+
});
|
|
1619
|
+
}, C = (a) => {
|
|
1620
|
+
i(`${a.path}?mode=ops`);
|
|
1621
|
+
}, k = ie(() => Xt(d), [d]);
|
|
1622
|
+
return /* @__PURE__ */ s("div", { className: f.shell, children: [
|
|
1623
|
+
/* @__PURE__ */ e("aside", { className: f.sidebar, children: /* @__PURE__ */ e("nav", { className: f.menuList, children: oe.map((a) => {
|
|
1624
|
+
const o = m.has(a.title);
|
|
1625
|
+
return /* @__PURE__ */ s("div", { className: f.menuGroup, children: [
|
|
1626
|
+
/* @__PURE__ */ s(
|
|
1627
|
+
"div",
|
|
1628
|
+
{
|
|
1629
|
+
className: f.menuGroupHeader,
|
|
1630
|
+
onClick: () => h(a.title),
|
|
1631
|
+
children: [
|
|
1632
|
+
/* @__PURE__ */ e("span", { className: f.menuGroupIcon, children: a.icon }),
|
|
1633
|
+
/* @__PURE__ */ e("span", { className: f.menuGroupLabel, children: a.title }),
|
|
1634
|
+
/* @__PURE__ */ e("span", { className: f.menuGroupArrow, children: o ? /* @__PURE__ */ e(Me, {}) : /* @__PURE__ */ e(Ue, {}) })
|
|
1635
|
+
]
|
|
1636
|
+
}
|
|
1637
|
+
),
|
|
1638
|
+
o && /* @__PURE__ */ e("ul", { className: f.menuSubList, children: a.items.map((r) => /* @__PURE__ */ s(
|
|
1639
|
+
"li",
|
|
1640
|
+
{
|
|
1641
|
+
className: `${f.menuSubItemWrap} ${f.menuSubItem} ${y === r.key ? f.menuSubItemActive : ""}`,
|
|
1642
|
+
onClick: () => C(r),
|
|
1643
|
+
children: [
|
|
1644
|
+
/* @__PURE__ */ e("span", { className: f.menuSubItemIcon, children: r.icon }),
|
|
1645
|
+
/* @__PURE__ */ e("span", { className: f.menuSubItemLabel, children: r.label })
|
|
1646
|
+
]
|
|
1647
|
+
},
|
|
1648
|
+
r.key
|
|
1649
|
+
)) })
|
|
1650
|
+
] }, a.title);
|
|
1651
|
+
}) }) }),
|
|
1652
|
+
c ? null : /* @__PURE__ */ e("main", { className: f.main, children: k })
|
|
1653
|
+
] });
|
|
1654
|
+
}
|
|
1655
|
+
export {
|
|
1656
|
+
fn as default
|
|
1657
|
+
};
|