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