@dovetail-v2/refine 0.0.19 → 0.0.21-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MonacoYamlDiffEditor-b1abdc2e.js → MonacoYamlDiffEditor-fd7edf86.js} +2 -2
- package/dist/{index-77b64cff.js → index-5f7b3e36.js} +2193 -2112
- package/dist/refine.js +101 -99
- package/dist/refine.umd.cjs +2091 -2010
- package/lib/src/components/index.d.ts +1 -0
- package/lib/src/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/refine.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global2, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@refinedev/core"), require("qs"), require("react"), require("react-router-dom"), require("@cloudtower/eagle"), require("js-yaml"), require("lodash-es"), require("sunflower-antd"), require("
|
|
3
|
-
})(this, function(exports2, core, qs, React, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("i18next"), require("@refinedev/core"), require("qs"), require("react"), require("react-router-dom"), require("@cloudtower/eagle"), require("js-yaml"), require("lodash-es"), require("sunflower-antd"), require("@cloudtower/icons-react"), require("monaco-editor"), require("monaco-yaml"), require("react-dom"), require("antd"), require("k8s-api-provider")) : typeof define === "function" && define.amd ? define(["exports", "i18next", "@refinedev/core", "qs", "react", "react-router-dom", "@cloudtower/eagle", "js-yaml", "lodash-es", "sunflower-antd", "@cloudtower/icons-react", "monaco-editor", "monaco-yaml", "react-dom", "antd", "k8s-api-provider"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.dovetail = {}, global2.i18n, global2.core, global2.qs, global2.React, global2.reactRouterDom, global2.eagle, global2.yaml, global2.lodashEs, global2.sunflowerAntd, global2.iconsReact, global2.monaco, global2.monacoYaml, global2.ReactDOM, global2.antd, global2.k8sApiProvider));
|
|
3
|
+
})(this, function(exports2, i18n, core, qs, React, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd, iconsReact, monaco, monacoYaml, ReactDOM, antd, k8sApiProvider) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -30,784 +30,26 @@ var __publicField = (obj, key, value) => {
|
|
|
30
30
|
function getDefaultExportFromCjs(x) {
|
|
31
31
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
44
|
-
function requireReactJsxRuntime_production_min() {
|
|
45
|
-
if (hasRequiredReactJsxRuntime_production_min)
|
|
46
|
-
return reactJsxRuntime_production_min;
|
|
47
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
48
|
-
var f = React, g = 60103;
|
|
49
|
-
reactJsxRuntime_production_min.Fragment = 60107;
|
|
50
|
-
if ("function" === typeof Symbol && Symbol.for) {
|
|
51
|
-
var h = Symbol.for;
|
|
52
|
-
g = h("react.element");
|
|
53
|
-
reactJsxRuntime_production_min.Fragment = h("react.fragment");
|
|
33
|
+
function warn() {
|
|
34
|
+
if (console && console.warn) {
|
|
35
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
+
args[_key] = arguments[_key];
|
|
37
|
+
}
|
|
38
|
+
if (typeof args[0] === "string")
|
|
39
|
+
args[0] = `react-i18next:: ${args[0]}`;
|
|
40
|
+
console.warn(...args);
|
|
54
41
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
void 0 !== a.ref && (l = a.ref);
|
|
61
|
-
for (b in a)
|
|
62
|
-
n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
63
|
-
if (c && c.defaultProps)
|
|
64
|
-
for (b in a = c.defaultProps, a)
|
|
65
|
-
void 0 === d[b] && (d[b] = a[b]);
|
|
66
|
-
return { $$typeof: g, type: c, key: e, ref: l, props: d, _owner: m.current };
|
|
42
|
+
}
|
|
43
|
+
const alreadyWarned = {};
|
|
44
|
+
function warnOnce() {
|
|
45
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
46
|
+
args[_key2] = arguments[_key2];
|
|
67
47
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/** @license React v16.14.0
|
|
74
|
-
* react-jsx-runtime.development.js
|
|
75
|
-
*
|
|
76
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the MIT license found in the
|
|
79
|
-
* LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/
|
|
81
|
-
var hasRequiredReactJsxRuntime_development;
|
|
82
|
-
function requireReactJsxRuntime_development() {
|
|
83
|
-
if (hasRequiredReactJsxRuntime_development)
|
|
84
|
-
return reactJsxRuntime_development;
|
|
85
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
86
|
-
(function(exports3) {
|
|
87
|
-
if (process.env.NODE_ENV !== "production") {
|
|
88
|
-
(function() {
|
|
89
|
-
var React$1 = React;
|
|
90
|
-
var REACT_ELEMENT_TYPE = 60103;
|
|
91
|
-
var REACT_PORTAL_TYPE = 60106;
|
|
92
|
-
exports3.Fragment = 60107;
|
|
93
|
-
var REACT_STRICT_MODE_TYPE = 60108;
|
|
94
|
-
var REACT_PROFILER_TYPE = 60114;
|
|
95
|
-
var REACT_PROVIDER_TYPE = 60109;
|
|
96
|
-
var REACT_CONTEXT_TYPE = 60110;
|
|
97
|
-
var REACT_FORWARD_REF_TYPE = 60112;
|
|
98
|
-
var REACT_SUSPENSE_TYPE = 60113;
|
|
99
|
-
var REACT_SUSPENSE_LIST_TYPE = 60120;
|
|
100
|
-
var REACT_MEMO_TYPE = 60115;
|
|
101
|
-
var REACT_LAZY_TYPE = 60116;
|
|
102
|
-
var REACT_BLOCK_TYPE = 60121;
|
|
103
|
-
var REACT_SERVER_BLOCK_TYPE = 60122;
|
|
104
|
-
var REACT_FUNDAMENTAL_TYPE = 60117;
|
|
105
|
-
var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
|
|
106
|
-
var REACT_LEGACY_HIDDEN_TYPE = 60131;
|
|
107
|
-
if (typeof Symbol === "function" && Symbol.for) {
|
|
108
|
-
var symbolFor = Symbol.for;
|
|
109
|
-
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
110
|
-
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
111
|
-
exports3.Fragment = symbolFor("react.fragment");
|
|
112
|
-
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
|
|
113
|
-
REACT_PROFILER_TYPE = symbolFor("react.profiler");
|
|
114
|
-
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
115
|
-
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
116
|
-
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
117
|
-
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
|
|
118
|
-
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
119
|
-
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
120
|
-
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
121
|
-
REACT_BLOCK_TYPE = symbolFor("react.block");
|
|
122
|
-
REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
|
|
123
|
-
REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
|
|
124
|
-
symbolFor("react.scope");
|
|
125
|
-
symbolFor("react.opaque.id");
|
|
126
|
-
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
127
|
-
symbolFor("react.offscreen");
|
|
128
|
-
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
129
|
-
}
|
|
130
|
-
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
131
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
132
|
-
function getIteratorFn(maybeIterable) {
|
|
133
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
137
|
-
if (typeof maybeIterator === "function") {
|
|
138
|
-
return maybeIterator;
|
|
139
|
-
}
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
143
|
-
function error(format) {
|
|
144
|
-
{
|
|
145
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
146
|
-
args[_key2 - 1] = arguments[_key2];
|
|
147
|
-
}
|
|
148
|
-
printWarning("error", format, args);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function printWarning(level, format, args) {
|
|
152
|
-
{
|
|
153
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
154
|
-
var stack = "";
|
|
155
|
-
if (currentlyValidatingElement) {
|
|
156
|
-
var name2 = getComponentName(currentlyValidatingElement.type);
|
|
157
|
-
var owner = currentlyValidatingElement._owner;
|
|
158
|
-
stack += describeComponentFrame(name2, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
159
|
-
}
|
|
160
|
-
stack += ReactDebugCurrentFrame.getStackAddendum();
|
|
161
|
-
if (stack !== "") {
|
|
162
|
-
format += "%s";
|
|
163
|
-
args = args.concat([stack]);
|
|
164
|
-
}
|
|
165
|
-
var argsWithFormat = args.map(function(item) {
|
|
166
|
-
return "" + item;
|
|
167
|
-
});
|
|
168
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
169
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
var enableScopeAPI = false;
|
|
173
|
-
function isValidElementType(type2) {
|
|
174
|
-
if (typeof type2 === "string" || typeof type2 === "function") {
|
|
175
|
-
return true;
|
|
176
|
-
}
|
|
177
|
-
if (type2 === exports3.Fragment || type2 === REACT_PROFILER_TYPE || type2 === REACT_DEBUG_TRACING_MODE_TYPE || type2 === REACT_STRICT_MODE_TYPE || type2 === REACT_SUSPENSE_TYPE || type2 === REACT_SUSPENSE_LIST_TYPE || type2 === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
if (typeof type2 === "object" && type2 !== null) {
|
|
181
|
-
if (type2.$$typeof === REACT_LAZY_TYPE || type2.$$typeof === REACT_MEMO_TYPE || type2.$$typeof === REACT_PROVIDER_TYPE || type2.$$typeof === REACT_CONTEXT_TYPE || type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_FUNDAMENTAL_TYPE || type2.$$typeof === REACT_BLOCK_TYPE || type2[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
188
|
-
function describeComponentFrame(name2, source, ownerName) {
|
|
189
|
-
var sourceInfo = "";
|
|
190
|
-
if (source) {
|
|
191
|
-
var path = source.fileName;
|
|
192
|
-
var fileName = path.replace(BEFORE_SLASH_RE, "");
|
|
193
|
-
{
|
|
194
|
-
if (/^index\./.test(fileName)) {
|
|
195
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
196
|
-
if (match) {
|
|
197
|
-
var pathBeforeSlash = match[1];
|
|
198
|
-
if (pathBeforeSlash) {
|
|
199
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, "");
|
|
200
|
-
fileName = folderName + "/" + fileName;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")";
|
|
206
|
-
} else if (ownerName) {
|
|
207
|
-
sourceInfo = " (created by " + ownerName + ")";
|
|
208
|
-
}
|
|
209
|
-
return "\n in " + (name2 || "Unknown") + sourceInfo;
|
|
210
|
-
}
|
|
211
|
-
var Resolved = 1;
|
|
212
|
-
function refineResolvedLazyComponent(lazyComponent) {
|
|
213
|
-
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
214
|
-
}
|
|
215
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
216
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
217
|
-
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
218
|
-
}
|
|
219
|
-
function getComponentName(type2) {
|
|
220
|
-
if (type2 == null) {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
{
|
|
224
|
-
if (typeof type2.tag === "number") {
|
|
225
|
-
error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
if (typeof type2 === "function") {
|
|
229
|
-
return type2.displayName || type2.name || null;
|
|
230
|
-
}
|
|
231
|
-
if (typeof type2 === "string") {
|
|
232
|
-
return type2;
|
|
233
|
-
}
|
|
234
|
-
switch (type2) {
|
|
235
|
-
case exports3.Fragment:
|
|
236
|
-
return "Fragment";
|
|
237
|
-
case REACT_PORTAL_TYPE:
|
|
238
|
-
return "Portal";
|
|
239
|
-
case REACT_PROFILER_TYPE:
|
|
240
|
-
return "Profiler";
|
|
241
|
-
case REACT_STRICT_MODE_TYPE:
|
|
242
|
-
return "StrictMode";
|
|
243
|
-
case REACT_SUSPENSE_TYPE:
|
|
244
|
-
return "Suspense";
|
|
245
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
246
|
-
return "SuspenseList";
|
|
247
|
-
}
|
|
248
|
-
if (typeof type2 === "object") {
|
|
249
|
-
switch (type2.$$typeof) {
|
|
250
|
-
case REACT_CONTEXT_TYPE:
|
|
251
|
-
return "Context.Consumer";
|
|
252
|
-
case REACT_PROVIDER_TYPE:
|
|
253
|
-
return "Context.Provider";
|
|
254
|
-
case REACT_FORWARD_REF_TYPE:
|
|
255
|
-
return getWrappedName(type2, type2.render, "ForwardRef");
|
|
256
|
-
case REACT_MEMO_TYPE:
|
|
257
|
-
return getComponentName(type2.type);
|
|
258
|
-
case REACT_BLOCK_TYPE:
|
|
259
|
-
return getComponentName(type2.render);
|
|
260
|
-
case REACT_LAZY_TYPE: {
|
|
261
|
-
var thenable = type2;
|
|
262
|
-
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
263
|
-
if (resolvedThenable) {
|
|
264
|
-
return getComponentName(resolvedThenable);
|
|
265
|
-
}
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return null;
|
|
271
|
-
}
|
|
272
|
-
var loggedTypeFailures = {};
|
|
273
|
-
ReactSharedInternals.ReactDebugCurrentFrame;
|
|
274
|
-
var currentlyValidatingElement = null;
|
|
275
|
-
function setCurrentlyValidatingElement(element) {
|
|
276
|
-
{
|
|
277
|
-
currentlyValidatingElement = element;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
281
|
-
{
|
|
282
|
-
var has2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
283
|
-
for (var typeSpecName in typeSpecs) {
|
|
284
|
-
if (has2(typeSpecs, typeSpecName)) {
|
|
285
|
-
var error$1 = void 0;
|
|
286
|
-
try {
|
|
287
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
288
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
289
|
-
err.name = "Invariant Violation";
|
|
290
|
-
throw err;
|
|
291
|
-
}
|
|
292
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
293
|
-
} catch (ex) {
|
|
294
|
-
error$1 = ex;
|
|
295
|
-
}
|
|
296
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
297
|
-
setCurrentlyValidatingElement(element);
|
|
298
|
-
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
299
|
-
setCurrentlyValidatingElement(null);
|
|
300
|
-
}
|
|
301
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
302
|
-
loggedTypeFailures[error$1.message] = true;
|
|
303
|
-
setCurrentlyValidatingElement(element);
|
|
304
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
305
|
-
setCurrentlyValidatingElement(null);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
312
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
313
|
-
var RESERVED_PROPS = {
|
|
314
|
-
key: true,
|
|
315
|
-
ref: true,
|
|
316
|
-
__self: true,
|
|
317
|
-
__source: true
|
|
318
|
-
};
|
|
319
|
-
var specialPropKeyWarningShown;
|
|
320
|
-
var specialPropRefWarningShown;
|
|
321
|
-
var didWarnAboutStringRefs;
|
|
322
|
-
{
|
|
323
|
-
didWarnAboutStringRefs = {};
|
|
324
|
-
}
|
|
325
|
-
function hasValidRef(config) {
|
|
326
|
-
{
|
|
327
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
328
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
329
|
-
if (getter && getter.isReactWarning) {
|
|
330
|
-
return false;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
return config.ref !== void 0;
|
|
335
|
-
}
|
|
336
|
-
function hasValidKey(config) {
|
|
337
|
-
{
|
|
338
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
339
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
340
|
-
if (getter && getter.isReactWarning) {
|
|
341
|
-
return false;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
return config.key !== void 0;
|
|
346
|
-
}
|
|
347
|
-
function warnIfStringRefCannotBeAutoConverted(config, self2) {
|
|
348
|
-
{
|
|
349
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
|
|
350
|
-
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
351
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
352
|
-
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
353
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
359
|
-
{
|
|
360
|
-
var warnAboutAccessingKey = function() {
|
|
361
|
-
if (!specialPropKeyWarningShown) {
|
|
362
|
-
specialPropKeyWarningShown = true;
|
|
363
|
-
error("%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://reactjs.org/link/special-props)", displayName);
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
367
|
-
Object.defineProperty(props, "key", {
|
|
368
|
-
get: warnAboutAccessingKey,
|
|
369
|
-
configurable: true
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
374
|
-
{
|
|
375
|
-
var warnAboutAccessingRef = function() {
|
|
376
|
-
if (!specialPropRefWarningShown) {
|
|
377
|
-
specialPropRefWarningShown = true;
|
|
378
|
-
error("%s: `ref` 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://reactjs.org/link/special-props)", displayName);
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
382
|
-
Object.defineProperty(props, "ref", {
|
|
383
|
-
get: warnAboutAccessingRef,
|
|
384
|
-
configurable: true
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
var ReactElement = function(type2, key, ref, self2, source, owner, props) {
|
|
389
|
-
var element = {
|
|
390
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
391
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
392
|
-
// Built-in properties that belong on the element
|
|
393
|
-
type: type2,
|
|
394
|
-
key,
|
|
395
|
-
ref,
|
|
396
|
-
props,
|
|
397
|
-
// Record the component responsible for creating this element.
|
|
398
|
-
_owner: owner
|
|
399
|
-
};
|
|
400
|
-
{
|
|
401
|
-
element._store = {};
|
|
402
|
-
Object.defineProperty(element._store, "validated", {
|
|
403
|
-
configurable: false,
|
|
404
|
-
enumerable: false,
|
|
405
|
-
writable: true,
|
|
406
|
-
value: false
|
|
407
|
-
});
|
|
408
|
-
Object.defineProperty(element, "_self", {
|
|
409
|
-
configurable: false,
|
|
410
|
-
enumerable: false,
|
|
411
|
-
writable: false,
|
|
412
|
-
value: self2
|
|
413
|
-
});
|
|
414
|
-
Object.defineProperty(element, "_source", {
|
|
415
|
-
configurable: false,
|
|
416
|
-
enumerable: false,
|
|
417
|
-
writable: false,
|
|
418
|
-
value: source
|
|
419
|
-
});
|
|
420
|
-
if (Object.freeze) {
|
|
421
|
-
Object.freeze(element.props);
|
|
422
|
-
Object.freeze(element);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
return element;
|
|
426
|
-
};
|
|
427
|
-
function jsxDEV(type2, config, maybeKey, source, self2) {
|
|
428
|
-
{
|
|
429
|
-
var propName;
|
|
430
|
-
var props = {};
|
|
431
|
-
var key = null;
|
|
432
|
-
var ref = null;
|
|
433
|
-
if (maybeKey !== void 0) {
|
|
434
|
-
key = "" + maybeKey;
|
|
435
|
-
}
|
|
436
|
-
if (hasValidKey(config)) {
|
|
437
|
-
key = "" + config.key;
|
|
438
|
-
}
|
|
439
|
-
if (hasValidRef(config)) {
|
|
440
|
-
ref = config.ref;
|
|
441
|
-
warnIfStringRefCannotBeAutoConverted(config, self2);
|
|
442
|
-
}
|
|
443
|
-
for (propName in config) {
|
|
444
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
445
|
-
props[propName] = config[propName];
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
if (type2 && type2.defaultProps) {
|
|
449
|
-
var defaultProps = type2.defaultProps;
|
|
450
|
-
for (propName in defaultProps) {
|
|
451
|
-
if (props[propName] === void 0) {
|
|
452
|
-
props[propName] = defaultProps[propName];
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if (key || ref) {
|
|
457
|
-
var displayName = typeof type2 === "function" ? type2.displayName || type2.name || "Unknown" : type2;
|
|
458
|
-
if (key) {
|
|
459
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
460
|
-
}
|
|
461
|
-
if (ref) {
|
|
462
|
-
defineRefPropWarningGetter(props, displayName);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
return ReactElement(type2, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
469
|
-
ReactSharedInternals.ReactDebugCurrentFrame;
|
|
470
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
471
|
-
currentlyValidatingElement = element;
|
|
472
|
-
}
|
|
473
|
-
var propTypesMisspellWarningShown;
|
|
474
|
-
{
|
|
475
|
-
propTypesMisspellWarningShown = false;
|
|
476
|
-
}
|
|
477
|
-
function isValidElement(object2) {
|
|
478
|
-
{
|
|
479
|
-
return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
function getDeclarationErrorAddendum() {
|
|
483
|
-
{
|
|
484
|
-
if (ReactCurrentOwner$1.current) {
|
|
485
|
-
var name2 = getComponentName(ReactCurrentOwner$1.current.type);
|
|
486
|
-
if (name2) {
|
|
487
|
-
return "\n\nCheck the render method of `" + name2 + "`.";
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
return "";
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
function getSourceInfoErrorAddendum(source) {
|
|
494
|
-
{
|
|
495
|
-
if (source !== void 0) {
|
|
496
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
497
|
-
var lineNumber = source.lineNumber;
|
|
498
|
-
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
499
|
-
}
|
|
500
|
-
return "";
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
var ownerHasKeyUseWarning = {};
|
|
504
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
505
|
-
{
|
|
506
|
-
var info = getDeclarationErrorAddendum();
|
|
507
|
-
if (!info) {
|
|
508
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
509
|
-
if (parentName) {
|
|
510
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
return info;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function validateExplicitKey(element, parentType) {
|
|
517
|
-
{
|
|
518
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
element._store.validated = true;
|
|
522
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
523
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
527
|
-
var childOwner = "";
|
|
528
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
529
|
-
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
530
|
-
}
|
|
531
|
-
setCurrentlyValidatingElement$1(element);
|
|
532
|
-
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
533
|
-
setCurrentlyValidatingElement$1(null);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
function validateChildKeys(node, parentType) {
|
|
537
|
-
{
|
|
538
|
-
if (typeof node !== "object") {
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
if (Array.isArray(node)) {
|
|
542
|
-
for (var i = 0; i < node.length; i++) {
|
|
543
|
-
var child = node[i];
|
|
544
|
-
if (isValidElement(child)) {
|
|
545
|
-
validateExplicitKey(child, parentType);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
} else if (isValidElement(node)) {
|
|
549
|
-
if (node._store) {
|
|
550
|
-
node._store.validated = true;
|
|
551
|
-
}
|
|
552
|
-
} else if (node) {
|
|
553
|
-
var iteratorFn = getIteratorFn(node);
|
|
554
|
-
if (typeof iteratorFn === "function") {
|
|
555
|
-
if (iteratorFn !== node.entries) {
|
|
556
|
-
var iterator = iteratorFn.call(node);
|
|
557
|
-
var step;
|
|
558
|
-
while (!(step = iterator.next()).done) {
|
|
559
|
-
if (isValidElement(step.value)) {
|
|
560
|
-
validateExplicitKey(step.value, parentType);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
function validatePropTypes(element) {
|
|
569
|
-
{
|
|
570
|
-
var type2 = element.type;
|
|
571
|
-
if (type2 === null || type2 === void 0 || typeof type2 === "string") {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
var propTypes;
|
|
575
|
-
if (typeof type2 === "function") {
|
|
576
|
-
propTypes = type2.propTypes;
|
|
577
|
-
} else if (typeof type2 === "object" && (type2.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
578
|
-
// Inner props are checked in the reconciler.
|
|
579
|
-
type2.$$typeof === REACT_MEMO_TYPE)) {
|
|
580
|
-
propTypes = type2.propTypes;
|
|
581
|
-
} else {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
if (propTypes) {
|
|
585
|
-
var name2 = getComponentName(type2);
|
|
586
|
-
checkPropTypes(propTypes, element.props, "prop", name2, element);
|
|
587
|
-
} else if (type2.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
588
|
-
propTypesMisspellWarningShown = true;
|
|
589
|
-
var _name = getComponentName(type2);
|
|
590
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
591
|
-
}
|
|
592
|
-
if (typeof type2.getDefaultProps === "function" && !type2.getDefaultProps.isReactClassApproved) {
|
|
593
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
function validateFragmentProps(fragment) {
|
|
598
|
-
{
|
|
599
|
-
var keys = Object.keys(fragment.props);
|
|
600
|
-
for (var i = 0; i < keys.length; i++) {
|
|
601
|
-
var key = keys[i];
|
|
602
|
-
if (key !== "children" && key !== "key") {
|
|
603
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
604
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
605
|
-
setCurrentlyValidatingElement$1(null);
|
|
606
|
-
break;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
if (fragment.ref !== null) {
|
|
610
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
611
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
612
|
-
setCurrentlyValidatingElement$1(null);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
function jsxWithValidation(type2, props, key, isStaticChildren, source, self2) {
|
|
617
|
-
{
|
|
618
|
-
var validType = isValidElementType(type2);
|
|
619
|
-
if (!validType) {
|
|
620
|
-
var info = "";
|
|
621
|
-
if (type2 === void 0 || typeof type2 === "object" && type2 !== null && Object.keys(type2).length === 0) {
|
|
622
|
-
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
623
|
-
}
|
|
624
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
625
|
-
if (sourceInfo) {
|
|
626
|
-
info += sourceInfo;
|
|
627
|
-
} else {
|
|
628
|
-
info += getDeclarationErrorAddendum();
|
|
629
|
-
}
|
|
630
|
-
var typeString;
|
|
631
|
-
if (type2 === null) {
|
|
632
|
-
typeString = "null";
|
|
633
|
-
} else if (Array.isArray(type2)) {
|
|
634
|
-
typeString = "array";
|
|
635
|
-
} else if (type2 !== void 0 && type2.$$typeof === REACT_ELEMENT_TYPE) {
|
|
636
|
-
typeString = "<" + (getComponentName(type2.type) || "Unknown") + " />";
|
|
637
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
638
|
-
} else {
|
|
639
|
-
typeString = typeof type2;
|
|
640
|
-
}
|
|
641
|
-
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
642
|
-
}
|
|
643
|
-
var element = jsxDEV(type2, props, key, source, self2);
|
|
644
|
-
if (element == null) {
|
|
645
|
-
return element;
|
|
646
|
-
}
|
|
647
|
-
if (validType) {
|
|
648
|
-
var children = props.children;
|
|
649
|
-
if (children !== void 0) {
|
|
650
|
-
if (isStaticChildren) {
|
|
651
|
-
if (Array.isArray(children)) {
|
|
652
|
-
for (var i = 0; i < children.length; i++) {
|
|
653
|
-
validateChildKeys(children[i], type2);
|
|
654
|
-
}
|
|
655
|
-
if (Object.freeze) {
|
|
656
|
-
Object.freeze(children);
|
|
657
|
-
}
|
|
658
|
-
} else {
|
|
659
|
-
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
660
|
-
}
|
|
661
|
-
} else {
|
|
662
|
-
validateChildKeys(children, type2);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
if (type2 === exports3.Fragment) {
|
|
667
|
-
validateFragmentProps(element);
|
|
668
|
-
} else {
|
|
669
|
-
validatePropTypes(element);
|
|
670
|
-
}
|
|
671
|
-
return element;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
function jsxWithValidationStatic(type2, props, key) {
|
|
675
|
-
{
|
|
676
|
-
return jsxWithValidation(type2, props, key, true);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
function jsxWithValidationDynamic(type2, props, key) {
|
|
680
|
-
{
|
|
681
|
-
return jsxWithValidation(type2, props, key, false);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
var jsx = jsxWithValidationDynamic;
|
|
685
|
-
var jsxs = jsxWithValidationStatic;
|
|
686
|
-
exports3.jsx = jsx;
|
|
687
|
-
exports3.jsxs = jsxs;
|
|
688
|
-
})();
|
|
689
|
-
}
|
|
690
|
-
})(reactJsxRuntime_development);
|
|
691
|
-
return reactJsxRuntime_development;
|
|
692
|
-
}
|
|
693
|
-
if (process.env.NODE_ENV === "production") {
|
|
694
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
695
|
-
} else {
|
|
696
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
697
|
-
}
|
|
698
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
699
|
-
const stringifyConfig = {
|
|
700
|
-
addQueryPrefix: true,
|
|
701
|
-
skipNulls: true,
|
|
702
|
-
arrayFormat: "indices",
|
|
703
|
-
encode: false,
|
|
704
|
-
encodeValuesOnly: true
|
|
705
|
-
};
|
|
706
|
-
const convertToNumberIfPossible = (value) => {
|
|
707
|
-
if (typeof value === "undefined") {
|
|
708
|
-
return value;
|
|
709
|
-
}
|
|
710
|
-
const num = Number(value);
|
|
711
|
-
if (`${num}` === value) {
|
|
712
|
-
return num;
|
|
713
|
-
}
|
|
714
|
-
return value;
|
|
715
|
-
};
|
|
716
|
-
const routerProvider = {
|
|
717
|
-
go: () => {
|
|
718
|
-
const { search: existingSearch, hash: existingHash } = reactRouterDom.useLocation();
|
|
719
|
-
const history = reactRouterDom.useHistory();
|
|
720
|
-
const fn = React.useCallback(
|
|
721
|
-
({ to, type: type2, query, hash, options: { keepQuery, keepHash } = {} }) => {
|
|
722
|
-
const urlQuery = {
|
|
723
|
-
...keepQuery && existingSearch && qs.parse(existingSearch, { ignoreQueryPrefix: true }),
|
|
724
|
-
...query
|
|
725
|
-
};
|
|
726
|
-
if (urlQuery.to) {
|
|
727
|
-
urlQuery.to = encodeURIComponent(`${urlQuery.to}`);
|
|
728
|
-
}
|
|
729
|
-
const hasUrlQuery = Object.keys(urlQuery).length > 0;
|
|
730
|
-
const urlHash = `#${(hash || keepHash && existingHash || "").replace(
|
|
731
|
-
/^#/,
|
|
732
|
-
""
|
|
733
|
-
)}`;
|
|
734
|
-
const hasUrlHash = urlHash.length > 1;
|
|
735
|
-
const urlTo = to || "";
|
|
736
|
-
const fullPath = `${urlTo}${hasUrlQuery ? qs.stringify(urlQuery, stringifyConfig) : ""}${hasUrlHash ? urlHash : ""}`;
|
|
737
|
-
if (type2 === "path") {
|
|
738
|
-
return fullPath;
|
|
739
|
-
}
|
|
740
|
-
return history[type2 || "push"](fullPath);
|
|
741
|
-
},
|
|
742
|
-
[existingHash, existingSearch, history]
|
|
743
|
-
);
|
|
744
|
-
return fn;
|
|
745
|
-
},
|
|
746
|
-
back: () => {
|
|
747
|
-
const history = reactRouterDom.useHistory();
|
|
748
|
-
const fn = React.useCallback(() => {
|
|
749
|
-
history.go(-1);
|
|
750
|
-
}, [history]);
|
|
751
|
-
return fn;
|
|
752
|
-
},
|
|
753
|
-
parse: () => {
|
|
754
|
-
var _a;
|
|
755
|
-
let params = reactRouterDom.useParams();
|
|
756
|
-
const { pathname, search } = reactRouterDom.useLocation();
|
|
757
|
-
const { resources: resources2 } = React.useContext(core.ResourceContext);
|
|
758
|
-
const { resource, action, matchedRoute } = React.useMemo(() => {
|
|
759
|
-
return core.matchResourceFromRoute(pathname, resources2);
|
|
760
|
-
}, [resources2, pathname]);
|
|
761
|
-
if (Object.entries(params).length === 0 && matchedRoute) {
|
|
762
|
-
params = ((_a = reactRouterDom.matchPath(matchedRoute, pathname)) == null ? void 0 : _a.params) || {};
|
|
763
|
-
}
|
|
764
|
-
const fn = React.useCallback(() => {
|
|
765
|
-
const parsedSearch = qs.parse(search, { ignoreQueryPrefix: true });
|
|
766
|
-
const combinedParams = {
|
|
767
|
-
...params,
|
|
768
|
-
...parsedSearch
|
|
769
|
-
};
|
|
770
|
-
const response = {
|
|
771
|
-
...resource && { resource },
|
|
772
|
-
...action && { action },
|
|
773
|
-
...(parsedSearch == null ? void 0 : parsedSearch.id) && { id: decodeURIComponent(parsedSearch.id) },
|
|
774
|
-
// ...(params?.action && { action: params.action }), // lets see if there is a need for this
|
|
775
|
-
pathname,
|
|
776
|
-
params: {
|
|
777
|
-
...combinedParams,
|
|
778
|
-
current: convertToNumberIfPossible(combinedParams.current),
|
|
779
|
-
pageSize: convertToNumberIfPossible(combinedParams.pageSize),
|
|
780
|
-
to: combinedParams.to ? decodeURIComponent(combinedParams.to) : void 0
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
return response;
|
|
784
|
-
}, [pathname, search, params, resource, action]);
|
|
785
|
-
return fn;
|
|
786
|
-
},
|
|
787
|
-
Link: React.forwardRef(function RefineLink(props, ref) {
|
|
788
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Link, { ...props, ref });
|
|
789
|
-
})
|
|
790
|
-
};
|
|
791
|
-
function warn() {
|
|
792
|
-
if (console && console.warn) {
|
|
793
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
794
|
-
args[_key] = arguments[_key];
|
|
795
|
-
}
|
|
796
|
-
if (typeof args[0] === "string")
|
|
797
|
-
args[0] = `react-i18next:: ${args[0]}`;
|
|
798
|
-
console.warn(...args);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
const alreadyWarned = {};
|
|
802
|
-
function warnOnce() {
|
|
803
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
804
|
-
args[_key2] = arguments[_key2];
|
|
805
|
-
}
|
|
806
|
-
if (typeof args[0] === "string" && alreadyWarned[args[0]])
|
|
807
|
-
return;
|
|
808
|
-
if (typeof args[0] === "string")
|
|
809
|
-
alreadyWarned[args[0]] = /* @__PURE__ */ new Date();
|
|
810
|
-
warn(...args);
|
|
48
|
+
if (typeof args[0] === "string" && alreadyWarned[args[0]])
|
|
49
|
+
return;
|
|
50
|
+
if (typeof args[0] === "string")
|
|
51
|
+
alreadyWarned[args[0]] = /* @__PURE__ */ new Date();
|
|
52
|
+
warn(...args);
|
|
811
53
|
}
|
|
812
54
|
const loadedClb = (i18n2, cb) => () => {
|
|
813
55
|
if (i18n2.isInitialized) {
|
|
@@ -873,200 +115,1188 @@ var __publicField = (obj, key, value) => {
|
|
|
873
115
|
}
|
|
874
116
|
});
|
|
875
117
|
}
|
|
876
|
-
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
877
|
-
const htmlEntities = {
|
|
878
|
-
"&": "&",
|
|
879
|
-
"&": "&",
|
|
880
|
-
"<": "<",
|
|
881
|
-
"<": "<",
|
|
882
|
-
">": ">",
|
|
883
|
-
">": ">",
|
|
884
|
-
"'": "'",
|
|
885
|
-
"'": "'",
|
|
886
|
-
""": '"',
|
|
887
|
-
""": '"',
|
|
888
|
-
" ": " ",
|
|
889
|
-
" ": " ",
|
|
890
|
-
"©": "©",
|
|
891
|
-
"©": "©",
|
|
892
|
-
"®": "®",
|
|
893
|
-
"®": "®",
|
|
894
|
-
"…": "…",
|
|
895
|
-
"…": "…",
|
|
896
|
-
"/": "/",
|
|
897
|
-
"/": "/"
|
|
118
|
+
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
119
|
+
const htmlEntities = {
|
|
120
|
+
"&": "&",
|
|
121
|
+
"&": "&",
|
|
122
|
+
"<": "<",
|
|
123
|
+
"<": "<",
|
|
124
|
+
">": ">",
|
|
125
|
+
">": ">",
|
|
126
|
+
"'": "'",
|
|
127
|
+
"'": "'",
|
|
128
|
+
""": '"',
|
|
129
|
+
""": '"',
|
|
130
|
+
" ": " ",
|
|
131
|
+
" ": " ",
|
|
132
|
+
"©": "©",
|
|
133
|
+
"©": "©",
|
|
134
|
+
"®": "®",
|
|
135
|
+
"®": "®",
|
|
136
|
+
"…": "…",
|
|
137
|
+
"…": "…",
|
|
138
|
+
"/": "/",
|
|
139
|
+
"/": "/"
|
|
140
|
+
};
|
|
141
|
+
const unescapeHtmlEntity = (m) => htmlEntities[m];
|
|
142
|
+
const unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
143
|
+
let defaultOptions = {
|
|
144
|
+
bindI18n: "languageChanged",
|
|
145
|
+
bindI18nStore: "",
|
|
146
|
+
transEmptyNodeValue: "",
|
|
147
|
+
transSupportBasicHtmlNodes: true,
|
|
148
|
+
transWrapTextNodes: "",
|
|
149
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
150
|
+
useSuspense: true,
|
|
151
|
+
unescape
|
|
152
|
+
};
|
|
153
|
+
function setDefaults() {
|
|
154
|
+
let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
155
|
+
defaultOptions = {
|
|
156
|
+
...defaultOptions,
|
|
157
|
+
...options
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function getDefaults() {
|
|
161
|
+
return defaultOptions;
|
|
162
|
+
}
|
|
163
|
+
let i18nInstance;
|
|
164
|
+
function setI18n(instance) {
|
|
165
|
+
i18nInstance = instance;
|
|
166
|
+
}
|
|
167
|
+
function getI18n() {
|
|
168
|
+
return i18nInstance;
|
|
169
|
+
}
|
|
170
|
+
const initReactI18next = {
|
|
171
|
+
type: "3rdParty",
|
|
172
|
+
init(instance) {
|
|
173
|
+
setDefaults(instance.options.react);
|
|
174
|
+
setI18n(instance);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const I18nContext = React.createContext();
|
|
178
|
+
class ReportNamespaces {
|
|
179
|
+
constructor() {
|
|
180
|
+
this.usedNamespaces = {};
|
|
181
|
+
}
|
|
182
|
+
addUsedNamespaces(namespaces) {
|
|
183
|
+
namespaces.forEach((ns) => {
|
|
184
|
+
if (!this.usedNamespaces[ns])
|
|
185
|
+
this.usedNamespaces[ns] = true;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
getUsedNamespaces() {
|
|
189
|
+
return Object.keys(this.usedNamespaces);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const usePrevious = (value, ignore) => {
|
|
193
|
+
const ref = React.useRef();
|
|
194
|
+
React.useEffect(() => {
|
|
195
|
+
ref.current = ignore ? ref.current : value;
|
|
196
|
+
}, [value, ignore]);
|
|
197
|
+
return ref.current;
|
|
198
|
+
};
|
|
199
|
+
function useTranslation(ns) {
|
|
200
|
+
let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
201
|
+
const {
|
|
202
|
+
i18n: i18nFromProps
|
|
203
|
+
} = props;
|
|
204
|
+
const {
|
|
205
|
+
i18n: i18nFromContext,
|
|
206
|
+
defaultNS: defaultNSFromContext
|
|
207
|
+
} = React.useContext(I18nContext) || {};
|
|
208
|
+
const i18n2 = i18nFromProps || i18nFromContext || getI18n();
|
|
209
|
+
if (i18n2 && !i18n2.reportNamespaces)
|
|
210
|
+
i18n2.reportNamespaces = new ReportNamespaces();
|
|
211
|
+
if (!i18n2) {
|
|
212
|
+
warnOnce("You will need to pass in an i18next instance by using initReactI18next");
|
|
213
|
+
const notReadyT = (k, optsOrDefaultValue) => {
|
|
214
|
+
if (typeof optsOrDefaultValue === "string")
|
|
215
|
+
return optsOrDefaultValue;
|
|
216
|
+
if (optsOrDefaultValue && typeof optsOrDefaultValue === "object" && typeof optsOrDefaultValue.defaultValue === "string")
|
|
217
|
+
return optsOrDefaultValue.defaultValue;
|
|
218
|
+
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
219
|
+
};
|
|
220
|
+
const retNotReady = [notReadyT, {}, false];
|
|
221
|
+
retNotReady.t = notReadyT;
|
|
222
|
+
retNotReady.i18n = {};
|
|
223
|
+
retNotReady.ready = false;
|
|
224
|
+
return retNotReady;
|
|
225
|
+
}
|
|
226
|
+
if (i18n2.options.react && i18n2.options.react.wait !== void 0)
|
|
227
|
+
warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
228
|
+
const i18nOptions = {
|
|
229
|
+
...getDefaults(),
|
|
230
|
+
...i18n2.options.react,
|
|
231
|
+
...props
|
|
232
|
+
};
|
|
233
|
+
const {
|
|
234
|
+
useSuspense,
|
|
235
|
+
keyPrefix
|
|
236
|
+
} = i18nOptions;
|
|
237
|
+
let namespaces = ns || defaultNSFromContext || i18n2.options && i18n2.options.defaultNS;
|
|
238
|
+
namespaces = typeof namespaces === "string" ? [namespaces] : namespaces || ["translation"];
|
|
239
|
+
if (i18n2.reportNamespaces.addUsedNamespaces)
|
|
240
|
+
i18n2.reportNamespaces.addUsedNamespaces(namespaces);
|
|
241
|
+
const ready2 = (i18n2.isInitialized || i18n2.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n2, i18nOptions));
|
|
242
|
+
function getT() {
|
|
243
|
+
return i18n2.getFixedT(props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
244
|
+
}
|
|
245
|
+
const [t, setT] = React.useState(getT);
|
|
246
|
+
let joinedNS = namespaces.join();
|
|
247
|
+
if (props.lng)
|
|
248
|
+
joinedNS = `${props.lng}${joinedNS}`;
|
|
249
|
+
const previousJoinedNS = usePrevious(joinedNS);
|
|
250
|
+
const isMounted = React.useRef(true);
|
|
251
|
+
React.useEffect(() => {
|
|
252
|
+
const {
|
|
253
|
+
bindI18n,
|
|
254
|
+
bindI18nStore
|
|
255
|
+
} = i18nOptions;
|
|
256
|
+
isMounted.current = true;
|
|
257
|
+
if (!ready2 && !useSuspense) {
|
|
258
|
+
if (props.lng) {
|
|
259
|
+
loadLanguages(i18n2, props.lng, namespaces, () => {
|
|
260
|
+
if (isMounted.current)
|
|
261
|
+
setT(getT);
|
|
262
|
+
});
|
|
263
|
+
} else {
|
|
264
|
+
loadNamespaces(i18n2, namespaces, () => {
|
|
265
|
+
if (isMounted.current)
|
|
266
|
+
setT(getT);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (ready2 && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
271
|
+
setT(getT);
|
|
272
|
+
}
|
|
273
|
+
function boundReset() {
|
|
274
|
+
if (isMounted.current)
|
|
275
|
+
setT(getT);
|
|
276
|
+
}
|
|
277
|
+
if (bindI18n && i18n2)
|
|
278
|
+
i18n2.on(bindI18n, boundReset);
|
|
279
|
+
if (bindI18nStore && i18n2)
|
|
280
|
+
i18n2.store.on(bindI18nStore, boundReset);
|
|
281
|
+
return () => {
|
|
282
|
+
isMounted.current = false;
|
|
283
|
+
if (bindI18n && i18n2)
|
|
284
|
+
bindI18n.split(" ").forEach((e) => i18n2.off(e, boundReset));
|
|
285
|
+
if (bindI18nStore && i18n2)
|
|
286
|
+
bindI18nStore.split(" ").forEach((e) => i18n2.store.off(e, boundReset));
|
|
287
|
+
};
|
|
288
|
+
}, [i18n2, joinedNS]);
|
|
289
|
+
const isInitial = React.useRef(true);
|
|
290
|
+
React.useEffect(() => {
|
|
291
|
+
if (isMounted.current && !isInitial.current) {
|
|
292
|
+
setT(getT);
|
|
293
|
+
}
|
|
294
|
+
isInitial.current = false;
|
|
295
|
+
}, [i18n2, keyPrefix]);
|
|
296
|
+
const ret = [t, i18n2, ready2];
|
|
297
|
+
ret.t = t;
|
|
298
|
+
ret.i18n = i18n2;
|
|
299
|
+
ret.ready = ready2;
|
|
300
|
+
if (ready2)
|
|
301
|
+
return ret;
|
|
302
|
+
if (!ready2 && !useSuspense)
|
|
303
|
+
return ret;
|
|
304
|
+
throw new Promise((resolve) => {
|
|
305
|
+
if (props.lng) {
|
|
306
|
+
loadLanguages(i18n2, props.lng, namespaces, () => resolve());
|
|
307
|
+
} else {
|
|
308
|
+
loadNamespaces(i18n2, namespaces, () => resolve());
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
const copy$1 = "Copy";
|
|
313
|
+
const reset_arguments$1 = "Reset";
|
|
314
|
+
const view_changes$1 = "Show Diff";
|
|
315
|
+
const back_to_edit$1 = "Edit";
|
|
316
|
+
const configure_file$1 = "Configuration";
|
|
317
|
+
const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
|
|
318
|
+
const yaml_value_wrong$1 = "Configuration has invalid values.";
|
|
319
|
+
const edit_yaml$1 = "Edit YAML";
|
|
320
|
+
const copied$1 = "Copied";
|
|
321
|
+
const already_reset$1 = "Already reset";
|
|
322
|
+
const fetch_schema_fail$1 = "Failed to fetch schema.";
|
|
323
|
+
const obtain_data_error$1 = "Having trouble getting data.";
|
|
324
|
+
const retry$1 = "Retry";
|
|
325
|
+
const create_resource$1 = "Create {{resource}}";
|
|
326
|
+
const edit_resource$1 = "Edit {{resource}}";
|
|
327
|
+
const dovetail$1 = {
|
|
328
|
+
copy: copy$1,
|
|
329
|
+
reset_arguments: reset_arguments$1,
|
|
330
|
+
view_changes: view_changes$1,
|
|
331
|
+
back_to_edit: back_to_edit$1,
|
|
332
|
+
configure_file: configure_file$1,
|
|
333
|
+
yaml_format_wrong: yaml_format_wrong$1,
|
|
334
|
+
yaml_value_wrong: yaml_value_wrong$1,
|
|
335
|
+
edit_yaml: edit_yaml$1,
|
|
336
|
+
copied: copied$1,
|
|
337
|
+
already_reset: already_reset$1,
|
|
338
|
+
fetch_schema_fail: fetch_schema_fail$1,
|
|
339
|
+
obtain_data_error: obtain_data_error$1,
|
|
340
|
+
retry: retry$1,
|
|
341
|
+
create_resource: create_resource$1,
|
|
342
|
+
edit_resource: edit_resource$1
|
|
898
343
|
};
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
let defaultOptions = {
|
|
902
|
-
bindI18n: "languageChanged",
|
|
903
|
-
bindI18nStore: "",
|
|
904
|
-
transEmptyNodeValue: "",
|
|
905
|
-
transSupportBasicHtmlNodes: true,
|
|
906
|
-
transWrapTextNodes: "",
|
|
907
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
908
|
-
useSuspense: true,
|
|
909
|
-
unescape
|
|
344
|
+
const EN = {
|
|
345
|
+
dovetail: dovetail$1
|
|
910
346
|
};
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
347
|
+
const copy = "复制";
|
|
348
|
+
const reset_arguments = "重置";
|
|
349
|
+
const view_changes = "查看改动";
|
|
350
|
+
const back_to_edit = "编辑";
|
|
351
|
+
const configure_file = "配置内容";
|
|
352
|
+
const yaml_format_wrong = "配置内容不是有效的 yaml 格式。";
|
|
353
|
+
const yaml_value_wrong = "配置内容中存在不合法的值。";
|
|
354
|
+
const edit_yaml = "编辑 YAML";
|
|
355
|
+
const copied = "已复制";
|
|
356
|
+
const already_reset = "已重置";
|
|
357
|
+
const cancel = "取消";
|
|
358
|
+
const create = "创建";
|
|
359
|
+
const confirm_delete_text = "确定要删除 {{target}} 吗?";
|
|
360
|
+
const edit = "编辑";
|
|
361
|
+
const namespace = "名字空间";
|
|
362
|
+
const name = "名称";
|
|
363
|
+
const state = "状态";
|
|
364
|
+
const status = "状态";
|
|
365
|
+
const phase = "状态";
|
|
366
|
+
const image = "容器镜像";
|
|
367
|
+
const replicas = "副本数";
|
|
368
|
+
const created_time = "创建时间";
|
|
369
|
+
const label = "标签";
|
|
370
|
+
const annotation = "注释";
|
|
371
|
+
const type = "类型";
|
|
372
|
+
const event = "事件";
|
|
373
|
+
const reason = "原因";
|
|
374
|
+
const object = "对象";
|
|
375
|
+
const note$1 = "事件信息";
|
|
376
|
+
const condition = "Condition";
|
|
377
|
+
const download_yaml = "下载 YAML";
|
|
378
|
+
const detail = "详情";
|
|
379
|
+
const node_name = "主机名称";
|
|
380
|
+
const restarts = "重启次数";
|
|
381
|
+
const updated_time = "更新时间";
|
|
382
|
+
const message = "消息";
|
|
383
|
+
const save = "保存";
|
|
384
|
+
const more = "更多";
|
|
385
|
+
const workload = "工作负载";
|
|
386
|
+
const all_namespaces = "所有名字空间";
|
|
387
|
+
const empty = "无可显示的数据";
|
|
388
|
+
const schedule = "调度时间表";
|
|
389
|
+
const lastScheduleTime = "上次调度时间";
|
|
390
|
+
const duration = "持续时间";
|
|
391
|
+
const completions = "完成 Job 历史数";
|
|
392
|
+
const started = "开始时间";
|
|
393
|
+
const init_container = "初始化容器";
|
|
394
|
+
const container = "容器";
|
|
395
|
+
const redeploy = "重新部署";
|
|
396
|
+
const data = "数据";
|
|
397
|
+
const suspend = "暂停";
|
|
398
|
+
const resume = "重新开始";
|
|
399
|
+
const cluster = "集群";
|
|
400
|
+
const storage = "存储";
|
|
401
|
+
const network = "网络";
|
|
402
|
+
const clusterIp = "集群 IP";
|
|
403
|
+
const sessionAffinity = "会话保持";
|
|
404
|
+
const log = "日志";
|
|
405
|
+
const select_container = "选择容器";
|
|
406
|
+
const wrap = "折叠";
|
|
407
|
+
const resume_log = "继续";
|
|
408
|
+
const log_new_lines = ",并展示 {{ count }} 行新日志";
|
|
409
|
+
const fetch_schema_fail = "获取 schema 失败。";
|
|
410
|
+
const obtain_data_error = "获取数据时遇到问题。";
|
|
411
|
+
const retry = "重试";
|
|
412
|
+
const ready = "就绪";
|
|
413
|
+
const updating = "更新中";
|
|
414
|
+
const completed = "完成";
|
|
415
|
+
const failed = "异常";
|
|
416
|
+
const suspended = "挂起";
|
|
417
|
+
const running = "运行中";
|
|
418
|
+
const terminating = "终止";
|
|
419
|
+
const succeeded = "成功终止";
|
|
420
|
+
const unknown = "未知";
|
|
421
|
+
const pending = "待处理";
|
|
422
|
+
const waiting = "等待中";
|
|
423
|
+
const create_resource = "创建 {{resource}}";
|
|
424
|
+
const edit_resource = "编辑 {{resource}}";
|
|
425
|
+
const sec = "秒";
|
|
426
|
+
const min = "分";
|
|
427
|
+
const hr = "小时";
|
|
428
|
+
const day = "天";
|
|
429
|
+
const expand = "展开";
|
|
430
|
+
const fold = "收起";
|
|
431
|
+
const rule = "规则";
|
|
432
|
+
const default_backend = "默认后端";
|
|
433
|
+
const ingress_rule_type = "规则类型";
|
|
434
|
+
const port = "端口";
|
|
435
|
+
const dovetail = {
|
|
436
|
+
copy,
|
|
437
|
+
reset_arguments,
|
|
438
|
+
view_changes,
|
|
439
|
+
back_to_edit,
|
|
440
|
+
configure_file,
|
|
441
|
+
yaml_format_wrong,
|
|
442
|
+
yaml_value_wrong,
|
|
443
|
+
edit_yaml,
|
|
444
|
+
copied,
|
|
445
|
+
already_reset,
|
|
446
|
+
cancel,
|
|
447
|
+
"delete": "删除",
|
|
448
|
+
create,
|
|
449
|
+
confirm_delete_text,
|
|
450
|
+
edit,
|
|
451
|
+
namespace,
|
|
452
|
+
name,
|
|
453
|
+
state,
|
|
454
|
+
status,
|
|
455
|
+
phase,
|
|
456
|
+
image,
|
|
457
|
+
replicas,
|
|
458
|
+
created_time,
|
|
459
|
+
label,
|
|
460
|
+
annotation,
|
|
461
|
+
type,
|
|
462
|
+
event,
|
|
463
|
+
reason,
|
|
464
|
+
object,
|
|
465
|
+
note: note$1,
|
|
466
|
+
condition,
|
|
467
|
+
download_yaml,
|
|
468
|
+
detail,
|
|
469
|
+
node_name,
|
|
470
|
+
restarts,
|
|
471
|
+
updated_time,
|
|
472
|
+
message,
|
|
473
|
+
save,
|
|
474
|
+
more,
|
|
475
|
+
workload,
|
|
476
|
+
all_namespaces,
|
|
477
|
+
empty,
|
|
478
|
+
schedule,
|
|
479
|
+
lastScheduleTime,
|
|
480
|
+
duration,
|
|
481
|
+
completions,
|
|
482
|
+
started,
|
|
483
|
+
init_container,
|
|
484
|
+
container,
|
|
485
|
+
redeploy,
|
|
486
|
+
data,
|
|
487
|
+
suspend,
|
|
488
|
+
resume,
|
|
489
|
+
cluster,
|
|
490
|
+
storage,
|
|
491
|
+
network,
|
|
492
|
+
clusterIp,
|
|
493
|
+
sessionAffinity,
|
|
494
|
+
log,
|
|
495
|
+
select_container,
|
|
496
|
+
wrap,
|
|
497
|
+
resume_log,
|
|
498
|
+
log_new_lines,
|
|
499
|
+
fetch_schema_fail,
|
|
500
|
+
obtain_data_error,
|
|
501
|
+
retry,
|
|
502
|
+
ready,
|
|
503
|
+
updating,
|
|
504
|
+
completed,
|
|
505
|
+
failed,
|
|
506
|
+
suspended,
|
|
507
|
+
running,
|
|
508
|
+
terminating,
|
|
509
|
+
succeeded,
|
|
510
|
+
unknown,
|
|
511
|
+
pending,
|
|
512
|
+
waiting,
|
|
513
|
+
create_resource,
|
|
514
|
+
edit_resource,
|
|
515
|
+
sec,
|
|
516
|
+
min,
|
|
517
|
+
hr,
|
|
518
|
+
day,
|
|
519
|
+
expand,
|
|
520
|
+
fold,
|
|
521
|
+
rule,
|
|
522
|
+
default_backend,
|
|
523
|
+
ingress_rule_type,
|
|
524
|
+
port
|
|
934
525
|
};
|
|
935
|
-
const
|
|
936
|
-
|
|
937
|
-
constructor() {
|
|
938
|
-
this.usedNamespaces = {};
|
|
939
|
-
}
|
|
940
|
-
addUsedNamespaces(namespaces) {
|
|
941
|
-
namespaces.forEach((ns) => {
|
|
942
|
-
if (!this.usedNamespaces[ns])
|
|
943
|
-
this.usedNamespaces[ns] = true;
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
getUsedNamespaces() {
|
|
947
|
-
return Object.keys(this.usedNamespaces);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
const usePrevious = (value, ignore) => {
|
|
951
|
-
const ref = React.useRef();
|
|
952
|
-
React.useEffect(() => {
|
|
953
|
-
ref.current = ignore ? ref.current : value;
|
|
954
|
-
}, [value, ignore]);
|
|
955
|
-
return ref.current;
|
|
526
|
+
const ZH = {
|
|
527
|
+
dovetail
|
|
956
528
|
};
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
529
|
+
const resources = {
|
|
530
|
+
"en-US": EN,
|
|
531
|
+
"zh-CN": ZH
|
|
532
|
+
};
|
|
533
|
+
i18n.use(initReactI18next).init({
|
|
534
|
+
supportedLngs: ["en-US", "zh-CN"],
|
|
535
|
+
resources,
|
|
536
|
+
ns: Object.keys(resources["zh-CN"]),
|
|
537
|
+
defaultNS: "dovetail",
|
|
538
|
+
fallbackLng: ["en-US", "zh-CN"],
|
|
539
|
+
lng: "zh-CN",
|
|
540
|
+
nsSeparator: "."
|
|
541
|
+
});
|
|
542
|
+
var jsxRuntime = { exports: {} };
|
|
543
|
+
var reactJsxRuntime_production_min = {};
|
|
544
|
+
/** @license React v16.14.0
|
|
545
|
+
* react-jsx-runtime.production.min.js
|
|
546
|
+
*
|
|
547
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
548
|
+
*
|
|
549
|
+
* This source code is licensed under the MIT license found in the
|
|
550
|
+
* LICENSE file in the root directory of this source tree.
|
|
551
|
+
*/
|
|
552
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
553
|
+
function requireReactJsxRuntime_production_min() {
|
|
554
|
+
if (hasRequiredReactJsxRuntime_production_min)
|
|
555
|
+
return reactJsxRuntime_production_min;
|
|
556
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
557
|
+
var f = React, g = 60103;
|
|
558
|
+
reactJsxRuntime_production_min.Fragment = 60107;
|
|
559
|
+
if ("function" === typeof Symbol && Symbol.for) {
|
|
560
|
+
var h = Symbol.for;
|
|
561
|
+
g = h("react.element");
|
|
562
|
+
reactJsxRuntime_production_min.Fragment = h("react.fragment");
|
|
983
563
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
namespaces = typeof namespaces === "string" ? [namespaces] : namespaces || ["translation"];
|
|
997
|
-
if (i18n2.reportNamespaces.addUsedNamespaces)
|
|
998
|
-
i18n2.reportNamespaces.addUsedNamespaces(namespaces);
|
|
999
|
-
const ready2 = (i18n2.isInitialized || i18n2.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n2, i18nOptions));
|
|
1000
|
-
function getT() {
|
|
1001
|
-
return i18n2.getFixedT(props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
564
|
+
var m = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n = Object.prototype.hasOwnProperty, p = { key: true, ref: true, __self: true, __source: true };
|
|
565
|
+
function q(c, a, k) {
|
|
566
|
+
var b, d = {}, e = null, l = null;
|
|
567
|
+
void 0 !== k && (e = "" + k);
|
|
568
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
569
|
+
void 0 !== a.ref && (l = a.ref);
|
|
570
|
+
for (b in a)
|
|
571
|
+
n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
572
|
+
if (c && c.defaultProps)
|
|
573
|
+
for (b in a = c.defaultProps, a)
|
|
574
|
+
void 0 === d[b] && (d[b] = a[b]);
|
|
575
|
+
return { $$typeof: g, type: c, key: e, ref: l, props: d, _owner: m.current };
|
|
1002
576
|
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
577
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
578
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
579
|
+
return reactJsxRuntime_production_min;
|
|
580
|
+
}
|
|
581
|
+
var reactJsxRuntime_development = {};
|
|
582
|
+
/** @license React v16.14.0
|
|
583
|
+
* react-jsx-runtime.development.js
|
|
584
|
+
*
|
|
585
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
586
|
+
*
|
|
587
|
+
* This source code is licensed under the MIT license found in the
|
|
588
|
+
* LICENSE file in the root directory of this source tree.
|
|
589
|
+
*/
|
|
590
|
+
var hasRequiredReactJsxRuntime_development;
|
|
591
|
+
function requireReactJsxRuntime_development() {
|
|
592
|
+
if (hasRequiredReactJsxRuntime_development)
|
|
593
|
+
return reactJsxRuntime_development;
|
|
594
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
595
|
+
(function(exports3) {
|
|
596
|
+
if (process.env.NODE_ENV !== "production") {
|
|
597
|
+
(function() {
|
|
598
|
+
var React$1 = React;
|
|
599
|
+
var REACT_ELEMENT_TYPE = 60103;
|
|
600
|
+
var REACT_PORTAL_TYPE = 60106;
|
|
601
|
+
exports3.Fragment = 60107;
|
|
602
|
+
var REACT_STRICT_MODE_TYPE = 60108;
|
|
603
|
+
var REACT_PROFILER_TYPE = 60114;
|
|
604
|
+
var REACT_PROVIDER_TYPE = 60109;
|
|
605
|
+
var REACT_CONTEXT_TYPE = 60110;
|
|
606
|
+
var REACT_FORWARD_REF_TYPE = 60112;
|
|
607
|
+
var REACT_SUSPENSE_TYPE = 60113;
|
|
608
|
+
var REACT_SUSPENSE_LIST_TYPE = 60120;
|
|
609
|
+
var REACT_MEMO_TYPE = 60115;
|
|
610
|
+
var REACT_LAZY_TYPE = 60116;
|
|
611
|
+
var REACT_BLOCK_TYPE = 60121;
|
|
612
|
+
var REACT_SERVER_BLOCK_TYPE = 60122;
|
|
613
|
+
var REACT_FUNDAMENTAL_TYPE = 60117;
|
|
614
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
|
|
615
|
+
var REACT_LEGACY_HIDDEN_TYPE = 60131;
|
|
616
|
+
if (typeof Symbol === "function" && Symbol.for) {
|
|
617
|
+
var symbolFor = Symbol.for;
|
|
618
|
+
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
619
|
+
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
620
|
+
exports3.Fragment = symbolFor("react.fragment");
|
|
621
|
+
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
|
|
622
|
+
REACT_PROFILER_TYPE = symbolFor("react.profiler");
|
|
623
|
+
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
624
|
+
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
625
|
+
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
626
|
+
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
|
|
627
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
628
|
+
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
629
|
+
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
630
|
+
REACT_BLOCK_TYPE = symbolFor("react.block");
|
|
631
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
|
|
632
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
|
|
633
|
+
symbolFor("react.scope");
|
|
634
|
+
symbolFor("react.opaque.id");
|
|
635
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
636
|
+
symbolFor("react.offscreen");
|
|
637
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
638
|
+
}
|
|
639
|
+
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
640
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
641
|
+
function getIteratorFn(maybeIterable) {
|
|
642
|
+
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
645
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
646
|
+
if (typeof maybeIterator === "function") {
|
|
647
|
+
return maybeIterator;
|
|
648
|
+
}
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
652
|
+
function error(format) {
|
|
653
|
+
{
|
|
654
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
655
|
+
args[_key2 - 1] = arguments[_key2];
|
|
656
|
+
}
|
|
657
|
+
printWarning("error", format, args);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
function printWarning(level, format, args) {
|
|
661
|
+
{
|
|
662
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
663
|
+
var stack = "";
|
|
664
|
+
if (currentlyValidatingElement) {
|
|
665
|
+
var name2 = getComponentName(currentlyValidatingElement.type);
|
|
666
|
+
var owner = currentlyValidatingElement._owner;
|
|
667
|
+
stack += describeComponentFrame(name2, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
668
|
+
}
|
|
669
|
+
stack += ReactDebugCurrentFrame.getStackAddendum();
|
|
670
|
+
if (stack !== "") {
|
|
671
|
+
format += "%s";
|
|
672
|
+
args = args.concat([stack]);
|
|
673
|
+
}
|
|
674
|
+
var argsWithFormat = args.map(function(item) {
|
|
675
|
+
return "" + item;
|
|
676
|
+
});
|
|
677
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
678
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
var enableScopeAPI = false;
|
|
682
|
+
function isValidElementType(type2) {
|
|
683
|
+
if (typeof type2 === "string" || typeof type2 === "function") {
|
|
684
|
+
return true;
|
|
685
|
+
}
|
|
686
|
+
if (type2 === exports3.Fragment || type2 === REACT_PROFILER_TYPE || type2 === REACT_DEBUG_TRACING_MODE_TYPE || type2 === REACT_STRICT_MODE_TYPE || type2 === REACT_SUSPENSE_TYPE || type2 === REACT_SUSPENSE_LIST_TYPE || type2 === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
|
|
687
|
+
return true;
|
|
688
|
+
}
|
|
689
|
+
if (typeof type2 === "object" && type2 !== null) {
|
|
690
|
+
if (type2.$$typeof === REACT_LAZY_TYPE || type2.$$typeof === REACT_MEMO_TYPE || type2.$$typeof === REACT_PROVIDER_TYPE || type2.$$typeof === REACT_CONTEXT_TYPE || type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_FUNDAMENTAL_TYPE || type2.$$typeof === REACT_BLOCK_TYPE || type2[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
691
|
+
return true;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return false;
|
|
695
|
+
}
|
|
696
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
697
|
+
function describeComponentFrame(name2, source, ownerName) {
|
|
698
|
+
var sourceInfo = "";
|
|
699
|
+
if (source) {
|
|
700
|
+
var path = source.fileName;
|
|
701
|
+
var fileName = path.replace(BEFORE_SLASH_RE, "");
|
|
702
|
+
{
|
|
703
|
+
if (/^index\./.test(fileName)) {
|
|
704
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
705
|
+
if (match) {
|
|
706
|
+
var pathBeforeSlash = match[1];
|
|
707
|
+
if (pathBeforeSlash) {
|
|
708
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, "");
|
|
709
|
+
fileName = folderName + "/" + fileName;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")";
|
|
715
|
+
} else if (ownerName) {
|
|
716
|
+
sourceInfo = " (created by " + ownerName + ")";
|
|
717
|
+
}
|
|
718
|
+
return "\n in " + (name2 || "Unknown") + sourceInfo;
|
|
719
|
+
}
|
|
720
|
+
var Resolved = 1;
|
|
721
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
722
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
723
|
+
}
|
|
724
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
725
|
+
var functionName = innerType.displayName || innerType.name || "";
|
|
726
|
+
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
727
|
+
}
|
|
728
|
+
function getComponentName(type2) {
|
|
729
|
+
if (type2 == null) {
|
|
730
|
+
return null;
|
|
731
|
+
}
|
|
732
|
+
{
|
|
733
|
+
if (typeof type2.tag === "number") {
|
|
734
|
+
error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
if (typeof type2 === "function") {
|
|
738
|
+
return type2.displayName || type2.name || null;
|
|
739
|
+
}
|
|
740
|
+
if (typeof type2 === "string") {
|
|
741
|
+
return type2;
|
|
742
|
+
}
|
|
743
|
+
switch (type2) {
|
|
744
|
+
case exports3.Fragment:
|
|
745
|
+
return "Fragment";
|
|
746
|
+
case REACT_PORTAL_TYPE:
|
|
747
|
+
return "Portal";
|
|
748
|
+
case REACT_PROFILER_TYPE:
|
|
749
|
+
return "Profiler";
|
|
750
|
+
case REACT_STRICT_MODE_TYPE:
|
|
751
|
+
return "StrictMode";
|
|
752
|
+
case REACT_SUSPENSE_TYPE:
|
|
753
|
+
return "Suspense";
|
|
754
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
755
|
+
return "SuspenseList";
|
|
756
|
+
}
|
|
757
|
+
if (typeof type2 === "object") {
|
|
758
|
+
switch (type2.$$typeof) {
|
|
759
|
+
case REACT_CONTEXT_TYPE:
|
|
760
|
+
return "Context.Consumer";
|
|
761
|
+
case REACT_PROVIDER_TYPE:
|
|
762
|
+
return "Context.Provider";
|
|
763
|
+
case REACT_FORWARD_REF_TYPE:
|
|
764
|
+
return getWrappedName(type2, type2.render, "ForwardRef");
|
|
765
|
+
case REACT_MEMO_TYPE:
|
|
766
|
+
return getComponentName(type2.type);
|
|
767
|
+
case REACT_BLOCK_TYPE:
|
|
768
|
+
return getComponentName(type2.render);
|
|
769
|
+
case REACT_LAZY_TYPE: {
|
|
770
|
+
var thenable = type2;
|
|
771
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
772
|
+
if (resolvedThenable) {
|
|
773
|
+
return getComponentName(resolvedThenable);
|
|
774
|
+
}
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return null;
|
|
780
|
+
}
|
|
781
|
+
var loggedTypeFailures = {};
|
|
782
|
+
ReactSharedInternals.ReactDebugCurrentFrame;
|
|
783
|
+
var currentlyValidatingElement = null;
|
|
784
|
+
function setCurrentlyValidatingElement(element) {
|
|
785
|
+
{
|
|
786
|
+
currentlyValidatingElement = element;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
790
|
+
{
|
|
791
|
+
var has2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
792
|
+
for (var typeSpecName in typeSpecs) {
|
|
793
|
+
if (has2(typeSpecs, typeSpecName)) {
|
|
794
|
+
var error$1 = void 0;
|
|
795
|
+
try {
|
|
796
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
797
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
798
|
+
err.name = "Invariant Violation";
|
|
799
|
+
throw err;
|
|
800
|
+
}
|
|
801
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
802
|
+
} catch (ex) {
|
|
803
|
+
error$1 = ex;
|
|
804
|
+
}
|
|
805
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
806
|
+
setCurrentlyValidatingElement(element);
|
|
807
|
+
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
808
|
+
setCurrentlyValidatingElement(null);
|
|
809
|
+
}
|
|
810
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
811
|
+
loggedTypeFailures[error$1.message] = true;
|
|
812
|
+
setCurrentlyValidatingElement(element);
|
|
813
|
+
error("Failed %s type: %s", location, error$1.message);
|
|
814
|
+
setCurrentlyValidatingElement(null);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
821
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
822
|
+
var RESERVED_PROPS = {
|
|
823
|
+
key: true,
|
|
824
|
+
ref: true,
|
|
825
|
+
__self: true,
|
|
826
|
+
__source: true
|
|
827
|
+
};
|
|
828
|
+
var specialPropKeyWarningShown;
|
|
829
|
+
var specialPropRefWarningShown;
|
|
830
|
+
var didWarnAboutStringRefs;
|
|
831
|
+
{
|
|
832
|
+
didWarnAboutStringRefs = {};
|
|
833
|
+
}
|
|
834
|
+
function hasValidRef(config) {
|
|
835
|
+
{
|
|
836
|
+
if (hasOwnProperty.call(config, "ref")) {
|
|
837
|
+
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
838
|
+
if (getter && getter.isReactWarning) {
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
return config.ref !== void 0;
|
|
844
|
+
}
|
|
845
|
+
function hasValidKey(config) {
|
|
846
|
+
{
|
|
847
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
848
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
849
|
+
if (getter && getter.isReactWarning) {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
return config.key !== void 0;
|
|
855
|
+
}
|
|
856
|
+
function warnIfStringRefCannotBeAutoConverted(config, self2) {
|
|
857
|
+
{
|
|
858
|
+
if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
|
|
859
|
+
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
860
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
861
|
+
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
862
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
868
|
+
{
|
|
869
|
+
var warnAboutAccessingKey = function() {
|
|
870
|
+
if (!specialPropKeyWarningShown) {
|
|
871
|
+
specialPropKeyWarningShown = true;
|
|
872
|
+
error("%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://reactjs.org/link/special-props)", displayName);
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
876
|
+
Object.defineProperty(props, "key", {
|
|
877
|
+
get: warnAboutAccessingKey,
|
|
878
|
+
configurable: true
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
883
|
+
{
|
|
884
|
+
var warnAboutAccessingRef = function() {
|
|
885
|
+
if (!specialPropRefWarningShown) {
|
|
886
|
+
specialPropRefWarningShown = true;
|
|
887
|
+
error("%s: `ref` 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://reactjs.org/link/special-props)", displayName);
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
891
|
+
Object.defineProperty(props, "ref", {
|
|
892
|
+
get: warnAboutAccessingRef,
|
|
893
|
+
configurable: true
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
var ReactElement = function(type2, key, ref, self2, source, owner, props) {
|
|
898
|
+
var element = {
|
|
899
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
900
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
901
|
+
// Built-in properties that belong on the element
|
|
902
|
+
type: type2,
|
|
903
|
+
key,
|
|
904
|
+
ref,
|
|
905
|
+
props,
|
|
906
|
+
// Record the component responsible for creating this element.
|
|
907
|
+
_owner: owner
|
|
908
|
+
};
|
|
909
|
+
{
|
|
910
|
+
element._store = {};
|
|
911
|
+
Object.defineProperty(element._store, "validated", {
|
|
912
|
+
configurable: false,
|
|
913
|
+
enumerable: false,
|
|
914
|
+
writable: true,
|
|
915
|
+
value: false
|
|
916
|
+
});
|
|
917
|
+
Object.defineProperty(element, "_self", {
|
|
918
|
+
configurable: false,
|
|
919
|
+
enumerable: false,
|
|
920
|
+
writable: false,
|
|
921
|
+
value: self2
|
|
922
|
+
});
|
|
923
|
+
Object.defineProperty(element, "_source", {
|
|
924
|
+
configurable: false,
|
|
925
|
+
enumerable: false,
|
|
926
|
+
writable: false,
|
|
927
|
+
value: source
|
|
928
|
+
});
|
|
929
|
+
if (Object.freeze) {
|
|
930
|
+
Object.freeze(element.props);
|
|
931
|
+
Object.freeze(element);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
return element;
|
|
935
|
+
};
|
|
936
|
+
function jsxDEV(type2, config, maybeKey, source, self2) {
|
|
937
|
+
{
|
|
938
|
+
var propName;
|
|
939
|
+
var props = {};
|
|
940
|
+
var key = null;
|
|
941
|
+
var ref = null;
|
|
942
|
+
if (maybeKey !== void 0) {
|
|
943
|
+
key = "" + maybeKey;
|
|
944
|
+
}
|
|
945
|
+
if (hasValidKey(config)) {
|
|
946
|
+
key = "" + config.key;
|
|
947
|
+
}
|
|
948
|
+
if (hasValidRef(config)) {
|
|
949
|
+
ref = config.ref;
|
|
950
|
+
warnIfStringRefCannotBeAutoConverted(config, self2);
|
|
951
|
+
}
|
|
952
|
+
for (propName in config) {
|
|
953
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
954
|
+
props[propName] = config[propName];
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
if (type2 && type2.defaultProps) {
|
|
958
|
+
var defaultProps = type2.defaultProps;
|
|
959
|
+
for (propName in defaultProps) {
|
|
960
|
+
if (props[propName] === void 0) {
|
|
961
|
+
props[propName] = defaultProps[propName];
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
if (key || ref) {
|
|
966
|
+
var displayName = typeof type2 === "function" ? type2.displayName || type2.name || "Unknown" : type2;
|
|
967
|
+
if (key) {
|
|
968
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
969
|
+
}
|
|
970
|
+
if (ref) {
|
|
971
|
+
defineRefPropWarningGetter(props, displayName);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return ReactElement(type2, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
978
|
+
ReactSharedInternals.ReactDebugCurrentFrame;
|
|
979
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
980
|
+
currentlyValidatingElement = element;
|
|
981
|
+
}
|
|
982
|
+
var propTypesMisspellWarningShown;
|
|
983
|
+
{
|
|
984
|
+
propTypesMisspellWarningShown = false;
|
|
985
|
+
}
|
|
986
|
+
function isValidElement(object2) {
|
|
987
|
+
{
|
|
988
|
+
return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function getDeclarationErrorAddendum() {
|
|
992
|
+
{
|
|
993
|
+
if (ReactCurrentOwner$1.current) {
|
|
994
|
+
var name2 = getComponentName(ReactCurrentOwner$1.current.type);
|
|
995
|
+
if (name2) {
|
|
996
|
+
return "\n\nCheck the render method of `" + name2 + "`.";
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
return "";
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1003
|
+
{
|
|
1004
|
+
if (source !== void 0) {
|
|
1005
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1006
|
+
var lineNumber = source.lineNumber;
|
|
1007
|
+
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
1008
|
+
}
|
|
1009
|
+
return "";
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
var ownerHasKeyUseWarning = {};
|
|
1013
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1014
|
+
{
|
|
1015
|
+
var info = getDeclarationErrorAddendum();
|
|
1016
|
+
if (!info) {
|
|
1017
|
+
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
1018
|
+
if (parentName) {
|
|
1019
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
return info;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
function validateExplicitKey(element, parentType) {
|
|
1026
|
+
{
|
|
1027
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
element._store.validated = true;
|
|
1031
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1032
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
1036
|
+
var childOwner = "";
|
|
1037
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1038
|
+
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1039
|
+
}
|
|
1040
|
+
setCurrentlyValidatingElement$1(element);
|
|
1041
|
+
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1042
|
+
setCurrentlyValidatingElement$1(null);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
function validateChildKeys(node, parentType) {
|
|
1046
|
+
{
|
|
1047
|
+
if (typeof node !== "object") {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
if (Array.isArray(node)) {
|
|
1051
|
+
for (var i = 0; i < node.length; i++) {
|
|
1052
|
+
var child = node[i];
|
|
1053
|
+
if (isValidElement(child)) {
|
|
1054
|
+
validateExplicitKey(child, parentType);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
} else if (isValidElement(node)) {
|
|
1058
|
+
if (node._store) {
|
|
1059
|
+
node._store.validated = true;
|
|
1060
|
+
}
|
|
1061
|
+
} else if (node) {
|
|
1062
|
+
var iteratorFn = getIteratorFn(node);
|
|
1063
|
+
if (typeof iteratorFn === "function") {
|
|
1064
|
+
if (iteratorFn !== node.entries) {
|
|
1065
|
+
var iterator = iteratorFn.call(node);
|
|
1066
|
+
var step;
|
|
1067
|
+
while (!(step = iterator.next()).done) {
|
|
1068
|
+
if (isValidElement(step.value)) {
|
|
1069
|
+
validateExplicitKey(step.value, parentType);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
function validatePropTypes(element) {
|
|
1078
|
+
{
|
|
1079
|
+
var type2 = element.type;
|
|
1080
|
+
if (type2 === null || type2 === void 0 || typeof type2 === "string") {
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
1083
|
+
var propTypes;
|
|
1084
|
+
if (typeof type2 === "function") {
|
|
1085
|
+
propTypes = type2.propTypes;
|
|
1086
|
+
} else if (typeof type2 === "object" && (type2.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1087
|
+
// Inner props are checked in the reconciler.
|
|
1088
|
+
type2.$$typeof === REACT_MEMO_TYPE)) {
|
|
1089
|
+
propTypes = type2.propTypes;
|
|
1090
|
+
} else {
|
|
1091
|
+
return;
|
|
1092
|
+
}
|
|
1093
|
+
if (propTypes) {
|
|
1094
|
+
var name2 = getComponentName(type2);
|
|
1095
|
+
checkPropTypes(propTypes, element.props, "prop", name2, element);
|
|
1096
|
+
} else if (type2.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1097
|
+
propTypesMisspellWarningShown = true;
|
|
1098
|
+
var _name = getComponentName(type2);
|
|
1099
|
+
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
1100
|
+
}
|
|
1101
|
+
if (typeof type2.getDefaultProps === "function" && !type2.getDefaultProps.isReactClassApproved) {
|
|
1102
|
+
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
function validateFragmentProps(fragment) {
|
|
1107
|
+
{
|
|
1108
|
+
var keys = Object.keys(fragment.props);
|
|
1109
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1110
|
+
var key = keys[i];
|
|
1111
|
+
if (key !== "children" && key !== "key") {
|
|
1112
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1113
|
+
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
1114
|
+
setCurrentlyValidatingElement$1(null);
|
|
1115
|
+
break;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
if (fragment.ref !== null) {
|
|
1119
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1120
|
+
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
1121
|
+
setCurrentlyValidatingElement$1(null);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
function jsxWithValidation(type2, props, key, isStaticChildren, source, self2) {
|
|
1126
|
+
{
|
|
1127
|
+
var validType = isValidElementType(type2);
|
|
1128
|
+
if (!validType) {
|
|
1129
|
+
var info = "";
|
|
1130
|
+
if (type2 === void 0 || typeof type2 === "object" && type2 !== null && Object.keys(type2).length === 0) {
|
|
1131
|
+
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1132
|
+
}
|
|
1133
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1134
|
+
if (sourceInfo) {
|
|
1135
|
+
info += sourceInfo;
|
|
1136
|
+
} else {
|
|
1137
|
+
info += getDeclarationErrorAddendum();
|
|
1138
|
+
}
|
|
1139
|
+
var typeString;
|
|
1140
|
+
if (type2 === null) {
|
|
1141
|
+
typeString = "null";
|
|
1142
|
+
} else if (Array.isArray(type2)) {
|
|
1143
|
+
typeString = "array";
|
|
1144
|
+
} else if (type2 !== void 0 && type2.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1145
|
+
typeString = "<" + (getComponentName(type2.type) || "Unknown") + " />";
|
|
1146
|
+
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1147
|
+
} else {
|
|
1148
|
+
typeString = typeof type2;
|
|
1149
|
+
}
|
|
1150
|
+
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
1151
|
+
}
|
|
1152
|
+
var element = jsxDEV(type2, props, key, source, self2);
|
|
1153
|
+
if (element == null) {
|
|
1154
|
+
return element;
|
|
1155
|
+
}
|
|
1156
|
+
if (validType) {
|
|
1157
|
+
var children = props.children;
|
|
1158
|
+
if (children !== void 0) {
|
|
1159
|
+
if (isStaticChildren) {
|
|
1160
|
+
if (Array.isArray(children)) {
|
|
1161
|
+
for (var i = 0; i < children.length; i++) {
|
|
1162
|
+
validateChildKeys(children[i], type2);
|
|
1163
|
+
}
|
|
1164
|
+
if (Object.freeze) {
|
|
1165
|
+
Object.freeze(children);
|
|
1166
|
+
}
|
|
1167
|
+
} else {
|
|
1168
|
+
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1169
|
+
}
|
|
1170
|
+
} else {
|
|
1171
|
+
validateChildKeys(children, type2);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
if (type2 === exports3.Fragment) {
|
|
1176
|
+
validateFragmentProps(element);
|
|
1177
|
+
} else {
|
|
1178
|
+
validatePropTypes(element);
|
|
1179
|
+
}
|
|
1180
|
+
return element;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
function jsxWithValidationStatic(type2, props, key) {
|
|
1184
|
+
{
|
|
1185
|
+
return jsxWithValidation(type2, props, key, true);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
function jsxWithValidationDynamic(type2, props, key) {
|
|
1189
|
+
{
|
|
1190
|
+
return jsxWithValidation(type2, props, key, false);
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
var jsx = jsxWithValidationDynamic;
|
|
1194
|
+
var jsxs = jsxWithValidationStatic;
|
|
1195
|
+
exports3.jsx = jsx;
|
|
1196
|
+
exports3.jsxs = jsxs;
|
|
1197
|
+
})();
|
|
1067
1198
|
}
|
|
1068
|
-
});
|
|
1199
|
+
})(reactJsxRuntime_development);
|
|
1200
|
+
return reactJsxRuntime_development;
|
|
1201
|
+
}
|
|
1202
|
+
if (process.env.NODE_ENV === "production") {
|
|
1203
|
+
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
1204
|
+
} else {
|
|
1205
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1069
1206
|
}
|
|
1207
|
+
var jsxRuntimeExports = jsxRuntime.exports;
|
|
1208
|
+
const stringifyConfig = {
|
|
1209
|
+
addQueryPrefix: true,
|
|
1210
|
+
skipNulls: true,
|
|
1211
|
+
arrayFormat: "indices",
|
|
1212
|
+
encode: false,
|
|
1213
|
+
encodeValuesOnly: true
|
|
1214
|
+
};
|
|
1215
|
+
const convertToNumberIfPossible = (value) => {
|
|
1216
|
+
if (typeof value === "undefined") {
|
|
1217
|
+
return value;
|
|
1218
|
+
}
|
|
1219
|
+
const num = Number(value);
|
|
1220
|
+
if (`${num}` === value) {
|
|
1221
|
+
return num;
|
|
1222
|
+
}
|
|
1223
|
+
return value;
|
|
1224
|
+
};
|
|
1225
|
+
const routerProvider = {
|
|
1226
|
+
go: () => {
|
|
1227
|
+
const { search: existingSearch, hash: existingHash } = reactRouterDom.useLocation();
|
|
1228
|
+
const history = reactRouterDom.useHistory();
|
|
1229
|
+
const fn = React.useCallback(
|
|
1230
|
+
({ to, type: type2, query, hash, options: { keepQuery, keepHash } = {} }) => {
|
|
1231
|
+
const urlQuery = {
|
|
1232
|
+
...keepQuery && existingSearch && qs.parse(existingSearch, { ignoreQueryPrefix: true }),
|
|
1233
|
+
...query
|
|
1234
|
+
};
|
|
1235
|
+
if (urlQuery.to) {
|
|
1236
|
+
urlQuery.to = encodeURIComponent(`${urlQuery.to}`);
|
|
1237
|
+
}
|
|
1238
|
+
const hasUrlQuery = Object.keys(urlQuery).length > 0;
|
|
1239
|
+
const urlHash = `#${(hash || keepHash && existingHash || "").replace(
|
|
1240
|
+
/^#/,
|
|
1241
|
+
""
|
|
1242
|
+
)}`;
|
|
1243
|
+
const hasUrlHash = urlHash.length > 1;
|
|
1244
|
+
const urlTo = to || "";
|
|
1245
|
+
const fullPath = `${urlTo}${hasUrlQuery ? qs.stringify(urlQuery, stringifyConfig) : ""}${hasUrlHash ? urlHash : ""}`;
|
|
1246
|
+
if (type2 === "path") {
|
|
1247
|
+
return fullPath;
|
|
1248
|
+
}
|
|
1249
|
+
return history[type2 || "push"](fullPath);
|
|
1250
|
+
},
|
|
1251
|
+
[existingHash, existingSearch, history]
|
|
1252
|
+
);
|
|
1253
|
+
return fn;
|
|
1254
|
+
},
|
|
1255
|
+
back: () => {
|
|
1256
|
+
const history = reactRouterDom.useHistory();
|
|
1257
|
+
const fn = React.useCallback(() => {
|
|
1258
|
+
history.go(-1);
|
|
1259
|
+
}, [history]);
|
|
1260
|
+
return fn;
|
|
1261
|
+
},
|
|
1262
|
+
parse: () => {
|
|
1263
|
+
var _a;
|
|
1264
|
+
let params = reactRouterDom.useParams();
|
|
1265
|
+
const { pathname, search } = reactRouterDom.useLocation();
|
|
1266
|
+
const { resources: resources2 } = React.useContext(core.ResourceContext);
|
|
1267
|
+
const { resource, action, matchedRoute } = React.useMemo(() => {
|
|
1268
|
+
return core.matchResourceFromRoute(pathname, resources2);
|
|
1269
|
+
}, [resources2, pathname]);
|
|
1270
|
+
if (Object.entries(params).length === 0 && matchedRoute) {
|
|
1271
|
+
params = ((_a = reactRouterDom.matchPath(matchedRoute, pathname)) == null ? void 0 : _a.params) || {};
|
|
1272
|
+
}
|
|
1273
|
+
const fn = React.useCallback(() => {
|
|
1274
|
+
const parsedSearch = qs.parse(search, { ignoreQueryPrefix: true });
|
|
1275
|
+
const combinedParams = {
|
|
1276
|
+
...params,
|
|
1277
|
+
...parsedSearch
|
|
1278
|
+
};
|
|
1279
|
+
const response = {
|
|
1280
|
+
...resource && { resource },
|
|
1281
|
+
...action && { action },
|
|
1282
|
+
...(parsedSearch == null ? void 0 : parsedSearch.id) && { id: decodeURIComponent(parsedSearch.id) },
|
|
1283
|
+
// ...(params?.action && { action: params.action }), // lets see if there is a need for this
|
|
1284
|
+
pathname,
|
|
1285
|
+
params: {
|
|
1286
|
+
...combinedParams,
|
|
1287
|
+
current: convertToNumberIfPossible(combinedParams.current),
|
|
1288
|
+
pageSize: convertToNumberIfPossible(combinedParams.pageSize),
|
|
1289
|
+
to: combinedParams.to ? decodeURIComponent(combinedParams.to) : void 0
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
|
+
return response;
|
|
1293
|
+
}, [pathname, search, params, resource, action]);
|
|
1294
|
+
return fn;
|
|
1295
|
+
},
|
|
1296
|
+
Link: React.forwardRef(function RefineLink(props, ref) {
|
|
1297
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Link, { ...props, ref });
|
|
1298
|
+
})
|
|
1299
|
+
};
|
|
1070
1300
|
function useK8sYamlEditor() {
|
|
1071
1301
|
const foldSymbol = React.useCallback(function(editor, symbol) {
|
|
1072
1302
|
const model = editor.getModel();
|
|
@@ -6439,1079 +6669,849 @@ var __publicField = (obj, key, value) => {
|
|
|
6439
6669
|
} else {
|
|
6440
6670
|
result2.__views__.push({
|
|
6441
6671
|
"size": nativeMin(n, MAX_ARRAY_LENGTH),
|
|
6442
|
-
"type": methodName + (result2.__dir__ < 0 ? "Right" : "")
|
|
6443
|
-
});
|
|
6444
|
-
}
|
|
6445
|
-
return result2;
|
|
6446
|
-
};
|
|
6447
|
-
LazyWrapper.prototype[methodName + "Right"] = function(n) {
|
|
6448
|
-
return this.reverse()[methodName](n).reverse();
|
|
6449
|
-
};
|
|
6450
|
-
});
|
|
6451
|
-
arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
|
|
6452
|
-
var type2 = index + 1, isFilter = type2 == LAZY_FILTER_FLAG || type2 == LAZY_WHILE_FLAG;
|
|
6453
|
-
LazyWrapper.prototype[methodName] = function(iteratee2) {
|
|
6454
|
-
var result2 = this.clone();
|
|
6455
|
-
result2.__iteratees__.push({
|
|
6456
|
-
"iteratee": getIteratee(iteratee2, 3),
|
|
6457
|
-
"type": type2
|
|
6458
|
-
});
|
|
6459
|
-
result2.__filtered__ = result2.__filtered__ || isFilter;
|
|
6460
|
-
return result2;
|
|
6461
|
-
};
|
|
6462
|
-
});
|
|
6463
|
-
arrayEach(["head", "last"], function(methodName, index) {
|
|
6464
|
-
var takeName = "take" + (index ? "Right" : "");
|
|
6465
|
-
LazyWrapper.prototype[methodName] = function() {
|
|
6466
|
-
return this[takeName](1).value()[0];
|
|
6467
|
-
};
|
|
6468
|
-
});
|
|
6469
|
-
arrayEach(["initial", "tail"], function(methodName, index) {
|
|
6470
|
-
var dropName = "drop" + (index ? "" : "Right");
|
|
6471
|
-
LazyWrapper.prototype[methodName] = function() {
|
|
6472
|
-
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
|
|
6473
|
-
};
|
|
6474
|
-
});
|
|
6475
|
-
LazyWrapper.prototype.compact = function() {
|
|
6476
|
-
return this.filter(identity);
|
|
6477
|
-
};
|
|
6478
|
-
LazyWrapper.prototype.find = function(predicate) {
|
|
6479
|
-
return this.filter(predicate).head();
|
|
6480
|
-
};
|
|
6481
|
-
LazyWrapper.prototype.findLast = function(predicate) {
|
|
6482
|
-
return this.reverse().find(predicate);
|
|
6483
|
-
};
|
|
6484
|
-
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
|
|
6485
|
-
if (typeof path == "function") {
|
|
6486
|
-
return new LazyWrapper(this);
|
|
6487
|
-
}
|
|
6488
|
-
return this.map(function(value) {
|
|
6489
|
-
return baseInvoke(value, path, args);
|
|
6490
|
-
});
|
|
6491
|
-
});
|
|
6492
|
-
LazyWrapper.prototype.reject = function(predicate) {
|
|
6493
|
-
return this.filter(negate(getIteratee(predicate)));
|
|
6494
|
-
};
|
|
6495
|
-
LazyWrapper.prototype.slice = function(start, end) {
|
|
6496
|
-
start = toInteger(start);
|
|
6497
|
-
var result2 = this;
|
|
6498
|
-
if (result2.__filtered__ && (start > 0 || end < 0)) {
|
|
6499
|
-
return new LazyWrapper(result2);
|
|
6500
|
-
}
|
|
6501
|
-
if (start < 0) {
|
|
6502
|
-
result2 = result2.takeRight(-start);
|
|
6503
|
-
} else if (start) {
|
|
6504
|
-
result2 = result2.drop(start);
|
|
6505
|
-
}
|
|
6506
|
-
if (end !== undefined$1) {
|
|
6507
|
-
end = toInteger(end);
|
|
6508
|
-
result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
|
|
6509
|
-
}
|
|
6510
|
-
return result2;
|
|
6511
|
-
};
|
|
6512
|
-
LazyWrapper.prototype.takeRightWhile = function(predicate) {
|
|
6513
|
-
return this.reverse().takeWhile(predicate).reverse();
|
|
6514
|
-
};
|
|
6515
|
-
LazyWrapper.prototype.toArray = function() {
|
|
6516
|
-
return this.take(MAX_ARRAY_LENGTH);
|
|
6517
|
-
};
|
|
6518
|
-
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
6519
|
-
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
|
|
6520
|
-
if (!lodashFunc) {
|
|
6521
|
-
return;
|
|
6522
|
-
}
|
|
6523
|
-
lodash2.prototype[methodName] = function() {
|
|
6524
|
-
var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
|
|
6525
|
-
var interceptor = function(value2) {
|
|
6526
|
-
var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args));
|
|
6527
|
-
return isTaker && chainAll ? result3[0] : result3;
|
|
6528
|
-
};
|
|
6529
|
-
if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
|
|
6530
|
-
isLazy = useLazy = false;
|
|
6531
|
-
}
|
|
6532
|
-
var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
|
|
6533
|
-
if (!retUnwrapped && useLazy) {
|
|
6534
|
-
value = onlyLazy ? value : new LazyWrapper(this);
|
|
6535
|
-
var result2 = func.apply(value, args);
|
|
6536
|
-
result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
|
|
6537
|
-
return new LodashWrapper(result2, chainAll);
|
|
6538
|
-
}
|
|
6539
|
-
if (isUnwrapped && onlyLazy) {
|
|
6540
|
-
return func.apply(this, args);
|
|
6541
|
-
}
|
|
6542
|
-
result2 = this.thru(interceptor);
|
|
6543
|
-
return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
|
|
6544
|
-
};
|
|
6545
|
-
});
|
|
6546
|
-
arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
|
|
6547
|
-
var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
6548
|
-
lodash2.prototype[methodName] = function() {
|
|
6549
|
-
var args = arguments;
|
|
6550
|
-
if (retUnwrapped && !this.__chain__) {
|
|
6551
|
-
var value = this.value();
|
|
6552
|
-
return func.apply(isArray(value) ? value : [], args);
|
|
6672
|
+
"type": methodName + (result2.__dir__ < 0 ? "Right" : "")
|
|
6673
|
+
});
|
|
6553
6674
|
}
|
|
6554
|
-
return
|
|
6555
|
-
|
|
6556
|
-
|
|
6675
|
+
return result2;
|
|
6676
|
+
};
|
|
6677
|
+
LazyWrapper.prototype[methodName + "Right"] = function(n) {
|
|
6678
|
+
return this.reverse()[methodName](n).reverse();
|
|
6557
6679
|
};
|
|
6558
6680
|
});
|
|
6559
|
-
|
|
6560
|
-
var
|
|
6561
|
-
|
|
6562
|
-
var
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
|
|
6570
|
-
"name": "wrapper",
|
|
6571
|
-
"func": undefined$1
|
|
6572
|
-
}];
|
|
6573
|
-
LazyWrapper.prototype.clone = lazyClone;
|
|
6574
|
-
LazyWrapper.prototype.reverse = lazyReverse;
|
|
6575
|
-
LazyWrapper.prototype.value = lazyValue;
|
|
6576
|
-
lodash2.prototype.at = wrapperAt;
|
|
6577
|
-
lodash2.prototype.chain = wrapperChain;
|
|
6578
|
-
lodash2.prototype.commit = wrapperCommit;
|
|
6579
|
-
lodash2.prototype.next = wrapperNext;
|
|
6580
|
-
lodash2.prototype.plant = wrapperPlant;
|
|
6581
|
-
lodash2.prototype.reverse = wrapperReverse;
|
|
6582
|
-
lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
|
|
6583
|
-
lodash2.prototype.first = lodash2.prototype.head;
|
|
6584
|
-
if (symIterator) {
|
|
6585
|
-
lodash2.prototype[symIterator] = wrapperToIterator;
|
|
6586
|
-
}
|
|
6587
|
-
return lodash2;
|
|
6588
|
-
};
|
|
6589
|
-
var _ = runInContext();
|
|
6590
|
-
if (freeModule) {
|
|
6591
|
-
(freeModule.exports = _)._ = _;
|
|
6592
|
-
freeExports._ = _;
|
|
6593
|
-
} else {
|
|
6594
|
-
root._ = _;
|
|
6595
|
-
}
|
|
6596
|
-
}).call(commonjsGlobal);
|
|
6597
|
-
})(lodash, lodash.exports);
|
|
6598
|
-
var lodashExports = lodash.exports;
|
|
6599
|
-
function generateValueFromSchema(schema, options) {
|
|
6600
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
6601
|
-
const { generateValue } = options;
|
|
6602
|
-
if (!schema) {
|
|
6603
|
-
return {};
|
|
6604
|
-
}
|
|
6605
|
-
switch (true) {
|
|
6606
|
-
case (schema.type === "string" && "enum" in schema && Boolean((_a = schema.enum) == null ? void 0 : _a.length)):
|
|
6607
|
-
return (generateValue == null ? void 0 : generateValue(schema)) || ((_b = schema.enum) == null ? void 0 : _b[0]);
|
|
6608
|
-
case schema.type === "string":
|
|
6609
|
-
return (generateValue == null ? void 0 : generateValue(schema)) || "";
|
|
6610
|
-
case schema.type === "boolean":
|
|
6611
|
-
return (generateValue == null ? void 0 : generateValue(schema)) || false;
|
|
6612
|
-
case schema.type === "array":
|
|
6613
|
-
if (!schema.minItems || !schema.items || typeof schema.items === "boolean" || Array.isArray(schema.items)) {
|
|
6614
|
-
return (generateValue == null ? void 0 : generateValue(schema)) || [];
|
|
6615
|
-
}
|
|
6616
|
-
return new Array(schema.minItems).fill(
|
|
6617
|
-
generateValueFromSchema(schema.items, options)
|
|
6618
|
-
);
|
|
6619
|
-
case schema.type === "number":
|
|
6620
|
-
case schema.type === "integer":
|
|
6621
|
-
return (generateValue == null ? void 0 : generateValue(schema)) || 0;
|
|
6622
|
-
case schema.type === "object": {
|
|
6623
|
-
const obj = {};
|
|
6624
|
-
for (const key in schema.properties) {
|
|
6625
|
-
obj[key] = generateValueFromSchema(
|
|
6626
|
-
schema.properties[key],
|
|
6627
|
-
options
|
|
6628
|
-
);
|
|
6629
|
-
}
|
|
6630
|
-
return obj;
|
|
6631
|
-
}
|
|
6632
|
-
case (Array.isArray(schema.type) && "anyOf" in schema && Boolean((_c = schema.anyOf) == null ? void 0 : _c.length)):
|
|
6633
|
-
case (Array.isArray(schema.type) && "oneOf" in schema && Boolean((_d = schema.oneOf) == null ? void 0 : _d.length)): {
|
|
6634
|
-
const subSchema = (_e = schema.anyOf || schema.oneOf) == null ? void 0 : _e[0];
|
|
6635
|
-
return generateValueFromSchema(subSchema, options);
|
|
6636
|
-
}
|
|
6637
|
-
case ("allOf" in schema && Boolean((_f = schema.allOf) == null ? void 0 : _f.length)):
|
|
6638
|
-
return generateValueFromSchema((_g = schema.allOf) == null ? void 0 : _g[0], options);
|
|
6639
|
-
default:
|
|
6640
|
-
return void 0;
|
|
6641
|
-
}
|
|
6642
|
-
}
|
|
6643
|
-
function generateSchemaTypeValue(schema) {
|
|
6644
|
-
return generateValueFromSchema(schema, {
|
|
6645
|
-
generateValue(schema2) {
|
|
6646
|
-
if (schema2.type === "array" && schema2.items) {
|
|
6647
|
-
return generateSchemaTypeValue(schema2.items);
|
|
6648
|
-
} else {
|
|
6649
|
-
return schema2.type;
|
|
6650
|
-
}
|
|
6651
|
-
}
|
|
6652
|
-
});
|
|
6653
|
-
}
|
|
6654
|
-
function resolveRef(schema, schemas, options) {
|
|
6655
|
-
var _a, _b;
|
|
6656
|
-
const { prune } = options;
|
|
6657
|
-
if (schema.$ref) {
|
|
6658
|
-
const refKey = schema.$ref.replace("#/components/schemas/", "");
|
|
6659
|
-
Object.assign(schema, schemas[refKey]);
|
|
6660
|
-
if (prune.metadata && [
|
|
6661
|
-
"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta",
|
|
6662
|
-
"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
|
|
6663
|
-
].some((k) => refKey.includes(k)) && schema.properties) {
|
|
6664
|
-
schema.properties = lodashExports.pick(schema.properties, [
|
|
6665
|
-
"name",
|
|
6666
|
-
"namespace",
|
|
6667
|
-
"annotations",
|
|
6668
|
-
"labels"
|
|
6669
|
-
]);
|
|
6670
|
-
}
|
|
6671
|
-
delete schema.$ref;
|
|
6672
|
-
}
|
|
6673
|
-
for (const schemaKey in schema) {
|
|
6674
|
-
if (prune.xProperty && schemaKey.startsWith("x-") && schemaKey !== "x-kubernetes-group-version-kind") {
|
|
6675
|
-
delete schema[schemaKey];
|
|
6676
|
-
}
|
|
6677
|
-
}
|
|
6678
|
-
switch (true) {
|
|
6679
|
-
case schema.type === "array":
|
|
6680
|
-
if (Array.isArray(schema.items)) {
|
|
6681
|
-
schema.items.forEach((item) => resolveRef(item, schemas, options));
|
|
6682
|
-
} else if (typeof schema.items === "object") {
|
|
6683
|
-
resolveRef(schema.items, schemas, options);
|
|
6684
|
-
}
|
|
6685
|
-
break;
|
|
6686
|
-
case schema.type === "object":
|
|
6687
|
-
for (const key in schema.properties) {
|
|
6688
|
-
const subSchema = schema.properties[key];
|
|
6689
|
-
if (prune.optional && !((_a = schema.required) == null ? void 0 : _a.includes(key))) {
|
|
6690
|
-
delete schema.properties[key];
|
|
6691
|
-
}
|
|
6692
|
-
if (prune.fields.includes(key)) {
|
|
6693
|
-
delete schema.properties[key];
|
|
6694
|
-
}
|
|
6695
|
-
resolveRef(subSchema, schemas, options);
|
|
6696
|
-
}
|
|
6697
|
-
if (schema.additionalProperties) {
|
|
6698
|
-
resolveRef(schema.additionalProperties, schemas, options);
|
|
6699
|
-
}
|
|
6700
|
-
break;
|
|
6701
|
-
case !!(schema.allOf && schema.allOf[0]):
|
|
6702
|
-
resolveRef((_b = schema.allOf) == null ? void 0 : _b[0], schemas, options);
|
|
6703
|
-
}
|
|
6704
|
-
if (prune.description) {
|
|
6705
|
-
delete schema.description;
|
|
6706
|
-
}
|
|
6707
|
-
return schema;
|
|
6708
|
-
}
|
|
6709
|
-
class K8sOpenAPI {
|
|
6710
|
-
constructor(resourceBasePath) {
|
|
6711
|
-
__publicField(this, "response", null);
|
|
6712
|
-
__publicField(this, "apiVersion");
|
|
6713
|
-
this.resourceBasePath = resourceBasePath;
|
|
6714
|
-
this.apiVersion = getApiVersion(resourceBasePath);
|
|
6715
|
-
}
|
|
6716
|
-
async fetch() {
|
|
6717
|
-
const response = await fetch(
|
|
6718
|
-
`/api/sks/api/v1/clusters/sks-mgmt/proxy/openapi/v3${this.resourceBasePath}`
|
|
6719
|
-
);
|
|
6720
|
-
return response.json();
|
|
6721
|
-
}
|
|
6722
|
-
async findSchema(kind) {
|
|
6723
|
-
const result = this.response || await this.fetch();
|
|
6724
|
-
const schema = Object.values(result.components.schemas).find(
|
|
6725
|
-
(schema2) => {
|
|
6726
|
-
var _a;
|
|
6727
|
-
return (_a = schema2["x-kubernetes-group-version-kind"]) == null ? void 0 : _a.some(
|
|
6728
|
-
({ kind: schemaKind, version: schemaVersion, group: schemaGroup }) => kind === schemaKind && this.apiVersion === `${schemaGroup ? schemaGroup + "/" : ""}${schemaVersion}`
|
|
6729
|
-
);
|
|
6730
|
-
}
|
|
6731
|
-
);
|
|
6732
|
-
if (schema) {
|
|
6733
|
-
resolveRef(schema, result.components.schemas, {
|
|
6734
|
-
prune: {
|
|
6735
|
-
description: true,
|
|
6736
|
-
optional: false,
|
|
6737
|
-
fields: [],
|
|
6738
|
-
metadata: true,
|
|
6739
|
-
xProperty: true
|
|
6740
|
-
}
|
|
6741
|
-
});
|
|
6742
|
-
}
|
|
6743
|
-
return schema;
|
|
6744
|
-
}
|
|
6745
|
-
}
|
|
6746
|
-
function useSchema(options) {
|
|
6747
|
-
var _a;
|
|
6748
|
-
const [schema, setSchema] = React.useState(null);
|
|
6749
|
-
const [loading, setLoading] = React.useState(false);
|
|
6750
|
-
const [error, setError] = React.useState(null);
|
|
6751
|
-
const useResourceResult = core.useResource();
|
|
6752
|
-
const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
|
|
6753
|
-
const openapi = React.useMemo(
|
|
6754
|
-
() => {
|
|
6755
|
-
var _a2;
|
|
6756
|
-
return new K8sOpenAPI((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath);
|
|
6757
|
-
},
|
|
6758
|
-
[(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath]
|
|
6759
|
-
);
|
|
6760
|
-
const fetchSchema = React.useCallback(async () => {
|
|
6761
|
-
var _a2;
|
|
6762
|
-
setLoading(true);
|
|
6763
|
-
setError(null);
|
|
6764
|
-
try {
|
|
6765
|
-
const schema2 = await openapi.findSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.kind);
|
|
6766
|
-
setSchema(schema2 || null);
|
|
6767
|
-
setError(null);
|
|
6768
|
-
} catch (e) {
|
|
6769
|
-
setError(e);
|
|
6770
|
-
} finally {
|
|
6771
|
-
setLoading(false);
|
|
6772
|
-
}
|
|
6773
|
-
}, [resource, openapi]);
|
|
6774
|
-
React.useEffect(() => {
|
|
6775
|
-
if (options == null ? void 0 : options.skip)
|
|
6776
|
-
return;
|
|
6777
|
-
fetchSchema();
|
|
6778
|
-
}, [fetchSchema]);
|
|
6779
|
-
return {
|
|
6780
|
-
schema,
|
|
6781
|
-
loading,
|
|
6782
|
-
error,
|
|
6783
|
-
fetchSchema
|
|
6784
|
-
};
|
|
6785
|
-
}
|
|
6786
|
-
function generateYamlBySchema(defaultValue, schema) {
|
|
6787
|
-
const typeObject = generateSchemaTypeValue(schema);
|
|
6788
|
-
function makeAnnotations(obj, key) {
|
|
6789
|
-
const result = {};
|
|
6790
|
-
if (lodashEs.isObject(obj[key])) {
|
|
6791
|
-
result[`#${key}`] = {};
|
|
6792
|
-
Object.keys(obj[key]).forEach((prop) => {
|
|
6793
|
-
result[`#${key}`] = {
|
|
6794
|
-
...result[`#${key}`],
|
|
6795
|
-
...makeAnnotations(obj[key], prop)
|
|
6681
|
+
arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
|
|
6682
|
+
var type2 = index + 1, isFilter = type2 == LAZY_FILTER_FLAG || type2 == LAZY_WHILE_FLAG;
|
|
6683
|
+
LazyWrapper.prototype[methodName] = function(iteratee2) {
|
|
6684
|
+
var result2 = this.clone();
|
|
6685
|
+
result2.__iteratees__.push({
|
|
6686
|
+
"iteratee": getIteratee(iteratee2, 3),
|
|
6687
|
+
"type": type2
|
|
6688
|
+
});
|
|
6689
|
+
result2.__filtered__ = result2.__filtered__ || isFilter;
|
|
6690
|
+
return result2;
|
|
6796
6691
|
};
|
|
6797
6692
|
});
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
}
|
|
6803
|
-
function merge(obj1, obj2, merged2 = {}) {
|
|
6804
|
-
for (const key in obj1) {
|
|
6805
|
-
merged2[key] = obj1[key];
|
|
6806
|
-
}
|
|
6807
|
-
for (const key in obj2) {
|
|
6808
|
-
if (key in obj1) {
|
|
6809
|
-
if (lodashEs.isObject(obj2[key]) && lodashEs.isObject(obj1[key])) {
|
|
6810
|
-
merged2[key] = merge(
|
|
6811
|
-
obj1[key],
|
|
6812
|
-
obj2[key]
|
|
6813
|
-
);
|
|
6814
|
-
}
|
|
6815
|
-
} else {
|
|
6816
|
-
merged2 = {
|
|
6817
|
-
...merged2,
|
|
6818
|
-
...makeAnnotations(obj2, key)
|
|
6693
|
+
arrayEach(["head", "last"], function(methodName, index) {
|
|
6694
|
+
var takeName = "take" + (index ? "Right" : "");
|
|
6695
|
+
LazyWrapper.prototype[methodName] = function() {
|
|
6696
|
+
return this[takeName](1).value()[0];
|
|
6819
6697
|
};
|
|
6820
|
-
}
|
|
6821
|
-
}
|
|
6822
|
-
return merged2;
|
|
6823
|
-
}
|
|
6824
|
-
const merged = merge(defaultValue, typeObject);
|
|
6825
|
-
const content = yaml.dump(merged);
|
|
6826
|
-
return content.replace(/(')(#.+?)(')/g, "$2").replace(/( +)(#)/g, "$2$1");
|
|
6827
|
-
}
|
|
6828
|
-
const GlobalStoreContext = React.createContext({});
|
|
6829
|
-
const useGlobalStore = () => {
|
|
6830
|
-
return React.useContext(GlobalStoreContext);
|
|
6831
|
-
};
|
|
6832
|
-
const useEagleForm = ({
|
|
6833
|
-
action,
|
|
6834
|
-
resource,
|
|
6835
|
-
onMutationSuccess: onMutationSuccessProp,
|
|
6836
|
-
onMutationError,
|
|
6837
|
-
submitOnEnter = false,
|
|
6838
|
-
warnWhenUnsavedChanges: warnWhenUnsavedChangesProp,
|
|
6839
|
-
redirect,
|
|
6840
|
-
successNotification,
|
|
6841
|
-
errorNotification,
|
|
6842
|
-
meta,
|
|
6843
|
-
metaData,
|
|
6844
|
-
queryMeta,
|
|
6845
|
-
mutationMeta,
|
|
6846
|
-
liveMode,
|
|
6847
|
-
liveParams,
|
|
6848
|
-
mutationMode,
|
|
6849
|
-
dataProviderName,
|
|
6850
|
-
onLiveEvent,
|
|
6851
|
-
invalidates,
|
|
6852
|
-
undoableTimeout,
|
|
6853
|
-
queryOptions,
|
|
6854
|
-
createMutationOptions,
|
|
6855
|
-
updateMutationOptions,
|
|
6856
|
-
id: idFromProps,
|
|
6857
|
-
overtimeOptions,
|
|
6858
|
-
editorOptions,
|
|
6859
|
-
initialValuesForCreate
|
|
6860
|
-
} = {}) => {
|
|
6861
|
-
var _a, _b, _c;
|
|
6862
|
-
const editor = React.useRef(null);
|
|
6863
|
-
const isFoldRef = React.useRef(false);
|
|
6864
|
-
const { t } = useTranslation();
|
|
6865
|
-
const [enableEditor, setEnableEditor] = React.useState(false);
|
|
6866
|
-
const [isYamlValid, setIsYamlValid] = React.useState(true);
|
|
6867
|
-
const [isSchemaValid, setIsSchemaValid] = React.useState(true);
|
|
6868
|
-
const [editorErrors, setEditorErrors] = React.useState([]);
|
|
6869
|
-
const [errorResponseBody, setErrorResponseBody] = React.useState(null);
|
|
6870
|
-
const useResourceResult = core.useResource();
|
|
6871
|
-
const { globalStore } = useGlobalStore();
|
|
6872
|
-
const kit = eagle.useUIKit();
|
|
6873
|
-
const {
|
|
6874
|
-
schema,
|
|
6875
|
-
loading: isLoadingSchema,
|
|
6876
|
-
error: loadSchemaError,
|
|
6877
|
-
fetchSchema
|
|
6878
|
-
} = useSchema({
|
|
6879
|
-
skip: editorOptions == null ? void 0 : editorOptions.isSkipSchema
|
|
6880
|
-
});
|
|
6881
|
-
const [formAnt] = kit.form.useForm();
|
|
6882
|
-
const formSF = sunflowerAntd.useForm({
|
|
6883
|
-
form: formAnt
|
|
6884
|
-
});
|
|
6885
|
-
const { form } = formSF;
|
|
6886
|
-
const { fold: fold2 } = useK8sYamlEditor();
|
|
6887
|
-
const useFormCoreResult = core.useForm({
|
|
6888
|
-
onMutationSuccess: onMutationSuccessProp ? onMutationSuccessProp : void 0,
|
|
6889
|
-
onMutationError,
|
|
6890
|
-
redirect,
|
|
6891
|
-
action,
|
|
6892
|
-
resource,
|
|
6893
|
-
successNotification,
|
|
6894
|
-
errorNotification,
|
|
6895
|
-
meta: core.pickNotDeprecated(meta, metaData),
|
|
6896
|
-
metaData: core.pickNotDeprecated(meta, metaData),
|
|
6897
|
-
queryMeta,
|
|
6898
|
-
mutationMeta,
|
|
6899
|
-
liveMode,
|
|
6900
|
-
liveParams,
|
|
6901
|
-
mutationMode,
|
|
6902
|
-
dataProviderName,
|
|
6903
|
-
onLiveEvent,
|
|
6904
|
-
invalidates,
|
|
6905
|
-
undoableTimeout,
|
|
6906
|
-
queryOptions,
|
|
6907
|
-
createMutationOptions,
|
|
6908
|
-
updateMutationOptions,
|
|
6909
|
-
id: idFromProps,
|
|
6910
|
-
overtimeOptions
|
|
6911
|
-
});
|
|
6912
|
-
const { formLoading, onFinish, queryResult, id } = useFormCoreResult;
|
|
6913
|
-
const { warnWhenUnsavedChanges: warnWhenUnsavedChangesRefine, setWarnWhen } = core.useWarnAboutChange();
|
|
6914
|
-
const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp ?? warnWhenUnsavedChangesRefine;
|
|
6915
|
-
const initialValues = React.useMemo(() => {
|
|
6916
|
-
var _a2;
|
|
6917
|
-
const initialValues2 = ((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) ? globalStore == null ? void 0 : globalStore.restoreItem(queryResult.data.data) : initialValuesForCreate;
|
|
6918
|
-
if (initialValues2) {
|
|
6919
|
-
pruneBeforeEdit(initialValues2);
|
|
6920
|
-
}
|
|
6921
|
-
return initialValues2;
|
|
6922
|
-
}, [queryResult, globalStore, initialValuesForCreate]);
|
|
6923
|
-
React.useEffect(() => {
|
|
6924
|
-
var _a2;
|
|
6925
|
-
form.resetFields();
|
|
6926
|
-
if (editor.current) {
|
|
6927
|
-
const editorValue = yaml.dump(initialValues);
|
|
6928
|
-
const editorInstance = editor.current.getEditorInstance();
|
|
6929
|
-
editor.current.setEditorValue(editorValue);
|
|
6930
|
-
editor.current.setValue(editorValue);
|
|
6931
|
-
if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
|
|
6932
|
-
fold2(editorInstance);
|
|
6933
|
-
isFoldRef.current = true;
|
|
6934
|
-
}
|
|
6935
|
-
}
|
|
6936
|
-
}, [initialValues, (_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, form, fold2]);
|
|
6937
|
-
React.useEffect(() => {
|
|
6938
|
-
var _a2, _b2;
|
|
6939
|
-
const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
|
|
6940
|
-
if (response && !(response == null ? void 0 : response.bodyUsed)) {
|
|
6941
|
-
(_b2 = response.json) == null ? void 0 : _b2.call(response).then((body) => {
|
|
6942
|
-
setErrorResponseBody(body);
|
|
6943
6698
|
});
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
}), [formLoading, form]);
|
|
6963
|
-
const editorProps = React.useMemo(() => {
|
|
6964
|
-
var _a2;
|
|
6965
|
-
return {
|
|
6966
|
-
ref: editor,
|
|
6967
|
-
defaultValue: schema && (editorOptions == null ? void 0 : editorOptions.isGenerateAnnotations) ? generateYamlBySchema(initialValues || {}, schema) : yaml.dump(initialValues),
|
|
6968
|
-
schema,
|
|
6969
|
-
id: ((_a2 = useResourceResult.resource) == null ? void 0 : _a2.name) || "",
|
|
6970
|
-
errorMsgs: editorErrors,
|
|
6971
|
-
onValidate(yamlValid, schemaValid) {
|
|
6972
|
-
setIsYamlValid(yamlValid);
|
|
6973
|
-
setIsSchemaValid(schemaValid);
|
|
6974
|
-
if (yamlValid && schemaValid) {
|
|
6975
|
-
setEditorErrors([]);
|
|
6699
|
+
arrayEach(["initial", "tail"], function(methodName, index) {
|
|
6700
|
+
var dropName = "drop" + (index ? "" : "Right");
|
|
6701
|
+
LazyWrapper.prototype[methodName] = function() {
|
|
6702
|
+
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
|
|
6703
|
+
};
|
|
6704
|
+
});
|
|
6705
|
+
LazyWrapper.prototype.compact = function() {
|
|
6706
|
+
return this.filter(identity);
|
|
6707
|
+
};
|
|
6708
|
+
LazyWrapper.prototype.find = function(predicate) {
|
|
6709
|
+
return this.filter(predicate).head();
|
|
6710
|
+
};
|
|
6711
|
+
LazyWrapper.prototype.findLast = function(predicate) {
|
|
6712
|
+
return this.reverse().find(predicate);
|
|
6713
|
+
};
|
|
6714
|
+
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
|
|
6715
|
+
if (typeof path == "function") {
|
|
6716
|
+
return new LazyWrapper(this);
|
|
6976
6717
|
}
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6718
|
+
return this.map(function(value) {
|
|
6719
|
+
return baseInvoke(value, path, args);
|
|
6720
|
+
});
|
|
6721
|
+
});
|
|
6722
|
+
LazyWrapper.prototype.reject = function(predicate) {
|
|
6723
|
+
return this.filter(negate(getIteratee(predicate)));
|
|
6724
|
+
};
|
|
6725
|
+
LazyWrapper.prototype.slice = function(start, end) {
|
|
6726
|
+
start = toInteger(start);
|
|
6727
|
+
var result2 = this;
|
|
6728
|
+
if (result2.__filtered__ && (start > 0 || end < 0)) {
|
|
6729
|
+
return new LazyWrapper(result2);
|
|
6730
|
+
}
|
|
6731
|
+
if (start < 0) {
|
|
6732
|
+
result2 = result2.takeRight(-start);
|
|
6733
|
+
} else if (start) {
|
|
6734
|
+
result2 = result2.drop(start);
|
|
6735
|
+
}
|
|
6736
|
+
if (end !== undefined$1) {
|
|
6737
|
+
end = toInteger(end);
|
|
6738
|
+
result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
|
|
6739
|
+
}
|
|
6740
|
+
return result2;
|
|
6741
|
+
};
|
|
6742
|
+
LazyWrapper.prototype.takeRightWhile = function(predicate) {
|
|
6743
|
+
return this.reverse().takeWhile(predicate).reverse();
|
|
6744
|
+
};
|
|
6745
|
+
LazyWrapper.prototype.toArray = function() {
|
|
6746
|
+
return this.take(MAX_ARRAY_LENGTH);
|
|
6747
|
+
};
|
|
6748
|
+
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
6749
|
+
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
|
|
6750
|
+
if (!lodashFunc) {
|
|
6751
|
+
return;
|
|
6752
|
+
}
|
|
6753
|
+
lodash2.prototype[methodName] = function() {
|
|
6754
|
+
var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
|
|
6755
|
+
var interceptor = function(value2) {
|
|
6756
|
+
var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args));
|
|
6757
|
+
return isTaker && chainAll ? result3[0] : result3;
|
|
6758
|
+
};
|
|
6759
|
+
if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
|
|
6760
|
+
isLazy = useLazy = false;
|
|
6761
|
+
}
|
|
6762
|
+
var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
|
|
6763
|
+
if (!retUnwrapped && useLazy) {
|
|
6764
|
+
value = onlyLazy ? value : new LazyWrapper(this);
|
|
6765
|
+
var result2 = func.apply(value, args);
|
|
6766
|
+
result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
|
|
6767
|
+
return new LodashWrapper(result2, chainAll);
|
|
6768
|
+
}
|
|
6769
|
+
if (isUnwrapped && onlyLazy) {
|
|
6770
|
+
return func.apply(this, args);
|
|
6771
|
+
}
|
|
6772
|
+
result2 = this.thru(interceptor);
|
|
6773
|
+
return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
|
|
6774
|
+
};
|
|
6775
|
+
});
|
|
6776
|
+
arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
|
|
6777
|
+
var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
6778
|
+
lodash2.prototype[methodName] = function() {
|
|
6779
|
+
var args = arguments;
|
|
6780
|
+
if (retUnwrapped && !this.__chain__) {
|
|
6781
|
+
var value = this.value();
|
|
6782
|
+
return func.apply(isArray(value) ? value : [], args);
|
|
6783
|
+
}
|
|
6784
|
+
return this[chainName](function(value2) {
|
|
6785
|
+
return func.apply(isArray(value2) ? value2 : [], args);
|
|
6786
|
+
});
|
|
6787
|
+
};
|
|
6788
|
+
});
|
|
6789
|
+
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
6790
|
+
var lodashFunc = lodash2[methodName];
|
|
6791
|
+
if (lodashFunc) {
|
|
6792
|
+
var key = lodashFunc.name + "";
|
|
6793
|
+
if (!hasOwnProperty.call(realNames, key)) {
|
|
6794
|
+
realNames[key] = [];
|
|
6795
|
+
}
|
|
6796
|
+
realNames[key].push({ "name": methodName, "func": lodashFunc });
|
|
6983
6797
|
}
|
|
6798
|
+
});
|
|
6799
|
+
realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
|
|
6800
|
+
"name": "wrapper",
|
|
6801
|
+
"func": undefined$1
|
|
6802
|
+
}];
|
|
6803
|
+
LazyWrapper.prototype.clone = lazyClone;
|
|
6804
|
+
LazyWrapper.prototype.reverse = lazyReverse;
|
|
6805
|
+
LazyWrapper.prototype.value = lazyValue;
|
|
6806
|
+
lodash2.prototype.at = wrapperAt;
|
|
6807
|
+
lodash2.prototype.chain = wrapperChain;
|
|
6808
|
+
lodash2.prototype.commit = wrapperCommit;
|
|
6809
|
+
lodash2.prototype.next = wrapperNext;
|
|
6810
|
+
lodash2.prototype.plant = wrapperPlant;
|
|
6811
|
+
lodash2.prototype.reverse = wrapperReverse;
|
|
6812
|
+
lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
|
|
6813
|
+
lodash2.prototype.first = lodash2.prototype.head;
|
|
6814
|
+
if (symIterator) {
|
|
6815
|
+
lodash2.prototype[symIterator] = wrapperToIterator;
|
|
6984
6816
|
}
|
|
6817
|
+
return lodash2;
|
|
6985
6818
|
};
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
var _a2;
|
|
6993
|
-
const errors = [
|
|
6994
|
-
!isYamlValid ? t("dovetail.yaml_format_wrong") : "",
|
|
6995
|
-
!isSchemaValid ? t("dovetail.yaml_value_wrong") : ""
|
|
6996
|
-
].filter((error) => !!error);
|
|
6997
|
-
if (errors.length) {
|
|
6998
|
-
setEditorErrors(errors);
|
|
6999
|
-
return;
|
|
7000
|
-
}
|
|
7001
|
-
const finalValues = editor.current ? yaml.load(((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue()) || "") : values;
|
|
7002
|
-
return onFinish(finalValues);
|
|
7003
|
-
},
|
|
7004
|
-
onKeyUp,
|
|
7005
|
-
onValuesChange,
|
|
7006
|
-
initialValues
|
|
7007
|
-
},
|
|
7008
|
-
saveButtonProps,
|
|
7009
|
-
...useFormCoreResult,
|
|
7010
|
-
editorProps,
|
|
7011
|
-
enableEditor,
|
|
7012
|
-
errorResponseBody,
|
|
7013
|
-
schema,
|
|
7014
|
-
isLoadingSchema,
|
|
7015
|
-
loadSchemaError,
|
|
7016
|
-
fetchSchema,
|
|
7017
|
-
switchEditor() {
|
|
7018
|
-
var _a2, _b2;
|
|
7019
|
-
if (enableEditor && ((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue())) {
|
|
7020
|
-
const value = yaml.load((_b2 = editor.current) == null ? void 0 : _b2.getEditorValue());
|
|
7021
|
-
form == null ? void 0 : form.setFieldsValue(value);
|
|
7022
|
-
}
|
|
7023
|
-
setEnableEditor(!enableEditor);
|
|
7024
|
-
},
|
|
7025
|
-
onFinish: async (values) => {
|
|
7026
|
-
var _a2;
|
|
7027
|
-
const finalValues = enableEditor ? yaml.load(((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue()) || "") : values ?? formSF.form.getFieldsValue(true);
|
|
7028
|
-
return await onFinish(finalValues);
|
|
7029
|
-
}
|
|
7030
|
-
};
|
|
7031
|
-
};
|
|
7032
|
-
const useDeleteModal = (resource) => {
|
|
7033
|
-
const { mutate } = core.useDelete();
|
|
7034
|
-
const [visible, setVisible] = React.useState(false);
|
|
7035
|
-
const navigation = core.useNavigation();
|
|
7036
|
-
const [id, setId] = React.useState("");
|
|
7037
|
-
const { t } = useTranslation();
|
|
7038
|
-
const modalProps = {
|
|
7039
|
-
title: t("dovetail.delete"),
|
|
7040
|
-
okText: t("dovetail.delete"),
|
|
7041
|
-
okButtonProps: {
|
|
7042
|
-
danger: true
|
|
7043
|
-
},
|
|
7044
|
-
cancelText: t("dovetail.cancel"),
|
|
7045
|
-
children: t("dovetail.confirm_delete_text", {
|
|
7046
|
-
target: id,
|
|
7047
|
-
interpolation: { escapeValue: false }
|
|
7048
|
-
}),
|
|
7049
|
-
onOk() {
|
|
7050
|
-
mutate({
|
|
7051
|
-
resource,
|
|
7052
|
-
id
|
|
7053
|
-
});
|
|
7054
|
-
setVisible(false);
|
|
7055
|
-
navigation.list(resource);
|
|
7056
|
-
},
|
|
7057
|
-
onCancel() {
|
|
7058
|
-
setVisible(false);
|
|
6819
|
+
var _ = runInContext();
|
|
6820
|
+
if (freeModule) {
|
|
6821
|
+
(freeModule.exports = _)._ = _;
|
|
6822
|
+
freeExports._ = _;
|
|
6823
|
+
} else {
|
|
6824
|
+
root._ = _;
|
|
7059
6825
|
}
|
|
7060
|
-
};
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
6826
|
+
}).call(commonjsGlobal);
|
|
6827
|
+
})(lodash, lodash.exports);
|
|
6828
|
+
var lodashExports = lodash.exports;
|
|
6829
|
+
function generateValueFromSchema(schema, options) {
|
|
6830
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6831
|
+
const { generateValue } = options;
|
|
6832
|
+
if (!schema) {
|
|
6833
|
+
return {};
|
|
7064
6834
|
}
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
const [, keyHash] = className.split("_");
|
|
7076
|
-
atomicClasses[keyHash] = className;
|
|
7077
|
-
} else {
|
|
7078
|
-
nonAtomicClasses.push(className);
|
|
6835
|
+
switch (true) {
|
|
6836
|
+
case (schema.type === "string" && "enum" in schema && Boolean((_a = schema.enum) == null ? void 0 : _a.length)):
|
|
6837
|
+
return (generateValue == null ? void 0 : generateValue(schema)) || ((_b = schema.enum) == null ? void 0 : _b[0]);
|
|
6838
|
+
case schema.type === "string":
|
|
6839
|
+
return (generateValue == null ? void 0 : generateValue(schema)) || "";
|
|
6840
|
+
case schema.type === "boolean":
|
|
6841
|
+
return (generateValue == null ? void 0 : generateValue(schema)) || false;
|
|
6842
|
+
case schema.type === "array":
|
|
6843
|
+
if (!schema.minItems || !schema.items || typeof schema.items === "boolean" || Array.isArray(schema.items)) {
|
|
6844
|
+
return (generateValue == null ? void 0 : generateValue(schema)) || [];
|
|
7079
6845
|
}
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
6846
|
+
return new Array(schema.minItems).fill(
|
|
6847
|
+
generateValueFromSchema(schema.items, options)
|
|
6848
|
+
);
|
|
6849
|
+
case schema.type === "number":
|
|
6850
|
+
case schema.type === "integer":
|
|
6851
|
+
return (generateValue == null ? void 0 : generateValue(schema)) || 0;
|
|
6852
|
+
case schema.type === "object": {
|
|
6853
|
+
const obj = {};
|
|
6854
|
+
for (const key in schema.properties) {
|
|
6855
|
+
obj[key] = generateValueFromSchema(
|
|
6856
|
+
schema.properties[key],
|
|
6857
|
+
options
|
|
6858
|
+
);
|
|
6859
|
+
}
|
|
6860
|
+
return obj;
|
|
7086
6861
|
}
|
|
6862
|
+
case (Array.isArray(schema.type) && "anyOf" in schema && Boolean((_c = schema.anyOf) == null ? void 0 : _c.length)):
|
|
6863
|
+
case (Array.isArray(schema.type) && "oneOf" in schema && Boolean((_d = schema.oneOf) == null ? void 0 : _d.length)): {
|
|
6864
|
+
const subSchema = (_e = schema.anyOf || schema.oneOf) == null ? void 0 : _e[0];
|
|
6865
|
+
return generateValueFromSchema(subSchema, options);
|
|
6866
|
+
}
|
|
6867
|
+
case ("allOf" in schema && Boolean((_f = schema.allOf) == null ? void 0 : _f.length)):
|
|
6868
|
+
return generateValueFromSchema((_g = schema.allOf) == null ? void 0 : _g[0], options);
|
|
6869
|
+
default:
|
|
6870
|
+
return void 0;
|
|
7087
6871
|
}
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
} = core.useBreadcrumb();
|
|
7098
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
|
|
7099
|
-
className: cx_default(BreadcrumbStyle, props.className),
|
|
7100
|
-
children: breadcrumbs.map((breadcrumb) => {
|
|
7101
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
|
|
7102
|
-
className: "breadcrumb-item",
|
|
7103
|
-
children: breadcrumb.href ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Link, {
|
|
7104
|
-
to: breadcrumb.href,
|
|
7105
|
-
children: breadcrumb.label
|
|
7106
|
-
}) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
7107
|
-
children: breadcrumb.label
|
|
7108
|
-
})
|
|
7109
|
-
}, `breadcrumb-${breadcrumb.label}`);
|
|
7110
|
-
})
|
|
7111
|
-
});
|
|
7112
|
-
}
|
|
7113
|
-
function NameInputWidget(props) {
|
|
7114
|
-
const kit = eagle.useUIKit();
|
|
7115
|
-
const { action } = core.useResource();
|
|
7116
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { ...props, disabled: action === "edit" });
|
|
7117
|
-
}
|
|
7118
|
-
const dnsSubDomainRules = [
|
|
7119
|
-
{
|
|
7120
|
-
required: true,
|
|
7121
|
-
message: "名称不能为空"
|
|
7122
|
-
},
|
|
7123
|
-
{
|
|
7124
|
-
pattern: /^[a-z0-9]([-.a-z0-9]*[a-z0-9])?$/,
|
|
7125
|
-
message: "名称只能包含小写字母、数字,以及 '-' 和 '.',且必须以字母或数字开头和结束"
|
|
7126
|
-
},
|
|
7127
|
-
{
|
|
7128
|
-
max: 253,
|
|
7129
|
-
message: "名称长度不能超过253个字符"
|
|
7130
|
-
}
|
|
7131
|
-
];
|
|
7132
|
-
const rfc1123LabelRules = [
|
|
7133
|
-
{
|
|
7134
|
-
required: true,
|
|
7135
|
-
message: "名称不能为空"
|
|
7136
|
-
},
|
|
7137
|
-
{
|
|
7138
|
-
pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/,
|
|
7139
|
-
message: "名称只能包含小写字母、数字,以及 '-',且以字母或数字开头和结束"
|
|
7140
|
-
},
|
|
7141
|
-
{
|
|
7142
|
-
max: 63,
|
|
7143
|
-
message: "名称长度不能超过63个字符"
|
|
7144
|
-
}
|
|
7145
|
-
];
|
|
7146
|
-
const rfc1035LabelRules = [
|
|
7147
|
-
{
|
|
7148
|
-
required: true,
|
|
7149
|
-
message: "名称不能为空"
|
|
7150
|
-
},
|
|
7151
|
-
{
|
|
7152
|
-
pattern: /^[a-z]([-a-z0-9]*[a-z0-9])?$/,
|
|
7153
|
-
message: "名称只能包含小写字母、数字,以及 '-',且以字母开头,字母或数字结束"
|
|
7154
|
-
},
|
|
7155
|
-
{
|
|
7156
|
-
max: 63,
|
|
7157
|
-
message: "名称长度不能超过63个字符"
|
|
7158
|
-
}
|
|
7159
|
-
];
|
|
7160
|
-
function NamespaceSelectWidget(props) {
|
|
7161
|
-
const kit = eagle.useUIKit();
|
|
7162
|
-
const { action } = core.useResource();
|
|
7163
|
-
const { data: data2 } = core.useList({
|
|
7164
|
-
resource: "namespaces",
|
|
7165
|
-
meta: {
|
|
7166
|
-
resourceBasePath: "/api/v1",
|
|
7167
|
-
kind: "Namespace"
|
|
6872
|
+
}
|
|
6873
|
+
function generateSchemaTypeValue(schema) {
|
|
6874
|
+
return generateValueFromSchema(schema, {
|
|
6875
|
+
generateValue(schema2) {
|
|
6876
|
+
if (schema2.type === "array" && schema2.items) {
|
|
6877
|
+
return generateSchemaTypeValue(schema2.items);
|
|
6878
|
+
} else {
|
|
6879
|
+
return schema2.type;
|
|
6880
|
+
}
|
|
7168
6881
|
}
|
|
7169
6882
|
});
|
|
7170
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.select, { input: props, disabled: action === "edit", children: data2 == null ? void 0 : data2.data.map((namespace2) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: namespace2.metadata.name, children: namespace2.metadata.name }, namespace2.metadata.name)) });
|
|
7171
6883
|
}
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
6884
|
+
function resolveRef(schema, schemas, options) {
|
|
6885
|
+
var _a, _b;
|
|
6886
|
+
const { prune } = options;
|
|
6887
|
+
if (schema.$ref) {
|
|
6888
|
+
const refKey = schema.$ref.replace("#/components/schemas/", "");
|
|
6889
|
+
Object.assign(schema, schemas[refKey]);
|
|
6890
|
+
if (prune.metadata && [
|
|
6891
|
+
"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta",
|
|
6892
|
+
"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
|
|
6893
|
+
].some((k) => refKey.includes(k)) && schema.properties) {
|
|
6894
|
+
schema.properties = lodashExports.pick(schema.properties, [
|
|
6895
|
+
"name",
|
|
6896
|
+
"namespace",
|
|
6897
|
+
"annotations",
|
|
6898
|
+
"labels"
|
|
6899
|
+
]);
|
|
6900
|
+
}
|
|
6901
|
+
delete schema.$ref;
|
|
7176
6902
|
}
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
}
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
6903
|
+
for (const schemaKey in schema) {
|
|
6904
|
+
if (prune.xProperty && schemaKey.startsWith("x-") && schemaKey !== "x-kubernetes-group-version-kind") {
|
|
6905
|
+
delete schema[schemaKey];
|
|
6906
|
+
}
|
|
6907
|
+
}
|
|
6908
|
+
switch (true) {
|
|
6909
|
+
case schema.type === "array":
|
|
6910
|
+
if (Array.isArray(schema.items)) {
|
|
6911
|
+
schema.items.forEach((item) => resolveRef(item, schemas, options));
|
|
6912
|
+
} else if (typeof schema.items === "object") {
|
|
6913
|
+
resolveRef(schema.items, schemas, options);
|
|
6914
|
+
}
|
|
6915
|
+
break;
|
|
6916
|
+
case schema.type === "object":
|
|
6917
|
+
for (const key in schema.properties) {
|
|
6918
|
+
const subSchema = schema.properties[key];
|
|
6919
|
+
if (prune.optional && !((_a = schema.required) == null ? void 0 : _a.includes(key))) {
|
|
6920
|
+
delete schema.properties[key];
|
|
6921
|
+
}
|
|
6922
|
+
if (prune.fields.includes(key)) {
|
|
6923
|
+
delete schema.properties[key];
|
|
6924
|
+
}
|
|
6925
|
+
resolveRef(subSchema, schemas, options);
|
|
6926
|
+
}
|
|
6927
|
+
if (schema.additionalProperties) {
|
|
6928
|
+
resolveRef(schema.additionalProperties, schemas, options);
|
|
6929
|
+
}
|
|
6930
|
+
break;
|
|
6931
|
+
case !!(schema.allOf && schema.allOf[0]):
|
|
6932
|
+
resolveRef((_b = schema.allOf) == null ? void 0 : _b[0], schemas, options);
|
|
6933
|
+
}
|
|
6934
|
+
if (prune.description) {
|
|
6935
|
+
delete schema.description;
|
|
6936
|
+
}
|
|
6937
|
+
return schema;
|
|
6938
|
+
}
|
|
6939
|
+
class K8sOpenAPI {
|
|
6940
|
+
constructor(resourceBasePath) {
|
|
6941
|
+
__publicField(this, "response", null);
|
|
6942
|
+
__publicField(this, "apiVersion");
|
|
6943
|
+
this.resourceBasePath = resourceBasePath;
|
|
6944
|
+
this.apiVersion = getApiVersion(resourceBasePath);
|
|
6945
|
+
}
|
|
6946
|
+
async fetch() {
|
|
6947
|
+
const response = await fetch(
|
|
6948
|
+
`/api/sks/api/v1/clusters/sks-mgmt/proxy/openapi/v3${this.resourceBasePath}`
|
|
6949
|
+
);
|
|
6950
|
+
return response.json();
|
|
6951
|
+
}
|
|
6952
|
+
async findSchema(kind) {
|
|
6953
|
+
const result = this.response || await this.fetch();
|
|
6954
|
+
const schema = Object.values(result.components.schemas).find(
|
|
6955
|
+
(schema2) => {
|
|
6956
|
+
var _a;
|
|
6957
|
+
return (_a = schema2["x-kubernetes-group-version-kind"]) == null ? void 0 : _a.some(
|
|
6958
|
+
({ kind: schemaKind, version: schemaVersion, group: schemaGroup }) => kind === schemaKind && this.apiVersion === `${schemaGroup ? schemaGroup + "/" : ""}${schemaVersion}`
|
|
6959
|
+
);
|
|
6960
|
+
}
|
|
6961
|
+
);
|
|
6962
|
+
if (schema) {
|
|
6963
|
+
resolveRef(schema, result.components.schemas, {
|
|
6964
|
+
prune: {
|
|
6965
|
+
description: true,
|
|
6966
|
+
optional: false,
|
|
6967
|
+
fields: [],
|
|
6968
|
+
metadata: true,
|
|
6969
|
+
xProperty: true
|
|
6970
|
+
}
|
|
7199
6971
|
});
|
|
7200
|
-
}
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { children: [
|
|
7204
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { value: item.key, onChange: onKeyChange }),
|
|
7205
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.textArea, { value: item.value, onChange: onValueChange }),
|
|
7206
|
-
children
|
|
7207
|
-
] });
|
|
6972
|
+
}
|
|
6973
|
+
return schema;
|
|
6974
|
+
}
|
|
7208
6975
|
}
|
|
7209
|
-
function
|
|
7210
|
-
|
|
7211
|
-
const
|
|
7212
|
-
const
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
var _a;
|
|
7221
|
-
const newValue = newItems.reduce((result, item) => {
|
|
7222
|
-
result[item.key] = item.value;
|
|
7223
|
-
return result;
|
|
7224
|
-
}, {});
|
|
7225
|
-
(_a = props.onChange) == null ? void 0 : _a.call(props, newValue);
|
|
7226
|
-
},
|
|
7227
|
-
[props]
|
|
7228
|
-
);
|
|
7229
|
-
const onRemove = React.useCallback(
|
|
7230
|
-
(index) => {
|
|
7231
|
-
const result = [...items];
|
|
7232
|
-
result.splice(index, 1);
|
|
7233
|
-
onChange(result);
|
|
6976
|
+
function useSchema(options) {
|
|
6977
|
+
var _a;
|
|
6978
|
+
const [schema, setSchema] = React.useState(null);
|
|
6979
|
+
const [loading, setLoading] = React.useState(false);
|
|
6980
|
+
const [error, setError] = React.useState(null);
|
|
6981
|
+
const useResourceResult = core.useResource();
|
|
6982
|
+
const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
|
|
6983
|
+
const openapi = React.useMemo(
|
|
6984
|
+
() => {
|
|
6985
|
+
var _a2;
|
|
6986
|
+
return new K8sOpenAPI((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath);
|
|
7234
6987
|
},
|
|
7235
|
-
[
|
|
6988
|
+
[(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath]
|
|
7236
6989
|
);
|
|
7237
|
-
const
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
index
|
|
7263
|
-
);
|
|
7264
|
-
}),
|
|
7265
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: onAdd, children: "Add" }) })
|
|
7266
|
-
] });
|
|
6990
|
+
const fetchSchema = React.useCallback(async () => {
|
|
6991
|
+
var _a2;
|
|
6992
|
+
setLoading(true);
|
|
6993
|
+
setError(null);
|
|
6994
|
+
try {
|
|
6995
|
+
const schema2 = await openapi.findSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.kind);
|
|
6996
|
+
setSchema(schema2 || null);
|
|
6997
|
+
setError(null);
|
|
6998
|
+
} catch (e) {
|
|
6999
|
+
setError(e);
|
|
7000
|
+
} finally {
|
|
7001
|
+
setLoading(false);
|
|
7002
|
+
}
|
|
7003
|
+
}, [resource, openapi]);
|
|
7004
|
+
React.useEffect(() => {
|
|
7005
|
+
if (options == null ? void 0 : options.skip)
|
|
7006
|
+
return;
|
|
7007
|
+
fetchSchema();
|
|
7008
|
+
}, [fetchSchema]);
|
|
7009
|
+
return {
|
|
7010
|
+
schema,
|
|
7011
|
+
loading,
|
|
7012
|
+
error,
|
|
7013
|
+
fetchSchema
|
|
7014
|
+
};
|
|
7267
7015
|
}
|
|
7268
|
-
function
|
|
7269
|
-
const
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
{
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7016
|
+
function generateYamlBySchema(defaultValue, schema) {
|
|
7017
|
+
const typeObject = generateSchemaTypeValue(schema);
|
|
7018
|
+
function makeAnnotations(obj, key) {
|
|
7019
|
+
const result = {};
|
|
7020
|
+
if (lodashEs.isObject(obj[key])) {
|
|
7021
|
+
result[`#${key}`] = {};
|
|
7022
|
+
Object.keys(obj[key]).forEach((prop) => {
|
|
7023
|
+
result[`#${key}`] = {
|
|
7024
|
+
...result[`#${key}`],
|
|
7025
|
+
...makeAnnotations(obj[key], prop)
|
|
7026
|
+
};
|
|
7027
|
+
});
|
|
7028
|
+
} else {
|
|
7029
|
+
result[`#${key}`] = obj[key];
|
|
7030
|
+
}
|
|
7031
|
+
return result;
|
|
7032
|
+
}
|
|
7033
|
+
function merge(obj1, obj2, merged2 = {}) {
|
|
7034
|
+
for (const key in obj1) {
|
|
7035
|
+
merged2[key] = obj1[key];
|
|
7036
|
+
}
|
|
7037
|
+
for (const key in obj2) {
|
|
7038
|
+
if (key in obj1) {
|
|
7039
|
+
if (lodashEs.isObject(obj2[key]) && lodashEs.isObject(obj1[key])) {
|
|
7040
|
+
merged2[key] = merge(
|
|
7041
|
+
obj1[key],
|
|
7042
|
+
obj2[key]
|
|
7043
|
+
);
|
|
7044
|
+
}
|
|
7045
|
+
} else {
|
|
7046
|
+
merged2 = {
|
|
7047
|
+
...merged2,
|
|
7048
|
+
...makeAnnotations(obj2, key)
|
|
7049
|
+
};
|
|
7279
7050
|
}
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7051
|
+
}
|
|
7052
|
+
return merged2;
|
|
7053
|
+
}
|
|
7054
|
+
const merged = merge(defaultValue, typeObject);
|
|
7055
|
+
const content = yaml.dump(merged);
|
|
7056
|
+
return content.replace(/(')(#.+?)(')/g, "$2").replace(/( +)(#)/g, "$2$1");
|
|
7284
7057
|
}
|
|
7285
|
-
const
|
|
7286
|
-
const
|
|
7287
|
-
|
|
7288
|
-
const back_to_edit$1 = "Edit";
|
|
7289
|
-
const configure_file$1 = "Configuration";
|
|
7290
|
-
const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
|
|
7291
|
-
const yaml_value_wrong$1 = "Configuration has invalid values.";
|
|
7292
|
-
const edit_yaml$1 = "Edit YAML";
|
|
7293
|
-
const copied$1 = "Copied";
|
|
7294
|
-
const already_reset$1 = "Already reset";
|
|
7295
|
-
const fetch_schema_fail$1 = "Failed to fetch schema.";
|
|
7296
|
-
const obtain_data_error$1 = "Having trouble getting data.";
|
|
7297
|
-
const retry$1 = "Retry";
|
|
7298
|
-
const create_resource$1 = "Create {{resource}}";
|
|
7299
|
-
const edit_resource$1 = "Edit {{resource}}";
|
|
7300
|
-
const dovetail$1 = {
|
|
7301
|
-
copy: copy$1,
|
|
7302
|
-
reset_arguments: reset_arguments$1,
|
|
7303
|
-
view_changes: view_changes$1,
|
|
7304
|
-
back_to_edit: back_to_edit$1,
|
|
7305
|
-
configure_file: configure_file$1,
|
|
7306
|
-
yaml_format_wrong: yaml_format_wrong$1,
|
|
7307
|
-
yaml_value_wrong: yaml_value_wrong$1,
|
|
7308
|
-
edit_yaml: edit_yaml$1,
|
|
7309
|
-
copied: copied$1,
|
|
7310
|
-
already_reset: already_reset$1,
|
|
7311
|
-
fetch_schema_fail: fetch_schema_fail$1,
|
|
7312
|
-
obtain_data_error: obtain_data_error$1,
|
|
7313
|
-
retry: retry$1,
|
|
7314
|
-
create_resource: create_resource$1,
|
|
7315
|
-
edit_resource: edit_resource$1
|
|
7316
|
-
};
|
|
7317
|
-
const EN = {
|
|
7318
|
-
dovetail: dovetail$1
|
|
7319
|
-
};
|
|
7320
|
-
const copy = "复制";
|
|
7321
|
-
const reset_arguments = "重置";
|
|
7322
|
-
const view_changes = "查看改动";
|
|
7323
|
-
const back_to_edit = "编辑";
|
|
7324
|
-
const configure_file = "配置内容";
|
|
7325
|
-
const yaml_format_wrong = "配置内容不是有效的 yaml 格式。";
|
|
7326
|
-
const yaml_value_wrong = "配置内容中存在不合法的值。";
|
|
7327
|
-
const edit_yaml = "编辑 YAML";
|
|
7328
|
-
const copied = "已复制";
|
|
7329
|
-
const already_reset = "已重置";
|
|
7330
|
-
const cancel = "取消";
|
|
7331
|
-
const create = "创建";
|
|
7332
|
-
const confirm_delete_text = "确定要删除 {{target}} 吗?";
|
|
7333
|
-
const edit = "编辑";
|
|
7334
|
-
const namespace = "名字空间";
|
|
7335
|
-
const name = "名称";
|
|
7336
|
-
const state = "状态";
|
|
7337
|
-
const status = "状态";
|
|
7338
|
-
const phase = "状态";
|
|
7339
|
-
const image = "容器镜像";
|
|
7340
|
-
const replicas = "副本数";
|
|
7341
|
-
const created_time = "创建时间";
|
|
7342
|
-
const label = "标签";
|
|
7343
|
-
const annotation = "注释";
|
|
7344
|
-
const type = "类型";
|
|
7345
|
-
const event = "事件";
|
|
7346
|
-
const reason = "原因";
|
|
7347
|
-
const object = "对象";
|
|
7348
|
-
const note$1 = "事件信息";
|
|
7349
|
-
const condition = "Condition";
|
|
7350
|
-
const download_yaml = "下载 YAML";
|
|
7351
|
-
const detail = "详情";
|
|
7352
|
-
const node_name = "主机名称";
|
|
7353
|
-
const restarts = "重启次数";
|
|
7354
|
-
const updated_time = "更新时间";
|
|
7355
|
-
const message = "消息";
|
|
7356
|
-
const save = "保存";
|
|
7357
|
-
const more = "更多";
|
|
7358
|
-
const workload = "工作负载";
|
|
7359
|
-
const all_namespaces = "所有名字空间";
|
|
7360
|
-
const empty = "无可显示的数据";
|
|
7361
|
-
const schedule = "调度时间表";
|
|
7362
|
-
const lastScheduleTime = "上次调度时间";
|
|
7363
|
-
const duration = "持续时间";
|
|
7364
|
-
const completions = "完成 Job 历史数";
|
|
7365
|
-
const started = "开始时间";
|
|
7366
|
-
const init_container = "初始化容器";
|
|
7367
|
-
const container = "容器";
|
|
7368
|
-
const redeploy = "重新部署";
|
|
7369
|
-
const data = "数据";
|
|
7370
|
-
const suspend = "暂停";
|
|
7371
|
-
const resume = "重新开始";
|
|
7372
|
-
const cluster = "集群";
|
|
7373
|
-
const storage = "存储";
|
|
7374
|
-
const network = "网络";
|
|
7375
|
-
const clusterIp = "集群 IP";
|
|
7376
|
-
const sessionAffinity = "会话保持";
|
|
7377
|
-
const log = "日志";
|
|
7378
|
-
const select_container = "选择容器";
|
|
7379
|
-
const wrap = "折叠";
|
|
7380
|
-
const resume_log = "继续";
|
|
7381
|
-
const log_new_lines = ",并展示 {{ count }} 行新日志";
|
|
7382
|
-
const fetch_schema_fail = "获取 schema 失败。";
|
|
7383
|
-
const obtain_data_error = "获取数据时遇到问题。";
|
|
7384
|
-
const retry = "重试";
|
|
7385
|
-
const ready = "就绪";
|
|
7386
|
-
const updating = "更新中";
|
|
7387
|
-
const completed = "完成";
|
|
7388
|
-
const failed = "异常";
|
|
7389
|
-
const suspended = "挂起";
|
|
7390
|
-
const running = "运行中";
|
|
7391
|
-
const terminating = "终止";
|
|
7392
|
-
const succeeded = "成功终止";
|
|
7393
|
-
const unknown = "未知";
|
|
7394
|
-
const pending = "待处理";
|
|
7395
|
-
const waiting = "等待中";
|
|
7396
|
-
const create_resource = "创建 {{resource}}";
|
|
7397
|
-
const edit_resource = "编辑 {{resource}}";
|
|
7398
|
-
const sec = "秒";
|
|
7399
|
-
const min = "分";
|
|
7400
|
-
const hr = "小时";
|
|
7401
|
-
const day = "天";
|
|
7402
|
-
const expand = "展开";
|
|
7403
|
-
const fold = "收起";
|
|
7404
|
-
const rule = "规则";
|
|
7405
|
-
const default_backend = "默认后端";
|
|
7406
|
-
const ingress_rule_type = "规则类型";
|
|
7407
|
-
const port = "端口";
|
|
7408
|
-
const dovetail = {
|
|
7409
|
-
copy,
|
|
7410
|
-
reset_arguments,
|
|
7411
|
-
view_changes,
|
|
7412
|
-
back_to_edit,
|
|
7413
|
-
configure_file,
|
|
7414
|
-
yaml_format_wrong,
|
|
7415
|
-
yaml_value_wrong,
|
|
7416
|
-
edit_yaml,
|
|
7417
|
-
copied,
|
|
7418
|
-
already_reset,
|
|
7419
|
-
cancel,
|
|
7420
|
-
"delete": "删除",
|
|
7421
|
-
create,
|
|
7422
|
-
confirm_delete_text,
|
|
7423
|
-
edit,
|
|
7424
|
-
namespace,
|
|
7425
|
-
name,
|
|
7426
|
-
state,
|
|
7427
|
-
status,
|
|
7428
|
-
phase,
|
|
7429
|
-
image,
|
|
7430
|
-
replicas,
|
|
7431
|
-
created_time,
|
|
7432
|
-
label,
|
|
7433
|
-
annotation,
|
|
7434
|
-
type,
|
|
7435
|
-
event,
|
|
7436
|
-
reason,
|
|
7437
|
-
object,
|
|
7438
|
-
note: note$1,
|
|
7439
|
-
condition,
|
|
7440
|
-
download_yaml,
|
|
7441
|
-
detail,
|
|
7442
|
-
node_name,
|
|
7443
|
-
restarts,
|
|
7444
|
-
updated_time,
|
|
7445
|
-
message,
|
|
7446
|
-
save,
|
|
7447
|
-
more,
|
|
7448
|
-
workload,
|
|
7449
|
-
all_namespaces,
|
|
7450
|
-
empty,
|
|
7451
|
-
schedule,
|
|
7452
|
-
lastScheduleTime,
|
|
7453
|
-
duration,
|
|
7454
|
-
completions,
|
|
7455
|
-
started,
|
|
7456
|
-
init_container,
|
|
7457
|
-
container,
|
|
7458
|
-
redeploy,
|
|
7459
|
-
data,
|
|
7460
|
-
suspend,
|
|
7461
|
-
resume,
|
|
7462
|
-
cluster,
|
|
7463
|
-
storage,
|
|
7464
|
-
network,
|
|
7465
|
-
clusterIp,
|
|
7466
|
-
sessionAffinity,
|
|
7467
|
-
log,
|
|
7468
|
-
select_container,
|
|
7469
|
-
wrap,
|
|
7470
|
-
resume_log,
|
|
7471
|
-
log_new_lines,
|
|
7472
|
-
fetch_schema_fail,
|
|
7473
|
-
obtain_data_error,
|
|
7474
|
-
retry,
|
|
7475
|
-
ready,
|
|
7476
|
-
updating,
|
|
7477
|
-
completed,
|
|
7478
|
-
failed,
|
|
7479
|
-
suspended,
|
|
7480
|
-
running,
|
|
7481
|
-
terminating,
|
|
7482
|
-
succeeded,
|
|
7483
|
-
unknown,
|
|
7484
|
-
pending,
|
|
7485
|
-
waiting,
|
|
7486
|
-
create_resource,
|
|
7487
|
-
edit_resource,
|
|
7488
|
-
sec,
|
|
7489
|
-
min,
|
|
7490
|
-
hr,
|
|
7491
|
-
day,
|
|
7492
|
-
expand,
|
|
7493
|
-
fold,
|
|
7494
|
-
rule,
|
|
7495
|
-
default_backend,
|
|
7496
|
-
ingress_rule_type,
|
|
7497
|
-
port
|
|
7058
|
+
const GlobalStoreContext = React.createContext({});
|
|
7059
|
+
const useGlobalStore = () => {
|
|
7060
|
+
return React.useContext(GlobalStoreContext);
|
|
7498
7061
|
};
|
|
7499
|
-
const
|
|
7500
|
-
|
|
7062
|
+
const useEagleForm = ({
|
|
7063
|
+
action,
|
|
7064
|
+
resource,
|
|
7065
|
+
onMutationSuccess: onMutationSuccessProp,
|
|
7066
|
+
onMutationError,
|
|
7067
|
+
submitOnEnter = false,
|
|
7068
|
+
warnWhenUnsavedChanges: warnWhenUnsavedChangesProp,
|
|
7069
|
+
redirect,
|
|
7070
|
+
successNotification,
|
|
7071
|
+
errorNotification,
|
|
7072
|
+
meta,
|
|
7073
|
+
metaData,
|
|
7074
|
+
queryMeta,
|
|
7075
|
+
mutationMeta,
|
|
7076
|
+
liveMode,
|
|
7077
|
+
liveParams,
|
|
7078
|
+
mutationMode,
|
|
7079
|
+
dataProviderName,
|
|
7080
|
+
onLiveEvent,
|
|
7081
|
+
invalidates,
|
|
7082
|
+
undoableTimeout,
|
|
7083
|
+
queryOptions,
|
|
7084
|
+
createMutationOptions,
|
|
7085
|
+
updateMutationOptions,
|
|
7086
|
+
id: idFromProps,
|
|
7087
|
+
overtimeOptions,
|
|
7088
|
+
editorOptions,
|
|
7089
|
+
initialValuesForCreate
|
|
7090
|
+
} = {}) => {
|
|
7091
|
+
var _a, _b, _c;
|
|
7092
|
+
const editor = React.useRef(null);
|
|
7093
|
+
const isFoldRef = React.useRef(false);
|
|
7094
|
+
const { t } = useTranslation();
|
|
7095
|
+
const [enableEditor, setEnableEditor] = React.useState(false);
|
|
7096
|
+
const [isYamlValid, setIsYamlValid] = React.useState(true);
|
|
7097
|
+
const [isSchemaValid, setIsSchemaValid] = React.useState(true);
|
|
7098
|
+
const [editorErrors, setEditorErrors] = React.useState([]);
|
|
7099
|
+
const [errorResponseBody, setErrorResponseBody] = React.useState(null);
|
|
7100
|
+
const useResourceResult = core.useResource();
|
|
7101
|
+
const { globalStore } = useGlobalStore();
|
|
7102
|
+
const kit = eagle.useUIKit();
|
|
7103
|
+
const {
|
|
7104
|
+
schema,
|
|
7105
|
+
loading: isLoadingSchema,
|
|
7106
|
+
error: loadSchemaError,
|
|
7107
|
+
fetchSchema
|
|
7108
|
+
} = useSchema({
|
|
7109
|
+
skip: editorOptions == null ? void 0 : editorOptions.isSkipSchema
|
|
7110
|
+
});
|
|
7111
|
+
const [formAnt] = kit.form.useForm();
|
|
7112
|
+
const formSF = sunflowerAntd.useForm({
|
|
7113
|
+
form: formAnt
|
|
7114
|
+
});
|
|
7115
|
+
const { form } = formSF;
|
|
7116
|
+
const { fold: fold2 } = useK8sYamlEditor();
|
|
7117
|
+
const useFormCoreResult = core.useForm({
|
|
7118
|
+
onMutationSuccess: onMutationSuccessProp ? onMutationSuccessProp : void 0,
|
|
7119
|
+
onMutationError,
|
|
7120
|
+
redirect,
|
|
7121
|
+
action,
|
|
7122
|
+
resource,
|
|
7123
|
+
successNotification,
|
|
7124
|
+
errorNotification,
|
|
7125
|
+
meta: core.pickNotDeprecated(meta, metaData),
|
|
7126
|
+
metaData: core.pickNotDeprecated(meta, metaData),
|
|
7127
|
+
queryMeta,
|
|
7128
|
+
mutationMeta,
|
|
7129
|
+
liveMode,
|
|
7130
|
+
liveParams,
|
|
7131
|
+
mutationMode,
|
|
7132
|
+
dataProviderName,
|
|
7133
|
+
onLiveEvent,
|
|
7134
|
+
invalidates,
|
|
7135
|
+
undoableTimeout,
|
|
7136
|
+
queryOptions,
|
|
7137
|
+
createMutationOptions,
|
|
7138
|
+
updateMutationOptions,
|
|
7139
|
+
id: idFromProps,
|
|
7140
|
+
overtimeOptions
|
|
7141
|
+
});
|
|
7142
|
+
const { formLoading, onFinish, queryResult, id } = useFormCoreResult;
|
|
7143
|
+
const { warnWhenUnsavedChanges: warnWhenUnsavedChangesRefine, setWarnWhen } = core.useWarnAboutChange();
|
|
7144
|
+
const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp ?? warnWhenUnsavedChangesRefine;
|
|
7145
|
+
const initialValues = React.useMemo(() => {
|
|
7146
|
+
var _a2;
|
|
7147
|
+
const initialValues2 = ((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) ? globalStore == null ? void 0 : globalStore.restoreItem(queryResult.data.data) : initialValuesForCreate;
|
|
7148
|
+
if (initialValues2) {
|
|
7149
|
+
pruneBeforeEdit(initialValues2);
|
|
7150
|
+
}
|
|
7151
|
+
return initialValues2;
|
|
7152
|
+
}, [queryResult, globalStore, initialValuesForCreate]);
|
|
7153
|
+
React.useEffect(() => {
|
|
7154
|
+
var _a2;
|
|
7155
|
+
form.resetFields();
|
|
7156
|
+
if (editor.current) {
|
|
7157
|
+
const editorValue = yaml.dump(initialValues);
|
|
7158
|
+
const editorInstance = editor.current.getEditorInstance();
|
|
7159
|
+
editor.current.setEditorValue(editorValue);
|
|
7160
|
+
editor.current.setValue(editorValue);
|
|
7161
|
+
if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
|
|
7162
|
+
fold2(editorInstance);
|
|
7163
|
+
isFoldRef.current = true;
|
|
7164
|
+
}
|
|
7165
|
+
}
|
|
7166
|
+
}, [initialValues, (_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, form, fold2]);
|
|
7167
|
+
React.useEffect(() => {
|
|
7168
|
+
var _a2, _b2;
|
|
7169
|
+
const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
|
|
7170
|
+
if (response && !(response == null ? void 0 : response.bodyUsed)) {
|
|
7171
|
+
(_b2 = response.json) == null ? void 0 : _b2.call(response).then((body) => {
|
|
7172
|
+
setErrorResponseBody(body);
|
|
7173
|
+
});
|
|
7174
|
+
}
|
|
7175
|
+
}, [useFormCoreResult.mutationResult]);
|
|
7176
|
+
const onKeyUp = (event2) => {
|
|
7177
|
+
if (submitOnEnter && event2.key === "Enter") {
|
|
7178
|
+
form.submit();
|
|
7179
|
+
}
|
|
7180
|
+
};
|
|
7181
|
+
const onValuesChange = (changeValues) => {
|
|
7182
|
+
if (changeValues && warnWhenUnsavedChanges) {
|
|
7183
|
+
setWarnWhen(true);
|
|
7184
|
+
}
|
|
7185
|
+
return changeValues;
|
|
7186
|
+
};
|
|
7187
|
+
const saveButtonProps = React.useMemo(() => ({
|
|
7188
|
+
loading: formLoading,
|
|
7189
|
+
onClick: () => {
|
|
7190
|
+
form.submit();
|
|
7191
|
+
}
|
|
7192
|
+
}), [formLoading, form]);
|
|
7193
|
+
const editorProps = React.useMemo(() => {
|
|
7194
|
+
var _a2;
|
|
7195
|
+
return {
|
|
7196
|
+
ref: editor,
|
|
7197
|
+
defaultValue: schema && (editorOptions == null ? void 0 : editorOptions.isGenerateAnnotations) ? generateYamlBySchema(initialValues || {}, schema) : yaml.dump(initialValues),
|
|
7198
|
+
schema,
|
|
7199
|
+
id: ((_a2 = useResourceResult.resource) == null ? void 0 : _a2.name) || "",
|
|
7200
|
+
errorMsgs: editorErrors,
|
|
7201
|
+
onValidate(yamlValid, schemaValid) {
|
|
7202
|
+
setIsYamlValid(yamlValid);
|
|
7203
|
+
setIsSchemaValid(schemaValid);
|
|
7204
|
+
if (yamlValid && schemaValid) {
|
|
7205
|
+
setEditorErrors([]);
|
|
7206
|
+
}
|
|
7207
|
+
},
|
|
7208
|
+
onEditorCreate(editor2) {
|
|
7209
|
+
var _a3;
|
|
7210
|
+
if (((_a3 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a3.data) && !isFoldRef.current) {
|
|
7211
|
+
fold2(editor2);
|
|
7212
|
+
isFoldRef.current = true;
|
|
7213
|
+
}
|
|
7214
|
+
}
|
|
7215
|
+
};
|
|
7216
|
+
}, [editorErrors, editorOptions, fold2, initialValues, (_b = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _b.data, schema, (_c = useResourceResult.resource) == null ? void 0 : _c.name]);
|
|
7217
|
+
return {
|
|
7218
|
+
form: formSF.form,
|
|
7219
|
+
formProps: {
|
|
7220
|
+
...formSF.formProps,
|
|
7221
|
+
onFinish: (values) => {
|
|
7222
|
+
var _a2;
|
|
7223
|
+
const errors = [
|
|
7224
|
+
!isYamlValid ? t("dovetail.yaml_format_wrong") : "",
|
|
7225
|
+
!isSchemaValid ? t("dovetail.yaml_value_wrong") : ""
|
|
7226
|
+
].filter((error) => !!error);
|
|
7227
|
+
if (errors.length) {
|
|
7228
|
+
setEditorErrors(errors);
|
|
7229
|
+
return;
|
|
7230
|
+
}
|
|
7231
|
+
const finalValues = editor.current ? yaml.load(((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue()) || "") : values;
|
|
7232
|
+
return onFinish(finalValues);
|
|
7233
|
+
},
|
|
7234
|
+
onKeyUp,
|
|
7235
|
+
onValuesChange,
|
|
7236
|
+
initialValues
|
|
7237
|
+
},
|
|
7238
|
+
saveButtonProps,
|
|
7239
|
+
...useFormCoreResult,
|
|
7240
|
+
editorProps,
|
|
7241
|
+
enableEditor,
|
|
7242
|
+
errorResponseBody,
|
|
7243
|
+
schema,
|
|
7244
|
+
isLoadingSchema,
|
|
7245
|
+
loadSchemaError,
|
|
7246
|
+
fetchSchema,
|
|
7247
|
+
switchEditor() {
|
|
7248
|
+
var _a2, _b2;
|
|
7249
|
+
if (enableEditor && ((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue())) {
|
|
7250
|
+
const value = yaml.load((_b2 = editor.current) == null ? void 0 : _b2.getEditorValue());
|
|
7251
|
+
form == null ? void 0 : form.setFieldsValue(value);
|
|
7252
|
+
}
|
|
7253
|
+
setEnableEditor(!enableEditor);
|
|
7254
|
+
},
|
|
7255
|
+
onFinish: async (values) => {
|
|
7256
|
+
var _a2;
|
|
7257
|
+
const finalValues = enableEditor ? yaml.load(((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue()) || "") : values ?? formSF.form.getFieldsValue(true);
|
|
7258
|
+
return await onFinish(finalValues);
|
|
7259
|
+
}
|
|
7260
|
+
};
|
|
7501
7261
|
};
|
|
7502
|
-
const
|
|
7503
|
-
|
|
7504
|
-
|
|
7262
|
+
const useDeleteModal = (resource) => {
|
|
7263
|
+
const { mutate } = core.useDelete();
|
|
7264
|
+
const [visible, setVisible] = React.useState(false);
|
|
7265
|
+
const navigation = core.useNavigation();
|
|
7266
|
+
const [id, setId] = React.useState("");
|
|
7267
|
+
const { t } = useTranslation();
|
|
7268
|
+
const modalProps = {
|
|
7269
|
+
title: t("dovetail.delete"),
|
|
7270
|
+
okText: t("dovetail.delete"),
|
|
7271
|
+
okButtonProps: {
|
|
7272
|
+
danger: true
|
|
7273
|
+
},
|
|
7274
|
+
cancelText: t("dovetail.cancel"),
|
|
7275
|
+
children: t("dovetail.confirm_delete_text", {
|
|
7276
|
+
target: id,
|
|
7277
|
+
interpolation: { escapeValue: false }
|
|
7278
|
+
}),
|
|
7279
|
+
onOk() {
|
|
7280
|
+
mutate({
|
|
7281
|
+
resource,
|
|
7282
|
+
id
|
|
7283
|
+
});
|
|
7284
|
+
setVisible(false);
|
|
7285
|
+
navigation.list(resource);
|
|
7286
|
+
},
|
|
7287
|
+
onCancel() {
|
|
7288
|
+
setVisible(false);
|
|
7289
|
+
}
|
|
7290
|
+
};
|
|
7291
|
+
function openDeleteConfirmModal(id2) {
|
|
7292
|
+
setId(id2);
|
|
7293
|
+
setVisible(true);
|
|
7294
|
+
}
|
|
7295
|
+
return { modalProps, visible, openDeleteConfirmModal };
|
|
7296
|
+
};
|
|
7297
|
+
var cx = function cx2() {
|
|
7298
|
+
const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
|
|
7299
|
+
const atomicClasses = {};
|
|
7300
|
+
const nonAtomicClasses = [];
|
|
7301
|
+
presentClassNames.forEach((arg) => {
|
|
7302
|
+
const individualClassNames = arg ? arg.split(" ") : [];
|
|
7303
|
+
individualClassNames.forEach((className) => {
|
|
7304
|
+
if (className.startsWith("atm_")) {
|
|
7305
|
+
const [, keyHash] = className.split("_");
|
|
7306
|
+
atomicClasses[keyHash] = className;
|
|
7307
|
+
} else {
|
|
7308
|
+
nonAtomicClasses.push(className);
|
|
7309
|
+
}
|
|
7310
|
+
});
|
|
7311
|
+
});
|
|
7312
|
+
const result = [];
|
|
7313
|
+
for (const keyHash in atomicClasses) {
|
|
7314
|
+
if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
|
|
7315
|
+
result.push(atomicClasses[keyHash]);
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
result.push(...nonAtomicClasses);
|
|
7319
|
+
return result.join(" ");
|
|
7505
7320
|
};
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7321
|
+
var cx_default = cx;
|
|
7322
|
+
const index_hex8jv = "";
|
|
7323
|
+
const BreadcrumbStyle = "b142d7q8";
|
|
7324
|
+
function Breadcrumb(props) {
|
|
7325
|
+
const {
|
|
7326
|
+
breadcrumbs
|
|
7327
|
+
} = core.useBreadcrumb();
|
|
7328
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
|
|
7329
|
+
className: cx_default(BreadcrumbStyle, props.className),
|
|
7330
|
+
children: breadcrumbs.map((breadcrumb) => {
|
|
7331
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
|
|
7332
|
+
className: "breadcrumb-item",
|
|
7333
|
+
children: breadcrumb.href ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Link, {
|
|
7334
|
+
to: breadcrumb.href,
|
|
7335
|
+
children: breadcrumb.label
|
|
7336
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
7337
|
+
children: breadcrumb.label
|
|
7338
|
+
})
|
|
7339
|
+
}, `breadcrumb-${breadcrumb.label}`);
|
|
7340
|
+
})
|
|
7341
|
+
});
|
|
7342
|
+
}
|
|
7343
|
+
function NameInputWidget(props) {
|
|
7344
|
+
const kit = eagle.useUIKit();
|
|
7345
|
+
const { action } = core.useResource();
|
|
7346
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { ...props, disabled: action === "edit" });
|
|
7347
|
+
}
|
|
7348
|
+
const dnsSubDomainRules = [
|
|
7349
|
+
{
|
|
7350
|
+
required: true,
|
|
7351
|
+
message: "名称不能为空"
|
|
7352
|
+
},
|
|
7353
|
+
{
|
|
7354
|
+
pattern: /^[a-z0-9]([-.a-z0-9]*[a-z0-9])?$/,
|
|
7355
|
+
message: "名称只能包含小写字母、数字,以及 '-' 和 '.',且必须以字母或数字开头和结束"
|
|
7356
|
+
},
|
|
7357
|
+
{
|
|
7358
|
+
max: 253,
|
|
7359
|
+
message: "名称长度不能超过253个字符"
|
|
7360
|
+
}
|
|
7361
|
+
];
|
|
7362
|
+
const rfc1123LabelRules = [
|
|
7363
|
+
{
|
|
7364
|
+
required: true,
|
|
7365
|
+
message: "名称不能为空"
|
|
7366
|
+
},
|
|
7367
|
+
{
|
|
7368
|
+
pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/,
|
|
7369
|
+
message: "名称只能包含小写字母、数字,以及 '-',且以字母或数字开头和结束"
|
|
7370
|
+
},
|
|
7371
|
+
{
|
|
7372
|
+
max: 63,
|
|
7373
|
+
message: "名称长度不能超过63个字符"
|
|
7374
|
+
}
|
|
7375
|
+
];
|
|
7376
|
+
const rfc1035LabelRules = [
|
|
7377
|
+
{
|
|
7378
|
+
required: true,
|
|
7379
|
+
message: "名称不能为空"
|
|
7380
|
+
},
|
|
7381
|
+
{
|
|
7382
|
+
pattern: /^[a-z]([-a-z0-9]*[a-z0-9])?$/,
|
|
7383
|
+
message: "名称只能包含小写字母、数字,以及 '-',且以字母开头,字母或数字结束"
|
|
7384
|
+
},
|
|
7385
|
+
{
|
|
7386
|
+
max: 63,
|
|
7387
|
+
message: "名称长度不能超过63个字符"
|
|
7388
|
+
}
|
|
7389
|
+
];
|
|
7390
|
+
function NamespaceSelectWidget(props) {
|
|
7391
|
+
const kit = eagle.useUIKit();
|
|
7392
|
+
const { action } = core.useResource();
|
|
7393
|
+
const { data: data2 } = core.useList({
|
|
7394
|
+
resource: "namespaces",
|
|
7395
|
+
meta: {
|
|
7396
|
+
resourceBasePath: "/api/v1",
|
|
7397
|
+
kind: "Namespace"
|
|
7398
|
+
}
|
|
7399
|
+
});
|
|
7400
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.select, { input: props, disabled: action === "edit", children: data2 == null ? void 0 : data2.data.map((namespace2) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: namespace2.metadata.name, children: namespace2.metadata.name }, namespace2.metadata.name)) });
|
|
7401
|
+
}
|
|
7402
|
+
const namespaceRules = [
|
|
7403
|
+
{
|
|
7404
|
+
required: true,
|
|
7405
|
+
message: "Please input the namespace."
|
|
7406
|
+
}
|
|
7407
|
+
];
|
|
7408
|
+
function KeyValueInput(props) {
|
|
7409
|
+
const { children, item } = props;
|
|
7410
|
+
const kit = eagle.useUIKit();
|
|
7411
|
+
const onKeyChange = React.useCallback(
|
|
7412
|
+
(event2) => {
|
|
7413
|
+
var _a;
|
|
7414
|
+
const key = event2.target.value;
|
|
7415
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
7416
|
+
...item,
|
|
7417
|
+
key
|
|
7418
|
+
});
|
|
7419
|
+
},
|
|
7420
|
+
[item, props]
|
|
7421
|
+
);
|
|
7422
|
+
const onValueChange = React.useCallback(
|
|
7423
|
+
(event2) => {
|
|
7424
|
+
var _a;
|
|
7425
|
+
const value = event2.target.value;
|
|
7426
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
7427
|
+
...item,
|
|
7428
|
+
value
|
|
7429
|
+
});
|
|
7430
|
+
},
|
|
7431
|
+
[item, props]
|
|
7432
|
+
);
|
|
7433
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { children: [
|
|
7434
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { value: item.key, onChange: onKeyChange }),
|
|
7435
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.textArea, { value: item.value, onChange: onValueChange }),
|
|
7436
|
+
children
|
|
7437
|
+
] });
|
|
7438
|
+
}
|
|
7439
|
+
function KeyValueListWidget(props) {
|
|
7440
|
+
const kit = eagle.useUIKit();
|
|
7441
|
+
const { value } = props;
|
|
7442
|
+
const items = React.useMemo(() => {
|
|
7443
|
+
return Object.entries(value || {}).map(([key, value2]) => ({
|
|
7444
|
+
key,
|
|
7445
|
+
value: value2
|
|
7446
|
+
}));
|
|
7447
|
+
}, [value]);
|
|
7448
|
+
const onChange = React.useCallback(
|
|
7449
|
+
(newItems) => {
|
|
7450
|
+
var _a;
|
|
7451
|
+
const newValue = newItems.reduce((result, item) => {
|
|
7452
|
+
result[item.key] = item.value;
|
|
7453
|
+
return result;
|
|
7454
|
+
}, {});
|
|
7455
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, newValue);
|
|
7456
|
+
},
|
|
7457
|
+
[props]
|
|
7458
|
+
);
|
|
7459
|
+
const onRemove = React.useCallback(
|
|
7460
|
+
(index) => {
|
|
7461
|
+
const result = [...items];
|
|
7462
|
+
result.splice(index, 1);
|
|
7463
|
+
onChange(result);
|
|
7464
|
+
},
|
|
7465
|
+
[onChange, items]
|
|
7466
|
+
);
|
|
7467
|
+
const onAdd = React.useCallback(() => {
|
|
7468
|
+
onChange([...items, { key: "", value: "" }]);
|
|
7469
|
+
}, [onChange, items]);
|
|
7470
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7471
|
+
items.map((item, index) => {
|
|
7472
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7473
|
+
KeyValueInput,
|
|
7474
|
+
{
|
|
7475
|
+
item,
|
|
7476
|
+
onChange: (newItem) => {
|
|
7477
|
+
const temp = [...items];
|
|
7478
|
+
temp.splice(index, 1, newItem);
|
|
7479
|
+
onChange(temp);
|
|
7480
|
+
},
|
|
7481
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7482
|
+
kit.button,
|
|
7483
|
+
{
|
|
7484
|
+
onClick: () => {
|
|
7485
|
+
onRemove(index);
|
|
7486
|
+
},
|
|
7487
|
+
danger: true,
|
|
7488
|
+
children: "Remove"
|
|
7489
|
+
}
|
|
7490
|
+
)
|
|
7491
|
+
},
|
|
7492
|
+
index
|
|
7493
|
+
);
|
|
7494
|
+
}),
|
|
7495
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: onAdd, children: "Add" }) })
|
|
7496
|
+
] });
|
|
7497
|
+
}
|
|
7498
|
+
function MetadataForm() {
|
|
7499
|
+
const kit = eagle.useUIKit();
|
|
7500
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7501
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { label: "Name", name: ["metadata", "name"], rules: rfc1123LabelRules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(NameInputWidget, {}) }),
|
|
7502
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7503
|
+
kit.form.Item,
|
|
7504
|
+
{
|
|
7505
|
+
label: "Namespace",
|
|
7506
|
+
name: ["metadata", "namespace"],
|
|
7507
|
+
rules: namespaceRules,
|
|
7508
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NamespaceSelectWidget, {})
|
|
7509
|
+
}
|
|
7510
|
+
),
|
|
7511
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { name: ["metadata", "labels"], label: "Labels", children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueListWidget, {}) }),
|
|
7512
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { name: ["metadata", "annotations"], label: "Annotations", children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueListWidget, {}) })
|
|
7513
|
+
] });
|
|
7514
|
+
}
|
|
7515
7515
|
function addId(arr, idKey) {
|
|
7516
7516
|
return arr.map((e) => {
|
|
7517
7517
|
return {
|
|
@@ -11768,7 +11768,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11768
11768
|
});
|
|
11769
11769
|
}
|
|
11770
11770
|
}];
|
|
11771
|
-
const
|
|
11771
|
+
const stateDisplay = lodashEs.get(record, "stateDisplay");
|
|
11772
11772
|
const topBar = /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11773
11773
|
className: TopBarStyle,
|
|
11774
11774
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
@@ -11778,9 +11778,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11778
11778
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11779
11779
|
className: eagle.Typo.Label.l1_regular,
|
|
11780
11780
|
children: (_c = record == null ? void 0 : record.metadata) == null ? void 0 : _c.name
|
|
11781
|
-
}),
|
|
11781
|
+
}), stateDisplay ? /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, {
|
|
11782
11782
|
className: StateTagStyle,
|
|
11783
|
-
state:
|
|
11783
|
+
state: stateDisplay
|
|
11784
11784
|
}) : void 0]
|
|
11785
11785
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11786
11786
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.radioGroup, {
|
|
@@ -18292,6 +18292,84 @@ var __publicField = (obj, key, value) => {
|
|
|
18292
18292
|
})]
|
|
18293
18293
|
});
|
|
18294
18294
|
};
|
|
18295
|
+
const NetworkPolicyRulesTable = ({ ingressOrEgress }) => {
|
|
18296
|
+
const result = ingressOrEgress == null ? void 0 : ingressOrEgress.map((gress, i) => {
|
|
18297
|
+
const peers = lodashEs.get(gress, "from") || lodashEs.get(gress, "to");
|
|
18298
|
+
if (!peers)
|
|
18299
|
+
return null;
|
|
18300
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRuleTable, { peers }, i);
|
|
18301
|
+
});
|
|
18302
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
18303
|
+
};
|
|
18304
|
+
const IngressRuleTable = ({ peers }) => {
|
|
18305
|
+
const kit = eagle.useUIKit();
|
|
18306
|
+
const { t } = useTranslation();
|
|
18307
|
+
const rows = React.useMemo(() => {
|
|
18308
|
+
const rows2 = (peers == null ? void 0 : peers.map((p) => {
|
|
18309
|
+
return Object.keys(p).map((key) => {
|
|
18310
|
+
return {
|
|
18311
|
+
type: key,
|
|
18312
|
+
...p[key]
|
|
18313
|
+
};
|
|
18314
|
+
});
|
|
18315
|
+
})) || [];
|
|
18316
|
+
return addId(lodashEs.flatten(rows2), "type");
|
|
18317
|
+
}, [peers]);
|
|
18318
|
+
const columns = [
|
|
18319
|
+
{
|
|
18320
|
+
key: "type",
|
|
18321
|
+
display: true,
|
|
18322
|
+
dataIndex: "type",
|
|
18323
|
+
title: t("dovetail.type"),
|
|
18324
|
+
sortable: true
|
|
18325
|
+
},
|
|
18326
|
+
{
|
|
18327
|
+
key: "cidr",
|
|
18328
|
+
display: true,
|
|
18329
|
+
dataIndex: "cidr",
|
|
18330
|
+
title: "CIDR",
|
|
18331
|
+
sortable: true,
|
|
18332
|
+
render(v) {
|
|
18333
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: v || "-" });
|
|
18334
|
+
}
|
|
18335
|
+
},
|
|
18336
|
+
{
|
|
18337
|
+
key: "except",
|
|
18338
|
+
display: true,
|
|
18339
|
+
dataIndex: "except",
|
|
18340
|
+
title: "Except",
|
|
18341
|
+
sortable: true,
|
|
18342
|
+
render: (except) => {
|
|
18343
|
+
if (!except)
|
|
18344
|
+
return "-";
|
|
18345
|
+
return except == null ? void 0 : except.map((str) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: str }, str));
|
|
18346
|
+
}
|
|
18347
|
+
},
|
|
18348
|
+
{
|
|
18349
|
+
key: "matchLabels",
|
|
18350
|
+
display: true,
|
|
18351
|
+
dataIndex: "matchLabels",
|
|
18352
|
+
title: "Match Labels",
|
|
18353
|
+
sortable: true,
|
|
18354
|
+
render(matchLabels) {
|
|
18355
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, { value: matchLabels });
|
|
18356
|
+
}
|
|
18357
|
+
}
|
|
18358
|
+
];
|
|
18359
|
+
if (rows.length === 0) {
|
|
18360
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
18361
|
+
}
|
|
18362
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18363
|
+
kit.table,
|
|
18364
|
+
{
|
|
18365
|
+
loading: false,
|
|
18366
|
+
dataSource: rows,
|
|
18367
|
+
columns,
|
|
18368
|
+
rowKey: "type",
|
|
18369
|
+
empty: t("dovetail.empty")
|
|
18370
|
+
}
|
|
18371
|
+
);
|
|
18372
|
+
};
|
|
18295
18373
|
const IngressRulesComponent = ({ ingress }) => {
|
|
18296
18374
|
const kit = eagle.useUIKit();
|
|
18297
18375
|
const result = ingress.flattenedRules.map((r) => {
|
|
@@ -19247,6 +19325,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19247
19325
|
}
|
|
19248
19326
|
const relationPlugin = new RelationPlugin();
|
|
19249
19327
|
const ProviderPlugins = [relationPlugin, modelPlugin];
|
|
19328
|
+
const DovetailRefineI18n = i18n;
|
|
19250
19329
|
const MonacoYamlDiffEditor = (props) => {
|
|
19251
19330
|
const ref = React.useRef(null);
|
|
19252
19331
|
const { origin, modified, id, height } = props;
|
|
@@ -19312,6 +19391,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19312
19391
|
exports2.DeleteManyButton = DeleteManyButton;
|
|
19313
19392
|
exports2.DeploymentModel = DeploymentModel;
|
|
19314
19393
|
exports2.Dovetail = Dovetail;
|
|
19394
|
+
exports2.DovetailRefineI18n = DovetailRefineI18n;
|
|
19315
19395
|
exports2.DrawerShow = DrawerShow;
|
|
19316
19396
|
exports2.DurationColumnRenderer = DurationColumnRenderer;
|
|
19317
19397
|
exports2.EditButton = EditButton;
|
|
@@ -19344,6 +19424,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19344
19424
|
exports2.NamespaceSelectWidget = NamespaceSelectWidget;
|
|
19345
19425
|
exports2.NamespacesFilter = NamespacesFilter;
|
|
19346
19426
|
exports2.NetworkPolicyModel = NetworkPolicyModel;
|
|
19427
|
+
exports2.NetworkPolicyRulesTable = NetworkPolicyRulesTable;
|
|
19347
19428
|
exports2.NodeNameColumnRenderer = NodeNameColumnRenderer;
|
|
19348
19429
|
exports2.POD_INIT_VALUE = POD_INIT_VALUE;
|
|
19349
19430
|
exports2.PageShow = PageShow;
|