@yuku123/z-ops-frontend-component 0.1.0
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/z-ops-component.es.js +758 -0
- package/dist/z-ops-component.umd.js +23 -0
- package/package.json +56 -0
- package/src/api.js +113 -0
- package/src/components/ChannelPage/index.jsx +80 -0
- package/src/components/DeliveryPage/index.jsx +78 -0
- package/src/components/DeploymentPage/index.jsx +79 -0
- package/src/components/DomainPage/index.jsx +18 -0
- package/src/components/EcsPage/index.jsx +18 -0
- package/src/components/RdOpsPage/index.jsx +39 -0
- package/src/components/RdsPage/index.jsx +18 -0
- package/src/components/ResourceOssPage/index.jsx +36 -0
- package/src/components/SprintPage/index.jsx +18 -0
- package/src/components/TaskPage/index.jsx +42 -0
- package/src/index.js +37 -0
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
import Ie, { useState as h, useEffect as B } from "react";
|
|
2
|
+
import { Form as i, Button as I, Table as V, Drawer as J, Input as w, Select as E, Space as L, InputNumber as ge, message as T, Tag as z, Modal as ne, Switch as ke, Empty as K } from "antd";
|
|
3
|
+
import { PlusOutlined as ae, EditOutlined as se, DeleteOutlined as le, SyncOutlined as Se, PlayCircleOutlined as Re, FolderOpenOutlined as Te, ReloadOutlined as fe, GlobalOutlined as Ae, DesktopOutlined as _e, DatabaseOutlined as Oe, ToolOutlined as Ce, CalendarOutlined as De } from "@ant-design/icons";
|
|
4
|
+
import Pe from "axios";
|
|
5
|
+
var q = { exports: {} }, U = {};
|
|
6
|
+
/**
|
|
7
|
+
* @license React
|
|
8
|
+
* react-jsx-runtime.production.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
var he;
|
|
16
|
+
function Ne() {
|
|
17
|
+
if (he) return U;
|
|
18
|
+
he = 1;
|
|
19
|
+
var r = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
|
|
20
|
+
function v(j, u, o) {
|
|
21
|
+
var p = null;
|
|
22
|
+
if (o !== void 0 && (p = "" + o), u.key !== void 0 && (p = "" + u.key), "key" in u) {
|
|
23
|
+
o = {};
|
|
24
|
+
for (var x in u)
|
|
25
|
+
x !== "key" && (o[x] = u[x]);
|
|
26
|
+
} else o = u;
|
|
27
|
+
return u = o.ref, {
|
|
28
|
+
$$typeof: r,
|
|
29
|
+
type: j,
|
|
30
|
+
key: p,
|
|
31
|
+
ref: u !== void 0 ? u : null,
|
|
32
|
+
props: o
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return U.Fragment = c, U.jsx = v, U.jsxs = v, U;
|
|
36
|
+
}
|
|
37
|
+
var W = {};
|
|
38
|
+
/**
|
|
39
|
+
* @license React
|
|
40
|
+
* react-jsx-runtime.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
47
|
+
var xe;
|
|
48
|
+
function Le() {
|
|
49
|
+
return xe || (xe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
50
|
+
function r(t) {
|
|
51
|
+
if (t == null) return null;
|
|
52
|
+
if (typeof t == "function")
|
|
53
|
+
return t.$$typeof === we ? null : t.displayName || t.name || null;
|
|
54
|
+
if (typeof t == "string") return t;
|
|
55
|
+
switch (t) {
|
|
56
|
+
case m:
|
|
57
|
+
return "Fragment";
|
|
58
|
+
case d:
|
|
59
|
+
return "Profiler";
|
|
60
|
+
case O:
|
|
61
|
+
return "StrictMode";
|
|
62
|
+
case k:
|
|
63
|
+
return "Suspense";
|
|
64
|
+
case D:
|
|
65
|
+
return "SuspenseList";
|
|
66
|
+
case be:
|
|
67
|
+
return "Activity";
|
|
68
|
+
}
|
|
69
|
+
if (typeof t == "object")
|
|
70
|
+
switch (typeof t.tag == "number" && console.error(
|
|
71
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
|
+
), t.$$typeof) {
|
|
73
|
+
case P:
|
|
74
|
+
return "Portal";
|
|
75
|
+
case H:
|
|
76
|
+
return t.displayName || "Context";
|
|
77
|
+
case C:
|
|
78
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
79
|
+
case X:
|
|
80
|
+
var s = t.render;
|
|
81
|
+
return t = t.displayName, t || (t = s.displayName || s.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
82
|
+
case ye:
|
|
83
|
+
return s = t.displayName || null, s !== null ? s : r(t.type) || "Memo";
|
|
84
|
+
case Z:
|
|
85
|
+
s = t._payload, t = t._init;
|
|
86
|
+
try {
|
|
87
|
+
return r(t(s));
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
function c(t) {
|
|
94
|
+
return "" + t;
|
|
95
|
+
}
|
|
96
|
+
function v(t) {
|
|
97
|
+
try {
|
|
98
|
+
c(t);
|
|
99
|
+
var s = !1;
|
|
100
|
+
} catch {
|
|
101
|
+
s = !0;
|
|
102
|
+
}
|
|
103
|
+
if (s) {
|
|
104
|
+
s = console;
|
|
105
|
+
var f = s.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
106
|
+
return f.call(
|
|
107
|
+
s,
|
|
108
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
+
y
|
|
110
|
+
), c(t);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function j(t) {
|
|
114
|
+
if (t === m) return "<>";
|
|
115
|
+
if (typeof t == "object" && t !== null && t.$$typeof === Z)
|
|
116
|
+
return "<...>";
|
|
117
|
+
try {
|
|
118
|
+
var s = r(t);
|
|
119
|
+
return s ? "<" + s + ">" : "<...>";
|
|
120
|
+
} catch {
|
|
121
|
+
return "<...>";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function u() {
|
|
125
|
+
var t = Q.A;
|
|
126
|
+
return t === null ? null : t.getOwner();
|
|
127
|
+
}
|
|
128
|
+
function o() {
|
|
129
|
+
return Error("react-stack-top-frame");
|
|
130
|
+
}
|
|
131
|
+
function p(t) {
|
|
132
|
+
if (ie.call(t, "key")) {
|
|
133
|
+
var s = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
134
|
+
if (s && s.isReactWarning) return !1;
|
|
135
|
+
}
|
|
136
|
+
return t.key !== void 0;
|
|
137
|
+
}
|
|
138
|
+
function x(t, s) {
|
|
139
|
+
function f() {
|
|
140
|
+
oe || (oe = !0, console.error(
|
|
141
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
142
|
+
s
|
|
143
|
+
));
|
|
144
|
+
}
|
|
145
|
+
f.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
146
|
+
get: f,
|
|
147
|
+
configurable: !0
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function g() {
|
|
151
|
+
var t = r(this.type);
|
|
152
|
+
return de[t] || (de[t] = !0, console.error(
|
|
153
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
155
|
+
}
|
|
156
|
+
function R(t, s, f, y, M, te) {
|
|
157
|
+
var b = f.ref;
|
|
158
|
+
return t = {
|
|
159
|
+
$$typeof: _,
|
|
160
|
+
type: t,
|
|
161
|
+
key: s,
|
|
162
|
+
props: f,
|
|
163
|
+
_owner: y
|
|
164
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(t, "ref", {
|
|
165
|
+
enumerable: !1,
|
|
166
|
+
get: g
|
|
167
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
168
|
+
configurable: !1,
|
|
169
|
+
enumerable: !1,
|
|
170
|
+
writable: !0,
|
|
171
|
+
value: 0
|
|
172
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
173
|
+
configurable: !1,
|
|
174
|
+
enumerable: !1,
|
|
175
|
+
writable: !0,
|
|
176
|
+
value: null
|
|
177
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
178
|
+
configurable: !1,
|
|
179
|
+
enumerable: !1,
|
|
180
|
+
writable: !0,
|
|
181
|
+
value: M
|
|
182
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
183
|
+
configurable: !1,
|
|
184
|
+
enumerable: !1,
|
|
185
|
+
writable: !0,
|
|
186
|
+
value: te
|
|
187
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
188
|
+
}
|
|
189
|
+
function l(t, s, f, y, M, te) {
|
|
190
|
+
var b = s.children;
|
|
191
|
+
if (b !== void 0)
|
|
192
|
+
if (y)
|
|
193
|
+
if (ve(b)) {
|
|
194
|
+
for (y = 0; y < b.length; y++)
|
|
195
|
+
S(b[y]);
|
|
196
|
+
Object.freeze && Object.freeze(b);
|
|
197
|
+
} else
|
|
198
|
+
console.error(
|
|
199
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
200
|
+
);
|
|
201
|
+
else S(b);
|
|
202
|
+
if (ie.call(s, "key")) {
|
|
203
|
+
b = r(t);
|
|
204
|
+
var F = Object.keys(s).filter(function(Ee) {
|
|
205
|
+
return Ee !== "key";
|
|
206
|
+
});
|
|
207
|
+
y = 0 < F.length ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}", pe[b + y] || (F = 0 < F.length ? "{" + F.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s {...props} />
|
|
211
|
+
React keys must be passed directly to JSX without using spread:
|
|
212
|
+
let props = %s;
|
|
213
|
+
<%s key={someKey} {...props} />`,
|
|
214
|
+
y,
|
|
215
|
+
b,
|
|
216
|
+
F,
|
|
217
|
+
b
|
|
218
|
+
), pe[b + y] = !0);
|
|
219
|
+
}
|
|
220
|
+
if (b = null, f !== void 0 && (v(f), b = "" + f), p(s) && (v(s.key), b = "" + s.key), "key" in s) {
|
|
221
|
+
f = {};
|
|
222
|
+
for (var re in s)
|
|
223
|
+
re !== "key" && (f[re] = s[re]);
|
|
224
|
+
} else f = s;
|
|
225
|
+
return b && x(
|
|
226
|
+
f,
|
|
227
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
228
|
+
), R(
|
|
229
|
+
t,
|
|
230
|
+
b,
|
|
231
|
+
f,
|
|
232
|
+
u(),
|
|
233
|
+
M,
|
|
234
|
+
te
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
function S(t) {
|
|
238
|
+
N(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === Z && (t._payload.status === "fulfilled" ? N(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
239
|
+
}
|
|
240
|
+
function N(t) {
|
|
241
|
+
return typeof t == "object" && t !== null && t.$$typeof === _;
|
|
242
|
+
}
|
|
243
|
+
var A = Ie, _ = Symbol.for("react.transitional.element"), P = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), H = Symbol.for("react.context"), X = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), ye = Symbol.for("react.memo"), Z = Symbol.for("react.lazy"), be = Symbol.for("react.activity"), we = Symbol.for("react.client.reference"), Q = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ie = Object.prototype.hasOwnProperty, ve = Array.isArray, ee = console.createTask ? console.createTask : function() {
|
|
244
|
+
return null;
|
|
245
|
+
};
|
|
246
|
+
A = {
|
|
247
|
+
react_stack_bottom_frame: function(t) {
|
|
248
|
+
return t();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
var oe, de = {}, ce = A.react_stack_bottom_frame.bind(
|
|
252
|
+
A,
|
|
253
|
+
o
|
|
254
|
+
)(), ue = ee(j(o)), pe = {};
|
|
255
|
+
W.Fragment = m, W.jsx = function(t, s, f) {
|
|
256
|
+
var y = 1e4 > Q.recentlyCreatedOwnerStacks++;
|
|
257
|
+
return l(
|
|
258
|
+
t,
|
|
259
|
+
s,
|
|
260
|
+
f,
|
|
261
|
+
!1,
|
|
262
|
+
y ? Error("react-stack-top-frame") : ce,
|
|
263
|
+
y ? ee(j(t)) : ue
|
|
264
|
+
);
|
|
265
|
+
}, W.jsxs = function(t, s, f) {
|
|
266
|
+
var y = 1e4 > Q.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return l(
|
|
268
|
+
t,
|
|
269
|
+
s,
|
|
270
|
+
f,
|
|
271
|
+
!0,
|
|
272
|
+
y ? Error("react-stack-top-frame") : ce,
|
|
273
|
+
y ? ee(j(t)) : ue
|
|
274
|
+
);
|
|
275
|
+
};
|
|
276
|
+
})()), W;
|
|
277
|
+
}
|
|
278
|
+
var me;
|
|
279
|
+
function ze() {
|
|
280
|
+
return me || (me = 1, process.env.NODE_ENV === "production" ? q.exports = Ne() : q.exports = Le()), q.exports;
|
|
281
|
+
}
|
|
282
|
+
var e = ze();
|
|
283
|
+
let je = "/api";
|
|
284
|
+
function Me(r) {
|
|
285
|
+
je = r || "/api";
|
|
286
|
+
}
|
|
287
|
+
function n() {
|
|
288
|
+
return Pe.create({ baseURL: je, timeout: 1e4 });
|
|
289
|
+
}
|
|
290
|
+
const a = (r) => {
|
|
291
|
+
const c = r.data;
|
|
292
|
+
return c && typeof c == "object" && "code" in c && "data" in c ? c.code !== 0 && c.code !== 200 ? Promise.reject(new Error(c.msg || c.message || "请求失败")) : c.data : c;
|
|
293
|
+
}, $ = {
|
|
294
|
+
list: () => n().get("/ops/deployment/list").then(a),
|
|
295
|
+
get: (r) => n().get(`/ops/deployment/${r}`).then(a),
|
|
296
|
+
create: (r) => n().post("/ops/deployment", r).then(a),
|
|
297
|
+
update: (r) => n().put("/ops/deployment", r).then(a),
|
|
298
|
+
delete: (r) => n().delete(`/ops/deployment/${r}`).then(a),
|
|
299
|
+
deploy: (r) => n().post(`/ops/deployment/deploy/${r}`).then(a),
|
|
300
|
+
log: (r) => n().get(`/ops/deployment/log/${r}`).then(a)
|
|
301
|
+
}, Y = {
|
|
302
|
+
list: () => n().get("/ops/target/list").then(a),
|
|
303
|
+
get: (r) => n().get(`/ops/target/${r}`).then(a),
|
|
304
|
+
create: (r) => n().post("/ops/target", r).then(a),
|
|
305
|
+
update: (r) => n().put("/ops/target", r).then(a),
|
|
306
|
+
delete: (r) => n().delete(`/ops/target/${r}`).then(a)
|
|
307
|
+
}, G = {
|
|
308
|
+
list: () => n().get("/ops/environment/list").then(a),
|
|
309
|
+
get: (r) => n().get(`/ops/environment/${r}`).then(a),
|
|
310
|
+
create: (r) => n().post("/ops/environment", r).then(a),
|
|
311
|
+
update: (r) => n().put("/ops/environment", r).then(a),
|
|
312
|
+
delete: (r) => n().delete(`/ops/environment/${r}`).then(a)
|
|
313
|
+
}, Be = {
|
|
314
|
+
list: (r) => n().get("/ops/record/list", { params: r ? { unitId: r } : {} }).then(a),
|
|
315
|
+
get: (r) => n().get(`/ops/record/${r}`).then(a)
|
|
316
|
+
}, qe = {
|
|
317
|
+
list: (r) => n().get("/ops/webhook/list", { params: r ? { unitId: r } : {} }).then(a),
|
|
318
|
+
create: (r) => n().post("/ops/webhook", r).then(a),
|
|
319
|
+
update: (r) => n().put("/ops/webhook", r).then(a),
|
|
320
|
+
delete: (r) => n().delete(`/ops/webhook/${r}`).then(a),
|
|
321
|
+
url: (r) => n().get(`/ops/webhook/url/${r}`).then(a)
|
|
322
|
+
}, Ge = {
|
|
323
|
+
page: (r) => n().post("/image/page", r).then(a),
|
|
324
|
+
list: () => n().get("/image/list").then(a),
|
|
325
|
+
get: (r) => n().get("/image/get", { params: { id: r } }).then(a),
|
|
326
|
+
add: (r) => n().post("/image", r).then(a),
|
|
327
|
+
update: (r) => n().post("/image/update", r).then(a),
|
|
328
|
+
delete: (r) => n().post("/image/delete", null, { params: { id: r } }).then(a),
|
|
329
|
+
tags: (r) => n().get("/image/tags", { params: { imageId: r } }).then(a),
|
|
330
|
+
addTag: (r) => n().post("/image/tag", r).then(a),
|
|
331
|
+
deleteTag: (r) => n().post("/image/tag/delete", null, { params: { id: r } }).then(a)
|
|
332
|
+
}, Je = {
|
|
333
|
+
list: (r) => n().get("/ops/image-tag/list", { params: { imageId: r } }).then(a),
|
|
334
|
+
create: (r) => n().post("/ops/image-tag", r).then(a),
|
|
335
|
+
delete: (r) => n().delete(`/ops/image-tag/${r}`).then(a)
|
|
336
|
+
}, Fe = {
|
|
337
|
+
page: (r) => n().post("/image-build/page", r).then(a),
|
|
338
|
+
list: () => n().get("/image-build/list").then(a),
|
|
339
|
+
get: (r) => n().get("/image-build/get", { params: { id: r } }).then(a),
|
|
340
|
+
add: (r) => n().post("/image-build", r).then(a)
|
|
341
|
+
}, $e = {
|
|
342
|
+
list: () => n().get("/v1/bucket").then(a)
|
|
343
|
+
}, Ke = () => {
|
|
344
|
+
const [r, c] = h([]), [v, j] = h(!1), [u, o] = h(!1), [p, x] = h(null), [g] = i.useForm(), R = async () => {
|
|
345
|
+
j(!0);
|
|
346
|
+
try {
|
|
347
|
+
c(await Y.list() || []);
|
|
348
|
+
} catch {
|
|
349
|
+
T.error("加载失败");
|
|
350
|
+
} finally {
|
|
351
|
+
j(!1);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
B(() => {
|
|
355
|
+
R();
|
|
356
|
+
}, []);
|
|
357
|
+
const l = () => {
|
|
358
|
+
x(null), g.resetFields(), g.setFieldsValue({ type: "k8s", status: "ENABLE", port: 22 }), o(!0);
|
|
359
|
+
}, S = (m) => {
|
|
360
|
+
x(m), g.setFieldsValue(m), o(!0);
|
|
361
|
+
}, N = (m) => {
|
|
362
|
+
ne.confirm({ title: "确认删除", content: `删除 ${m.name}?`, onOk: async () => {
|
|
363
|
+
await Y.delete(m.id), T.success("删除成功"), R();
|
|
364
|
+
} });
|
|
365
|
+
}, A = async () => {
|
|
366
|
+
try {
|
|
367
|
+
const m = await g.validateFields();
|
|
368
|
+
p ? await Y.update({ ...m, id: p.id }) : await Y.create(m), T.success(p ? "更新成功" : "创建成功"), o(!1), R();
|
|
369
|
+
} catch {
|
|
370
|
+
}
|
|
371
|
+
}, _ = { k8s: { text: "K8s", color: "blue" }, docker: { text: "Docker", color: "cyan" }, vm: { text: "VM", color: "orange" }, serverless: { text: "Serverless", color: "purple" } }, P = [
|
|
372
|
+
{ title: "名称", dataIndex: "name", width: 150 },
|
|
373
|
+
{ title: "类型", dataIndex: "type", width: 110, render: (m) => {
|
|
374
|
+
const O = _[m] || { text: m, color: "default" };
|
|
375
|
+
return /* @__PURE__ */ e.jsx(z, { color: O.color, children: O.text });
|
|
376
|
+
} },
|
|
377
|
+
{ title: "主机", dataIndex: "host", ellipsis: !0 },
|
|
378
|
+
{ title: "端口", dataIndex: "port", width: 70 },
|
|
379
|
+
{ title: "命名空间", dataIndex: "namespace", width: 120 },
|
|
380
|
+
{ title: "状态", dataIndex: "status", width: 80, render: (m) => /* @__PURE__ */ e.jsx(z, { color: m === "ENABLE" ? "green" : "red", children: m === "ENABLE" ? "启用" : "禁用" }) },
|
|
381
|
+
{ title: "操作", width: 160, render: (m, O) => /* @__PURE__ */ e.jsxs(L, { size: "small", children: [
|
|
382
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", icon: /* @__PURE__ */ e.jsx(se, {}), onClick: () => S(O), children: "编辑" }),
|
|
383
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", danger: !0, icon: /* @__PURE__ */ e.jsx(le, {}), onClick: () => N(O), children: "删除" })
|
|
384
|
+
] }) }
|
|
385
|
+
];
|
|
386
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
387
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
388
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
389
|
+
/* @__PURE__ */ e.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "渠道管理" }),
|
|
390
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "管理部署目标 (Kubernetes / Docker / VM)" })
|
|
391
|
+
] }),
|
|
392
|
+
/* @__PURE__ */ e.jsx(I, { type: "primary", icon: /* @__PURE__ */ e.jsx(ae, {}), onClick: l, children: "新建渠道" })
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 16 }, children: /* @__PURE__ */ e.jsx(V, { columns: P, dataSource: r, loading: v, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无部署目标" } }) }),
|
|
395
|
+
/* @__PURE__ */ e.jsx(J, { title: p ? "编辑渠道" : "新建渠道", placement: "right", width: 520, open: u, onClose: () => o(!1), children: /* @__PURE__ */ e.jsxs(i, { form: g, layout: "vertical", onFinish: A, children: [
|
|
396
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "name", label: "名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(w, { placeholder: "如: prod-k8s-cluster" }) }),
|
|
397
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "type", label: "类型", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsxs(E, { children: [
|
|
398
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "k8s", children: "Kubernetes" }),
|
|
399
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "docker", children: "Docker" }),
|
|
400
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "vm", children: "虚拟机" }),
|
|
401
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "serverless", children: "Serverless" })
|
|
402
|
+
] }) }),
|
|
403
|
+
/* @__PURE__ */ e.jsxs(L, { style: { display: "flex" }, size: "middle", children: [
|
|
404
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "host", label: "主机地址", rules: [{ required: !0 }], style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(w, { placeholder: "192.168.1.100" }) }),
|
|
405
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "port", label: "端口", children: /* @__PURE__ */ e.jsx(ge, { min: 1, max: 65535 }) })
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ e.jsxs(L, { style: { display: "flex" }, size: "middle", children: [
|
|
408
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "username", label: "用户名", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(w, { placeholder: "root" }) }),
|
|
409
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "namespace", label: "命名空间", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(w, { placeholder: "default" }) })
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "authPath", label: "密钥路径", children: /* @__PURE__ */ e.jsx(w, { placeholder: "~/.ssh/id_rsa" }) }),
|
|
412
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 2 }) }),
|
|
413
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "status", label: "状态", initialValue: "ENABLE", children: /* @__PURE__ */ e.jsxs(E, { children: [
|
|
414
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "ENABLE", children: "启用" }),
|
|
415
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "DISABLE", children: "禁用" })
|
|
416
|
+
] }) }),
|
|
417
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.06)" }, children: [
|
|
418
|
+
/* @__PURE__ */ e.jsx(I, { onClick: () => o(!1), children: "取消" }),
|
|
419
|
+
/* @__PURE__ */ e.jsx(I, { type: "primary", htmlType: "submit", children: "保存" })
|
|
420
|
+
] })
|
|
421
|
+
] }) })
|
|
422
|
+
] });
|
|
423
|
+
}, He = () => {
|
|
424
|
+
const [r, c] = h([]), [v, j] = h([]), [u, o] = h(!1), [p, x] = h(!1), [g, R] = h(null), [l] = i.useForm(), S = async () => {
|
|
425
|
+
o(!0);
|
|
426
|
+
try {
|
|
427
|
+
const [d, C] = await Promise.all([G.list(), Y.list()]);
|
|
428
|
+
c(d || []), j(C || []);
|
|
429
|
+
} catch {
|
|
430
|
+
T.error("加载失败");
|
|
431
|
+
} finally {
|
|
432
|
+
o(!1);
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
B(() => {
|
|
436
|
+
S();
|
|
437
|
+
}, []);
|
|
438
|
+
const N = () => {
|
|
439
|
+
R(null), l.resetFields(), l.setFieldsValue({ status: "ENABLE", sort: 0, autoDeploy: 0 }), x(!0);
|
|
440
|
+
}, A = (d) => {
|
|
441
|
+
R(d), l.setFieldsValue(d), x(!0);
|
|
442
|
+
}, _ = (d) => {
|
|
443
|
+
ne.confirm({ title: "确认删除", content: `删除环境 ${d.name}?`, onOk: async () => {
|
|
444
|
+
await G.delete(d.id), T.success("删除成功"), S();
|
|
445
|
+
} });
|
|
446
|
+
}, P = async () => {
|
|
447
|
+
try {
|
|
448
|
+
const d = await l.validateFields(), C = { ...d, autoDeploy: d.autoDeploy ? 1 : 0 };
|
|
449
|
+
g ? await G.update({ ...C, id: g.id }) : await G.create(C), T.success(g ? "更新成功" : "创建成功"), x(!1), S();
|
|
450
|
+
} catch {
|
|
451
|
+
}
|
|
452
|
+
}, m = Object.fromEntries(v.map((d) => [d.id, d.name])), O = [
|
|
453
|
+
{ title: "名称", dataIndex: "name", width: 120 },
|
|
454
|
+
{ title: "编码", dataIndex: "code", width: 100 },
|
|
455
|
+
{ title: "关联渠道", dataIndex: "targetId", width: 140, render: (d) => m[d] || "-" },
|
|
456
|
+
{ title: "自动部署", dataIndex: "autoDeploy", width: 90, render: (d) => d ? /* @__PURE__ */ e.jsx(z, { color: "green", children: "是" }) : /* @__PURE__ */ e.jsx(z, { children: "否" }) },
|
|
457
|
+
{ title: "描述", dataIndex: "description", ellipsis: !0 },
|
|
458
|
+
{ title: "状态", dataIndex: "status", width: 80, render: (d) => /* @__PURE__ */ e.jsx(z, { color: d === "ENABLE" ? "green" : "red", children: d === "ENABLE" ? "启用" : "禁用" }) },
|
|
459
|
+
{ title: "操作", width: 160, render: (d, C) => /* @__PURE__ */ e.jsxs(L, { size: "small", children: [
|
|
460
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", icon: /* @__PURE__ */ e.jsx(se, {}), onClick: () => A(C), children: "编辑" }),
|
|
461
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", danger: !0, icon: /* @__PURE__ */ e.jsx(le, {}), onClick: () => _(C), children: "删除" })
|
|
462
|
+
] }) }
|
|
463
|
+
];
|
|
464
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
465
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
466
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
467
|
+
/* @__PURE__ */ e.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "环境管理" }),
|
|
468
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "管理部署环境 (开发 / 测试 / 预发 / 生产)" })
|
|
469
|
+
] }),
|
|
470
|
+
/* @__PURE__ */ e.jsx(I, { type: "primary", icon: /* @__PURE__ */ e.jsx(ae, {}), onClick: N, children: "新建环境" })
|
|
471
|
+
] }),
|
|
472
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 16 }, children: /* @__PURE__ */ e.jsx(V, { columns: O, dataSource: r, loading: u, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无环境" } }) }),
|
|
473
|
+
/* @__PURE__ */ e.jsx(J, { title: g ? "编辑环境" : "新建环境", placement: "right", width: 520, open: p, onClose: () => x(!1), children: /* @__PURE__ */ e.jsxs(i, { form: l, layout: "vertical", onFinish: P, children: [
|
|
474
|
+
/* @__PURE__ */ e.jsxs(L, { style: { display: "flex" }, size: "middle", children: [
|
|
475
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "name", label: "名称", rules: [{ required: !0 }], style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(w, { placeholder: "如: 生产环境" }) }),
|
|
476
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "code", label: "编码", rules: [{ required: !0 }], style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(w, { placeholder: "如: prod" }) })
|
|
477
|
+
] }),
|
|
478
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "targetId", label: "关联部署渠道", children: /* @__PURE__ */ e.jsx(E, { allowClear: !0, placeholder: "选择部署目标", children: v.map((d) => /* @__PURE__ */ e.jsx(E.Option, { value: d.id, children: d.name }, d.id)) }) }),
|
|
479
|
+
/* @__PURE__ */ e.jsxs(L, { style: { display: "flex" }, size: "middle", children: [
|
|
480
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "sort", label: "排序", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(ge, { min: 0 }) }),
|
|
481
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "autoDeploy", label: "自动部署", valuePropName: "checked", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(ke, {}) })
|
|
482
|
+
] }),
|
|
483
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 2 }) }),
|
|
484
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "config", label: "配置 (JSON)", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 3 }) }),
|
|
485
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "status", label: "状态", initialValue: "ENABLE", children: /* @__PURE__ */ e.jsxs(E, { children: [
|
|
486
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "ENABLE", children: "启用" }),
|
|
487
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "DISABLE", children: "禁用" })
|
|
488
|
+
] }) }),
|
|
489
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.06)" }, children: [
|
|
490
|
+
/* @__PURE__ */ e.jsx(I, { onClick: () => x(!1), children: "取消" }),
|
|
491
|
+
/* @__PURE__ */ e.jsx(I, { type: "primary", htmlType: "submit", children: "保存" })
|
|
492
|
+
] })
|
|
493
|
+
] }) })
|
|
494
|
+
] });
|
|
495
|
+
}, Xe = () => {
|
|
496
|
+
const [r, c] = h([]), [v, j] = h(!1), [u, o] = h(!1), [p, x] = h(!1), [g, R] = h(null), [l, S] = h(null), [N, A] = h(""), [_] = i.useForm(), P = async () => {
|
|
497
|
+
j(!0);
|
|
498
|
+
try {
|
|
499
|
+
c(await $.list() || []);
|
|
500
|
+
} catch {
|
|
501
|
+
T.error("加载失败");
|
|
502
|
+
} finally {
|
|
503
|
+
j(!1);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
B(() => {
|
|
507
|
+
P();
|
|
508
|
+
}, []);
|
|
509
|
+
const m = () => {
|
|
510
|
+
R(null), _.resetFields(), _.setFieldsValue({ status: "ENABLE", gitBranch: "main" }), o(!0);
|
|
511
|
+
}, O = (k) => {
|
|
512
|
+
R(k), _.setFieldsValue(k), o(!0);
|
|
513
|
+
}, d = (k) => {
|
|
514
|
+
ne.confirm({ title: "确认删除", content: `删除 ${k.name}?`, onOk: async () => {
|
|
515
|
+
await $.delete(k.id), T.success("删除成功"), P();
|
|
516
|
+
} });
|
|
517
|
+
}, C = async (k) => {
|
|
518
|
+
S(k.id), x(!0), A(`正在部署...
|
|
519
|
+
`);
|
|
520
|
+
try {
|
|
521
|
+
const D = await $.deploy(k.id);
|
|
522
|
+
A(D || "部署完成");
|
|
523
|
+
} catch (D) {
|
|
524
|
+
A("部署失败: " + (D.message || "未知错误"));
|
|
525
|
+
} finally {
|
|
526
|
+
S(null);
|
|
527
|
+
}
|
|
528
|
+
}, H = async () => {
|
|
529
|
+
try {
|
|
530
|
+
const k = await _.validateFields();
|
|
531
|
+
g ? await $.update({ ...k, id: g.id }) : await $.create(k), T.success(g ? "更新成功" : "创建成功"), o(!1), P();
|
|
532
|
+
} catch {
|
|
533
|
+
}
|
|
534
|
+
}, X = [
|
|
535
|
+
{ title: "名称", dataIndex: "name", width: 150 },
|
|
536
|
+
{ title: "Git 仓库", dataIndex: "gitRepo", ellipsis: !0 },
|
|
537
|
+
{ title: "分支", dataIndex: "gitBranch", width: 100 },
|
|
538
|
+
{ title: "工作目录", dataIndex: "workDir", ellipsis: !0 },
|
|
539
|
+
{ title: "状态", dataIndex: "status", width: 80, render: (k) => /* @__PURE__ */ e.jsx(z, { color: k === "ENABLE" ? "green" : "red", children: k === "ENABLE" ? "启用" : "禁用" }) },
|
|
540
|
+
{ title: "操作", width: 240, render: (k, D) => /* @__PURE__ */ e.jsxs(L, { size: "small", children: [
|
|
541
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", icon: /* @__PURE__ */ e.jsx(Re, { spin: l === D.id }), onClick: () => C(D), disabled: l !== null, children: l === D.id ? "部署中" : "部署" }),
|
|
542
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", icon: /* @__PURE__ */ e.jsx(se, {}), onClick: () => O(D), children: "编辑" }),
|
|
543
|
+
/* @__PURE__ */ e.jsx(I, { size: "small", type: "text", danger: !0, icon: /* @__PURE__ */ e.jsx(le, {}), onClick: () => d(D), children: "删除" })
|
|
544
|
+
] }) }
|
|
545
|
+
];
|
|
546
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
547
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
548
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
549
|
+
/* @__PURE__ */ e.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "部署单元" }),
|
|
550
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "管理 Git 仓库部署配置" })
|
|
551
|
+
] }),
|
|
552
|
+
/* @__PURE__ */ e.jsx(I, { type: "primary", icon: /* @__PURE__ */ e.jsx(ae, {}), onClick: m, children: "新建部署单元" })
|
|
553
|
+
] }),
|
|
554
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 16 }, children: /* @__PURE__ */ e.jsx(V, { columns: X, dataSource: r, loading: v, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无部署单元" } }) }),
|
|
555
|
+
/* @__PURE__ */ e.jsx(J, { title: g ? "编辑部署单元" : "新建部署单元", placement: "right", width: 520, open: u, onClose: () => o(!1), children: /* @__PURE__ */ e.jsxs(i, { form: _, layout: "vertical", onFinish: H, children: [
|
|
556
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "name", label: "名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(w, { placeholder: "如: z-agent-backend" }) }),
|
|
557
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 2 }) }),
|
|
558
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "status", label: "状态", initialValue: "ENABLE", children: /* @__PURE__ */ e.jsxs(E, { children: [
|
|
559
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "ENABLE", children: "启用" }),
|
|
560
|
+
/* @__PURE__ */ e.jsx(E.Option, { value: "DISABLE", children: "禁用" })
|
|
561
|
+
] }) }),
|
|
562
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "gitRepo", label: "Git 仓库地址", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(w, { placeholder: "https://github.com/username/repo.git" }) }),
|
|
563
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "gitBranch", label: "分支", initialValue: "main", children: /* @__PURE__ */ e.jsx(w, { placeholder: "main" }) }),
|
|
564
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "workDir", label: "本地工作目录", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(w, { placeholder: "/deploy/my-app" }) }),
|
|
565
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "buildCommand", label: "构建命令", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 2, placeholder: "mvn clean package -DskipTests" }) }),
|
|
566
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "deployCommand", label: "部署命令", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 2 }) }),
|
|
567
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "healthCheckUrl", label: "健康检查 URL", children: /* @__PURE__ */ e.jsx(w, { placeholder: "http://localhost:8080/actuator/health" }) }),
|
|
568
|
+
/* @__PURE__ */ e.jsx(i.Item, { name: "envVars", label: "环境变量 (JSON)", children: /* @__PURE__ */ e.jsx(w.TextArea, { rows: 3 }) }),
|
|
569
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.06)" }, children: [
|
|
570
|
+
/* @__PURE__ */ e.jsx(I, { onClick: () => o(!1), children: "取消" }),
|
|
571
|
+
/* @__PURE__ */ e.jsx(I, { type: "primary", htmlType: "submit", children: "保存" })
|
|
572
|
+
] })
|
|
573
|
+
] }) }),
|
|
574
|
+
/* @__PURE__ */ e.jsx(J, { title: /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
575
|
+
/* @__PURE__ */ e.jsx(Se, { spin: l !== null }),
|
|
576
|
+
/* @__PURE__ */ e.jsx("span", { children: l ? "部署中" : "部署完成" })
|
|
577
|
+
] }), placement: "right", width: 600, open: p, onClose: () => x(!1), children: /* @__PURE__ */ e.jsx("pre", { style: { background: "#0a0a0f", color: "#d0d6e0", padding: 16, borderRadius: 6, fontFamily: "monospace", fontSize: 12, lineHeight: 1.6, maxHeight: 500, overflow: "auto", whiteSpace: "pre-wrap" }, children: N }) })
|
|
578
|
+
] });
|
|
579
|
+
}, Ze = () => {
|
|
580
|
+
const [r, c] = h([]), [v, j] = h([]), [u, o] = h(null), [p, x] = h(!1);
|
|
581
|
+
B(() => {
|
|
582
|
+
(async () => {
|
|
583
|
+
try {
|
|
584
|
+
const l = await $.list() || [];
|
|
585
|
+
j(l), l.length && o(l[0].id);
|
|
586
|
+
} catch {
|
|
587
|
+
T.error("加载部署单元失败");
|
|
588
|
+
}
|
|
589
|
+
})();
|
|
590
|
+
}, []), B(() => {
|
|
591
|
+
if (!u) {
|
|
592
|
+
c([]);
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
(async () => {
|
|
596
|
+
x(!0);
|
|
597
|
+
try {
|
|
598
|
+
c(await Be.list(u) || []);
|
|
599
|
+
} catch {
|
|
600
|
+
T.error("加载记录失败");
|
|
601
|
+
} finally {
|
|
602
|
+
x(!1);
|
|
603
|
+
}
|
|
604
|
+
})();
|
|
605
|
+
}, [u]);
|
|
606
|
+
const g = { SUCCESS: { text: "成功", color: "green" }, FAILED: { text: "失败", color: "red" }, RUNNING: { text: "运行中", color: "processing" }, PENDING: { text: "等待中", color: "default" } }, R = [
|
|
607
|
+
{ title: "ID", dataIndex: "id", width: 60 },
|
|
608
|
+
{ title: "分支", dataIndex: "branch", width: 120 },
|
|
609
|
+
{ title: "Commit", dataIndex: "commitId", width: 100, ellipsis: !0, render: (l) => l ? /* @__PURE__ */ e.jsx("code", { children: l.substring(0, 8) }) : "-" },
|
|
610
|
+
{ title: "部署人", dataIndex: "deployer", width: 100 },
|
|
611
|
+
{ title: "触发方式", dataIndex: "triggerType", width: 100, render: (l) => ({ MANUAL: "手动", WEBHOOK: "Webhook", SCHEDULE: "定时" })[l] || l || "-" },
|
|
612
|
+
{ title: "开始时间", dataIndex: "startedAt", width: 170 },
|
|
613
|
+
{ title: "结束时间", dataIndex: "finishedAt", width: 170 },
|
|
614
|
+
{ title: "状态", dataIndex: "status", width: 90, render: (l) => {
|
|
615
|
+
const S = g[l] || { text: l, color: "default" };
|
|
616
|
+
return /* @__PURE__ */ e.jsx(z, { color: S.color, children: S.text });
|
|
617
|
+
} },
|
|
618
|
+
{ title: "结果", dataIndex: "result", ellipsis: !0 }
|
|
619
|
+
];
|
|
620
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
621
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
622
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
623
|
+
/* @__PURE__ */ e.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "部署记录" }),
|
|
624
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "查看历史部署记录" })
|
|
625
|
+
] }),
|
|
626
|
+
/* @__PURE__ */ e.jsxs(L, { children: [
|
|
627
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98" }, children: "部署单元:" }),
|
|
628
|
+
/* @__PURE__ */ e.jsx(E, { value: u, onChange: o, style: { width: 240 }, children: v.map((l) => /* @__PURE__ */ e.jsx(E.Option, { value: l.id, children: l.name }, l.id)) })
|
|
629
|
+
] })
|
|
630
|
+
] }),
|
|
631
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 16 }, children: /* @__PURE__ */ e.jsx(V, { columns: R, dataSource: r, loading: p, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无部署记录" } }) })
|
|
632
|
+
] });
|
|
633
|
+
}, Qe = () => {
|
|
634
|
+
const [r, c] = h([]), [v, j] = h(!1), u = async () => {
|
|
635
|
+
j(!0);
|
|
636
|
+
try {
|
|
637
|
+
c(await $e.list() || []);
|
|
638
|
+
} catch {
|
|
639
|
+
T.error("加载 Bucket 列表失败");
|
|
640
|
+
} finally {
|
|
641
|
+
j(!1);
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
B(() => {
|
|
645
|
+
u();
|
|
646
|
+
}, []);
|
|
647
|
+
const o = [
|
|
648
|
+
{ title: "Bucket 名称", dataIndex: "name", copyable: !0 },
|
|
649
|
+
{ title: "创建时间", dataIndex: "createdAt", width: 180 },
|
|
650
|
+
{ title: "存储类型", dataIndex: "storageClass", width: 100, render: (p) => p || "标准" },
|
|
651
|
+
{ title: "区域", dataIndex: "region", width: 100 },
|
|
652
|
+
{ title: "对象数", dataIndex: "objectCount", width: 100, render: (p) => p ?? "-" },
|
|
653
|
+
{ title: "用量", dataIndex: "sizeGb", width: 100, render: (p) => p != null ? `${p} GB` : "-" }
|
|
654
|
+
];
|
|
655
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
656
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
657
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
658
|
+
/* @__PURE__ */ e.jsxs("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: [
|
|
659
|
+
/* @__PURE__ */ e.jsx(Te, { style: { marginRight: 8 } }),
|
|
660
|
+
"对象存储"
|
|
661
|
+
] }),
|
|
662
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "OSS Bucket 与文件目录" })
|
|
663
|
+
] }),
|
|
664
|
+
/* @__PURE__ */ e.jsx(I, { icon: /* @__PURE__ */ e.jsx(fe, {}), onClick: u, children: "刷新" })
|
|
665
|
+
] }),
|
|
666
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 16 }, children: /* @__PURE__ */ e.jsx(V, { columns: o, dataSource: r, loading: v, rowKey: "name", pagination: { pageSize: 10 }, locale: { emptyText: "暂无 Bucket" } }) })
|
|
667
|
+
] });
|
|
668
|
+
}, et = () => /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
669
|
+
/* @__PURE__ */ e.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
670
|
+
/* @__PURE__ */ e.jsx(Ae, { style: { marginRight: 8 } }),
|
|
671
|
+
"域名管理"
|
|
672
|
+
] }),
|
|
673
|
+
/* @__PURE__ */ e.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "管理已绑定的域名与 SSL 证书" }),
|
|
674
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 48 }, children: /* @__PURE__ */ e.jsx(K, { description: "后端 API 开发中,敬请期待" }) })
|
|
675
|
+
] }), tt = () => /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
676
|
+
/* @__PURE__ */ e.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
677
|
+
/* @__PURE__ */ e.jsx(_e, { style: { marginRight: 8 } }),
|
|
678
|
+
"ECS 管理"
|
|
679
|
+
] }),
|
|
680
|
+
/* @__PURE__ */ e.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "查看与管理云服务器实例" }),
|
|
681
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 48 }, children: /* @__PURE__ */ e.jsx(K, { description: "后端 API 开发中,敬请期待" }) })
|
|
682
|
+
] }), rt = () => /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
683
|
+
/* @__PURE__ */ e.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
684
|
+
/* @__PURE__ */ e.jsx(Oe, { style: { marginRight: 8 } }),
|
|
685
|
+
"RDS 管理"
|
|
686
|
+
] }),
|
|
687
|
+
/* @__PURE__ */ e.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "查看云数据库实例与慢查询监控" }),
|
|
688
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 48 }, children: /* @__PURE__ */ e.jsx(K, { description: "后端 API 开发中,敬请期待" }) })
|
|
689
|
+
] }), nt = () => {
|
|
690
|
+
const [r, c] = h([]), [v, j] = h(!1), u = async () => {
|
|
691
|
+
j(!0);
|
|
692
|
+
try {
|
|
693
|
+
c(await Fe.list() || []);
|
|
694
|
+
} catch {
|
|
695
|
+
T.error("加载构建记录失败");
|
|
696
|
+
} finally {
|
|
697
|
+
j(!1);
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
B(() => {
|
|
701
|
+
u();
|
|
702
|
+
}, []);
|
|
703
|
+
const o = { SUCCESS: { text: "成功", color: "green" }, FAILED: { text: "失败", color: "red" }, BUILDING: { text: "构建中", color: "processing" } }, p = [
|
|
704
|
+
{ title: "ID", dataIndex: "id", width: 60 },
|
|
705
|
+
{ title: "镜像名", dataIndex: "imageName", width: 160 },
|
|
706
|
+
{ title: "应用名", dataIndex: "appName", width: 120 },
|
|
707
|
+
{ title: "分支", dataIndex: "branch", width: 120 },
|
|
708
|
+
{ title: "环境", dataIndex: "env", width: 80 },
|
|
709
|
+
{ title: "状态", dataIndex: "status", width: 90, render: (x) => {
|
|
710
|
+
const g = o[x] || { text: x, color: "default" };
|
|
711
|
+
return /* @__PURE__ */ e.jsx(z, { color: g.color, children: g.text });
|
|
712
|
+
} },
|
|
713
|
+
{ title: "镜像版本", dataIndex: "imageTag", width: 140, ellipsis: !0 },
|
|
714
|
+
{ title: "构建时间", dataIndex: "createdAt", width: 170 }
|
|
715
|
+
];
|
|
716
|
+
return /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
717
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
718
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
719
|
+
/* @__PURE__ */ e.jsxs("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: [
|
|
720
|
+
/* @__PURE__ */ e.jsx(Ce, { style: { marginRight: 8 } }),
|
|
721
|
+
"镜像构建"
|
|
722
|
+
] }),
|
|
723
|
+
/* @__PURE__ */ e.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "镜像构建记录" })
|
|
724
|
+
] }),
|
|
725
|
+
/* @__PURE__ */ e.jsx(I, { icon: /* @__PURE__ */ e.jsx(fe, {}), onClick: u, children: "刷新" })
|
|
726
|
+
] }),
|
|
727
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 16 }, children: /* @__PURE__ */ e.jsx(V, { columns: p, dataSource: r, loading: v, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无构建记录" } }) })
|
|
728
|
+
] });
|
|
729
|
+
}, at = () => /* @__PURE__ */ e.jsxs("div", { style: { padding: 24 }, children: [
|
|
730
|
+
/* @__PURE__ */ e.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
731
|
+
/* @__PURE__ */ e.jsx(De, { style: { marginRight: 8 } }),
|
|
732
|
+
"迭代管理"
|
|
733
|
+
] }),
|
|
734
|
+
/* @__PURE__ */ e.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "管理研发迭代与里程碑" }),
|
|
735
|
+
/* @__PURE__ */ e.jsx("div", { style: { background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.06)", borderRadius: 8, padding: 48 }, children: /* @__PURE__ */ e.jsx(K, { description: "后端 API 开发中,敬请期待" }) })
|
|
736
|
+
] });
|
|
737
|
+
export {
|
|
738
|
+
Ke as ChannelPage,
|
|
739
|
+
He as DeliveryPage,
|
|
740
|
+
Xe as DeploymentPage,
|
|
741
|
+
et as DomainPage,
|
|
742
|
+
tt as EcsPage,
|
|
743
|
+
nt as RdOpsPage,
|
|
744
|
+
rt as RdsPage,
|
|
745
|
+
Qe as ResourceOssPage,
|
|
746
|
+
at as SprintPage,
|
|
747
|
+
Ze as TaskPage,
|
|
748
|
+
Me as configureApiBaseURL,
|
|
749
|
+
$ as deploymentUnitApi,
|
|
750
|
+
G as environmentApi,
|
|
751
|
+
Ge as imageApi,
|
|
752
|
+
Fe as imageBuildApi,
|
|
753
|
+
Je as imageTagApi,
|
|
754
|
+
$e as ossBucketApi,
|
|
755
|
+
Be as recordApi,
|
|
756
|
+
Y as targetApi,
|
|
757
|
+
qe as webhookApi
|
|
758
|
+
};
|