@yuku123/z-ops-frontend-component 0.1.0 → 0.2.1
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 +2050 -510
- package/dist/z-ops-component.umd.js +16 -5
- package/package.json +2 -2
- package/src/components/OpsApp.jsx +19 -0
- package/src/components/RdApp.jsx +15 -0
- package/src/components/ResourceApp.jsx +16 -0
- package/src/index.js +5 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import Pt, { useState as I, useEffect as X } from "react";
|
|
3
|
+
import { Form as C, Button as N, Table as ee, Drawer as xe, Input as _, Select as D, Space as G, InputNumber as lt, message as B, Tag as J, Modal as Le, Switch as Tt, Empty as be } from "antd";
|
|
4
|
+
import { PlusOutlined as _e, EditOutlined as Oe, DeleteOutlined as De, SyncOutlined as At, PlayCircleOutlined as Lt, FolderOpenOutlined as _t, ReloadOutlined as it, GlobalOutlined as Ot, DesktopOutlined as Dt, DatabaseOutlined as Nt, ToolOutlined as $t, CalendarOutlined as Ft } from "@ant-design/icons";
|
|
5
|
+
import Bt from "axios";
|
|
6
|
+
var he = { exports: {} }, le = {};
|
|
6
7
|
/**
|
|
7
8
|
* @license React
|
|
8
9
|
* react-jsx-runtime.production.js
|
|
@@ -12,29 +13,29 @@ var q = { exports: {} }, U = {};
|
|
|
12
13
|
* This source code is licensed under the MIT license found in the
|
|
13
14
|
* LICENSE file in the root directory of this source tree.
|
|
14
15
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
for (var
|
|
25
|
-
|
|
26
|
-
} else
|
|
27
|
-
return
|
|
28
|
-
$$typeof:
|
|
29
|
-
type:
|
|
30
|
-
key:
|
|
31
|
-
ref:
|
|
32
|
-
props:
|
|
16
|
+
var Ze;
|
|
17
|
+
function Mt() {
|
|
18
|
+
if (Ze) return le;
|
|
19
|
+
Ze = 1;
|
|
20
|
+
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
21
|
+
function r(a, l, i) {
|
|
22
|
+
var o = null;
|
|
23
|
+
if (i !== void 0 && (o = "" + i), l.key !== void 0 && (o = "" + l.key), "key" in l) {
|
|
24
|
+
i = {};
|
|
25
|
+
for (var u in l)
|
|
26
|
+
u !== "key" && (i[u] = l[u]);
|
|
27
|
+
} else i = l;
|
|
28
|
+
return l = i.ref, {
|
|
29
|
+
$$typeof: e,
|
|
30
|
+
type: a,
|
|
31
|
+
key: o,
|
|
32
|
+
ref: l !== void 0 ? l : null,
|
|
33
|
+
props: i
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
return
|
|
36
|
+
return le.Fragment = t, le.jsx = r, le.jsxs = r, le;
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
+
var ie = {};
|
|
38
39
|
/**
|
|
39
40
|
* @license React
|
|
40
41
|
* react-jsx-runtime.development.js
|
|
@@ -44,715 +45,2254 @@ var W = {};
|
|
|
44
45
|
* This source code is licensed under the MIT license found in the
|
|
45
46
|
* LICENSE file in the root directory of this source tree.
|
|
46
47
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
52
|
-
if (typeof
|
|
53
|
-
return
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (
|
|
56
|
-
case
|
|
48
|
+
var Qe;
|
|
49
|
+
function zt() {
|
|
50
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
+
function e(h) {
|
|
52
|
+
if (h == null) return null;
|
|
53
|
+
if (typeof h == "function")
|
|
54
|
+
return h.$$typeof === Se ? null : h.displayName || h.name || null;
|
|
55
|
+
if (typeof h == "string") return h;
|
|
56
|
+
switch (h) {
|
|
57
|
+
case p:
|
|
57
58
|
return "Fragment";
|
|
58
|
-
case
|
|
59
|
+
case x:
|
|
59
60
|
return "Profiler";
|
|
60
|
-
case
|
|
61
|
+
case S:
|
|
61
62
|
return "StrictMode";
|
|
62
63
|
case k:
|
|
63
64
|
return "Suspense";
|
|
64
|
-
case
|
|
65
|
+
case T:
|
|
65
66
|
return "SuspenseList";
|
|
66
|
-
case
|
|
67
|
+
case re:
|
|
67
68
|
return "Activity";
|
|
68
69
|
}
|
|
69
|
-
if (typeof
|
|
70
|
-
switch (typeof
|
|
70
|
+
if (typeof h == "object")
|
|
71
|
+
switch (typeof h.tag == "number" && console.error(
|
|
71
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
|
-
),
|
|
73
|
-
case
|
|
73
|
+
), h.$$typeof) {
|
|
74
|
+
case b:
|
|
74
75
|
return "Portal";
|
|
75
|
-
case
|
|
76
|
-
return
|
|
77
|
-
case
|
|
78
|
-
return (
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
|
|
76
|
+
case F:
|
|
77
|
+
return h.displayName || "Context";
|
|
78
|
+
case R:
|
|
79
|
+
return (h._context.displayName || "Context") + ".Consumer";
|
|
80
|
+
case O:
|
|
81
|
+
var j = h.render;
|
|
82
|
+
return h = h.displayName, h || (h = j.displayName || j.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
|
|
83
|
+
case q:
|
|
84
|
+
return j = h.displayName || null, j !== null ? j : e(h.type) || "Memo";
|
|
85
|
+
case V:
|
|
86
|
+
j = h._payload, h = h._init;
|
|
86
87
|
try {
|
|
87
|
-
return
|
|
88
|
+
return e(h(j));
|
|
88
89
|
} catch {
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
return null;
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
return "" +
|
|
94
|
+
function t(h) {
|
|
95
|
+
return "" + h;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function r(h) {
|
|
97
98
|
try {
|
|
98
|
-
|
|
99
|
-
var
|
|
99
|
+
t(h);
|
|
100
|
+
var j = !1;
|
|
100
101
|
} catch {
|
|
101
|
-
|
|
102
|
+
j = !0;
|
|
102
103
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
104
|
+
if (j) {
|
|
105
|
+
j = console;
|
|
106
|
+
var P = j.error, A = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
107
|
+
return P.call(
|
|
108
|
+
j,
|
|
108
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
110
|
-
),
|
|
110
|
+
A
|
|
111
|
+
), t(h);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
115
|
-
if (typeof
|
|
114
|
+
function a(h) {
|
|
115
|
+
if (h === p) return "<>";
|
|
116
|
+
if (typeof h == "object" && h !== null && h.$$typeof === V)
|
|
116
117
|
return "<...>";
|
|
117
118
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
119
|
+
var j = e(h);
|
|
120
|
+
return j ? "<" + j + ">" : "<...>";
|
|
120
121
|
} catch {
|
|
121
122
|
return "<...>";
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
-
var
|
|
126
|
-
return
|
|
125
|
+
function l() {
|
|
126
|
+
var h = ne.A;
|
|
127
|
+
return h === null ? null : h.getOwner();
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function i() {
|
|
129
130
|
return Error("react-stack-top-frame");
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
132
|
+
function o(h) {
|
|
133
|
+
if (ae.call(h, "key")) {
|
|
134
|
+
var j = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
135
|
+
if (j && j.isReactWarning) return !1;
|
|
135
136
|
}
|
|
136
|
-
return
|
|
137
|
+
return h.key !== void 0;
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
-
function
|
|
140
|
-
|
|
139
|
+
function u(h, j) {
|
|
140
|
+
function P() {
|
|
141
|
+
qe || (qe = !0, console.error(
|
|
141
142
|
"%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
|
-
|
|
143
|
+
j
|
|
143
144
|
));
|
|
144
145
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
146
|
+
P.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
147
|
+
get: P,
|
|
147
148
|
configurable: !0
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
-
var
|
|
152
|
-
return
|
|
151
|
+
function c() {
|
|
152
|
+
var h = e(this.type);
|
|
153
|
+
return Ge[h] || (Ge[h] = !0, console.error(
|
|
153
154
|
"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
|
-
)),
|
|
155
|
-
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
158
|
-
return
|
|
159
|
-
$$typeof:
|
|
160
|
-
type:
|
|
161
|
-
key:
|
|
162
|
-
props:
|
|
163
|
-
_owner:
|
|
164
|
-
}, (
|
|
155
|
+
)), h = this.props.ref, h !== void 0 ? h : null;
|
|
156
|
+
}
|
|
157
|
+
function m(h, j, P, A, de, Ce) {
|
|
158
|
+
var L = P.ref;
|
|
159
|
+
return h = {
|
|
160
|
+
$$typeof: v,
|
|
161
|
+
type: h,
|
|
162
|
+
key: j,
|
|
163
|
+
props: P,
|
|
164
|
+
_owner: A
|
|
165
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(h, "ref", {
|
|
165
166
|
enumerable: !1,
|
|
166
|
-
get:
|
|
167
|
-
}) : Object.defineProperty(
|
|
167
|
+
get: c
|
|
168
|
+
}) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
168
169
|
configurable: !1,
|
|
169
170
|
enumerable: !1,
|
|
170
171
|
writable: !0,
|
|
171
172
|
value: 0
|
|
172
|
-
}), Object.defineProperty(
|
|
173
|
+
}), Object.defineProperty(h, "_debugInfo", {
|
|
173
174
|
configurable: !1,
|
|
174
175
|
enumerable: !1,
|
|
175
176
|
writable: !0,
|
|
176
177
|
value: null
|
|
177
|
-
}), Object.defineProperty(
|
|
178
|
+
}), Object.defineProperty(h, "_debugStack", {
|
|
178
179
|
configurable: !1,
|
|
179
180
|
enumerable: !1,
|
|
180
181
|
writable: !0,
|
|
181
|
-
value:
|
|
182
|
-
}), Object.defineProperty(
|
|
182
|
+
value: de
|
|
183
|
+
}), Object.defineProperty(h, "_debugTask", {
|
|
183
184
|
configurable: !1,
|
|
184
185
|
enumerable: !1,
|
|
185
186
|
writable: !0,
|
|
186
|
-
value:
|
|
187
|
-
}), Object.freeze && (Object.freeze(
|
|
188
|
-
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
for (
|
|
195
|
-
|
|
196
|
-
Object.freeze && Object.freeze(
|
|
187
|
+
value: Ce
|
|
188
|
+
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
189
|
+
}
|
|
190
|
+
function s(h, j, P, A, de, Ce) {
|
|
191
|
+
var L = j.children;
|
|
192
|
+
if (L !== void 0)
|
|
193
|
+
if (A)
|
|
194
|
+
if (ce(L)) {
|
|
195
|
+
for (A = 0; A < L.length; A++)
|
|
196
|
+
f(L[A]);
|
|
197
|
+
Object.freeze && Object.freeze(L);
|
|
197
198
|
} else
|
|
198
199
|
console.error(
|
|
199
200
|
"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
|
);
|
|
201
|
-
else
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
var
|
|
205
|
-
return
|
|
202
|
+
else f(L);
|
|
203
|
+
if (ae.call(j, "key")) {
|
|
204
|
+
L = e(h);
|
|
205
|
+
var Z = Object.keys(j).filter(function(It) {
|
|
206
|
+
return It !== "key";
|
|
206
207
|
});
|
|
207
|
-
|
|
208
|
+
A = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", Xe[L + A] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
210
|
let props = %s;
|
|
210
211
|
<%s {...props} />
|
|
211
212
|
React keys must be passed directly to JSX without using spread:
|
|
212
213
|
let props = %s;
|
|
213
214
|
<%s key={someKey} {...props} />`,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
),
|
|
215
|
+
A,
|
|
216
|
+
L,
|
|
217
|
+
Z,
|
|
218
|
+
L
|
|
219
|
+
), Xe[L + A] = !0);
|
|
219
220
|
}
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
for (var
|
|
223
|
-
|
|
224
|
-
} else
|
|
225
|
-
return
|
|
226
|
-
|
|
227
|
-
typeof
|
|
228
|
-
),
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
221
|
+
if (L = null, P !== void 0 && (r(P), L = "" + P), o(j) && (r(j.key), L = "" + j.key), "key" in j) {
|
|
222
|
+
P = {};
|
|
223
|
+
for (var ke in j)
|
|
224
|
+
ke !== "key" && (P[ke] = j[ke]);
|
|
225
|
+
} else P = j;
|
|
226
|
+
return L && u(
|
|
227
|
+
P,
|
|
228
|
+
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
229
|
+
), m(
|
|
230
|
+
h,
|
|
231
|
+
L,
|
|
232
|
+
P,
|
|
233
|
+
l(),
|
|
234
|
+
de,
|
|
235
|
+
Ce
|
|
235
236
|
);
|
|
236
237
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
238
|
+
function f(h) {
|
|
239
|
+
g(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === V && (h._payload.status === "fulfilled" ? g(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
return typeof
|
|
241
|
+
function g(h) {
|
|
242
|
+
return typeof h == "object" && h !== null && h.$$typeof === v;
|
|
242
243
|
}
|
|
243
|
-
var
|
|
244
|
+
var y = Pt, v = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), F = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), V = Symbol.for("react.lazy"), re = Symbol.for("react.activity"), Se = Symbol.for("react.client.reference"), ne = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ae = Object.prototype.hasOwnProperty, ce = Array.isArray, M = console.createTask ? console.createTask : function() {
|
|
244
245
|
return null;
|
|
245
246
|
};
|
|
246
|
-
|
|
247
|
-
react_stack_bottom_frame: function(
|
|
248
|
-
return
|
|
247
|
+
y = {
|
|
248
|
+
react_stack_bottom_frame: function(h) {
|
|
249
|
+
return h();
|
|
249
250
|
}
|
|
250
251
|
};
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)(),
|
|
255
|
-
|
|
256
|
-
var
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
252
|
+
var qe, Ge = {}, Je = y.react_stack_bottom_frame.bind(
|
|
253
|
+
y,
|
|
254
|
+
i
|
|
255
|
+
)(), Ke = M(a(i)), Xe = {};
|
|
256
|
+
ie.Fragment = p, ie.jsx = function(h, j, P) {
|
|
257
|
+
var A = 1e4 > ne.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return s(
|
|
259
|
+
h,
|
|
260
|
+
j,
|
|
261
|
+
P,
|
|
261
262
|
!1,
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
A ? Error("react-stack-top-frame") : Je,
|
|
264
|
+
A ? M(a(h)) : Ke
|
|
264
265
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
266
|
+
}, ie.jsxs = function(h, j, P) {
|
|
267
|
+
var A = 1e4 > ne.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return s(
|
|
269
|
+
h,
|
|
270
|
+
j,
|
|
271
|
+
P,
|
|
271
272
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
A ? Error("react-stack-top-frame") : Je,
|
|
274
|
+
A ? M(a(h)) : Ke
|
|
274
275
|
);
|
|
275
276
|
};
|
|
276
|
-
})()),
|
|
277
|
-
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
281
|
-
}
|
|
282
|
-
var
|
|
283
|
-
let
|
|
284
|
-
function
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
289
|
-
}
|
|
290
|
-
const
|
|
291
|
-
const
|
|
292
|
-
return
|
|
293
|
-
},
|
|
294
|
-
list: () =>
|
|
295
|
-
get: (
|
|
296
|
-
create: (
|
|
297
|
-
update: (
|
|
298
|
-
delete: (
|
|
299
|
-
deploy: (
|
|
300
|
-
log: (
|
|
301
|
-
},
|
|
302
|
-
list: () =>
|
|
303
|
-
get: (
|
|
304
|
-
create: (
|
|
305
|
-
update: (
|
|
306
|
-
delete: (
|
|
307
|
-
},
|
|
308
|
-
list: () =>
|
|
309
|
-
get: (
|
|
310
|
-
create: (
|
|
311
|
-
update: (
|
|
312
|
-
delete: (
|
|
313
|
-
},
|
|
314
|
-
list: (
|
|
315
|
-
get: (
|
|
316
|
-
},
|
|
317
|
-
list: (
|
|
318
|
-
create: (
|
|
319
|
-
update: (
|
|
320
|
-
delete: (
|
|
321
|
-
url: (
|
|
322
|
-
},
|
|
323
|
-
page: (
|
|
324
|
-
list: () =>
|
|
325
|
-
get: (
|
|
326
|
-
add: (
|
|
327
|
-
update: (
|
|
328
|
-
delete: (
|
|
329
|
-
tags: (
|
|
330
|
-
addTag: (
|
|
331
|
-
deleteTag: (
|
|
332
|
-
},
|
|
333
|
-
list: (
|
|
334
|
-
create: (
|
|
335
|
-
delete: (
|
|
336
|
-
},
|
|
337
|
-
page: (
|
|
338
|
-
list: () =>
|
|
339
|
-
get: (
|
|
340
|
-
add: (
|
|
341
|
-
},
|
|
342
|
-
list: () =>
|
|
343
|
-
},
|
|
344
|
-
const [
|
|
345
|
-
|
|
277
|
+
})()), ie;
|
|
278
|
+
}
|
|
279
|
+
var et;
|
|
280
|
+
function Ut() {
|
|
281
|
+
return et || (et = 1, process.env.NODE_ENV === "production" ? he.exports = Mt() : he.exports = zt()), he.exports;
|
|
282
|
+
}
|
|
283
|
+
var n = Ut();
|
|
284
|
+
let ot = "/api";
|
|
285
|
+
function Cn(e) {
|
|
286
|
+
ot = e || "/api";
|
|
287
|
+
}
|
|
288
|
+
function w() {
|
|
289
|
+
return Bt.create({ baseURL: ot, timeout: 1e4 });
|
|
290
|
+
}
|
|
291
|
+
const E = (e) => {
|
|
292
|
+
const t = e.data;
|
|
293
|
+
return t && typeof t == "object" && "code" in t && "data" in t ? t.code !== 0 && t.code !== 200 ? Promise.reject(new Error(t.msg || t.message || "请求失败")) : t.data : t;
|
|
294
|
+
}, Q = {
|
|
295
|
+
list: () => w().get("/ops/deployment/list").then(E),
|
|
296
|
+
get: (e) => w().get(`/ops/deployment/${e}`).then(E),
|
|
297
|
+
create: (e) => w().post("/ops/deployment", e).then(E),
|
|
298
|
+
update: (e) => w().put("/ops/deployment", e).then(E),
|
|
299
|
+
delete: (e) => w().delete(`/ops/deployment/${e}`).then(E),
|
|
300
|
+
deploy: (e) => w().post(`/ops/deployment/deploy/${e}`).then(E),
|
|
301
|
+
log: (e) => w().get(`/ops/deployment/log/${e}`).then(E)
|
|
302
|
+
}, se = {
|
|
303
|
+
list: () => w().get("/ops/target/list").then(E),
|
|
304
|
+
get: (e) => w().get(`/ops/target/${e}`).then(E),
|
|
305
|
+
create: (e) => w().post("/ops/target", e).then(E),
|
|
306
|
+
update: (e) => w().put("/ops/target", e).then(E),
|
|
307
|
+
delete: (e) => w().delete(`/ops/target/${e}`).then(E)
|
|
308
|
+
}, fe = {
|
|
309
|
+
list: () => w().get("/ops/environment/list").then(E),
|
|
310
|
+
get: (e) => w().get(`/ops/environment/${e}`).then(E),
|
|
311
|
+
create: (e) => w().post("/ops/environment", e).then(E),
|
|
312
|
+
update: (e) => w().put("/ops/environment", e).then(E),
|
|
313
|
+
delete: (e) => w().delete(`/ops/environment/${e}`).then(E)
|
|
314
|
+
}, Wt = {
|
|
315
|
+
list: (e) => w().get("/ops/record/list", { params: e ? { unitId: e } : {} }).then(E),
|
|
316
|
+
get: (e) => w().get(`/ops/record/${e}`).then(E)
|
|
317
|
+
}, kn = {
|
|
318
|
+
list: (e) => w().get("/ops/webhook/list", { params: e ? { unitId: e } : {} }).then(E),
|
|
319
|
+
create: (e) => w().post("/ops/webhook", e).then(E),
|
|
320
|
+
update: (e) => w().put("/ops/webhook", e).then(E),
|
|
321
|
+
delete: (e) => w().delete(`/ops/webhook/${e}`).then(E),
|
|
322
|
+
url: (e) => w().get(`/ops/webhook/url/${e}`).then(E)
|
|
323
|
+
}, In = {
|
|
324
|
+
page: (e) => w().post("/image/page", e).then(E),
|
|
325
|
+
list: () => w().get("/image/list").then(E),
|
|
326
|
+
get: (e) => w().get("/image/get", { params: { id: e } }).then(E),
|
|
327
|
+
add: (e) => w().post("/image", e).then(E),
|
|
328
|
+
update: (e) => w().post("/image/update", e).then(E),
|
|
329
|
+
delete: (e) => w().post("/image/delete", null, { params: { id: e } }).then(E),
|
|
330
|
+
tags: (e) => w().get("/image/tags", { params: { imageId: e } }).then(E),
|
|
331
|
+
addTag: (e) => w().post("/image/tag", e).then(E),
|
|
332
|
+
deleteTag: (e) => w().post("/image/tag/delete", null, { params: { id: e } }).then(E)
|
|
333
|
+
}, Pn = {
|
|
334
|
+
list: (e) => w().get("/ops/image-tag/list", { params: { imageId: e } }).then(E),
|
|
335
|
+
create: (e) => w().post("/ops/image-tag", e).then(E),
|
|
336
|
+
delete: (e) => w().delete(`/ops/image-tag/${e}`).then(E)
|
|
337
|
+
}, Vt = {
|
|
338
|
+
page: (e) => w().post("/image-build/page", e).then(E),
|
|
339
|
+
list: () => w().get("/image-build/list").then(E),
|
|
340
|
+
get: (e) => w().get("/image-build/get", { params: { id: e } }).then(E),
|
|
341
|
+
add: (e) => w().post("/image-build", e).then(E)
|
|
342
|
+
}, Ht = {
|
|
343
|
+
list: () => w().get("/v1/bucket").then(E)
|
|
344
|
+
}, Tn = () => {
|
|
345
|
+
const [e, t] = I([]), [r, a] = I(!1), [l, i] = I(!1), [o, u] = I(null), [c] = C.useForm(), m = async () => {
|
|
346
|
+
a(!0);
|
|
346
347
|
try {
|
|
347
|
-
|
|
348
|
+
t(await se.list() || []);
|
|
348
349
|
} catch {
|
|
349
|
-
|
|
350
|
+
B.error("加载失败");
|
|
350
351
|
} finally {
|
|
351
|
-
|
|
352
|
+
a(!1);
|
|
352
353
|
}
|
|
353
354
|
};
|
|
354
|
-
|
|
355
|
-
|
|
355
|
+
X(() => {
|
|
356
|
+
m();
|
|
356
357
|
}, []);
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
},
|
|
360
|
-
|
|
361
|
-
},
|
|
362
|
-
|
|
363
|
-
await
|
|
358
|
+
const s = () => {
|
|
359
|
+
u(null), c.resetFields(), c.setFieldsValue({ type: "k8s", status: "ENABLE", port: 22 }), i(!0);
|
|
360
|
+
}, f = (p) => {
|
|
361
|
+
u(p), c.setFieldsValue(p), i(!0);
|
|
362
|
+
}, g = (p) => {
|
|
363
|
+
Le.confirm({ title: "确认删除", content: `删除 ${p.name}?`, onOk: async () => {
|
|
364
|
+
await se.delete(p.id), B.success("删除成功"), m();
|
|
364
365
|
} });
|
|
365
|
-
},
|
|
366
|
+
}, y = async () => {
|
|
366
367
|
try {
|
|
367
|
-
const
|
|
368
|
-
|
|
368
|
+
const p = await c.validateFields();
|
|
369
|
+
o ? await se.update({ ...p, id: o.id }) : await se.create(p), B.success(o ? "更新成功" : "创建成功"), i(!1), m();
|
|
369
370
|
} catch {
|
|
370
371
|
}
|
|
371
|
-
},
|
|
372
|
+
}, v = { k8s: { text: "K8s", color: "blue" }, docker: { text: "Docker", color: "cyan" }, vm: { text: "VM", color: "orange" }, serverless: { text: "Serverless", color: "purple" } }, b = [
|
|
372
373
|
{ title: "名称", dataIndex: "name", width: 150 },
|
|
373
|
-
{ title: "类型", dataIndex: "type", width: 110, render: (
|
|
374
|
-
const
|
|
375
|
-
return /* @__PURE__ */
|
|
374
|
+
{ title: "类型", dataIndex: "type", width: 110, render: (p) => {
|
|
375
|
+
const S = v[p] || { text: p, color: "default" };
|
|
376
|
+
return /* @__PURE__ */ n.jsx(J, { color: S.color, children: S.text });
|
|
376
377
|
} },
|
|
377
378
|
{ title: "主机", dataIndex: "host", ellipsis: !0 },
|
|
378
379
|
{ title: "端口", dataIndex: "port", width: 70 },
|
|
379
380
|
{ title: "命名空间", dataIndex: "namespace", width: 120 },
|
|
380
|
-
{ title: "状态", dataIndex: "status", width: 80, render: (
|
|
381
|
-
{ title: "操作", width: 160, render: (
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
381
|
+
{ title: "状态", dataIndex: "status", width: 80, render: (p) => /* @__PURE__ */ n.jsx(J, { color: p === "ENABLE" ? "green" : "red", children: p === "ENABLE" ? "启用" : "禁用" }) },
|
|
382
|
+
{ title: "操作", width: 160, render: (p, S) => /* @__PURE__ */ n.jsxs(G, { size: "small", children: [
|
|
383
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", icon: /* @__PURE__ */ n.jsx(Oe, {}), onClick: () => f(S), children: "编辑" }),
|
|
384
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", danger: !0, icon: /* @__PURE__ */ n.jsx(De, {}), onClick: () => g(S), children: "删除" })
|
|
384
385
|
] }) }
|
|
385
386
|
];
|
|
386
|
-
return /* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
388
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
389
|
+
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
390
|
+
/* @__PURE__ */ n.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "渠道管理" }),
|
|
391
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "管理部署目标 (Kubernetes / Docker / VM)" })
|
|
391
392
|
] }),
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ n.jsx(N, { type: "primary", icon: /* @__PURE__ */ n.jsx(_e, {}), onClick: s, children: "新建渠道" })
|
|
393
394
|
] }),
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ n.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__ */ n.jsx(ee, { columns: b, dataSource: e, loading: r, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无部署目标" } }) }),
|
|
396
|
+
/* @__PURE__ */ n.jsx(xe, { title: o ? "编辑渠道" : "新建渠道", placement: "right", width: 520, open: l, onClose: () => i(!1), children: /* @__PURE__ */ n.jsxs(C, { form: c, layout: "vertical", onFinish: y, children: [
|
|
397
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "name", label: "名称", rules: [{ required: !0 }], children: /* @__PURE__ */ n.jsx(_, { placeholder: "如: prod-k8s-cluster" }) }),
|
|
398
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "type", label: "类型", rules: [{ required: !0 }], children: /* @__PURE__ */ n.jsxs(D, { children: [
|
|
399
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "k8s", children: "Kubernetes" }),
|
|
400
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "docker", children: "Docker" }),
|
|
401
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "vm", children: "虚拟机" }),
|
|
402
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "serverless", children: "Serverless" })
|
|
402
403
|
] }) }),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ n.jsxs(G, { style: { display: "flex" }, size: "middle", children: [
|
|
405
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "host", label: "主机地址", rules: [{ required: !0 }], style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(_, { placeholder: "192.168.1.100" }) }),
|
|
406
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "port", label: "端口", children: /* @__PURE__ */ n.jsx(lt, { min: 1, max: 65535 }) })
|
|
406
407
|
] }),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ n.jsxs(G, { style: { display: "flex" }, size: "middle", children: [
|
|
409
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "username", label: "用户名", style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(_, { placeholder: "root" }) }),
|
|
410
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "namespace", label: "命名空间", style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(_, { placeholder: "default" }) })
|
|
410
411
|
] }),
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "authPath", label: "密钥路径", children: /* @__PURE__ */ n.jsx(_, { placeholder: "~/.ssh/id_rsa" }) }),
|
|
413
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "description", label: "描述", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 2 }) }),
|
|
414
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "status", label: "状态", initialValue: "ENABLE", children: /* @__PURE__ */ n.jsxs(D, { children: [
|
|
415
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "ENABLE", children: "启用" }),
|
|
416
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "DISABLE", children: "禁用" })
|
|
416
417
|
] }) }),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.06)" }, children: [
|
|
419
|
+
/* @__PURE__ */ n.jsx(N, { onClick: () => i(!1), children: "取消" }),
|
|
420
|
+
/* @__PURE__ */ n.jsx(N, { type: "primary", htmlType: "submit", children: "保存" })
|
|
420
421
|
] })
|
|
421
422
|
] }) })
|
|
422
423
|
] });
|
|
423
|
-
},
|
|
424
|
-
const [
|
|
425
|
-
|
|
424
|
+
}, An = () => {
|
|
425
|
+
const [e, t] = I([]), [r, a] = I([]), [l, i] = I(!1), [o, u] = I(!1), [c, m] = I(null), [s] = C.useForm(), f = async () => {
|
|
426
|
+
i(!0);
|
|
426
427
|
try {
|
|
427
|
-
const [
|
|
428
|
-
|
|
428
|
+
const [x, R] = await Promise.all([fe.list(), se.list()]);
|
|
429
|
+
t(x || []), a(R || []);
|
|
429
430
|
} catch {
|
|
430
|
-
|
|
431
|
+
B.error("加载失败");
|
|
431
432
|
} finally {
|
|
432
|
-
|
|
433
|
+
i(!1);
|
|
433
434
|
}
|
|
434
435
|
};
|
|
435
|
-
|
|
436
|
-
|
|
436
|
+
X(() => {
|
|
437
|
+
f();
|
|
437
438
|
}, []);
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
await
|
|
439
|
+
const g = () => {
|
|
440
|
+
m(null), s.resetFields(), s.setFieldsValue({ status: "ENABLE", sort: 0, autoDeploy: 0 }), u(!0);
|
|
441
|
+
}, y = (x) => {
|
|
442
|
+
m(x), s.setFieldsValue(x), u(!0);
|
|
443
|
+
}, v = (x) => {
|
|
444
|
+
Le.confirm({ title: "确认删除", content: `删除环境 ${x.name}?`, onOk: async () => {
|
|
445
|
+
await fe.delete(x.id), B.success("删除成功"), f();
|
|
445
446
|
} });
|
|
446
|
-
},
|
|
447
|
+
}, b = async () => {
|
|
447
448
|
try {
|
|
448
|
-
const
|
|
449
|
-
|
|
449
|
+
const x = await s.validateFields(), R = { ...x, autoDeploy: x.autoDeploy ? 1 : 0 };
|
|
450
|
+
c ? await fe.update({ ...R, id: c.id }) : await fe.create(R), B.success(c ? "更新成功" : "创建成功"), u(!1), f();
|
|
450
451
|
} catch {
|
|
451
452
|
}
|
|
452
|
-
},
|
|
453
|
+
}, p = Object.fromEntries(r.map((x) => [x.id, x.name])), S = [
|
|
453
454
|
{ title: "名称", dataIndex: "name", width: 120 },
|
|
454
455
|
{ title: "编码", dataIndex: "code", width: 100 },
|
|
455
|
-
{ title: "关联渠道", dataIndex: "targetId", width: 140, render: (
|
|
456
|
-
{ title: "自动部署", dataIndex: "autoDeploy", width: 90, render: (
|
|
456
|
+
{ title: "关联渠道", dataIndex: "targetId", width: 140, render: (x) => p[x] || "-" },
|
|
457
|
+
{ title: "自动部署", dataIndex: "autoDeploy", width: 90, render: (x) => x ? /* @__PURE__ */ n.jsx(J, { color: "green", children: "是" }) : /* @__PURE__ */ n.jsx(J, { children: "否" }) },
|
|
457
458
|
{ title: "描述", dataIndex: "description", ellipsis: !0 },
|
|
458
|
-
{ title: "状态", dataIndex: "status", width: 80, render: (
|
|
459
|
-
{ title: "操作", width: 160, render: (
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
459
|
+
{ title: "状态", dataIndex: "status", width: 80, render: (x) => /* @__PURE__ */ n.jsx(J, { color: x === "ENABLE" ? "green" : "red", children: x === "ENABLE" ? "启用" : "禁用" }) },
|
|
460
|
+
{ title: "操作", width: 160, render: (x, R) => /* @__PURE__ */ n.jsxs(G, { size: "small", children: [
|
|
461
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", icon: /* @__PURE__ */ n.jsx(Oe, {}), onClick: () => y(R), children: "编辑" }),
|
|
462
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", danger: !0, icon: /* @__PURE__ */ n.jsx(De, {}), onClick: () => v(R), children: "删除" })
|
|
462
463
|
] }) }
|
|
463
464
|
];
|
|
464
|
-
return /* @__PURE__ */
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
466
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
467
|
+
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
468
|
+
/* @__PURE__ */ n.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "环境管理" }),
|
|
469
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "管理部署环境 (开发 / 测试 / 预发 / 生产)" })
|
|
469
470
|
] }),
|
|
470
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ n.jsx(N, { type: "primary", icon: /* @__PURE__ */ n.jsx(_e, {}), onClick: g, children: "新建环境" })
|
|
471
472
|
] }),
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ n.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__ */ n.jsx(ee, { columns: S, dataSource: e, loading: l, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无环境" } }) }),
|
|
474
|
+
/* @__PURE__ */ n.jsx(xe, { title: c ? "编辑环境" : "新建环境", placement: "right", width: 520, open: o, onClose: () => u(!1), children: /* @__PURE__ */ n.jsxs(C, { form: s, layout: "vertical", onFinish: b, children: [
|
|
475
|
+
/* @__PURE__ */ n.jsxs(G, { style: { display: "flex" }, size: "middle", children: [
|
|
476
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "name", label: "名称", rules: [{ required: !0 }], style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(_, { placeholder: "如: 生产环境" }) }),
|
|
477
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "code", label: "编码", rules: [{ required: !0 }], style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(_, { placeholder: "如: prod" }) })
|
|
477
478
|
] }),
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "targetId", label: "关联部署渠道", children: /* @__PURE__ */ n.jsx(D, { allowClear: !0, placeholder: "选择部署目标", children: r.map((x) => /* @__PURE__ */ n.jsx(D.Option, { value: x.id, children: x.name }, x.id)) }) }),
|
|
480
|
+
/* @__PURE__ */ n.jsxs(G, { style: { display: "flex" }, size: "middle", children: [
|
|
481
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "sort", label: "排序", style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(lt, { min: 0 }) }),
|
|
482
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "autoDeploy", label: "自动部署", valuePropName: "checked", style: { flex: 1 }, children: /* @__PURE__ */ n.jsx(Tt, {}) })
|
|
482
483
|
] }),
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "description", label: "描述", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 2 }) }),
|
|
485
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "config", label: "配置 (JSON)", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 3 }) }),
|
|
486
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "status", label: "状态", initialValue: "ENABLE", children: /* @__PURE__ */ n.jsxs(D, { children: [
|
|
487
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "ENABLE", children: "启用" }),
|
|
488
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "DISABLE", children: "禁用" })
|
|
488
489
|
] }) }),
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.06)" }, children: [
|
|
491
|
+
/* @__PURE__ */ n.jsx(N, { onClick: () => u(!1), children: "取消" }),
|
|
492
|
+
/* @__PURE__ */ n.jsx(N, { type: "primary", htmlType: "submit", children: "保存" })
|
|
492
493
|
] })
|
|
493
494
|
] }) })
|
|
494
495
|
] });
|
|
495
|
-
},
|
|
496
|
-
const [
|
|
497
|
-
|
|
496
|
+
}, Ln = () => {
|
|
497
|
+
const [e, t] = I([]), [r, a] = I(!1), [l, i] = I(!1), [o, u] = I(!1), [c, m] = I(null), [s, f] = I(null), [g, y] = I(""), [v] = C.useForm(), b = async () => {
|
|
498
|
+
a(!0);
|
|
498
499
|
try {
|
|
499
|
-
|
|
500
|
+
t(await Q.list() || []);
|
|
500
501
|
} catch {
|
|
501
|
-
|
|
502
|
+
B.error("加载失败");
|
|
502
503
|
} finally {
|
|
503
|
-
|
|
504
|
+
a(!1);
|
|
504
505
|
}
|
|
505
506
|
};
|
|
506
|
-
|
|
507
|
-
|
|
507
|
+
X(() => {
|
|
508
|
+
b();
|
|
508
509
|
}, []);
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
},
|
|
514
|
-
|
|
515
|
-
await
|
|
510
|
+
const p = () => {
|
|
511
|
+
m(null), v.resetFields(), v.setFieldsValue({ status: "ENABLE", gitBranch: "main" }), i(!0);
|
|
512
|
+
}, S = (k) => {
|
|
513
|
+
m(k), v.setFieldsValue(k), i(!0);
|
|
514
|
+
}, x = (k) => {
|
|
515
|
+
Le.confirm({ title: "确认删除", content: `删除 ${k.name}?`, onOk: async () => {
|
|
516
|
+
await Q.delete(k.id), B.success("删除成功"), b();
|
|
516
517
|
} });
|
|
517
|
-
},
|
|
518
|
-
|
|
518
|
+
}, R = async (k) => {
|
|
519
|
+
f(k.id), u(!0), y(`正在部署...
|
|
519
520
|
`);
|
|
520
521
|
try {
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
} catch (
|
|
524
|
-
|
|
522
|
+
const T = await Q.deploy(k.id);
|
|
523
|
+
y(T || "部署完成");
|
|
524
|
+
} catch (T) {
|
|
525
|
+
y("部署失败: " + (T.message || "未知错误"));
|
|
525
526
|
} finally {
|
|
526
|
-
|
|
527
|
+
f(null);
|
|
527
528
|
}
|
|
528
|
-
},
|
|
529
|
+
}, F = async () => {
|
|
529
530
|
try {
|
|
530
|
-
const k = await
|
|
531
|
-
|
|
531
|
+
const k = await v.validateFields();
|
|
532
|
+
c ? await Q.update({ ...k, id: c.id }) : await Q.create(k), B.success(c ? "更新成功" : "创建成功"), i(!1), b();
|
|
532
533
|
} catch {
|
|
533
534
|
}
|
|
534
|
-
},
|
|
535
|
+
}, O = [
|
|
535
536
|
{ title: "名称", dataIndex: "name", width: 150 },
|
|
536
537
|
{ title: "Git 仓库", dataIndex: "gitRepo", ellipsis: !0 },
|
|
537
538
|
{ title: "分支", dataIndex: "gitBranch", width: 100 },
|
|
538
539
|
{ title: "工作目录", dataIndex: "workDir", ellipsis: !0 },
|
|
539
|
-
{ title: "状态", dataIndex: "status", width: 80, render: (k) => /* @__PURE__ */
|
|
540
|
-
{ title: "操作", width: 240, render: (k,
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */
|
|
540
|
+
{ title: "状态", dataIndex: "status", width: 80, render: (k) => /* @__PURE__ */ n.jsx(J, { color: k === "ENABLE" ? "green" : "red", children: k === "ENABLE" ? "启用" : "禁用" }) },
|
|
541
|
+
{ title: "操作", width: 240, render: (k, T) => /* @__PURE__ */ n.jsxs(G, { size: "small", children: [
|
|
542
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", icon: /* @__PURE__ */ n.jsx(Lt, { spin: s === T.id }), onClick: () => R(T), disabled: s !== null, children: s === T.id ? "部署中" : "部署" }),
|
|
543
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", icon: /* @__PURE__ */ n.jsx(Oe, {}), onClick: () => S(T), children: "编辑" }),
|
|
544
|
+
/* @__PURE__ */ n.jsx(N, { size: "small", type: "text", danger: !0, icon: /* @__PURE__ */ n.jsx(De, {}), onClick: () => x(T), children: "删除" })
|
|
544
545
|
] }) }
|
|
545
546
|
];
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
548
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
549
|
+
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
550
|
+
/* @__PURE__ */ n.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "部署单元" }),
|
|
551
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "管理 Git 仓库部署配置" })
|
|
551
552
|
] }),
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ n.jsx(N, { type: "primary", icon: /* @__PURE__ */ n.jsx(_e, {}), onClick: p, children: "新建部署单元" })
|
|
553
554
|
] }),
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ n.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__ */ n.jsx(ee, { columns: O, dataSource: e, loading: r, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无部署单元" } }) }),
|
|
556
|
+
/* @__PURE__ */ n.jsx(xe, { title: c ? "编辑部署单元" : "新建部署单元", placement: "right", width: 520, open: l, onClose: () => i(!1), children: /* @__PURE__ */ n.jsxs(C, { form: v, layout: "vertical", onFinish: F, children: [
|
|
557
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "name", label: "名称", rules: [{ required: !0 }], children: /* @__PURE__ */ n.jsx(_, { placeholder: "如: z-agent-backend" }) }),
|
|
558
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "description", label: "描述", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 2 }) }),
|
|
559
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "status", label: "状态", initialValue: "ENABLE", children: /* @__PURE__ */ n.jsxs(D, { children: [
|
|
560
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "ENABLE", children: "启用" }),
|
|
561
|
+
/* @__PURE__ */ n.jsx(D.Option, { value: "DISABLE", children: "禁用" })
|
|
561
562
|
] }) }),
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "gitRepo", label: "Git 仓库地址", rules: [{ required: !0 }], children: /* @__PURE__ */ n.jsx(_, { placeholder: "https://github.com/username/repo.git" }) }),
|
|
564
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "gitBranch", label: "分支", initialValue: "main", children: /* @__PURE__ */ n.jsx(_, { placeholder: "main" }) }),
|
|
565
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "workDir", label: "本地工作目录", rules: [{ required: !0 }], children: /* @__PURE__ */ n.jsx(_, { placeholder: "/deploy/my-app" }) }),
|
|
566
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "buildCommand", label: "构建命令", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 2, placeholder: "mvn clean package -DskipTests" }) }),
|
|
567
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "deployCommand", label: "部署命令", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 2 }) }),
|
|
568
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "healthCheckUrl", label: "健康检查 URL", children: /* @__PURE__ */ n.jsx(_, { placeholder: "http://localhost:8080/actuator/health" }) }),
|
|
569
|
+
/* @__PURE__ */ n.jsx(C.Item, { name: "envVars", label: "环境变量 (JSON)", children: /* @__PURE__ */ n.jsx(_.TextArea, { rows: 3 }) }),
|
|
570
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.06)" }, children: [
|
|
571
|
+
/* @__PURE__ */ n.jsx(N, { onClick: () => i(!1), children: "取消" }),
|
|
572
|
+
/* @__PURE__ */ n.jsx(N, { type: "primary", htmlType: "submit", children: "保存" })
|
|
572
573
|
] })
|
|
573
574
|
] }) }),
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
] }), placement: "right", width: 600, open:
|
|
575
|
+
/* @__PURE__ */ n.jsx(xe, { title: /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
576
|
+
/* @__PURE__ */ n.jsx(At, { spin: s !== null }),
|
|
577
|
+
/* @__PURE__ */ n.jsx("span", { children: s ? "部署中" : "部署完成" })
|
|
578
|
+
] }), placement: "right", width: 600, open: o, onClose: () => u(!1), children: /* @__PURE__ */ n.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: g }) })
|
|
578
579
|
] });
|
|
579
|
-
},
|
|
580
|
-
const [
|
|
581
|
-
|
|
580
|
+
}, _n = () => {
|
|
581
|
+
const [e, t] = I([]), [r, a] = I([]), [l, i] = I(null), [o, u] = I(!1);
|
|
582
|
+
X(() => {
|
|
582
583
|
(async () => {
|
|
583
584
|
try {
|
|
584
|
-
const
|
|
585
|
-
|
|
585
|
+
const s = await Q.list() || [];
|
|
586
|
+
a(s), s.length && i(s[0].id);
|
|
586
587
|
} catch {
|
|
587
|
-
|
|
588
|
+
B.error("加载部署单元失败");
|
|
588
589
|
}
|
|
589
590
|
})();
|
|
590
|
-
}, []),
|
|
591
|
-
if (!
|
|
592
|
-
|
|
591
|
+
}, []), X(() => {
|
|
592
|
+
if (!l) {
|
|
593
|
+
t([]);
|
|
593
594
|
return;
|
|
594
595
|
}
|
|
595
596
|
(async () => {
|
|
596
|
-
|
|
597
|
+
u(!0);
|
|
597
598
|
try {
|
|
598
|
-
|
|
599
|
+
t(await Wt.list(l) || []);
|
|
599
600
|
} catch {
|
|
600
|
-
|
|
601
|
+
B.error("加载记录失败");
|
|
601
602
|
} finally {
|
|
602
|
-
|
|
603
|
+
u(!1);
|
|
603
604
|
}
|
|
604
605
|
})();
|
|
605
|
-
}, [
|
|
606
|
-
const
|
|
606
|
+
}, [l]);
|
|
607
|
+
const c = { SUCCESS: { text: "成功", color: "green" }, FAILED: { text: "失败", color: "red" }, RUNNING: { text: "运行中", color: "processing" }, PENDING: { text: "等待中", color: "default" } }, m = [
|
|
607
608
|
{ title: "ID", dataIndex: "id", width: 60 },
|
|
608
609
|
{ title: "分支", dataIndex: "branch", width: 120 },
|
|
609
|
-
{ title: "Commit", dataIndex: "commitId", width: 100, ellipsis: !0, render: (
|
|
610
|
+
{ title: "Commit", dataIndex: "commitId", width: 100, ellipsis: !0, render: (s) => s ? /* @__PURE__ */ n.jsx("code", { children: s.substring(0, 8) }) : "-" },
|
|
610
611
|
{ title: "部署人", dataIndex: "deployer", width: 100 },
|
|
611
|
-
{ title: "触发方式", dataIndex: "triggerType", width: 100, render: (
|
|
612
|
+
{ title: "触发方式", dataIndex: "triggerType", width: 100, render: (s) => ({ MANUAL: "手动", WEBHOOK: "Webhook", SCHEDULE: "定时" })[s] || s || "-" },
|
|
612
613
|
{ title: "开始时间", dataIndex: "startedAt", width: 170 },
|
|
613
614
|
{ title: "结束时间", dataIndex: "finishedAt", width: 170 },
|
|
614
|
-
{ title: "状态", dataIndex: "status", width: 90, render: (
|
|
615
|
-
const
|
|
616
|
-
return /* @__PURE__ */
|
|
615
|
+
{ title: "状态", dataIndex: "status", width: 90, render: (s) => {
|
|
616
|
+
const f = c[s] || { text: s, color: "default" };
|
|
617
|
+
return /* @__PURE__ */ n.jsx(J, { color: f.color, children: f.text });
|
|
617
618
|
} },
|
|
618
619
|
{ title: "结果", dataIndex: "result", ellipsis: !0 }
|
|
619
620
|
];
|
|
620
|
-
return /* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
622
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
623
|
+
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
624
|
+
/* @__PURE__ */ n.jsx("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: "部署记录" }),
|
|
625
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "查看历史部署记录" })
|
|
625
626
|
] }),
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ n.jsxs(G, { children: [
|
|
628
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98" }, children: "部署单元:" }),
|
|
629
|
+
/* @__PURE__ */ n.jsx(D, { value: l, onChange: i, style: { width: 240 }, children: r.map((s) => /* @__PURE__ */ n.jsx(D.Option, { value: s.id, children: s.name }, s.id)) })
|
|
629
630
|
] })
|
|
630
631
|
] }),
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ n.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__ */ n.jsx(ee, { columns: m, dataSource: e, loading: o, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无部署记录" } }) })
|
|
632
633
|
] });
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
|
|
634
|
+
};
|
|
635
|
+
/**
|
|
636
|
+
* react-router v7.18.0
|
|
637
|
+
*
|
|
638
|
+
* Copyright (c) Remix Software Inc.
|
|
639
|
+
*
|
|
640
|
+
* This source code is licensed under the MIT license found in the
|
|
641
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
642
|
+
*
|
|
643
|
+
* @license MIT
|
|
644
|
+
*/
|
|
645
|
+
var Ne = /^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i, Yt = /^[\\/]{2}/;
|
|
646
|
+
function qt(e, t) {
|
|
647
|
+
return t + e.replace(/\\/g, "/");
|
|
648
|
+
}
|
|
649
|
+
function $(e, t) {
|
|
650
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
651
|
+
throw new Error(t);
|
|
652
|
+
}
|
|
653
|
+
function H(e, t) {
|
|
654
|
+
if (!e) {
|
|
655
|
+
typeof console < "u" && console.warn(t);
|
|
656
|
+
try {
|
|
657
|
+
throw new Error(t);
|
|
658
|
+
} catch {
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
function Ae({
|
|
663
|
+
pathname: e = "/",
|
|
664
|
+
search: t = "",
|
|
665
|
+
hash: r = ""
|
|
666
|
+
}) {
|
|
667
|
+
return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), r && r !== "#" && (e += r.charAt(0) === "#" ? r : "#" + r), e;
|
|
668
|
+
}
|
|
669
|
+
function $e(e) {
|
|
670
|
+
let t = {};
|
|
671
|
+
if (e) {
|
|
672
|
+
let r = e.indexOf("#");
|
|
673
|
+
r >= 0 && (t.hash = e.substring(r), e = e.substring(0, r));
|
|
674
|
+
let a = e.indexOf("?");
|
|
675
|
+
a >= 0 && (t.search = e.substring(a), e = e.substring(0, a)), e && (t.pathname = e);
|
|
676
|
+
}
|
|
677
|
+
return t;
|
|
678
|
+
}
|
|
679
|
+
function st(e, t, r = "/") {
|
|
680
|
+
return Gt(e, t, r, !1);
|
|
681
|
+
}
|
|
682
|
+
function Gt(e, t, r, a, l) {
|
|
683
|
+
let i = typeof t == "string" ? $e(t) : t, o = K(i.pathname || "/", r);
|
|
684
|
+
if (o == null)
|
|
685
|
+
return null;
|
|
686
|
+
let u = Jt(e), c = null, m = ir(o);
|
|
687
|
+
for (let s = 0; c == null && s < u.length; ++s)
|
|
688
|
+
c = lr(
|
|
689
|
+
u[s],
|
|
690
|
+
m,
|
|
691
|
+
a
|
|
692
|
+
);
|
|
693
|
+
return c;
|
|
694
|
+
}
|
|
695
|
+
function Jt(e) {
|
|
696
|
+
let t = ut(e);
|
|
697
|
+
return Kt(t), t;
|
|
698
|
+
}
|
|
699
|
+
function ut(e, t = [], r = [], a = "", l = !1) {
|
|
700
|
+
let i = (o, u, c = l, m) => {
|
|
701
|
+
let s = {
|
|
702
|
+
relativePath: m === void 0 ? o.path || "" : m,
|
|
703
|
+
caseSensitive: o.caseSensitive === !0,
|
|
704
|
+
childrenIndex: u,
|
|
705
|
+
route: o
|
|
706
|
+
};
|
|
707
|
+
if (s.relativePath.startsWith("/")) {
|
|
708
|
+
if (!s.relativePath.startsWith(a) && c)
|
|
709
|
+
return;
|
|
710
|
+
$(
|
|
711
|
+
s.relativePath.startsWith(a),
|
|
712
|
+
`Absolute route path "${s.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
713
|
+
), s.relativePath = s.relativePath.slice(a.length);
|
|
714
|
+
}
|
|
715
|
+
let f = z([a, s.relativePath]), g = r.concat(s);
|
|
716
|
+
o.children && o.children.length > 0 && ($(
|
|
717
|
+
// Our types know better, but runtime JS may not!
|
|
718
|
+
// @ts-expect-error
|
|
719
|
+
o.index !== !0,
|
|
720
|
+
`Index routes must not have child routes. Please remove all child routes from route path "${f}".`
|
|
721
|
+
), ut(
|
|
722
|
+
o.children,
|
|
723
|
+
t,
|
|
724
|
+
g,
|
|
725
|
+
f,
|
|
726
|
+
c
|
|
727
|
+
)), !(o.path == null && !o.index) && t.push({
|
|
728
|
+
path: f,
|
|
729
|
+
score: nr(f, o.index),
|
|
730
|
+
routesMeta: g.map((y, v) => {
|
|
731
|
+
let [b, p] = ht(
|
|
732
|
+
y.relativePath,
|
|
733
|
+
y.caseSensitive,
|
|
734
|
+
v === g.length - 1
|
|
735
|
+
);
|
|
736
|
+
return {
|
|
737
|
+
...y,
|
|
738
|
+
matcher: b,
|
|
739
|
+
compiledParams: p
|
|
740
|
+
};
|
|
741
|
+
})
|
|
742
|
+
});
|
|
743
|
+
};
|
|
744
|
+
return e.forEach((o, u) => {
|
|
745
|
+
var c;
|
|
746
|
+
if (o.path === "" || !((c = o.path) != null && c.includes("?")))
|
|
747
|
+
i(o, u);
|
|
748
|
+
else
|
|
749
|
+
for (let m of ct(o.path))
|
|
750
|
+
i(o, u, !0, m);
|
|
751
|
+
}), t;
|
|
752
|
+
}
|
|
753
|
+
function ct(e) {
|
|
754
|
+
let t = e.split("/");
|
|
755
|
+
if (t.length === 0) return [];
|
|
756
|
+
let [r, ...a] = t, l = r.endsWith("?"), i = r.replace(/\?$/, "");
|
|
757
|
+
if (a.length === 0)
|
|
758
|
+
return l ? [i, ""] : [i];
|
|
759
|
+
let o = ct(a.join("/")), u = [];
|
|
760
|
+
return u.push(
|
|
761
|
+
...o.map(
|
|
762
|
+
(c) => c === "" ? i : [i, c].join("/")
|
|
763
|
+
)
|
|
764
|
+
), l && u.push(...o), u.map(
|
|
765
|
+
(c) => e.startsWith("/") && c === "" ? "/" : c
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
function Kt(e) {
|
|
769
|
+
e.sort(
|
|
770
|
+
(t, r) => t.score !== r.score ? r.score - t.score : ar(
|
|
771
|
+
t.routesMeta.map((a) => a.childrenIndex),
|
|
772
|
+
r.routesMeta.map((a) => a.childrenIndex)
|
|
773
|
+
)
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
var Xt = /^:[\w-]+$/, Zt = 3, Qt = 2, er = 1, tr = 10, rr = -2, tt = (e) => e === "*";
|
|
777
|
+
function nr(e, t) {
|
|
778
|
+
let r = e.split("/"), a = r.length;
|
|
779
|
+
return r.some(tt) && (a += rr), t && (a += Qt), r.filter((l) => !tt(l)).reduce(
|
|
780
|
+
(l, i) => l + (Xt.test(i) ? Zt : i === "" ? er : tr),
|
|
781
|
+
a
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
function ar(e, t) {
|
|
785
|
+
return e.length === t.length && e.slice(0, -1).every((a, l) => a === t[l]) ? (
|
|
786
|
+
// If two routes are siblings, we should try to match the earlier sibling
|
|
787
|
+
// first. This allows people to have fine-grained control over the matching
|
|
788
|
+
// behavior by simply putting routes with identical paths in the order they
|
|
789
|
+
// want them tried.
|
|
790
|
+
e[e.length - 1] - t[t.length - 1]
|
|
791
|
+
) : (
|
|
792
|
+
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
793
|
+
// so they sort equally.
|
|
794
|
+
0
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
function lr(e, t, r = !1) {
|
|
798
|
+
let { routesMeta: a } = e, l = {}, i = "/", o = [];
|
|
799
|
+
for (let u = 0; u < a.length; ++u) {
|
|
800
|
+
let c = a[u], m = u === a.length - 1, s = i === "/" ? t : t.slice(i.length) || "/", f = {
|
|
801
|
+
path: c.relativePath,
|
|
802
|
+
caseSensitive: c.caseSensitive,
|
|
803
|
+
end: m
|
|
804
|
+
}, g = (
|
|
805
|
+
// Use precomputed matcher if it exists
|
|
806
|
+
c.matcher && c.compiledParams ? dt(
|
|
807
|
+
f,
|
|
808
|
+
s,
|
|
809
|
+
c.matcher,
|
|
810
|
+
c.compiledParams
|
|
811
|
+
) : ye(f, s)
|
|
812
|
+
), y = c.route;
|
|
813
|
+
if (!g && m && r && !a[a.length - 1].route.index && (g = ye(
|
|
814
|
+
{
|
|
815
|
+
path: c.relativePath,
|
|
816
|
+
caseSensitive: c.caseSensitive,
|
|
817
|
+
end: !1
|
|
818
|
+
},
|
|
819
|
+
s
|
|
820
|
+
)), !g)
|
|
821
|
+
return null;
|
|
822
|
+
Object.assign(l, g.params), o.push({
|
|
823
|
+
// TODO: Can this as be avoided?
|
|
824
|
+
params: l,
|
|
825
|
+
pathname: z([i, g.pathname]),
|
|
826
|
+
pathnameBase: ur(
|
|
827
|
+
z([i, g.pathnameBase])
|
|
828
|
+
),
|
|
829
|
+
route: y
|
|
830
|
+
}), g.pathnameBase !== "/" && (i = z([i, g.pathnameBase]));
|
|
831
|
+
}
|
|
832
|
+
return o;
|
|
833
|
+
}
|
|
834
|
+
function ye(e, t) {
|
|
835
|
+
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
836
|
+
let [r, a] = ht(
|
|
837
|
+
e.path,
|
|
838
|
+
e.caseSensitive,
|
|
839
|
+
e.end
|
|
840
|
+
);
|
|
841
|
+
return dt(e, t, r, a);
|
|
842
|
+
}
|
|
843
|
+
function dt(e, t, r, a) {
|
|
844
|
+
let l = t.match(r);
|
|
845
|
+
if (!l) return null;
|
|
846
|
+
let i = l[0], o = i.replace(/(.)\/+$/, "$1"), u = l.slice(1);
|
|
847
|
+
return {
|
|
848
|
+
params: a.reduce(
|
|
849
|
+
(m, { paramName: s, isOptional: f }, g) => {
|
|
850
|
+
if (s === "*") {
|
|
851
|
+
let v = u[g] || "";
|
|
852
|
+
o = i.slice(0, i.length - v.length).replace(/(.)\/+$/, "$1");
|
|
853
|
+
}
|
|
854
|
+
const y = u[g];
|
|
855
|
+
return f && !y ? m[s] = void 0 : m[s] = (y || "").replace(/%2F/g, "/"), m;
|
|
856
|
+
},
|
|
857
|
+
{}
|
|
858
|
+
),
|
|
859
|
+
pathname: i,
|
|
860
|
+
pathnameBase: o,
|
|
861
|
+
pattern: e
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
function ht(e, t = !1, r = !0) {
|
|
865
|
+
H(
|
|
866
|
+
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
867
|
+
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
868
|
+
);
|
|
869
|
+
let a = [], l = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
870
|
+
/\/:([\w-]+)(\?)?/g,
|
|
871
|
+
(o, u, c, m, s) => {
|
|
872
|
+
if (a.push({ paramName: u, isOptional: c != null }), c) {
|
|
873
|
+
let f = s.charAt(m + o.length);
|
|
874
|
+
return f && f !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
|
|
875
|
+
}
|
|
876
|
+
return "/([^\\/]+)";
|
|
877
|
+
}
|
|
878
|
+
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
879
|
+
return e.endsWith("*") ? (a.push({ paramName: "*" }), l += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? l += "\\/*$" : e !== "" && e !== "/" && (l += "(?:(?=\\/|$))"), [new RegExp(l, t ? void 0 : "i"), a];
|
|
880
|
+
}
|
|
881
|
+
function ir(e) {
|
|
882
|
+
try {
|
|
883
|
+
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
884
|
+
} catch (t) {
|
|
885
|
+
return H(
|
|
886
|
+
!1,
|
|
887
|
+
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
|
|
888
|
+
), e;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
function K(e, t) {
|
|
892
|
+
if (t === "/") return e;
|
|
893
|
+
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
894
|
+
return null;
|
|
895
|
+
let r = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(r);
|
|
896
|
+
return a && a !== "/" ? null : e.slice(r) || "/";
|
|
897
|
+
}
|
|
898
|
+
function or(e, t = "/") {
|
|
899
|
+
let {
|
|
900
|
+
pathname: r,
|
|
901
|
+
search: a = "",
|
|
902
|
+
hash: l = ""
|
|
903
|
+
} = typeof e == "string" ? $e(e) : e, i;
|
|
904
|
+
return r ? (r = mt(r), r.startsWith("/") ? i = rt(r.substring(1), "/") : i = rt(r, t)) : i = t, {
|
|
905
|
+
pathname: i,
|
|
906
|
+
search: cr(a),
|
|
907
|
+
hash: dr(l)
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
function rt(e, t) {
|
|
911
|
+
let r = ve(t).split("/");
|
|
912
|
+
return e.split("/").forEach((l) => {
|
|
913
|
+
l === ".." ? r.length > 1 && r.pop() : l !== "." && r.push(l);
|
|
914
|
+
}), r.length > 1 ? r.join("/") : "/";
|
|
915
|
+
}
|
|
916
|
+
function Ie(e, t, r, a) {
|
|
917
|
+
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
|
|
918
|
+
a
|
|
919
|
+
)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
920
|
+
}
|
|
921
|
+
function sr(e) {
|
|
922
|
+
return e.filter(
|
|
923
|
+
(t, r) => r === 0 || t.route.path && t.route.path.length > 0
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
function ft(e) {
|
|
927
|
+
let t = sr(e);
|
|
928
|
+
return t.map(
|
|
929
|
+
(r, a) => a === t.length - 1 ? r.pathname : r.pathnameBase
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
function Fe(e, t, r, a = !1) {
|
|
933
|
+
let l;
|
|
934
|
+
typeof e == "string" ? l = $e(e) : (l = { ...e }, $(
|
|
935
|
+
!l.pathname || !l.pathname.includes("?"),
|
|
936
|
+
Ie("?", "pathname", "search", l)
|
|
937
|
+
), $(
|
|
938
|
+
!l.pathname || !l.pathname.includes("#"),
|
|
939
|
+
Ie("#", "pathname", "hash", l)
|
|
940
|
+
), $(
|
|
941
|
+
!l.search || !l.search.includes("#"),
|
|
942
|
+
Ie("#", "search", "hash", l)
|
|
943
|
+
));
|
|
944
|
+
let i = e === "" || l.pathname === "", o = i ? "/" : l.pathname, u;
|
|
945
|
+
if (o == null)
|
|
946
|
+
u = r;
|
|
947
|
+
else {
|
|
948
|
+
let f = t.length - 1;
|
|
949
|
+
if (!a && o.startsWith("..")) {
|
|
950
|
+
let g = o.split("/");
|
|
951
|
+
for (; g[0] === ".."; )
|
|
952
|
+
g.shift(), f -= 1;
|
|
953
|
+
l.pathname = g.join("/");
|
|
954
|
+
}
|
|
955
|
+
u = f >= 0 ? t[f] : "/";
|
|
956
|
+
}
|
|
957
|
+
let c = or(l, u), m = o && o !== "/" && o.endsWith("/"), s = (i || o === ".") && r.endsWith("/");
|
|
958
|
+
return !c.pathname.endsWith("/") && (m || s) && (c.pathname += "/"), c;
|
|
959
|
+
}
|
|
960
|
+
var mt = (e) => e.replace(/[\\/]{2,}/g, "/"), z = (e) => mt(e.join("/")), ve = (e) => e.replace(/\/+$/, ""), ur = (e) => ve(e).replace(/^\/*/, "/"), cr = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, dr = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, hr = class {
|
|
961
|
+
constructor(e, t, r, a = !1) {
|
|
962
|
+
this.status = e, this.statusText = t || "", this.internal = a, r instanceof Error ? (this.data = r.toString(), this.error = r) : this.data = r;
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
function fr(e) {
|
|
966
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
967
|
+
}
|
|
968
|
+
function mr(e) {
|
|
969
|
+
let t = e.map((r) => r.route.path).filter(Boolean);
|
|
970
|
+
return z(t) || "/";
|
|
971
|
+
}
|
|
972
|
+
var pt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
973
|
+
function gt(e, t) {
|
|
974
|
+
let r = e;
|
|
975
|
+
if (typeof r != "string" || !Ne.test(r))
|
|
976
|
+
return {
|
|
977
|
+
absoluteURL: void 0,
|
|
978
|
+
isExternal: !1,
|
|
979
|
+
to: r
|
|
980
|
+
};
|
|
981
|
+
let a = r, l = !1;
|
|
982
|
+
if (pt)
|
|
983
|
+
try {
|
|
984
|
+
let i = new URL(window.location.href), o = Yt.test(r) ? new URL(qt(r, i.protocol)) : new URL(r), u = K(o.pathname, t);
|
|
985
|
+
o.origin === i.origin && u != null ? r = u + o.search + o.hash : l = !0;
|
|
986
|
+
} catch {
|
|
987
|
+
H(
|
|
988
|
+
!1,
|
|
989
|
+
`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
return {
|
|
993
|
+
absoluteURL: a,
|
|
994
|
+
isExternal: l,
|
|
995
|
+
to: r
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
999
|
+
var xt = [
|
|
1000
|
+
"POST",
|
|
1001
|
+
"PUT",
|
|
1002
|
+
"PATCH",
|
|
1003
|
+
"DELETE"
|
|
1004
|
+
];
|
|
1005
|
+
new Set(
|
|
1006
|
+
xt
|
|
1007
|
+
);
|
|
1008
|
+
var pr = [
|
|
1009
|
+
"GET",
|
|
1010
|
+
...xt
|
|
1011
|
+
];
|
|
1012
|
+
new Set(pr);
|
|
1013
|
+
var gr = [
|
|
1014
|
+
"about:",
|
|
1015
|
+
"blob:",
|
|
1016
|
+
"chrome:",
|
|
1017
|
+
"chrome-untrusted:",
|
|
1018
|
+
"content:",
|
|
1019
|
+
"data:",
|
|
1020
|
+
"devtools:",
|
|
1021
|
+
"file:",
|
|
1022
|
+
"filesystem:",
|
|
1023
|
+
// eslint-disable-next-line no-script-url
|
|
1024
|
+
"javascript:"
|
|
1025
|
+
];
|
|
1026
|
+
function xr(e) {
|
|
1027
|
+
try {
|
|
1028
|
+
return gr.includes(new URL(e).protocol);
|
|
1029
|
+
} catch {
|
|
1030
|
+
return !1;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
var te = d.createContext(null);
|
|
1034
|
+
te.displayName = "DataRouter";
|
|
1035
|
+
var we = d.createContext(null);
|
|
1036
|
+
we.displayName = "DataRouterState";
|
|
1037
|
+
var yt = d.createContext(!1);
|
|
1038
|
+
function yr() {
|
|
1039
|
+
return d.useContext(yt);
|
|
1040
|
+
}
|
|
1041
|
+
var vt = d.createContext({
|
|
1042
|
+
isTransitioning: !1
|
|
1043
|
+
});
|
|
1044
|
+
vt.displayName = "ViewTransition";
|
|
1045
|
+
var vr = d.createContext(
|
|
1046
|
+
/* @__PURE__ */ new Map()
|
|
1047
|
+
);
|
|
1048
|
+
vr.displayName = "Fetchers";
|
|
1049
|
+
var br = d.createContext(null);
|
|
1050
|
+
br.displayName = "Await";
|
|
1051
|
+
var U = d.createContext(
|
|
1052
|
+
null
|
|
1053
|
+
);
|
|
1054
|
+
U.displayName = "Navigation";
|
|
1055
|
+
var Be = d.createContext(
|
|
1056
|
+
null
|
|
1057
|
+
);
|
|
1058
|
+
Be.displayName = "Location";
|
|
1059
|
+
var W = d.createContext({
|
|
1060
|
+
outlet: null,
|
|
1061
|
+
matches: [],
|
|
1062
|
+
isDataRoute: !1
|
|
1063
|
+
});
|
|
1064
|
+
W.displayName = "Route";
|
|
1065
|
+
var Me = d.createContext(null);
|
|
1066
|
+
Me.displayName = "RouteError";
|
|
1067
|
+
var bt = "REACT_ROUTER_ERROR", wr = "REDIRECT", Er = "ROUTE_ERROR_RESPONSE";
|
|
1068
|
+
function Rr(e) {
|
|
1069
|
+
if (e.startsWith(`${bt}:${wr}:{`))
|
|
1070
|
+
try {
|
|
1071
|
+
let t = JSON.parse(e.slice(28));
|
|
1072
|
+
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean")
|
|
1073
|
+
return t;
|
|
1074
|
+
} catch {
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
function jr(e) {
|
|
1078
|
+
if (e.startsWith(
|
|
1079
|
+
`${bt}:${Er}:{`
|
|
1080
|
+
))
|
|
1081
|
+
try {
|
|
1082
|
+
let t = JSON.parse(e.slice(40));
|
|
1083
|
+
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string")
|
|
1084
|
+
return new hr(
|
|
1085
|
+
t.status,
|
|
1086
|
+
t.statusText,
|
|
1087
|
+
t.data
|
|
1088
|
+
);
|
|
1089
|
+
} catch {
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function Sr(e, { relative: t } = {}) {
|
|
1093
|
+
$(
|
|
1094
|
+
Ee(),
|
|
1095
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1096
|
+
// router loaded. We can help them understand how to avoid that.
|
|
1097
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
1098
|
+
);
|
|
1099
|
+
let { basename: r, navigator: a } = d.useContext(U), { hash: l, pathname: i, search: o } = ue(e, { relative: t }), u = i;
|
|
1100
|
+
return r !== "/" && (u = i === "/" ? r : z([r, i])), a.createHref({ pathname: u, search: o, hash: l });
|
|
1101
|
+
}
|
|
1102
|
+
function Ee() {
|
|
1103
|
+
return d.useContext(Be) != null;
|
|
1104
|
+
}
|
|
1105
|
+
function Y() {
|
|
1106
|
+
return $(
|
|
1107
|
+
Ee(),
|
|
1108
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1109
|
+
// router loaded. We can help them understand how to avoid that.
|
|
1110
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
1111
|
+
), d.useContext(Be).location;
|
|
1112
|
+
}
|
|
1113
|
+
var wt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
1114
|
+
function Et(e) {
|
|
1115
|
+
d.useContext(U).static || d.useLayoutEffect(e);
|
|
1116
|
+
}
|
|
1117
|
+
function Cr() {
|
|
1118
|
+
let { isDataRoute: e } = d.useContext(W);
|
|
1119
|
+
return e ? zr() : kr();
|
|
1120
|
+
}
|
|
1121
|
+
function kr() {
|
|
1122
|
+
$(
|
|
1123
|
+
Ee(),
|
|
1124
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1125
|
+
// router loaded. We can help them understand how to avoid that.
|
|
1126
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
1127
|
+
);
|
|
1128
|
+
let e = d.useContext(te), { basename: t, navigator: r } = d.useContext(U), { matches: a } = d.useContext(W), { pathname: l } = Y(), i = JSON.stringify(ft(a)), o = d.useRef(!1);
|
|
1129
|
+
return Et(() => {
|
|
1130
|
+
o.current = !0;
|
|
1131
|
+
}), d.useCallback(
|
|
1132
|
+
(c, m = {}) => {
|
|
1133
|
+
if (H(o.current, wt), !o.current) return;
|
|
1134
|
+
if (typeof c == "number") {
|
|
1135
|
+
r.go(c);
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
let s = Fe(
|
|
1139
|
+
c,
|
|
1140
|
+
JSON.parse(i),
|
|
1141
|
+
l,
|
|
1142
|
+
m.relative === "path"
|
|
1143
|
+
);
|
|
1144
|
+
e == null && t !== "/" && (s.pathname = s.pathname === "/" ? t : z([t, s.pathname])), (m.replace ? r.replace : r.push)(
|
|
1145
|
+
s,
|
|
1146
|
+
m.state,
|
|
1147
|
+
m
|
|
1148
|
+
);
|
|
1149
|
+
},
|
|
1150
|
+
[
|
|
1151
|
+
t,
|
|
1152
|
+
r,
|
|
1153
|
+
i,
|
|
1154
|
+
l,
|
|
1155
|
+
e
|
|
1156
|
+
]
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
var Ir = d.createContext(null);
|
|
1160
|
+
function Pr(e) {
|
|
1161
|
+
let t = d.useContext(W).outlet;
|
|
1162
|
+
return d.useMemo(
|
|
1163
|
+
() => t && /* @__PURE__ */ d.createElement(Ir.Provider, { value: e }, t),
|
|
1164
|
+
[t, e]
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
function ue(e, { relative: t } = {}) {
|
|
1168
|
+
let { matches: r } = d.useContext(W), { pathname: a } = Y(), l = JSON.stringify(ft(r));
|
|
1169
|
+
return d.useMemo(
|
|
1170
|
+
() => Fe(
|
|
1171
|
+
e,
|
|
1172
|
+
JSON.parse(l),
|
|
1173
|
+
a,
|
|
1174
|
+
t === "path"
|
|
1175
|
+
),
|
|
1176
|
+
[e, l, a, t]
|
|
1177
|
+
);
|
|
1178
|
+
}
|
|
1179
|
+
function Tr(e, t, r) {
|
|
1180
|
+
$(
|
|
1181
|
+
Ee(),
|
|
1182
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1183
|
+
// router loaded. We can help them understand how to avoid that.
|
|
1184
|
+
"useRoutes() may be used only in the context of a <Router> component."
|
|
1185
|
+
);
|
|
1186
|
+
let { navigator: a } = d.useContext(U), { matches: l } = d.useContext(W), i = l[l.length - 1], o = i ? i.params : {}, u = i ? i.pathname : "/", c = i ? i.pathnameBase : "/", m = i && i.route;
|
|
1187
|
+
{
|
|
1188
|
+
let p = m && m.path || "";
|
|
1189
|
+
jt(
|
|
1190
|
+
u,
|
|
1191
|
+
!m || p.endsWith("*") || p.endsWith("*?"),
|
|
1192
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${p}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1193
|
+
|
|
1194
|
+
Please change the parent <Route path="${p}"> to <Route path="${p === "/" ? "*" : `${p}/*`}">.`
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1197
|
+
let s = Y(), f;
|
|
1198
|
+
f = s;
|
|
1199
|
+
let g = f.pathname || "/", y = g;
|
|
1200
|
+
if (c !== "/") {
|
|
1201
|
+
let p = c.replace(/^\//, "").split("/");
|
|
1202
|
+
y = "/" + g.replace(/^\//, "").split("/").slice(p.length).join("/");
|
|
1203
|
+
}
|
|
1204
|
+
let v = r && r.state.matches.length ? (
|
|
1205
|
+
// If we're in a data router, use the matches we've already identified but ensure
|
|
1206
|
+
// we have the latest route instances from the manifest in case elements have changed
|
|
1207
|
+
r.state.matches.map(
|
|
1208
|
+
(p) => Object.assign(p, {
|
|
1209
|
+
route: r.manifest[p.route.id] || p.route
|
|
1210
|
+
})
|
|
1211
|
+
)
|
|
1212
|
+
) : st(e, { pathname: y });
|
|
1213
|
+
return H(
|
|
1214
|
+
m || v != null,
|
|
1215
|
+
`No routes matched location "${f.pathname}${f.search}${f.hash}" `
|
|
1216
|
+
), H(
|
|
1217
|
+
v == null || v[v.length - 1].route.element !== void 0 || v[v.length - 1].route.Component !== void 0 || v[v.length - 1].route.lazy !== void 0,
|
|
1218
|
+
`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
1219
|
+
), Dr(
|
|
1220
|
+
v && v.map(
|
|
1221
|
+
(p) => Object.assign({}, p, {
|
|
1222
|
+
params: Object.assign({}, o, p.params),
|
|
1223
|
+
pathname: z([
|
|
1224
|
+
c,
|
|
1225
|
+
// Re-encode pathnames that were decoded inside matchRoutes.
|
|
1226
|
+
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
1227
|
+
// `new URL()` internally and we need to prevent it from treating
|
|
1228
|
+
// them as separators
|
|
1229
|
+
a.encodeLocation ? a.encodeLocation(
|
|
1230
|
+
p.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
1231
|
+
).pathname : p.pathname
|
|
1232
|
+
]),
|
|
1233
|
+
pathnameBase: p.pathnameBase === "/" ? c : z([
|
|
1234
|
+
c,
|
|
1235
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
1236
|
+
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
1237
|
+
// `new URL()` internally and we need to prevent it from treating
|
|
1238
|
+
// them as separators
|
|
1239
|
+
a.encodeLocation ? a.encodeLocation(
|
|
1240
|
+
p.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
1241
|
+
).pathname : p.pathnameBase
|
|
1242
|
+
])
|
|
1243
|
+
})
|
|
1244
|
+
),
|
|
1245
|
+
l,
|
|
1246
|
+
r
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
function Ar() {
|
|
1250
|
+
let e = Mr(), t = fr(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", l = { padding: "0.5rem", backgroundColor: a }, i = { padding: "2px 4px", backgroundColor: a }, o = null;
|
|
1251
|
+
return console.error(
|
|
1252
|
+
"Error handled by React Router default ErrorBoundary:",
|
|
1253
|
+
e
|
|
1254
|
+
), o = /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ d.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ d.createElement("code", { style: i }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ d.createElement("code", { style: i }, "errorElement"), " prop on your route.")), /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ d.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ d.createElement("pre", { style: l }, r) : null, o);
|
|
1255
|
+
}
|
|
1256
|
+
var Lr = /* @__PURE__ */ d.createElement(Ar, null), Rt = class extends d.Component {
|
|
1257
|
+
constructor(e) {
|
|
1258
|
+
super(e), this.state = {
|
|
1259
|
+
location: e.location,
|
|
1260
|
+
revalidation: e.revalidation,
|
|
1261
|
+
error: e.error
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
static getDerivedStateFromError(e) {
|
|
1265
|
+
return { error: e };
|
|
1266
|
+
}
|
|
1267
|
+
static getDerivedStateFromProps(e, t) {
|
|
1268
|
+
return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
1269
|
+
error: e.error,
|
|
1270
|
+
location: e.location,
|
|
1271
|
+
revalidation: e.revalidation
|
|
1272
|
+
} : {
|
|
1273
|
+
error: e.error !== void 0 ? e.error : t.error,
|
|
1274
|
+
location: t.location,
|
|
1275
|
+
revalidation: e.revalidation || t.revalidation
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
componentDidCatch(e, t) {
|
|
1279
|
+
this.props.onError ? this.props.onError(e, t) : console.error(
|
|
1280
|
+
"React Router caught the following error during render",
|
|
1281
|
+
e
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
render() {
|
|
1285
|
+
let e = this.state.error;
|
|
1286
|
+
if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
|
|
1287
|
+
const r = jr(e.digest);
|
|
1288
|
+
r && (e = r);
|
|
1289
|
+
}
|
|
1290
|
+
let t = e !== void 0 ? /* @__PURE__ */ d.createElement(W.Provider, { value: this.props.routeContext }, /* @__PURE__ */ d.createElement(
|
|
1291
|
+
Me.Provider,
|
|
1292
|
+
{
|
|
1293
|
+
value: e,
|
|
1294
|
+
children: this.props.component
|
|
1295
|
+
}
|
|
1296
|
+
)) : this.props.children;
|
|
1297
|
+
return this.context ? /* @__PURE__ */ d.createElement(_r, { error: e }, t) : t;
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
Rt.contextType = yt;
|
|
1301
|
+
var Pe = /* @__PURE__ */ new WeakMap();
|
|
1302
|
+
function _r({
|
|
1303
|
+
children: e,
|
|
1304
|
+
error: t
|
|
1305
|
+
}) {
|
|
1306
|
+
let { basename: r } = d.useContext(U);
|
|
1307
|
+
if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
|
|
1308
|
+
let a = Rr(t.digest);
|
|
1309
|
+
if (a) {
|
|
1310
|
+
let l = Pe.get(t);
|
|
1311
|
+
if (l) throw l;
|
|
1312
|
+
let i = gt(a.location, r), o = i.absoluteURL || i.to;
|
|
1313
|
+
if (xr(o))
|
|
1314
|
+
throw new Error("Invalid redirect location");
|
|
1315
|
+
if (pt && !Pe.get(t))
|
|
1316
|
+
if (i.isExternal || a.reloadDocument)
|
|
1317
|
+
window.location.href = o;
|
|
1318
|
+
else {
|
|
1319
|
+
const u = Promise.resolve().then(
|
|
1320
|
+
() => window.__reactRouterDataRouter.navigate(i.to, {
|
|
1321
|
+
replace: a.replace
|
|
1322
|
+
})
|
|
1323
|
+
);
|
|
1324
|
+
throw Pe.set(t, u), u;
|
|
1325
|
+
}
|
|
1326
|
+
return /* @__PURE__ */ d.createElement("meta", { httpEquiv: "refresh", content: `0;url=${o}` });
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
return e;
|
|
1330
|
+
}
|
|
1331
|
+
function Or({ routeContext: e, match: t, children: r }) {
|
|
1332
|
+
let a = d.useContext(te);
|
|
1333
|
+
return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ d.createElement(W.Provider, { value: e }, r);
|
|
1334
|
+
}
|
|
1335
|
+
function Dr(e, t = [], r) {
|
|
1336
|
+
let a = r == null ? void 0 : r.state;
|
|
1337
|
+
if (e == null) {
|
|
1338
|
+
if (!a)
|
|
1339
|
+
return null;
|
|
1340
|
+
if (a.errors)
|
|
1341
|
+
e = a.matches;
|
|
1342
|
+
else if (t.length === 0 && !a.initialized && a.matches.length > 0)
|
|
1343
|
+
e = a.matches;
|
|
1344
|
+
else
|
|
1345
|
+
return null;
|
|
1346
|
+
}
|
|
1347
|
+
let l = e, i = a == null ? void 0 : a.errors;
|
|
1348
|
+
if (i != null) {
|
|
1349
|
+
let s = l.findIndex(
|
|
1350
|
+
(f) => f.route.id && (i == null ? void 0 : i[f.route.id]) !== void 0
|
|
1351
|
+
);
|
|
1352
|
+
$(
|
|
1353
|
+
s >= 0,
|
|
1354
|
+
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
1355
|
+
i
|
|
1356
|
+
).join(",")}`
|
|
1357
|
+
), l = l.slice(
|
|
1358
|
+
0,
|
|
1359
|
+
Math.min(l.length, s + 1)
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
let o = !1, u = -1;
|
|
1363
|
+
if (r && a) {
|
|
1364
|
+
o = a.renderFallback;
|
|
1365
|
+
for (let s = 0; s < l.length; s++) {
|
|
1366
|
+
let f = l[s];
|
|
1367
|
+
if ((f.route.HydrateFallback || f.route.hydrateFallbackElement) && (u = s), f.route.id) {
|
|
1368
|
+
let { loaderData: g, errors: y } = a, v = f.route.loader && !g.hasOwnProperty(f.route.id) && (!y || y[f.route.id] === void 0);
|
|
1369
|
+
if (f.route.lazy || v) {
|
|
1370
|
+
r.isStatic && (o = !0), u >= 0 ? l = l.slice(0, u + 1) : l = [l[0]];
|
|
1371
|
+
break;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
let c = r == null ? void 0 : r.onError, m = a && c ? (s, f) => {
|
|
1377
|
+
var g, y;
|
|
1378
|
+
c(s, {
|
|
1379
|
+
location: a.location,
|
|
1380
|
+
params: ((y = (g = a.matches) == null ? void 0 : g[0]) == null ? void 0 : y.params) ?? {},
|
|
1381
|
+
pattern: mr(a.matches),
|
|
1382
|
+
errorInfo: f
|
|
1383
|
+
});
|
|
1384
|
+
} : void 0;
|
|
1385
|
+
return l.reduceRight(
|
|
1386
|
+
(s, f, g) => {
|
|
1387
|
+
let y, v = !1, b = null, p = null;
|
|
1388
|
+
a && (y = i && f.route.id ? i[f.route.id] : void 0, b = f.route.errorElement || Lr, o && (u < 0 && g === 0 ? (jt(
|
|
1389
|
+
"route-fallback",
|
|
1390
|
+
!1,
|
|
1391
|
+
"No `HydrateFallback` element provided to render during initial hydration"
|
|
1392
|
+
), v = !0, p = null) : u === g && (v = !0, p = f.route.hydrateFallbackElement || null)));
|
|
1393
|
+
let S = t.concat(l.slice(0, g + 1)), x = () => {
|
|
1394
|
+
let R;
|
|
1395
|
+
return y ? R = b : v ? R = p : f.route.Component ? R = /* @__PURE__ */ d.createElement(f.route.Component, null) : f.route.element ? R = f.route.element : R = s, /* @__PURE__ */ d.createElement(
|
|
1396
|
+
Or,
|
|
1397
|
+
{
|
|
1398
|
+
match: f,
|
|
1399
|
+
routeContext: {
|
|
1400
|
+
outlet: s,
|
|
1401
|
+
matches: S,
|
|
1402
|
+
isDataRoute: a != null
|
|
1403
|
+
},
|
|
1404
|
+
children: R
|
|
1405
|
+
}
|
|
1406
|
+
);
|
|
1407
|
+
};
|
|
1408
|
+
return a && (f.route.ErrorBoundary || f.route.errorElement || g === 0) ? /* @__PURE__ */ d.createElement(
|
|
1409
|
+
Rt,
|
|
1410
|
+
{
|
|
1411
|
+
location: a.location,
|
|
1412
|
+
revalidation: a.revalidation,
|
|
1413
|
+
component: b,
|
|
1414
|
+
error: y,
|
|
1415
|
+
children: x(),
|
|
1416
|
+
routeContext: { outlet: null, matches: S, isDataRoute: !0 },
|
|
1417
|
+
onError: m
|
|
1418
|
+
}
|
|
1419
|
+
) : x();
|
|
1420
|
+
},
|
|
1421
|
+
null
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
function ze(e) {
|
|
1425
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1426
|
+
}
|
|
1427
|
+
function Nr(e) {
|
|
1428
|
+
let t = d.useContext(te);
|
|
1429
|
+
return $(t, ze(e)), t;
|
|
1430
|
+
}
|
|
1431
|
+
function $r(e) {
|
|
1432
|
+
let t = d.useContext(we);
|
|
1433
|
+
return $(t, ze(e)), t;
|
|
1434
|
+
}
|
|
1435
|
+
function Fr(e) {
|
|
1436
|
+
let t = d.useContext(W);
|
|
1437
|
+
return $(t, ze(e)), t;
|
|
1438
|
+
}
|
|
1439
|
+
function Ue(e) {
|
|
1440
|
+
let t = Fr(e), r = t.matches[t.matches.length - 1];
|
|
1441
|
+
return $(
|
|
1442
|
+
r.route.id,
|
|
1443
|
+
`${e} can only be used on routes that contain a unique "id"`
|
|
1444
|
+
), r.route.id;
|
|
1445
|
+
}
|
|
1446
|
+
function Br() {
|
|
1447
|
+
return Ue(
|
|
1448
|
+
"useRouteId"
|
|
1449
|
+
/* UseRouteId */
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1452
|
+
function Mr() {
|
|
1453
|
+
var a;
|
|
1454
|
+
let e = d.useContext(Me), t = $r(
|
|
1455
|
+
"useRouteError"
|
|
1456
|
+
/* UseRouteError */
|
|
1457
|
+
), r = Ue(
|
|
1458
|
+
"useRouteError"
|
|
1459
|
+
/* UseRouteError */
|
|
1460
|
+
);
|
|
1461
|
+
return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[r];
|
|
1462
|
+
}
|
|
1463
|
+
function zr() {
|
|
1464
|
+
let { router: e } = Nr(
|
|
1465
|
+
"useNavigate"
|
|
1466
|
+
/* UseNavigateStable */
|
|
1467
|
+
), t = Ue(
|
|
1468
|
+
"useNavigate"
|
|
1469
|
+
/* UseNavigateStable */
|
|
1470
|
+
), r = d.useRef(!1);
|
|
1471
|
+
return Et(() => {
|
|
1472
|
+
r.current = !0;
|
|
1473
|
+
}), d.useCallback(
|
|
1474
|
+
async (l, i = {}) => {
|
|
1475
|
+
H(r.current, wt), r.current && (typeof l == "number" ? await e.navigate(l) : await e.navigate(l, { fromRouteId: t, ...i }));
|
|
1476
|
+
},
|
|
1477
|
+
[e, t]
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
var nt = {};
|
|
1481
|
+
function jt(e, t, r) {
|
|
1482
|
+
!t && !nt[e] && (nt[e] = !0, H(!1, r));
|
|
1483
|
+
}
|
|
1484
|
+
d.memo(Ur);
|
|
1485
|
+
function Ur({
|
|
1486
|
+
routes: e,
|
|
1487
|
+
manifest: t,
|
|
1488
|
+
future: r,
|
|
1489
|
+
state: a,
|
|
1490
|
+
isStatic: l,
|
|
1491
|
+
onError: i
|
|
1492
|
+
}) {
|
|
1493
|
+
return Tr(e, void 0, {
|
|
1494
|
+
manifest: t,
|
|
1495
|
+
state: a,
|
|
1496
|
+
isStatic: l,
|
|
1497
|
+
onError: i
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
function We(e) {
|
|
1501
|
+
return Pr(e.context);
|
|
1502
|
+
}
|
|
1503
|
+
var pe = "get", ge = "application/x-www-form-urlencoded";
|
|
1504
|
+
function Re(e) {
|
|
1505
|
+
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
1506
|
+
}
|
|
1507
|
+
function Wr(e) {
|
|
1508
|
+
return Re(e) && e.tagName.toLowerCase() === "button";
|
|
1509
|
+
}
|
|
1510
|
+
function Vr(e) {
|
|
1511
|
+
return Re(e) && e.tagName.toLowerCase() === "form";
|
|
1512
|
+
}
|
|
1513
|
+
function Hr(e) {
|
|
1514
|
+
return Re(e) && e.tagName.toLowerCase() === "input";
|
|
1515
|
+
}
|
|
1516
|
+
function Yr(e) {
|
|
1517
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
1518
|
+
}
|
|
1519
|
+
function qr(e, t) {
|
|
1520
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
1521
|
+
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
1522
|
+
!Yr(e);
|
|
1523
|
+
}
|
|
1524
|
+
var me = null;
|
|
1525
|
+
function Gr() {
|
|
1526
|
+
if (me === null)
|
|
1527
|
+
try {
|
|
1528
|
+
new FormData(
|
|
1529
|
+
document.createElement("form"),
|
|
1530
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
1531
|
+
0
|
|
1532
|
+
), me = !1;
|
|
1533
|
+
} catch {
|
|
1534
|
+
me = !0;
|
|
1535
|
+
}
|
|
1536
|
+
return me;
|
|
1537
|
+
}
|
|
1538
|
+
var Jr = /* @__PURE__ */ new Set([
|
|
1539
|
+
"application/x-www-form-urlencoded",
|
|
1540
|
+
"multipart/form-data",
|
|
1541
|
+
"text/plain"
|
|
1542
|
+
]);
|
|
1543
|
+
function Te(e) {
|
|
1544
|
+
return e != null && !Jr.has(e) ? (H(
|
|
1545
|
+
!1,
|
|
1546
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ge}"`
|
|
1547
|
+
), null) : e;
|
|
1548
|
+
}
|
|
1549
|
+
function Kr(e, t) {
|
|
1550
|
+
let r, a, l, i, o;
|
|
1551
|
+
if (Vr(e)) {
|
|
1552
|
+
let u = e.getAttribute("action");
|
|
1553
|
+
a = u ? K(u, t) : null, r = e.getAttribute("method") || pe, l = Te(e.getAttribute("enctype")) || ge, i = new FormData(e);
|
|
1554
|
+
} else if (Wr(e) || Hr(e) && (e.type === "submit" || e.type === "image")) {
|
|
1555
|
+
let u = e.form;
|
|
1556
|
+
if (u == null)
|
|
1557
|
+
throw new Error(
|
|
1558
|
+
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1559
|
+
);
|
|
1560
|
+
let c = e.getAttribute("formaction") || u.getAttribute("action");
|
|
1561
|
+
if (a = c ? K(c, t) : null, r = e.getAttribute("formmethod") || u.getAttribute("method") || pe, l = Te(e.getAttribute("formenctype")) || Te(u.getAttribute("enctype")) || ge, i = new FormData(u, e), !Gr()) {
|
|
1562
|
+
let { name: m, type: s, value: f } = e;
|
|
1563
|
+
if (s === "image") {
|
|
1564
|
+
let g = m ? `${m}.` : "";
|
|
1565
|
+
i.append(`${g}x`, "0"), i.append(`${g}y`, "0");
|
|
1566
|
+
} else m && i.append(m, f);
|
|
1567
|
+
}
|
|
1568
|
+
} else {
|
|
1569
|
+
if (Re(e))
|
|
1570
|
+
throw new Error(
|
|
1571
|
+
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
1572
|
+
);
|
|
1573
|
+
r = pe, a = null, l = ge, o = e;
|
|
1574
|
+
}
|
|
1575
|
+
return i && l === "text/plain" && (o = i, i = void 0), { action: a, method: r.toLowerCase(), encType: l, formData: i, body: o };
|
|
1576
|
+
}
|
|
1577
|
+
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
1578
|
+
function Ve(e, t) {
|
|
1579
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
1580
|
+
throw new Error(t);
|
|
1581
|
+
}
|
|
1582
|
+
function St(e, t, r, a) {
|
|
1583
|
+
let l = typeof e == "string" ? new URL(
|
|
1584
|
+
e,
|
|
1585
|
+
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1586
|
+
// don't assume window is available
|
|
1587
|
+
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1588
|
+
) : e;
|
|
1589
|
+
return r ? l.pathname.endsWith("/") ? l.pathname = `${l.pathname}_.${a}` : l.pathname = `${l.pathname}.${a}` : l.pathname === "/" ? l.pathname = `_root.${a}` : t && K(l.pathname, t) === "/" ? l.pathname = `${ve(t)}/_root.${a}` : l.pathname = `${ve(l.pathname)}.${a}`, l;
|
|
1590
|
+
}
|
|
1591
|
+
async function Xr(e, t) {
|
|
1592
|
+
if (e.id in t)
|
|
1593
|
+
return t[e.id];
|
|
1594
|
+
try {
|
|
1595
|
+
let r = await import(
|
|
1596
|
+
/* @vite-ignore */
|
|
1597
|
+
/* webpackIgnore: true */
|
|
1598
|
+
e.module
|
|
1599
|
+
);
|
|
1600
|
+
return t[e.id] = r, r;
|
|
1601
|
+
} catch (r) {
|
|
1602
|
+
return console.error(
|
|
1603
|
+
`Error loading route module \`${e.module}\`, reloading page...`
|
|
1604
|
+
), console.error(r), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
function Zr(e) {
|
|
1609
|
+
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
1610
|
+
}
|
|
1611
|
+
async function Qr(e, t, r) {
|
|
1612
|
+
let a = await Promise.all(
|
|
1613
|
+
e.map(async (l) => {
|
|
1614
|
+
let i = t.routes[l.route.id];
|
|
1615
|
+
if (i) {
|
|
1616
|
+
let o = await Xr(i, r);
|
|
1617
|
+
return o.links ? o.links() : [];
|
|
1618
|
+
}
|
|
1619
|
+
return [];
|
|
1620
|
+
})
|
|
1621
|
+
);
|
|
1622
|
+
return nn(
|
|
1623
|
+
a.flat(1).filter(Zr).filter((l) => l.rel === "stylesheet" || l.rel === "preload").map(
|
|
1624
|
+
(l) => l.rel === "stylesheet" ? { ...l, rel: "prefetch", as: "style" } : { ...l, rel: "prefetch" }
|
|
1625
|
+
)
|
|
1626
|
+
);
|
|
1627
|
+
}
|
|
1628
|
+
function at(e, t, r, a, l, i) {
|
|
1629
|
+
let o = (c, m) => r[m] ? c.route.id !== r[m].route.id : !0, u = (c, m) => {
|
|
1630
|
+
var s;
|
|
1631
|
+
return (
|
|
1632
|
+
// param change, /users/123 -> /users/456
|
|
1633
|
+
r[m].pathname !== c.pathname || // splat param changed, which is not present in match.path
|
|
1634
|
+
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1635
|
+
((s = r[m].route.path) == null ? void 0 : s.endsWith("*")) && r[m].params["*"] !== c.params["*"]
|
|
1636
|
+
);
|
|
1637
|
+
};
|
|
1638
|
+
return i === "assets" ? t.filter(
|
|
1639
|
+
(c, m) => o(c, m) || u(c, m)
|
|
1640
|
+
) : i === "data" ? t.filter((c, m) => {
|
|
1641
|
+
var f;
|
|
1642
|
+
let s = a.routes[c.route.id];
|
|
1643
|
+
if (!s || !s.hasLoader)
|
|
1644
|
+
return !1;
|
|
1645
|
+
if (o(c, m) || u(c, m))
|
|
1646
|
+
return !0;
|
|
1647
|
+
if (c.route.shouldRevalidate) {
|
|
1648
|
+
let g = c.route.shouldRevalidate({
|
|
1649
|
+
currentUrl: new URL(
|
|
1650
|
+
l.pathname + l.search + l.hash,
|
|
1651
|
+
window.origin
|
|
1652
|
+
),
|
|
1653
|
+
currentParams: ((f = r[0]) == null ? void 0 : f.params) || {},
|
|
1654
|
+
nextUrl: new URL(e, window.origin),
|
|
1655
|
+
nextParams: c.params,
|
|
1656
|
+
defaultShouldRevalidate: !0
|
|
1657
|
+
});
|
|
1658
|
+
if (typeof g == "boolean")
|
|
1659
|
+
return g;
|
|
1660
|
+
}
|
|
1661
|
+
return !0;
|
|
1662
|
+
}) : [];
|
|
1663
|
+
}
|
|
1664
|
+
function en(e, t, { includeHydrateFallback: r } = {}) {
|
|
1665
|
+
return tn(
|
|
1666
|
+
e.map((a) => {
|
|
1667
|
+
let l = t.routes[a.route.id];
|
|
1668
|
+
if (!l) return [];
|
|
1669
|
+
let i = [l.module];
|
|
1670
|
+
return l.clientActionModule && (i = i.concat(l.clientActionModule)), l.clientLoaderModule && (i = i.concat(l.clientLoaderModule)), r && l.hydrateFallbackModule && (i = i.concat(l.hydrateFallbackModule)), l.imports && (i = i.concat(l.imports)), i;
|
|
1671
|
+
}).flat(1)
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
function tn(e) {
|
|
1675
|
+
return [...new Set(e)];
|
|
1676
|
+
}
|
|
1677
|
+
function rn(e) {
|
|
1678
|
+
let t = {}, r = Object.keys(e).sort();
|
|
1679
|
+
for (let a of r)
|
|
1680
|
+
t[a] = e[a];
|
|
1681
|
+
return t;
|
|
1682
|
+
}
|
|
1683
|
+
function nn(e, t) {
|
|
1684
|
+
let r = /* @__PURE__ */ new Set();
|
|
1685
|
+
return new Set(t), e.reduce((a, l) => {
|
|
1686
|
+
let i = JSON.stringify(rn(l));
|
|
1687
|
+
return r.has(i) || (r.add(i), a.push({ key: i, link: l })), a;
|
|
1688
|
+
}, []);
|
|
1689
|
+
}
|
|
1690
|
+
function He() {
|
|
1691
|
+
let e = d.useContext(te);
|
|
1692
|
+
return Ve(
|
|
1693
|
+
e,
|
|
1694
|
+
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1695
|
+
), e;
|
|
1696
|
+
}
|
|
1697
|
+
function an() {
|
|
1698
|
+
let e = d.useContext(we);
|
|
1699
|
+
return Ve(
|
|
1700
|
+
e,
|
|
1701
|
+
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1702
|
+
), e;
|
|
1703
|
+
}
|
|
1704
|
+
var Ye = d.createContext(void 0);
|
|
1705
|
+
Ye.displayName = "FrameworkContext";
|
|
1706
|
+
function je() {
|
|
1707
|
+
let e = d.useContext(Ye);
|
|
1708
|
+
return Ve(
|
|
1709
|
+
e,
|
|
1710
|
+
"You must render this element inside a <HydratedRouter> element"
|
|
1711
|
+
), e;
|
|
1712
|
+
}
|
|
1713
|
+
function ln(e, t) {
|
|
1714
|
+
let r = d.useContext(Ye), [a, l] = d.useState(!1), [i, o] = d.useState(!1), { onFocus: u, onBlur: c, onMouseEnter: m, onMouseLeave: s, onTouchStart: f } = t, g = d.useRef(null);
|
|
1715
|
+
d.useEffect(() => {
|
|
1716
|
+
if (e === "render" && o(!0), e === "viewport") {
|
|
1717
|
+
let b = (S) => {
|
|
1718
|
+
S.forEach((x) => {
|
|
1719
|
+
o(x.isIntersecting);
|
|
1720
|
+
});
|
|
1721
|
+
}, p = new IntersectionObserver(b, { threshold: 0.5 });
|
|
1722
|
+
return g.current && p.observe(g.current), () => {
|
|
1723
|
+
p.disconnect();
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
}, [e]), d.useEffect(() => {
|
|
1727
|
+
if (a) {
|
|
1728
|
+
let b = setTimeout(() => {
|
|
1729
|
+
o(!0);
|
|
1730
|
+
}, 100);
|
|
1731
|
+
return () => {
|
|
1732
|
+
clearTimeout(b);
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
}, [a]);
|
|
1736
|
+
let y = () => {
|
|
1737
|
+
l(!0);
|
|
1738
|
+
}, v = () => {
|
|
1739
|
+
l(!1), o(!1);
|
|
1740
|
+
};
|
|
1741
|
+
return r ? e !== "intent" ? [i, g, {}] : [
|
|
1742
|
+
i,
|
|
1743
|
+
g,
|
|
1744
|
+
{
|
|
1745
|
+
onFocus: oe(u, y),
|
|
1746
|
+
onBlur: oe(c, v),
|
|
1747
|
+
onMouseEnter: oe(m, y),
|
|
1748
|
+
onMouseLeave: oe(s, v),
|
|
1749
|
+
onTouchStart: oe(f, y)
|
|
1750
|
+
}
|
|
1751
|
+
] : [!1, g, {}];
|
|
1752
|
+
}
|
|
1753
|
+
function oe(e, t) {
|
|
1754
|
+
return (r) => {
|
|
1755
|
+
e && e(r), r.defaultPrevented || t(r);
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
function on({ page: e, ...t }) {
|
|
1759
|
+
let r = yr(), { nonce: a } = je(), { router: l } = He(), i = d.useMemo(
|
|
1760
|
+
() => st(l.routes, e, l.basename),
|
|
1761
|
+
[l.routes, e, l.basename]
|
|
1762
|
+
);
|
|
1763
|
+
return i ? (t.nonce == null && a && (t = { ...t, nonce: a }), r ? /* @__PURE__ */ d.createElement(un, { page: e, matches: i, ...t }) : /* @__PURE__ */ d.createElement(cn, { page: e, matches: i, ...t })) : null;
|
|
1764
|
+
}
|
|
1765
|
+
function sn(e) {
|
|
1766
|
+
let { manifest: t, routeModules: r } = je(), [a, l] = d.useState([]);
|
|
1767
|
+
return d.useEffect(() => {
|
|
1768
|
+
let i = !1;
|
|
1769
|
+
return Qr(e, t, r).then(
|
|
1770
|
+
(o) => {
|
|
1771
|
+
i || l(o);
|
|
1772
|
+
}
|
|
1773
|
+
), () => {
|
|
1774
|
+
i = !0;
|
|
1775
|
+
};
|
|
1776
|
+
}, [e, t, r]), a;
|
|
1777
|
+
}
|
|
1778
|
+
function un({
|
|
1779
|
+
page: e,
|
|
1780
|
+
matches: t,
|
|
1781
|
+
...r
|
|
1782
|
+
}) {
|
|
1783
|
+
let a = Y(), { future: l } = je(), { basename: i } = He(), o = d.useMemo(() => {
|
|
1784
|
+
if (e === a.pathname + a.search + a.hash)
|
|
1785
|
+
return [];
|
|
1786
|
+
let u = St(
|
|
1787
|
+
e,
|
|
1788
|
+
i,
|
|
1789
|
+
l.v8_trailingSlashAwareDataRequests,
|
|
1790
|
+
"rsc"
|
|
1791
|
+
), c = !1, m = [];
|
|
1792
|
+
for (let s of t)
|
|
1793
|
+
typeof s.route.shouldRevalidate == "function" ? c = !0 : m.push(s.route.id);
|
|
1794
|
+
return c && m.length > 0 && u.searchParams.set("_routes", m.join(",")), [u.pathname + u.search];
|
|
1795
|
+
}, [
|
|
1796
|
+
i,
|
|
1797
|
+
l.v8_trailingSlashAwareDataRequests,
|
|
1798
|
+
e,
|
|
1799
|
+
a,
|
|
1800
|
+
t
|
|
1801
|
+
]);
|
|
1802
|
+
return /* @__PURE__ */ d.createElement(d.Fragment, null, o.map((u) => /* @__PURE__ */ d.createElement("link", { key: u, rel: "prefetch", as: "fetch", href: u, ...r })));
|
|
1803
|
+
}
|
|
1804
|
+
function cn({
|
|
1805
|
+
page: e,
|
|
1806
|
+
matches: t,
|
|
1807
|
+
...r
|
|
1808
|
+
}) {
|
|
1809
|
+
let a = Y(), { future: l, manifest: i, routeModules: o } = je(), { basename: u } = He(), { loaderData: c, matches: m } = an(), s = d.useMemo(
|
|
1810
|
+
() => at(
|
|
1811
|
+
e,
|
|
1812
|
+
t,
|
|
1813
|
+
m,
|
|
1814
|
+
i,
|
|
1815
|
+
a,
|
|
1816
|
+
"data"
|
|
1817
|
+
),
|
|
1818
|
+
[e, t, m, i, a]
|
|
1819
|
+
), f = d.useMemo(
|
|
1820
|
+
() => at(
|
|
1821
|
+
e,
|
|
1822
|
+
t,
|
|
1823
|
+
m,
|
|
1824
|
+
i,
|
|
1825
|
+
a,
|
|
1826
|
+
"assets"
|
|
1827
|
+
),
|
|
1828
|
+
[e, t, m, i, a]
|
|
1829
|
+
), g = d.useMemo(() => {
|
|
1830
|
+
if (e === a.pathname + a.search + a.hash)
|
|
1831
|
+
return [];
|
|
1832
|
+
let b = /* @__PURE__ */ new Set(), p = !1;
|
|
1833
|
+
if (t.forEach((x) => {
|
|
1834
|
+
var F;
|
|
1835
|
+
let R = i.routes[x.route.id];
|
|
1836
|
+
!R || !R.hasLoader || (!s.some((O) => O.route.id === x.route.id) && x.route.id in c && ((F = o[x.route.id]) != null && F.shouldRevalidate) || R.hasClientLoader ? p = !0 : b.add(x.route.id));
|
|
1837
|
+
}), b.size === 0)
|
|
1838
|
+
return [];
|
|
1839
|
+
let S = St(
|
|
1840
|
+
e,
|
|
1841
|
+
u,
|
|
1842
|
+
l.v8_trailingSlashAwareDataRequests,
|
|
1843
|
+
"data"
|
|
1844
|
+
);
|
|
1845
|
+
return p && b.size > 0 && S.searchParams.set(
|
|
1846
|
+
"_routes",
|
|
1847
|
+
t.filter((x) => b.has(x.route.id)).map((x) => x.route.id).join(",")
|
|
1848
|
+
), [S.pathname + S.search];
|
|
1849
|
+
}, [
|
|
1850
|
+
u,
|
|
1851
|
+
l.v8_trailingSlashAwareDataRequests,
|
|
1852
|
+
c,
|
|
1853
|
+
a,
|
|
1854
|
+
i,
|
|
1855
|
+
s,
|
|
1856
|
+
t,
|
|
1857
|
+
e,
|
|
1858
|
+
o
|
|
1859
|
+
]), y = d.useMemo(
|
|
1860
|
+
() => en(f, i),
|
|
1861
|
+
[f, i]
|
|
1862
|
+
), v = sn(f);
|
|
1863
|
+
return /* @__PURE__ */ d.createElement(d.Fragment, null, g.map((b) => /* @__PURE__ */ d.createElement("link", { key: b, rel: "prefetch", as: "fetch", href: b, ...r })), y.map((b) => /* @__PURE__ */ d.createElement("link", { key: b, rel: "modulepreload", href: b, ...r })), v.map(({ key: b, link: p }) => (
|
|
1864
|
+
// these don't spread `linkProps` because they are full link descriptors
|
|
1865
|
+
// already with their own props
|
|
1866
|
+
/* @__PURE__ */ d.createElement(
|
|
1867
|
+
"link",
|
|
1868
|
+
{
|
|
1869
|
+
key: b,
|
|
1870
|
+
nonce: r.nonce,
|
|
1871
|
+
...p,
|
|
1872
|
+
crossOrigin: p.crossOrigin ?? r.crossOrigin
|
|
1873
|
+
}
|
|
1874
|
+
)
|
|
1875
|
+
)));
|
|
1876
|
+
}
|
|
1877
|
+
function dn(...e) {
|
|
1878
|
+
return (t) => {
|
|
1879
|
+
e.forEach((r) => {
|
|
1880
|
+
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
1881
|
+
});
|
|
1882
|
+
};
|
|
1883
|
+
}
|
|
1884
|
+
var hn = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1885
|
+
try {
|
|
1886
|
+
hn && (window.__reactRouterVersion = // @ts-expect-error
|
|
1887
|
+
"7.18.0");
|
|
1888
|
+
} catch {
|
|
1889
|
+
}
|
|
1890
|
+
var Ct = d.forwardRef(
|
|
1891
|
+
function({
|
|
1892
|
+
onClick: t,
|
|
1893
|
+
discover: r = "render",
|
|
1894
|
+
prefetch: a = "none",
|
|
1895
|
+
relative: l,
|
|
1896
|
+
reloadDocument: i,
|
|
1897
|
+
replace: o,
|
|
1898
|
+
mask: u,
|
|
1899
|
+
state: c,
|
|
1900
|
+
target: m,
|
|
1901
|
+
to: s,
|
|
1902
|
+
preventScrollReset: f,
|
|
1903
|
+
viewTransition: g,
|
|
1904
|
+
defaultShouldRevalidate: y,
|
|
1905
|
+
...v
|
|
1906
|
+
}, b) {
|
|
1907
|
+
let { basename: p, navigator: S, useTransitions: x } = d.useContext(U), R = typeof s == "string" && Ne.test(s), F = gt(s, p);
|
|
1908
|
+
s = F.to;
|
|
1909
|
+
let O = Sr(s, { relative: l }), k = Y(), T = null;
|
|
1910
|
+
if (u) {
|
|
1911
|
+
let M = Fe(
|
|
1912
|
+
u,
|
|
1913
|
+
[],
|
|
1914
|
+
k.mask ? k.mask.pathname : "/",
|
|
1915
|
+
!0
|
|
1916
|
+
);
|
|
1917
|
+
p !== "/" && (M.pathname = M.pathname === "/" ? p : z([p, M.pathname])), T = S.createHref(M);
|
|
1918
|
+
}
|
|
1919
|
+
let [q, V, re] = ln(
|
|
1920
|
+
a,
|
|
1921
|
+
v
|
|
1922
|
+
), Se = gn(s, {
|
|
1923
|
+
replace: o,
|
|
1924
|
+
mask: u,
|
|
1925
|
+
state: c,
|
|
1926
|
+
target: m,
|
|
1927
|
+
preventScrollReset: f,
|
|
1928
|
+
relative: l,
|
|
1929
|
+
viewTransition: g,
|
|
1930
|
+
defaultShouldRevalidate: y,
|
|
1931
|
+
useTransitions: x
|
|
1932
|
+
});
|
|
1933
|
+
function ne(M) {
|
|
1934
|
+
t && t(M), M.defaultPrevented || Se(M);
|
|
1935
|
+
}
|
|
1936
|
+
let ae = !(F.isExternal || i), ce = (
|
|
1937
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1938
|
+
/* @__PURE__ */ d.createElement(
|
|
1939
|
+
"a",
|
|
1940
|
+
{
|
|
1941
|
+
...v,
|
|
1942
|
+
...re,
|
|
1943
|
+
href: (ae ? T : void 0) || F.absoluteURL || O,
|
|
1944
|
+
onClick: ae ? ne : t,
|
|
1945
|
+
ref: dn(b, V),
|
|
1946
|
+
target: m,
|
|
1947
|
+
"data-discover": !R && r === "render" ? "true" : void 0
|
|
1948
|
+
}
|
|
1949
|
+
)
|
|
1950
|
+
);
|
|
1951
|
+
return q && !R ? /* @__PURE__ */ d.createElement(d.Fragment, null, ce, /* @__PURE__ */ d.createElement(on, { page: O })) : ce;
|
|
1952
|
+
}
|
|
1953
|
+
);
|
|
1954
|
+
Ct.displayName = "Link";
|
|
1955
|
+
var fn = d.forwardRef(
|
|
1956
|
+
function({
|
|
1957
|
+
"aria-current": t = "page",
|
|
1958
|
+
caseSensitive: r = !1,
|
|
1959
|
+
className: a = "",
|
|
1960
|
+
end: l = !1,
|
|
1961
|
+
style: i,
|
|
1962
|
+
to: o,
|
|
1963
|
+
viewTransition: u,
|
|
1964
|
+
children: c,
|
|
1965
|
+
...m
|
|
1966
|
+
}, s) {
|
|
1967
|
+
let f = ue(o, { relative: m.relative }), g = Y(), y = d.useContext(we), { navigator: v, basename: b } = d.useContext(U), p = y != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1968
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1969
|
+
wn(f) && u === !0, S = v.encodeLocation ? v.encodeLocation(f).pathname : f.pathname, x = g.pathname, R = y && y.navigation && y.navigation.location ? y.navigation.location.pathname : null;
|
|
1970
|
+
r || (x = x.toLowerCase(), R = R ? R.toLowerCase() : null, S = S.toLowerCase()), R && b && (R = K(R, b) || R);
|
|
1971
|
+
const F = S !== "/" && S.endsWith("/") ? S.length - 1 : S.length;
|
|
1972
|
+
let O = x === S || !l && x.startsWith(S) && x.charAt(F) === "/", k = R != null && (R === S || !l && R.startsWith(S) && R.charAt(S.length) === "/"), T = {
|
|
1973
|
+
isActive: O,
|
|
1974
|
+
isPending: k,
|
|
1975
|
+
isTransitioning: p
|
|
1976
|
+
}, q = O ? t : void 0, V;
|
|
1977
|
+
typeof a == "function" ? V = a(T) : V = [
|
|
1978
|
+
a,
|
|
1979
|
+
O ? "active" : null,
|
|
1980
|
+
k ? "pending" : null,
|
|
1981
|
+
p ? "transitioning" : null
|
|
1982
|
+
].filter(Boolean).join(" ");
|
|
1983
|
+
let re = typeof i == "function" ? i(T) : i;
|
|
1984
|
+
return /* @__PURE__ */ d.createElement(
|
|
1985
|
+
Ct,
|
|
1986
|
+
{
|
|
1987
|
+
...m,
|
|
1988
|
+
"aria-current": q,
|
|
1989
|
+
className: V,
|
|
1990
|
+
ref: s,
|
|
1991
|
+
style: re,
|
|
1992
|
+
to: o,
|
|
1993
|
+
viewTransition: u
|
|
1994
|
+
},
|
|
1995
|
+
typeof c == "function" ? c(T) : c
|
|
1996
|
+
);
|
|
1997
|
+
}
|
|
1998
|
+
);
|
|
1999
|
+
fn.displayName = "NavLink";
|
|
2000
|
+
var mn = d.forwardRef(
|
|
2001
|
+
({
|
|
2002
|
+
discover: e = "render",
|
|
2003
|
+
fetcherKey: t,
|
|
2004
|
+
navigate: r,
|
|
2005
|
+
reloadDocument: a,
|
|
2006
|
+
replace: l,
|
|
2007
|
+
state: i,
|
|
2008
|
+
method: o = pe,
|
|
2009
|
+
action: u,
|
|
2010
|
+
onSubmit: c,
|
|
2011
|
+
relative: m,
|
|
2012
|
+
preventScrollReset: s,
|
|
2013
|
+
viewTransition: f,
|
|
2014
|
+
defaultShouldRevalidate: g,
|
|
2015
|
+
...y
|
|
2016
|
+
}, v) => {
|
|
2017
|
+
let { useTransitions: b } = d.useContext(U), p = vn(), S = bn(u, { relative: m }), x = o.toLowerCase() === "get" ? "get" : "post", R = typeof u == "string" && Ne.test(u), F = (O) => {
|
|
2018
|
+
if (c && c(O), O.defaultPrevented) return;
|
|
2019
|
+
O.preventDefault();
|
|
2020
|
+
let k = O.nativeEvent.submitter, T = (k == null ? void 0 : k.getAttribute("formmethod")) || o, q = () => p(k || O.currentTarget, {
|
|
2021
|
+
fetcherKey: t,
|
|
2022
|
+
method: T,
|
|
2023
|
+
navigate: r,
|
|
2024
|
+
replace: l,
|
|
2025
|
+
state: i,
|
|
2026
|
+
relative: m,
|
|
2027
|
+
preventScrollReset: s,
|
|
2028
|
+
viewTransition: f,
|
|
2029
|
+
defaultShouldRevalidate: g
|
|
2030
|
+
});
|
|
2031
|
+
b && r !== !1 ? d.startTransition(() => q()) : q();
|
|
2032
|
+
};
|
|
2033
|
+
return /* @__PURE__ */ d.createElement(
|
|
2034
|
+
"form",
|
|
2035
|
+
{
|
|
2036
|
+
ref: v,
|
|
2037
|
+
method: x,
|
|
2038
|
+
action: S,
|
|
2039
|
+
onSubmit: a ? c : F,
|
|
2040
|
+
...y,
|
|
2041
|
+
"data-discover": !R && e === "render" ? "true" : void 0
|
|
2042
|
+
}
|
|
2043
|
+
);
|
|
2044
|
+
}
|
|
2045
|
+
);
|
|
2046
|
+
mn.displayName = "Form";
|
|
2047
|
+
function pn(e) {
|
|
2048
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
2049
|
+
}
|
|
2050
|
+
function kt(e) {
|
|
2051
|
+
let t = d.useContext(te);
|
|
2052
|
+
return $(t, pn(e)), t;
|
|
2053
|
+
}
|
|
2054
|
+
function gn(e, {
|
|
2055
|
+
target: t,
|
|
2056
|
+
replace: r,
|
|
2057
|
+
mask: a,
|
|
2058
|
+
state: l,
|
|
2059
|
+
preventScrollReset: i,
|
|
2060
|
+
relative: o,
|
|
2061
|
+
viewTransition: u,
|
|
2062
|
+
defaultShouldRevalidate: c,
|
|
2063
|
+
useTransitions: m
|
|
2064
|
+
} = {}) {
|
|
2065
|
+
let s = Cr(), f = Y(), g = ue(e, { relative: o });
|
|
2066
|
+
return d.useCallback(
|
|
2067
|
+
(y) => {
|
|
2068
|
+
if (qr(y, t)) {
|
|
2069
|
+
y.preventDefault();
|
|
2070
|
+
let v = r !== void 0 ? r : Ae(f) === Ae(g), b = () => s(e, {
|
|
2071
|
+
replace: v,
|
|
2072
|
+
mask: a,
|
|
2073
|
+
state: l,
|
|
2074
|
+
preventScrollReset: i,
|
|
2075
|
+
relative: o,
|
|
2076
|
+
viewTransition: u,
|
|
2077
|
+
defaultShouldRevalidate: c
|
|
2078
|
+
});
|
|
2079
|
+
m ? d.startTransition(() => b()) : b();
|
|
2080
|
+
}
|
|
2081
|
+
},
|
|
2082
|
+
[
|
|
2083
|
+
f,
|
|
2084
|
+
s,
|
|
2085
|
+
g,
|
|
2086
|
+
r,
|
|
2087
|
+
a,
|
|
2088
|
+
l,
|
|
2089
|
+
t,
|
|
2090
|
+
e,
|
|
2091
|
+
i,
|
|
2092
|
+
o,
|
|
2093
|
+
u,
|
|
2094
|
+
c,
|
|
2095
|
+
m
|
|
2096
|
+
]
|
|
2097
|
+
);
|
|
2098
|
+
}
|
|
2099
|
+
var xn = 0, yn = () => `__${String(++xn)}__`;
|
|
2100
|
+
function vn() {
|
|
2101
|
+
let { router: e } = kt(
|
|
2102
|
+
"useSubmit"
|
|
2103
|
+
/* UseSubmit */
|
|
2104
|
+
), { basename: t } = d.useContext(U), r = Br(), a = e.fetch, l = e.navigate;
|
|
2105
|
+
return d.useCallback(
|
|
2106
|
+
async (i, o = {}) => {
|
|
2107
|
+
let { action: u, method: c, encType: m, formData: s, body: f } = Kr(
|
|
2108
|
+
i,
|
|
2109
|
+
t
|
|
2110
|
+
);
|
|
2111
|
+
if (o.navigate === !1) {
|
|
2112
|
+
let g = o.fetcherKey || yn();
|
|
2113
|
+
await a(g, r, o.action || u, {
|
|
2114
|
+
defaultShouldRevalidate: o.defaultShouldRevalidate,
|
|
2115
|
+
preventScrollReset: o.preventScrollReset,
|
|
2116
|
+
formData: s,
|
|
2117
|
+
body: f,
|
|
2118
|
+
formMethod: o.method || c,
|
|
2119
|
+
formEncType: o.encType || m,
|
|
2120
|
+
flushSync: o.flushSync
|
|
2121
|
+
});
|
|
2122
|
+
} else
|
|
2123
|
+
await l(o.action || u, {
|
|
2124
|
+
defaultShouldRevalidate: o.defaultShouldRevalidate,
|
|
2125
|
+
preventScrollReset: o.preventScrollReset,
|
|
2126
|
+
formData: s,
|
|
2127
|
+
body: f,
|
|
2128
|
+
formMethod: o.method || c,
|
|
2129
|
+
formEncType: o.encType || m,
|
|
2130
|
+
replace: o.replace,
|
|
2131
|
+
state: o.state,
|
|
2132
|
+
fromRouteId: r,
|
|
2133
|
+
flushSync: o.flushSync,
|
|
2134
|
+
viewTransition: o.viewTransition
|
|
2135
|
+
});
|
|
2136
|
+
},
|
|
2137
|
+
[a, l, t, r]
|
|
2138
|
+
);
|
|
2139
|
+
}
|
|
2140
|
+
function bn(e, { relative: t } = {}) {
|
|
2141
|
+
let { basename: r } = d.useContext(U), a = d.useContext(W);
|
|
2142
|
+
$(a, "useFormAction must be used inside a RouteContext");
|
|
2143
|
+
let [l] = a.matches.slice(-1), i = { ...ue(e || ".", { relative: t }) }, o = Y();
|
|
2144
|
+
if (e == null) {
|
|
2145
|
+
i.search = o.search;
|
|
2146
|
+
let u = new URLSearchParams(i.search), c = u.getAll("index");
|
|
2147
|
+
if (c.some((s) => s === "")) {
|
|
2148
|
+
u.delete("index"), c.filter((f) => f).forEach((f) => u.append("index", f));
|
|
2149
|
+
let s = u.toString();
|
|
2150
|
+
i.search = s ? `?${s}` : "";
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
return (!e || e === ".") && l.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (i.pathname = i.pathname === "/" ? r : z([r, i.pathname])), Ae(i);
|
|
2154
|
+
}
|
|
2155
|
+
function wn(e, { relative: t } = {}) {
|
|
2156
|
+
let r = d.useContext(vt);
|
|
2157
|
+
$(
|
|
2158
|
+
r != null,
|
|
2159
|
+
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
2160
|
+
);
|
|
2161
|
+
let { basename: a } = kt(
|
|
2162
|
+
"useViewTransitionState"
|
|
2163
|
+
/* useViewTransitionState */
|
|
2164
|
+
), l = ue(e, { relative: t });
|
|
2165
|
+
if (!r.isTransitioning)
|
|
2166
|
+
return !1;
|
|
2167
|
+
let i = K(r.currentLocation.pathname, a) || r.currentLocation.pathname, o = K(r.nextLocation.pathname, a) || r.nextLocation.pathname;
|
|
2168
|
+
return ye(l.pathname, o) != null || ye(l.pathname, i) != null;
|
|
2169
|
+
}
|
|
2170
|
+
const On = () => /* @__PURE__ */ n.jsx(We, {}), Dn = () => /* @__PURE__ */ n.jsx(We, {}), Nn = () => /* @__PURE__ */ n.jsx(We, {}), $n = () => {
|
|
2171
|
+
const [e, t] = I([]), [r, a] = I(!1), l = async () => {
|
|
2172
|
+
a(!0);
|
|
636
2173
|
try {
|
|
637
|
-
|
|
2174
|
+
t(await Ht.list() || []);
|
|
638
2175
|
} catch {
|
|
639
|
-
|
|
2176
|
+
B.error("加载 Bucket 列表失败");
|
|
640
2177
|
} finally {
|
|
641
|
-
|
|
2178
|
+
a(!1);
|
|
642
2179
|
}
|
|
643
2180
|
};
|
|
644
|
-
|
|
645
|
-
|
|
2181
|
+
X(() => {
|
|
2182
|
+
l();
|
|
646
2183
|
}, []);
|
|
647
|
-
const
|
|
2184
|
+
const i = [
|
|
648
2185
|
{ title: "Bucket 名称", dataIndex: "name", copyable: !0 },
|
|
649
2186
|
{ title: "创建时间", dataIndex: "createdAt", width: 180 },
|
|
650
|
-
{ title: "存储类型", dataIndex: "storageClass", width: 100, render: (
|
|
2187
|
+
{ title: "存储类型", dataIndex: "storageClass", width: 100, render: (o) => o || "标准" },
|
|
651
2188
|
{ title: "区域", dataIndex: "region", width: 100 },
|
|
652
|
-
{ title: "对象数", dataIndex: "objectCount", width: 100, render: (
|
|
653
|
-
{ title: "用量", dataIndex: "sizeGb", width: 100, render: (
|
|
2189
|
+
{ title: "对象数", dataIndex: "objectCount", width: 100, render: (o) => o ?? "-" },
|
|
2190
|
+
{ title: "用量", dataIndex: "sizeGb", width: 100, render: (o) => o != null ? `${o} GB` : "-" }
|
|
654
2191
|
];
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
2193
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
2194
|
+
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
2195
|
+
/* @__PURE__ */ n.jsxs("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: [
|
|
2196
|
+
/* @__PURE__ */ n.jsx(_t, { style: { marginRight: 8 } }),
|
|
660
2197
|
"对象存储"
|
|
661
2198
|
] }),
|
|
662
|
-
/* @__PURE__ */
|
|
2199
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "OSS Bucket 与文件目录" })
|
|
663
2200
|
] }),
|
|
664
|
-
/* @__PURE__ */
|
|
2201
|
+
/* @__PURE__ */ n.jsx(N, { icon: /* @__PURE__ */ n.jsx(it, {}), onClick: l, children: "刷新" })
|
|
665
2202
|
] }),
|
|
666
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ n.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__ */ n.jsx(ee, { columns: i, dataSource: e, loading: r, rowKey: "name", pagination: { pageSize: 10 }, locale: { emptyText: "暂无 Bucket" } }) })
|
|
667
2204
|
] });
|
|
668
|
-
},
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
2205
|
+
}, Fn = () => /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
2206
|
+
/* @__PURE__ */ n.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
2207
|
+
/* @__PURE__ */ n.jsx(Ot, { style: { marginRight: 8 } }),
|
|
671
2208
|
"域名管理"
|
|
672
2209
|
] }),
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
] }),
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "管理已绑定的域名与 SSL 证书" }),
|
|
2211
|
+
/* @__PURE__ */ n.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__ */ n.jsx(be, { description: "后端 API 开发中,敬请期待" }) })
|
|
2212
|
+
] }), Bn = () => /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
2213
|
+
/* @__PURE__ */ n.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
2214
|
+
/* @__PURE__ */ n.jsx(Dt, { style: { marginRight: 8 } }),
|
|
678
2215
|
"ECS 管理"
|
|
679
2216
|
] }),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
] }),
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "查看与管理云服务器实例" }),
|
|
2218
|
+
/* @__PURE__ */ n.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__ */ n.jsx(be, { description: "后端 API 开发中,敬请期待" }) })
|
|
2219
|
+
] }), Mn = () => /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
2220
|
+
/* @__PURE__ */ n.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
2221
|
+
/* @__PURE__ */ n.jsx(Nt, { style: { marginRight: 8 } }),
|
|
685
2222
|
"RDS 管理"
|
|
686
2223
|
] }),
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
] }),
|
|
690
|
-
const [
|
|
691
|
-
|
|
2224
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "查看云数据库实例与慢查询监控" }),
|
|
2225
|
+
/* @__PURE__ */ n.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__ */ n.jsx(be, { description: "后端 API 开发中,敬请期待" }) })
|
|
2226
|
+
] }), zn = () => {
|
|
2227
|
+
const [e, t] = I([]), [r, a] = I(!1), l = async () => {
|
|
2228
|
+
a(!0);
|
|
692
2229
|
try {
|
|
693
|
-
|
|
2230
|
+
t(await Vt.list() || []);
|
|
694
2231
|
} catch {
|
|
695
|
-
|
|
2232
|
+
B.error("加载构建记录失败");
|
|
696
2233
|
} finally {
|
|
697
|
-
|
|
2234
|
+
a(!1);
|
|
698
2235
|
}
|
|
699
2236
|
};
|
|
700
|
-
|
|
701
|
-
|
|
2237
|
+
X(() => {
|
|
2238
|
+
l();
|
|
702
2239
|
}, []);
|
|
703
|
-
const
|
|
2240
|
+
const i = { SUCCESS: { text: "成功", color: "green" }, FAILED: { text: "失败", color: "red" }, BUILDING: { text: "构建中", color: "processing" } }, o = [
|
|
704
2241
|
{ title: "ID", dataIndex: "id", width: 60 },
|
|
705
2242
|
{ title: "镜像名", dataIndex: "imageName", width: 160 },
|
|
706
2243
|
{ title: "应用名", dataIndex: "appName", width: 120 },
|
|
707
2244
|
{ title: "分支", dataIndex: "branch", width: 120 },
|
|
708
2245
|
{ title: "环境", dataIndex: "env", width: 80 },
|
|
709
|
-
{ title: "状态", dataIndex: "status", width: 90, render: (
|
|
710
|
-
const
|
|
711
|
-
return /* @__PURE__ */
|
|
2246
|
+
{ title: "状态", dataIndex: "status", width: 90, render: (u) => {
|
|
2247
|
+
const c = i[u] || { text: u, color: "default" };
|
|
2248
|
+
return /* @__PURE__ */ n.jsx(J, { color: c.color, children: c.text });
|
|
712
2249
|
} },
|
|
713
2250
|
{ title: "镜像版本", dataIndex: "imageTag", width: 140, ellipsis: !0 },
|
|
714
2251
|
{ title: "构建时间", dataIndex: "createdAt", width: 170 }
|
|
715
2252
|
];
|
|
716
|
-
return /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
2254
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 24 }, children: [
|
|
2255
|
+
/* @__PURE__ */ n.jsxs("div", { children: [
|
|
2256
|
+
/* @__PURE__ */ n.jsxs("h2", { style: { margin: 0, fontSize: 20, fontWeight: 600 }, children: [
|
|
2257
|
+
/* @__PURE__ */ n.jsx($t, { style: { marginRight: 8 } }),
|
|
721
2258
|
"镜像构建"
|
|
722
2259
|
] }),
|
|
723
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ n.jsx("span", { style: { color: "#8a8f98", fontSize: 14 }, children: "镜像构建记录" })
|
|
724
2261
|
] }),
|
|
725
|
-
/* @__PURE__ */
|
|
2262
|
+
/* @__PURE__ */ n.jsx(N, { icon: /* @__PURE__ */ n.jsx(it, {}), onClick: l, children: "刷新" })
|
|
726
2263
|
] }),
|
|
727
|
-
/* @__PURE__ */
|
|
2264
|
+
/* @__PURE__ */ n.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__ */ n.jsx(ee, { columns: o, dataSource: e, loading: r, rowKey: "id", pagination: { pageSize: 10 }, locale: { emptyText: "暂无构建记录" } }) })
|
|
728
2265
|
] });
|
|
729
|
-
},
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
2266
|
+
}, Un = () => /* @__PURE__ */ n.jsxs("div", { style: { padding: 24 }, children: [
|
|
2267
|
+
/* @__PURE__ */ n.jsxs("h2", { style: { margin: "0 0 8px", fontSize: 20, fontWeight: 600 }, children: [
|
|
2268
|
+
/* @__PURE__ */ n.jsx(Ft, { style: { marginRight: 8 } }),
|
|
732
2269
|
"迭代管理"
|
|
733
2270
|
] }),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ n.jsx("p", { style: { color: "#8a8f98", marginBottom: 24 }, children: "管理研发迭代与里程碑" }),
|
|
2272
|
+
/* @__PURE__ */ n.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__ */ n.jsx(be, { description: "后端 API 开发中,敬请期待" }) })
|
|
736
2273
|
] });
|
|
737
2274
|
export {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
2275
|
+
Tn as ChannelPage,
|
|
2276
|
+
An as DeliveryPage,
|
|
2277
|
+
Ln as DeploymentPage,
|
|
2278
|
+
Fn as DomainPage,
|
|
2279
|
+
Bn as EcsPage,
|
|
2280
|
+
On as OpsApp,
|
|
2281
|
+
Dn as RdApp,
|
|
2282
|
+
zn as RdOpsPage,
|
|
2283
|
+
Mn as RdsPage,
|
|
2284
|
+
Nn as ResourceApp,
|
|
2285
|
+
$n as ResourceOssPage,
|
|
2286
|
+
Un as SprintPage,
|
|
2287
|
+
_n as TaskPage,
|
|
2288
|
+
Cn as configureApiBaseURL,
|
|
2289
|
+
Q as deploymentUnitApi,
|
|
2290
|
+
fe as environmentApi,
|
|
2291
|
+
In as imageApi,
|
|
2292
|
+
Vt as imageBuildApi,
|
|
2293
|
+
Pn as imageTagApi,
|
|
2294
|
+
Ht as ossBucketApi,
|
|
2295
|
+
Wt as recordApi,
|
|
2296
|
+
se as targetApi,
|
|
2297
|
+
kn as webhookApi
|
|
758
2298
|
};
|