@yuku123/z-team-component 0.2.134 → 0.2.135
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/{AdminModuleContent-DjEqlai_.js → AdminModuleContent-DHCn4OpR.js} +5 -5
- package/dist/{ChangeLogView-BQCxD0g7.js → ChangeLogView-Cc5cYmcz.js} +1 -1
- package/dist/{ComponentDoc-C1yrRq6Y.js → ComponentDoc-BAUII4UZ.js} +3 -3
- package/dist/{InvitationManagementPage-Bbl_HXlG.js → InvitationManagementPage-BgY1jxQB.js} +1 -1
- package/dist/{OnboardingPage-BoYhlfWE.js → OnboardingPage-CckzpaI0.js} +2 -2
- package/dist/{ScheduledTasks-0FX6xhIs.js → ScheduledTasks-DZSEnuIF.js} +6 -6
- package/dist/{SystemShell-DNRHYsgT.js → SystemShell-DCRIL4Rh.js} +5 -5
- package/dist/{admin-logs-OZ3s7ssr.js → admin-logs-DEawvNOd.js} +1 -1
- package/dist/{api-B0ComkTL.js → api--xHkMnrY.js} +1 -1
- package/dist/{api-BgrPNvTB.js → api-B-nnjGsa.js} +1 -1
- package/dist/{createWorkspaceWsHandler-CkgJR6Oo.js → createWorkspaceWsHandler-y6pRWLoa.js} +3 -3
- package/dist/{index-mHqvjT5a.js → index-4R_QcR8P.js} +2 -2
- package/dist/{index-Cn2CVr2m.js → index-B2ztJXV3.js} +2 -2
- package/dist/{index-Bf-Az5am.js → index-BDUHHaoY.js} +4 -4
- package/dist/{index-CHLZ4xCe.js → index-BIffImVM.js} +426 -414
- package/dist/{index-Dy5HesOM.js → index-C09THX8u.js} +2 -2
- package/dist/{index-dti6XFQV.js → index-C4cx5Qxu.js} +2 -2
- package/dist/{index-vqAJt3qL.js → index-C7ng_cdZ.js} +1 -1
- package/dist/{index-9fGksFL5.js → index-C9LqX4Lg.js} +1 -1
- package/dist/{index-DXvw5NUH.js → index-CMLlvrEW.js} +13 -13
- package/dist/{index-Cg88iPqc.js → index-COn912sj.js} +3 -3
- package/dist/{index-C1sQehbP.js → index-CcHrWE4P.js} +2 -2
- package/dist/index-Cxoup7V8.js +139 -0
- package/dist/{index-CM6iVhI3.js → index-CzS_q6Tn.js} +3 -3
- package/dist/{index-DTKd1x9H.js → index-DWrEAa8-.js} +3 -3
- package/dist/{index-BtCyMeHe.js → index-DePIQVt9.js} +3 -3
- package/dist/{index-Bf57pWxm.js → index-DlBN-ou4.js} +5 -5
- package/dist/{index-Dg_qr92O.js → index-Do3pyigD.js} +1 -1
- package/dist/{index-BiCIEDbX.js → index-DtgTLML8.js} +3 -3
- package/dist/{index-Dx6dKBLL.js → index-DxXcTAH4.js} +1 -1
- package/dist/index-H7hP7Fmj.js +228 -0
- package/dist/{index-DxH2PsDU.js → index-LnUf9Vil.js} +6 -6
- package/dist/{index-Dj88QNYQ.js → index-XWWknPNw.js} +2 -2
- package/dist/{index-M_hPRTgh.js → index-frmk-zNf.js} +5 -5
- package/dist/{index-Bbs7DMqZ.js → index-ztXjGIJk.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{instance-BXN17-Ol.js → instance-DL4u5k9c.js} +1 -1
- package/dist/{menuPermission-Bw3hPi8i.js → menuPermission-CA_atlfk.js} +3 -3
- package/dist/pages.js +1 -1
- package/dist/{send-default-agent-team-message-DM0C9VL-.js → send-default-agent-team-message-BfBVm9AO.js} +1 -1
- package/dist/{sso-user-F62YVj4w.js → sso-user-Dr8_-Sxd.js} +1 -1
- package/dist/{training-Df00Ilsm.js → training-CcGUA5KC.js} +1 -1
- package/dist/{webide-Iw2coFFL.js → webide-C2JfQ-Je.js} +3 -3
- package/dist/z-team-component.css +1 -1
- package/package.json +1 -1
- package/dist/index-TaAkEm82.js +0 -112
- package/dist/index-glQgW-8f.js +0 -147
|
@@ -1,180 +1,192 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useNavigate as me, useLocation as se, Navigate as
|
|
3
|
-
import { Spin as pe, Row as he, Col as
|
|
4
|
-
import { DownOutlined as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { P as
|
|
7
|
-
import { f as
|
|
8
|
-
import { u as te, a3 as
|
|
2
|
+
import { useNavigate as me, useLocation as se, Navigate as q } from "react-router-dom";
|
|
3
|
+
import { Spin as pe, Row as he, Col as U, Card as M, Statistic as W, Space as _, Tag as O, Button as I, Alert as V, Table as ye, Badge as re, Popconfirm as B, message as S, Select as ae, Drawer as fe, Tabs as ge, Form as H, Modal as be, Input as j, InputNumber as X } from "antd";
|
|
4
|
+
import { DownOutlined as we, RightOutlined as ke, DashboardOutlined as Q, ClusterOutlined as J, CloudServerOutlined as D, ContainerOutlined as oe, ReloadOutlined as Y, LockOutlined as ve, UnlockOutlined as xe, PlayCircleOutlined as Se, PauseCircleOutlined as Ie, ClearOutlined as le, SendOutlined as Ce, EyeOutlined as Pe, DeleteOutlined as ce, PlusOutlined as _e, EditOutlined as Oe, BranchesOutlined as Re, RocketOutlined as $e, AlertOutlined as Ae, FileTextOutlined as Ne, DatabaseOutlined as ee, CloudOutlined as Ee, DeploymentUnitOutlined as Te } from "@ant-design/icons";
|
|
5
|
+
import { useState as m, useMemo as Z, useEffect as E, useRef as z } from "react";
|
|
6
|
+
import { P as Ge, R as He } from "./index-CcHrWE4P.js";
|
|
7
|
+
import { f as Le, M as De } from "./menuPermission-CA_atlfk.js";
|
|
8
|
+
import { u as te, a3 as ze } from "./ComponentDoc-BAUII4UZ.js";
|
|
9
9
|
import { ListTable as ie } from "@yuku123/z-frontend-common/ui";
|
|
10
|
-
import "./index-
|
|
11
|
-
const Fe = "
|
|
10
|
+
import "./index-CMLlvrEW.js";
|
|
11
|
+
const Fe = "_shell_rfl59_7", Me = "_sidebar_rfl59_20", Be = "_menuList_rfl59_41", Ue = "_menuGroup_rfl59_47", We = "_menuGroupHeader_rfl59_56", Ke = "_menuGroupHeaderOpen_rfl59_75", qe = "_menuGroupHeaderActive_rfl59_86", Je = "_menuGroupIcon_rfl59_90", Ve = "_menuGroupLabel_rfl59_99", je = "_menuGroupArrow_rfl59_104", Xe = "_menuSubList_rfl59_110", Ze = "_menuSubItemWrap_rfl59_116", Qe = "_menuSubItem_rfl59_116", Ye = "_menuItemOnPath_rfl59_154", et = "_menuSubItemPill_rfl59_175", tt = "_menuSubItemActive_rfl59_191", nt = "_menuSubItemIcon_rfl59_201", st = "_main_rfl59_215", rt = "_empty_rfl59_226", at = "_emptyIcon_rfl59_236", ot = "_emptyText_rfl59_241", w = {
|
|
12
12
|
shell: Fe,
|
|
13
|
-
sidebar:
|
|
14
|
-
menuList:
|
|
15
|
-
menuGroup:
|
|
16
|
-
menuGroupHeader:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
sidebar: Me,
|
|
14
|
+
menuList: Be,
|
|
15
|
+
menuGroup: Ue,
|
|
16
|
+
menuGroupHeader: We,
|
|
17
|
+
menuGroupHeaderOpen: Ke,
|
|
18
|
+
menuGroupHeaderActive: qe,
|
|
19
|
+
menuGroupIcon: Je,
|
|
20
|
+
menuGroupLabel: Ve,
|
|
21
|
+
menuGroupArrow: je,
|
|
22
|
+
menuSubList: Xe,
|
|
23
|
+
menuSubItemWrap: Ze,
|
|
24
|
+
menuSubItem: Qe,
|
|
25
|
+
menuItemOnPath: Ye,
|
|
26
|
+
menuSubItemPill: et,
|
|
27
|
+
menuSubItemActive: tt,
|
|
28
|
+
menuSubItemIcon: nt,
|
|
29
|
+
main: st,
|
|
30
|
+
empty: rt,
|
|
31
|
+
emptyIcon: at,
|
|
32
|
+
emptyText: ot
|
|
30
33
|
};
|
|
31
|
-
function
|
|
34
|
+
function lt(t, a) {
|
|
32
35
|
for (const l of t)
|
|
33
|
-
if (l.path ===
|
|
36
|
+
if (l.path === a) return l.element;
|
|
34
37
|
for (const l of t)
|
|
35
38
|
if (l.path.includes("*") || l.path.includes(":")) {
|
|
36
|
-
const
|
|
37
|
-
if (new RegExp(
|
|
39
|
+
const p = "^" + l.path.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, "[^/]+") + "$";
|
|
40
|
+
if (new RegExp(p).test(a)) return l.element;
|
|
38
41
|
}
|
|
39
42
|
return null;
|
|
40
43
|
}
|
|
41
|
-
function
|
|
44
|
+
function ct({ text: t }) {
|
|
42
45
|
return /* @__PURE__ */ s("div", { className: w.empty, children: [
|
|
43
46
|
/* @__PURE__ */ e("div", { className: w.emptyIcon, children: "⚙️" }),
|
|
44
47
|
/* @__PURE__ */ e("div", { className: w.emptyText, children: t })
|
|
45
48
|
] });
|
|
46
49
|
}
|
|
47
|
-
function
|
|
50
|
+
function it({
|
|
48
51
|
groups: t,
|
|
49
|
-
routes:
|
|
52
|
+
routes: a,
|
|
50
53
|
mode: l,
|
|
51
|
-
emptyText:
|
|
52
|
-
activePathOverride:
|
|
53
|
-
menuOnly:
|
|
54
|
+
emptyText: p,
|
|
55
|
+
activePathOverride: h,
|
|
56
|
+
menuOnly: y = !1
|
|
54
57
|
}) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
for (const y of h.items)
|
|
64
|
-
if (y.path === n) return y.key;
|
|
58
|
+
const g = me(), { pathname: u } = se(), C = te((n) => n.currentUser), v = te((n) => n.permissionState), [r, o] = m(/* @__PURE__ */ new Set()), c = Z(
|
|
59
|
+
() => v === "failed" ? t : Le(t, C),
|
|
60
|
+
[t, C, v]
|
|
61
|
+
), b = Z(() => {
|
|
62
|
+
const n = h ?? u;
|
|
63
|
+
for (const d of c)
|
|
64
|
+
for (const f of d.items)
|
|
65
|
+
if (f.path === n) return f.key;
|
|
65
66
|
return null;
|
|
66
|
-
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
}, [c, h, u]);
|
|
68
|
+
E(() => {
|
|
69
|
+
b && c.forEach((n) => {
|
|
70
|
+
n.items.some((d) => d.key === b) && o(
|
|
71
|
+
(d) => d.has(n.title) ? d : new Set(d).add(n.title)
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
}, [b, c]);
|
|
75
|
+
const P = (n) => {
|
|
76
|
+
o((d) => {
|
|
77
|
+
const f = new Set(d);
|
|
78
|
+
return f.has(n) ? f.delete(n) : f.add(n), f;
|
|
70
79
|
});
|
|
71
80
|
}, N = (n) => {
|
|
72
|
-
|
|
73
|
-
},
|
|
81
|
+
g(`${n.path}?mode=${l}`);
|
|
82
|
+
}, k = Z(() => lt(a, u), [a, u]);
|
|
74
83
|
return /* @__PURE__ */ s("div", { className: w.shell, children: [
|
|
75
84
|
/* @__PURE__ */ s("aside", { className: w.sidebar, children: [
|
|
76
|
-
/* @__PURE__ */ e(
|
|
77
|
-
/* @__PURE__ */ e("nav", { className: w.menuList, children:
|
|
78
|
-
const
|
|
85
|
+
/* @__PURE__ */ e(De, {}),
|
|
86
|
+
/* @__PURE__ */ e("nav", { className: w.menuList, children: c.map((n) => {
|
|
87
|
+
const d = r.has(n.title), f = b ? n.items.findIndex((x) => x.key === b) : -1;
|
|
79
88
|
return /* @__PURE__ */ s("div", { className: w.menuGroup, children: [
|
|
80
89
|
/* @__PURE__ */ s(
|
|
81
90
|
"div",
|
|
82
91
|
{
|
|
83
|
-
className: w.menuGroupHeader
|
|
84
|
-
onClick: () =>
|
|
92
|
+
className: `${w.menuGroupHeader} ${d ? w.menuGroupHeaderOpen : ""} ${f >= 0 ? w.menuGroupHeaderActive : ""}`,
|
|
93
|
+
onClick: () => P(n.title),
|
|
85
94
|
children: [
|
|
86
95
|
/* @__PURE__ */ e("span", { className: w.menuGroupIcon, children: n.icon }),
|
|
87
96
|
/* @__PURE__ */ e("span", { className: w.menuGroupLabel, children: n.title }),
|
|
88
|
-
/* @__PURE__ */ e("span", { className: w.menuGroupArrow, children:
|
|
97
|
+
/* @__PURE__ */ e("span", { className: w.menuGroupArrow, children: d ? /* @__PURE__ */ e(we, {}) : /* @__PURE__ */ e(ke, {}) })
|
|
89
98
|
]
|
|
90
99
|
}
|
|
91
100
|
),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
d && /* @__PURE__ */ e("ul", { className: w.menuSubList, children: n.items.map((x, R) => {
|
|
102
|
+
const F = f >= 0 && R <= f;
|
|
103
|
+
return /* @__PURE__ */ e(
|
|
104
|
+
"li",
|
|
105
|
+
{
|
|
106
|
+
className: `${w.menuSubItemWrap} ${w.menuSubItem} ${F ? w.menuItemOnPath : ""} ${b === x.key ? w.menuSubItemActive : ""}`,
|
|
107
|
+
onClick: () => N(x),
|
|
108
|
+
children: /* @__PURE__ */ s("div", { className: w.menuSubItemPill, children: [
|
|
109
|
+
/* @__PURE__ */ e("span", { className: w.menuSubItemIcon, children: x.icon }),
|
|
110
|
+
/* @__PURE__ */ e("span", { className: w.menuSubItemLabel, children: x.label })
|
|
111
|
+
] })
|
|
112
|
+
},
|
|
113
|
+
x.key
|
|
114
|
+
);
|
|
115
|
+
}) })
|
|
104
116
|
] }, n.title);
|
|
105
117
|
}) })
|
|
106
118
|
] }),
|
|
107
|
-
|
|
108
|
-
/* @__PURE__ */ e(
|
|
109
|
-
/* @__PURE__ */ e(
|
|
119
|
+
y ? null : /* @__PURE__ */ s("main", { className: w.main, children: [
|
|
120
|
+
/* @__PURE__ */ e(Ge, {}),
|
|
121
|
+
/* @__PURE__ */ e(He, { resetKey: u, children: k ?? /* @__PURE__ */ e(ct, { text: p }) })
|
|
110
122
|
] })
|
|
111
123
|
] });
|
|
112
124
|
}
|
|
113
|
-
const
|
|
114
|
-
async function de(t,
|
|
115
|
-
const l = `${
|
|
125
|
+
const dt = "/z-team/ops/k8s";
|
|
126
|
+
async function de(t, a) {
|
|
127
|
+
const l = `${dt}${t}`, p = await fetch(l, {
|
|
116
128
|
headers: { "Content-Type": "application/json" },
|
|
117
|
-
...
|
|
118
|
-
}),
|
|
119
|
-
if (!/json/i.test(
|
|
120
|
-
throw new Error(`数据源不可达:GET ${l} 返回 ${
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
throw new Error(`后端 ${l} 返回 success=false:${
|
|
124
|
-
return
|
|
129
|
+
...a
|
|
130
|
+
}), h = p.headers && p.headers.get("content-type") || "";
|
|
131
|
+
if (!/json/i.test(h))
|
|
132
|
+
throw new Error(`数据源不可达:GET ${l} 返回 ${p.status} ${h || "(无 content-type)"},不是 JSON —— 该前缀没有进到后端接口(K8s 管理 API 在 z-ops 仓,z-opc 宿主未注册)`);
|
|
133
|
+
const y = await p.json();
|
|
134
|
+
if (y && y.success === !1)
|
|
135
|
+
throw new Error(`后端 ${l} 返回 success=false:${y.message || "(无 message)"}`);
|
|
136
|
+
return y;
|
|
125
137
|
}
|
|
126
|
-
async function
|
|
127
|
-
return de(t,
|
|
138
|
+
async function T(t, a) {
|
|
139
|
+
return de(t, a);
|
|
128
140
|
}
|
|
129
|
-
async function
|
|
130
|
-
return
|
|
141
|
+
async function ut() {
|
|
142
|
+
return T("/cluster/info");
|
|
131
143
|
}
|
|
132
|
-
async function
|
|
133
|
-
return
|
|
144
|
+
async function mt() {
|
|
145
|
+
return T("/nodes");
|
|
134
146
|
}
|
|
135
|
-
async function
|
|
136
|
-
return
|
|
147
|
+
async function pt(t) {
|
|
148
|
+
return T("/nodes/cordon", {
|
|
137
149
|
method: "POST",
|
|
138
150
|
body: JSON.stringify({ name: t })
|
|
139
151
|
});
|
|
140
152
|
}
|
|
141
|
-
async function
|
|
142
|
-
return
|
|
153
|
+
async function ht(t) {
|
|
154
|
+
return T("/nodes/uncordon", {
|
|
143
155
|
method: "POST",
|
|
144
156
|
body: JSON.stringify({ name: t })
|
|
145
157
|
});
|
|
146
158
|
}
|
|
147
|
-
async function
|
|
148
|
-
return
|
|
159
|
+
async function yt(t = "*") {
|
|
160
|
+
return T(`/workloads/pods?namespace=${t}`);
|
|
149
161
|
}
|
|
150
|
-
async function
|
|
151
|
-
return
|
|
162
|
+
async function ft(t, a, l = 200) {
|
|
163
|
+
return T(`/workloads/pods/${t}/${a}/logs?tailLines=${l}`);
|
|
152
164
|
}
|
|
153
|
-
async function
|
|
154
|
-
return
|
|
165
|
+
async function gt(t, a) {
|
|
166
|
+
return T(`/workloads/pods/${t}/${a}/restart`, { method: "POST" });
|
|
155
167
|
}
|
|
156
|
-
async function
|
|
157
|
-
return
|
|
168
|
+
async function bt(t, a) {
|
|
169
|
+
return T(`/workloads/pods/${t}/${a}`, { method: "DELETE" });
|
|
158
170
|
}
|
|
159
|
-
async function
|
|
160
|
-
return
|
|
171
|
+
async function wt() {
|
|
172
|
+
return T("/namespaces");
|
|
161
173
|
}
|
|
162
|
-
const
|
|
163
|
-
var
|
|
164
|
-
const [t,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
return () => clearInterval(
|
|
174
|
+
const kt = () => {
|
|
175
|
+
var y, g;
|
|
176
|
+
const [t, a] = m(null), [l, p] = m(!0);
|
|
177
|
+
E(() => {
|
|
178
|
+
h();
|
|
179
|
+
const u = setInterval(h, 1e4);
|
|
180
|
+
return () => clearInterval(u);
|
|
169
181
|
}, []);
|
|
170
|
-
const
|
|
182
|
+
const h = async () => {
|
|
171
183
|
try {
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
} catch (
|
|
175
|
-
console.error("Failed to load cluster info",
|
|
184
|
+
const u = await ut();
|
|
185
|
+
u.success && a(u.data);
|
|
186
|
+
} catch (u) {
|
|
187
|
+
console.error("Failed to load cluster info", u);
|
|
176
188
|
} finally {
|
|
177
|
-
|
|
189
|
+
p(!1);
|
|
178
190
|
}
|
|
179
191
|
};
|
|
180
192
|
return l ? /* @__PURE__ */ e(pe, { size: "large" }) : /* @__PURE__ */ s("div", { style: { padding: 16 }, children: [
|
|
@@ -183,12 +195,12 @@ const bt = () => {
|
|
|
183
195
|
" 运维总览"
|
|
184
196
|
] }),
|
|
185
197
|
/* @__PURE__ */ s(he, { gutter: [16, 16], children: [
|
|
186
|
-
/* @__PURE__ */ e(
|
|
198
|
+
/* @__PURE__ */ e(U, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
187
199
|
/* @__PURE__ */ e(
|
|
188
|
-
|
|
200
|
+
W,
|
|
189
201
|
{
|
|
190
|
-
title: /* @__PURE__ */ s(
|
|
191
|
-
/* @__PURE__ */ e(
|
|
202
|
+
title: /* @__PURE__ */ s(_, { children: [
|
|
203
|
+
/* @__PURE__ */ e(J, {}),
|
|
192
204
|
" K8s 节点"
|
|
193
205
|
] }),
|
|
194
206
|
value: (t == null ? void 0 : t.readyNodes) ?? 0,
|
|
@@ -198,17 +210,17 @@ const bt = () => {
|
|
|
198
210
|
] })
|
|
199
211
|
}
|
|
200
212
|
),
|
|
201
|
-
/* @__PURE__ */ e(
|
|
213
|
+
/* @__PURE__ */ e(O, { color: (t == null ? void 0 : t.status) === "Healthy" ? "success" : "warning", children: (t == null ? void 0 : t.status) ?? "Unknown" })
|
|
202
214
|
] }) }),
|
|
203
|
-
/* @__PURE__ */ e(
|
|
215
|
+
/* @__PURE__ */ e(U, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
204
216
|
/* @__PURE__ */ e(
|
|
205
|
-
|
|
217
|
+
W,
|
|
206
218
|
{
|
|
207
|
-
title: /* @__PURE__ */ s(
|
|
208
|
-
/* @__PURE__ */ e(
|
|
219
|
+
title: /* @__PURE__ */ s(_, { children: [
|
|
220
|
+
/* @__PURE__ */ e(D, {}),
|
|
209
221
|
" CPU"
|
|
210
222
|
] }),
|
|
211
|
-
value: ((
|
|
223
|
+
value: ((y = t == null ? void 0 : t.usedCpu) == null ? void 0 : y.toFixed(1)) ?? "0",
|
|
212
224
|
suffix: /* @__PURE__ */ s("span", { style: { color: "#999" }, children: [
|
|
213
225
|
" / ",
|
|
214
226
|
(t == null ? void 0 : t.totalCpu) ?? 0,
|
|
@@ -217,20 +229,20 @@ const bt = () => {
|
|
|
217
229
|
precision: 1
|
|
218
230
|
}
|
|
219
231
|
),
|
|
220
|
-
/* @__PURE__ */ s(
|
|
232
|
+
/* @__PURE__ */ s(O, { color: ((t == null ? void 0 : t.usedCpu) ?? 0) / ((t == null ? void 0 : t.totalCpu) ?? 1) > 0.8 ? "error" : "success", children: [
|
|
221
233
|
(((t == null ? void 0 : t.usedCpu) ?? 0) / ((t == null ? void 0 : t.totalCpu) ?? 1) * 100).toFixed(0),
|
|
222
234
|
"%"
|
|
223
235
|
] })
|
|
224
236
|
] }) }),
|
|
225
|
-
/* @__PURE__ */ e(
|
|
237
|
+
/* @__PURE__ */ e(U, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
226
238
|
/* @__PURE__ */ e(
|
|
227
|
-
|
|
239
|
+
W,
|
|
228
240
|
{
|
|
229
|
-
title: /* @__PURE__ */ s(
|
|
241
|
+
title: /* @__PURE__ */ s(_, { children: [
|
|
230
242
|
/* @__PURE__ */ e(Q, {}),
|
|
231
243
|
" 内存"
|
|
232
244
|
] }),
|
|
233
|
-
value: ((
|
|
245
|
+
value: ((g = t == null ? void 0 : t.usedMemory) == null ? void 0 : g.toFixed(1)) ?? "0",
|
|
234
246
|
suffix: /* @__PURE__ */ s("span", { style: { color: "#999" }, children: [
|
|
235
247
|
" / ",
|
|
236
248
|
(t == null ? void 0 : t.totalMemory) ?? 0,
|
|
@@ -239,16 +251,16 @@ const bt = () => {
|
|
|
239
251
|
precision: 1
|
|
240
252
|
}
|
|
241
253
|
),
|
|
242
|
-
/* @__PURE__ */ s(
|
|
254
|
+
/* @__PURE__ */ s(O, { color: ((t == null ? void 0 : t.usedMemory) ?? 0) / ((t == null ? void 0 : t.totalMemory) ?? 1) > 0.8 ? "error" : "success", children: [
|
|
243
255
|
(((t == null ? void 0 : t.usedMemory) ?? 0) / ((t == null ? void 0 : t.totalMemory) ?? 1) * 100).toFixed(0),
|
|
244
256
|
"%"
|
|
245
257
|
] })
|
|
246
258
|
] }) }),
|
|
247
|
-
/* @__PURE__ */ e(
|
|
259
|
+
/* @__PURE__ */ e(U, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ s(M, { children: [
|
|
248
260
|
/* @__PURE__ */ e(
|
|
249
|
-
|
|
261
|
+
W,
|
|
250
262
|
{
|
|
251
|
-
title: /* @__PURE__ */ s(
|
|
263
|
+
title: /* @__PURE__ */ s(_, { children: [
|
|
252
264
|
/* @__PURE__ */ e(oe, {}),
|
|
253
265
|
" Pods"
|
|
254
266
|
] }),
|
|
@@ -259,13 +271,13 @@ const bt = () => {
|
|
|
259
271
|
] })
|
|
260
272
|
}
|
|
261
273
|
),
|
|
262
|
-
/* @__PURE__ */ s(
|
|
274
|
+
/* @__PURE__ */ s(O, { color: "success", children: [
|
|
263
275
|
(t == null ? void 0 : t.namespaceCount) ?? 0,
|
|
264
276
|
" namespaces"
|
|
265
277
|
] })
|
|
266
278
|
] }) })
|
|
267
279
|
] }),
|
|
268
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e(M, { title: "集群信息", style: { marginTop: 16 }, children: /* @__PURE__ */ s(_, { orientation: "vertical", children: [
|
|
269
281
|
/* @__PURE__ */ s("div", { children: [
|
|
270
282
|
/* @__PURE__ */ e("strong", { children: "K8s 版本:" }),
|
|
271
283
|
" ",
|
|
@@ -274,7 +286,7 @@ const bt = () => {
|
|
|
274
286
|
/* @__PURE__ */ s("div", { children: [
|
|
275
287
|
/* @__PURE__ */ e("strong", { children: "集群状态:" }),
|
|
276
288
|
" ",
|
|
277
|
-
/* @__PURE__ */ e(
|
|
289
|
+
/* @__PURE__ */ e(O, { color: "success", children: t == null ? void 0 : t.status })
|
|
278
290
|
] }),
|
|
279
291
|
/* @__PURE__ */ s("div", { children: [
|
|
280
292
|
/* @__PURE__ */ e("strong", { children: "节点数:" }),
|
|
@@ -298,44 +310,44 @@ const bt = () => {
|
|
|
298
310
|
] })
|
|
299
311
|
] }) })
|
|
300
312
|
] });
|
|
301
|
-
},
|
|
302
|
-
const [t,
|
|
303
|
-
|
|
304
|
-
|
|
313
|
+
}, vt = () => {
|
|
314
|
+
const [t, a] = m([]), [l, p] = m(!1), [h, y] = m("");
|
|
315
|
+
E(() => {
|
|
316
|
+
g();
|
|
305
317
|
}, []);
|
|
306
|
-
const
|
|
307
|
-
|
|
318
|
+
const g = async () => {
|
|
319
|
+
p(!0), y("");
|
|
308
320
|
try {
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
} catch (
|
|
312
|
-
|
|
321
|
+
const r = await mt();
|
|
322
|
+
a(Array.isArray(r.data) ? r.data : []);
|
|
323
|
+
} catch (r) {
|
|
324
|
+
a([]), y(String((r == null ? void 0 : r.message) || r));
|
|
313
325
|
} finally {
|
|
314
|
-
|
|
326
|
+
p(!1);
|
|
315
327
|
}
|
|
316
|
-
},
|
|
328
|
+
}, u = async (r) => {
|
|
317
329
|
try {
|
|
318
|
-
await
|
|
330
|
+
await pt(r), S.success(`${r} 已封锁(停止调度)`), g();
|
|
319
331
|
} catch {
|
|
320
|
-
|
|
332
|
+
S.error("封锁失败");
|
|
321
333
|
}
|
|
322
|
-
},
|
|
334
|
+
}, C = async (r) => {
|
|
323
335
|
try {
|
|
324
|
-
await
|
|
336
|
+
await ht(r), S.success(`${r} 已解封`), g();
|
|
325
337
|
} catch {
|
|
326
|
-
|
|
338
|
+
S.error("解封失败");
|
|
327
339
|
}
|
|
328
340
|
};
|
|
329
341
|
return /* @__PURE__ */ s("div", { children: [
|
|
330
|
-
/* @__PURE__ */ e(
|
|
331
|
-
|
|
332
|
-
|
|
342
|
+
/* @__PURE__ */ e(_, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(Y, {}), onClick: g, loading: l, children: "刷新" }) }),
|
|
343
|
+
h && /* @__PURE__ */ e(
|
|
344
|
+
V,
|
|
333
345
|
{
|
|
334
346
|
type: "error",
|
|
335
347
|
showIcon: !0,
|
|
336
348
|
style: { marginBottom: 12 },
|
|
337
349
|
message: "节点列表读取失败",
|
|
338
|
-
description:
|
|
350
|
+
description: h
|
|
339
351
|
}
|
|
340
352
|
),
|
|
341
353
|
/* @__PURE__ */ e(
|
|
@@ -346,39 +358,39 @@ const bt = () => {
|
|
|
346
358
|
title: "名称",
|
|
347
359
|
dataIndex: "name",
|
|
348
360
|
key: "name",
|
|
349
|
-
render: (
|
|
361
|
+
render: (r) => /* @__PURE__ */ e("strong", { children: r })
|
|
350
362
|
},
|
|
351
363
|
{
|
|
352
364
|
title: "IP",
|
|
353
365
|
dataIndex: "ip",
|
|
354
366
|
key: "ip",
|
|
355
|
-
render: (
|
|
367
|
+
render: (r) => /* @__PURE__ */ e("code", { children: r })
|
|
356
368
|
},
|
|
357
369
|
{
|
|
358
370
|
title: "状态",
|
|
359
371
|
dataIndex: "status",
|
|
360
372
|
key: "status",
|
|
361
|
-
render: (
|
|
373
|
+
render: (r) => /* @__PURE__ */ e(re, { status: r === "Ready" ? "success" : "error", text: r })
|
|
362
374
|
},
|
|
363
375
|
{
|
|
364
376
|
title: "角色",
|
|
365
377
|
dataIndex: "roles",
|
|
366
378
|
key: "roles",
|
|
367
|
-
render: (
|
|
379
|
+
render: (r) => r ? /* @__PURE__ */ e(O, { color: "blue", children: r }) : /* @__PURE__ */ e(O, { children: "worker" })
|
|
368
380
|
},
|
|
369
381
|
{
|
|
370
382
|
title: "CPU",
|
|
371
383
|
key: "cpu",
|
|
372
|
-
render: (
|
|
373
|
-
var
|
|
374
|
-
const
|
|
384
|
+
render: (r, o) => {
|
|
385
|
+
var P;
|
|
386
|
+
const c = o.cpuUsed, b = c != null && o.cpuCapacity > 0 ? c / o.cpuCapacity * 100 : null;
|
|
375
387
|
return /* @__PURE__ */ s("span", { children: [
|
|
376
|
-
|
|
388
|
+
c != null ? c.toFixed(2) : "—",
|
|
377
389
|
" / ",
|
|
378
|
-
((
|
|
390
|
+
((P = o.cpuCapacity) == null ? void 0 : P.toFixed(0)) ?? 0,
|
|
379
391
|
" cores",
|
|
380
|
-
|
|
381
|
-
|
|
392
|
+
b != null && /* @__PURE__ */ s(O, { color: b > 80 ? "error" : "success", style: { marginLeft: 4 }, children: [
|
|
393
|
+
b.toFixed(0),
|
|
382
394
|
"%"
|
|
383
395
|
] })
|
|
384
396
|
] });
|
|
@@ -387,16 +399,16 @@ const bt = () => {
|
|
|
387
399
|
{
|
|
388
400
|
title: "内存",
|
|
389
401
|
key: "mem",
|
|
390
|
-
render: (
|
|
391
|
-
var
|
|
392
|
-
const
|
|
402
|
+
render: (r, o) => {
|
|
403
|
+
var P;
|
|
404
|
+
const c = o.memUsed, b = c != null && o.memCapacity > 0 ? c / o.memCapacity * 100 : null;
|
|
393
405
|
return /* @__PURE__ */ s("span", { children: [
|
|
394
|
-
|
|
406
|
+
c != null ? c.toFixed(1) : "—",
|
|
395
407
|
" / ",
|
|
396
|
-
((
|
|
408
|
+
((P = o.memCapacity) == null ? void 0 : P.toFixed(1)) ?? 0,
|
|
397
409
|
" GB",
|
|
398
|
-
|
|
399
|
-
|
|
410
|
+
b != null && /* @__PURE__ */ s(O, { color: b > 80 ? "error" : "success", style: { marginLeft: 4 }, children: [
|
|
411
|
+
b.toFixed(0),
|
|
400
412
|
"%"
|
|
401
413
|
] })
|
|
402
414
|
] });
|
|
@@ -409,9 +421,9 @@ const bt = () => {
|
|
|
409
421
|
title: "操作",
|
|
410
422
|
key: "action",
|
|
411
423
|
width: 150,
|
|
412
|
-
render: (
|
|
413
|
-
/* @__PURE__ */ e(
|
|
414
|
-
/* @__PURE__ */ e(
|
|
424
|
+
render: (r, o) => /* @__PURE__ */ s(_, { children: [
|
|
425
|
+
/* @__PURE__ */ e(B, { title: `封锁 ${o.name}?`, onConfirm: () => u(o.name), children: /* @__PURE__ */ e(I, { size: "small", icon: /* @__PURE__ */ e(ve, {}), children: "Cordon" }) }),
|
|
426
|
+
/* @__PURE__ */ e(B, { title: `解封 ${o.name}?`, onConfirm: () => C(o.name), children: /* @__PURE__ */ e(I, { size: "small", icon: /* @__PURE__ */ e(xe, {}), children: "Uncordon" }) })
|
|
415
427
|
] })
|
|
416
428
|
}
|
|
417
429
|
],
|
|
@@ -426,49 +438,49 @@ const bt = () => {
|
|
|
426
438
|
] });
|
|
427
439
|
}, xt = ({
|
|
428
440
|
namespace: t,
|
|
429
|
-
podName:
|
|
441
|
+
podName: a,
|
|
430
442
|
tailLines: l = 200
|
|
431
443
|
}) => {
|
|
432
|
-
const [
|
|
433
|
-
|
|
434
|
-
var
|
|
435
|
-
(
|
|
436
|
-
}), [t,
|
|
437
|
-
var
|
|
438
|
-
|
|
439
|
-
}, [
|
|
440
|
-
const
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
},
|
|
445
|
-
o.current ||
|
|
446
|
-
},
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
|
|
444
|
+
const [p, h] = m([]), [y, g] = m(!1), [u, C] = m(!1), v = z(null), r = z(null), o = z(!1);
|
|
445
|
+
E(() => (c(), () => {
|
|
446
|
+
var k;
|
|
447
|
+
(k = v.current) == null || k.close();
|
|
448
|
+
}), [t, a]), E(() => {
|
|
449
|
+
var k;
|
|
450
|
+
u || (k = r.current) == null || k.scrollIntoView({ behavior: "smooth" });
|
|
451
|
+
}, [p, u]);
|
|
452
|
+
const c = () => {
|
|
453
|
+
const k = window.location.protocol === "https:" ? "wss:" : "ws:", n = window.location.host, d = `${k}//${n}/z-team/ops/k8s/ws/logs?namespace=${t}&name=${a}&tailLines=${l}`, f = new WebSocket(d);
|
|
454
|
+
v.current = f, f.onopen = () => {
|
|
455
|
+
g(!0), S.success("日志流已连接");
|
|
456
|
+
}, f.onmessage = (x) => {
|
|
457
|
+
o.current || h((R) => [...R.slice(-1e3), x.data]);
|
|
458
|
+
}, f.onclose = () => {
|
|
459
|
+
g(!1);
|
|
460
|
+
}, f.onerror = () => {
|
|
461
|
+
g(!1), S.error("WebSocket 连接错误");
|
|
450
462
|
};
|
|
451
463
|
};
|
|
452
464
|
return /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
453
|
-
/* @__PURE__ */ s(
|
|
454
|
-
/* @__PURE__ */ e(
|
|
465
|
+
/* @__PURE__ */ s(_, { style: { marginBottom: 8 }, children: [
|
|
466
|
+
/* @__PURE__ */ e(O, { color: y ? "success" : "error", children: y ? "● 已连接" : "● 已断开" }),
|
|
455
467
|
/* @__PURE__ */ e(
|
|
456
|
-
|
|
468
|
+
I,
|
|
457
469
|
{
|
|
458
470
|
size: "small",
|
|
459
|
-
icon:
|
|
471
|
+
icon: u ? /* @__PURE__ */ e(Se, {}) : /* @__PURE__ */ e(Ie, {}),
|
|
460
472
|
onClick: () => {
|
|
461
|
-
o.current = !o.current,
|
|
473
|
+
o.current = !o.current, C(o.current);
|
|
462
474
|
},
|
|
463
|
-
children:
|
|
475
|
+
children: u ? "继续" : "暂停"
|
|
464
476
|
}
|
|
465
477
|
),
|
|
466
|
-
/* @__PURE__ */ e(
|
|
467
|
-
|
|
478
|
+
/* @__PURE__ */ e(I, { size: "small", icon: /* @__PURE__ */ e(le, {}), onClick: () => {
|
|
479
|
+
h([]);
|
|
468
480
|
}, children: "清空" }),
|
|
469
|
-
/* @__PURE__ */ e(
|
|
470
|
-
var
|
|
471
|
-
(
|
|
481
|
+
/* @__PURE__ */ e(I, { size: "small", onClick: () => {
|
|
482
|
+
var k;
|
|
483
|
+
(k = v.current) == null || k.close(), h([]), c();
|
|
472
484
|
}, children: "重连" })
|
|
473
485
|
] }),
|
|
474
486
|
/* @__PURE__ */ s("div", { style: {
|
|
@@ -482,60 +494,60 @@ const bt = () => {
|
|
|
482
494
|
lineHeight: 1.5,
|
|
483
495
|
color: "#d4d4d4"
|
|
484
496
|
}, children: [
|
|
485
|
-
|
|
486
|
-
color:
|
|
497
|
+
p.map((k, n) => /* @__PURE__ */ e("div", { style: {
|
|
498
|
+
color: k.includes("ERROR") ? "#f44336" : k.includes("WARN") ? "#ff9800" : k.includes("INFO") ? "#4caf50" : "#d4d4d4",
|
|
487
499
|
whiteSpace: "pre-wrap",
|
|
488
500
|
wordBreak: "break-all"
|
|
489
|
-
}, children:
|
|
490
|
-
/* @__PURE__ */ e("div", { ref:
|
|
501
|
+
}, children: k }, n)),
|
|
502
|
+
/* @__PURE__ */ e("div", { ref: r })
|
|
491
503
|
] })
|
|
492
504
|
] });
|
|
493
|
-
},
|
|
505
|
+
}, St = ({
|
|
494
506
|
namespace: t,
|
|
495
|
-
podName:
|
|
507
|
+
podName: a
|
|
496
508
|
}) => {
|
|
497
|
-
const [l,
|
|
498
|
-
|
|
509
|
+
const [l, p] = m(!1), [h, y] = m(""), [g, u] = m("sh"), [C, v] = m([]), r = z(null), o = z(null), c = z(null);
|
|
510
|
+
E(() => (t && a && b(), () => {
|
|
499
511
|
var n;
|
|
500
|
-
return (n =
|
|
501
|
-
}), [t,
|
|
502
|
-
const
|
|
503
|
-
const n = window.location.protocol === "https:" ? "wss:" : "ws:",
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
},
|
|
507
|
-
|
|
512
|
+
return (n = r.current) == null ? void 0 : n.close();
|
|
513
|
+
}), [t, a]);
|
|
514
|
+
const b = () => {
|
|
515
|
+
const n = window.location.protocol === "https:" ? "wss:" : "ws:", d = window.location.host, f = `${n}//${d}/z-team/ops/k8s/ws/exec?namespace=${t}&name=${a}&command=${g}`, x = new WebSocket(f);
|
|
516
|
+
r.current = x, x.onopen = () => {
|
|
517
|
+
p(!0), v((R) => [...R, `Connected to ${t}/${a} (${g})`]), S.success("终端已连接");
|
|
518
|
+
}, x.onmessage = (R) => {
|
|
519
|
+
v((F) => [...F.slice(-500), R.data]), setTimeout(() => {
|
|
508
520
|
o.current && (o.current.scrollTop = o.current.scrollHeight);
|
|
509
521
|
}, 50);
|
|
510
|
-
},
|
|
511
|
-
|
|
522
|
+
}, x.onclose = () => {
|
|
523
|
+
p(!1), v((R) => [...R, `
|
|
512
524
|
--- 连接已关闭 ---`]);
|
|
513
|
-
},
|
|
514
|
-
|
|
525
|
+
}, x.onerror = () => {
|
|
526
|
+
p(!1), S.error("WebSocket 连接错误");
|
|
515
527
|
};
|
|
516
|
-
},
|
|
517
|
-
!
|
|
528
|
+
}, P = () => {
|
|
529
|
+
!h.trim() || !r.current || (r.current.readyState === WebSocket.OPEN ? (r.current.send(h), v((n) => [...n, `$ ${h}`]), y("")) : S.warning("WebSocket 未连接"));
|
|
518
530
|
}, N = (n) => {
|
|
519
|
-
var
|
|
520
|
-
n.key === "Enter" &&
|
|
521
|
-
},
|
|
531
|
+
var d;
|
|
532
|
+
n.key === "Enter" && P(), n.key === "Tab" && (n.preventDefault(), ((d = r.current) == null ? void 0 : d.readyState) === WebSocket.OPEN && r.current.send(" "));
|
|
533
|
+
}, k = () => v([]);
|
|
522
534
|
return /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
523
|
-
/* @__PURE__ */ s(
|
|
524
|
-
/* @__PURE__ */ e(
|
|
535
|
+
/* @__PURE__ */ s(_, { style: { marginBottom: 8 }, children: [
|
|
536
|
+
/* @__PURE__ */ e(O, { color: l ? "success" : "error", children: l ? "● 已连接" : "● 已断开" }),
|
|
525
537
|
/* @__PURE__ */ e(
|
|
526
|
-
|
|
538
|
+
ae,
|
|
527
539
|
{
|
|
528
|
-
value:
|
|
529
|
-
onChange:
|
|
540
|
+
value: g,
|
|
541
|
+
onChange: u,
|
|
530
542
|
size: "small",
|
|
531
543
|
style: { width: 100 },
|
|
532
544
|
options: ["sh", "bash", "/bin/sh", "/bin/bash"].map((n) => ({ label: n, value: n }))
|
|
533
545
|
}
|
|
534
546
|
),
|
|
535
|
-
/* @__PURE__ */ e(
|
|
536
|
-
/* @__PURE__ */ e(
|
|
547
|
+
/* @__PURE__ */ e(I, { size: "small", onClick: k, icon: /* @__PURE__ */ e(le, {}), children: "清空" }),
|
|
548
|
+
/* @__PURE__ */ e(I, { size: "small", onClick: () => {
|
|
537
549
|
var n;
|
|
538
|
-
(n =
|
|
550
|
+
(n = r.current) == null || n.close(), setTimeout(b, 200);
|
|
539
551
|
}, children: "重连" })
|
|
540
552
|
] }),
|
|
541
553
|
/* @__PURE__ */ s(
|
|
@@ -557,12 +569,12 @@ const bt = () => {
|
|
|
557
569
|
border: "1px solid #333"
|
|
558
570
|
},
|
|
559
571
|
children: [
|
|
560
|
-
|
|
572
|
+
C.map((n, d) => /* @__PURE__ */ e("div", { style: {
|
|
561
573
|
whiteSpace: "pre-wrap",
|
|
562
574
|
wordBreak: "break-all",
|
|
563
575
|
color: n.startsWith("$ ") ? "#00bfff" : n.startsWith("---") ? "#666" : n.includes("Error") || n.includes("error") ? "#ff4444" : "#00ff88"
|
|
564
|
-
}, children: n },
|
|
565
|
-
/* @__PURE__ */ e("span", { ref:
|
|
576
|
+
}, children: n }, d)),
|
|
577
|
+
/* @__PURE__ */ e("span", { ref: c, style: {
|
|
566
578
|
display: "inline-block",
|
|
567
579
|
width: 8,
|
|
568
580
|
height: 16,
|
|
@@ -573,7 +585,7 @@ const bt = () => {
|
|
|
573
585
|
]
|
|
574
586
|
}
|
|
575
587
|
),
|
|
576
|
-
/* @__PURE__ */ s(
|
|
588
|
+
/* @__PURE__ */ s(_.Compact, { style: { width: "100%" }, children: [
|
|
577
589
|
/* @__PURE__ */ s("span", { style: {
|
|
578
590
|
background: "#333",
|
|
579
591
|
color: "#00ff88",
|
|
@@ -587,13 +599,13 @@ const bt = () => {
|
|
|
587
599
|
"$ ",
|
|
588
600
|
t,
|
|
589
601
|
"/",
|
|
590
|
-
|
|
602
|
+
a
|
|
591
603
|
] }),
|
|
592
604
|
/* @__PURE__ */ e(
|
|
593
605
|
"input",
|
|
594
606
|
{
|
|
595
|
-
value:
|
|
596
|
-
onChange: (n) =>
|
|
607
|
+
value: h,
|
|
608
|
+
onChange: (n) => y(n.target.value),
|
|
597
609
|
onKeyDown: N,
|
|
598
610
|
placeholder: "输入命令后按 Enter...",
|
|
599
611
|
disabled: !l,
|
|
@@ -612,18 +624,18 @@ const bt = () => {
|
|
|
612
624
|
}
|
|
613
625
|
),
|
|
614
626
|
/* @__PURE__ */ e(
|
|
615
|
-
|
|
627
|
+
I,
|
|
616
628
|
{
|
|
617
629
|
type: "primary",
|
|
618
630
|
icon: /* @__PURE__ */ e(Ce, {}),
|
|
619
|
-
onClick:
|
|
631
|
+
onClick: P,
|
|
620
632
|
disabled: !l,
|
|
621
633
|
children: "发送"
|
|
622
634
|
}
|
|
623
635
|
)
|
|
624
636
|
] })
|
|
625
637
|
] });
|
|
626
|
-
},
|
|
638
|
+
}, It = (t) => {
|
|
627
639
|
switch (t) {
|
|
628
640
|
case "Running":
|
|
629
641
|
return "success";
|
|
@@ -636,57 +648,57 @@ const bt = () => {
|
|
|
636
648
|
default:
|
|
637
649
|
return "default";
|
|
638
650
|
}
|
|
639
|
-
},
|
|
640
|
-
const [t,
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}, []),
|
|
644
|
-
|
|
645
|
-
}, [
|
|
646
|
-
const
|
|
651
|
+
}, Ct = () => {
|
|
652
|
+
const [t, a] = m([]), [l, p] = m(!1), [h, y] = m(""), [g, u] = m("*"), [C, v] = m([]), [r, o] = m(!1), [c, b] = m(null), [P, N] = m("logs"), [k, n] = m("");
|
|
653
|
+
E(() => {
|
|
654
|
+
d();
|
|
655
|
+
}, []), E(() => {
|
|
656
|
+
f();
|
|
657
|
+
}, [g]);
|
|
658
|
+
const d = async () => {
|
|
647
659
|
try {
|
|
648
|
-
const
|
|
649
|
-
|
|
660
|
+
const i = await wt();
|
|
661
|
+
v(Array.isArray(i.data) ? ["*", ...i.data] : ["*"]);
|
|
650
662
|
} catch {
|
|
651
|
-
|
|
663
|
+
v(["*"]);
|
|
652
664
|
}
|
|
653
|
-
},
|
|
654
|
-
|
|
665
|
+
}, f = async () => {
|
|
666
|
+
p(!0), y("");
|
|
655
667
|
try {
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
} catch (
|
|
659
|
-
|
|
668
|
+
const i = await yt(g);
|
|
669
|
+
a(Array.isArray(i.data) ? i.data : []);
|
|
670
|
+
} catch (i) {
|
|
671
|
+
a([]), y(String((i == null ? void 0 : i.message) || i));
|
|
660
672
|
} finally {
|
|
661
|
-
|
|
673
|
+
p(!1);
|
|
662
674
|
}
|
|
663
|
-
},
|
|
675
|
+
}, x = async (i) => {
|
|
664
676
|
var $;
|
|
665
|
-
|
|
677
|
+
b(i), N("logs"), o(!0);
|
|
666
678
|
try {
|
|
667
|
-
const
|
|
668
|
-
n((($ =
|
|
669
|
-
} catch (
|
|
670
|
-
n(`加载日志失败:${String((
|
|
679
|
+
const G = await ft(i.namespace, i.name, 200);
|
|
680
|
+
n((($ = G == null ? void 0 : G.data) == null ? void 0 : $.logs) ?? "");
|
|
681
|
+
} catch (G) {
|
|
682
|
+
n(`加载日志失败:${String((G == null ? void 0 : G.message) || G)}`);
|
|
671
683
|
}
|
|
672
|
-
},
|
|
684
|
+
}, R = async (i) => {
|
|
673
685
|
try {
|
|
674
|
-
await
|
|
686
|
+
await gt(i.namespace, i.name), S.success(`${i.name} 已重启`), f();
|
|
675
687
|
} catch {
|
|
676
|
-
|
|
688
|
+
S.error("重启失败");
|
|
677
689
|
}
|
|
678
|
-
},
|
|
690
|
+
}, F = async (i) => {
|
|
679
691
|
try {
|
|
680
|
-
await
|
|
692
|
+
await bt(i.namespace, i.name), S.success(`${i.name} 已删除`), f();
|
|
681
693
|
} catch {
|
|
682
|
-
|
|
694
|
+
S.error("删除失败");
|
|
683
695
|
}
|
|
684
696
|
}, ue = [
|
|
685
697
|
{
|
|
686
698
|
title: "名称",
|
|
687
699
|
dataIndex: "name",
|
|
688
700
|
key: "name",
|
|
689
|
-
render: (
|
|
701
|
+
render: (i, $) => /* @__PURE__ */ e("a", { onClick: () => x($), children: i })
|
|
690
702
|
},
|
|
691
703
|
{ title: "命名空间", dataIndex: "namespace", key: "namespace", width: 120 },
|
|
692
704
|
{ title: "节点", dataIndex: "nodeName", key: "nodeName", width: 130 },
|
|
@@ -696,14 +708,14 @@ const bt = () => {
|
|
|
696
708
|
dataIndex: "status",
|
|
697
709
|
key: "status",
|
|
698
710
|
width: 100,
|
|
699
|
-
render: (
|
|
711
|
+
render: (i) => /* @__PURE__ */ e(re, { status: It(i), text: i })
|
|
700
712
|
},
|
|
701
713
|
{
|
|
702
714
|
title: "就绪",
|
|
703
715
|
dataIndex: "ready",
|
|
704
716
|
key: "ready",
|
|
705
717
|
width: 70,
|
|
706
|
-
render: (
|
|
718
|
+
render: (i) => i ? /* @__PURE__ */ e(O, { color: "success", children: "✓" }) : /* @__PURE__ */ e(O, { color: "error", children: "✗" })
|
|
707
719
|
},
|
|
708
720
|
{ title: "重启", dataIndex: "restartCount", key: "restartCount", width: 70 },
|
|
709
721
|
{ title: "存活", dataIndex: "age", key: "age", width: 80 },
|
|
@@ -711,35 +723,35 @@ const bt = () => {
|
|
|
711
723
|
title: "操作",
|
|
712
724
|
key: "action",
|
|
713
725
|
width: 200,
|
|
714
|
-
render: (
|
|
715
|
-
/* @__PURE__ */ e(
|
|
716
|
-
/* @__PURE__ */ e(
|
|
717
|
-
/* @__PURE__ */ e(
|
|
726
|
+
render: (i, $) => /* @__PURE__ */ s(_, { children: [
|
|
727
|
+
/* @__PURE__ */ e(I, { size: "small", icon: /* @__PURE__ */ e(Pe, {}), onClick: () => x($), children: "日志" }),
|
|
728
|
+
/* @__PURE__ */ e(B, { title: "确认重启此 Pod?", onConfirm: () => R($), children: /* @__PURE__ */ e(I, { size: "small", type: "primary", ghost: !0, children: "重启" }) }),
|
|
729
|
+
/* @__PURE__ */ e(B, { title: "确认删除此 Pod?", onConfirm: () => F($), children: /* @__PURE__ */ e(I, { size: "small", danger: !0, icon: /* @__PURE__ */ e(ce, {}), children: "删除" }) })
|
|
718
730
|
] })
|
|
719
731
|
}
|
|
720
732
|
];
|
|
721
733
|
return /* @__PURE__ */ s("div", { children: [
|
|
722
|
-
/* @__PURE__ */ s(
|
|
734
|
+
/* @__PURE__ */ s(_, { style: { marginBottom: 16 }, children: [
|
|
723
735
|
/* @__PURE__ */ e("span", { children: "命名空间:" }),
|
|
724
736
|
/* @__PURE__ */ e(
|
|
725
|
-
|
|
737
|
+
ae,
|
|
726
738
|
{
|
|
727
|
-
value:
|
|
728
|
-
onChange:
|
|
739
|
+
value: g,
|
|
740
|
+
onChange: u,
|
|
729
741
|
style: { width: 200 },
|
|
730
|
-
options:
|
|
742
|
+
options: C.map((i) => ({ label: i, value: i }))
|
|
731
743
|
}
|
|
732
744
|
),
|
|
733
|
-
/* @__PURE__ */ e(
|
|
745
|
+
/* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(Y, {}), onClick: f, loading: l, children: "刷新" })
|
|
734
746
|
] }),
|
|
735
|
-
|
|
736
|
-
|
|
747
|
+
h && /* @__PURE__ */ e(
|
|
748
|
+
V,
|
|
737
749
|
{
|
|
738
750
|
type: "error",
|
|
739
751
|
showIcon: !0,
|
|
740
752
|
style: { marginBottom: 12 },
|
|
741
753
|
message: "Pod 列表读取失败",
|
|
742
|
-
description:
|
|
754
|
+
description: h
|
|
743
755
|
}
|
|
744
756
|
),
|
|
745
757
|
/* @__PURE__ */ e(
|
|
@@ -758,27 +770,27 @@ const bt = () => {
|
|
|
758
770
|
}
|
|
759
771
|
),
|
|
760
772
|
/* @__PURE__ */ e(
|
|
761
|
-
|
|
773
|
+
fe,
|
|
762
774
|
{
|
|
763
|
-
title:
|
|
775
|
+
title: c ? `${c.name} (${c.namespace})` : "",
|
|
764
776
|
placement: "right",
|
|
765
777
|
size: "large",
|
|
766
|
-
open:
|
|
778
|
+
open: r,
|
|
767
779
|
onClose: () => o(!1),
|
|
768
780
|
children: /* @__PURE__ */ e(
|
|
769
|
-
|
|
781
|
+
ge,
|
|
770
782
|
{
|
|
771
|
-
activeKey:
|
|
783
|
+
activeKey: P,
|
|
772
784
|
onChange: N,
|
|
773
785
|
items: [
|
|
774
786
|
{
|
|
775
787
|
key: "logs",
|
|
776
788
|
label: "实时日志",
|
|
777
|
-
children:
|
|
789
|
+
children: c ? /* @__PURE__ */ e(
|
|
778
790
|
xt,
|
|
779
791
|
{
|
|
780
|
-
namespace:
|
|
781
|
-
podName:
|
|
792
|
+
namespace: c.namespace,
|
|
793
|
+
podName: c.name
|
|
782
794
|
}
|
|
783
795
|
) : null
|
|
784
796
|
},
|
|
@@ -786,10 +798,10 @@ const bt = () => {
|
|
|
786
798
|
key: "exec",
|
|
787
799
|
label: "终端",
|
|
788
800
|
children: /* @__PURE__ */ e("div", { style: { padding: 20 }, children: /* @__PURE__ */ e(
|
|
789
|
-
|
|
801
|
+
St,
|
|
790
802
|
{
|
|
791
|
-
namespace: (
|
|
792
|
-
podName: (
|
|
803
|
+
namespace: (c == null ? void 0 : c.namespace) ?? "",
|
|
804
|
+
podName: (c == null ? void 0 : c.name) ?? ""
|
|
793
805
|
}
|
|
794
806
|
) })
|
|
795
807
|
}
|
|
@@ -800,39 +812,39 @@ const bt = () => {
|
|
|
800
812
|
)
|
|
801
813
|
] });
|
|
802
814
|
};
|
|
803
|
-
async function
|
|
804
|
-
return de(`/hpa${t}`,
|
|
815
|
+
async function K(t, a) {
|
|
816
|
+
return de(`/hpa${t}`, a);
|
|
805
817
|
}
|
|
806
|
-
const
|
|
807
|
-
const [t,
|
|
808
|
-
|
|
818
|
+
const Pt = () => {
|
|
819
|
+
const [t, a] = m([]), [l, p] = m(!1), [h, y] = m(""), [g, u] = m(!1), [C, v] = m(!1), [r] = H.useForm();
|
|
820
|
+
E(() => {
|
|
809
821
|
o();
|
|
810
822
|
}, []);
|
|
811
823
|
const o = async () => {
|
|
812
|
-
|
|
824
|
+
p(!0), y("");
|
|
813
825
|
try {
|
|
814
|
-
const n = await
|
|
815
|
-
|
|
826
|
+
const n = await K("/list?namespace=*");
|
|
827
|
+
a(Array.isArray(n.data) ? n.data : []);
|
|
816
828
|
} catch (n) {
|
|
817
|
-
|
|
829
|
+
a([]), y(String((n == null ? void 0 : n.message) || n));
|
|
818
830
|
} finally {
|
|
819
|
-
|
|
831
|
+
p(!1);
|
|
820
832
|
}
|
|
821
|
-
},
|
|
822
|
-
|
|
823
|
-
},
|
|
824
|
-
|
|
833
|
+
}, c = () => {
|
|
834
|
+
v(!1), r.resetFields(), r.setFieldsValue({ minReplicas: 1, maxReplicas: 10, cpuTarget: 80 }), u(!0);
|
|
835
|
+
}, b = (n) => {
|
|
836
|
+
v(!0), r.setFieldsValue({
|
|
825
837
|
name: n.name,
|
|
826
838
|
namespace: n.namespace,
|
|
827
839
|
deploymentName: n.scaleTargetRef,
|
|
828
840
|
minReplicas: n.minReplicas,
|
|
829
841
|
maxReplicas: n.maxReplicas,
|
|
830
842
|
cpuTarget: n.cpuTarget
|
|
831
|
-
}),
|
|
832
|
-
},
|
|
843
|
+
}), u(!0);
|
|
844
|
+
}, P = async () => {
|
|
833
845
|
try {
|
|
834
|
-
const n = await
|
|
835
|
-
|
|
846
|
+
const n = await r.validateFields();
|
|
847
|
+
C ? (await K("/update", {
|
|
836
848
|
method: "POST",
|
|
837
849
|
body: JSON.stringify({
|
|
838
850
|
namespace: n.namespace,
|
|
@@ -840,33 +852,33 @@ const St = () => {
|
|
|
840
852
|
minReplicas: n.minReplicas,
|
|
841
853
|
maxReplicas: n.maxReplicas
|
|
842
854
|
})
|
|
843
|
-
}),
|
|
855
|
+
}), S.success("HPA 更新成功")) : (await K("/create", {
|
|
844
856
|
method: "POST",
|
|
845
857
|
body: JSON.stringify(n)
|
|
846
|
-
}),
|
|
858
|
+
}), S.success("HPA 创建成功")), u(!1), o();
|
|
847
859
|
} catch {
|
|
848
|
-
|
|
860
|
+
S.error("操作失败");
|
|
849
861
|
}
|
|
850
862
|
}, N = async (n) => {
|
|
851
863
|
try {
|
|
852
|
-
await
|
|
864
|
+
await K(`/delete/${n.namespace}/${n.name}`, { method: "DELETE" }), S.success("HPA 已删除"), o();
|
|
853
865
|
} catch {
|
|
854
|
-
|
|
866
|
+
S.error("删除失败");
|
|
855
867
|
}
|
|
856
868
|
};
|
|
857
869
|
return /* @__PURE__ */ s("div", { children: [
|
|
858
|
-
/* @__PURE__ */ s(
|
|
859
|
-
/* @__PURE__ */ e(
|
|
860
|
-
/* @__PURE__ */ e(
|
|
870
|
+
/* @__PURE__ */ s(_, { style: { marginBottom: 16 }, children: [
|
|
871
|
+
/* @__PURE__ */ e(I, { type: "primary", icon: /* @__PURE__ */ e(_e, {}), onClick: c, children: "新建 HPA" }),
|
|
872
|
+
/* @__PURE__ */ e(I, { icon: /* @__PURE__ */ e(Y, {}), onClick: o, loading: l, children: "刷新" })
|
|
861
873
|
] }),
|
|
862
|
-
|
|
863
|
-
|
|
874
|
+
h && /* @__PURE__ */ e(
|
|
875
|
+
V,
|
|
864
876
|
{
|
|
865
877
|
type: "error",
|
|
866
878
|
showIcon: !0,
|
|
867
879
|
style: { marginBottom: 12 },
|
|
868
880
|
message: "HPA 列表读取失败",
|
|
869
|
-
description:
|
|
881
|
+
description: h
|
|
870
882
|
}
|
|
871
883
|
),
|
|
872
884
|
/* @__PURE__ */ e(
|
|
@@ -880,12 +892,12 @@ const St = () => {
|
|
|
880
892
|
{
|
|
881
893
|
title: "副本范围",
|
|
882
894
|
key: "replicas",
|
|
883
|
-
render: (n,
|
|
884
|
-
|
|
895
|
+
render: (n, d) => /* @__PURE__ */ s("span", { children: [
|
|
896
|
+
d.minReplicas,
|
|
885
897
|
" ~ ",
|
|
886
|
-
|
|
898
|
+
d.maxReplicas,
|
|
887
899
|
" (当前: ",
|
|
888
|
-
|
|
900
|
+
d.currentReplicas ?? "-",
|
|
889
901
|
")"
|
|
890
902
|
] })
|
|
891
903
|
},
|
|
@@ -893,7 +905,7 @@ const St = () => {
|
|
|
893
905
|
title: "CPU 目标",
|
|
894
906
|
dataIndex: "cpuTarget",
|
|
895
907
|
key: "cpuTarget",
|
|
896
|
-
render: (n) => n ? /* @__PURE__ */ s(
|
|
908
|
+
render: (n) => n ? /* @__PURE__ */ s(O, { color: "blue", children: [
|
|
897
909
|
n,
|
|
898
910
|
"%"
|
|
899
911
|
] }) : "-"
|
|
@@ -902,16 +914,16 @@ const St = () => {
|
|
|
902
914
|
title: "期望副本",
|
|
903
915
|
dataIndex: "desiredReplicas",
|
|
904
916
|
key: "desired",
|
|
905
|
-
render: (n) => n ? /* @__PURE__ */ e(
|
|
917
|
+
render: (n) => n ? /* @__PURE__ */ e(O, { color: "green", children: n }) : "-"
|
|
906
918
|
},
|
|
907
919
|
{ title: "存活", dataIndex: "age", key: "age" },
|
|
908
920
|
{
|
|
909
921
|
title: "操作",
|
|
910
922
|
key: "action",
|
|
911
923
|
width: 150,
|
|
912
|
-
render: (n,
|
|
913
|
-
/* @__PURE__ */ e(
|
|
914
|
-
/* @__PURE__ */ e(
|
|
924
|
+
render: (n, d) => /* @__PURE__ */ s(_, { children: [
|
|
925
|
+
/* @__PURE__ */ e(I, { size: "small", icon: /* @__PURE__ */ e(Oe, {}), onClick: () => b(d), children: "编辑" }),
|
|
926
|
+
/* @__PURE__ */ e(B, { title: `删除 HPA ${d.name}?`, onConfirm: () => N(d), children: /* @__PURE__ */ e(I, { size: "small", danger: !0, icon: /* @__PURE__ */ e(ce, {}), children: "删除" }) })
|
|
915
927
|
] })
|
|
916
928
|
}
|
|
917
929
|
],
|
|
@@ -925,29 +937,29 @@ const St = () => {
|
|
|
925
937
|
}
|
|
926
938
|
),
|
|
927
939
|
/* @__PURE__ */ e(
|
|
928
|
-
|
|
940
|
+
be,
|
|
929
941
|
{
|
|
930
|
-
title:
|
|
931
|
-
open:
|
|
932
|
-
onOk:
|
|
933
|
-
onCancel: () =>
|
|
934
|
-
children: /* @__PURE__ */ s(
|
|
935
|
-
/* @__PURE__ */ e(
|
|
936
|
-
/* @__PURE__ */ e(
|
|
937
|
-
/* @__PURE__ */ e(
|
|
938
|
-
/* @__PURE__ */ s(
|
|
939
|
-
/* @__PURE__ */ e(
|
|
940
|
-
/* @__PURE__ */ e(
|
|
942
|
+
title: C ? "编辑 HPA" : "新建 HPA",
|
|
943
|
+
open: g,
|
|
944
|
+
onOk: P,
|
|
945
|
+
onCancel: () => u(!1),
|
|
946
|
+
children: /* @__PURE__ */ s(H, { form: r, layout: "vertical", children: [
|
|
947
|
+
/* @__PURE__ */ e(H.Item, { name: "namespace", label: "命名空间", rules: [{ required: !0 }], children: /* @__PURE__ */ e(j, { disabled: C }) }),
|
|
948
|
+
/* @__PURE__ */ e(H.Item, { name: "name", label: "HPA 名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(j, { disabled: C }) }),
|
|
949
|
+
/* @__PURE__ */ e(H.Item, { name: "deploymentName", label: "目标 Deployment", rules: [{ required: !0 }], children: /* @__PURE__ */ e(j, { disabled: C, placeholder: "namespace/deploymentName" }) }),
|
|
950
|
+
/* @__PURE__ */ s(_, { children: [
|
|
951
|
+
/* @__PURE__ */ e(H.Item, { name: "minReplicas", label: "最小副本", rules: [{ required: !0 }], children: /* @__PURE__ */ e(X, { min: 0, max: 100 }) }),
|
|
952
|
+
/* @__PURE__ */ e(H.Item, { name: "maxReplicas", label: "最大副本", rules: [{ required: !0 }], children: /* @__PURE__ */ e(X, { min: 1, max: 100 }) })
|
|
941
953
|
] }),
|
|
942
|
-
/* @__PURE__ */ e(
|
|
954
|
+
/* @__PURE__ */ e(H.Item, { name: "cpuTarget", label: "CPU 目标 (%)", children: /* @__PURE__ */ e(X, { min: 1, max: 100 }) })
|
|
943
955
|
] })
|
|
944
956
|
}
|
|
945
957
|
)
|
|
946
958
|
] });
|
|
947
|
-
},
|
|
959
|
+
}, _t = [
|
|
948
960
|
{
|
|
949
961
|
title: "DevOps 运维",
|
|
950
|
-
icon: /* @__PURE__ */ e(
|
|
962
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
951
963
|
items: [
|
|
952
964
|
{
|
|
953
965
|
key: "devops-dashboard",
|
|
@@ -959,7 +971,7 @@ const St = () => {
|
|
|
959
971
|
{
|
|
960
972
|
key: "devops-nodes",
|
|
961
973
|
label: "节点管理",
|
|
962
|
-
icon: /* @__PURE__ */ e(
|
|
974
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
963
975
|
path: "/ops/devops/nodes",
|
|
964
976
|
desc: "K8s 节点列表与状态"
|
|
965
977
|
},
|
|
@@ -973,42 +985,42 @@ const St = () => {
|
|
|
973
985
|
{
|
|
974
986
|
key: "devops-hpa",
|
|
975
987
|
label: "弹性伸缩",
|
|
976
|
-
icon: /* @__PURE__ */ e(
|
|
988
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
977
989
|
path: "/ops/devops/hpa",
|
|
978
990
|
desc: "HPA 自动扩缩容策略"
|
|
979
991
|
},
|
|
980
992
|
{
|
|
981
993
|
key: "devops-registry",
|
|
982
994
|
label: "镜像仓库",
|
|
983
|
-
icon: /* @__PURE__ */ e(
|
|
995
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
984
996
|
path: "/ops/devops/registry",
|
|
985
997
|
desc: "容器镜像统一管理"
|
|
986
998
|
},
|
|
987
999
|
{
|
|
988
1000
|
key: "devops-pipeline",
|
|
989
1001
|
label: "流水线",
|
|
990
|
-
icon: /* @__PURE__ */ e(
|
|
1002
|
+
icon: /* @__PURE__ */ e(Re, {}),
|
|
991
1003
|
path: "/ops/devops/pipeline",
|
|
992
1004
|
desc: "CI/CD 流水线编排"
|
|
993
1005
|
},
|
|
994
1006
|
{
|
|
995
1007
|
key: "devops-release",
|
|
996
1008
|
label: "发布管理",
|
|
997
|
-
icon: /* @__PURE__ */ e(
|
|
1009
|
+
icon: /* @__PURE__ */ e($e, {}),
|
|
998
1010
|
path: "/ops/devops/release",
|
|
999
1011
|
desc: "应用发布与回滚"
|
|
1000
1012
|
},
|
|
1001
1013
|
{
|
|
1002
1014
|
key: "devops-monitor",
|
|
1003
1015
|
label: "监控告警",
|
|
1004
|
-
icon: /* @__PURE__ */ e(
|
|
1016
|
+
icon: /* @__PURE__ */ e(Ae, {}),
|
|
1005
1017
|
path: "/ops/devops/monitor",
|
|
1006
1018
|
desc: "Prometheus/Grafana 监控"
|
|
1007
1019
|
},
|
|
1008
1020
|
{
|
|
1009
1021
|
key: "devops-logs",
|
|
1010
1022
|
label: "日志管理",
|
|
1011
|
-
icon: /* @__PURE__ */ e(
|
|
1023
|
+
icon: /* @__PURE__ */ e(Ne, {}),
|
|
1012
1024
|
path: "/ops/devops/logs",
|
|
1013
1025
|
desc: "Loki 集中日志查询"
|
|
1014
1026
|
},
|
|
@@ -1023,7 +1035,7 @@ const St = () => {
|
|
|
1023
1035
|
},
|
|
1024
1036
|
{
|
|
1025
1037
|
title: "基础设施",
|
|
1026
|
-
icon: /* @__PURE__ */ e(
|
|
1038
|
+
icon: /* @__PURE__ */ e(J, {}),
|
|
1027
1039
|
items: [
|
|
1028
1040
|
{
|
|
1029
1041
|
key: "ops-channel",
|
|
@@ -1035,7 +1047,7 @@ const St = () => {
|
|
|
1035
1047
|
{
|
|
1036
1048
|
key: "ops-env",
|
|
1037
1049
|
label: "环境管理",
|
|
1038
|
-
icon: /* @__PURE__ */ e(
|
|
1050
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1039
1051
|
path: "/ops/delivery",
|
|
1040
1052
|
desc: "运行环境配置与管理"
|
|
1041
1053
|
},
|
|
@@ -1057,19 +1069,19 @@ const St = () => {
|
|
|
1057
1069
|
},
|
|
1058
1070
|
{
|
|
1059
1071
|
title: "资源管理",
|
|
1060
|
-
icon: /* @__PURE__ */ e(
|
|
1072
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1061
1073
|
items: [
|
|
1062
1074
|
{
|
|
1063
1075
|
key: "resource",
|
|
1064
1076
|
label: "资源管理",
|
|
1065
|
-
icon: /* @__PURE__ */ e(
|
|
1077
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
1066
1078
|
path: "/resource/domain",
|
|
1067
1079
|
desc: "域名、ECS、RDS、OSS 管理"
|
|
1068
1080
|
}
|
|
1069
1081
|
]
|
|
1070
1082
|
}
|
|
1071
1083
|
];
|
|
1072
|
-
function
|
|
1084
|
+
function L({ label: t }) {
|
|
1073
1085
|
return /* @__PURE__ */ s("div", { style: { padding: 40, textAlign: "center", color: "#999" }, children: [
|
|
1074
1086
|
/* @__PURE__ */ s("h2", { children: [
|
|
1075
1087
|
"🚧 ",
|
|
@@ -1078,26 +1090,26 @@ function D({ label: t }) {
|
|
|
1078
1090
|
/* @__PURE__ */ e("p", { children: "功能开发中..." })
|
|
1079
1091
|
] });
|
|
1080
1092
|
}
|
|
1081
|
-
function
|
|
1093
|
+
function Ot({ label: t, reason: a, message: l = "该页面未孵化,因为后端接口尚不可用" }) {
|
|
1082
1094
|
return /* @__PURE__ */ s("div", { style: { padding: 40, maxWidth: 720, margin: "0 auto" }, children: [
|
|
1083
1095
|
/* @__PURE__ */ s("h2", { style: { textAlign: "center" }, children: [
|
|
1084
1096
|
"🧪 ",
|
|
1085
1097
|
t
|
|
1086
1098
|
] }),
|
|
1087
1099
|
/* @__PURE__ */ e(
|
|
1088
|
-
|
|
1100
|
+
V,
|
|
1089
1101
|
{
|
|
1090
1102
|
type: "warning",
|
|
1091
1103
|
showIcon: !0,
|
|
1092
1104
|
message: l,
|
|
1093
|
-
description:
|
|
1105
|
+
description: a
|
|
1094
1106
|
}
|
|
1095
1107
|
)
|
|
1096
1108
|
] });
|
|
1097
1109
|
}
|
|
1098
|
-
function
|
|
1110
|
+
function A({ label: t }) {
|
|
1099
1111
|
return /* @__PURE__ */ e(
|
|
1100
|
-
|
|
1112
|
+
Ot,
|
|
1101
1113
|
{
|
|
1102
1114
|
label: t,
|
|
1103
1115
|
message: "该页面未孵化,因为组件从来不在本仓",
|
|
@@ -1107,19 +1119,19 @@ function O({ label: t }) {
|
|
|
1107
1119
|
}
|
|
1108
1120
|
function ne() {
|
|
1109
1121
|
const { pathname: t } = se();
|
|
1110
|
-
return /* @__PURE__ */ e(
|
|
1122
|
+
return /* @__PURE__ */ e(q, { to: t, replace: !0 });
|
|
1111
1123
|
}
|
|
1112
|
-
const
|
|
1124
|
+
const Rt = [...ze, "/script"], $t = [
|
|
1113
1125
|
// ─── 运维中心 ───
|
|
1114
1126
|
// ⚠ 这一族路由的组件从来没有从 z-ops 迁进来(见 UnmigratedPage 注释)。原先直接写
|
|
1115
1127
|
// <ChannelPage/> 之类会在**模块求值期**抛 ReferenceError 并白屏整个前端,不是只坏这一页。
|
|
1116
|
-
{ path: "/ops", element: /* @__PURE__ */ e(
|
|
1117
|
-
{ path: "/ops/channel", element: /* @__PURE__ */ e(
|
|
1118
|
-
{ path: "/ops/delivery", element: /* @__PURE__ */ e(
|
|
1119
|
-
{ path: "/ops/deployment", element: /* @__PURE__ */ e(
|
|
1120
|
-
{ path: "/ops/deployment/:id", element: /* @__PURE__ */ e(
|
|
1121
|
-
{ path: "/ops/repo-mgmt", element: /* @__PURE__ */ e(
|
|
1122
|
-
{ path: "/ops/git-platform", element: /* @__PURE__ */ e(
|
|
1128
|
+
{ path: "/ops", element: /* @__PURE__ */ e(q, { to: "/ops/devops", replace: !0 }) },
|
|
1129
|
+
{ path: "/ops/channel", element: /* @__PURE__ */ e(A, { label: "渠道管理" }) },
|
|
1130
|
+
{ path: "/ops/delivery", element: /* @__PURE__ */ e(A, { label: "环境管理" }) },
|
|
1131
|
+
{ path: "/ops/deployment", element: /* @__PURE__ */ e(A, { label: "部署管理" }) },
|
|
1132
|
+
{ path: "/ops/deployment/:id", element: /* @__PURE__ */ e(A, { label: "部署管理" }) },
|
|
1133
|
+
{ path: "/ops/repo-mgmt", element: /* @__PURE__ */ e(A, { label: "仓库管理" }) },
|
|
1134
|
+
{ path: "/ops/git-platform", element: /* @__PURE__ */ e(A, { label: "仓库管理" }) },
|
|
1123
1135
|
// ─── DevOps 子路由(K8s 管理面:2026-11-09 复活,数据源改由主壳 OpsK8sController 提供)───
|
|
1124
1136
|
// ⚠ 历史:这 4 条曾挂真组件,但 API_BASE '/z-team/ops/k8s' 的 handler 只在 z-ops 仓的
|
|
1125
1137
|
// z-ops-web 里,主壳 boot jar 的 BOOT-INF/lib 里 0 个 z-ops-* ⇒ 实测 GET /z-team/ops/k8s/nodes
|
|
@@ -1130,47 +1142,47 @@ const Pt = [...Ge, "/script"], _t = [
|
|
|
1130
1142
|
// ⇒ 占位卡换成真组件。为什么不反向代理 z-ops:它的接口走 SSO(实测 302 → /login),
|
|
1131
1143
|
// 而两侧 JWT secret 不同(主壳 zgw-jwt/jwt-secret vs z-ops sso-jwt/sso-jwt-secret)⇒ 必被挡;
|
|
1132
1144
|
// 给 z-ops 加 @NoLogin 又等于把「删 Pod / 改 HPA」公开到 NodePort 30886。
|
|
1133
|
-
{ path: "/ops/devops", element: /* @__PURE__ */ e(
|
|
1134
|
-
{ path: "/ops/devops/dashboard", element: /* @__PURE__ */ e(
|
|
1135
|
-
{ path: "/ops/devops/nodes", element: /* @__PURE__ */ e(
|
|
1136
|
-
{ path: "/ops/devops/pods", element: /* @__PURE__ */ e(
|
|
1137
|
-
{ path: "/ops/devops/hpa", element: /* @__PURE__ */ e(
|
|
1138
|
-
{ path: "/ops/devops/registry", element: /* @__PURE__ */ e(
|
|
1139
|
-
{ path: "/ops/devops/pipeline", element: /* @__PURE__ */ e(
|
|
1140
|
-
{ path: "/ops/devops/release", element: /* @__PURE__ */ e(
|
|
1141
|
-
{ path: "/ops/devops/monitor", element: /* @__PURE__ */ e(
|
|
1142
|
-
{ path: "/ops/devops/logs", element: /* @__PURE__ */ e(
|
|
1143
|
-
{ path: "/ops/devops/dba", element: /* @__PURE__ */ e(
|
|
1145
|
+
{ path: "/ops/devops", element: /* @__PURE__ */ e(q, { to: "/ops/devops/dashboard", replace: !0 }) },
|
|
1146
|
+
{ path: "/ops/devops/dashboard", element: /* @__PURE__ */ e(kt, {}) },
|
|
1147
|
+
{ path: "/ops/devops/nodes", element: /* @__PURE__ */ e(vt, {}) },
|
|
1148
|
+
{ path: "/ops/devops/pods", element: /* @__PURE__ */ e(Ct, {}) },
|
|
1149
|
+
{ path: "/ops/devops/hpa", element: /* @__PURE__ */ e(Pt, {}) },
|
|
1150
|
+
{ path: "/ops/devops/registry", element: /* @__PURE__ */ e(L, { label: "镜像仓库" }) },
|
|
1151
|
+
{ path: "/ops/devops/pipeline", element: /* @__PURE__ */ e(L, { label: "流水线" }) },
|
|
1152
|
+
{ path: "/ops/devops/release", element: /* @__PURE__ */ e(L, { label: "发布管理" }) },
|
|
1153
|
+
{ path: "/ops/devops/monitor", element: /* @__PURE__ */ e(L, { label: "监控告警" }) },
|
|
1154
|
+
{ path: "/ops/devops/logs", element: /* @__PURE__ */ e(L, { label: "日志管理" }) },
|
|
1155
|
+
{ path: "/ops/devops/dba", element: /* @__PURE__ */ e(L, { label: "DBA 工单" }) },
|
|
1144
1156
|
// ─── 资源管理 ───
|
|
1145
|
-
{ path: "/resource", element: /* @__PURE__ */ e(
|
|
1146
|
-
{ path: "/resource/domain", element: /* @__PURE__ */ e(
|
|
1147
|
-
{ path: "/resource/ecs", element: /* @__PURE__ */ e(
|
|
1148
|
-
{ path: "/resource/rds", element: /* @__PURE__ */ e(
|
|
1149
|
-
{ path: "/resource/oss", element: /* @__PURE__ */ e(
|
|
1157
|
+
{ path: "/resource", element: /* @__PURE__ */ e(q, { to: "/resource/domain", replace: !0 }) },
|
|
1158
|
+
{ path: "/resource/domain", element: /* @__PURE__ */ e(A, { label: "域名管理" }) },
|
|
1159
|
+
{ path: "/resource/ecs", element: /* @__PURE__ */ e(A, { label: "ECS 管理" }) },
|
|
1160
|
+
{ path: "/resource/rds", element: /* @__PURE__ */ e(A, { label: "RDS 管理" }) },
|
|
1161
|
+
{ path: "/resource/oss", element: /* @__PURE__ */ e(A, { label: "OSS 管理" }) },
|
|
1150
1162
|
// ─── 已迁到中间件面的前缀 → 旧深链交还中间件面 ───
|
|
1151
1163
|
// ⚠ 必须排在最后:matchWorkbenchPath 先全表精确、再全表通配,
|
|
1152
1164
|
// 但本面自己的 /ops/* 与 /resource/* 都在前面,不会被这几条吃掉。
|
|
1153
|
-
...
|
|
1165
|
+
...Rt.flatMap((t) => [
|
|
1154
1166
|
{ path: t, element: /* @__PURE__ */ e(ne, {}) },
|
|
1155
1167
|
{ path: `${t}/*`, element: /* @__PURE__ */ e(ne, {}) }
|
|
1156
1168
|
])
|
|
1157
1169
|
];
|
|
1158
|
-
function
|
|
1170
|
+
function Mt({
|
|
1159
1171
|
activePathOverride: t,
|
|
1160
|
-
menuOnly:
|
|
1172
|
+
menuOnly: a = !1
|
|
1161
1173
|
} = {}) {
|
|
1162
1174
|
return /* @__PURE__ */ e(
|
|
1163
|
-
|
|
1175
|
+
it,
|
|
1164
1176
|
{
|
|
1165
|
-
groups:
|
|
1166
|
-
routes:
|
|
1177
|
+
groups: _t,
|
|
1178
|
+
routes: $t,
|
|
1167
1179
|
mode: "ops",
|
|
1168
1180
|
emptyText: "请从左侧菜单选择运维模块",
|
|
1169
1181
|
activePathOverride: t,
|
|
1170
|
-
menuOnly:
|
|
1182
|
+
menuOnly: a
|
|
1171
1183
|
}
|
|
1172
1184
|
);
|
|
1173
1185
|
}
|
|
1174
1186
|
export {
|
|
1175
|
-
|
|
1187
|
+
Mt as default
|
|
1176
1188
|
};
|