@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.97 → 0.0.1-alpha.99
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/openapi-k8s-toolkit.es.js +1123 -126
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +1122 -125
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/Annotations.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/EditModal/EditModal.d.ts +19 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/EditModal/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/EditModal/styled.d.ts +23 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/types.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/utils.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/EditModal/EditModal.d.ts +3 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/Taints.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/EditModal/EditModal.d.ts +19 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/EditModal/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/EditModal/styled.d.ts +23 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/types.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/utils.d.ts +9 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/Tolerations.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/EditModal/EditModal.d.ts +19 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/EditModal/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/EditModal/styled.d.ts +23 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/types.d.ts +8 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/utils.d.ts +8 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +3 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +61 -0
- package/package.json +1 -1
|
@@ -2504,7 +2504,7 @@
|
|
|
2504
2504
|
justify-content: center;
|
|
2505
2505
|
}
|
|
2506
2506
|
`;
|
|
2507
|
-
const Styled$
|
|
2507
|
+
const Styled$t = {
|
|
2508
2508
|
CustomTreeProvider
|
|
2509
2509
|
};
|
|
2510
2510
|
|
|
@@ -2569,7 +2569,7 @@
|
|
|
2569
2569
|
});
|
|
2570
2570
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
2571
2571
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
|
|
2572
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
2572
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$t.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2573
2573
|
antd.Tree,
|
|
2574
2574
|
{
|
|
2575
2575
|
treeData: loop(treeData),
|
|
@@ -2681,7 +2681,7 @@
|
|
|
2681
2681
|
*
|
|
2682
2682
|
* @returns {boolean} True if value is a String, otherwise false
|
|
2683
2683
|
*/
|
|
2684
|
-
const isString = typeOfTest('string');
|
|
2684
|
+
const isString$1 = typeOfTest('string');
|
|
2685
2685
|
|
|
2686
2686
|
/**
|
|
2687
2687
|
* Determine if a value is a Function
|
|
@@ -2707,7 +2707,7 @@
|
|
|
2707
2707
|
*
|
|
2708
2708
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
2709
2709
|
*/
|
|
2710
|
-
const isObject$
|
|
2710
|
+
const isObject$4 = (thing) => thing !== null && typeof thing === 'object';
|
|
2711
2711
|
|
|
2712
2712
|
/**
|
|
2713
2713
|
* Determine if a value is a Boolean
|
|
@@ -2724,7 +2724,7 @@
|
|
|
2724
2724
|
*
|
|
2725
2725
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
2726
2726
|
*/
|
|
2727
|
-
const isPlainObject = (val) => {
|
|
2727
|
+
const isPlainObject$1 = (val) => {
|
|
2728
2728
|
if (kindOf(val) !== 'object') {
|
|
2729
2729
|
return false;
|
|
2730
2730
|
}
|
|
@@ -2776,7 +2776,7 @@
|
|
|
2776
2776
|
*
|
|
2777
2777
|
* @returns {boolean} True if value is a Stream, otherwise false
|
|
2778
2778
|
*/
|
|
2779
|
-
const isStream = (val) => isObject$
|
|
2779
|
+
const isStream = (val) => isObject$4(val) && isFunction$1(val.pipe);
|
|
2780
2780
|
|
|
2781
2781
|
/**
|
|
2782
2782
|
* Determine if a value is a FormData
|
|
@@ -2910,9 +2910,9 @@
|
|
|
2910
2910
|
const result = {};
|
|
2911
2911
|
const assignValue = (val, key) => {
|
|
2912
2912
|
const targetKey = caseless && findKey(result, key) || key;
|
|
2913
|
-
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
2913
|
+
if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) {
|
|
2914
2914
|
result[targetKey] = merge$2(result[targetKey], val);
|
|
2915
|
-
} else if (isPlainObject(val)) {
|
|
2915
|
+
} else if (isPlainObject$1(val)) {
|
|
2916
2916
|
result[targetKey] = merge$2({}, val);
|
|
2917
2917
|
} else if (isArray(val)) {
|
|
2918
2918
|
result[targetKey] = val.slice();
|
|
@@ -3234,7 +3234,7 @@
|
|
|
3234
3234
|
|
|
3235
3235
|
const visit = (source, i) => {
|
|
3236
3236
|
|
|
3237
|
-
if (isObject$
|
|
3237
|
+
if (isObject$4(source)) {
|
|
3238
3238
|
if (stack.indexOf(source) >= 0) {
|
|
3239
3239
|
return;
|
|
3240
3240
|
}
|
|
@@ -3263,7 +3263,7 @@
|
|
|
3263
3263
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
3264
3264
|
|
|
3265
3265
|
const isThenable = (thing) =>
|
|
3266
|
-
thing && (isObject$
|
|
3266
|
+
thing && (isObject$4(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
3267
3267
|
|
|
3268
3268
|
const utils = {
|
|
3269
3269
|
isArray,
|
|
@@ -3271,11 +3271,11 @@
|
|
|
3271
3271
|
isBuffer,
|
|
3272
3272
|
isFormData,
|
|
3273
3273
|
isArrayBufferView,
|
|
3274
|
-
isString,
|
|
3274
|
+
isString: isString$1,
|
|
3275
3275
|
isNumber,
|
|
3276
3276
|
isBoolean,
|
|
3277
|
-
isObject: isObject$
|
|
3278
|
-
isPlainObject,
|
|
3277
|
+
isObject: isObject$4,
|
|
3278
|
+
isPlainObject: isPlainObject$1,
|
|
3279
3279
|
isUndefined,
|
|
3280
3280
|
isDate,
|
|
3281
3281
|
isFile,
|
|
@@ -8443,14 +8443,14 @@
|
|
|
8443
8443
|
display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
|
|
8444
8444
|
flex-flow: ${({ $flexFlow }) => $flexFlow};
|
|
8445
8445
|
`;
|
|
8446
|
-
const Styled$
|
|
8446
|
+
const Styled$s = {
|
|
8447
8447
|
ContentContainer
|
|
8448
8448
|
};
|
|
8449
8449
|
|
|
8450
8450
|
const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
|
|
8451
8451
|
const { token } = antd.theme.useToken();
|
|
8452
8452
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8453
|
-
Styled$
|
|
8453
|
+
Styled$s.ContentContainer,
|
|
8454
8454
|
{
|
|
8455
8455
|
$flexGrow: flexGrow,
|
|
8456
8456
|
$bgColor: token.colorBgContainer,
|
|
@@ -8511,13 +8511,13 @@
|
|
|
8511
8511
|
padding-inline: 8px;
|
|
8512
8512
|
}
|
|
8513
8513
|
`;
|
|
8514
|
-
const Styled$
|
|
8514
|
+
const Styled$r = {
|
|
8515
8515
|
UncontrolledSelect: UncontrolledSelect$1
|
|
8516
8516
|
};
|
|
8517
8517
|
|
|
8518
8518
|
const UncontrolledSelect = (props) => {
|
|
8519
8519
|
const { isCursorPointer } = props;
|
|
8520
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8520
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$r.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
|
|
8521
8521
|
};
|
|
8522
8522
|
|
|
8523
8523
|
const CustomSelect$5 = st(antd.Select)`
|
|
@@ -8563,13 +8563,13 @@
|
|
|
8563
8563
|
margin-block: 0 !important;
|
|
8564
8564
|
}
|
|
8565
8565
|
`;
|
|
8566
|
-
const Styled$
|
|
8566
|
+
const Styled$q = {
|
|
8567
8567
|
CustomSelect: CustomSelect$5
|
|
8568
8568
|
};
|
|
8569
8569
|
|
|
8570
8570
|
const CustomSelect$4 = (props) => {
|
|
8571
8571
|
const { paddingContainerEnd, ...rest } = props;
|
|
8572
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8572
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$q.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
|
|
8573
8573
|
};
|
|
8574
8574
|
|
|
8575
8575
|
const CursorPointerTag = st(antd.Tag)`
|
|
@@ -8679,7 +8679,7 @@
|
|
|
8679
8679
|
flex-wrap: nowrap !important;
|
|
8680
8680
|
}
|
|
8681
8681
|
`;
|
|
8682
|
-
const Styled$
|
|
8682
|
+
const Styled$p = {
|
|
8683
8683
|
PositionRelativeContainer,
|
|
8684
8684
|
FullWidthContainer,
|
|
8685
8685
|
NoWrapContainer
|
|
@@ -8722,9 +8722,9 @@
|
|
|
8722
8722
|
};
|
|
8723
8723
|
return [firstItem, ellipsisItem, lastItem];
|
|
8724
8724
|
};
|
|
8725
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
8726
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8727
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8725
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$p.PositionRelativeContainer, { children: [
|
|
8726
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$p.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
|
|
8727
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$p.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
|
|
8728
8728
|
] });
|
|
8729
8729
|
};
|
|
8730
8730
|
|
|
@@ -8732,12 +8732,12 @@
|
|
|
8732
8732
|
min-height: 22px;
|
|
8733
8733
|
width: 100%;
|
|
8734
8734
|
`;
|
|
8735
|
-
const Styled$
|
|
8735
|
+
const Styled$o = {
|
|
8736
8736
|
HeightDiv
|
|
8737
8737
|
};
|
|
8738
8738
|
|
|
8739
8739
|
const ManageableBreadcrumbs = ({ data }) => {
|
|
8740
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8740
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
|
|
8741
8741
|
};
|
|
8742
8742
|
const ManageableBreadcrumbsWithDataProvider = ({
|
|
8743
8743
|
uri,
|
|
@@ -8761,7 +8761,7 @@
|
|
|
8761
8761
|
return null;
|
|
8762
8762
|
}
|
|
8763
8763
|
if (rawDataLoading) {
|
|
8764
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8764
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
|
|
8765
8765
|
}
|
|
8766
8766
|
if (!rawData) {
|
|
8767
8767
|
return null;
|
|
@@ -8776,7 +8776,7 @@
|
|
|
8776
8776
|
idToCompare
|
|
8777
8777
|
});
|
|
8778
8778
|
if (!result) {
|
|
8779
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8779
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.HeightDiv, {});
|
|
8780
8780
|
}
|
|
8781
8781
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result });
|
|
8782
8782
|
};
|
|
@@ -8867,7 +8867,7 @@
|
|
|
8867
8867
|
margin: 0 !important;
|
|
8868
8868
|
}
|
|
8869
8869
|
`;
|
|
8870
|
-
const Styled$
|
|
8870
|
+
const Styled$n = {
|
|
8871
8871
|
CustomMenu
|
|
8872
8872
|
};
|
|
8873
8873
|
|
|
@@ -8894,7 +8894,7 @@
|
|
|
8894
8894
|
setSelectedKeys(data.selectedKeys);
|
|
8895
8895
|
}, [data.selectedKeys]);
|
|
8896
8896
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8897
|
-
Styled$
|
|
8897
|
+
Styled$n.CustomMenu,
|
|
8898
8898
|
{
|
|
8899
8899
|
selectedKeys,
|
|
8900
8900
|
onSelect: () => {
|
|
@@ -26171,7 +26171,7 @@
|
|
|
26171
26171
|
white-space: nowrap;
|
|
26172
26172
|
text-overflow: ellipsis;
|
|
26173
26173
|
`;
|
|
26174
|
-
const Styled$
|
|
26174
|
+
const Styled$m = {
|
|
26175
26175
|
ShortenedText
|
|
26176
26176
|
};
|
|
26177
26177
|
|
|
@@ -26180,7 +26180,7 @@
|
|
|
26180
26180
|
const trimmedText = text.substring(0, trimLength);
|
|
26181
26181
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, placement: "top", children: trimmedText });
|
|
26182
26182
|
}
|
|
26183
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
26183
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$m.ShortenedText, { $maxWidth: maxWidth, children: text }) });
|
|
26184
26184
|
};
|
|
26185
26185
|
|
|
26186
26186
|
const FilterDropdown = ({
|
|
@@ -33757,7 +33757,7 @@
|
|
|
33757
33757
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
33758
33758
|
}
|
|
33759
33759
|
wait = toNumber(wait) || 0;
|
|
33760
|
-
if (isObject$
|
|
33760
|
+
if (isObject$3(options)) {
|
|
33761
33761
|
leading = !!options.leading;
|
|
33762
33762
|
maxing = 'maxWait' in options;
|
|
33763
33763
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
@@ -33888,7 +33888,7 @@
|
|
|
33888
33888
|
* _.isObject(null);
|
|
33889
33889
|
* // => false
|
|
33890
33890
|
*/
|
|
33891
|
-
function isObject$
|
|
33891
|
+
function isObject$3(value) {
|
|
33892
33892
|
var type = typeof value;
|
|
33893
33893
|
return !!value && (type == 'object' || type == 'function');
|
|
33894
33894
|
}
|
|
@@ -33973,9 +33973,9 @@
|
|
|
33973
33973
|
if (isSymbol(value)) {
|
|
33974
33974
|
return NAN;
|
|
33975
33975
|
}
|
|
33976
|
-
if (isObject$
|
|
33976
|
+
if (isObject$3(value)) {
|
|
33977
33977
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
33978
|
-
value = isObject$
|
|
33978
|
+
value = isObject$3(other) ? (other + '') : other;
|
|
33979
33979
|
}
|
|
33980
33980
|
if (typeof value != 'string') {
|
|
33981
33981
|
return value === 0 ? value : +value;
|
|
@@ -34437,7 +34437,7 @@
|
|
|
34437
34437
|
};
|
|
34438
34438
|
}
|
|
34439
34439
|
|
|
34440
|
-
function isObject$
|
|
34440
|
+
function isObject$2(value) {
|
|
34441
34441
|
return {}.toString.call(value).includes('Object');
|
|
34442
34442
|
}
|
|
34443
34443
|
|
|
@@ -34454,7 +34454,7 @@
|
|
|
34454
34454
|
}
|
|
34455
34455
|
|
|
34456
34456
|
function validateChanges(initial, changes) {
|
|
34457
|
-
if (!isObject$
|
|
34457
|
+
if (!isObject$2(changes)) errorHandler$1('changeType');
|
|
34458
34458
|
if (Object.keys(changes).some(function (field) {
|
|
34459
34459
|
return !hasOwnProperty(initial, field);
|
|
34460
34460
|
})) errorHandler$1('changeField');
|
|
@@ -34466,15 +34466,15 @@
|
|
|
34466
34466
|
}
|
|
34467
34467
|
|
|
34468
34468
|
function validateHandler(handler) {
|
|
34469
|
-
if (!(isFunction(handler) || isObject$
|
|
34470
|
-
if (isObject$
|
|
34469
|
+
if (!(isFunction(handler) || isObject$2(handler))) errorHandler$1('handlerType');
|
|
34470
|
+
if (isObject$2(handler) && Object.values(handler).some(function (_handler) {
|
|
34471
34471
|
return !isFunction(_handler);
|
|
34472
34472
|
})) errorHandler$1('handlersType');
|
|
34473
34473
|
}
|
|
34474
34474
|
|
|
34475
34475
|
function validateInitial(initial) {
|
|
34476
34476
|
if (!initial) errorHandler$1('initialIsRequired');
|
|
34477
|
-
if (!isObject$
|
|
34477
|
+
if (!isObject$2(initial)) errorHandler$1('initialType');
|
|
34478
34478
|
if (isEmpty$1(initial)) errorHandler$1('initialContent');
|
|
34479
34479
|
}
|
|
34480
34480
|
|
|
@@ -34574,7 +34574,7 @@
|
|
|
34574
34574
|
};
|
|
34575
34575
|
}
|
|
34576
34576
|
|
|
34577
|
-
function isObject(value) {
|
|
34577
|
+
function isObject$1(value) {
|
|
34578
34578
|
return {}.toString.call(value).includes('Object');
|
|
34579
34579
|
}
|
|
34580
34580
|
|
|
@@ -34586,7 +34586,7 @@
|
|
|
34586
34586
|
|
|
34587
34587
|
function validateConfig(config) {
|
|
34588
34588
|
if (!config) errorHandler('configIsRequired');
|
|
34589
|
-
if (!isObject(config)) errorHandler('configType');
|
|
34589
|
+
if (!isObject$1(config)) errorHandler('configType');
|
|
34590
34590
|
|
|
34591
34591
|
if (config.urls) {
|
|
34592
34592
|
informAboutDeprecation();
|
|
@@ -41720,7 +41720,7 @@
|
|
|
41720
41720
|
border-radius: 8px;
|
|
41721
41721
|
}
|
|
41722
41722
|
`;
|
|
41723
|
-
const Styled$
|
|
41723
|
+
const Styled$l = {
|
|
41724
41724
|
BorderRadiusContainer: BorderRadiusContainer$1
|
|
41725
41725
|
};
|
|
41726
41726
|
|
|
@@ -41729,7 +41729,7 @@
|
|
|
41729
41729
|
o.useEffect(() => {
|
|
41730
41730
|
setYamlData(stringify(currentValues));
|
|
41731
41731
|
}, [currentValues]);
|
|
41732
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41732
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$l.BorderRadiusContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41733
41733
|
Ft,
|
|
41734
41734
|
{
|
|
41735
41735
|
defaultLanguage: "yaml",
|
|
@@ -41768,7 +41768,7 @@
|
|
|
41768
41768
|
font-size: 16px;
|
|
41769
41769
|
line-height: 24px;
|
|
41770
41770
|
`;
|
|
41771
|
-
const Styled$
|
|
41771
|
+
const Styled$k = {
|
|
41772
41772
|
BorderRadiusContainer,
|
|
41773
41773
|
ControlsRowContainer: ControlsRowContainer$1,
|
|
41774
41774
|
BigText: BigText$1
|
|
@@ -41847,7 +41847,7 @@
|
|
|
41847
41847
|
};
|
|
41848
41848
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
41849
41849
|
contextHolder,
|
|
41850
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41850
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$k.BorderRadiusContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41851
41851
|
Ft,
|
|
41852
41852
|
{
|
|
41853
41853
|
defaultLanguage: "yaml",
|
|
@@ -41863,7 +41863,7 @@
|
|
|
41863
41863
|
}
|
|
41864
41864
|
}
|
|
41865
41865
|
) }),
|
|
41866
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$k.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
41867
41867
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
|
|
41868
41868
|
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => navigate(backlink), children: "Cancel" })
|
|
41869
41869
|
] }) }),
|
|
@@ -41873,7 +41873,7 @@
|
|
|
41873
41873
|
open: !!error,
|
|
41874
41874
|
onOk: () => setError(void 0),
|
|
41875
41875
|
onCancel: () => setError(void 0),
|
|
41876
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41876
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$k.BigText, { children: "Error!" }) }),
|
|
41877
41877
|
cancelButtonProps: { style: { display: "none" } },
|
|
41878
41878
|
children: [
|
|
41879
41879
|
"An error has occurred: ",
|
|
@@ -41953,7 +41953,7 @@
|
|
|
41953
41953
|
display: ${({ $isOpen }) => $isOpen ? "block" : "none"};
|
|
41954
41954
|
padding: ${({ $designNewLayout }) => $designNewLayout ? "0 0 0 6px" : "4px"};
|
|
41955
41955
|
`;
|
|
41956
|
-
const Styled$
|
|
41956
|
+
const Styled$j = {
|
|
41957
41957
|
Container: Container$1,
|
|
41958
41958
|
TitleBar,
|
|
41959
41959
|
Content: Content$1
|
|
@@ -41980,14 +41980,14 @@
|
|
|
41980
41980
|
}
|
|
41981
41981
|
};
|
|
41982
41982
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
41983
|
-
Styled$
|
|
41983
|
+
Styled$j.Container,
|
|
41984
41984
|
{
|
|
41985
41985
|
$designNewLayout: designNewLayout,
|
|
41986
41986
|
$borderColor: token.colorBorder,
|
|
41987
41987
|
$bgColor: token.colorBgContainer,
|
|
41988
41988
|
children: [
|
|
41989
41989
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", children: [
|
|
41990
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
41990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$j.TitleBar, { onClick: () => toggleCollapse(), children: [
|
|
41991
41991
|
!designNewLayout && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CaretDownOutlined, { size: 14 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CaretRightOutlined, { size: 14 }) }),
|
|
41992
41992
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title }),
|
|
41993
41993
|
designNewLayout && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(DownIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(UpIcon, {}) })
|
|
@@ -41998,7 +41998,7 @@
|
|
|
41998
41998
|
persistedCheckbox
|
|
41999
41999
|
] })
|
|
42000
42000
|
] }),
|
|
42001
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
42001
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.Content, { $isOpen: isOpen, $designNewLayout: designNewLayout, children })
|
|
42002
42002
|
]
|
|
42003
42003
|
}
|
|
42004
42004
|
);
|
|
@@ -42032,13 +42032,13 @@
|
|
|
42032
42032
|
const Content = st.div`
|
|
42033
42033
|
padding: ${({ $designNewLayout }) => $designNewLayout ? "0 0 0 6px" : "4px"};
|
|
42034
42034
|
`;
|
|
42035
|
-
const Styled$
|
|
42035
|
+
const Styled$i = {
|
|
42036
42036
|
Content
|
|
42037
42037
|
};
|
|
42038
42038
|
|
|
42039
42039
|
const ArrayInsideContainer = ({ children }) => {
|
|
42040
42040
|
const designNewLayout = useDesignNewLayout();
|
|
42041
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
42041
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$i.Content, { $designNewLayout: designNewLayout, children });
|
|
42042
42042
|
};
|
|
42043
42043
|
|
|
42044
42044
|
const arraysEqual = (arr1, arr2) => {
|
|
@@ -42714,7 +42714,7 @@
|
|
|
42714
42714
|
cursor: pointer;
|
|
42715
42715
|
padding-top: 11px;
|
|
42716
42716
|
`;
|
|
42717
|
-
const Styled$
|
|
42717
|
+
const Styled$h = {
|
|
42718
42718
|
SwitchAndCrossContainer,
|
|
42719
42719
|
CrossContainer
|
|
42720
42720
|
};
|
|
@@ -42739,7 +42739,7 @@
|
|
|
42739
42739
|
onRemoveByMinus && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { size: "small", type: "text", onClick: onRemoveByMinus, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) })
|
|
42740
42740
|
] })
|
|
42741
42741
|
] }),
|
|
42742
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
42742
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$h.SwitchAndCrossContainer, { children: [
|
|
42743
42743
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
42744
42744
|
ResetedFormItem,
|
|
42745
42745
|
{
|
|
@@ -42749,7 +42749,7 @@
|
|
|
42749
42749
|
arrKey !== void 0 ? arrKey : Array.isArray(name) ? name.slice(-1)[0] : name
|
|
42750
42750
|
),
|
|
42751
42751
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
42752
|
-
Styled$
|
|
42752
|
+
Styled$h.CrossContainer,
|
|
42753
42753
|
{
|
|
42754
42754
|
onClick: () => {
|
|
42755
42755
|
if (makeValueUndefined) {
|
|
@@ -42947,7 +42947,7 @@
|
|
|
42947
42947
|
overflow-x: auto;
|
|
42948
42948
|
scrollbar-width: thin;
|
|
42949
42949
|
`;
|
|
42950
|
-
const ResetedFormList = st(antd.Form.List)`
|
|
42950
|
+
const ResetedFormList$3 = st(antd.Form.List)`
|
|
42951
42951
|
margin-bottom: 8px;
|
|
42952
42952
|
`;
|
|
42953
42953
|
const ControlsRowContainer = st.div`
|
|
@@ -42965,8 +42965,8 @@
|
|
|
42965
42965
|
font-size: 16px;
|
|
42966
42966
|
line-height: 24px;
|
|
42967
42967
|
`;
|
|
42968
|
-
const Styled$
|
|
42969
|
-
ResetedFormList,
|
|
42968
|
+
const Styled$g = {
|
|
42969
|
+
ResetedFormList: ResetedFormList$3,
|
|
42970
42970
|
Container,
|
|
42971
42971
|
OverflowContainer: OverflowContainer$1,
|
|
42972
42972
|
ControlsRowContainer,
|
|
@@ -43213,7 +43213,7 @@
|
|
|
43213
43213
|
}
|
|
43214
43214
|
),
|
|
43215
43215
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43216
|
-
Styled$
|
|
43216
|
+
Styled$g.ResetedFormList,
|
|
43217
43217
|
{
|
|
43218
43218
|
name: arrName || name,
|
|
43219
43219
|
rules: !forceNonRequired && required?.includes(getStringByName(name)) ? [
|
|
@@ -43940,8 +43940,8 @@
|
|
|
43940
43940
|
setPersistedKeys([...persistedKeys.filter((arr) => JSON.stringify(arr) !== JSON.stringify(value))]);
|
|
43941
43941
|
};
|
|
43942
43942
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
43943
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
43944
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
43943
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$g.Container, { $designNewLayout: designNewLayout, $designNewLayoutHeight: designNewLayoutHeight, children: [
|
|
43944
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.OverflowContainer, { ref: overflowRef, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43945
43945
|
antd.Form,
|
|
43946
43946
|
{
|
|
43947
43947
|
form,
|
|
@@ -43985,7 +43985,7 @@
|
|
|
43985
43985
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(YamlEditor, { theme, currentValues: yamlValues || {}, onChange: onYamlChangeCallback }) })
|
|
43986
43986
|
] }),
|
|
43987
43987
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FlexGrow, {}),
|
|
43988
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
43988
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
43989
43989
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
|
|
43990
43990
|
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => navigate(backlink), children: "Cancel" }),
|
|
43991
43991
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => setIsDebugModalOpen(true), icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.BugOutlined, {}) }),
|
|
@@ -43997,7 +43997,7 @@
|
|
|
43997
43997
|
open: !!error,
|
|
43998
43998
|
onOk: () => setError(void 0),
|
|
43999
43999
|
onCancel: () => setError(void 0),
|
|
44000
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44000
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.BigText, { children: "Error!" }) }),
|
|
44001
44001
|
cancelButtonProps: { style: { display: "none" } },
|
|
44002
44002
|
children: [
|
|
44003
44003
|
"An error has occurred: ",
|
|
@@ -44013,7 +44013,7 @@
|
|
|
44013
44013
|
onCancel: () => setIsDebugModalOpen(false),
|
|
44014
44014
|
title: "Debug for properties",
|
|
44015
44015
|
width: "90vw",
|
|
44016
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44016
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.DebugContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(o.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44017
44017
|
Editor,
|
|
44018
44018
|
{
|
|
44019
44019
|
defaultLanguage: "json",
|
|
@@ -44167,12 +44167,12 @@
|
|
|
44167
44167
|
padding: 8px;
|
|
44168
44168
|
}
|
|
44169
44169
|
`;
|
|
44170
|
-
const Styled$
|
|
44170
|
+
const Styled$f = {
|
|
44171
44171
|
CustomCard: CustomCard$5
|
|
44172
44172
|
};
|
|
44173
44173
|
|
|
44174
44174
|
const AddCard = ({ onAddClick }) => {
|
|
44175
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44175
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.CustomCard, { onClick: onAddClick, children: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.PlusOutlined, {}) });
|
|
44176
44176
|
};
|
|
44177
44177
|
|
|
44178
44178
|
const byteToHex = [];
|
|
@@ -44476,7 +44476,7 @@
|
|
|
44476
44476
|
bottom: 6px;
|
|
44477
44477
|
right: 6px;
|
|
44478
44478
|
`;
|
|
44479
|
-
const Styled$
|
|
44479
|
+
const Styled$e = {
|
|
44480
44480
|
CustomCard: CustomCard$4,
|
|
44481
44481
|
ImageContainer,
|
|
44482
44482
|
OverflowContainer,
|
|
@@ -44553,14 +44553,14 @@
|
|
|
44553
44553
|
return null;
|
|
44554
44554
|
}
|
|
44555
44555
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44556
|
-
Styled$
|
|
44556
|
+
Styled$e.CustomCard,
|
|
44557
44557
|
{
|
|
44558
44558
|
$isDisabled: disabled,
|
|
44559
44559
|
$hoverColor: token.colorPrimary,
|
|
44560
44560
|
onClick: () => disabled ? null : navigate(navigateUrl),
|
|
44561
44561
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { vertical: true, style: { width: "100%", height: "100%" }, justify: "spaceBetween", children: [
|
|
44562
44562
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", children: [
|
|
44563
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44563
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.ImageContainer, { dangerouslySetInnerHTML: { __html: decodedIcon } }),
|
|
44564
44564
|
isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44565
44565
|
"div",
|
|
44566
44566
|
{
|
|
@@ -44581,8 +44581,8 @@
|
|
|
44581
44581
|
}
|
|
44582
44582
|
)
|
|
44583
44583
|
] }),
|
|
44584
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
44585
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
44584
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$e.OverflowContainer, { children: [
|
|
44585
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$e.TitleContainer, { children: [
|
|
44586
44586
|
name,
|
|
44587
44587
|
" ",
|
|
44588
44588
|
addedMode && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
@@ -44590,10 +44590,10 @@
|
|
|
44590
44590
|
k8sList?.items?.length
|
|
44591
44591
|
] })
|
|
44592
44592
|
] }),
|
|
44593
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44594
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44593
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.TagsContainer, { children: tags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.CustomTag, { children: tag }, tag)) }),
|
|
44594
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.DescriptionContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: description }) })
|
|
44595
44595
|
] }),
|
|
44596
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44596
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.EditButtonContainer, { children: isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44597
44597
|
"div",
|
|
44598
44598
|
{
|
|
44599
44599
|
onClick: (e) => {
|
|
@@ -44651,7 +44651,7 @@
|
|
|
44651
44651
|
line-clamp: 1;
|
|
44652
44652
|
word-break: break-all;
|
|
44653
44653
|
`;
|
|
44654
|
-
const Styled$
|
|
44654
|
+
const Styled$d = {
|
|
44655
44655
|
BigValue
|
|
44656
44656
|
};
|
|
44657
44657
|
|
|
@@ -44762,7 +44762,7 @@
|
|
|
44762
44762
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", children: [
|
|
44763
44763
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 12, vertical: true, children: [
|
|
44764
44764
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: "Available Products" }) }),
|
|
44765
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44765
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.BigValue, { children: "Marketplace" }) })
|
|
44766
44766
|
] }) }),
|
|
44767
44767
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 12, vertical: true, children: [
|
|
44768
44768
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchTextInput, { uniqueTags, selectedTags, onSelectedTags: setSelectedTags }),
|
|
@@ -44966,7 +44966,7 @@
|
|
|
44966
44966
|
line-clamp: 1;
|
|
44967
44967
|
word-break: break-all;
|
|
44968
44968
|
`;
|
|
44969
|
-
const Styled$
|
|
44969
|
+
const Styled$c = {
|
|
44970
44970
|
ActionMenuPlaceholder};
|
|
44971
44971
|
|
|
44972
44972
|
const ProjectInfoCard$1 = ({
|
|
@@ -45044,7 +45044,7 @@
|
|
|
45044
45044
|
} : void 0,
|
|
45045
45045
|
onUpdate: updatePermission.data?.status.allowed ? openUpdate : void 0
|
|
45046
45046
|
}
|
|
45047
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45047
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$c.ActionMenuPlaceholder, {}) }),
|
|
45048
45048
|
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownAccessGroups, { accessGroups })
|
|
45049
45049
|
] }) })
|
|
45050
45050
|
] }),
|
|
@@ -45130,7 +45130,7 @@
|
|
|
45130
45130
|
width: 100%;
|
|
45131
45131
|
height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
|
|
45132
45132
|
`;
|
|
45133
|
-
const Styled$
|
|
45133
|
+
const Styled$b = {
|
|
45134
45134
|
FullWidthDiv: FullWidthDiv$3,
|
|
45135
45135
|
CustomCard: CustomCard$3
|
|
45136
45136
|
};
|
|
@@ -45215,7 +45215,7 @@
|
|
|
45215
45215
|
};
|
|
45216
45216
|
}, [terminal, endpoint, namespace, podName, container]);
|
|
45217
45217
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45218
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45218
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$b.CustomCard, { $isVisible: !isLoading && !error, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$b.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
|
|
45219
45219
|
isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
|
|
45220
45220
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
|
|
45221
45221
|
] });
|
|
@@ -45226,7 +45226,7 @@
|
|
|
45226
45226
|
width: 200px;
|
|
45227
45227
|
}
|
|
45228
45228
|
`;
|
|
45229
|
-
const Styled$
|
|
45229
|
+
const Styled$a = {
|
|
45230
45230
|
CustomSelect: CustomSelect$3
|
|
45231
45231
|
};
|
|
45232
45232
|
|
|
@@ -45237,7 +45237,7 @@
|
|
|
45237
45237
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
|
|
45238
45238
|
}
|
|
45239
45239
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45240
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45240
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$a.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45241
45241
|
antd.Select,
|
|
45242
45242
|
{
|
|
45243
45243
|
placeholder: "Select container",
|
|
@@ -45289,7 +45289,7 @@
|
|
|
45289
45289
|
align-items: center;
|
|
45290
45290
|
gap: 8px;
|
|
45291
45291
|
`;
|
|
45292
|
-
const Styled$
|
|
45292
|
+
const Styled$9 = {
|
|
45293
45293
|
FullWidthDiv: FullWidthDiv$2,
|
|
45294
45294
|
CustomCard: CustomCard$2,
|
|
45295
45295
|
ProgressContainer
|
|
@@ -45421,8 +45421,8 @@
|
|
|
45421
45421
|
};
|
|
45422
45422
|
}, [terminal, endpoint, nodeName, profile]);
|
|
45423
45423
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45424
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45425
|
-
!isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
45424
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$9.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$9.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
|
|
45425
|
+
!isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$9.ProgressContainer, { $substractHeight: substractHeight, children: [
|
|
45426
45426
|
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
|
|
45427
45427
|
!isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Progress, { type: "circle", percent: progressPercent }),
|
|
45428
45428
|
warmupMessage && /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Typography.Text, { children: [
|
|
@@ -45443,7 +45443,7 @@
|
|
|
45443
45443
|
width: 200px;
|
|
45444
45444
|
}
|
|
45445
45445
|
`;
|
|
45446
|
-
const Styled$
|
|
45446
|
+
const Styled$8 = {
|
|
45447
45447
|
CustomSelect: CustomSelect$2
|
|
45448
45448
|
};
|
|
45449
45449
|
|
|
@@ -45452,7 +45452,7 @@
|
|
|
45452
45452
|
const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/terminalNode/terminalNode`;
|
|
45453
45453
|
const profiles = ["legacy", "general", "baseline", "netadmin", "restricted", "sysadmin"];
|
|
45454
45454
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45455
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45455
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$8.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45456
45456
|
antd.Select,
|
|
45457
45457
|
{
|
|
45458
45458
|
placeholder: "Select profile",
|
|
@@ -45491,7 +45491,7 @@
|
|
|
45491
45491
|
width: 100%;
|
|
45492
45492
|
height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
|
|
45493
45493
|
`;
|
|
45494
|
-
const Styled$
|
|
45494
|
+
const Styled$7 = {
|
|
45495
45495
|
FullWidthDiv: FullWidthDiv$1,
|
|
45496
45496
|
CustomCard: CustomCard$1
|
|
45497
45497
|
};
|
|
@@ -45572,7 +45572,7 @@
|
|
|
45572
45572
|
};
|
|
45573
45573
|
}, [terminal, endpoint, namespace, podName, container]);
|
|
45574
45574
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45575
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45575
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$7.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$7.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
|
|
45576
45576
|
isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
|
|
45577
45577
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
|
|
45578
45578
|
] });
|
|
@@ -45583,7 +45583,7 @@
|
|
|
45583
45583
|
width: 200px;
|
|
45584
45584
|
}
|
|
45585
45585
|
`;
|
|
45586
|
-
const Styled$
|
|
45586
|
+
const Styled$6 = {
|
|
45587
45587
|
CustomSelect: CustomSelect$1
|
|
45588
45588
|
};
|
|
45589
45589
|
|
|
@@ -45594,7 +45594,7 @@
|
|
|
45594
45594
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
|
|
45595
45595
|
}
|
|
45596
45596
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45597
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45597
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45598
45598
|
antd.Select,
|
|
45599
45599
|
{
|
|
45600
45600
|
placeholder: "Select container",
|
|
@@ -45644,7 +45644,7 @@
|
|
|
45644
45644
|
cursor: pointer;
|
|
45645
45645
|
user-select: none;
|
|
45646
45646
|
`;
|
|
45647
|
-
const Styled$
|
|
45647
|
+
const Styled$5 = {
|
|
45648
45648
|
FullWidthDiv,
|
|
45649
45649
|
CustomCard,
|
|
45650
45650
|
VisibilityContainer: VisibilityContainer$2,
|
|
@@ -45718,9 +45718,9 @@
|
|
|
45718
45718
|
};
|
|
45719
45719
|
}, [endpoint, namespace, podName, container, previous]);
|
|
45720
45720
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45721
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.VisibilityContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "start", align: "center", gap: 16, children: [
|
|
45722
45722
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45723
|
-
Styled$
|
|
45723
|
+
Styled$5.CursorPointerDiv,
|
|
45724
45724
|
{
|
|
45725
45725
|
onClick: () => {
|
|
45726
45726
|
if (isPaused) {
|
|
@@ -45745,7 +45745,7 @@
|
|
|
45745
45745
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isPaused ? "Not streaming events" : "Streaming events" })
|
|
45746
45746
|
] }) }),
|
|
45747
45747
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
|
|
45748
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45748
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45749
45749
|
Ft,
|
|
45750
45750
|
{
|
|
45751
45751
|
defaultLanguage: "plaintext",
|
|
@@ -45776,7 +45776,7 @@
|
|
|
45776
45776
|
width: 200px;
|
|
45777
45777
|
}
|
|
45778
45778
|
`;
|
|
45779
|
-
const Styled$
|
|
45779
|
+
const Styled$4 = {
|
|
45780
45780
|
TopRowContent,
|
|
45781
45781
|
CustomSelect
|
|
45782
45782
|
};
|
|
@@ -45822,8 +45822,8 @@
|
|
|
45822
45822
|
}
|
|
45823
45823
|
];
|
|
45824
45824
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45825
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45826
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45825
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.TopRowContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 16, children: [
|
|
45826
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45827
45827
|
antd.Select,
|
|
45828
45828
|
{
|
|
45829
45829
|
placeholder: "Select container",
|
|
@@ -45838,7 +45838,7 @@
|
|
|
45838
45838
|
}
|
|
45839
45839
|
}
|
|
45840
45840
|
) }),
|
|
45841
|
-
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45841
|
+
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45842
45842
|
antd.Select,
|
|
45843
45843
|
{
|
|
45844
45844
|
placeholder: "Select current/previous",
|
|
@@ -46751,7 +46751,7 @@
|
|
|
46751
46751
|
const VisibilityContainer$1 = st.div`
|
|
46752
46752
|
display: ${({ $hidden }) => $hidden ? "none" : "block"};
|
|
46753
46753
|
`;
|
|
46754
|
-
const Styled = {
|
|
46754
|
+
const Styled$3 = {
|
|
46755
46755
|
VisibilityContainer: VisibilityContainer$1
|
|
46756
46756
|
};
|
|
46757
46757
|
|
|
@@ -46774,7 +46774,7 @@
|
|
|
46774
46774
|
if (isMultiqueryLoading) {
|
|
46775
46775
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
46776
46776
|
}
|
|
46777
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.VisibilityContainer, { $hidden: valuePrepared === "~undefined-value~", children });
|
|
46777
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.VisibilityContainer, { $hidden: valuePrepared === "~undefined-value~", children });
|
|
46778
46778
|
};
|
|
46779
46779
|
|
|
46780
46780
|
const unknownToString = (value) => {
|
|
@@ -46786,7 +46786,7 @@
|
|
|
46786
46786
|
}
|
|
46787
46787
|
return value.toString();
|
|
46788
46788
|
};
|
|
46789
|
-
const flattenOnce$
|
|
46789
|
+
const flattenOnce$3 = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
46790
46790
|
const isRecordArray = (val) => {
|
|
46791
46791
|
return Array.isArray(val) && val.every(
|
|
46792
46792
|
(item) => item !== null && typeof item === "object" && // exclude nested Arrays if you want “plain” objects only:
|
|
@@ -46799,7 +46799,7 @@
|
|
|
46799
46799
|
}
|
|
46800
46800
|
let flattenArrayOfUnknown = [];
|
|
46801
46801
|
try {
|
|
46802
|
-
flattenArrayOfUnknown = flattenOnce$
|
|
46802
|
+
flattenArrayOfUnknown = flattenOnce$3(value);
|
|
46803
46803
|
} catch (e) {
|
|
46804
46804
|
console.log(e);
|
|
46805
46805
|
return { error: "Error while flattening" };
|
|
@@ -46862,14 +46862,14 @@
|
|
|
46862
46862
|
] });
|
|
46863
46863
|
};
|
|
46864
46864
|
|
|
46865
|
-
const flattenOnce = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
46866
|
-
const getItemsInside$
|
|
46865
|
+
const flattenOnce$2 = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
46866
|
+
const getItemsInside$4 = (value) => {
|
|
46867
46867
|
if (!Array.isArray(value)) {
|
|
46868
46868
|
return { error: "Value on jsonPath is not an array" };
|
|
46869
46869
|
}
|
|
46870
46870
|
let flattenArrayOfUnknown = [];
|
|
46871
46871
|
try {
|
|
46872
|
-
flattenArrayOfUnknown = flattenOnce(value);
|
|
46872
|
+
flattenArrayOfUnknown = flattenOnce$2(value);
|
|
46873
46873
|
} catch (e) {
|
|
46874
46874
|
console.log(e);
|
|
46875
46875
|
return { error: "Error while flattening" };
|
|
@@ -46911,7 +46911,7 @@
|
|
|
46911
46911
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
|
|
46912
46912
|
}
|
|
46913
46913
|
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToArray}`);
|
|
46914
|
-
const { counter, error: errorArrayOfObjects } = getItemsInside$
|
|
46914
|
+
const { counter, error: errorArrayOfObjects } = getItemsInside$4(anythingForNow);
|
|
46915
46915
|
if (errorArrayOfObjects) {
|
|
46916
46916
|
console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
|
|
46917
46917
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
|
|
@@ -46924,7 +46924,7 @@
|
|
|
46924
46924
|
] });
|
|
46925
46925
|
};
|
|
46926
46926
|
|
|
46927
|
-
const getItemsInside = (value) => {
|
|
46927
|
+
const getItemsInside$3 = (value) => {
|
|
46928
46928
|
if (!Array.isArray(value)) {
|
|
46929
46929
|
return { error: "Value on jsonPath is not an array" };
|
|
46930
46930
|
}
|
|
@@ -46968,7 +46968,7 @@
|
|
|
46968
46968
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
|
|
46969
46969
|
}
|
|
46970
46970
|
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToObj}`);
|
|
46971
|
-
const { counter, error: errorArrayOfObjects } = getItemsInside(anythingForNow);
|
|
46971
|
+
const { counter, error: errorArrayOfObjects } = getItemsInside$3(anythingForNow);
|
|
46972
46972
|
if (errorArrayOfObjects) {
|
|
46973
46973
|
console.log(`Key Counter: ${id}: ${errorArrayOfObjects}`);
|
|
46974
46974
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
|
|
@@ -46998,7 +46998,7 @@
|
|
|
46998
46998
|
return text.length > max ? text.slice(0, max) + "..." : text;
|
|
46999
46999
|
};
|
|
47000
47000
|
|
|
47001
|
-
const EditModal = ({
|
|
47001
|
+
const EditModal$3 = ({
|
|
47002
47002
|
open,
|
|
47003
47003
|
close,
|
|
47004
47004
|
values,
|
|
@@ -47011,7 +47011,9 @@
|
|
|
47011
47011
|
endpoint,
|
|
47012
47012
|
pathToValue,
|
|
47013
47013
|
editModalWidth,
|
|
47014
|
-
paddingContainerEnd
|
|
47014
|
+
paddingContainerEnd,
|
|
47015
|
+
modalDescriptionTextStyle,
|
|
47016
|
+
inputLabelStyle
|
|
47015
47017
|
}) => {
|
|
47016
47018
|
const queryClient = reactQuery.useQueryClient();
|
|
47017
47019
|
const [error, setError] = o.useState();
|
|
@@ -47070,11 +47072,11 @@
|
|
|
47070
47072
|
children: [
|
|
47071
47073
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
|
|
47072
47074
|
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47073
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: modalDescriptionText }),
|
|
47075
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: modalDescriptionTextStyle, children: modalDescriptionText }),
|
|
47074
47076
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
47075
47077
|
] }),
|
|
47076
47078
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Form, { form, children: [
|
|
47077
|
-
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, children: inputLabel }),
|
|
47079
|
+
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, style: inputLabelStyle, children: inputLabel }),
|
|
47078
47080
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47079
47081
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47080
47082
|
ResetedFormItem,
|
|
@@ -47137,7 +47139,9 @@
|
|
|
47137
47139
|
notificationSuccessMessageDescription,
|
|
47138
47140
|
modalTitle,
|
|
47139
47141
|
modalDescriptionText,
|
|
47142
|
+
modalDescriptionTextStyle,
|
|
47140
47143
|
inputLabel,
|
|
47144
|
+
inputLabelStyle,
|
|
47141
47145
|
containerStyle,
|
|
47142
47146
|
maxEditTagTextLength,
|
|
47143
47147
|
allowClearEditSelect,
|
|
@@ -47224,11 +47228,10 @@
|
|
|
47224
47228
|
children,
|
|
47225
47229
|
contextHolder,
|
|
47226
47230
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47227
|
-
EditModal,
|
|
47231
|
+
EditModal$3,
|
|
47228
47232
|
{
|
|
47229
47233
|
open,
|
|
47230
47234
|
close: () => setOpen(false),
|
|
47231
|
-
values: labelsRaw,
|
|
47232
47235
|
openNotificationSuccess,
|
|
47233
47236
|
modalTitle: modalTitlePrepared,
|
|
47234
47237
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
@@ -47238,7 +47241,9 @@
|
|
|
47238
47241
|
endpoint: endpointPrepared,
|
|
47239
47242
|
pathToValue: pathToValuePrepared,
|
|
47240
47243
|
editModalWidth,
|
|
47241
|
-
paddingContainerEnd
|
|
47244
|
+
paddingContainerEnd,
|
|
47245
|
+
modalDescriptionTextStyle,
|
|
47246
|
+
inputLabelStyle
|
|
47242
47247
|
}
|
|
47243
47248
|
)
|
|
47244
47249
|
] });
|
|
@@ -47289,7 +47294,7 @@
|
|
|
47289
47294
|
children,
|
|
47290
47295
|
contextHolder,
|
|
47291
47296
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47292
|
-
EditModal,
|
|
47297
|
+
EditModal$3,
|
|
47293
47298
|
{
|
|
47294
47299
|
open,
|
|
47295
47300
|
close: () => setOpen(false),
|
|
@@ -47303,7 +47308,9 @@
|
|
|
47303
47308
|
endpoint: endpointPrepared,
|
|
47304
47309
|
pathToValue: pathToValuePrepared,
|
|
47305
47310
|
editModalWidth,
|
|
47306
|
-
paddingContainerEnd
|
|
47311
|
+
paddingContainerEnd,
|
|
47312
|
+
modalDescriptionTextStyle,
|
|
47313
|
+
inputLabelStyle
|
|
47307
47314
|
}
|
|
47308
47315
|
)
|
|
47309
47316
|
] });
|
|
@@ -47327,6 +47334,7 @@
|
|
|
47327
47334
|
reqIndex,
|
|
47328
47335
|
jsonPathToLabels,
|
|
47329
47336
|
linkPrefix,
|
|
47337
|
+
errorText,
|
|
47330
47338
|
...linkProps
|
|
47331
47339
|
} = data;
|
|
47332
47340
|
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
@@ -47350,15 +47358,23 @@
|
|
|
47350
47358
|
}
|
|
47351
47359
|
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToLabels}`);
|
|
47352
47360
|
const { data: labelsRaw, error: errorArrayOfObjects } = parseArrayOfAny(anythingForNow);
|
|
47361
|
+
const linkPrefixPrepared = parseAll({ text: linkPrefix, replaceValues, multiQueryData });
|
|
47353
47362
|
if (!labelsRaw) {
|
|
47354
47363
|
if (errorArrayOfObjects) {
|
|
47355
|
-
|
|
47356
|
-
|
|
47357
|
-
|
|
47364
|
+
console.log(errorArrayOfObjects);
|
|
47365
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Typography.Link, { href: linkPrefixPrepared, ...linkProps, children: [
|
|
47366
|
+
errorText,
|
|
47367
|
+
children
|
|
47368
|
+
] });
|
|
47369
|
+
}
|
|
47370
|
+
console.log("Not a valid data structure");
|
|
47371
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Typography.Link, { href: linkPrefixPrepared, ...linkProps, children: [
|
|
47372
|
+
errorText,
|
|
47373
|
+
children
|
|
47374
|
+
] });
|
|
47358
47375
|
}
|
|
47359
47376
|
const labels = Object.entries(labelsRaw).map(([key, value]) => `${key}=${value}`).join(",");
|
|
47360
47377
|
const labelsEncoded = encodeURIComponent(labels);
|
|
47361
|
-
const linkPrefixPrepared = parseAll({ text: linkPrefix, replaceValues, multiQueryData });
|
|
47362
47378
|
const hrefPrepared = `${linkPrefixPrepared}?${labelsEncoded}`;
|
|
47363
47379
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Typography.Link, { href: hrefPrepared, ...linkProps, children: [
|
|
47364
47380
|
labels,
|
|
@@ -47366,6 +47382,984 @@
|
|
|
47366
47382
|
] });
|
|
47367
47383
|
};
|
|
47368
47384
|
|
|
47385
|
+
const ResetedFormList$2 = st(antd.Form.List)`
|
|
47386
|
+
margin-bottom: 8px;
|
|
47387
|
+
`;
|
|
47388
|
+
const Styled$2 = {
|
|
47389
|
+
ResetedFormList: ResetedFormList$2
|
|
47390
|
+
};
|
|
47391
|
+
|
|
47392
|
+
const EditModal$2 = ({
|
|
47393
|
+
open,
|
|
47394
|
+
close,
|
|
47395
|
+
values,
|
|
47396
|
+
openNotificationSuccess,
|
|
47397
|
+
modalTitle,
|
|
47398
|
+
modalDescriptionText,
|
|
47399
|
+
inputLabel,
|
|
47400
|
+
endpoint,
|
|
47401
|
+
pathToValue,
|
|
47402
|
+
editModalWidth,
|
|
47403
|
+
cols,
|
|
47404
|
+
modalDescriptionTextStyle,
|
|
47405
|
+
inputLabelStyle
|
|
47406
|
+
}) => {
|
|
47407
|
+
const queryClient = reactQuery.useQueryClient();
|
|
47408
|
+
const [error, setError] = o.useState();
|
|
47409
|
+
const [isLoading, setIsLoading] = o.useState(false);
|
|
47410
|
+
const [form] = antd.Form.useForm();
|
|
47411
|
+
const taints = antd.Form.useWatch("taints", form);
|
|
47412
|
+
o.useEffect(() => {
|
|
47413
|
+
if (open) {
|
|
47414
|
+
form.setFieldsValue({
|
|
47415
|
+
taints: values || []
|
|
47416
|
+
});
|
|
47417
|
+
}
|
|
47418
|
+
}, [open, form]);
|
|
47419
|
+
const submit = () => {
|
|
47420
|
+
form.validateFields().then(() => {
|
|
47421
|
+
console.log(JSON.stringify(taints));
|
|
47422
|
+
setIsLoading(true);
|
|
47423
|
+
setError(void 0);
|
|
47424
|
+
patchEntryWithReplaceOp({ endpoint, pathToValue, body: taints }).then(() => {
|
|
47425
|
+
queryClient.invalidateQueries({ queryKey: ["multi"] });
|
|
47426
|
+
if (openNotificationSuccess) {
|
|
47427
|
+
openNotificationSuccess();
|
|
47428
|
+
}
|
|
47429
|
+
setIsLoading(false);
|
|
47430
|
+
setError(void 0);
|
|
47431
|
+
close();
|
|
47432
|
+
}).catch((error2) => {
|
|
47433
|
+
setIsLoading(false);
|
|
47434
|
+
setError(error2);
|
|
47435
|
+
});
|
|
47436
|
+
}).catch(() => console.log("Validating error"));
|
|
47437
|
+
};
|
|
47438
|
+
const effectOptions = ["NoSchedule", "PreferNoSchedule", "NoExecute"];
|
|
47439
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
47440
|
+
antd.Modal,
|
|
47441
|
+
{
|
|
47442
|
+
title: modalTitle,
|
|
47443
|
+
open,
|
|
47444
|
+
onOk: () => submit(),
|
|
47445
|
+
onCancel: () => {
|
|
47446
|
+
close();
|
|
47447
|
+
form.resetFields();
|
|
47448
|
+
setIsLoading(false);
|
|
47449
|
+
setError(void 0);
|
|
47450
|
+
},
|
|
47451
|
+
okText: "Save",
|
|
47452
|
+
confirmLoading: isLoading,
|
|
47453
|
+
maskClosable: false,
|
|
47454
|
+
width: editModalWidth || 520,
|
|
47455
|
+
destroyOnHidden: true,
|
|
47456
|
+
centered: true,
|
|
47457
|
+
children: [
|
|
47458
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
|
|
47459
|
+
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47460
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: modalDescriptionTextStyle, children: modalDescriptionText }),
|
|
47461
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
47462
|
+
] }),
|
|
47463
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Form, { form, children: [
|
|
47464
|
+
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, style: inputLabelStyle, children: inputLabel }),
|
|
47465
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47466
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
|
|
47467
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Key" }) }),
|
|
47468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Value" }) }),
|
|
47469
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Effect" }) }),
|
|
47470
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
|
|
47471
|
+
] }),
|
|
47472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47473
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$2.ResetedFormList, { name: "taints", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47474
|
+
fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
|
|
47475
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47476
|
+
ResetedFormItem,
|
|
47477
|
+
{
|
|
47478
|
+
...restField,
|
|
47479
|
+
name: [name, "key"],
|
|
47480
|
+
rules: [
|
|
47481
|
+
{
|
|
47482
|
+
validator: (_, v) => v === void 0 || typeof v === "string" ? Promise.resolve() : Promise.reject(new Error("Key must be a string."))
|
|
47483
|
+
}
|
|
47484
|
+
],
|
|
47485
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { placeholder: "e.g. dedicated" })
|
|
47486
|
+
}
|
|
47487
|
+
) }),
|
|
47488
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47489
|
+
ResetedFormItem,
|
|
47490
|
+
{
|
|
47491
|
+
...restField,
|
|
47492
|
+
name: [name, "value"],
|
|
47493
|
+
rules: [
|
|
47494
|
+
{
|
|
47495
|
+
validator: (_, v) => v === void 0 || typeof v === "string" ? Promise.resolve() : Promise.reject(new Error("Value must be a string."))
|
|
47496
|
+
}
|
|
47497
|
+
],
|
|
47498
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { placeholder: "e.g. batch" })
|
|
47499
|
+
}
|
|
47500
|
+
) }),
|
|
47501
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47502
|
+
ResetedFormItem,
|
|
47503
|
+
{
|
|
47504
|
+
...restField,
|
|
47505
|
+
name: [name, "effect"],
|
|
47506
|
+
rules: [
|
|
47507
|
+
{ required: true, message: "Effect is required." },
|
|
47508
|
+
{
|
|
47509
|
+
validator: (_, v) => v && effectOptions.includes(v) ? Promise.resolve() : Promise.reject(new Error("Select a valid effect."))
|
|
47510
|
+
}
|
|
47511
|
+
],
|
|
47512
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47513
|
+
antd.Select,
|
|
47514
|
+
{
|
|
47515
|
+
placeholder: "Select effect",
|
|
47516
|
+
options: effectOptions.map((eff) => ({ label: eff, value: eff }))
|
|
47517
|
+
}
|
|
47518
|
+
)
|
|
47519
|
+
}
|
|
47520
|
+
) }),
|
|
47521
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { size: "small", type: "text", onClick: () => remove(name), children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) }) })
|
|
47522
|
+
] }, key)),
|
|
47523
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResetedFormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "text", size: "small", onClick: () => add(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon, {}) }) })
|
|
47524
|
+
] }) })
|
|
47525
|
+
] })
|
|
47526
|
+
]
|
|
47527
|
+
}
|
|
47528
|
+
);
|
|
47529
|
+
};
|
|
47530
|
+
|
|
47531
|
+
const flattenOnce$1 = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
47532
|
+
const ALLOWED_EFFECTS$1 = /* @__PURE__ */ new Set(["NoSchedule", "PreferNoSchedule", "NoExecute"]);
|
|
47533
|
+
const isTaintLike = (x) => {
|
|
47534
|
+
if (x === null || typeof x !== "object" || Array.isArray(x)) return false;
|
|
47535
|
+
const o = x;
|
|
47536
|
+
if (typeof o.effect !== "string" || !ALLOWED_EFFECTS$1.has(o.effect)) return false;
|
|
47537
|
+
if ("key" in o && typeof o.key !== "string") return false;
|
|
47538
|
+
if ("value" in o && typeof o.value !== "string") return false;
|
|
47539
|
+
return true;
|
|
47540
|
+
};
|
|
47541
|
+
const filterTaintLikes = (input) => {
|
|
47542
|
+
if (!Array.isArray(input)) return [];
|
|
47543
|
+
return input.filter(isTaintLike);
|
|
47544
|
+
};
|
|
47545
|
+
const getItemsInside$2 = (value) => {
|
|
47546
|
+
if (!Array.isArray(value)) {
|
|
47547
|
+
return { error: "Value on jsonPath is not an array" };
|
|
47548
|
+
}
|
|
47549
|
+
let flattenArrayOfUnknown = [];
|
|
47550
|
+
try {
|
|
47551
|
+
flattenArrayOfUnknown = flattenOnce$1(value);
|
|
47552
|
+
} catch (e) {
|
|
47553
|
+
console.log(e);
|
|
47554
|
+
return { error: "Error while flattening" };
|
|
47555
|
+
}
|
|
47556
|
+
return { counter: flattenArrayOfUnknown.length, taints: filterTaintLikes(flattenArrayOfUnknown) };
|
|
47557
|
+
};
|
|
47558
|
+
|
|
47559
|
+
const Taints = ({ data, children }) => {
|
|
47560
|
+
const {
|
|
47561
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47562
|
+
id,
|
|
47563
|
+
reqIndex,
|
|
47564
|
+
jsonPathToArray,
|
|
47565
|
+
text,
|
|
47566
|
+
errorText,
|
|
47567
|
+
style,
|
|
47568
|
+
notificationSuccessMessage,
|
|
47569
|
+
notificationSuccessMessageDescription,
|
|
47570
|
+
modalTitle,
|
|
47571
|
+
modalDescriptionText,
|
|
47572
|
+
modalDescriptionTextStyle,
|
|
47573
|
+
inputLabel,
|
|
47574
|
+
inputLabelStyle,
|
|
47575
|
+
containerStyle,
|
|
47576
|
+
endpoint,
|
|
47577
|
+
pathToValue,
|
|
47578
|
+
editModalWidth,
|
|
47579
|
+
cols
|
|
47580
|
+
} = data;
|
|
47581
|
+
const [api, contextHolder] = antd.notification.useNotification();
|
|
47582
|
+
const [open, setOpen] = o.useState(false);
|
|
47583
|
+
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
47584
|
+
const partsOfUrl = usePartsOfUrl();
|
|
47585
|
+
if (isMultiQueryLoading) {
|
|
47586
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
47587
|
+
}
|
|
47588
|
+
if (isMultiQueryErrors) {
|
|
47589
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
47590
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
47591
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
47592
|
+
] });
|
|
47593
|
+
}
|
|
47594
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
47595
|
+
acc[index.toString()] = value;
|
|
47596
|
+
return acc;
|
|
47597
|
+
}, {});
|
|
47598
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
47599
|
+
if (jsonRoot === void 0) {
|
|
47600
|
+
console.log("Item Counter: ${id}: No root for json path");
|
|
47601
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
|
|
47602
|
+
}
|
|
47603
|
+
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToArray}`);
|
|
47604
|
+
const { counter, taints, error: errorArrayOfObjects } = getItemsInside$2(anythingForNow);
|
|
47605
|
+
const notificationSuccessMessagePrepared = notificationSuccessMessage ? parseAll({
|
|
47606
|
+
text: notificationSuccessMessage,
|
|
47607
|
+
replaceValues,
|
|
47608
|
+
multiQueryData
|
|
47609
|
+
}) : "Success";
|
|
47610
|
+
const notificationSuccessMessageDescriptionPrepared = notificationSuccessMessageDescription ? parseAll({
|
|
47611
|
+
text: notificationSuccessMessageDescription,
|
|
47612
|
+
replaceValues,
|
|
47613
|
+
multiQueryData
|
|
47614
|
+
}) : "Success";
|
|
47615
|
+
const modalTitlePrepared = modalTitle ? parseAll({ text: modalTitle, replaceValues, multiQueryData }) : "Edit";
|
|
47616
|
+
const modalDescriptionTextPrepared = modalDescriptionText ? parseAll({ text: modalDescriptionText, replaceValues, multiQueryData }) : void 0;
|
|
47617
|
+
const inputLabelPrepared = inputLabel ? parseAll({ text: inputLabel, replaceValues, multiQueryData }) : void 0;
|
|
47618
|
+
const endpointPrepared = endpoint ? parseAll({ text: endpoint, replaceValues, multiQueryData }) : "no-endpoint-provided";
|
|
47619
|
+
const pathToValuePrepared = pathToValue ? parseAll({ text: pathToValue, replaceValues, multiQueryData }) : "no-pathToValue-provided";
|
|
47620
|
+
const openNotificationSuccess = () => {
|
|
47621
|
+
api.success({
|
|
47622
|
+
message: notificationSuccessMessagePrepared,
|
|
47623
|
+
description: notificationSuccessMessageDescriptionPrepared,
|
|
47624
|
+
placement: "bottomRight"
|
|
47625
|
+
});
|
|
47626
|
+
};
|
|
47627
|
+
if (errorArrayOfObjects) {
|
|
47628
|
+
console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
|
|
47629
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47630
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
47631
|
+
errorText,
|
|
47632
|
+
" ",
|
|
47633
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47634
|
+
antd.Button,
|
|
47635
|
+
{
|
|
47636
|
+
type: "text",
|
|
47637
|
+
size: "small",
|
|
47638
|
+
onClick: (e) => {
|
|
47639
|
+
e.stopPropagation();
|
|
47640
|
+
setOpen(true);
|
|
47641
|
+
},
|
|
47642
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
47643
|
+
}
|
|
47644
|
+
)
|
|
47645
|
+
] }) }),
|
|
47646
|
+
contextHolder,
|
|
47647
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47648
|
+
EditModal$2,
|
|
47649
|
+
{
|
|
47650
|
+
open,
|
|
47651
|
+
close: () => setOpen(false),
|
|
47652
|
+
values: taints,
|
|
47653
|
+
openNotificationSuccess,
|
|
47654
|
+
modalTitle: modalTitlePrepared,
|
|
47655
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
47656
|
+
inputLabel: inputLabelPrepared,
|
|
47657
|
+
endpoint: endpointPrepared,
|
|
47658
|
+
pathToValue: pathToValuePrepared,
|
|
47659
|
+
editModalWidth,
|
|
47660
|
+
cols,
|
|
47661
|
+
modalDescriptionTextStyle,
|
|
47662
|
+
inputLabelStyle
|
|
47663
|
+
}
|
|
47664
|
+
)
|
|
47665
|
+
] });
|
|
47666
|
+
}
|
|
47667
|
+
const parsedText = parseAll({ text, replaceValues, multiQueryData });
|
|
47668
|
+
const parsedTextWithCounter = parsedText.replace("~counter~", String(counter || 0));
|
|
47669
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47670
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
47671
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
47672
|
+
parsedTextWithCounter,
|
|
47673
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47674
|
+
antd.Button,
|
|
47675
|
+
{
|
|
47676
|
+
type: "text",
|
|
47677
|
+
size: "small",
|
|
47678
|
+
onClick: (e) => {
|
|
47679
|
+
e.stopPropagation();
|
|
47680
|
+
setOpen(true);
|
|
47681
|
+
},
|
|
47682
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
47683
|
+
}
|
|
47684
|
+
)
|
|
47685
|
+
] }),
|
|
47686
|
+
children
|
|
47687
|
+
] }),
|
|
47688
|
+
contextHolder,
|
|
47689
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47690
|
+
EditModal$2,
|
|
47691
|
+
{
|
|
47692
|
+
open,
|
|
47693
|
+
close: () => setOpen(false),
|
|
47694
|
+
values: taints,
|
|
47695
|
+
openNotificationSuccess,
|
|
47696
|
+
modalTitle: modalTitlePrepared,
|
|
47697
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
47698
|
+
inputLabel: inputLabelPrepared,
|
|
47699
|
+
endpoint: endpointPrepared,
|
|
47700
|
+
pathToValue: pathToValuePrepared,
|
|
47701
|
+
editModalWidth,
|
|
47702
|
+
cols,
|
|
47703
|
+
modalDescriptionTextStyle,
|
|
47704
|
+
inputLabelStyle
|
|
47705
|
+
}
|
|
47706
|
+
)
|
|
47707
|
+
] });
|
|
47708
|
+
};
|
|
47709
|
+
|
|
47710
|
+
const ResetedFormList$1 = st(antd.Form.List)`
|
|
47711
|
+
margin-bottom: 8px;
|
|
47712
|
+
`;
|
|
47713
|
+
const Styled$1 = {
|
|
47714
|
+
ResetedFormList: ResetedFormList$1
|
|
47715
|
+
};
|
|
47716
|
+
|
|
47717
|
+
const EditModal$1 = ({
|
|
47718
|
+
open,
|
|
47719
|
+
close,
|
|
47720
|
+
values,
|
|
47721
|
+
openNotificationSuccess,
|
|
47722
|
+
modalTitle,
|
|
47723
|
+
modalDescriptionText,
|
|
47724
|
+
inputLabel,
|
|
47725
|
+
endpoint,
|
|
47726
|
+
pathToValue,
|
|
47727
|
+
editModalWidth,
|
|
47728
|
+
cols,
|
|
47729
|
+
modalDescriptionTextStyle,
|
|
47730
|
+
inputLabelStyle
|
|
47731
|
+
}) => {
|
|
47732
|
+
const queryClient = reactQuery.useQueryClient();
|
|
47733
|
+
const [error, setError] = o.useState();
|
|
47734
|
+
const [isLoading, setIsLoading] = o.useState(false);
|
|
47735
|
+
const [form] = antd.Form.useForm();
|
|
47736
|
+
const tolerations = antd.Form.useWatch("tolerations", form);
|
|
47737
|
+
o.useEffect(() => {
|
|
47738
|
+
if (open) {
|
|
47739
|
+
form.setFieldsValue({
|
|
47740
|
+
tolerations: values || []
|
|
47741
|
+
});
|
|
47742
|
+
}
|
|
47743
|
+
}, [open, form]);
|
|
47744
|
+
const submit = () => {
|
|
47745
|
+
form.validateFields().then(() => {
|
|
47746
|
+
console.log(JSON.stringify(tolerations));
|
|
47747
|
+
setIsLoading(true);
|
|
47748
|
+
setError(void 0);
|
|
47749
|
+
patchEntryWithReplaceOp({ endpoint, pathToValue, body: tolerations }).then(() => {
|
|
47750
|
+
queryClient.invalidateQueries({ queryKey: ["multi"] });
|
|
47751
|
+
if (openNotificationSuccess) {
|
|
47752
|
+
openNotificationSuccess();
|
|
47753
|
+
}
|
|
47754
|
+
setIsLoading(false);
|
|
47755
|
+
setError(void 0);
|
|
47756
|
+
close();
|
|
47757
|
+
}).catch((error2) => {
|
|
47758
|
+
setIsLoading(false);
|
|
47759
|
+
setError(error2);
|
|
47760
|
+
});
|
|
47761
|
+
}).catch(() => console.log("Validating error"));
|
|
47762
|
+
};
|
|
47763
|
+
const operatorOptions = ["Exists", "Equal"];
|
|
47764
|
+
const effectOptions = ["NoSchedule", "PreferNoSchedule", "NoExecute"];
|
|
47765
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
47766
|
+
antd.Modal,
|
|
47767
|
+
{
|
|
47768
|
+
title: modalTitle,
|
|
47769
|
+
open,
|
|
47770
|
+
onOk: () => submit(),
|
|
47771
|
+
onCancel: () => {
|
|
47772
|
+
close();
|
|
47773
|
+
form.resetFields();
|
|
47774
|
+
setIsLoading(false);
|
|
47775
|
+
setError(void 0);
|
|
47776
|
+
},
|
|
47777
|
+
okText: "Save",
|
|
47778
|
+
confirmLoading: isLoading,
|
|
47779
|
+
maskClosable: false,
|
|
47780
|
+
width: editModalWidth || 520,
|
|
47781
|
+
destroyOnHidden: true,
|
|
47782
|
+
centered: true,
|
|
47783
|
+
children: [
|
|
47784
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
|
|
47785
|
+
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47786
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: modalDescriptionTextStyle, children: modalDescriptionText }),
|
|
47787
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
47788
|
+
] }),
|
|
47789
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Form, { form, children: [
|
|
47790
|
+
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, style: inputLabelStyle, children: inputLabel }),
|
|
47791
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47792
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
|
|
47793
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
47794
|
+
"Key",
|
|
47795
|
+
" ",
|
|
47796
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: "Required when operator is Equal; optional for Exists.", children: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.InfoCircleOutlined, {}) })
|
|
47797
|
+
] }) }) }),
|
|
47798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Operator" }) }),
|
|
47799
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
47800
|
+
"Value",
|
|
47801
|
+
" ",
|
|
47802
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: "Required for Equal; must be empty for Exists.", children: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.InfoCircleOutlined, {}) })
|
|
47803
|
+
] }) }) }),
|
|
47804
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Effect" }) }),
|
|
47805
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[4], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
|
|
47806
|
+
] }),
|
|
47807
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47808
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.ResetedFormList, { name: "tolerations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47809
|
+
fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
|
|
47810
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47811
|
+
ResetedFormItem,
|
|
47812
|
+
{
|
|
47813
|
+
...restField,
|
|
47814
|
+
name: [name, "key"],
|
|
47815
|
+
rules: [
|
|
47816
|
+
({ getFieldValue }) => ({
|
|
47817
|
+
validator(_, v) {
|
|
47818
|
+
const op = getFieldValue(["tolerations", name, "operator"]);
|
|
47819
|
+
if (op === "Equal" && (!v || v === "")) {
|
|
47820
|
+
return Promise.reject(new Error("Key is required when operator is Equal."));
|
|
47821
|
+
}
|
|
47822
|
+
return Promise.resolve();
|
|
47823
|
+
}
|
|
47824
|
+
})
|
|
47825
|
+
],
|
|
47826
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { placeholder: "key" })
|
|
47827
|
+
}
|
|
47828
|
+
) }),
|
|
47829
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47830
|
+
ResetedFormItem,
|
|
47831
|
+
{
|
|
47832
|
+
...restField,
|
|
47833
|
+
name: [name, "operator"],
|
|
47834
|
+
rules: [
|
|
47835
|
+
{ required: true, message: "Operator is required." },
|
|
47836
|
+
{
|
|
47837
|
+
validator: (_, v) => v && operatorOptions.includes(v) ? Promise.resolve() : Promise.reject(new Error("Select a valid operator."))
|
|
47838
|
+
}
|
|
47839
|
+
],
|
|
47840
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47841
|
+
antd.Select,
|
|
47842
|
+
{
|
|
47843
|
+
placeholder: "Select operator",
|
|
47844
|
+
options: operatorOptions.map((op) => ({ label: op, value: op }))
|
|
47845
|
+
}
|
|
47846
|
+
)
|
|
47847
|
+
}
|
|
47848
|
+
) }),
|
|
47849
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47850
|
+
ResetedFormItem,
|
|
47851
|
+
{
|
|
47852
|
+
...restField,
|
|
47853
|
+
name: [name, "value"],
|
|
47854
|
+
rules: [
|
|
47855
|
+
({ getFieldValue }) => ({
|
|
47856
|
+
validator(_, v) {
|
|
47857
|
+
const op = getFieldValue(["tolerations", name, "operator"]);
|
|
47858
|
+
if (op === "Equal" && (!v || v === "")) {
|
|
47859
|
+
return Promise.reject(new Error("Value is required when operator is Equal."));
|
|
47860
|
+
}
|
|
47861
|
+
return Promise.resolve();
|
|
47862
|
+
}
|
|
47863
|
+
})
|
|
47864
|
+
],
|
|
47865
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { placeholder: "value" })
|
|
47866
|
+
}
|
|
47867
|
+
) }),
|
|
47868
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47869
|
+
ResetedFormItem,
|
|
47870
|
+
{
|
|
47871
|
+
...restField,
|
|
47872
|
+
name: [name, "effect"],
|
|
47873
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47874
|
+
antd.Select,
|
|
47875
|
+
{
|
|
47876
|
+
placeholder: "Select effect",
|
|
47877
|
+
options: effectOptions.map((eff) => ({ label: eff, value: eff }))
|
|
47878
|
+
}
|
|
47879
|
+
)
|
|
47880
|
+
}
|
|
47881
|
+
) }),
|
|
47882
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[4], children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { size: "small", type: "text", onClick: () => remove(name), children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) }) })
|
|
47883
|
+
] }, key)),
|
|
47884
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResetedFormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "text", size: "small", onClick: () => add(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon, {}) }) })
|
|
47885
|
+
] }) })
|
|
47886
|
+
] })
|
|
47887
|
+
]
|
|
47888
|
+
}
|
|
47889
|
+
);
|
|
47890
|
+
};
|
|
47891
|
+
|
|
47892
|
+
const flattenOnce = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
47893
|
+
const ALLOWED_OPERATORS = /* @__PURE__ */ new Set(["Exists", "Equal"]);
|
|
47894
|
+
const ALLOWED_EFFECTS = /* @__PURE__ */ new Set(["NoSchedule", "PreferNoSchedule", "NoExecute"]);
|
|
47895
|
+
const isToleration = (x) => {
|
|
47896
|
+
if (x === null || typeof x !== "object" || Array.isArray(x)) return false;
|
|
47897
|
+
const o = x;
|
|
47898
|
+
if ("key" in o && typeof o.key !== "string") return false;
|
|
47899
|
+
if ("value" in o && typeof o.value !== "string") return false;
|
|
47900
|
+
if ("operator" in o) {
|
|
47901
|
+
if (typeof o.operator !== "string" || !ALLOWED_OPERATORS.has(o.operator)) {
|
|
47902
|
+
return false;
|
|
47903
|
+
}
|
|
47904
|
+
}
|
|
47905
|
+
if ("effect" in o) {
|
|
47906
|
+
if (typeof o.effect !== "string" || !ALLOWED_EFFECTS.has(o.effect)) {
|
|
47907
|
+
return false;
|
|
47908
|
+
}
|
|
47909
|
+
}
|
|
47910
|
+
return true;
|
|
47911
|
+
};
|
|
47912
|
+
const filterTolerations = (input) => {
|
|
47913
|
+
if (!Array.isArray(input)) return [];
|
|
47914
|
+
return input.filter(isToleration);
|
|
47915
|
+
};
|
|
47916
|
+
const getItemsInside$1 = (value) => {
|
|
47917
|
+
if (!Array.isArray(value)) {
|
|
47918
|
+
return { error: "Value on jsonPath is not an array" };
|
|
47919
|
+
}
|
|
47920
|
+
let flattenArrayOfUnknown = [];
|
|
47921
|
+
try {
|
|
47922
|
+
flattenArrayOfUnknown = flattenOnce(value);
|
|
47923
|
+
} catch (e) {
|
|
47924
|
+
console.log(e);
|
|
47925
|
+
return { error: "Error while flattening" };
|
|
47926
|
+
}
|
|
47927
|
+
return { counter: flattenArrayOfUnknown.length, tolerations: filterTolerations(flattenArrayOfUnknown) };
|
|
47928
|
+
};
|
|
47929
|
+
|
|
47930
|
+
const Tolerations = ({
|
|
47931
|
+
data,
|
|
47932
|
+
children
|
|
47933
|
+
}) => {
|
|
47934
|
+
const {
|
|
47935
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47936
|
+
id,
|
|
47937
|
+
reqIndex,
|
|
47938
|
+
jsonPathToArray,
|
|
47939
|
+
text,
|
|
47940
|
+
errorText,
|
|
47941
|
+
notificationSuccessMessage,
|
|
47942
|
+
notificationSuccessMessageDescription,
|
|
47943
|
+
modalTitle,
|
|
47944
|
+
modalDescriptionText,
|
|
47945
|
+
modalDescriptionTextStyle,
|
|
47946
|
+
inputLabel,
|
|
47947
|
+
inputLabelStyle,
|
|
47948
|
+
containerStyle,
|
|
47949
|
+
endpoint,
|
|
47950
|
+
pathToValue,
|
|
47951
|
+
editModalWidth,
|
|
47952
|
+
cols
|
|
47953
|
+
} = data;
|
|
47954
|
+
const [api, contextHolder] = antd.notification.useNotification();
|
|
47955
|
+
const [open, setOpen] = o.useState(false);
|
|
47956
|
+
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
47957
|
+
const partsOfUrl = usePartsOfUrl();
|
|
47958
|
+
if (isMultiQueryLoading) {
|
|
47959
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
47960
|
+
}
|
|
47961
|
+
if (isMultiQueryErrors) {
|
|
47962
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
47963
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
47964
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
47965
|
+
] });
|
|
47966
|
+
}
|
|
47967
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
47968
|
+
acc[index.toString()] = value;
|
|
47969
|
+
return acc;
|
|
47970
|
+
}, {});
|
|
47971
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
47972
|
+
if (jsonRoot === void 0) {
|
|
47973
|
+
console.log("Item Counter: ${id}: No root for json path");
|
|
47974
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
|
|
47975
|
+
}
|
|
47976
|
+
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToArray}`);
|
|
47977
|
+
const { counter, tolerations, error: errorArrayOfObjects } = getItemsInside$1(anythingForNow);
|
|
47978
|
+
const notificationSuccessMessagePrepared = notificationSuccessMessage ? parseAll({
|
|
47979
|
+
text: notificationSuccessMessage,
|
|
47980
|
+
replaceValues,
|
|
47981
|
+
multiQueryData
|
|
47982
|
+
}) : "Success";
|
|
47983
|
+
const notificationSuccessMessageDescriptionPrepared = notificationSuccessMessageDescription ? parseAll({
|
|
47984
|
+
text: notificationSuccessMessageDescription,
|
|
47985
|
+
replaceValues,
|
|
47986
|
+
multiQueryData
|
|
47987
|
+
}) : "Success";
|
|
47988
|
+
const modalTitlePrepared = modalTitle ? parseAll({ text: modalTitle, replaceValues, multiQueryData }) : "Edit";
|
|
47989
|
+
const modalDescriptionTextPrepared = modalDescriptionText ? parseAll({ text: modalDescriptionText, replaceValues, multiQueryData }) : void 0;
|
|
47990
|
+
const inputLabelPrepared = inputLabel ? parseAll({ text: inputLabel, replaceValues, multiQueryData }) : void 0;
|
|
47991
|
+
const endpointPrepared = endpoint ? parseAll({ text: endpoint, replaceValues, multiQueryData }) : "no-endpoint-provided";
|
|
47992
|
+
const pathToValuePrepared = pathToValue ? parseAll({ text: pathToValue, replaceValues, multiQueryData }) : "no-pathToValue-provided";
|
|
47993
|
+
const openNotificationSuccess = () => {
|
|
47994
|
+
api.success({
|
|
47995
|
+
message: notificationSuccessMessagePrepared,
|
|
47996
|
+
description: notificationSuccessMessageDescriptionPrepared,
|
|
47997
|
+
placement: "bottomRight"
|
|
47998
|
+
});
|
|
47999
|
+
};
|
|
48000
|
+
if (errorArrayOfObjects) {
|
|
48001
|
+
console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
|
|
48002
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48003
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
48004
|
+
errorText,
|
|
48005
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48006
|
+
antd.Button,
|
|
48007
|
+
{
|
|
48008
|
+
type: "text",
|
|
48009
|
+
size: "small",
|
|
48010
|
+
onClick: (e) => {
|
|
48011
|
+
e.stopPropagation();
|
|
48012
|
+
setOpen(true);
|
|
48013
|
+
},
|
|
48014
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
48015
|
+
}
|
|
48016
|
+
)
|
|
48017
|
+
] }) }),
|
|
48018
|
+
contextHolder,
|
|
48019
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48020
|
+
EditModal$1,
|
|
48021
|
+
{
|
|
48022
|
+
open,
|
|
48023
|
+
close: () => setOpen(false),
|
|
48024
|
+
values: tolerations,
|
|
48025
|
+
openNotificationSuccess,
|
|
48026
|
+
modalTitle: modalTitlePrepared,
|
|
48027
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
48028
|
+
inputLabel: inputLabelPrepared,
|
|
48029
|
+
endpoint: endpointPrepared,
|
|
48030
|
+
pathToValue: pathToValuePrepared,
|
|
48031
|
+
editModalWidth,
|
|
48032
|
+
cols,
|
|
48033
|
+
modalDescriptionTextStyle,
|
|
48034
|
+
inputLabelStyle
|
|
48035
|
+
}
|
|
48036
|
+
)
|
|
48037
|
+
] });
|
|
48038
|
+
}
|
|
48039
|
+
const parsedText = parseAll({ text, replaceValues, multiQueryData });
|
|
48040
|
+
const parsedTextWithCounter = parsedText.replace("~counter~", String(counter || 0));
|
|
48041
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48042
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
48043
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
48044
|
+
parsedTextWithCounter,
|
|
48045
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48046
|
+
antd.Button,
|
|
48047
|
+
{
|
|
48048
|
+
type: "text",
|
|
48049
|
+
size: "small",
|
|
48050
|
+
onClick: (e) => {
|
|
48051
|
+
e.stopPropagation();
|
|
48052
|
+
setOpen(true);
|
|
48053
|
+
},
|
|
48054
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
48055
|
+
}
|
|
48056
|
+
)
|
|
48057
|
+
] }),
|
|
48058
|
+
children
|
|
48059
|
+
] }),
|
|
48060
|
+
contextHolder,
|
|
48061
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48062
|
+
EditModal$1,
|
|
48063
|
+
{
|
|
48064
|
+
open,
|
|
48065
|
+
close: () => setOpen(false),
|
|
48066
|
+
values: tolerations,
|
|
48067
|
+
openNotificationSuccess,
|
|
48068
|
+
modalTitle: modalTitlePrepared,
|
|
48069
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
48070
|
+
inputLabel: inputLabelPrepared,
|
|
48071
|
+
endpoint: endpointPrepared,
|
|
48072
|
+
pathToValue: pathToValuePrepared,
|
|
48073
|
+
editModalWidth,
|
|
48074
|
+
cols,
|
|
48075
|
+
modalDescriptionTextStyle,
|
|
48076
|
+
inputLabelStyle
|
|
48077
|
+
}
|
|
48078
|
+
)
|
|
48079
|
+
] });
|
|
48080
|
+
};
|
|
48081
|
+
|
|
48082
|
+
const ResetedFormList = st(antd.Form.List)`
|
|
48083
|
+
margin-bottom: 8px;
|
|
48084
|
+
`;
|
|
48085
|
+
const Styled = {
|
|
48086
|
+
ResetedFormList
|
|
48087
|
+
};
|
|
48088
|
+
|
|
48089
|
+
const EditModal = ({
|
|
48090
|
+
open,
|
|
48091
|
+
close,
|
|
48092
|
+
values,
|
|
48093
|
+
openNotificationSuccess,
|
|
48094
|
+
modalTitle,
|
|
48095
|
+
modalDescriptionText,
|
|
48096
|
+
inputLabel,
|
|
48097
|
+
endpoint,
|
|
48098
|
+
pathToValue,
|
|
48099
|
+
editModalWidth,
|
|
48100
|
+
cols,
|
|
48101
|
+
modalDescriptionTextStyle,
|
|
48102
|
+
inputLabelStyle
|
|
48103
|
+
}) => {
|
|
48104
|
+
const queryClient = reactQuery.useQueryClient();
|
|
48105
|
+
const [error, setError] = o.useState();
|
|
48106
|
+
const [isLoading, setIsLoading] = o.useState(false);
|
|
48107
|
+
const [form] = antd.Form.useForm();
|
|
48108
|
+
const annotations = antd.Form.useWatch("annotations", form);
|
|
48109
|
+
o.useEffect(() => {
|
|
48110
|
+
if (open) {
|
|
48111
|
+
form.setFieldsValue({
|
|
48112
|
+
annotations: values ? Object.entries(values).map(([key, value]) => ({
|
|
48113
|
+
key,
|
|
48114
|
+
value
|
|
48115
|
+
})) : []
|
|
48116
|
+
});
|
|
48117
|
+
}
|
|
48118
|
+
}, [open, form]);
|
|
48119
|
+
const submit = () => {
|
|
48120
|
+
form.validateFields().then(() => {
|
|
48121
|
+
const result = {};
|
|
48122
|
+
annotations.forEach(({ key, value }) => {
|
|
48123
|
+
result[key] = value || "";
|
|
48124
|
+
});
|
|
48125
|
+
console.log(JSON.stringify(result));
|
|
48126
|
+
setIsLoading(true);
|
|
48127
|
+
setError(void 0);
|
|
48128
|
+
patchEntryWithReplaceOp({ endpoint, pathToValue, body: result }).then(() => {
|
|
48129
|
+
queryClient.invalidateQueries({ queryKey: ["multi"] });
|
|
48130
|
+
if (openNotificationSuccess) {
|
|
48131
|
+
openNotificationSuccess();
|
|
48132
|
+
}
|
|
48133
|
+
setIsLoading(false);
|
|
48134
|
+
setError(void 0);
|
|
48135
|
+
close();
|
|
48136
|
+
}).catch((error2) => {
|
|
48137
|
+
setIsLoading(false);
|
|
48138
|
+
setError(error2);
|
|
48139
|
+
});
|
|
48140
|
+
}).catch(() => console.log("Validating error"));
|
|
48141
|
+
};
|
|
48142
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
48143
|
+
antd.Modal,
|
|
48144
|
+
{
|
|
48145
|
+
title: modalTitle,
|
|
48146
|
+
open,
|
|
48147
|
+
onOk: () => submit(),
|
|
48148
|
+
onCancel: () => {
|
|
48149
|
+
close();
|
|
48150
|
+
form.resetFields();
|
|
48151
|
+
setIsLoading(false);
|
|
48152
|
+
setError(void 0);
|
|
48153
|
+
},
|
|
48154
|
+
okText: "Save",
|
|
48155
|
+
confirmLoading: isLoading,
|
|
48156
|
+
maskClosable: false,
|
|
48157
|
+
width: editModalWidth || 520,
|
|
48158
|
+
destroyOnHidden: true,
|
|
48159
|
+
centered: true,
|
|
48160
|
+
children: [
|
|
48161
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
|
|
48162
|
+
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48163
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: modalDescriptionTextStyle, children: modalDescriptionText }),
|
|
48164
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
48165
|
+
] }),
|
|
48166
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Form, { form, children: [
|
|
48167
|
+
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, style: inputLabelStyle, children: inputLabel }),
|
|
48168
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
48169
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
|
|
48170
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Key" }) }),
|
|
48171
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Value" }) }),
|
|
48172
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
|
|
48173
|
+
] }),
|
|
48174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
48175
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormList, { name: "annotations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48176
|
+
fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
|
|
48177
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48178
|
+
ResetedFormItem,
|
|
48179
|
+
{
|
|
48180
|
+
...restField,
|
|
48181
|
+
name: [name, "key"],
|
|
48182
|
+
rules: [{ required: true, message: "Key is required" }],
|
|
48183
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { placeholder: "key" })
|
|
48184
|
+
}
|
|
48185
|
+
) }),
|
|
48186
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResetedFormItem, { ...restField, name: [name, "value"], children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { placeholder: "value" }) }) }),
|
|
48187
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { size: "small", type: "text", onClick: () => remove(name), children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) }) })
|
|
48188
|
+
] }, key)),
|
|
48189
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResetedFormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "text", size: "small", onClick: () => add(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon, {}) }) })
|
|
48190
|
+
] }) })
|
|
48191
|
+
] })
|
|
48192
|
+
]
|
|
48193
|
+
}
|
|
48194
|
+
);
|
|
48195
|
+
};
|
|
48196
|
+
|
|
48197
|
+
const isObject = (x) => typeof x === "object" && x !== null;
|
|
48198
|
+
const isPlainObject = (x) => isObject(x) && !Array.isArray(x) && (Object.getPrototypeOf(x) === Object.prototype || Object.getPrototypeOf(x) === null);
|
|
48199
|
+
const isString = (v) => typeof v === "string";
|
|
48200
|
+
const isStringNumberRecord = (x) => isPlainObject(x) && Object.values(x).every(isString);
|
|
48201
|
+
const getItemsInside = (value) => {
|
|
48202
|
+
if (!Array.isArray(value)) {
|
|
48203
|
+
return { error: "Value on jsonPath is not an array" };
|
|
48204
|
+
}
|
|
48205
|
+
if (typeof value[0] !== "object" || value[0] === null) {
|
|
48206
|
+
return { counter: 0, annotations: isStringNumberRecord(value[0]) ? value[0] : void 0 };
|
|
48207
|
+
}
|
|
48208
|
+
return { counter: Object.keys(value[0]).length, annotations: isStringNumberRecord(value[0]) ? value[0] : void 0 };
|
|
48209
|
+
};
|
|
48210
|
+
|
|
48211
|
+
const Annotations = ({
|
|
48212
|
+
data,
|
|
48213
|
+
children
|
|
48214
|
+
}) => {
|
|
48215
|
+
const {
|
|
48216
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48217
|
+
id,
|
|
48218
|
+
reqIndex,
|
|
48219
|
+
jsonPathToObj,
|
|
48220
|
+
text,
|
|
48221
|
+
errorText,
|
|
48222
|
+
notificationSuccessMessage,
|
|
48223
|
+
notificationSuccessMessageDescription,
|
|
48224
|
+
modalTitle,
|
|
48225
|
+
modalDescriptionText,
|
|
48226
|
+
modalDescriptionTextStyle,
|
|
48227
|
+
inputLabel,
|
|
48228
|
+
inputLabelStyle,
|
|
48229
|
+
containerStyle,
|
|
48230
|
+
endpoint,
|
|
48231
|
+
pathToValue,
|
|
48232
|
+
editModalWidth,
|
|
48233
|
+
cols
|
|
48234
|
+
} = data;
|
|
48235
|
+
const [api, contextHolder] = antd.notification.useNotification();
|
|
48236
|
+
const [open, setOpen] = o.useState(false);
|
|
48237
|
+
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
48238
|
+
const partsOfUrl = usePartsOfUrl();
|
|
48239
|
+
if (isMultiQueryLoading) {
|
|
48240
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
48241
|
+
}
|
|
48242
|
+
if (isMultiQueryErrors) {
|
|
48243
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
48244
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
48245
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
48246
|
+
] });
|
|
48247
|
+
}
|
|
48248
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
48249
|
+
acc[index.toString()] = value;
|
|
48250
|
+
return acc;
|
|
48251
|
+
}, {});
|
|
48252
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
48253
|
+
if (jsonRoot === void 0) {
|
|
48254
|
+
console.log("Item Counter: ${id}: No root for json path");
|
|
48255
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
|
|
48256
|
+
}
|
|
48257
|
+
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToObj}`);
|
|
48258
|
+
const { counter, annotations, error: errorArrayOfObjects } = getItemsInside(anythingForNow);
|
|
48259
|
+
const notificationSuccessMessagePrepared = notificationSuccessMessage ? parseAll({
|
|
48260
|
+
text: notificationSuccessMessage,
|
|
48261
|
+
replaceValues,
|
|
48262
|
+
multiQueryData
|
|
48263
|
+
}) : "Success";
|
|
48264
|
+
const notificationSuccessMessageDescriptionPrepared = notificationSuccessMessageDescription ? parseAll({
|
|
48265
|
+
text: notificationSuccessMessageDescription,
|
|
48266
|
+
replaceValues,
|
|
48267
|
+
multiQueryData
|
|
48268
|
+
}) : "Success";
|
|
48269
|
+
const modalTitlePrepared = modalTitle ? parseAll({ text: modalTitle, replaceValues, multiQueryData }) : "Edit";
|
|
48270
|
+
const modalDescriptionTextPrepared = modalDescriptionText ? parseAll({ text: modalDescriptionText, replaceValues, multiQueryData }) : void 0;
|
|
48271
|
+
const inputLabelPrepared = inputLabel ? parseAll({ text: inputLabel, replaceValues, multiQueryData }) : void 0;
|
|
48272
|
+
const endpointPrepared = endpoint ? parseAll({ text: endpoint, replaceValues, multiQueryData }) : "no-endpoint-provided";
|
|
48273
|
+
const pathToValuePrepared = pathToValue ? parseAll({ text: pathToValue, replaceValues, multiQueryData }) : "no-pathToValue-provided";
|
|
48274
|
+
const openNotificationSuccess = () => {
|
|
48275
|
+
api.success({
|
|
48276
|
+
message: notificationSuccessMessagePrepared,
|
|
48277
|
+
description: notificationSuccessMessageDescriptionPrepared,
|
|
48278
|
+
placement: "bottomRight"
|
|
48279
|
+
});
|
|
48280
|
+
};
|
|
48281
|
+
if (errorArrayOfObjects) {
|
|
48282
|
+
console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
|
|
48283
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
48285
|
+
errorText,
|
|
48286
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48287
|
+
antd.Button,
|
|
48288
|
+
{
|
|
48289
|
+
type: "text",
|
|
48290
|
+
size: "small",
|
|
48291
|
+
onClick: (e) => {
|
|
48292
|
+
e.stopPropagation();
|
|
48293
|
+
setOpen(true);
|
|
48294
|
+
},
|
|
48295
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
48296
|
+
}
|
|
48297
|
+
)
|
|
48298
|
+
] }) }),
|
|
48299
|
+
contextHolder,
|
|
48300
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48301
|
+
EditModal,
|
|
48302
|
+
{
|
|
48303
|
+
open,
|
|
48304
|
+
close: () => setOpen(false),
|
|
48305
|
+
values: annotations,
|
|
48306
|
+
openNotificationSuccess,
|
|
48307
|
+
modalTitle: modalTitlePrepared,
|
|
48308
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
48309
|
+
inputLabel: inputLabelPrepared,
|
|
48310
|
+
endpoint: endpointPrepared,
|
|
48311
|
+
pathToValue: pathToValuePrepared,
|
|
48312
|
+
editModalWidth,
|
|
48313
|
+
cols,
|
|
48314
|
+
modalDescriptionTextStyle,
|
|
48315
|
+
inputLabelStyle
|
|
48316
|
+
}
|
|
48317
|
+
)
|
|
48318
|
+
] });
|
|
48319
|
+
}
|
|
48320
|
+
const parsedText = parseAll({ text, replaceValues, multiQueryData });
|
|
48321
|
+
const parsedTextWithCounter = parsedText.replace("~counter~", String(counter || 0));
|
|
48322
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48323
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
48324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
48325
|
+
parsedTextWithCounter,
|
|
48326
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48327
|
+
antd.Button,
|
|
48328
|
+
{
|
|
48329
|
+
type: "text",
|
|
48330
|
+
size: "small",
|
|
48331
|
+
onClick: (e) => {
|
|
48332
|
+
e.stopPropagation();
|
|
48333
|
+
setOpen(true);
|
|
48334
|
+
},
|
|
48335
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
48336
|
+
}
|
|
48337
|
+
)
|
|
48338
|
+
] }),
|
|
48339
|
+
children
|
|
48340
|
+
] }),
|
|
48341
|
+
contextHolder,
|
|
48342
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48343
|
+
EditModal,
|
|
48344
|
+
{
|
|
48345
|
+
open,
|
|
48346
|
+
close: () => setOpen(false),
|
|
48347
|
+
values: annotations,
|
|
48348
|
+
openNotificationSuccess,
|
|
48349
|
+
modalTitle: modalTitlePrepared,
|
|
48350
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
48351
|
+
inputLabel: inputLabelPrepared,
|
|
48352
|
+
endpoint: endpointPrepared,
|
|
48353
|
+
pathToValue: pathToValuePrepared,
|
|
48354
|
+
editModalWidth,
|
|
48355
|
+
cols,
|
|
48356
|
+
modalDescriptionTextStyle,
|
|
48357
|
+
inputLabelStyle
|
|
48358
|
+
}
|
|
48359
|
+
)
|
|
48360
|
+
] });
|
|
48361
|
+
};
|
|
48362
|
+
|
|
47369
48363
|
const DynamicComponents = {
|
|
47370
48364
|
DefaultDiv,
|
|
47371
48365
|
antdText: AntdText,
|
|
@@ -47395,7 +48389,10 @@
|
|
|
47395
48389
|
ItemCounter,
|
|
47396
48390
|
Labels,
|
|
47397
48391
|
LabelsToSearchParams,
|
|
47398
|
-
KeyCounter
|
|
48392
|
+
KeyCounter,
|
|
48393
|
+
Taints,
|
|
48394
|
+
Tolerations,
|
|
48395
|
+
Annotations
|
|
47399
48396
|
};
|
|
47400
48397
|
|
|
47401
48398
|
const prepareUrlsToFetchForDynamicRenderer = ({
|