@dovetail-v2/refine 0.0.12 → 0.0.13
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.6b29d662.js → MonacoYamlDiffEditor.33e5c246.js} +2 -3
- package/dist/{index.01461ca8.js → index.84fe2e0e.js} +340 -1495
- package/dist/refine.js +46 -42
- package/dist/refine.umd.cjs +308 -1464
- package/lib/src/Dovetail.d.ts +3 -1
- package/lib/src/components/ShowContent/fields.d.ts +5 -1
- package/lib/src/components/YamlEditor/MonacoYamlEditor.d.ts +1 -1
- package/lib/src/components/YamlEditor/YamlEditorComponent.d.ts +2 -1
- package/lib/src/hooks/useEagleForm.d.ts +11 -9
- package/lib/src/hooks/useEagleTable/columns.d.ts +1 -0
- package/lib/src/hooks/useK8sYamlEditor.d.ts +5 -0
- package/lib/src/i18n.d.ts +5 -0
- package/lib/src/locales/zh-CN/index.d.ts +5 -0
- package/lib/src/pages/services/index.d.ts +3 -0
- package/lib/src/types/resource.d.ts +3 -1
- package/lib/src/utils/selector.d.ts +3 -0
- package/package.json +6 -5
package/dist/refine.umd.cjs
CHANGED
|
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
(function(global2, factory) {
|
|
8
|
-
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("@cloudtower/icons-react"), require("monaco-editor"), require("monaco-yaml"), require("react-dom"), require("antd"), require("
|
|
9
|
-
})(this, function(exports2, core, qs, React, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd, iconsReact, monaco, monacoYaml, ReactDOM, antd$1,
|
|
8
|
+
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("k8s-api-provider"), require("lodash-es"), require("sunflower-antd"), require("@cloudtower/icons-react"), require("monaco-editor"), require("monaco-yaml"), require("react-dom"), require("antd"), require("i18next")) : typeof define === "function" && define.amd ? define(["exports", "@refinedev/core", "qs", "react", "react-router-dom", "@cloudtower/eagle", "js-yaml", "k8s-api-provider", "lodash-es", "sunflower-antd", "@cloudtower/icons-react", "monaco-editor", "monaco-yaml", "react-dom", "antd", "i18next"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.dovetail = {}, global2.core, global2.qs, global2.React, global2.reactRouterDom, global2.eagle, global2.yaml, global2.k8sApiProvider, global2.lodashEs, global2.sunflowerAntd, global2.iconsReact, global2.monaco, global2.monacoYaml, global2.ReactDOM, global2.antd$1, global2.i18n));
|
|
9
|
+
})(this, function(exports2, core, qs, React, reactRouterDom, eagle, yaml, k8sApiProvider, lodashEs, sunflowerAntd, iconsReact, monaco, monacoYaml, ReactDOM, antd$1, i18n) {
|
|
10
10
|
"use strict";
|
|
11
11
|
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
12
12
|
function _interopNamespace(e) {
|
|
@@ -14,12 +14,12 @@ var __publicField = (obj, key, value) => {
|
|
|
14
14
|
return e;
|
|
15
15
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
16
16
|
if (e) {
|
|
17
|
-
for (const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
Object.defineProperty(n,
|
|
17
|
+
for (const k in e) {
|
|
18
|
+
if (k !== "default") {
|
|
19
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: () => e[
|
|
22
|
+
get: () => e[k]
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -31,8 +31,6 @@ var __publicField = (obj, key, value) => {
|
|
|
31
31
|
const yaml__default = /* @__PURE__ */ _interopDefaultLegacy(yaml);
|
|
32
32
|
const monaco__namespace = /* @__PURE__ */ _interopNamespace(monaco);
|
|
33
33
|
const ReactDOM__default = /* @__PURE__ */ _interopDefaultLegacy(ReactDOM);
|
|
34
|
-
const require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0);
|
|
35
|
-
const require$$2__default = /* @__PURE__ */ _interopDefaultLegacy(require$$2);
|
|
36
34
|
const i18n__default = /* @__PURE__ */ _interopDefaultLegacy(i18n);
|
|
37
35
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
38
36
|
var jsxRuntime = { exports: {} };
|
|
@@ -50,28 +48,28 @@ var __publicField = (obj, key, value) => {
|
|
|
50
48
|
if (hasRequiredReactJsxRuntime_production_min)
|
|
51
49
|
return reactJsxRuntime_production_min;
|
|
52
50
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
53
|
-
var
|
|
51
|
+
var f = React__default.default, g = 60103;
|
|
54
52
|
reactJsxRuntime_production_min.Fragment = 60107;
|
|
55
53
|
if ("function" === typeof Symbol && Symbol.for) {
|
|
56
54
|
var h = Symbol.for;
|
|
57
55
|
g = h("react.element");
|
|
58
56
|
reactJsxRuntime_production_min.Fragment = h("react.fragment");
|
|
59
57
|
}
|
|
60
|
-
var m =
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
void 0 !==
|
|
58
|
+
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 };
|
|
59
|
+
function q(c, a, k) {
|
|
60
|
+
var b, d = {}, e = null, l = null;
|
|
61
|
+
void 0 !== k && (e = "" + k);
|
|
64
62
|
void 0 !== a.key && (e = "" + a.key);
|
|
65
63
|
void 0 !== a.ref && (l = a.ref);
|
|
66
|
-
for (
|
|
67
|
-
n.call(a,
|
|
64
|
+
for (b in a)
|
|
65
|
+
n.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
68
66
|
if (c && c.defaultProps)
|
|
69
|
-
for (
|
|
70
|
-
void 0 ===
|
|
71
|
-
return { $$typeof: g, type: c, key: e, ref: l, props:
|
|
67
|
+
for (b in a = c.defaultProps, a)
|
|
68
|
+
void 0 === d[b] && (d[b] = a[b]);
|
|
69
|
+
return { $$typeof: g, type: c, key: e, ref: l, props: d, _owner: m.current };
|
|
72
70
|
}
|
|
73
|
-
reactJsxRuntime_production_min.jsx =
|
|
74
|
-
reactJsxRuntime_production_min.jsxs =
|
|
71
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
72
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
75
73
|
return reactJsxRuntime_production_min;
|
|
76
74
|
}
|
|
77
75
|
var reactJsxRuntime_development = {};
|
|
@@ -282,7 +280,7 @@ var __publicField = (obj, key, value) => {
|
|
|
282
280
|
currentlyValidatingElement = element;
|
|
283
281
|
}
|
|
284
282
|
}
|
|
285
|
-
function checkPropTypes(typeSpecs, values,
|
|
283
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
286
284
|
{
|
|
287
285
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
288
286
|
for (var typeSpecName in typeSpecs) {
|
|
@@ -290,23 +288,23 @@ var __publicField = (obj, key, value) => {
|
|
|
290
288
|
var error$1 = void 0;
|
|
291
289
|
try {
|
|
292
290
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
293
|
-
var err = Error((componentName || "React class") + ": " +
|
|
291
|
+
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`.");
|
|
294
292
|
err.name = "Invariant Violation";
|
|
295
293
|
throw err;
|
|
296
294
|
}
|
|
297
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName,
|
|
295
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
298
296
|
} catch (ex) {
|
|
299
297
|
error$1 = ex;
|
|
300
298
|
}
|
|
301
299
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
302
300
|
setCurrentlyValidatingElement(element);
|
|
303
|
-
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",
|
|
301
|
+
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);
|
|
304
302
|
setCurrentlyValidatingElement(null);
|
|
305
303
|
}
|
|
306
304
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
307
305
|
loggedTypeFailures[error$1.message] = true;
|
|
308
306
|
setCurrentlyValidatingElement(element);
|
|
309
|
-
error("Failed %s type: %s",
|
|
307
|
+
error("Failed %s type: %s", location, error$1.message);
|
|
310
308
|
setCurrentlyValidatingElement(null);
|
|
311
309
|
}
|
|
312
310
|
}
|
|
@@ -788,20 +786,6 @@ var __publicField = (obj, key, value) => {
|
|
|
788
786
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Link, { ...props, ref });
|
|
789
787
|
})
|
|
790
788
|
};
|
|
791
|
-
function _extends() {
|
|
792
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
793
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
794
|
-
var source = arguments[i];
|
|
795
|
-
for (var key in source) {
|
|
796
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
797
|
-
target[key] = source[key];
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
return target;
|
|
802
|
-
};
|
|
803
|
-
return _extends.apply(this, arguments);
|
|
804
|
-
}
|
|
805
789
|
function warn() {
|
|
806
790
|
if (console && console.warn) {
|
|
807
791
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -982,12 +966,12 @@ var __publicField = (obj, key, value) => {
|
|
|
982
966
|
i18n2.reportNamespaces = new ReportNamespaces();
|
|
983
967
|
if (!i18n2) {
|
|
984
968
|
warnOnce("You will need to pass in an i18next instance by using initReactI18next");
|
|
985
|
-
const notReadyT = (
|
|
969
|
+
const notReadyT = (k, optsOrDefaultValue) => {
|
|
986
970
|
if (typeof optsOrDefaultValue === "string")
|
|
987
971
|
return optsOrDefaultValue;
|
|
988
972
|
if (optsOrDefaultValue && typeof optsOrDefaultValue === "object" && typeof optsOrDefaultValue.defaultValue === "string")
|
|
989
973
|
return optsOrDefaultValue.defaultValue;
|
|
990
|
-
return Array.isArray(
|
|
974
|
+
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
991
975
|
};
|
|
992
976
|
const retNotReady = [notReadyT, {}, false];
|
|
993
977
|
retNotReady.t = notReadyT;
|
|
@@ -1081,16 +1065,52 @@ var __publicField = (obj, key, value) => {
|
|
|
1081
1065
|
}
|
|
1082
1066
|
});
|
|
1083
1067
|
}
|
|
1068
|
+
function useK8sYamlEditor() {
|
|
1069
|
+
function foldSymbol(editor, symbol) {
|
|
1070
|
+
const model = editor.getModel();
|
|
1071
|
+
const matchs = (model == null ? void 0 : model.findMatches(
|
|
1072
|
+
symbol,
|
|
1073
|
+
false,
|
|
1074
|
+
false,
|
|
1075
|
+
false,
|
|
1076
|
+
"",
|
|
1077
|
+
false
|
|
1078
|
+
).filter((match) => match.range.startColumn === 1)) || [];
|
|
1079
|
+
return new Promise(async (resolve, reject) => {
|
|
1080
|
+
try {
|
|
1081
|
+
for (const match of matchs) {
|
|
1082
|
+
const lineNumber = match.range.startLineNumber;
|
|
1083
|
+
editor.setPosition({ lineNumber, column: 1 });
|
|
1084
|
+
await editor.getAction("editor.fold").run();
|
|
1085
|
+
}
|
|
1086
|
+
resolve(null);
|
|
1087
|
+
} catch (e) {
|
|
1088
|
+
reject(e);
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
async function fold(editor) {
|
|
1093
|
+
await editor.getAction("editor.unfoldAll").run();
|
|
1094
|
+
const symbols = [
|
|
1095
|
+
" annotations:",
|
|
1096
|
+
" managedFields:",
|
|
1097
|
+
"status:",
|
|
1098
|
+
" kubectl.kubernetes.io/last-applied-configuration:"
|
|
1099
|
+
];
|
|
1100
|
+
for (const symbol of symbols) {
|
|
1101
|
+
await foldSymbol(editor, symbol);
|
|
1102
|
+
}
|
|
1103
|
+
editor.setScrollPosition({ scrollTop: 0 });
|
|
1104
|
+
}
|
|
1105
|
+
return {
|
|
1106
|
+
fold
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1084
1109
|
function getApiVersion(resourceBasePath) {
|
|
1085
1110
|
return resourceBasePath.replace(/^(\/api\/)|(\/apis\/)/, "");
|
|
1086
1111
|
}
|
|
1087
|
-
function pruneBeforeEdit(
|
|
1088
|
-
|
|
1089
|
-
delete v2.id;
|
|
1090
|
-
(_a = v2.metadata) == null ? true : delete _a.managedFields;
|
|
1091
|
-
if ((_b = v2.metadata) == null ? void 0 : _b.annotations) {
|
|
1092
|
-
delete v2.metadata.annotations["kubectl.kubernetes.io/last-applied-configuration"];
|
|
1093
|
-
}
|
|
1112
|
+
function pruneBeforeEdit(v) {
|
|
1113
|
+
delete v.id;
|
|
1094
1114
|
}
|
|
1095
1115
|
var lodash = { exports: {} };
|
|
1096
1116
|
/**
|
|
@@ -1787,7 +1807,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1787
1807
|
return string.match(reUnicodeWord) || [];
|
|
1788
1808
|
}
|
|
1789
1809
|
var runInContext = function runInContext2(context) {
|
|
1790
|
-
context = context == null ? root :
|
|
1810
|
+
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
1791
1811
|
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
1792
1812
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
1793
1813
|
var coreJsData = context["__core-js_shared__"];
|
|
@@ -3053,7 +3073,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3053
3073
|
end = end === undefined$1 ? length : end;
|
|
3054
3074
|
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
3055
3075
|
}
|
|
3056
|
-
var
|
|
3076
|
+
var clearTimeout = ctxClearTimeout || function(id) {
|
|
3057
3077
|
return root.clearTimeout(id);
|
|
3058
3078
|
};
|
|
3059
3079
|
function cloneBuffer(buffer, isDeep) {
|
|
@@ -4924,7 +4944,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4924
4944
|
}
|
|
4925
4945
|
function cancel2() {
|
|
4926
4946
|
if (timerId !== undefined$1) {
|
|
4927
|
-
|
|
4947
|
+
clearTimeout(timerId);
|
|
4928
4948
|
}
|
|
4929
4949
|
lastInvokeTime = 0;
|
|
4930
4950
|
lastArgs = lastCallTime = lastThis = timerId = undefined$1;
|
|
@@ -4942,7 +4962,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4942
4962
|
return leadingEdge(lastCallTime);
|
|
4943
4963
|
}
|
|
4944
4964
|
if (maxing) {
|
|
4945
|
-
|
|
4965
|
+
clearTimeout(timerId);
|
|
4946
4966
|
timerId = setTimeout2(timerExpired, wait);
|
|
4947
4967
|
return invokeFunc(lastCallTime);
|
|
4948
4968
|
}
|
|
@@ -6003,9 +6023,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6003
6023
|
}
|
|
6004
6024
|
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
|
6005
6025
|
}
|
|
6006
|
-
function uniqueId(
|
|
6026
|
+
function uniqueId(prefix) {
|
|
6007
6027
|
var id = ++idCounter;
|
|
6008
|
-
return toString(
|
|
6028
|
+
return toString(prefix) + id;
|
|
6009
6029
|
}
|
|
6010
6030
|
var add = createMathOperation(function(augend, addend) {
|
|
6011
6031
|
return augend + addend;
|
|
@@ -6521,12 +6541,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6521
6541
|
}
|
|
6522
6542
|
return lodash2;
|
|
6523
6543
|
};
|
|
6524
|
-
var
|
|
6544
|
+
var _ = runInContext();
|
|
6525
6545
|
if (freeModule) {
|
|
6526
|
-
(freeModule.exports =
|
|
6527
|
-
freeExports._ =
|
|
6546
|
+
(freeModule.exports = _)._ = _;
|
|
6547
|
+
freeExports._ = _;
|
|
6528
6548
|
} else {
|
|
6529
|
-
root._ =
|
|
6549
|
+
root._ = _;
|
|
6530
6550
|
}
|
|
6531
6551
|
}).call(commonjsGlobal);
|
|
6532
6552
|
})(lodash, lodash.exports);
|
|
@@ -6594,7 +6614,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6594
6614
|
if (prune.metadata && [
|
|
6595
6615
|
"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta",
|
|
6596
6616
|
"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
|
|
6597
|
-
].some((
|
|
6617
|
+
].some((k) => refKey.includes(k)) && schema.properties) {
|
|
6598
6618
|
schema.properties = lodash.exports.pick(schema.properties, [
|
|
6599
6619
|
"name",
|
|
6600
6620
|
"namespace",
|
|
@@ -6768,8 +6788,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6768
6788
|
overtimeOptions,
|
|
6769
6789
|
editorOptions
|
|
6770
6790
|
} = {}) => {
|
|
6771
|
-
var _a, _b, _c
|
|
6791
|
+
var _a, _b, _c;
|
|
6772
6792
|
const editor = React.useRef(null);
|
|
6793
|
+
const isFoldRef = React.useRef(false);
|
|
6773
6794
|
const { t } = useTranslation();
|
|
6774
6795
|
const [enableEditor, setEnableEditor] = React.useState(false);
|
|
6775
6796
|
const [isYamlValid, setIsYamlValid] = React.useState(true);
|
|
@@ -6784,6 +6805,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6784
6805
|
form: formAnt
|
|
6785
6806
|
});
|
|
6786
6807
|
const { form } = formSF;
|
|
6808
|
+
const { fold } = useK8sYamlEditor();
|
|
6787
6809
|
const useFormCoreResult = core.useForm({
|
|
6788
6810
|
onMutationSuccess: onMutationSuccessProp ? onMutationSuccessProp : void 0,
|
|
6789
6811
|
onMutationError,
|
|
@@ -6813,13 +6835,19 @@ var __publicField = (obj, key, value) => {
|
|
|
6813
6835
|
const { warnWhenUnsavedChanges: warnWhenUnsavedChangesRefine, setWarnWhen } = core.useWarnAboutChange();
|
|
6814
6836
|
const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp != null ? warnWhenUnsavedChangesProp : warnWhenUnsavedChangesRefine;
|
|
6815
6837
|
React__default.default.useEffect(() => {
|
|
6838
|
+
var _a2;
|
|
6816
6839
|
form.resetFields();
|
|
6817
6840
|
if (editor.current) {
|
|
6818
6841
|
const editorValue = yaml__default.default.dump(form.getFieldsValue(true));
|
|
6842
|
+
const editorInstance = editor.current.getEditorInstance();
|
|
6819
6843
|
editor.current.setEditorValue(editorValue);
|
|
6820
6844
|
editor.current.setValue(editorValue);
|
|
6845
|
+
if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
|
|
6846
|
+
fold(editorInstance);
|
|
6847
|
+
isFoldRef.current = true;
|
|
6848
|
+
}
|
|
6821
6849
|
}
|
|
6822
|
-
}, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, form]);
|
|
6850
|
+
}, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, form, fold]);
|
|
6823
6851
|
React__default.default.useEffect(() => {
|
|
6824
6852
|
var _a2, _b2;
|
|
6825
6853
|
const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
|
|
@@ -6858,10 +6886,17 @@ var __publicField = (obj, key, value) => {
|
|
|
6858
6886
|
if (yamlValid && schemaValid) {
|
|
6859
6887
|
setEditorErrors([]);
|
|
6860
6888
|
}
|
|
6889
|
+
},
|
|
6890
|
+
onEditorCreate(editor2) {
|
|
6891
|
+
var _a2;
|
|
6892
|
+
if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && !isFoldRef.current) {
|
|
6893
|
+
fold(editor2);
|
|
6894
|
+
isFoldRef.current = true;
|
|
6895
|
+
}
|
|
6861
6896
|
}
|
|
6862
6897
|
};
|
|
6863
6898
|
const initialValues = ((_c = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _c.data) ? {
|
|
6864
|
-
...(
|
|
6899
|
+
...k8sApiProvider.relationPlugin.restoreItem(queryResult.data.data)
|
|
6865
6900
|
} : void 0;
|
|
6866
6901
|
if (initialValues) {
|
|
6867
6902
|
pruneBeforeEdit(initialValues);
|
|
@@ -6873,8 +6908,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6873
6908
|
onFinish: (values) => {
|
|
6874
6909
|
var _a2;
|
|
6875
6910
|
const errors = [
|
|
6876
|
-
!isYamlValid
|
|
6877
|
-
!isSchemaValid
|
|
6911
|
+
!isYamlValid ? t("dovetail.yaml_format_wrong") : "",
|
|
6912
|
+
!isSchemaValid ? t("dovetail.yaml_value_wrong") : ""
|
|
6878
6913
|
].filter((error) => !!error);
|
|
6879
6914
|
if (errors.length) {
|
|
6880
6915
|
setEditorErrors(errors);
|
|
@@ -7010,13 +7045,13 @@ var __publicField = (obj, key, value) => {
|
|
|
7010
7045
|
!function(t, e) {
|
|
7011
7046
|
module2.exports = e();
|
|
7012
7047
|
}(commonjsGlobal, function() {
|
|
7013
|
-
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month",
|
|
7048
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
7014
7049
|
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
7015
7050
|
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
7016
7051
|
} }, m = function(t2, e2, n2) {
|
|
7017
7052
|
var r2 = String(t2);
|
|
7018
7053
|
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
7019
|
-
},
|
|
7054
|
+
}, v = { s: m, z: function(t2) {
|
|
7020
7055
|
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
7021
7056
|
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
7022
7057
|
}, m: function t2(e2, n2) {
|
|
@@ -7027,53 +7062,53 @@ var __publicField = (obj, key, value) => {
|
|
|
7027
7062
|
}, a: function(t2) {
|
|
7028
7063
|
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
7029
7064
|
}, p: function(t2) {
|
|
7030
|
-
return { M: c, y: h, w: o, d: a, D:
|
|
7065
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
7031
7066
|
}, u: function(t2) {
|
|
7032
7067
|
return void 0 === t2;
|
|
7033
|
-
} }, g = "en",
|
|
7034
|
-
|
|
7035
|
-
var p = "$isDayjsObject",
|
|
7036
|
-
return t2 instanceof
|
|
7037
|
-
},
|
|
7068
|
+
} }, g = "en", D = {};
|
|
7069
|
+
D[g] = M;
|
|
7070
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
7071
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
7072
|
+
}, w = function t2(e2, n2, r2) {
|
|
7038
7073
|
var i2;
|
|
7039
7074
|
if (!e2)
|
|
7040
7075
|
return g;
|
|
7041
7076
|
if ("string" == typeof e2) {
|
|
7042
7077
|
var s2 = e2.toLowerCase();
|
|
7043
|
-
|
|
7078
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
7044
7079
|
var u2 = e2.split("-");
|
|
7045
7080
|
if (!i2 && u2.length > 1)
|
|
7046
7081
|
return t2(u2[0]);
|
|
7047
7082
|
} else {
|
|
7048
7083
|
var a2 = e2.name;
|
|
7049
|
-
|
|
7084
|
+
D[a2] = e2, i2 = a2;
|
|
7050
7085
|
}
|
|
7051
7086
|
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
7052
7087
|
}, O = function(t2, e2) {
|
|
7053
|
-
if (
|
|
7088
|
+
if (S(t2))
|
|
7054
7089
|
return t2.clone();
|
|
7055
7090
|
var n2 = "object" == typeof e2 ? e2 : {};
|
|
7056
|
-
return n2.date = t2, n2.args = arguments, new
|
|
7057
|
-
},
|
|
7058
|
-
|
|
7091
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
7092
|
+
}, b = v;
|
|
7093
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
7059
7094
|
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
7060
7095
|
};
|
|
7061
|
-
var
|
|
7062
|
-
function
|
|
7063
|
-
this.$L =
|
|
7096
|
+
var _ = function() {
|
|
7097
|
+
function M2(t2) {
|
|
7098
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
7064
7099
|
}
|
|
7065
|
-
var m2 =
|
|
7100
|
+
var m2 = M2.prototype;
|
|
7066
7101
|
return m2.parse = function(t2) {
|
|
7067
7102
|
this.$d = function(t3) {
|
|
7068
7103
|
var e2 = t3.date, n2 = t3.utc;
|
|
7069
7104
|
if (null === e2)
|
|
7070
7105
|
return new Date(NaN);
|
|
7071
|
-
if (
|
|
7106
|
+
if (b.u(e2))
|
|
7072
7107
|
return new Date();
|
|
7073
7108
|
if (e2 instanceof Date)
|
|
7074
7109
|
return new Date(e2);
|
|
7075
7110
|
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
7076
|
-
var r2 = e2.match($
|
|
7111
|
+
var r2 = e2.match($);
|
|
7077
7112
|
if (r2) {
|
|
7078
7113
|
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
7079
7114
|
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
@@ -7085,7 +7120,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7085
7120
|
var t2 = this.$d;
|
|
7086
7121
|
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
7087
7122
|
}, m2.$utils = function() {
|
|
7088
|
-
return
|
|
7123
|
+
return b;
|
|
7089
7124
|
}, m2.isValid = function() {
|
|
7090
7125
|
return !(this.$d.toString() === l);
|
|
7091
7126
|
}, m2.isSame = function(t2, e2) {
|
|
@@ -7096,94 +7131,94 @@ var __publicField = (obj, key, value) => {
|
|
|
7096
7131
|
}, m2.isBefore = function(t2, e2) {
|
|
7097
7132
|
return this.endOf(e2) < O(t2);
|
|
7098
7133
|
}, m2.$g = function(t2, e2, n2) {
|
|
7099
|
-
return
|
|
7134
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
7100
7135
|
}, m2.unix = function() {
|
|
7101
7136
|
return Math.floor(this.valueOf() / 1e3);
|
|
7102
7137
|
}, m2.valueOf = function() {
|
|
7103
7138
|
return this.$d.getTime();
|
|
7104
7139
|
}, m2.startOf = function(t2, e2) {
|
|
7105
|
-
var n2 = this, r2 = !!
|
|
7106
|
-
var i2 =
|
|
7140
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
7141
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
7107
7142
|
return r2 ? i2 : i2.endOf(a);
|
|
7108
|
-
}, $
|
|
7109
|
-
return
|
|
7110
|
-
},
|
|
7111
|
-
switch (
|
|
7143
|
+
}, $2 = function(t3, e3) {
|
|
7144
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
7145
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
7146
|
+
switch (f2) {
|
|
7112
7147
|
case h:
|
|
7113
7148
|
return r2 ? l2(1, 0) : l2(31, 11);
|
|
7114
7149
|
case c:
|
|
7115
|
-
return r2 ? l2(1,
|
|
7150
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
7116
7151
|
case o:
|
|
7117
|
-
var g2 = this.$locale().weekStart || 0,
|
|
7118
|
-
return l2(r2 ? m3 -
|
|
7152
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
7153
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
7119
7154
|
case a:
|
|
7120
|
-
case
|
|
7121
|
-
return $
|
|
7155
|
+
case d:
|
|
7156
|
+
return $2(v2 + "Hours", 0);
|
|
7122
7157
|
case u:
|
|
7123
|
-
return $
|
|
7158
|
+
return $2(v2 + "Minutes", 1);
|
|
7124
7159
|
case s:
|
|
7125
|
-
return $
|
|
7160
|
+
return $2(v2 + "Seconds", 2);
|
|
7126
7161
|
case i:
|
|
7127
|
-
return $
|
|
7162
|
+
return $2(v2 + "Milliseconds", 3);
|
|
7128
7163
|
default:
|
|
7129
7164
|
return this.clone();
|
|
7130
7165
|
}
|
|
7131
7166
|
}, m2.endOf = function(t2) {
|
|
7132
7167
|
return this.startOf(t2, false);
|
|
7133
7168
|
}, m2.$set = function(t2, e2) {
|
|
7134
|
-
var n2, o2 =
|
|
7169
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
7135
7170
|
if (o2 === c || o2 === h) {
|
|
7136
|
-
var
|
|
7137
|
-
|
|
7171
|
+
var y2 = this.clone().set(d, 1);
|
|
7172
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
7138
7173
|
} else
|
|
7139
|
-
l2 && this.$d[l2]($
|
|
7174
|
+
l2 && this.$d[l2]($2);
|
|
7140
7175
|
return this.init(), this;
|
|
7141
7176
|
}, m2.set = function(t2, e2) {
|
|
7142
7177
|
return this.clone().$set(t2, e2);
|
|
7143
7178
|
}, m2.get = function(t2) {
|
|
7144
|
-
return this[
|
|
7145
|
-
}, m2.add = function(r2,
|
|
7146
|
-
var
|
|
7179
|
+
return this[b.p(t2)]();
|
|
7180
|
+
}, m2.add = function(r2, f2) {
|
|
7181
|
+
var d2, l2 = this;
|
|
7147
7182
|
r2 = Number(r2);
|
|
7148
|
-
var $
|
|
7183
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
7149
7184
|
var e2 = O(l2);
|
|
7150
|
-
return
|
|
7185
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
7151
7186
|
};
|
|
7152
|
-
if ($
|
|
7187
|
+
if ($2 === c)
|
|
7153
7188
|
return this.set(c, this.$M + r2);
|
|
7154
|
-
if ($
|
|
7189
|
+
if ($2 === h)
|
|
7155
7190
|
return this.set(h, this.$y + r2);
|
|
7156
|
-
if ($
|
|
7157
|
-
return
|
|
7158
|
-
if ($
|
|
7159
|
-
return
|
|
7160
|
-
var
|
|
7161
|
-
return
|
|
7191
|
+
if ($2 === a)
|
|
7192
|
+
return y2(1);
|
|
7193
|
+
if ($2 === o)
|
|
7194
|
+
return y2(7);
|
|
7195
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
7196
|
+
return b.w(m3, this);
|
|
7162
7197
|
}, m2.subtract = function(t2, e2) {
|
|
7163
7198
|
return this.add(-1 * t2, e2);
|
|
7164
7199
|
}, m2.format = function(t2) {
|
|
7165
7200
|
var e2 = this, n2 = this.$locale();
|
|
7166
7201
|
if (!this.isValid())
|
|
7167
7202
|
return n2.invalidDate || l;
|
|
7168
|
-
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 =
|
|
7203
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
7169
7204
|
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
7170
|
-
},
|
|
7171
|
-
return
|
|
7172
|
-
}, $
|
|
7205
|
+
}, d2 = function(t3) {
|
|
7206
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
7207
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
7173
7208
|
var r3 = t3 < 12 ? "AM" : "PM";
|
|
7174
7209
|
return n3 ? r3.toLowerCase() : r3;
|
|
7175
7210
|
};
|
|
7176
|
-
return r2.replace(
|
|
7211
|
+
return r2.replace(y, function(t3, r3) {
|
|
7177
7212
|
return r3 || function(t4) {
|
|
7178
7213
|
switch (t4) {
|
|
7179
7214
|
case "YY":
|
|
7180
7215
|
return String(e2.$y).slice(-2);
|
|
7181
7216
|
case "YYYY":
|
|
7182
|
-
return
|
|
7217
|
+
return b.s(e2.$y, 4, "0");
|
|
7183
7218
|
case "M":
|
|
7184
7219
|
return a2 + 1;
|
|
7185
7220
|
case "MM":
|
|
7186
|
-
return
|
|
7221
|
+
return b.s(a2 + 1, 2, "0");
|
|
7187
7222
|
case "MMM":
|
|
7188
7223
|
return h2(n2.monthsShort, a2, c2, 3);
|
|
7189
7224
|
case "MMMM":
|
|
@@ -7191,7 +7226,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7191
7226
|
case "D":
|
|
7192
7227
|
return e2.$D;
|
|
7193
7228
|
case "DD":
|
|
7194
|
-
return
|
|
7229
|
+
return b.s(e2.$D, 2, "0");
|
|
7195
7230
|
case "d":
|
|
7196
7231
|
return String(e2.$W);
|
|
7197
7232
|
case "dd":
|
|
@@ -7203,25 +7238,25 @@ var __publicField = (obj, key, value) => {
|
|
|
7203
7238
|
case "H":
|
|
7204
7239
|
return String(s2);
|
|
7205
7240
|
case "HH":
|
|
7206
|
-
return
|
|
7241
|
+
return b.s(s2, 2, "0");
|
|
7207
7242
|
case "h":
|
|
7208
|
-
return
|
|
7243
|
+
return d2(1);
|
|
7209
7244
|
case "hh":
|
|
7210
|
-
return
|
|
7245
|
+
return d2(2);
|
|
7211
7246
|
case "a":
|
|
7212
|
-
return $
|
|
7247
|
+
return $2(s2, u2, true);
|
|
7213
7248
|
case "A":
|
|
7214
|
-
return $
|
|
7249
|
+
return $2(s2, u2, false);
|
|
7215
7250
|
case "m":
|
|
7216
7251
|
return String(u2);
|
|
7217
7252
|
case "mm":
|
|
7218
|
-
return
|
|
7253
|
+
return b.s(u2, 2, "0");
|
|
7219
7254
|
case "s":
|
|
7220
7255
|
return String(e2.$s);
|
|
7221
7256
|
case "ss":
|
|
7222
|
-
return
|
|
7257
|
+
return b.s(e2.$s, 2, "0");
|
|
7223
7258
|
case "SSS":
|
|
7224
|
-
return
|
|
7259
|
+
return b.s(e2.$ms, 3, "0");
|
|
7225
7260
|
case "Z":
|
|
7226
7261
|
return i2;
|
|
7227
7262
|
}
|
|
@@ -7230,50 +7265,50 @@ var __publicField = (obj, key, value) => {
|
|
|
7230
7265
|
});
|
|
7231
7266
|
}, m2.utcOffset = function() {
|
|
7232
7267
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
7233
|
-
}, m2.diff = function(r2,
|
|
7234
|
-
var $
|
|
7235
|
-
return
|
|
7268
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
7269
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
7270
|
+
return b.m(y2, m3);
|
|
7236
7271
|
};
|
|
7237
|
-
switch (
|
|
7272
|
+
switch (M3) {
|
|
7238
7273
|
case h:
|
|
7239
|
-
$
|
|
7274
|
+
$2 = D2() / 12;
|
|
7240
7275
|
break;
|
|
7241
7276
|
case c:
|
|
7242
|
-
$
|
|
7277
|
+
$2 = D2();
|
|
7243
7278
|
break;
|
|
7244
|
-
case
|
|
7245
|
-
$
|
|
7279
|
+
case f:
|
|
7280
|
+
$2 = D2() / 3;
|
|
7246
7281
|
break;
|
|
7247
7282
|
case o:
|
|
7248
|
-
$
|
|
7283
|
+
$2 = (g2 - v2) / 6048e5;
|
|
7249
7284
|
break;
|
|
7250
7285
|
case a:
|
|
7251
|
-
$
|
|
7286
|
+
$2 = (g2 - v2) / 864e5;
|
|
7252
7287
|
break;
|
|
7253
7288
|
case u:
|
|
7254
|
-
$
|
|
7289
|
+
$2 = g2 / n;
|
|
7255
7290
|
break;
|
|
7256
7291
|
case s:
|
|
7257
|
-
$
|
|
7292
|
+
$2 = g2 / e;
|
|
7258
7293
|
break;
|
|
7259
7294
|
case i:
|
|
7260
|
-
$
|
|
7295
|
+
$2 = g2 / t;
|
|
7261
7296
|
break;
|
|
7262
7297
|
default:
|
|
7263
|
-
$
|
|
7298
|
+
$2 = g2;
|
|
7264
7299
|
}
|
|
7265
|
-
return l2 ? $
|
|
7300
|
+
return l2 ? $2 : b.a($2);
|
|
7266
7301
|
}, m2.daysInMonth = function() {
|
|
7267
7302
|
return this.endOf(c).$D;
|
|
7268
7303
|
}, m2.$locale = function() {
|
|
7269
|
-
return
|
|
7304
|
+
return D[this.$L];
|
|
7270
7305
|
}, m2.locale = function(t2, e2) {
|
|
7271
7306
|
if (!t2)
|
|
7272
7307
|
return this.$L;
|
|
7273
|
-
var n2 = this.clone(), r2 =
|
|
7308
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
7274
7309
|
return r2 && (n2.$L = r2), n2;
|
|
7275
7310
|
}, m2.clone = function() {
|
|
7276
|
-
return
|
|
7311
|
+
return b.w(this.$d, this);
|
|
7277
7312
|
}, m2.toDate = function() {
|
|
7278
7313
|
return new Date(this.valueOf());
|
|
7279
7314
|
}, m2.toJSON = function() {
|
|
@@ -7282,17 +7317,17 @@ var __publicField = (obj, key, value) => {
|
|
|
7282
7317
|
return this.$d.toISOString();
|
|
7283
7318
|
}, m2.toString = function() {
|
|
7284
7319
|
return this.$d.toUTCString();
|
|
7285
|
-
},
|
|
7286
|
-
}(),
|
|
7287
|
-
return O.prototype =
|
|
7288
|
-
|
|
7320
|
+
}, M2;
|
|
7321
|
+
}(), k = _.prototype;
|
|
7322
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
7323
|
+
k[t2[1]] = function(e2) {
|
|
7289
7324
|
return this.$g(e2, t2[0], t2[1]);
|
|
7290
7325
|
};
|
|
7291
7326
|
}), O.extend = function(t2, e2) {
|
|
7292
|
-
return t2.$i || (t2(e2,
|
|
7293
|
-
}, O.locale =
|
|
7327
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
7328
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
7294
7329
|
return O(1e3 * t2);
|
|
7295
|
-
}, O.en =
|
|
7330
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
7296
7331
|
});
|
|
7297
7332
|
})(dayjs_min);
|
|
7298
7333
|
const dayjs = dayjs_min.exports;
|
|
@@ -7343,13 +7378,13 @@ var __publicField = (obj, key, value) => {
|
|
|
7343
7378
|
const canScale = record.kind === "Deployment" || record.kind === "StatefulSet";
|
|
7344
7379
|
const currentReplicas = lodashEs.get(record, "spec.replicas", 0);
|
|
7345
7380
|
const scale = (delta) => {
|
|
7346
|
-
const
|
|
7347
|
-
const id =
|
|
7348
|
-
pruneBeforeEdit(
|
|
7381
|
+
const v = record.scale(currentReplicas + delta);
|
|
7382
|
+
const id = v.id;
|
|
7383
|
+
pruneBeforeEdit(v);
|
|
7349
7384
|
mutate({
|
|
7350
7385
|
id,
|
|
7351
7386
|
resource: (resource == null ? void 0 : resource.name) || "",
|
|
7352
|
-
values:
|
|
7387
|
+
values: v
|
|
7353
7388
|
});
|
|
7354
7389
|
};
|
|
7355
7390
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs("span", {
|
|
@@ -7392,9 +7427,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7392
7427
|
}
|
|
7393
7428
|
);
|
|
7394
7429
|
};
|
|
7395
|
-
const CommonSorter = (dataIndex) => (a,
|
|
7430
|
+
const CommonSorter = (dataIndex) => (a, b) => {
|
|
7396
7431
|
const valA = lodash.exports.get(a, dataIndex);
|
|
7397
|
-
const valB = lodash.exports.get(
|
|
7432
|
+
const valB = lodash.exports.get(b, dataIndex);
|
|
7398
7433
|
if (valA === valB)
|
|
7399
7434
|
return 0;
|
|
7400
7435
|
if (valA > valB)
|
|
@@ -7410,8 +7445,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7410
7445
|
title: i18n2.t("name"),
|
|
7411
7446
|
sortable: true,
|
|
7412
7447
|
sorter: CommonSorter(dataIndex),
|
|
7413
|
-
render: (
|
|
7414
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(NameLink, { name:
|
|
7448
|
+
render: (v, record) => {
|
|
7449
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(NameLink, { name: v, id: record.id, resource });
|
|
7415
7450
|
}
|
|
7416
7451
|
};
|
|
7417
7452
|
};
|
|
@@ -7435,7 +7470,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7435
7470
|
title: i18n2.t("phase"),
|
|
7436
7471
|
sortable: true,
|
|
7437
7472
|
sorter: CommonSorter(dataIndex),
|
|
7438
|
-
render: (
|
|
7473
|
+
render: (v) => /* @__PURE__ */ jsxRuntime.exports.jsx(StateTag, { state: v })
|
|
7439
7474
|
};
|
|
7440
7475
|
};
|
|
7441
7476
|
const WorkloadImageColumnRenderer = (i18n2) => {
|
|
@@ -7461,7 +7496,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7461
7496
|
title: i18n2.t("replicas"),
|
|
7462
7497
|
sortable: true,
|
|
7463
7498
|
sorter: CommonSorter(dataIndex),
|
|
7464
|
-
render: (
|
|
7499
|
+
render: (_, record) => {
|
|
7465
7500
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(WorkloadReplicas, { record });
|
|
7466
7501
|
}
|
|
7467
7502
|
};
|
|
@@ -7474,9 +7509,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7474
7509
|
dataIndex,
|
|
7475
7510
|
title: i18n2.t("created_time"),
|
|
7476
7511
|
sortable: true,
|
|
7477
|
-
sorter: (a,
|
|
7512
|
+
sorter: (a, b) => {
|
|
7478
7513
|
const valA = new Date(lodash.exports.get(a, dataIndex));
|
|
7479
|
-
const valB = new Date(lodash.exports.get(
|
|
7514
|
+
const valB = new Date(lodash.exports.get(b, dataIndex));
|
|
7480
7515
|
if (valA === valB)
|
|
7481
7516
|
return 0;
|
|
7482
7517
|
if (valA > valB)
|
|
@@ -7532,6 +7567,17 @@ var __publicField = (obj, key, value) => {
|
|
|
7532
7567
|
sorter: CommonSorter(dataIndex)
|
|
7533
7568
|
};
|
|
7534
7569
|
};
|
|
7570
|
+
const ServiceTypeColumnRenderer = (i18n2) => {
|
|
7571
|
+
const dataIndex = ["rawYaml", "spec", "type"];
|
|
7572
|
+
return {
|
|
7573
|
+
key: "type",
|
|
7574
|
+
title: i18n2.t("dovetail.type"),
|
|
7575
|
+
display: true,
|
|
7576
|
+
dataIndex,
|
|
7577
|
+
sortable: true,
|
|
7578
|
+
sorter: CommonSorter(dataIndex)
|
|
7579
|
+
};
|
|
7580
|
+
};
|
|
7535
7581
|
function download(filename, content) {
|
|
7536
7582
|
const element = document.createElement("a");
|
|
7537
7583
|
element.setAttribute(
|
|
@@ -7836,7 +7882,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7836
7882
|
display: true,
|
|
7837
7883
|
dataIndex: [],
|
|
7838
7884
|
title: () => /* @__PURE__ */ jsxRuntime.exports.jsx(eagle.Icon, { src: iconsReact.SettingsGear16GradientGrayIcon }),
|
|
7839
|
-
render: (
|
|
7885
|
+
render: (_, record) => {
|
|
7840
7886
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(Dropdown, { data: record });
|
|
7841
7887
|
}
|
|
7842
7888
|
};
|
|
@@ -8968,7 +9014,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8968
9014
|
}
|
|
8969
9015
|
);
|
|
8970
9016
|
};
|
|
8971
|
-
const WorkloadPodsTable_z2tsj7 = "";
|
|
8972
9017
|
function matchSelector(pod, selector) {
|
|
8973
9018
|
var _a, _b, _c;
|
|
8974
9019
|
let match = true;
|
|
@@ -8979,6 +9024,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8979
9024
|
}
|
|
8980
9025
|
return match;
|
|
8981
9026
|
}
|
|
9027
|
+
const WorkloadPodsTable_z2tsj7 = "";
|
|
8982
9028
|
const WorkloadPodsTable = ({
|
|
8983
9029
|
selector
|
|
8984
9030
|
}) => {
|
|
@@ -9039,7 +9085,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9039
9085
|
key: "Replicas",
|
|
9040
9086
|
title: i18n2.t("replicas"),
|
|
9041
9087
|
path: ["status", "replicas"],
|
|
9042
|
-
render: (
|
|
9088
|
+
render: (_, record) => {
|
|
9043
9089
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(WorkloadReplicas, { record });
|
|
9044
9090
|
}
|
|
9045
9091
|
};
|
|
@@ -9054,12 +9100,12 @@ var __publicField = (obj, key, value) => {
|
|
|
9054
9100
|
}
|
|
9055
9101
|
};
|
|
9056
9102
|
};
|
|
9057
|
-
const PodsField = (
|
|
9103
|
+
const PodsField = (_) => {
|
|
9058
9104
|
return {
|
|
9059
9105
|
key: "pods",
|
|
9060
9106
|
title: "Pods",
|
|
9061
9107
|
path: [],
|
|
9062
|
-
render: (
|
|
9108
|
+
render: (_2, record) => {
|
|
9063
9109
|
var _a, _b;
|
|
9064
9110
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9065
9111
|
WorkloadPodsTable,
|
|
@@ -9072,12 +9118,12 @@ var __publicField = (obj, key, value) => {
|
|
|
9072
9118
|
}
|
|
9073
9119
|
};
|
|
9074
9120
|
};
|
|
9075
|
-
const JobsField = (
|
|
9121
|
+
const JobsField = (_) => {
|
|
9076
9122
|
return {
|
|
9077
9123
|
key: "jobs",
|
|
9078
9124
|
title: "Jobs",
|
|
9079
9125
|
path: [],
|
|
9080
|
-
render: (
|
|
9126
|
+
render: (_2, record) => {
|
|
9081
9127
|
var _a, _b, _c;
|
|
9082
9128
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9083
9129
|
CronjobJobsTable,
|
|
@@ -9128,6 +9174,45 @@ var __publicField = (obj, key, value) => {
|
|
|
9128
9174
|
}
|
|
9129
9175
|
};
|
|
9130
9176
|
};
|
|
9177
|
+
const ServiceTypeField = (i18n2) => {
|
|
9178
|
+
return {
|
|
9179
|
+
key: "type",
|
|
9180
|
+
title: i18n2.t("dovetail.type"),
|
|
9181
|
+
path: ["rawYaml", "spec", "type"]
|
|
9182
|
+
};
|
|
9183
|
+
};
|
|
9184
|
+
const ClusterIpField = (i18n2) => {
|
|
9185
|
+
return {
|
|
9186
|
+
key: "clusterIp",
|
|
9187
|
+
title: i18n2.t("dovetail.clusterIp"),
|
|
9188
|
+
path: ["rawYaml", "spec", "clusterIP"]
|
|
9189
|
+
};
|
|
9190
|
+
};
|
|
9191
|
+
const SessionAffinityField = (i18n2) => {
|
|
9192
|
+
return {
|
|
9193
|
+
key: "clusterIp",
|
|
9194
|
+
title: i18n2.t("dovetail.sessionAffinity"),
|
|
9195
|
+
path: ["rawYaml", "spec", "sessionAffinity"]
|
|
9196
|
+
};
|
|
9197
|
+
};
|
|
9198
|
+
const ServicePodsField = (_) => {
|
|
9199
|
+
return {
|
|
9200
|
+
key: "pods",
|
|
9201
|
+
title: "Pods",
|
|
9202
|
+
path: [],
|
|
9203
|
+
render: (_2, record) => {
|
|
9204
|
+
var _a, _b;
|
|
9205
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9206
|
+
WorkloadPodsTable,
|
|
9207
|
+
{
|
|
9208
|
+
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r) => {
|
|
9209
|
+
return r.kind === "Pod" && r.type === "selects";
|
|
9210
|
+
})) == null ? void 0 : _b.selector
|
|
9211
|
+
}
|
|
9212
|
+
);
|
|
9213
|
+
}
|
|
9214
|
+
};
|
|
9215
|
+
};
|
|
9131
9216
|
const style_inzxm5 = "";
|
|
9132
9217
|
const ToolBarStyle = "t1joof7s";
|
|
9133
9218
|
const ToolBarHeaderStyle = "tti58uh";
|
|
@@ -9335,6 +9420,9 @@ var __publicField = (obj, key, value) => {
|
|
|
9335
9420
|
const {
|
|
9336
9421
|
t
|
|
9337
9422
|
} = useTranslation();
|
|
9423
|
+
const {
|
|
9424
|
+
fold
|
|
9425
|
+
} = useK8sYamlEditor();
|
|
9338
9426
|
const {
|
|
9339
9427
|
data: data2
|
|
9340
9428
|
} = queryResult;
|
|
@@ -9463,8 +9551,11 @@ var __publicField = (obj, key, value) => {
|
|
|
9463
9551
|
}),
|
|
9464
9552
|
["yaml"]: /* @__PURE__ */ jsxRuntime.exports.jsx(MonacoYamlEditor$1, {
|
|
9465
9553
|
className: EditorStyle$1,
|
|
9466
|
-
defaultValue: yaml__default.default.dump(
|
|
9554
|
+
defaultValue: yaml__default.default.dump(lodashEs.omit(k8sApiProvider.relationPlugin.restoreItem(data2.data), "id")),
|
|
9467
9555
|
schema: {},
|
|
9556
|
+
onEditorCreate: (editor) => {
|
|
9557
|
+
fold(editor);
|
|
9558
|
+
},
|
|
9468
9559
|
readOnly: true
|
|
9469
9560
|
})
|
|
9470
9561
|
};
|
|
@@ -9517,7 +9608,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9517
9608
|
title: i18n2.t("state"),
|
|
9518
9609
|
sortable: true,
|
|
9519
9610
|
sorter: CommonSorter(["state"]),
|
|
9520
|
-
render: (
|
|
9611
|
+
render: (v) => /* @__PURE__ */ jsxRuntime.exports.jsx(StateTag, { state: Object.keys(v)[0] })
|
|
9521
9612
|
},
|
|
9522
9613
|
{
|
|
9523
9614
|
key: "ready",
|
|
@@ -9525,10 +9616,10 @@ var __publicField = (obj, key, value) => {
|
|
|
9525
9616
|
title: i18n2.t("ready"),
|
|
9526
9617
|
sortable: true,
|
|
9527
9618
|
sorter: CommonSorter(["ready"]),
|
|
9528
|
-
render: (
|
|
9619
|
+
render: (v) => /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9529
9620
|
eagle.Icon,
|
|
9530
9621
|
{
|
|
9531
|
-
src:
|
|
9622
|
+
src: v ? iconsReact.CheckmarkDoneSuccessCorrect16BoldGreenIcon : iconsReact.XmarkFailed16BoldRedIcon
|
|
9532
9623
|
}
|
|
9533
9624
|
)
|
|
9534
9625
|
},
|
|
@@ -9550,7 +9641,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9550
9641
|
key: "init",
|
|
9551
9642
|
dataIndex: [],
|
|
9552
9643
|
title: i18n2.t("init_container"),
|
|
9553
|
-
render: (
|
|
9644
|
+
render: (_, record) => {
|
|
9554
9645
|
const isInit = initContainerStatuses.some(
|
|
9555
9646
|
(c) => c.containerID === record.containerID
|
|
9556
9647
|
);
|
|
@@ -9607,13 +9698,13 @@ var __publicField = (obj, key, value) => {
|
|
|
9607
9698
|
kit.menu.Item,
|
|
9608
9699
|
{
|
|
9609
9700
|
onClick: () => {
|
|
9610
|
-
const
|
|
9611
|
-
const id =
|
|
9612
|
-
pruneBeforeEdit(
|
|
9701
|
+
const v = data2.redeploy();
|
|
9702
|
+
const id = v.id;
|
|
9703
|
+
pruneBeforeEdit(v);
|
|
9613
9704
|
mutate({
|
|
9614
9705
|
id,
|
|
9615
9706
|
resource: (resource == null ? void 0 : resource.name) || "",
|
|
9616
|
-
values:
|
|
9707
|
+
values: v
|
|
9617
9708
|
});
|
|
9618
9709
|
},
|
|
9619
9710
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(eagle.Icon, { src: iconsReact.DynamicResourceSchedule16BlueIcon, children: t("dovetail.redeploy") })
|
|
@@ -9716,7 +9807,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9716
9807
|
getEditorValue: () => {
|
|
9717
9808
|
var _a;
|
|
9718
9809
|
return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) || "";
|
|
9719
|
-
}
|
|
9810
|
+
},
|
|
9811
|
+
getEditorInstance: () => editorInstance.current || null
|
|
9720
9812
|
};
|
|
9721
9813
|
});
|
|
9722
9814
|
const onChange = React.useCallback(
|
|
@@ -10053,7 +10145,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10053
10145
|
const { i18n: i18n2 } = useTranslation();
|
|
10054
10146
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment, { children: configs.map((config) => {
|
|
10055
10147
|
var _a, _b;
|
|
10056
|
-
const formatter = config.formatter || ((
|
|
10148
|
+
const formatter = config.formatter || ((v) => new ResourceModel(v));
|
|
10057
10149
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(React__default.default.Fragment, { children: [
|
|
10058
10150
|
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}`, exact: true, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
10059
10151
|
ResourceList,
|
|
@@ -10089,13 +10181,13 @@ var __publicField = (obj, key, value) => {
|
|
|
10089
10181
|
kit.menu.Item,
|
|
10090
10182
|
{
|
|
10091
10183
|
onClick: () => {
|
|
10092
|
-
const
|
|
10093
|
-
const id =
|
|
10094
|
-
pruneBeforeEdit(
|
|
10184
|
+
const v = suspended ? data2.resume() : data2.suspend();
|
|
10185
|
+
const id = v.id;
|
|
10186
|
+
pruneBeforeEdit(v);
|
|
10095
10187
|
mutate({
|
|
10096
10188
|
id,
|
|
10097
10189
|
resource: (resource == null ? void 0 : resource.name) || "",
|
|
10098
|
-
values:
|
|
10190
|
+
values: v
|
|
10099
10191
|
});
|
|
10100
10192
|
},
|
|
10101
10193
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(eagle.Icon, { src: suspended ? iconsReact.VmResume16Icon : iconsReact.SuspendedPause16GradientGrayIcon, children: t(suspended ? "dovetail.resume" : "dovetail.suspend") })
|
|
@@ -10282,1265 +10374,6 @@ var __publicField = (obj, key, value) => {
|
|
|
10282
10374
|
}
|
|
10283
10375
|
);
|
|
10284
10376
|
};
|
|
10285
|
-
function isAbsolute(pathname) {
|
|
10286
|
-
return pathname.charAt(0) === "/";
|
|
10287
|
-
}
|
|
10288
|
-
function spliceOne(list, index) {
|
|
10289
|
-
for (var i = index, k2 = i + 1, n = list.length; k2 < n; i += 1, k2 += 1) {
|
|
10290
|
-
list[i] = list[k2];
|
|
10291
|
-
}
|
|
10292
|
-
list.pop();
|
|
10293
|
-
}
|
|
10294
|
-
function resolvePathname(to, from) {
|
|
10295
|
-
if (from === void 0)
|
|
10296
|
-
from = "";
|
|
10297
|
-
var toParts = to && to.split("/") || [];
|
|
10298
|
-
var fromParts = from && from.split("/") || [];
|
|
10299
|
-
var isToAbs = to && isAbsolute(to);
|
|
10300
|
-
var isFromAbs = from && isAbsolute(from);
|
|
10301
|
-
var mustEndAbs = isToAbs || isFromAbs;
|
|
10302
|
-
if (to && isAbsolute(to)) {
|
|
10303
|
-
fromParts = toParts;
|
|
10304
|
-
} else if (toParts.length) {
|
|
10305
|
-
fromParts.pop();
|
|
10306
|
-
fromParts = fromParts.concat(toParts);
|
|
10307
|
-
}
|
|
10308
|
-
if (!fromParts.length)
|
|
10309
|
-
return "/";
|
|
10310
|
-
var hasTrailingSlash;
|
|
10311
|
-
if (fromParts.length) {
|
|
10312
|
-
var last = fromParts[fromParts.length - 1];
|
|
10313
|
-
hasTrailingSlash = last === "." || last === ".." || last === "";
|
|
10314
|
-
} else {
|
|
10315
|
-
hasTrailingSlash = false;
|
|
10316
|
-
}
|
|
10317
|
-
var up = 0;
|
|
10318
|
-
for (var i = fromParts.length; i >= 0; i--) {
|
|
10319
|
-
var part = fromParts[i];
|
|
10320
|
-
if (part === ".") {
|
|
10321
|
-
spliceOne(fromParts, i);
|
|
10322
|
-
} else if (part === "..") {
|
|
10323
|
-
spliceOne(fromParts, i);
|
|
10324
|
-
up++;
|
|
10325
|
-
} else if (up) {
|
|
10326
|
-
spliceOne(fromParts, i);
|
|
10327
|
-
up--;
|
|
10328
|
-
}
|
|
10329
|
-
}
|
|
10330
|
-
if (!mustEndAbs)
|
|
10331
|
-
for (; up--; up)
|
|
10332
|
-
fromParts.unshift("..");
|
|
10333
|
-
if (mustEndAbs && fromParts[0] !== "" && (!fromParts[0] || !isAbsolute(fromParts[0])))
|
|
10334
|
-
fromParts.unshift("");
|
|
10335
|
-
var result = fromParts.join("/");
|
|
10336
|
-
if (hasTrailingSlash && result.substr(-1) !== "/")
|
|
10337
|
-
result += "/";
|
|
10338
|
-
return result;
|
|
10339
|
-
}
|
|
10340
|
-
var isProduction$1 = process.env.NODE_ENV === "production";
|
|
10341
|
-
function warning(condition2, message2) {
|
|
10342
|
-
if (!isProduction$1) {
|
|
10343
|
-
if (condition2) {
|
|
10344
|
-
return;
|
|
10345
|
-
}
|
|
10346
|
-
var text = "Warning: " + message2;
|
|
10347
|
-
if (typeof console !== "undefined") {
|
|
10348
|
-
console.warn(text);
|
|
10349
|
-
}
|
|
10350
|
-
try {
|
|
10351
|
-
throw Error(text);
|
|
10352
|
-
} catch (x2) {
|
|
10353
|
-
}
|
|
10354
|
-
}
|
|
10355
|
-
}
|
|
10356
|
-
var isProduction = process.env.NODE_ENV === "production";
|
|
10357
|
-
var prefix = "Invariant failed";
|
|
10358
|
-
function invariant(condition2, message2) {
|
|
10359
|
-
if (condition2) {
|
|
10360
|
-
return;
|
|
10361
|
-
}
|
|
10362
|
-
if (isProduction) {
|
|
10363
|
-
throw new Error(prefix);
|
|
10364
|
-
}
|
|
10365
|
-
var provided = typeof message2 === "function" ? message2() : message2;
|
|
10366
|
-
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
10367
|
-
throw new Error(value);
|
|
10368
|
-
}
|
|
10369
|
-
function addLeadingSlash(path) {
|
|
10370
|
-
return path.charAt(0) === "/" ? path : "/" + path;
|
|
10371
|
-
}
|
|
10372
|
-
function stripLeadingSlash(path) {
|
|
10373
|
-
return path.charAt(0) === "/" ? path.substr(1) : path;
|
|
10374
|
-
}
|
|
10375
|
-
function hasBasename(path, prefix2) {
|
|
10376
|
-
return path.toLowerCase().indexOf(prefix2.toLowerCase()) === 0 && "/?#".indexOf(path.charAt(prefix2.length)) !== -1;
|
|
10377
|
-
}
|
|
10378
|
-
function stripBasename(path, prefix2) {
|
|
10379
|
-
return hasBasename(path, prefix2) ? path.substr(prefix2.length) : path;
|
|
10380
|
-
}
|
|
10381
|
-
function stripTrailingSlash(path) {
|
|
10382
|
-
return path.charAt(path.length - 1) === "/" ? path.slice(0, -1) : path;
|
|
10383
|
-
}
|
|
10384
|
-
function parsePath(path) {
|
|
10385
|
-
var pathname = path || "/";
|
|
10386
|
-
var search = "";
|
|
10387
|
-
var hash = "";
|
|
10388
|
-
var hashIndex = pathname.indexOf("#");
|
|
10389
|
-
if (hashIndex !== -1) {
|
|
10390
|
-
hash = pathname.substr(hashIndex);
|
|
10391
|
-
pathname = pathname.substr(0, hashIndex);
|
|
10392
|
-
}
|
|
10393
|
-
var searchIndex = pathname.indexOf("?");
|
|
10394
|
-
if (searchIndex !== -1) {
|
|
10395
|
-
search = pathname.substr(searchIndex);
|
|
10396
|
-
pathname = pathname.substr(0, searchIndex);
|
|
10397
|
-
}
|
|
10398
|
-
return {
|
|
10399
|
-
pathname,
|
|
10400
|
-
search: search === "?" ? "" : search,
|
|
10401
|
-
hash: hash === "#" ? "" : hash
|
|
10402
|
-
};
|
|
10403
|
-
}
|
|
10404
|
-
function createPath(location2) {
|
|
10405
|
-
var pathname = location2.pathname, search = location2.search, hash = location2.hash;
|
|
10406
|
-
var path = pathname || "/";
|
|
10407
|
-
if (search && search !== "?")
|
|
10408
|
-
path += search.charAt(0) === "?" ? search : "?" + search;
|
|
10409
|
-
if (hash && hash !== "#")
|
|
10410
|
-
path += hash.charAt(0) === "#" ? hash : "#" + hash;
|
|
10411
|
-
return path;
|
|
10412
|
-
}
|
|
10413
|
-
function createLocation(path, state2, key, currentLocation) {
|
|
10414
|
-
var location2;
|
|
10415
|
-
if (typeof path === "string") {
|
|
10416
|
-
location2 = parsePath(path);
|
|
10417
|
-
location2.state = state2;
|
|
10418
|
-
} else {
|
|
10419
|
-
location2 = _extends({}, path);
|
|
10420
|
-
if (location2.pathname === void 0)
|
|
10421
|
-
location2.pathname = "";
|
|
10422
|
-
if (location2.search) {
|
|
10423
|
-
if (location2.search.charAt(0) !== "?")
|
|
10424
|
-
location2.search = "?" + location2.search;
|
|
10425
|
-
} else {
|
|
10426
|
-
location2.search = "";
|
|
10427
|
-
}
|
|
10428
|
-
if (location2.hash) {
|
|
10429
|
-
if (location2.hash.charAt(0) !== "#")
|
|
10430
|
-
location2.hash = "#" + location2.hash;
|
|
10431
|
-
} else {
|
|
10432
|
-
location2.hash = "";
|
|
10433
|
-
}
|
|
10434
|
-
if (state2 !== void 0 && location2.state === void 0)
|
|
10435
|
-
location2.state = state2;
|
|
10436
|
-
}
|
|
10437
|
-
try {
|
|
10438
|
-
location2.pathname = decodeURI(location2.pathname);
|
|
10439
|
-
} catch (e) {
|
|
10440
|
-
if (e instanceof URIError) {
|
|
10441
|
-
throw new URIError('Pathname "' + location2.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.');
|
|
10442
|
-
} else {
|
|
10443
|
-
throw e;
|
|
10444
|
-
}
|
|
10445
|
-
}
|
|
10446
|
-
if (key)
|
|
10447
|
-
location2.key = key;
|
|
10448
|
-
if (currentLocation) {
|
|
10449
|
-
if (!location2.pathname) {
|
|
10450
|
-
location2.pathname = currentLocation.pathname;
|
|
10451
|
-
} else if (location2.pathname.charAt(0) !== "/") {
|
|
10452
|
-
location2.pathname = resolvePathname(location2.pathname, currentLocation.pathname);
|
|
10453
|
-
}
|
|
10454
|
-
} else {
|
|
10455
|
-
if (!location2.pathname) {
|
|
10456
|
-
location2.pathname = "/";
|
|
10457
|
-
}
|
|
10458
|
-
}
|
|
10459
|
-
return location2;
|
|
10460
|
-
}
|
|
10461
|
-
function createTransitionManager() {
|
|
10462
|
-
var prompt = null;
|
|
10463
|
-
function setPrompt(nextPrompt) {
|
|
10464
|
-
process.env.NODE_ENV !== "production" ? warning(prompt == null, "A history supports only one prompt at a time") : void 0;
|
|
10465
|
-
prompt = nextPrompt;
|
|
10466
|
-
return function() {
|
|
10467
|
-
if (prompt === nextPrompt)
|
|
10468
|
-
prompt = null;
|
|
10469
|
-
};
|
|
10470
|
-
}
|
|
10471
|
-
function confirmTransitionTo(location2, action, getUserConfirmation, callback) {
|
|
10472
|
-
if (prompt != null) {
|
|
10473
|
-
var result = typeof prompt === "function" ? prompt(location2, action) : prompt;
|
|
10474
|
-
if (typeof result === "string") {
|
|
10475
|
-
if (typeof getUserConfirmation === "function") {
|
|
10476
|
-
getUserConfirmation(result, callback);
|
|
10477
|
-
} else {
|
|
10478
|
-
process.env.NODE_ENV !== "production" ? warning(false, "A history needs a getUserConfirmation function in order to use a prompt message") : void 0;
|
|
10479
|
-
callback(true);
|
|
10480
|
-
}
|
|
10481
|
-
} else {
|
|
10482
|
-
callback(result !== false);
|
|
10483
|
-
}
|
|
10484
|
-
} else {
|
|
10485
|
-
callback(true);
|
|
10486
|
-
}
|
|
10487
|
-
}
|
|
10488
|
-
var listeners = [];
|
|
10489
|
-
function appendListener(fn) {
|
|
10490
|
-
var isActive = true;
|
|
10491
|
-
function listener() {
|
|
10492
|
-
if (isActive)
|
|
10493
|
-
fn.apply(void 0, arguments);
|
|
10494
|
-
}
|
|
10495
|
-
listeners.push(listener);
|
|
10496
|
-
return function() {
|
|
10497
|
-
isActive = false;
|
|
10498
|
-
listeners = listeners.filter(function(item) {
|
|
10499
|
-
return item !== listener;
|
|
10500
|
-
});
|
|
10501
|
-
};
|
|
10502
|
-
}
|
|
10503
|
-
function notifyListeners() {
|
|
10504
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10505
|
-
args[_key] = arguments[_key];
|
|
10506
|
-
}
|
|
10507
|
-
listeners.forEach(function(listener) {
|
|
10508
|
-
return listener.apply(void 0, args);
|
|
10509
|
-
});
|
|
10510
|
-
}
|
|
10511
|
-
return {
|
|
10512
|
-
setPrompt,
|
|
10513
|
-
confirmTransitionTo,
|
|
10514
|
-
appendListener,
|
|
10515
|
-
notifyListeners
|
|
10516
|
-
};
|
|
10517
|
-
}
|
|
10518
|
-
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
10519
|
-
function getConfirmation(message2, callback) {
|
|
10520
|
-
callback(window.confirm(message2));
|
|
10521
|
-
}
|
|
10522
|
-
function supportsHistory() {
|
|
10523
|
-
var ua = window.navigator.userAgent;
|
|
10524
|
-
if ((ua.indexOf("Android 2.") !== -1 || ua.indexOf("Android 4.0") !== -1) && ua.indexOf("Mobile Safari") !== -1 && ua.indexOf("Chrome") === -1 && ua.indexOf("Windows Phone") === -1)
|
|
10525
|
-
return false;
|
|
10526
|
-
return window.history && "pushState" in window.history;
|
|
10527
|
-
}
|
|
10528
|
-
function supportsPopStateOnHashChange() {
|
|
10529
|
-
return window.navigator.userAgent.indexOf("Trident") === -1;
|
|
10530
|
-
}
|
|
10531
|
-
function supportsGoWithoutReloadUsingHash() {
|
|
10532
|
-
return window.navigator.userAgent.indexOf("Firefox") === -1;
|
|
10533
|
-
}
|
|
10534
|
-
function isExtraneousPopstateEvent(event) {
|
|
10535
|
-
return event.state === void 0 && navigator.userAgent.indexOf("CriOS") === -1;
|
|
10536
|
-
}
|
|
10537
|
-
var PopStateEvent = "popstate";
|
|
10538
|
-
var HashChangeEvent = "hashchange";
|
|
10539
|
-
function getHistoryState() {
|
|
10540
|
-
try {
|
|
10541
|
-
return window.history.state || {};
|
|
10542
|
-
} catch (e) {
|
|
10543
|
-
return {};
|
|
10544
|
-
}
|
|
10545
|
-
}
|
|
10546
|
-
function createBrowserHistory(props) {
|
|
10547
|
-
if (props === void 0) {
|
|
10548
|
-
props = {};
|
|
10549
|
-
}
|
|
10550
|
-
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, "Browser history needs a DOM") : invariant(false) : void 0;
|
|
10551
|
-
var globalHistory = window.history;
|
|
10552
|
-
var canUseHistory = supportsHistory();
|
|
10553
|
-
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
|
10554
|
-
var _props = props, _props$forceRefresh = _props.forceRefresh, forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
|
10555
|
-
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : "";
|
|
10556
|
-
function getDOMLocation(historyState) {
|
|
10557
|
-
var _ref = historyState || {}, key = _ref.key, state2 = _ref.state;
|
|
10558
|
-
var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash;
|
|
10559
|
-
var path = pathname + search + hash;
|
|
10560
|
-
process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
|
|
10561
|
-
if (basename)
|
|
10562
|
-
path = stripBasename(path, basename);
|
|
10563
|
-
return createLocation(path, state2, key);
|
|
10564
|
-
}
|
|
10565
|
-
function createKey() {
|
|
10566
|
-
return Math.random().toString(36).substr(2, keyLength);
|
|
10567
|
-
}
|
|
10568
|
-
var transitionManager = createTransitionManager();
|
|
10569
|
-
function setState(nextState) {
|
|
10570
|
-
_extends(history, nextState);
|
|
10571
|
-
history.length = globalHistory.length;
|
|
10572
|
-
transitionManager.notifyListeners(history.location, history.action);
|
|
10573
|
-
}
|
|
10574
|
-
function handlePopState(event) {
|
|
10575
|
-
if (isExtraneousPopstateEvent(event))
|
|
10576
|
-
return;
|
|
10577
|
-
handlePop(getDOMLocation(event.state));
|
|
10578
|
-
}
|
|
10579
|
-
function handleHashChange() {
|
|
10580
|
-
handlePop(getDOMLocation(getHistoryState()));
|
|
10581
|
-
}
|
|
10582
|
-
var forceNextPop = false;
|
|
10583
|
-
function handlePop(location2) {
|
|
10584
|
-
if (forceNextPop) {
|
|
10585
|
-
forceNextPop = false;
|
|
10586
|
-
setState();
|
|
10587
|
-
} else {
|
|
10588
|
-
var action = "POP";
|
|
10589
|
-
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10590
|
-
if (ok) {
|
|
10591
|
-
setState({
|
|
10592
|
-
action,
|
|
10593
|
-
location: location2
|
|
10594
|
-
});
|
|
10595
|
-
} else {
|
|
10596
|
-
revertPop(location2);
|
|
10597
|
-
}
|
|
10598
|
-
});
|
|
10599
|
-
}
|
|
10600
|
-
}
|
|
10601
|
-
function revertPop(fromLocation) {
|
|
10602
|
-
var toLocation = history.location;
|
|
10603
|
-
var toIndex = allKeys.indexOf(toLocation.key);
|
|
10604
|
-
if (toIndex === -1)
|
|
10605
|
-
toIndex = 0;
|
|
10606
|
-
var fromIndex = allKeys.indexOf(fromLocation.key);
|
|
10607
|
-
if (fromIndex === -1)
|
|
10608
|
-
fromIndex = 0;
|
|
10609
|
-
var delta = toIndex - fromIndex;
|
|
10610
|
-
if (delta) {
|
|
10611
|
-
forceNextPop = true;
|
|
10612
|
-
go(delta);
|
|
10613
|
-
}
|
|
10614
|
-
}
|
|
10615
|
-
var initialLocation = getDOMLocation(getHistoryState());
|
|
10616
|
-
var allKeys = [initialLocation.key];
|
|
10617
|
-
function createHref(location2) {
|
|
10618
|
-
return basename + createPath(location2);
|
|
10619
|
-
}
|
|
10620
|
-
function push(path, state2) {
|
|
10621
|
-
process.env.NODE_ENV !== "production" ? warning(!(typeof path === "object" && path.state !== void 0 && state2 !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored") : void 0;
|
|
10622
|
-
var action = "PUSH";
|
|
10623
|
-
var location2 = createLocation(path, state2, createKey(), history.location);
|
|
10624
|
-
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10625
|
-
if (!ok)
|
|
10626
|
-
return;
|
|
10627
|
-
var href = createHref(location2);
|
|
10628
|
-
var key = location2.key, state3 = location2.state;
|
|
10629
|
-
if (canUseHistory) {
|
|
10630
|
-
globalHistory.pushState({
|
|
10631
|
-
key,
|
|
10632
|
-
state: state3
|
|
10633
|
-
}, null, href);
|
|
10634
|
-
if (forceRefresh) {
|
|
10635
|
-
window.location.href = href;
|
|
10636
|
-
} else {
|
|
10637
|
-
var prevIndex = allKeys.indexOf(history.location.key);
|
|
10638
|
-
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
|
10639
|
-
nextKeys.push(location2.key);
|
|
10640
|
-
allKeys = nextKeys;
|
|
10641
|
-
setState({
|
|
10642
|
-
action,
|
|
10643
|
-
location: location2
|
|
10644
|
-
});
|
|
10645
|
-
}
|
|
10646
|
-
} else {
|
|
10647
|
-
process.env.NODE_ENV !== "production" ? warning(state3 === void 0, "Browser history cannot push state in browsers that do not support HTML5 history") : void 0;
|
|
10648
|
-
window.location.href = href;
|
|
10649
|
-
}
|
|
10650
|
-
});
|
|
10651
|
-
}
|
|
10652
|
-
function replace(path, state2) {
|
|
10653
|
-
process.env.NODE_ENV !== "production" ? warning(!(typeof path === "object" && path.state !== void 0 && state2 !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored") : void 0;
|
|
10654
|
-
var action = "REPLACE";
|
|
10655
|
-
var location2 = createLocation(path, state2, createKey(), history.location);
|
|
10656
|
-
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10657
|
-
if (!ok)
|
|
10658
|
-
return;
|
|
10659
|
-
var href = createHref(location2);
|
|
10660
|
-
var key = location2.key, state3 = location2.state;
|
|
10661
|
-
if (canUseHistory) {
|
|
10662
|
-
globalHistory.replaceState({
|
|
10663
|
-
key,
|
|
10664
|
-
state: state3
|
|
10665
|
-
}, null, href);
|
|
10666
|
-
if (forceRefresh) {
|
|
10667
|
-
window.location.replace(href);
|
|
10668
|
-
} else {
|
|
10669
|
-
var prevIndex = allKeys.indexOf(history.location.key);
|
|
10670
|
-
if (prevIndex !== -1)
|
|
10671
|
-
allKeys[prevIndex] = location2.key;
|
|
10672
|
-
setState({
|
|
10673
|
-
action,
|
|
10674
|
-
location: location2
|
|
10675
|
-
});
|
|
10676
|
-
}
|
|
10677
|
-
} else {
|
|
10678
|
-
process.env.NODE_ENV !== "production" ? warning(state3 === void 0, "Browser history cannot replace state in browsers that do not support HTML5 history") : void 0;
|
|
10679
|
-
window.location.replace(href);
|
|
10680
|
-
}
|
|
10681
|
-
});
|
|
10682
|
-
}
|
|
10683
|
-
function go(n) {
|
|
10684
|
-
globalHistory.go(n);
|
|
10685
|
-
}
|
|
10686
|
-
function goBack() {
|
|
10687
|
-
go(-1);
|
|
10688
|
-
}
|
|
10689
|
-
function goForward() {
|
|
10690
|
-
go(1);
|
|
10691
|
-
}
|
|
10692
|
-
var listenerCount = 0;
|
|
10693
|
-
function checkDOMListeners(delta) {
|
|
10694
|
-
listenerCount += delta;
|
|
10695
|
-
if (listenerCount === 1 && delta === 1) {
|
|
10696
|
-
window.addEventListener(PopStateEvent, handlePopState);
|
|
10697
|
-
if (needsHashChangeListener)
|
|
10698
|
-
window.addEventListener(HashChangeEvent, handleHashChange);
|
|
10699
|
-
} else if (listenerCount === 0) {
|
|
10700
|
-
window.removeEventListener(PopStateEvent, handlePopState);
|
|
10701
|
-
if (needsHashChangeListener)
|
|
10702
|
-
window.removeEventListener(HashChangeEvent, handleHashChange);
|
|
10703
|
-
}
|
|
10704
|
-
}
|
|
10705
|
-
var isBlocked = false;
|
|
10706
|
-
function block(prompt) {
|
|
10707
|
-
if (prompt === void 0) {
|
|
10708
|
-
prompt = false;
|
|
10709
|
-
}
|
|
10710
|
-
var unblock = transitionManager.setPrompt(prompt);
|
|
10711
|
-
if (!isBlocked) {
|
|
10712
|
-
checkDOMListeners(1);
|
|
10713
|
-
isBlocked = true;
|
|
10714
|
-
}
|
|
10715
|
-
return function() {
|
|
10716
|
-
if (isBlocked) {
|
|
10717
|
-
isBlocked = false;
|
|
10718
|
-
checkDOMListeners(-1);
|
|
10719
|
-
}
|
|
10720
|
-
return unblock();
|
|
10721
|
-
};
|
|
10722
|
-
}
|
|
10723
|
-
function listen(listener) {
|
|
10724
|
-
var unlisten = transitionManager.appendListener(listener);
|
|
10725
|
-
checkDOMListeners(1);
|
|
10726
|
-
return function() {
|
|
10727
|
-
checkDOMListeners(-1);
|
|
10728
|
-
unlisten();
|
|
10729
|
-
};
|
|
10730
|
-
}
|
|
10731
|
-
var history = {
|
|
10732
|
-
length: globalHistory.length,
|
|
10733
|
-
action: "POP",
|
|
10734
|
-
location: initialLocation,
|
|
10735
|
-
createHref,
|
|
10736
|
-
push,
|
|
10737
|
-
replace,
|
|
10738
|
-
go,
|
|
10739
|
-
goBack,
|
|
10740
|
-
goForward,
|
|
10741
|
-
block,
|
|
10742
|
-
listen
|
|
10743
|
-
};
|
|
10744
|
-
return history;
|
|
10745
|
-
}
|
|
10746
|
-
var HashChangeEvent$1 = "hashchange";
|
|
10747
|
-
var HashPathCoders = {
|
|
10748
|
-
hashbang: {
|
|
10749
|
-
encodePath: function encodePath(path) {
|
|
10750
|
-
return path.charAt(0) === "!" ? path : "!/" + stripLeadingSlash(path);
|
|
10751
|
-
},
|
|
10752
|
-
decodePath: function decodePath(path) {
|
|
10753
|
-
return path.charAt(0) === "!" ? path.substr(1) : path;
|
|
10754
|
-
}
|
|
10755
|
-
},
|
|
10756
|
-
noslash: {
|
|
10757
|
-
encodePath: stripLeadingSlash,
|
|
10758
|
-
decodePath: addLeadingSlash
|
|
10759
|
-
},
|
|
10760
|
-
slash: {
|
|
10761
|
-
encodePath: addLeadingSlash,
|
|
10762
|
-
decodePath: addLeadingSlash
|
|
10763
|
-
}
|
|
10764
|
-
};
|
|
10765
|
-
function stripHash(url) {
|
|
10766
|
-
var hashIndex = url.indexOf("#");
|
|
10767
|
-
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
10768
|
-
}
|
|
10769
|
-
function getHashPath() {
|
|
10770
|
-
var href = window.location.href;
|
|
10771
|
-
var hashIndex = href.indexOf("#");
|
|
10772
|
-
return hashIndex === -1 ? "" : href.substring(hashIndex + 1);
|
|
10773
|
-
}
|
|
10774
|
-
function pushHashPath(path) {
|
|
10775
|
-
window.location.hash = path;
|
|
10776
|
-
}
|
|
10777
|
-
function replaceHashPath(path) {
|
|
10778
|
-
window.location.replace(stripHash(window.location.href) + "#" + path);
|
|
10779
|
-
}
|
|
10780
|
-
function createHashHistory(props) {
|
|
10781
|
-
if (props === void 0) {
|
|
10782
|
-
props = {};
|
|
10783
|
-
}
|
|
10784
|
-
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, "Hash history needs a DOM") : invariant(false) : void 0;
|
|
10785
|
-
var globalHistory = window.history;
|
|
10786
|
-
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
|
10787
|
-
var _props = props, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$hashType = _props.hashType, hashType = _props$hashType === void 0 ? "slash" : _props$hashType;
|
|
10788
|
-
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : "";
|
|
10789
|
-
var _HashPathCoders$hashT = HashPathCoders[hashType], encodePath = _HashPathCoders$hashT.encodePath, decodePath = _HashPathCoders$hashT.decodePath;
|
|
10790
|
-
function getDOMLocation() {
|
|
10791
|
-
var path2 = decodePath(getHashPath());
|
|
10792
|
-
process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path2, basename), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + path2 + '" to begin with "' + basename + '".') : void 0;
|
|
10793
|
-
if (basename)
|
|
10794
|
-
path2 = stripBasename(path2, basename);
|
|
10795
|
-
return createLocation(path2);
|
|
10796
|
-
}
|
|
10797
|
-
var transitionManager = createTransitionManager();
|
|
10798
|
-
function setState(nextState) {
|
|
10799
|
-
_extends(history, nextState);
|
|
10800
|
-
history.length = globalHistory.length;
|
|
10801
|
-
transitionManager.notifyListeners(history.location, history.action);
|
|
10802
|
-
}
|
|
10803
|
-
var forceNextPop = false;
|
|
10804
|
-
var ignorePath = null;
|
|
10805
|
-
function locationsAreEqual$$1(a, b2) {
|
|
10806
|
-
return a.pathname === b2.pathname && a.search === b2.search && a.hash === b2.hash;
|
|
10807
|
-
}
|
|
10808
|
-
function handleHashChange() {
|
|
10809
|
-
var path2 = getHashPath();
|
|
10810
|
-
var encodedPath2 = encodePath(path2);
|
|
10811
|
-
if (path2 !== encodedPath2) {
|
|
10812
|
-
replaceHashPath(encodedPath2);
|
|
10813
|
-
} else {
|
|
10814
|
-
var location2 = getDOMLocation();
|
|
10815
|
-
var prevLocation = history.location;
|
|
10816
|
-
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location2))
|
|
10817
|
-
return;
|
|
10818
|
-
if (ignorePath === createPath(location2))
|
|
10819
|
-
return;
|
|
10820
|
-
ignorePath = null;
|
|
10821
|
-
handlePop(location2);
|
|
10822
|
-
}
|
|
10823
|
-
}
|
|
10824
|
-
function handlePop(location2) {
|
|
10825
|
-
if (forceNextPop) {
|
|
10826
|
-
forceNextPop = false;
|
|
10827
|
-
setState();
|
|
10828
|
-
} else {
|
|
10829
|
-
var action = "POP";
|
|
10830
|
-
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10831
|
-
if (ok) {
|
|
10832
|
-
setState({
|
|
10833
|
-
action,
|
|
10834
|
-
location: location2
|
|
10835
|
-
});
|
|
10836
|
-
} else {
|
|
10837
|
-
revertPop(location2);
|
|
10838
|
-
}
|
|
10839
|
-
});
|
|
10840
|
-
}
|
|
10841
|
-
}
|
|
10842
|
-
function revertPop(fromLocation) {
|
|
10843
|
-
var toLocation = history.location;
|
|
10844
|
-
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
|
10845
|
-
if (toIndex === -1)
|
|
10846
|
-
toIndex = 0;
|
|
10847
|
-
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
|
10848
|
-
if (fromIndex === -1)
|
|
10849
|
-
fromIndex = 0;
|
|
10850
|
-
var delta = toIndex - fromIndex;
|
|
10851
|
-
if (delta) {
|
|
10852
|
-
forceNextPop = true;
|
|
10853
|
-
go(delta);
|
|
10854
|
-
}
|
|
10855
|
-
}
|
|
10856
|
-
var path = getHashPath();
|
|
10857
|
-
var encodedPath = encodePath(path);
|
|
10858
|
-
if (path !== encodedPath)
|
|
10859
|
-
replaceHashPath(encodedPath);
|
|
10860
|
-
var initialLocation = getDOMLocation();
|
|
10861
|
-
var allPaths = [createPath(initialLocation)];
|
|
10862
|
-
function createHref(location2) {
|
|
10863
|
-
var baseTag = document.querySelector("base");
|
|
10864
|
-
var href = "";
|
|
10865
|
-
if (baseTag && baseTag.getAttribute("href")) {
|
|
10866
|
-
href = stripHash(window.location.href);
|
|
10867
|
-
}
|
|
10868
|
-
return href + "#" + encodePath(basename + createPath(location2));
|
|
10869
|
-
}
|
|
10870
|
-
function push(path2, state2) {
|
|
10871
|
-
process.env.NODE_ENV !== "production" ? warning(state2 === void 0, "Hash history cannot push state; it is ignored") : void 0;
|
|
10872
|
-
var action = "PUSH";
|
|
10873
|
-
var location2 = createLocation(path2, void 0, void 0, history.location);
|
|
10874
|
-
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10875
|
-
if (!ok)
|
|
10876
|
-
return;
|
|
10877
|
-
var path3 = createPath(location2);
|
|
10878
|
-
var encodedPath2 = encodePath(basename + path3);
|
|
10879
|
-
var hashChanged = getHashPath() !== encodedPath2;
|
|
10880
|
-
if (hashChanged) {
|
|
10881
|
-
ignorePath = path3;
|
|
10882
|
-
pushHashPath(encodedPath2);
|
|
10883
|
-
var prevIndex = allPaths.lastIndexOf(createPath(history.location));
|
|
10884
|
-
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
|
10885
|
-
nextPaths.push(path3);
|
|
10886
|
-
allPaths = nextPaths;
|
|
10887
|
-
setState({
|
|
10888
|
-
action,
|
|
10889
|
-
location: location2
|
|
10890
|
-
});
|
|
10891
|
-
} else {
|
|
10892
|
-
process.env.NODE_ENV !== "production" ? warning(false, "Hash history cannot PUSH the same path; a new entry will not be added to the history stack") : void 0;
|
|
10893
|
-
setState();
|
|
10894
|
-
}
|
|
10895
|
-
});
|
|
10896
|
-
}
|
|
10897
|
-
function replace(path2, state2) {
|
|
10898
|
-
process.env.NODE_ENV !== "production" ? warning(state2 === void 0, "Hash history cannot replace state; it is ignored") : void 0;
|
|
10899
|
-
var action = "REPLACE";
|
|
10900
|
-
var location2 = createLocation(path2, void 0, void 0, history.location);
|
|
10901
|
-
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10902
|
-
if (!ok)
|
|
10903
|
-
return;
|
|
10904
|
-
var path3 = createPath(location2);
|
|
10905
|
-
var encodedPath2 = encodePath(basename + path3);
|
|
10906
|
-
var hashChanged = getHashPath() !== encodedPath2;
|
|
10907
|
-
if (hashChanged) {
|
|
10908
|
-
ignorePath = path3;
|
|
10909
|
-
replaceHashPath(encodedPath2);
|
|
10910
|
-
}
|
|
10911
|
-
var prevIndex = allPaths.indexOf(createPath(history.location));
|
|
10912
|
-
if (prevIndex !== -1)
|
|
10913
|
-
allPaths[prevIndex] = path3;
|
|
10914
|
-
setState({
|
|
10915
|
-
action,
|
|
10916
|
-
location: location2
|
|
10917
|
-
});
|
|
10918
|
-
});
|
|
10919
|
-
}
|
|
10920
|
-
function go(n) {
|
|
10921
|
-
process.env.NODE_ENV !== "production" ? warning(canGoWithoutReload, "Hash history go(n) causes a full page reload in this browser") : void 0;
|
|
10922
|
-
globalHistory.go(n);
|
|
10923
|
-
}
|
|
10924
|
-
function goBack() {
|
|
10925
|
-
go(-1);
|
|
10926
|
-
}
|
|
10927
|
-
function goForward() {
|
|
10928
|
-
go(1);
|
|
10929
|
-
}
|
|
10930
|
-
var listenerCount = 0;
|
|
10931
|
-
function checkDOMListeners(delta) {
|
|
10932
|
-
listenerCount += delta;
|
|
10933
|
-
if (listenerCount === 1 && delta === 1) {
|
|
10934
|
-
window.addEventListener(HashChangeEvent$1, handleHashChange);
|
|
10935
|
-
} else if (listenerCount === 0) {
|
|
10936
|
-
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
|
10937
|
-
}
|
|
10938
|
-
}
|
|
10939
|
-
var isBlocked = false;
|
|
10940
|
-
function block(prompt) {
|
|
10941
|
-
if (prompt === void 0) {
|
|
10942
|
-
prompt = false;
|
|
10943
|
-
}
|
|
10944
|
-
var unblock = transitionManager.setPrompt(prompt);
|
|
10945
|
-
if (!isBlocked) {
|
|
10946
|
-
checkDOMListeners(1);
|
|
10947
|
-
isBlocked = true;
|
|
10948
|
-
}
|
|
10949
|
-
return function() {
|
|
10950
|
-
if (isBlocked) {
|
|
10951
|
-
isBlocked = false;
|
|
10952
|
-
checkDOMListeners(-1);
|
|
10953
|
-
}
|
|
10954
|
-
return unblock();
|
|
10955
|
-
};
|
|
10956
|
-
}
|
|
10957
|
-
function listen(listener) {
|
|
10958
|
-
var unlisten = transitionManager.appendListener(listener);
|
|
10959
|
-
checkDOMListeners(1);
|
|
10960
|
-
return function() {
|
|
10961
|
-
checkDOMListeners(-1);
|
|
10962
|
-
unlisten();
|
|
10963
|
-
};
|
|
10964
|
-
}
|
|
10965
|
-
var history = {
|
|
10966
|
-
length: globalHistory.length,
|
|
10967
|
-
action: "POP",
|
|
10968
|
-
location: initialLocation,
|
|
10969
|
-
createHref,
|
|
10970
|
-
push,
|
|
10971
|
-
replace,
|
|
10972
|
-
go,
|
|
10973
|
-
goBack,
|
|
10974
|
-
goForward,
|
|
10975
|
-
block,
|
|
10976
|
-
listen
|
|
10977
|
-
};
|
|
10978
|
-
return history;
|
|
10979
|
-
}
|
|
10980
|
-
var lib = {};
|
|
10981
|
-
Object.defineProperty(lib, "__esModule", { value: true });
|
|
10982
|
-
var y = require$$0__default.default;
|
|
10983
|
-
var U = lodash.exports;
|
|
10984
|
-
var et = require$$2__default.default;
|
|
10985
|
-
function _interopDefault$1(e) {
|
|
10986
|
-
return e && e.__esModule ? e : { default: e };
|
|
10987
|
-
}
|
|
10988
|
-
var y__default = /* @__PURE__ */ _interopDefault$1(y);
|
|
10989
|
-
var U__default = /* @__PURE__ */ _interopDefault$1(U);
|
|
10990
|
-
var et__default = /* @__PURE__ */ _interopDefault$1(et);
|
|
10991
|
-
var z = Object.defineProperty, q = Object.defineProperties;
|
|
10992
|
-
var X = Object.getOwnPropertyDescriptors;
|
|
10993
|
-
var D = Object.getOwnPropertySymbols;
|
|
10994
|
-
var I = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
10995
|
-
var C = (s, t, r) => t in s ? z(s, t, { enumerable: true, configurable: true, writable: true, value: r }) : s[t] = r, f = (s, t) => {
|
|
10996
|
-
for (var r in t || (t = {}))
|
|
10997
|
-
I.call(t, r) && C(s, r, t[r]);
|
|
10998
|
-
if (D)
|
|
10999
|
-
for (var r of D(t))
|
|
11000
|
-
K.call(t, r) && C(s, r, t[r]);
|
|
11001
|
-
return s;
|
|
11002
|
-
}, b = (s, t) => q(s, X(t));
|
|
11003
|
-
var k = (s, t) => {
|
|
11004
|
-
var r = {};
|
|
11005
|
-
for (var e in s)
|
|
11006
|
-
I.call(s, e) && t.indexOf(e) < 0 && (r[e] = s[e]);
|
|
11007
|
-
if (s != null && D)
|
|
11008
|
-
for (var e of D(s))
|
|
11009
|
-
t.indexOf(e) < 0 && K.call(s, e) && (r[e] = s[e]);
|
|
11010
|
-
return r;
|
|
11011
|
-
};
|
|
11012
|
-
var d = (s, t, r) => new Promise((e, a) => {
|
|
11013
|
-
var o = (c) => {
|
|
11014
|
-
try {
|
|
11015
|
-
n(r.next(c));
|
|
11016
|
-
} catch (u) {
|
|
11017
|
-
a(u);
|
|
11018
|
-
}
|
|
11019
|
-
}, i = (c) => {
|
|
11020
|
-
try {
|
|
11021
|
-
n(r.throw(c));
|
|
11022
|
-
} catch (u) {
|
|
11023
|
-
a(u);
|
|
11024
|
-
}
|
|
11025
|
-
}, n = (c) => c.done ? e(c.value) : Promise.resolve(c.value).then(o, i);
|
|
11026
|
-
n((r = r.apply(s, t)).next());
|
|
11027
|
-
});
|
|
11028
|
-
var W = class {
|
|
11029
|
-
processData(t) {
|
|
11030
|
-
let { kind: r, apiVersion: e } = t;
|
|
11031
|
-
return t.items = t.items.map((a) => this.processItem(b(f({}, a), { kind: r.replace(/List$/g, ""), apiVersion: e }))), t;
|
|
11032
|
-
}
|
|
11033
|
-
processItem(t) {
|
|
11034
|
-
return this.processPodSelector(t), t;
|
|
11035
|
-
}
|
|
11036
|
-
restoreData(t) {
|
|
11037
|
-
return t.items = t.items.map((r) => this.restoreItem(r)), t;
|
|
11038
|
-
}
|
|
11039
|
-
restoreItem(t) {
|
|
11040
|
-
return delete t.metadata.relations, t;
|
|
11041
|
-
}
|
|
11042
|
-
processPodSelector(t) {
|
|
11043
|
-
let { spec: r, kind: e } = t, a = r == null ? void 0 : r.selector;
|
|
11044
|
-
if (!a || !e || !["Deployment", "DaemonSet", "StatefulSet", "ReplicaSet", "Job", "Service"].includes(e))
|
|
11045
|
-
return t;
|
|
11046
|
-
if (!a.matchLabels && !a.matchExpressions) {
|
|
11047
|
-
a.matchLabels = {};
|
|
11048
|
-
for (let o in a)
|
|
11049
|
-
a.matchLabels[o] = a[o];
|
|
11050
|
-
}
|
|
11051
|
-
return this.appendRelation(t, { kind: "Pod", apiVersion: "v1", type: e === "Service" ? "selects" : "creates", selector: a, inbound: false }), t;
|
|
11052
|
-
}
|
|
11053
|
-
appendRelation(t, r) {
|
|
11054
|
-
let e = t.metadata;
|
|
11055
|
-
return e.relations || (e.relations = []), e.relations.push(r), t;
|
|
11056
|
-
}
|
|
11057
|
-
}, v = new W();
|
|
11058
|
-
function R(s, ...t) {
|
|
11059
|
-
return console.log(`[REFINE K8s ${s}]`, ...t);
|
|
11060
|
-
}
|
|
11061
|
-
function rt({ resourceBasePath: s, namespace: t, resource: r, name: e }) {
|
|
11062
|
-
let a = [s];
|
|
11063
|
-
return t && a.push(`namespaces/${t}`), a.push(r), e && a.push(e), a.join("/");
|
|
11064
|
-
}
|
|
11065
|
-
function G(s, t) {
|
|
11066
|
-
if (s.indexOf(`
|
|
11067
|
-
`) === -1)
|
|
11068
|
-
return s;
|
|
11069
|
-
let e = s.slice(0, s.indexOf(`
|
|
11070
|
-
`)), a = s.slice(s.indexOf(`
|
|
11071
|
-
`) + 1);
|
|
11072
|
-
return t(e), G(a, t);
|
|
11073
|
-
}
|
|
11074
|
-
function V(s) {
|
|
11075
|
-
clearTimeout(s.pingTimeout), s.pingTimeout = setTimeout(() => {
|
|
11076
|
-
s.close();
|
|
11077
|
-
}, 3e4 * 1.5);
|
|
11078
|
-
}
|
|
11079
|
-
var L = et__default.default(), E = class {
|
|
11080
|
-
constructor(t) {
|
|
11081
|
-
this.options = t;
|
|
11082
|
-
this.maxTimeout = Math.pow(2, 10) * 1e3;
|
|
11083
|
-
this.retryTimes = 0;
|
|
11084
|
-
let { objectConstructor: r, basePath: e, watchWsBasePath: a } = t;
|
|
11085
|
-
this.options = t, this.watchWsBasePath = a, this.basePath = e, this.resourceBasePath = r.resourceBasePath, this.namespace = r.namespace, this.resource = r.resource;
|
|
11086
|
-
}
|
|
11087
|
-
resetRetryState() {
|
|
11088
|
-
this.retryTimes = 0, clearTimeout(this.retryTimer), this.retryTimer = void 0;
|
|
11089
|
-
}
|
|
11090
|
-
list() {
|
|
11091
|
-
return d(this, arguments, function* ({ namespace: t, query: r, fetchOptions: e } = {}) {
|
|
11092
|
-
let a = this.getUrl({ namespace: t });
|
|
11093
|
-
return yield y__default.default.get(a, f({ searchParams: r, retry: 0 }, e || {})).json();
|
|
11094
|
-
});
|
|
11095
|
-
}
|
|
11096
|
-
listWatch() {
|
|
11097
|
-
return d(this, arguments, function* ({ namespace: t, query: r, onResponse: e, onEvent: a } = {}) {
|
|
11098
|
-
let o = this.getUrl({ namespace: t }), i = this.watchWsBasePath ? this.getUrl({ namespace: t }, void 0, true) : o, n = yield this.list({ namespace: t, query: r, fetchOptions: { timeout: false } }), c = this.watch(i, n, e, a, this.listWatch.bind(this, { namespace: t, query: r, onResponse: e, onEvent: a }));
|
|
11099
|
-
return e == null || e(n), c;
|
|
11100
|
-
});
|
|
11101
|
-
}
|
|
11102
|
-
watch(t, r, e, a, o) {
|
|
11103
|
-
return d(this, null, function* () {
|
|
11104
|
-
let { items: i } = r, n = [], c = (u) => {
|
|
11105
|
-
if (u.type === "PING")
|
|
11106
|
-
return;
|
|
11107
|
-
R("INFORMER", u);
|
|
11108
|
-
let h = u.object.metadata.name, p = u.object.metadata.namespace;
|
|
11109
|
-
switch (u.type) {
|
|
11110
|
-
case "ADDED": {
|
|
11111
|
-
let l = false;
|
|
11112
|
-
i = i.map((m) => m.metadata.name === h && m.metadata.namespace === p ? (l = true, u.object) : m).concat(l ? [] : [u.object]);
|
|
11113
|
-
break;
|
|
11114
|
-
}
|
|
11115
|
-
case "MODIFIED":
|
|
11116
|
-
i = i.map((l) => l.metadata.name === h && l.metadata.namespace === p ? u.object : l);
|
|
11117
|
-
break;
|
|
11118
|
-
case "DELETED":
|
|
11119
|
-
i = i.filter((l) => l.metadata.name !== h || l.metadata.namespace !== p);
|
|
11120
|
-
break;
|
|
11121
|
-
}
|
|
11122
|
-
e == null || e(b(f({}, r), { items: i })), a == null || a(u);
|
|
11123
|
-
};
|
|
11124
|
-
return n.push(this.watchBySdk(r, c)), this.watchWsBasePath ? n.push(this.watchByWebsocket(t, r, c, o)) : n.push(this.watchByHttp(t, r, c, o)), () => {
|
|
11125
|
-
n.forEach((u) => u());
|
|
11126
|
-
};
|
|
11127
|
-
});
|
|
11128
|
-
}
|
|
11129
|
-
watchBySdk(t, r) {
|
|
11130
|
-
let e = (a) => {
|
|
11131
|
-
let { type: o, basePath: i, items: n } = a;
|
|
11132
|
-
i === this.basePath && n.forEach((c) => {
|
|
11133
|
-
c.apiVersion === t.apiVersion && c.kind === t.kind.replace(/List$/g, "") && r({ type: o, object: c });
|
|
11134
|
-
});
|
|
11135
|
-
};
|
|
11136
|
-
return L.on("change", e), () => {
|
|
11137
|
-
L.off("change", e);
|
|
11138
|
-
};
|
|
11139
|
-
}
|
|
11140
|
-
watchByWebsocket(t, r, e, a) {
|
|
11141
|
-
let { resourceVersion: o = "" } = r.metadata, i = location.protocol.includes("https") ? "wss" : "ws", n = new WebSocket(t.includes("://") ? `${t}?resourceVersion=${o}&watch=1` : `${i}://${location.host}/${t}?resourceVersion=${o}&watch=1`), c = false, u = () => {
|
|
11142
|
-
n.readyState === n.OPEN ? n.close(3001, "DOVETAIL_MANUAL_CLOSE") : c = true;
|
|
11143
|
-
};
|
|
11144
|
-
function h() {
|
|
11145
|
-
u();
|
|
11146
|
-
}
|
|
11147
|
-
return n.addEventListener("open", () => {
|
|
11148
|
-
if (c) {
|
|
11149
|
-
n.close(3001, "DOVETAIL_MANUAL_CLOSE");
|
|
11150
|
-
return;
|
|
11151
|
-
}
|
|
11152
|
-
V(n);
|
|
11153
|
-
}), n.addEventListener("message", function(p) {
|
|
11154
|
-
let l = JSON.parse(p.data);
|
|
11155
|
-
V(n), e(l);
|
|
11156
|
-
}), n.addEventListener("close", (p) => {
|
|
11157
|
-
clearTimeout(n.pingTimeout), p.reason !== "DOVETAIL_MANUAL_CLOSE" && (this.retryFunc(() => d(this, null, function* () {
|
|
11158
|
-
u = yield a();
|
|
11159
|
-
})), u = () => {
|
|
11160
|
-
clearTimeout(this.retryTimer);
|
|
11161
|
-
});
|
|
11162
|
-
}), h;
|
|
11163
|
-
}
|
|
11164
|
-
watchByHttp(t, r, e, a) {
|
|
11165
|
-
let { resourceVersion: o = "" } = r.metadata, i = new AbortController(), { signal: n } = i, c = () => i.abort();
|
|
11166
|
-
function u() {
|
|
11167
|
-
c();
|
|
11168
|
-
}
|
|
11169
|
-
return d(this, null, function* () {
|
|
11170
|
-
var h;
|
|
11171
|
-
try {
|
|
11172
|
-
let l = (h = (yield y__default.default.get(t, { searchParams: { watch: 1, resourceVersion: o }, timeout: false, signal: n })).body) == null ? void 0 : h.getReader(), m = new TextDecoder("utf-8"), P = "";
|
|
11173
|
-
(function H() {
|
|
11174
|
-
return d(this, null, function* () {
|
|
11175
|
-
if (!l)
|
|
11176
|
-
return Promise.reject();
|
|
11177
|
-
let { done: J, value: Y } = yield l.read();
|
|
11178
|
-
return J ? Promise.resolve() : (P += m.decode(Y), P = G(P, (B) => {
|
|
11179
|
-
try {
|
|
11180
|
-
let O = JSON.parse(B);
|
|
11181
|
-
e(O);
|
|
11182
|
-
} catch (O) {
|
|
11183
|
-
R("INFORMER", "Error while parsing", B, `
|
|
11184
|
-
`, O);
|
|
11185
|
-
}
|
|
11186
|
-
}), H());
|
|
11187
|
-
});
|
|
11188
|
-
})();
|
|
11189
|
-
} catch (p) {
|
|
11190
|
-
if (p.name === "AbortError")
|
|
11191
|
-
return;
|
|
11192
|
-
R("INFORMER", "watch API error:", p), c = yield a();
|
|
11193
|
-
}
|
|
11194
|
-
}), u;
|
|
11195
|
-
}
|
|
11196
|
-
getUrl({ name: t, namespace: r } = {}, e, a) {
|
|
11197
|
-
let o = rt({ resourceBasePath: this.resourceBasePath, resource: this.resource, namespace: r || this.namespace, name: t }), i = new URLSearchParams(this.normalizeQuery(e));
|
|
11198
|
-
return (a ? this.watchWsBasePath : this.basePath) + o + (e ? `?${i.toString()}` : "");
|
|
11199
|
-
}
|
|
11200
|
-
normalizeQuery(t = {}) {
|
|
11201
|
-
return t.labelSelector && (t.labelSelector = [t.labelSelector].flat().join(",")), t.fieldSelector && (t.fieldSelector = [t.fieldSelector].flat().join(",")), t;
|
|
11202
|
-
}
|
|
11203
|
-
retryFunc(t) {
|
|
11204
|
-
let r = Math.min(Math.pow(2, this.retryTimes) * 1e3, this.maxTimeout);
|
|
11205
|
-
this.retryTimer = setTimeout(t, r), this.retryTimes++;
|
|
11206
|
-
}
|
|
11207
|
-
}, S = {}, w = class {
|
|
11208
|
-
constructor(t) {
|
|
11209
|
-
this.options = t;
|
|
11210
|
-
this.defaultNamespace = "default";
|
|
11211
|
-
let { basePath: r, fieldManager: e } = t;
|
|
11212
|
-
this.options = t, this.basePath = r, this.fieldManager = e;
|
|
11213
|
-
}
|
|
11214
|
-
applyYaml(t, r, e) {
|
|
11215
|
-
return d(this, null, function* () {
|
|
11216
|
-
var c;
|
|
11217
|
-
let a = t.filter((u) => u && u.kind && u.metadata).map((u) => v.restoreItem(u)), o = [], i = [], n = [];
|
|
11218
|
-
for (let u in a) {
|
|
11219
|
-
let h = a[u], p = U.cloneDeep(h);
|
|
11220
|
-
p.metadata = p.metadata || {}, p.metadata.annotations = p.metadata.annotations || {}, r === "application/apply-patch+yaml" && (delete p.metadata.managedFields, delete p.metadata.resourceVersion);
|
|
11221
|
-
let l = true;
|
|
11222
|
-
try {
|
|
11223
|
-
yield this.read(p);
|
|
11224
|
-
} catch (P) {
|
|
11225
|
-
if (((c = P.response) == null ? void 0 : c.status) === 404)
|
|
11226
|
-
l = false;
|
|
11227
|
-
else
|
|
11228
|
-
throw P;
|
|
11229
|
-
}
|
|
11230
|
-
let m = l ? yield this.patch(p, r || "application/apply-patch+yaml", e == null ? void 0 : e[u]) : yield this.create(p);
|
|
11231
|
-
l ? n.push(m) : i.push(m), o.push(m);
|
|
11232
|
-
}
|
|
11233
|
-
return i.length && L.emit("change", { type: "ADDED", basePath: this.basePath, items: i }), n.length && L.emit("change", { type: "MODIFIED", basePath: this.basePath, items: n }), o;
|
|
11234
|
-
});
|
|
11235
|
-
}
|
|
11236
|
-
deleteYaml(t, r) {
|
|
11237
|
-
return d(this, null, function* () {
|
|
11238
|
-
let { sync: e } = r || {}, a = t.filter((n) => n && n.kind && n.metadata), o = [], i = [];
|
|
11239
|
-
for (let n of a) {
|
|
11240
|
-
n.metadata = n.metadata || {}, n.metadata.annotations = n.metadata.annotations || {};
|
|
11241
|
-
let c = yield this.delete(n);
|
|
11242
|
-
o.push(c), i.push(n);
|
|
11243
|
-
}
|
|
11244
|
-
return e && L.emit("change", { type: "DELETED", basePath: this.basePath, items: i }), o;
|
|
11245
|
-
});
|
|
11246
|
-
}
|
|
11247
|
-
read(t) {
|
|
11248
|
-
return d(this, null, function* () {
|
|
11249
|
-
let r = yield this.specUriPath(t, "read");
|
|
11250
|
-
return yield y__default.default.get(r, { retry: 0 }).json();
|
|
11251
|
-
});
|
|
11252
|
-
}
|
|
11253
|
-
create(t) {
|
|
11254
|
-
return d(this, null, function* () {
|
|
11255
|
-
let r = yield this.specUriPath(t, "create");
|
|
11256
|
-
return yield y__default.default.post(r, { retry: 0, json: t }).json();
|
|
11257
|
-
});
|
|
11258
|
-
}
|
|
11259
|
-
patch(t, r, e) {
|
|
11260
|
-
return d(this, null, function* () {
|
|
11261
|
-
let a = yield this.specUriPath(t, "patch"), o = r === "application/json-patch+json" ? (e || []).map((n) => ({ op: "replace", path: "/" + n.split(".").join("/"), value: U.get(t, n) })) : t;
|
|
11262
|
-
return yield y__default.default.patch(a, { headers: { "Content-Type": r }, retry: 0, json: o, searchParams: r === "application/apply-patch+yaml" ? { fieldManager: this.fieldManager || "refine", force: true } : void 0 }).json();
|
|
11263
|
-
});
|
|
11264
|
-
}
|
|
11265
|
-
put(t) {
|
|
11266
|
-
return d(this, null, function* () {
|
|
11267
|
-
let r = yield this.specUriPath(t, "put");
|
|
11268
|
-
return yield y__default.default.put(r, { retry: 0, json: t }).json();
|
|
11269
|
-
});
|
|
11270
|
-
}
|
|
11271
|
-
delete(t) {
|
|
11272
|
-
return d(this, null, function* () {
|
|
11273
|
-
let r = yield this.specUriPath(t, "delete");
|
|
11274
|
-
return yield y__default.default.delete(r, { retry: 0 }).json();
|
|
11275
|
-
});
|
|
11276
|
-
}
|
|
11277
|
-
apiVersionPath(t) {
|
|
11278
|
-
let r = t.includes("/") ? "apis" : "api";
|
|
11279
|
-
return [this.basePath, r, t].join("/");
|
|
11280
|
-
}
|
|
11281
|
-
specUriPath(t, r) {
|
|
11282
|
-
return d(this, null, function* () {
|
|
11283
|
-
if (!t.kind)
|
|
11284
|
-
throw new Error("Required spec property kind is not set");
|
|
11285
|
-
t.apiVersion = t.apiVersion || "v1", t.metadata = t.metadata || {};
|
|
11286
|
-
let e = yield this.resource(t.apiVersion, t.kind);
|
|
11287
|
-
if (!e)
|
|
11288
|
-
throw new Error(`Unrecognized API version and kind: ${t.apiVersion} ${t.kind}`);
|
|
11289
|
-
e.namespaced && !t.metadata.namespace && r !== "list" && (t.metadata.namespace = this.defaultNamespace);
|
|
11290
|
-
let a = [this.apiVersionPath(t.apiVersion)];
|
|
11291
|
-
if (e.namespaced && t.metadata.namespace && a.push("namespaces", encodeURIComponent(String(t.metadata.namespace))), a.push(e.name), r !== "create" && r !== "list") {
|
|
11292
|
-
if (!t.metadata.name)
|
|
11293
|
-
throw new Error("Required spec property name is not set");
|
|
11294
|
-
a.push(encodeURIComponent(String(t.metadata.name)));
|
|
11295
|
-
}
|
|
11296
|
-
return a.join("/").toLowerCase();
|
|
11297
|
-
});
|
|
11298
|
-
}
|
|
11299
|
-
resource(t, r) {
|
|
11300
|
-
return d(this, null, function* () {
|
|
11301
|
-
let e = this.getApiVersionCacheKey(t);
|
|
11302
|
-
if (S[e]) {
|
|
11303
|
-
let i = S[e].resources.find((n) => n.kind === r);
|
|
11304
|
-
if (i)
|
|
11305
|
-
return i;
|
|
11306
|
-
}
|
|
11307
|
-
let a = this.apiVersionPath(t), o = yield y__default.default.get(a).json();
|
|
11308
|
-
return S[e] = o, S[e].resources.find((i) => i.kind === r);
|
|
11309
|
-
});
|
|
11310
|
-
}
|
|
11311
|
-
getApiVersionCacheKey(t) {
|
|
11312
|
-
return `${t}@${this.basePath}`;
|
|
11313
|
-
}
|
|
11314
|
-
};
|
|
11315
|
-
var A = (s, t) => !s || s.length === 0 ? t : t.filter((r) => s.every((e) => {
|
|
11316
|
-
if ("field" in e) {
|
|
11317
|
-
let { field: a, operator: o, value: i } = e;
|
|
11318
|
-
return x(r, a, o, i);
|
|
11319
|
-
} else {
|
|
11320
|
-
let { operator: a, value: o } = e;
|
|
11321
|
-
if (a === "or")
|
|
11322
|
-
return o.some((i) => {
|
|
11323
|
-
let { field: n, operator: c, value: u } = i;
|
|
11324
|
-
return x(r, n, c, u);
|
|
11325
|
-
});
|
|
11326
|
-
if (a === "and")
|
|
11327
|
-
return o.every((i) => {
|
|
11328
|
-
let { field: n, operator: c, value: u } = i;
|
|
11329
|
-
return x(r, n, c, u);
|
|
11330
|
-
});
|
|
11331
|
-
}
|
|
11332
|
-
return true;
|
|
11333
|
-
}));
|
|
11334
|
-
function x(s, t, r, e) {
|
|
11335
|
-
let a = U__default.default.get(s, t);
|
|
11336
|
-
switch (r) {
|
|
11337
|
-
case "eq":
|
|
11338
|
-
return a === e;
|
|
11339
|
-
case "ne":
|
|
11340
|
-
return a !== e;
|
|
11341
|
-
case "lt":
|
|
11342
|
-
return a < e;
|
|
11343
|
-
case "gt":
|
|
11344
|
-
return a > e;
|
|
11345
|
-
case "lte":
|
|
11346
|
-
return a <= e;
|
|
11347
|
-
case "gte":
|
|
11348
|
-
return a >= e;
|
|
11349
|
-
case "in":
|
|
11350
|
-
return e.includes(a);
|
|
11351
|
-
case "nin":
|
|
11352
|
-
return !e.includes(a);
|
|
11353
|
-
case "contains":
|
|
11354
|
-
return a.includes(e);
|
|
11355
|
-
case "ncontains":
|
|
11356
|
-
return !a.includes(e);
|
|
11357
|
-
case "containss":
|
|
11358
|
-
return a.toLowerCase().includes(e.toLowerCase());
|
|
11359
|
-
case "ncontainss":
|
|
11360
|
-
return !a.toLowerCase().includes(e.toLowerCase());
|
|
11361
|
-
case "between":
|
|
11362
|
-
return e[0] <= a && a <= e[1];
|
|
11363
|
-
case "nbetween":
|
|
11364
|
-
return e[0] > a || a > e[1];
|
|
11365
|
-
case "null":
|
|
11366
|
-
return a === null;
|
|
11367
|
-
case "nnull":
|
|
11368
|
-
return a !== null;
|
|
11369
|
-
case "startswith":
|
|
11370
|
-
return a.startsWith(e);
|
|
11371
|
-
case "nstartswith":
|
|
11372
|
-
return !a.startsWith(e);
|
|
11373
|
-
case "startswiths":
|
|
11374
|
-
return a.toLowerCase().startsWith(e.toLowerCase());
|
|
11375
|
-
case "nstartswiths":
|
|
11376
|
-
return !a.toLowerCase().startsWith(e.toLowerCase());
|
|
11377
|
-
case "endswith":
|
|
11378
|
-
return a.endsWith(e);
|
|
11379
|
-
case "nendswith":
|
|
11380
|
-
return !a.endsWith(e);
|
|
11381
|
-
case "endswiths":
|
|
11382
|
-
return a.toLowerCase().endsWith(e.toLowerCase());
|
|
11383
|
-
case "nendswiths":
|
|
11384
|
-
return !a.toLowerCase().endsWith(e.toLowerCase());
|
|
11385
|
-
default:
|
|
11386
|
-
return true;
|
|
11387
|
-
}
|
|
11388
|
-
}
|
|
11389
|
-
function M(s, t) {
|
|
11390
|
-
return s != null && s.length ? [...t].sort((r, e) => {
|
|
11391
|
-
for (let a of s) {
|
|
11392
|
-
let { field: o, order: i } = a, n = U__default.default.get(r, o), c = U__default.default.get(e, o);
|
|
11393
|
-
if (!(U__default.default.isNil(n) && U__default.default.isNil(c))) {
|
|
11394
|
-
if (U__default.default.isNil(n))
|
|
11395
|
-
return i === "asc" ? 1 : -1;
|
|
11396
|
-
if (U__default.default.isNil(c) || n < c)
|
|
11397
|
-
return i === "asc" ? -1 : 1;
|
|
11398
|
-
if (n > c)
|
|
11399
|
-
return i === "asc" ? 1 : -1;
|
|
11400
|
-
}
|
|
11401
|
-
}
|
|
11402
|
-
return 0;
|
|
11403
|
-
}) : t;
|
|
11404
|
-
}
|
|
11405
|
-
var N = (s, t) => {
|
|
11406
|
-
let { current: r = 1, pageSize: e = 20, mode: a } = s != null ? s : {};
|
|
11407
|
-
if (a !== "client")
|
|
11408
|
-
return console.warn("k8s no support server paginateData"), t;
|
|
11409
|
-
let o = 0, i = t.length, n = r * e;
|
|
11410
|
-
return o = (r - 1) * e, i = n < i ? n : i, t.slice(o, i);
|
|
11411
|
-
};
|
|
11412
|
-
function T(s) {
|
|
11413
|
-
var t, r, e, a;
|
|
11414
|
-
return (t = s.metadata) != null && t.namespace ? `${(e = s.metadata) == null ? void 0 : e.namespace}/${(a = s.metadata) == null ? void 0 : a.name}` : ((r = s.metadata) == null ? void 0 : r.name) || "";
|
|
11415
|
-
}
|
|
11416
|
-
function $(s) {
|
|
11417
|
-
return s.replace(/^(\/api\/)|(\/apis\/)/, "");
|
|
11418
|
-
}
|
|
11419
|
-
var F = (s) => {
|
|
11420
|
-
let t = (r) => d(void 0, null, function* () {
|
|
11421
|
-
let { resource: e, id: a, meta: o } = r, i = a.toString().split("/"), [n, c] = i.length === 1 ? [void 0, i[0]] : i, { items: u, kind: h, apiVersion: p } = yield s.get(e, o), l = u.find((m) => m.metadata.name === c && m.metadata.namespace === n);
|
|
11422
|
-
return { data: b(f({}, l), { id: l ? T(l) : "", kind: h.replace(/List$/g, ""), apiVersion: p }) };
|
|
11423
|
-
});
|
|
11424
|
-
return { getList: (r) => d(void 0, null, function* () {
|
|
11425
|
-
let { resource: e, pagination: a, filters: o, sorters: i, meta: n } = r, { items: c } = yield s.get(e, n);
|
|
11426
|
-
return o && (c = A(o, c)), i && (c = M(i, c)), a && (c = N(a, c)), { data: c.map((u) => b(f({}, u), { id: T(u) })), total: c.length };
|
|
11427
|
-
}), getMany: (r) => d(void 0, null, function* () {
|
|
11428
|
-
let i = r, { ids: e } = i, a = k(i, ["ids"]);
|
|
11429
|
-
return { data: yield Promise.all(e.map((n) => t(f({ id: n }, a)).then((c) => c.data))) };
|
|
11430
|
-
}), create: (a) => d(void 0, [a], function* ({ variables: r, meta: e }) {
|
|
11431
|
-
return { data: (yield new w({ basePath: s.apiUrl, fieldManager: s.fieldManager }).applyYaml([b(f({}, r), { apiVersion: $(e == null ? void 0 : e.resourceBasePath), kind: e == null ? void 0 : e.kind })]))[0] };
|
|
11432
|
-
}), update: (a) => d(void 0, [a], function* ({ variables: r, meta: e }) {
|
|
11433
|
-
let o = new w({ basePath: s.apiUrl, fieldManager: s.fieldManager }), i = [b(f({}, r), { apiVersion: $(e == null ? void 0 : e.resourceBasePath), kind: e == null ? void 0 : e.kind })];
|
|
11434
|
-
return { data: (yield o.applyYaml(i, e == null ? void 0 : e.strategy, e == null ? void 0 : e.replacePaths))[0] };
|
|
11435
|
-
}), getOne: t, deleteOne: (i) => d(void 0, null, function* () {
|
|
11436
|
-
var n = i, { resource: r, id: e, meta: a } = n, o = k(n, ["resource", "id", "meta"]);
|
|
11437
|
-
let c = new w({ basePath: s.apiUrl, fieldManager: s.fieldManager }), { data: u } = yield t(f({ id: e, resource: r, meta: a }, o));
|
|
11438
|
-
return { data: (yield c.deleteYaml([u]))[0] };
|
|
11439
|
-
}), getApiUrl: () => s.apiUrl };
|
|
11440
|
-
};
|
|
11441
|
-
var j = { ADDED: "created", MODIFIED: "updated", DELETED: "deleted", PING: "ping" };
|
|
11442
|
-
function st(s) {
|
|
11443
|
-
return Object.keys(j).find((t) => j[t] === s);
|
|
11444
|
-
}
|
|
11445
|
-
function _(s, t) {
|
|
11446
|
-
return Array.isArray(s) ? s.find((r) => r.prefix === t) : s;
|
|
11447
|
-
}
|
|
11448
|
-
var It = (s) => ({ subscribe: ({ channel: t, params: r, callback: e }) => {
|
|
11449
|
-
let { resource: a } = r != null ? r : {};
|
|
11450
|
-
if (!a)
|
|
11451
|
-
throw new Error("[WatchApi]: `resource` is required in `params` for k8s watch and globalStore");
|
|
11452
|
-
let o = _(s, r == null ? void 0 : r.dataProviderName);
|
|
11453
|
-
if (!o)
|
|
11454
|
-
throw new Error("[WatchApi]: `GlobalStore` is required in `params` for k8s live provider, can not find matched `GlobalStore`");
|
|
11455
|
-
return { stop: o.subscribe(a, (n) => {
|
|
11456
|
-
let c = T(n.object);
|
|
11457
|
-
e({ channel: t, type: j[n.type] || n.type, date: new Date(), payload: { ids: [c], object: n.object } });
|
|
11458
|
-
}) };
|
|
11459
|
-
}, unsubscribe: ({ stop: t }) => {
|
|
11460
|
-
t == null || t();
|
|
11461
|
-
}, publish: (t) => {
|
|
11462
|
-
var o;
|
|
11463
|
-
let r = _(s, (o = t.meta) == null ? void 0 : o.dataProviderName);
|
|
11464
|
-
if (!r)
|
|
11465
|
-
throw new Error("[WatchApi]: `GlobalStore` is required in `params` for k8s live provider, can not find matched `GlobalStore`");
|
|
11466
|
-
let e = st(t.type), [, a] = t.channel.split("/");
|
|
11467
|
-
if (!a)
|
|
11468
|
-
throw new Error("[WatchApi]: `resource` is required in `params` for k8s watch and globalStore");
|
|
11469
|
-
r.publish(a, { type: e, object: t.payload });
|
|
11470
|
-
} });
|
|
11471
|
-
var nt = (s) => {
|
|
11472
|
-
switch (s) {
|
|
11473
|
-
case "ne":
|
|
11474
|
-
case "gte":
|
|
11475
|
-
case "lte":
|
|
11476
|
-
return `_${s}`;
|
|
11477
|
-
case "contains":
|
|
11478
|
-
return "_like";
|
|
11479
|
-
case "eq":
|
|
11480
|
-
default:
|
|
11481
|
-
return "";
|
|
11482
|
-
}
|
|
11483
|
-
};
|
|
11484
|
-
function it(s, t) {
|
|
11485
|
-
return t != null && t.resourceBasePath ? { resourceBasePath: t == null ? void 0 : t.resourceBasePath, resource: s, namespace: t.namespace } : { resourceBasePath: "/api/v1", resource: "namespaces" };
|
|
11486
|
-
}
|
|
11487
|
-
var Q = class {
|
|
11488
|
-
constructor(t) {
|
|
11489
|
-
this._apiUrl = "";
|
|
11490
|
-
this.store = /* @__PURE__ */ new Map();
|
|
11491
|
-
this.subscribers = /* @__PURE__ */ new Map();
|
|
11492
|
-
this.init(t);
|
|
11493
|
-
}
|
|
11494
|
-
get apiUrl() {
|
|
11495
|
-
return this._apiUrl;
|
|
11496
|
-
}
|
|
11497
|
-
get(t, r) {
|
|
11498
|
-
return new Promise((e, a) => {
|
|
11499
|
-
if (this.store.has(t))
|
|
11500
|
-
e(this.store.get(t));
|
|
11501
|
-
else {
|
|
11502
|
-
let o = new E({ basePath: this._apiUrl, watchWsBasePath: this.watchWsApiUrl, objectConstructor: it(t, r) }), i = false;
|
|
11503
|
-
o.listWatch({ onResponse: (n) => {
|
|
11504
|
-
v.processData(n), i || (e(n), i = true), this.store.set(t, n);
|
|
11505
|
-
}, onEvent: (n) => {
|
|
11506
|
-
v.processItem(n.object), this.notify(t, n);
|
|
11507
|
-
} }).catch((n) => a(n));
|
|
11508
|
-
}
|
|
11509
|
-
});
|
|
11510
|
-
}
|
|
11511
|
-
subscribe(t, r) {
|
|
11512
|
-
return this.subscribers.has(t) || this.subscribers.set(t, []), this.subscribers.get(t).push(r), () => {
|
|
11513
|
-
let e = this.subscribers.get(t);
|
|
11514
|
-
this.subscribers.set(t, (e == null ? void 0 : e.filter((a) => a !== r)) || []);
|
|
11515
|
-
};
|
|
11516
|
-
}
|
|
11517
|
-
notify(t, r) {
|
|
11518
|
-
let e = this.subscribers.get(t);
|
|
11519
|
-
if (e)
|
|
11520
|
-
for (let a of e)
|
|
11521
|
-
a(r);
|
|
11522
|
-
}
|
|
11523
|
-
publish(t, r) {
|
|
11524
|
-
this.notify(t, r);
|
|
11525
|
-
}
|
|
11526
|
-
init(t) {
|
|
11527
|
-
let { apiUrl: r, watchWsApiUrl: e, prefix: a, fieldManager: o } = t;
|
|
11528
|
-
this.store = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this._apiUrl = r, this.watchWsApiUrl = e, this.prefix = a, this.fieldManager = o;
|
|
11529
|
-
}
|
|
11530
|
-
};
|
|
11531
|
-
var ee = F;
|
|
11532
|
-
var GlobalStore = lib.GlobalStore = Q;
|
|
11533
|
-
lib.KubeApi = E;
|
|
11534
|
-
lib.KubeSdk = w;
|
|
11535
|
-
var dataProvider = lib.dataProvider = F;
|
|
11536
|
-
lib.default = ee;
|
|
11537
|
-
lib.filterData = A;
|
|
11538
|
-
lib.getId = T;
|
|
11539
|
-
lib.getObjectConstructor = it;
|
|
11540
|
-
lib.informerLog = R;
|
|
11541
|
-
var liveProvider = lib.liveProvider = It;
|
|
11542
|
-
lib.mapOperator = nt;
|
|
11543
|
-
lib.sortData = M;
|
|
11544
10377
|
const copy$1 = "Copy";
|
|
11545
10378
|
const reset_arguments$1 = "Reset";
|
|
11546
10379
|
const view_changes$1 = "Show Diff";
|
|
@@ -11615,6 +10448,11 @@ var __publicField = (obj, key, value) => {
|
|
|
11615
10448
|
const data = "\u6570\u636E";
|
|
11616
10449
|
const suspend = "\u6682\u505C";
|
|
11617
10450
|
const resume = "\u91CD\u65B0\u5F00\u59CB";
|
|
10451
|
+
const cluster = "\u96C6\u7FA4";
|
|
10452
|
+
const storage = "\u5B58\u50A8";
|
|
10453
|
+
const network = "\u7F51\u7EDC";
|
|
10454
|
+
const clusterIp = "\u96C6\u7FA4 IP";
|
|
10455
|
+
const sessionAffinity = "\u4F1A\u8BDD\u4FDD\u6301";
|
|
11618
10456
|
const dovetail = {
|
|
11619
10457
|
copy,
|
|
11620
10458
|
reset_arguments,
|
|
@@ -11665,7 +10503,12 @@ var __publicField = (obj, key, value) => {
|
|
|
11665
10503
|
redeploy,
|
|
11666
10504
|
data,
|
|
11667
10505
|
suspend,
|
|
11668
|
-
resume
|
|
10506
|
+
resume,
|
|
10507
|
+
cluster,
|
|
10508
|
+
storage,
|
|
10509
|
+
network,
|
|
10510
|
+
clusterIp,
|
|
10511
|
+
sessionAffinity
|
|
11669
10512
|
};
|
|
11670
10513
|
const ZH = {
|
|
11671
10514
|
dovetail
|
|
@@ -11686,19 +10529,13 @@ var __publicField = (obj, key, value) => {
|
|
|
11686
10529
|
const styles = "";
|
|
11687
10530
|
const antd = "";
|
|
11688
10531
|
const style = "";
|
|
11689
|
-
const globalStore = new GlobalStore({
|
|
10532
|
+
const globalStore = new k8sApiProvider.GlobalStore({
|
|
11690
10533
|
apiUrl: "/api/k8s",
|
|
11691
10534
|
watchWsApiUrl: "api/sks-ws/k8s",
|
|
11692
10535
|
prefix: "default"
|
|
11693
10536
|
});
|
|
11694
10537
|
const Dovetail = (props) => {
|
|
11695
|
-
const { resourcesConfig, urlPrefix, useHashUrl, Layout: Layout2 } = props;
|
|
11696
|
-
const history = React.useMemo(() => {
|
|
11697
|
-
if (useHashUrl) {
|
|
11698
|
-
return createHashHistory();
|
|
11699
|
-
}
|
|
11700
|
-
return createBrowserHistory();
|
|
11701
|
-
}, [useHashUrl]);
|
|
10538
|
+
const { resourcesConfig, urlPrefix = "", useHashUrl, Layout: Layout2, history } = props;
|
|
11702
10539
|
const notCustomResources = React.useMemo(() => {
|
|
11703
10540
|
return resourcesConfig.filter((c) => !c.isCustom);
|
|
11704
10541
|
}, [resourcesConfig]);
|
|
@@ -11716,10 +10553,10 @@ var __publicField = (obj, key, value) => {
|
|
|
11716
10553
|
core.Refine,
|
|
11717
10554
|
{
|
|
11718
10555
|
dataProvider: {
|
|
11719
|
-
default: dataProvider(globalStore)
|
|
10556
|
+
default: k8sApiProvider.dataProvider(globalStore)
|
|
11720
10557
|
},
|
|
11721
10558
|
routerProvider,
|
|
11722
|
-
liveProvider: liveProvider(globalStore),
|
|
10559
|
+
liveProvider: k8sApiProvider.liveProvider(globalStore),
|
|
11723
10560
|
options: {
|
|
11724
10561
|
warnWhenUnsavedChanges: true,
|
|
11725
10562
|
liveMode: "auto"
|
|
@@ -11745,7 +10582,9 @@ var __publicField = (obj, key, value) => {
|
|
|
11745
10582
|
};
|
|
11746
10583
|
var RESOURCE_GROUP = /* @__PURE__ */ ((RESOURCE_GROUP2) => {
|
|
11747
10584
|
RESOURCE_GROUP2["WORKLOAD"] = "WORKLOAD";
|
|
11748
|
-
RESOURCE_GROUP2["
|
|
10585
|
+
RESOURCE_GROUP2["STORAGE"] = "STORAGE";
|
|
10586
|
+
RESOURCE_GROUP2["NETWORK"] = "NETWORK";
|
|
10587
|
+
RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
|
|
11749
10588
|
return RESOURCE_GROUP2;
|
|
11750
10589
|
})(RESOURCE_GROUP || {});
|
|
11751
10590
|
const MonacoYamlDiffEditor = (props) => {
|
|
@@ -11793,6 +10632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11793
10632
|
exports2.BASE_INIT_VALUE = BASE_INIT_VALUE;
|
|
11794
10633
|
exports2.Breadcrumb = Breadcrumb;
|
|
11795
10634
|
exports2.CRONJOB_INIT_VALUE = CRONJOB_INIT_VALUE;
|
|
10635
|
+
exports2.ClusterIpField = ClusterIpField;
|
|
11796
10636
|
exports2.ColumnKeys = ColumnKeys;
|
|
11797
10637
|
exports2.CommonSorter = CommonSorter;
|
|
11798
10638
|
exports2.CompletionsCountColumnRenderer = CompletionsCountColumnRenderer;
|
|
@@ -11849,6 +10689,10 @@ var __publicField = (obj, key, value) => {
|
|
|
11849
10689
|
exports2.STATEFULSET_INIT_VALUE = STATEFULSET_INIT_VALUE;
|
|
11850
10690
|
exports2.SecretDataField = SecretDataField;
|
|
11851
10691
|
exports2.Separator = Separator;
|
|
10692
|
+
exports2.ServicePodsField = ServicePodsField;
|
|
10693
|
+
exports2.ServiceTypeColumnRenderer = ServiceTypeColumnRenderer;
|
|
10694
|
+
exports2.ServiceTypeField = ServiceTypeField;
|
|
10695
|
+
exports2.SessionAffinityField = SessionAffinityField;
|
|
11852
10696
|
exports2.ShowContent = ShowContent;
|
|
11853
10697
|
exports2.StartTimeField = StartTimeField;
|
|
11854
10698
|
exports2.StateTag = StateTag;
|