@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.3 → 1.4.0-alpha.5
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/{index-b0CnxhD6.mjs → index-DclFY72w.mjs} +312 -134
- package/dist/index-DclFY72w.mjs.map +1 -0
- package/dist/{index-1rnPhsJg.mjs → index-eI1hWaeQ.mjs} +3 -36
- package/dist/index-eI1hWaeQ.mjs.map +1 -0
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +275 -130
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/OpenKubeletConfigModal.d.ts +9 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/renderActionModal.d.ts +8 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/utils.d.ts +0 -5
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/utils.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/utils.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/utils.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/utils.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/utils.d.ts +2 -2
- package/dist/types/components/organisms/DynamicComponents/types/ActionsDropdown.d.ts +3 -1
- package/dist/types/components/organisms/DynamicComponents/types/Annotations.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/LabelsToSearchParams.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/StatusText.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/Taints.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/Tolerations.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-1rnPhsJg.mjs.map +0 -1
- package/dist/index-b0CnxhD6.mjs.map +0 -1
|
@@ -3,7 +3,7 @@ import * as React$1 from 'react';
|
|
|
3
3
|
import React__default, { useState, useRef, useLayoutEffect, useReducer, useEffect, useCallback, useMemo, Fragment, createContext, useContext, memo, createElement, isValidElement, cloneElement, useInsertionEffect, useSyncExternalStore, forwardRef, useImperativeHandle, PureComponent, Children, Component, lazy, Suspense } from 'react';
|
|
4
4
|
import { Input, Tree, Modal, Alert, theme, Select, Tag, Flex, Typography, Breadcrumb, Spin, Menu, Tooltip as Tooltip$1, Space, Button, Card as Card$2, Row, Col, Tabs, notification, Form, Popover, Switch, Segmented, Table, Progress, Statistic, message, Dropdown, Slider, InputNumber, Result, DatePicker, Radio, Checkbox, Empty } from 'antd';
|
|
5
5
|
import * as AntIcons from '@ant-design/icons';
|
|
6
|
-
import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, PlusOutlined, ClearOutlined, MinusOutlined, CaretDownOutlined, CaretRightOutlined, InfoCircleOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined, WarningOutlined, MoreOutlined, DownOutlined,
|
|
6
|
+
import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, PlusOutlined, ClearOutlined, MinusOutlined, CaretDownOutlined, CaretRightOutlined, InfoCircleOutlined, SearchOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined, WarningOutlined, MoreOutlined, DownOutlined, CheckOutlined, CloseOutlined, BugOutlined, EllipsisOutlined, PoweroffOutlined, FullscreenExitOutlined, FullscreenOutlined, SettingOutlined, ReloadOutlined } from '@ant-design/icons';
|
|
7
7
|
import { useNavigate, useSearchParams, Link, useLocation, useParams } from 'react-router-dom';
|
|
8
8
|
import { useQuery, useQueries, useQueryClient } from '@tanstack/react-query';
|
|
9
9
|
import RFB from 'novnc-next';
|
|
@@ -7976,6 +7976,7 @@ const DeleteModal = ({ name, onClose, endpoint }) => {
|
|
|
7976
7976
|
confirmLoading: isLoading,
|
|
7977
7977
|
okButtonProps: { danger: true },
|
|
7978
7978
|
width: 400,
|
|
7979
|
+
centered: true,
|
|
7979
7980
|
children: error && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "error", message: "Error while delete", description: error?.response?.data?.message })
|
|
7980
7981
|
}
|
|
7981
7982
|
);
|
|
@@ -8012,6 +8013,7 @@ const DeleteModalMany = ({ data, onClose }) => {
|
|
|
8012
8013
|
confirmLoading: isLoading,
|
|
8013
8014
|
okButtonProps: { danger: true },
|
|
8014
8015
|
width: 400,
|
|
8016
|
+
centered: true,
|
|
8015
8017
|
children: error && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "error", message: "Error while delete", description: error?.response?.data?.message })
|
|
8016
8018
|
}
|
|
8017
8019
|
);
|
|
@@ -8040,6 +8042,7 @@ const ConfirmModal = ({
|
|
|
8040
8042
|
confirmLoading,
|
|
8041
8043
|
okButtonProps: { danger },
|
|
8042
8044
|
width,
|
|
8045
|
+
centered: true,
|
|
8043
8046
|
children
|
|
8044
8047
|
}
|
|
8045
8048
|
);
|
|
@@ -34725,6 +34728,24 @@ const parsePromTemplate = ({
|
|
|
34725
34728
|
return parsed.replace(/\{(\d+)\}/g, (_2, key) => replaceValues[key] || "");
|
|
34726
34729
|
};
|
|
34727
34730
|
|
|
34731
|
+
const isExternalHref = (href) => {
|
|
34732
|
+
if (!href) {
|
|
34733
|
+
return false;
|
|
34734
|
+
}
|
|
34735
|
+
if (/^(mailto:|tel:|sms:)/i.test(href)) {
|
|
34736
|
+
return true;
|
|
34737
|
+
}
|
|
34738
|
+
if (href.startsWith("//")) {
|
|
34739
|
+
return true;
|
|
34740
|
+
}
|
|
34741
|
+
try {
|
|
34742
|
+
const parsed = new URL(href, window.location.origin);
|
|
34743
|
+
return parsed.origin !== window.location.origin;
|
|
34744
|
+
} catch {
|
|
34745
|
+
return false;
|
|
34746
|
+
}
|
|
34747
|
+
};
|
|
34748
|
+
|
|
34728
34749
|
const AntdLink = ({
|
|
34729
34750
|
data,
|
|
34730
34751
|
children
|
|
@@ -34739,6 +34760,7 @@ const AntdLink = ({
|
|
|
34739
34760
|
}, {});
|
|
34740
34761
|
const textPrepared = parseAll({ text, replaceValues, multiQueryData });
|
|
34741
34762
|
const hrefPrepared = parseAll({ text: href, replaceValues, multiQueryData });
|
|
34763
|
+
const isExternal = isExternalHref(hrefPrepared);
|
|
34742
34764
|
if (isMultiqueryLoading) {
|
|
34743
34765
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34744
34766
|
}
|
|
@@ -34747,6 +34769,9 @@ const AntdLink = ({
|
|
|
34747
34769
|
{
|
|
34748
34770
|
href: hrefPrepared,
|
|
34749
34771
|
onClick: (e) => {
|
|
34772
|
+
if (isExternal) {
|
|
34773
|
+
return;
|
|
34774
|
+
}
|
|
34750
34775
|
e.preventDefault();
|
|
34751
34776
|
navigate(hrefPrepared);
|
|
34752
34777
|
},
|
|
@@ -34986,7 +35011,7 @@ const getResult = ({
|
|
|
34986
35011
|
valuesPrepared,
|
|
34987
35012
|
criteriaSuccess,
|
|
34988
35013
|
criteriaError,
|
|
34989
|
-
|
|
35014
|
+
strategySuccess,
|
|
34990
35015
|
strategyError,
|
|
34991
35016
|
valueToCompareSuccess,
|
|
34992
35017
|
valueToCompareError,
|
|
@@ -34995,7 +35020,7 @@ const getResult = ({
|
|
|
34995
35020
|
fallbackText
|
|
34996
35021
|
}) => {
|
|
34997
35022
|
let success = false;
|
|
34998
|
-
if (
|
|
35023
|
+
if (strategySuccess === "some") {
|
|
34999
35024
|
success = criteriaSuccess === "equals" ? valuesPrepared.some((v) => valueToCompareSuccess.includes(v)) : valuesPrepared.some((v) => !valueToCompareSuccess.includes(v));
|
|
35000
35025
|
} else {
|
|
35001
35026
|
success = criteriaSuccess === "equals" ? valuesPrepared.every((v) => valueToCompareSuccess.includes(v)) : valuesPrepared.every((v) => !valueToCompareSuccess.includes(v));
|
|
@@ -35025,7 +35050,7 @@ const StatusText$1 = ({
|
|
|
35025
35050
|
values,
|
|
35026
35051
|
criteriaSuccess,
|
|
35027
35052
|
criteriaError,
|
|
35028
|
-
|
|
35053
|
+
strategySuccess,
|
|
35029
35054
|
strategyError,
|
|
35030
35055
|
valueToCompareSuccess,
|
|
35031
35056
|
valueToCompareError,
|
|
@@ -35057,7 +35082,7 @@ const StatusText$1 = ({
|
|
|
35057
35082
|
valuesPrepared,
|
|
35058
35083
|
criteriaSuccess,
|
|
35059
35084
|
criteriaError,
|
|
35060
|
-
|
|
35085
|
+
strategySuccess,
|
|
35061
35086
|
strategyError,
|
|
35062
35087
|
valueToCompareSuccess,
|
|
35063
35088
|
valueToCompareError,
|
|
@@ -35200,6 +35225,15 @@ const serializeLabelsWithNoEncoding$1 = (input) => {
|
|
|
35200
35225
|
return entries.map(([k, v]) => `${k}=${v}`).join(",");
|
|
35201
35226
|
};
|
|
35202
35227
|
|
|
35228
|
+
const isValidLabelSelectorObject = (input) => {
|
|
35229
|
+
if (typeof input !== "object" || input === null || Array.isArray(input) || Object.getPrototypeOf(input) !== Object.prototype) {
|
|
35230
|
+
return false;
|
|
35231
|
+
}
|
|
35232
|
+
const entries = Object.entries(input);
|
|
35233
|
+
if (entries.length === 0) return false;
|
|
35234
|
+
return entries.every(([, value]) => typeof value === "string" || typeof value === "number");
|
|
35235
|
+
};
|
|
35236
|
+
|
|
35203
35237
|
const EnrichedTable$1 = ({
|
|
35204
35238
|
data,
|
|
35205
35239
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -35283,8 +35317,10 @@ const EnrichedTable$1 = ({
|
|
|
35283
35317
|
if (labelSelectorFull) {
|
|
35284
35318
|
const root = multiQueryData[`req${labelSelectorFull.reqIndex}`];
|
|
35285
35319
|
const value = Array.isArray(labelSelectorFull.pathToLabels) ? _$1.get(root || {}, labelSelectorFull.pathToLabels) : jp.query(root || {}, `$${labelSelectorFull.pathToLabels}`)[0];
|
|
35286
|
-
|
|
35287
|
-
|
|
35320
|
+
if (isValidLabelSelectorObject(value)) {
|
|
35321
|
+
const serializedLabels = serializeLabelsWithNoEncoding$1(value);
|
|
35322
|
+
if (serializedLabels.length > 0) sParams.set("labelSelector", serializedLabels);
|
|
35323
|
+
}
|
|
35288
35324
|
}
|
|
35289
35325
|
if (fieldSelector) {
|
|
35290
35326
|
const parsedObject = Object.fromEntries(
|
|
@@ -43343,6 +43379,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
43343
43379
|
onCancel: () => setError(void 0),
|
|
43344
43380
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.BigText, { children: "Error!" }) }),
|
|
43345
43381
|
cancelButtonProps: { style: { display: "none" } },
|
|
43382
|
+
centered: true,
|
|
43346
43383
|
children: [
|
|
43347
43384
|
"An error has occurred: ",
|
|
43348
43385
|
error?.response?.data?.message
|
|
@@ -44504,6 +44541,39 @@ const AnnotationsEditModal = ({
|
|
|
44504
44541
|
);
|
|
44505
44542
|
};
|
|
44506
44543
|
|
|
44544
|
+
const ReadOnlyModal = ({
|
|
44545
|
+
open,
|
|
44546
|
+
close,
|
|
44547
|
+
modalTitle,
|
|
44548
|
+
modalDescriptionText,
|
|
44549
|
+
modalDescriptionTextStyle,
|
|
44550
|
+
editModalWidth,
|
|
44551
|
+
children
|
|
44552
|
+
}) => {
|
|
44553
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44554
|
+
Modal,
|
|
44555
|
+
{
|
|
44556
|
+
title: modalTitle,
|
|
44557
|
+
open,
|
|
44558
|
+
okButtonProps: { style: { display: "none" } },
|
|
44559
|
+
onCancel: () => {
|
|
44560
|
+
close();
|
|
44561
|
+
},
|
|
44562
|
+
maskClosable: false,
|
|
44563
|
+
width: editModalWidth || 520,
|
|
44564
|
+
destroyOnHidden: true,
|
|
44565
|
+
centered: true,
|
|
44566
|
+
children: [
|
|
44567
|
+
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
44568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: modalDescriptionTextStyle, children: modalDescriptionText }),
|
|
44569
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
44570
|
+
] }),
|
|
44571
|
+
children
|
|
44572
|
+
]
|
|
44573
|
+
}
|
|
44574
|
+
);
|
|
44575
|
+
};
|
|
44576
|
+
|
|
44507
44577
|
const isRecordStringNumber = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.entries(value).every(([k, v]) => typeof k === "string" && (typeof v === "string" || typeof v === "number"));
|
|
44508
44578
|
const parseLabelsArrayOfAny = (value) => {
|
|
44509
44579
|
if (!Array.isArray(value)) {
|
|
@@ -44830,6 +44900,7 @@ const LabelsToSearchParams = ({ data, children }) => {
|
|
|
44830
44900
|
textLink,
|
|
44831
44901
|
errorText,
|
|
44832
44902
|
maxTextLength,
|
|
44903
|
+
renderLabelsAsRows,
|
|
44833
44904
|
...linkProps
|
|
44834
44905
|
} = data;
|
|
44835
44906
|
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
@@ -44857,20 +44928,30 @@ const LabelsToSearchParams = ({ data, children }) => {
|
|
|
44857
44928
|
if (!labelsRaw) {
|
|
44858
44929
|
if (errorArrayOfObjects) {
|
|
44859
44930
|
console.log(errorArrayOfObjects);
|
|
44860
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.
|
|
44931
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { children: [
|
|
44861
44932
|
errorText,
|
|
44862
44933
|
children
|
|
44863
44934
|
] });
|
|
44864
44935
|
}
|
|
44865
44936
|
console.log("Not a valid data structure");
|
|
44866
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.
|
|
44937
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { children: [
|
|
44867
44938
|
errorText,
|
|
44868
44939
|
children
|
|
44869
44940
|
] });
|
|
44870
44941
|
}
|
|
44871
44942
|
const labels = Object.entries(labelsRaw).map(([key, value]) => `${key}=${value}`).join(",");
|
|
44943
|
+
const labelsRows = Object.entries(labelsRaw).map(([key, value]) => `${key}=${value}`);
|
|
44872
44944
|
const labelsEncoded = encodeURIComponent(labels);
|
|
44873
44945
|
const hrefPrepared = `${linkPrefixPrepared}${labelsEncoded}`;
|
|
44946
|
+
if (renderLabelsAsRows) {
|
|
44947
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "flex-start", gap: 8, children: [
|
|
44948
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchOutlined, { style: { marginTop: 4 } }),
|
|
44949
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { vertical: true, children: [
|
|
44950
|
+
labelsRows.map((row, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Link, { href: hrefPrepared, ...linkProps, children: index < labelsRows.length - 1 ? `${row},` : row }, row)),
|
|
44951
|
+
children
|
|
44952
|
+
] })
|
|
44953
|
+
] });
|
|
44954
|
+
}
|
|
44874
44955
|
if (maxTextLength && !textLink) {
|
|
44875
44956
|
const truncatedLabels = maxTextLength ? truncate$1(labels, maxTextLength) : labels;
|
|
44876
44957
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -44952,6 +45033,7 @@ const Taints = ({ data, children }) => {
|
|
|
44952
45033
|
pathToValue,
|
|
44953
45034
|
editModalWidth,
|
|
44954
45035
|
cols,
|
|
45036
|
+
readOnly,
|
|
44955
45037
|
permissions,
|
|
44956
45038
|
permissionContext
|
|
44957
45039
|
} = data;
|
|
@@ -44982,7 +45064,8 @@ const Taints = ({ data, children }) => {
|
|
|
44982
45064
|
});
|
|
44983
45065
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
44984
45066
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
44985
|
-
const
|
|
45067
|
+
const canOpenEdit = !readOnly;
|
|
45068
|
+
const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
|
|
44986
45069
|
if (isMultiQueryLoading) {
|
|
44987
45070
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
44988
45071
|
}
|
|
@@ -45027,7 +45110,7 @@ const Taints = ({ data, children }) => {
|
|
|
45027
45110
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45028
45111
|
errorText,
|
|
45029
45112
|
" ",
|
|
45030
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45113
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45031
45114
|
Button,
|
|
45032
45115
|
{
|
|
45033
45116
|
type: "text",
|
|
@@ -45041,7 +45124,7 @@ const Taints = ({ data, children }) => {
|
|
|
45041
45124
|
)
|
|
45042
45125
|
] }) }),
|
|
45043
45126
|
contextHolder,
|
|
45044
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45127
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45045
45128
|
TaintsEditModal,
|
|
45046
45129
|
{
|
|
45047
45130
|
open,
|
|
@@ -45068,7 +45151,7 @@ const Taints = ({ data, children }) => {
|
|
|
45068
45151
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
45069
45152
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45070
45153
|
parsedTextWithCounter,
|
|
45071
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45154
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45072
45155
|
Button,
|
|
45073
45156
|
{
|
|
45074
45157
|
type: "text",
|
|
@@ -45084,7 +45167,7 @@ const Taints = ({ data, children }) => {
|
|
|
45084
45167
|
children
|
|
45085
45168
|
] }),
|
|
45086
45169
|
contextHolder,
|
|
45087
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45170
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45088
45171
|
TaintsEditModal,
|
|
45089
45172
|
{
|
|
45090
45173
|
open,
|
|
@@ -45162,6 +45245,7 @@ const Tolerations = ({
|
|
|
45162
45245
|
modalDescriptionTextStyle,
|
|
45163
45246
|
inputLabel,
|
|
45164
45247
|
inputLabelStyle,
|
|
45248
|
+
readOnly,
|
|
45165
45249
|
containerStyle,
|
|
45166
45250
|
endpoint,
|
|
45167
45251
|
pathToValue,
|
|
@@ -45197,7 +45281,8 @@ const Tolerations = ({
|
|
|
45197
45281
|
});
|
|
45198
45282
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
45199
45283
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
45200
|
-
const
|
|
45284
|
+
const canOpenEdit = !readOnly;
|
|
45285
|
+
const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
|
|
45201
45286
|
if (isMultiQueryLoading) {
|
|
45202
45287
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
45203
45288
|
}
|
|
@@ -45241,7 +45326,7 @@ const Tolerations = ({
|
|
|
45241
45326
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45242
45327
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45243
45328
|
errorText,
|
|
45244
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45329
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45245
45330
|
Button,
|
|
45246
45331
|
{
|
|
45247
45332
|
type: "text",
|
|
@@ -45255,7 +45340,7 @@ const Tolerations = ({
|
|
|
45255
45340
|
)
|
|
45256
45341
|
] }) }),
|
|
45257
45342
|
contextHolder,
|
|
45258
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45343
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45259
45344
|
TolerationsEditModal,
|
|
45260
45345
|
{
|
|
45261
45346
|
open,
|
|
@@ -45282,7 +45367,7 @@ const Tolerations = ({
|
|
|
45282
45367
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
45283
45368
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45284
45369
|
parsedTextWithCounter,
|
|
45285
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45370
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45286
45371
|
Button,
|
|
45287
45372
|
{
|
|
45288
45373
|
type: "text",
|
|
@@ -45298,7 +45383,7 @@ const Tolerations = ({
|
|
|
45298
45383
|
children
|
|
45299
45384
|
] }),
|
|
45300
45385
|
contextHolder,
|
|
45301
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45386
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45302
45387
|
TolerationsEditModal,
|
|
45303
45388
|
{
|
|
45304
45389
|
open,
|
|
@@ -45352,6 +45437,7 @@ const Annotations = ({
|
|
|
45352
45437
|
modalDescriptionTextStyle,
|
|
45353
45438
|
inputLabel,
|
|
45354
45439
|
inputLabelStyle,
|
|
45440
|
+
readOnly,
|
|
45355
45441
|
containerStyle,
|
|
45356
45442
|
endpoint,
|
|
45357
45443
|
pathToValue,
|
|
@@ -45387,7 +45473,8 @@ const Annotations = ({
|
|
|
45387
45473
|
});
|
|
45388
45474
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
45389
45475
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
45390
|
-
const
|
|
45476
|
+
const canOpenEdit = !readOnly;
|
|
45477
|
+
const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
|
|
45391
45478
|
if (isMultiQueryLoading) {
|
|
45392
45479
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
45393
45480
|
}
|
|
@@ -45431,7 +45518,7 @@ const Annotations = ({
|
|
|
45431
45518
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45432
45519
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45433
45520
|
errorText,
|
|
45434
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45521
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45435
45522
|
Button,
|
|
45436
45523
|
{
|
|
45437
45524
|
type: "text",
|
|
@@ -45445,7 +45532,7 @@ const Annotations = ({
|
|
|
45445
45532
|
)
|
|
45446
45533
|
] }) }),
|
|
45447
45534
|
contextHolder,
|
|
45448
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45535
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45449
45536
|
AnnotationsEditModal,
|
|
45450
45537
|
{
|
|
45451
45538
|
open,
|
|
@@ -45472,7 +45559,7 @@ const Annotations = ({
|
|
|
45472
45559
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
45473
45560
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45474
45561
|
parsedTextWithCounter,
|
|
45475
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45562
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45476
45563
|
Button,
|
|
45477
45564
|
{
|
|
45478
45565
|
type: "text",
|
|
@@ -45488,7 +45575,7 @@ const Annotations = ({
|
|
|
45488
45575
|
children
|
|
45489
45576
|
] }),
|
|
45490
45577
|
contextHolder,
|
|
45491
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45578
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45492
45579
|
AnnotationsEditModal,
|
|
45493
45580
|
{
|
|
45494
45581
|
open,
|
|
@@ -77883,7 +77970,7 @@ const TolerationsModal = ({
|
|
|
77883
77970
|
};
|
|
77884
77971
|
|
|
77885
77972
|
const LazyEnrichedTableModal = lazy(
|
|
77886
|
-
() => import('./index-
|
|
77973
|
+
() => import('./index-eI1hWaeQ.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
|
|
77887
77974
|
);
|
|
77888
77975
|
const renderActiveType = (activeType, extraProps) => {
|
|
77889
77976
|
if (!activeType) return null;
|
|
@@ -78992,34 +79079,6 @@ const buildEditUrl = (props, fullPath) => {
|
|
|
78992
79079
|
].filter(Boolean);
|
|
78993
79080
|
return `/${parts.join("/")}?backlink=${backlink}`;
|
|
78994
79081
|
};
|
|
78995
|
-
const renderActionModal = (action, extraProps) => {
|
|
78996
|
-
switch (action.type) {
|
|
78997
|
-
case "edit":
|
|
78998
|
-
return null;
|
|
78999
|
-
case "editLabels":
|
|
79000
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsModal, { ...action.props, ...extraProps });
|
|
79001
|
-
case "editAnnotations":
|
|
79002
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(AnnotationsModal, { ...action.props, ...extraProps });
|
|
79003
|
-
case "editTaints":
|
|
79004
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TaintsModal, { ...action.props, ...extraProps });
|
|
79005
|
-
case "editTolerations":
|
|
79006
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TolerationsModal, { ...action.props, ...extraProps });
|
|
79007
|
-
case "delete":
|
|
79008
|
-
return null;
|
|
79009
|
-
case "cordon":
|
|
79010
|
-
case "uncordon":
|
|
79011
|
-
case "suspend":
|
|
79012
|
-
case "resume":
|
|
79013
|
-
case "rolloutRestart":
|
|
79014
|
-
case "evict":
|
|
79015
|
-
case "openKubeletConfig":
|
|
79016
|
-
return null;
|
|
79017
|
-
default: {
|
|
79018
|
-
const _exhaustive = action;
|
|
79019
|
-
return _exhaustive;
|
|
79020
|
-
}
|
|
79021
|
-
}
|
|
79022
|
-
};
|
|
79023
79082
|
const getActionIcon = (action) => {
|
|
79024
79083
|
if (action.props.iconBase64Encoded) {
|
|
79025
79084
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$m.IconWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$m.IconScaler, { children: renderIcon$1(action.props.iconBase64Encoded, "currentColor") }) });
|
|
@@ -79100,6 +79159,92 @@ const buildEvictBody = (data) => {
|
|
|
79100
79159
|
...Object.keys(deleteOptions).length > 0 ? { deleteOptions } : {}
|
|
79101
79160
|
};
|
|
79102
79161
|
};
|
|
79162
|
+
const handleEditAction = (action, ctx, fullPath, navigate) => {
|
|
79163
|
+
const clusterPrepared = parseAll({ text: action.props.cluster, ...ctx });
|
|
79164
|
+
const namespacePrepared = action.props.namespace ? parseAll({ text: action.props.namespace, ...ctx }) : void 0;
|
|
79165
|
+
const syntheticProjectPrepared = action.props.syntheticProject ? parseAll({ text: action.props.syntheticProject, ...ctx }) : void 0;
|
|
79166
|
+
const apiGroupPrepared = action.props.apiGroup ? parseAll({ text: action.props.apiGroup, ...ctx }) : void 0;
|
|
79167
|
+
const apiVersionPrepared = parseAll({ text: action.props.apiVersion, ...ctx });
|
|
79168
|
+
const pluralPrepared = parseAll({ text: action.props.plural, ...ctx });
|
|
79169
|
+
const namePrepared = parseAll({ text: action.props.name, ...ctx });
|
|
79170
|
+
const baseprefixPrepared = action.props.baseprefix ? parseAll({ text: action.props.baseprefix, ...ctx }) : void 0;
|
|
79171
|
+
const url = buildEditUrl(
|
|
79172
|
+
{
|
|
79173
|
+
...action.props,
|
|
79174
|
+
cluster: clusterPrepared,
|
|
79175
|
+
namespace: namespacePrepared,
|
|
79176
|
+
syntheticProject: syntheticProjectPrepared,
|
|
79177
|
+
apiGroup: apiGroupPrepared,
|
|
79178
|
+
apiVersion: apiVersionPrepared,
|
|
79179
|
+
plural: pluralPrepared,
|
|
79180
|
+
name: namePrepared,
|
|
79181
|
+
baseprefix: baseprefixPrepared
|
|
79182
|
+
},
|
|
79183
|
+
fullPath
|
|
79184
|
+
);
|
|
79185
|
+
navigate(url);
|
|
79186
|
+
};
|
|
79187
|
+
const handleDeleteAction = (action, ctx, setDeleteModalData) => {
|
|
79188
|
+
const endpointPrepared = parseAll({ text: action.props.endpoint, ...ctx });
|
|
79189
|
+
const namePrepared = parseAll({ text: action.props.name, ...ctx });
|
|
79190
|
+
const redirectToPrepared = action.props.redirectTo ? parseAll({ text: action.props.redirectTo, ...ctx }) : void 0;
|
|
79191
|
+
setDeleteModalData({
|
|
79192
|
+
name: namePrepared,
|
|
79193
|
+
endpoint: endpointPrepared,
|
|
79194
|
+
redirectTo: redirectToPrepared
|
|
79195
|
+
});
|
|
79196
|
+
};
|
|
79197
|
+
const handlePatchActions = (action, ctx, onSuccess, onError) => {
|
|
79198
|
+
const actionLabel = action.props.text || action.type;
|
|
79199
|
+
const endpointPrepared = parseAll({ text: action.props.endpoint, ...ctx });
|
|
79200
|
+
const pathToValuePrepared = parseAll({ text: action.props.pathToValue, ...ctx });
|
|
79201
|
+
const valuePrepared = parseValueIfString(action.props.value, ctx);
|
|
79202
|
+
patchEntryWithReplaceOp({
|
|
79203
|
+
endpoint: endpointPrepared,
|
|
79204
|
+
pathToValue: pathToValuePrepared,
|
|
79205
|
+
body: valuePrepared
|
|
79206
|
+
}).then(() => onSuccess(actionLabel)).catch((error) => {
|
|
79207
|
+
onError(actionLabel, error);
|
|
79208
|
+
});
|
|
79209
|
+
};
|
|
79210
|
+
const handleRolloutRestartAction = (action, ctx, onSuccess, onError) => {
|
|
79211
|
+
const actionLabel = action.props.text || "Rollout restart";
|
|
79212
|
+
const endpointPrepared = parseAll({ text: action.props.endpoint, ...ctx });
|
|
79213
|
+
const annotationKeyPrepared = action.props.annotationKey ? parseAll({ text: action.props.annotationKey, ...ctx }) : "kubectl.kubernetes.io/restartedAt";
|
|
79214
|
+
const timestampPrepared = action.props.timestamp ? parseAll({ text: action.props.timestamp, ...ctx }) : (/* @__PURE__ */ new Date()).toISOString();
|
|
79215
|
+
patchEntryWithMergePatch({
|
|
79216
|
+
endpoint: endpointPrepared,
|
|
79217
|
+
body: {
|
|
79218
|
+
spec: {
|
|
79219
|
+
template: {
|
|
79220
|
+
metadata: {
|
|
79221
|
+
annotations: {
|
|
79222
|
+
[annotationKeyPrepared]: timestampPrepared
|
|
79223
|
+
}
|
|
79224
|
+
}
|
|
79225
|
+
}
|
|
79226
|
+
}
|
|
79227
|
+
}
|
|
79228
|
+
}).then(() => onSuccess(actionLabel)).catch((error) => {
|
|
79229
|
+
onError(actionLabel, error);
|
|
79230
|
+
console.error(error);
|
|
79231
|
+
});
|
|
79232
|
+
};
|
|
79233
|
+
const handleOpenKubeletConfigAction = (action, ctx, setActiveAction, setModalOpen) => {
|
|
79234
|
+
const urlPrepared = parseAll({ text: action.props.url, ...ctx });
|
|
79235
|
+
const modalTitlePrepared = action.props.modalTitle ? parseAll({ text: action.props.modalTitle, ...ctx }) : void 0;
|
|
79236
|
+
const modalDescriptionTextPrepared = action.props.modalDescriptionText ? parseAll({ text: action.props.modalDescriptionText, ...ctx }) : void 0;
|
|
79237
|
+
setActiveAction({
|
|
79238
|
+
...action,
|
|
79239
|
+
props: {
|
|
79240
|
+
...action.props,
|
|
79241
|
+
url: urlPrepared,
|
|
79242
|
+
modalTitle: modalTitlePrepared,
|
|
79243
|
+
modalDescriptionText: modalDescriptionTextPrepared
|
|
79244
|
+
}
|
|
79245
|
+
});
|
|
79246
|
+
setModalOpen(true);
|
|
79247
|
+
};
|
|
79103
79248
|
const useActionsDropdownHandlers = ({ replaceValues, multiQueryData }) => {
|
|
79104
79249
|
const navigate = useNavigate();
|
|
79105
79250
|
const location = useLocation();
|
|
@@ -79116,100 +79261,44 @@ const useActionsDropdownHandlers = ({ replaceValues, multiQueryData }) => {
|
|
|
79116
79261
|
queryClient.invalidateQueries({ queryKey: ["multi"] });
|
|
79117
79262
|
};
|
|
79118
79263
|
const showSuccess = (actionLabel) => {
|
|
79264
|
+
invalidateMultiQuery();
|
|
79119
79265
|
notificationApi.success({
|
|
79120
79266
|
message: `${actionLabel} successful`,
|
|
79121
79267
|
placement: "bottomRight"
|
|
79122
79268
|
});
|
|
79123
79269
|
};
|
|
79270
|
+
const getErrorDescription = (error) => {
|
|
79271
|
+
if (error instanceof AxiosError) {
|
|
79272
|
+
return error.response?.data?.message || error.message;
|
|
79273
|
+
}
|
|
79274
|
+
if (error instanceof Error) {
|
|
79275
|
+
return error.message;
|
|
79276
|
+
}
|
|
79277
|
+
return "Unknown error";
|
|
79278
|
+
};
|
|
79124
79279
|
const showError = (actionLabel, error) => {
|
|
79125
|
-
const description = error instanceof AxiosError ? error.response?.data?.message || error.message : error instanceof Error ? error.message : "Unknown error";
|
|
79126
79280
|
notificationApi.error({
|
|
79127
79281
|
message: `${actionLabel} failed`,
|
|
79128
|
-
description,
|
|
79282
|
+
description: getErrorDescription(error),
|
|
79129
79283
|
placement: "bottomRight"
|
|
79130
79284
|
});
|
|
79131
79285
|
};
|
|
79132
79286
|
const ctx = { replaceValues, multiQueryData };
|
|
79133
79287
|
const handleActionClick = (action) => {
|
|
79134
79288
|
if (action.type === "edit") {
|
|
79135
|
-
|
|
79136
|
-
const namespacePrepared = action.props.namespace ? parseAll({ text: action.props.namespace, replaceValues, multiQueryData }) : void 0;
|
|
79137
|
-
const syntheticProjectPrepared = action.props.syntheticProject ? parseAll({ text: action.props.syntheticProject, replaceValues, multiQueryData }) : void 0;
|
|
79138
|
-
const apiGroupPrepared = action.props.apiGroup ? parseAll({ text: action.props.apiGroup, replaceValues, multiQueryData }) : void 0;
|
|
79139
|
-
const apiVersionPrepared = parseAll({ text: action.props.apiVersion, replaceValues, multiQueryData });
|
|
79140
|
-
const pluralPrepared = parseAll({ text: action.props.plural, replaceValues, multiQueryData });
|
|
79141
|
-
const namePrepared = parseAll({ text: action.props.name, replaceValues, multiQueryData });
|
|
79142
|
-
const baseprefixPrepared = action.props.baseprefix ? parseAll({ text: action.props.baseprefix, replaceValues, multiQueryData }) : void 0;
|
|
79143
|
-
const url = buildEditUrl(
|
|
79144
|
-
{
|
|
79145
|
-
...action.props,
|
|
79146
|
-
cluster: clusterPrepared,
|
|
79147
|
-
namespace: namespacePrepared,
|
|
79148
|
-
syntheticProject: syntheticProjectPrepared,
|
|
79149
|
-
apiGroup: apiGroupPrepared,
|
|
79150
|
-
apiVersion: apiVersionPrepared,
|
|
79151
|
-
plural: pluralPrepared,
|
|
79152
|
-
name: namePrepared,
|
|
79153
|
-
baseprefix: baseprefixPrepared
|
|
79154
|
-
},
|
|
79155
|
-
fullPath
|
|
79156
|
-
);
|
|
79157
|
-
navigate(url);
|
|
79289
|
+
handleEditAction(action, ctx, fullPath, navigate);
|
|
79158
79290
|
return;
|
|
79159
79291
|
}
|
|
79160
79292
|
if (action.type === "delete") {
|
|
79161
|
-
|
|
79162
|
-
const namePrepared = parseAll({ text: action.props.name, replaceValues, multiQueryData });
|
|
79163
|
-
const redirectToPrepared = action.props.redirectTo ? parseAll({ text: action.props.redirectTo, replaceValues, multiQueryData }) : void 0;
|
|
79164
|
-
setDeleteModalData({
|
|
79165
|
-
name: namePrepared,
|
|
79166
|
-
endpoint: endpointPrepared,
|
|
79167
|
-
redirectTo: redirectToPrepared
|
|
79168
|
-
});
|
|
79293
|
+
handleDeleteAction(action, ctx, setDeleteModalData);
|
|
79169
79294
|
return;
|
|
79170
79295
|
}
|
|
79171
79296
|
if (action.type === "cordon" || action.type === "uncordon" || action.type === "suspend" || action.type === "resume") {
|
|
79172
|
-
|
|
79173
|
-
const endpointPrepared = parseAll({ text: action.props.endpoint, replaceValues, multiQueryData });
|
|
79174
|
-
const pathToValuePrepared = parseAll({ text: action.props.pathToValue, replaceValues, multiQueryData });
|
|
79175
|
-
const valuePrepared = parseValueIfString(action.props.value, ctx);
|
|
79176
|
-
patchEntryWithReplaceOp({
|
|
79177
|
-
endpoint: endpointPrepared,
|
|
79178
|
-
pathToValue: pathToValuePrepared,
|
|
79179
|
-
body: valuePrepared
|
|
79180
|
-
}).then(() => {
|
|
79181
|
-
invalidateMultiQuery();
|
|
79182
|
-
showSuccess(actionLabel);
|
|
79183
|
-
}).catch((error) => {
|
|
79184
|
-
showError(actionLabel, error);
|
|
79185
|
-
});
|
|
79297
|
+
handlePatchActions(action, ctx, showSuccess, showError);
|
|
79186
79298
|
return;
|
|
79187
79299
|
}
|
|
79188
79300
|
if (action.type === "rolloutRestart") {
|
|
79189
|
-
|
|
79190
|
-
const endpointPrepared = parseAll({ text: action.props.endpoint, replaceValues, multiQueryData });
|
|
79191
|
-
const annotationKeyPrepared = action.props.annotationKey ? parseAll({ text: action.props.annotationKey, replaceValues, multiQueryData }) : "kubectl.kubernetes.io/restartedAt";
|
|
79192
|
-
const timestampPrepared = action.props.timestamp ? parseAll({ text: action.props.timestamp, replaceValues, multiQueryData }) : (/* @__PURE__ */ new Date()).toISOString();
|
|
79193
|
-
patchEntryWithMergePatch({
|
|
79194
|
-
endpoint: endpointPrepared,
|
|
79195
|
-
body: {
|
|
79196
|
-
spec: {
|
|
79197
|
-
template: {
|
|
79198
|
-
metadata: {
|
|
79199
|
-
annotations: {
|
|
79200
|
-
[annotationKeyPrepared]: timestampPrepared
|
|
79201
|
-
}
|
|
79202
|
-
}
|
|
79203
|
-
}
|
|
79204
|
-
}
|
|
79205
|
-
}
|
|
79206
|
-
}).then(() => {
|
|
79207
|
-
invalidateMultiQuery();
|
|
79208
|
-
showSuccess(actionLabel);
|
|
79209
|
-
}).catch((error) => {
|
|
79210
|
-
showError(actionLabel, error);
|
|
79211
|
-
console.error(error);
|
|
79212
|
-
});
|
|
79301
|
+
handleRolloutRestartAction(action, ctx, showSuccess, showError);
|
|
79213
79302
|
return;
|
|
79214
79303
|
}
|
|
79215
79304
|
if (action.type === "evict") {
|
|
@@ -79218,9 +79307,7 @@ const useActionsDropdownHandlers = ({ replaceValues, multiQueryData }) => {
|
|
|
79218
79307
|
return;
|
|
79219
79308
|
}
|
|
79220
79309
|
if (action.type === "openKubeletConfig") {
|
|
79221
|
-
|
|
79222
|
-
const target = action.props.target ?? "_blank";
|
|
79223
|
-
window.open(urlPrepared, target);
|
|
79310
|
+
handleOpenKubeletConfigAction(action, ctx, setActiveAction, setModalOpen);
|
|
79224
79311
|
return;
|
|
79225
79312
|
}
|
|
79226
79313
|
setActiveAction(action);
|
|
@@ -79230,11 +79317,9 @@ const useActionsDropdownHandlers = ({ replaceValues, multiQueryData }) => {
|
|
|
79230
79317
|
if (!evictModalData) return;
|
|
79231
79318
|
setIsEvictLoading(true);
|
|
79232
79319
|
const body = buildEvictBody(evictModalData);
|
|
79233
|
-
|
|
79234
|
-
|
|
79235
|
-
|
|
79236
|
-
}).catch((error) => {
|
|
79237
|
-
showError(`Evict ${evictModalData.name}`, error);
|
|
79320
|
+
const evictLabel = `Evict ${evictModalData.name}`;
|
|
79321
|
+
createNewEntry({ endpoint: evictModalData.endpoint, body }).then(() => showSuccess(evictLabel)).catch((error) => {
|
|
79322
|
+
showError(evictLabel, error);
|
|
79238
79323
|
}).finally(() => {
|
|
79239
79324
|
setIsEvictLoading(false);
|
|
79240
79325
|
setEvictModalData(null);
|
|
@@ -79339,6 +79424,96 @@ const useActionsDropdownPermissions = ({
|
|
|
79339
79424
|
return permissions ?? computedPermissions;
|
|
79340
79425
|
};
|
|
79341
79426
|
|
|
79427
|
+
const toYamlString = (value) => {
|
|
79428
|
+
if (value === void 0) return "";
|
|
79429
|
+
if (typeof value === "string") {
|
|
79430
|
+
try {
|
|
79431
|
+
return stringify(JSON.parse(value));
|
|
79432
|
+
} catch {
|
|
79433
|
+
return value;
|
|
79434
|
+
}
|
|
79435
|
+
}
|
|
79436
|
+
return stringify(value);
|
|
79437
|
+
};
|
|
79438
|
+
const OpenKubeletConfigModal = ({ open, onClose, props }) => {
|
|
79439
|
+
const theme = useTheme();
|
|
79440
|
+
const { data, isLoading, isError, error } = useDirectUnknownResource({
|
|
79441
|
+
uri: props.url,
|
|
79442
|
+
queryKey: ["open-kubelet-config", props.url],
|
|
79443
|
+
refetchInterval: false,
|
|
79444
|
+
isEnabled: open && !!props.url && props.url !== "-"
|
|
79445
|
+
});
|
|
79446
|
+
const yamlData = useMemo(() => toYamlString(data), [data]);
|
|
79447
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
79448
|
+
ReadOnlyModal,
|
|
79449
|
+
{
|
|
79450
|
+
open,
|
|
79451
|
+
close: onClose,
|
|
79452
|
+
modalTitle: props.modalTitle || props.text,
|
|
79453
|
+
modalDescriptionText: props.modalDescriptionText,
|
|
79454
|
+
editModalWidth: props.editModalWidth || 920,
|
|
79455
|
+
children: [
|
|
79456
|
+
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
|
|
79457
|
+
isError && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79458
|
+
Alert,
|
|
79459
|
+
{
|
|
79460
|
+
type: "error",
|
|
79461
|
+
showIcon: true,
|
|
79462
|
+
message: "Failed to load kubelet config",
|
|
79463
|
+
description: error instanceof Error ? error.message : "Unknown error"
|
|
79464
|
+
}
|
|
79465
|
+
),
|
|
79466
|
+
!isLoading && !isError && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79467
|
+
Ft$1,
|
|
79468
|
+
{
|
|
79469
|
+
defaultLanguage: "yaml",
|
|
79470
|
+
width: "100%",
|
|
79471
|
+
height: "60vh",
|
|
79472
|
+
value: yamlData,
|
|
79473
|
+
theme: theme === "dark" ? "vs-dark" : "vs",
|
|
79474
|
+
options: {
|
|
79475
|
+
readOnly: true,
|
|
79476
|
+
minimap: { enabled: false },
|
|
79477
|
+
wordWrap: "on",
|
|
79478
|
+
lineNumbers: "on"
|
|
79479
|
+
}
|
|
79480
|
+
}
|
|
79481
|
+
)
|
|
79482
|
+
]
|
|
79483
|
+
}
|
|
79484
|
+
);
|
|
79485
|
+
};
|
|
79486
|
+
|
|
79487
|
+
const renderActionModal = (action, extraProps) => {
|
|
79488
|
+
switch (action.type) {
|
|
79489
|
+
case "edit":
|
|
79490
|
+
return null;
|
|
79491
|
+
case "editLabels":
|
|
79492
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsModal, { ...action.props, ...extraProps });
|
|
79493
|
+
case "editAnnotations":
|
|
79494
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AnnotationsModal, { ...action.props, ...extraProps });
|
|
79495
|
+
case "editTaints":
|
|
79496
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TaintsModal, { ...action.props, ...extraProps });
|
|
79497
|
+
case "editTolerations":
|
|
79498
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TolerationsModal, { ...action.props, ...extraProps });
|
|
79499
|
+
case "delete":
|
|
79500
|
+
return null;
|
|
79501
|
+
case "cordon":
|
|
79502
|
+
case "uncordon":
|
|
79503
|
+
case "suspend":
|
|
79504
|
+
case "resume":
|
|
79505
|
+
case "rolloutRestart":
|
|
79506
|
+
case "evict":
|
|
79507
|
+
return null;
|
|
79508
|
+
case "openKubeletConfig":
|
|
79509
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(OpenKubeletConfigModal, { ...extraProps, props: action.props });
|
|
79510
|
+
default: {
|
|
79511
|
+
const _exhaustive = action;
|
|
79512
|
+
return _exhaustive;
|
|
79513
|
+
}
|
|
79514
|
+
}
|
|
79515
|
+
};
|
|
79516
|
+
|
|
79342
79517
|
const ActionsDropdown = ({ data, children }) => {
|
|
79343
79518
|
const {
|
|
79344
79519
|
buttonText = "Actions",
|
|
@@ -84127,6 +84302,7 @@ const BlackholeForm = ({
|
|
|
84127
84302
|
onCancel: () => setError(void 0),
|
|
84128
84303
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.BigText, { children: "Error!" }) }),
|
|
84129
84304
|
cancelButtonProps: { style: { display: "none" } },
|
|
84305
|
+
centered: true,
|
|
84130
84306
|
children: [
|
|
84131
84307
|
"An error has occurred: ",
|
|
84132
84308
|
error?.response?.data?.message
|
|
@@ -84141,6 +84317,7 @@ const BlackholeForm = ({
|
|
|
84141
84317
|
onCancel: () => setIsDebugModalOpen(false),
|
|
84142
84318
|
title: "Debug for properties",
|
|
84143
84319
|
width: "90vw",
|
|
84320
|
+
centered: true,
|
|
84144
84321
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.DebugContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
84145
84322
|
Editor,
|
|
84146
84323
|
{
|
|
@@ -84469,6 +84646,7 @@ const AddEditFormModal = ({
|
|
|
84469
84646
|
open: isOpen !== false,
|
|
84470
84647
|
onCancel: () => setIsOpen(false),
|
|
84471
84648
|
onOk: () => submit(),
|
|
84649
|
+
centered: true,
|
|
84472
84650
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { form, name: "control-hooks", initialValues: { ...defaultValues }, children: [
|
|
84473
84651
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Name", name: "name", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { required: true }) }),
|
|
84474
84652
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Description", name: "description", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { required: true }) }),
|
|
@@ -88802,5 +88980,5 @@ const usePluginManifest = ({
|
|
|
88802
88980
|
});
|
|
88803
88981
|
};
|
|
88804
88982
|
|
|
88805
|
-
export { useInfiniteSentinel as $, getBuiltinResourceTypes as A, getCrdData as B, getDirectUnknownResource as C, DeleteIcon as D, EnrichedTableProvider as E, checkPermission as F, getSwagger as G, filterIfApiInstanceNamespaceScoped as H, filterIfBuiltInInstanceNamespaceScoped as I, checkIfApiInstanceNamespaceScoped as J, checkIfBuiltInInstanceNamespaceScoped as K, getKinds as L, useClusterList as M, useApiResources as N, useApiResourceSingle as O, PaddingContainer as P, useBuiltinResources as Q,
|
|
88806
|
-
//# sourceMappingURL=index-
|
|
88983
|
+
export { useInfiniteSentinel as $, getBuiltinResourceTypes as A, getCrdData as B, getDirectUnknownResource as C, DeleteIcon as D, EnrichedTableProvider as E, checkPermission as F, getSwagger as G, filterIfApiInstanceNamespaceScoped as H, filterIfBuiltInInstanceNamespaceScoped as I, checkIfApiInstanceNamespaceScoped as J, checkIfBuiltInInstanceNamespaceScoped as K, getKinds as L, useClusterList as M, useApiResources as N, useApiResourceSingle as O, PaddingContainer as P, useBuiltinResources as Q, ReadOnlyModal as R, useBuiltinResourceSingle as S, useCrdResources as T, useCrdResourceSingle as U, useApisResourceTypes as V, useApiResourceTypesByGroup as W, useBuiltinResourceTypes as X, useCrdData as Y, useListWatch as Z, _$1 as _, useTheme as a, parseQuotaValueMemoryAndStorage as a$, useK8sVerbs as a0, useManyK8sSmartResource as a1, useSmartResourceParams as a2, useResourceScope as a3, useKinds as a4, usePluginManifest as a5, Spacer$1 as a6, TreeWithSearch as a7, ConfirmModal as a8, UpIcon as a9, EnrichedTable as aA, getEnrichedColumns as aB, getEnrichedColumnsWithControls as aC, YamlEditorSingleton$1 as aD, BlackholeFormProvider as aE, BlackholeForm as aF, getObjectFormItemsDraft as aG, MarketPlace as aH, MarketplaceCard as aI, ProjectInfoCard as aJ, PodTerminal as aK, NodeTerminal as aL, PodLogs as aM, PodLogsMonaco as aN, VMVNC as aO, Search as aP, Events as aQ, DynamicRenderer as aR, DynamicComponents as aS, DynamicRendererWithProviders as aT, prepareTemplate as aU, isFlatObject as aV, filterSelectOptions as aW, getStringByName as aX, floorToDecimal as aY, parseQuotaValue as aZ, parseQuotaValueCpu as a_, DownIcon as aa, BackToDefaultIcon as ab, SuccessIcon as ac, feedbackIcons as ad, PlusIcon as ae, MinusIcon as af, LockedIcon as ag, UnlockedIcon as ah, PauseCircleIcon as ai, ResumeCircleIcon as aj, LookingGlassIcon as ak, EarthIcon as al, ContentCard$1 as am, FlexGrow as an, UncontrolledSelect as ao, CustomSelect$4 as ap, CursorPointerTag as aq, CursorPointerTagMinContent as ar, CursorDefaultDiv as as, ResourceLink as at, ManageableBreadcrumbsProvider as au, prepareDataForManageableBreadcrumbs as av, ManageableBreadcrumbs as aw, ManageableSidebarProvider as ax, prepareDataForManageableSidebar as ay, ManageableSidebar as az, usePartsOfUrl as b, normalizeValuesForQuotasToNumber as b0, getAllPathsFromObj as b1, getPrefixSubarrays as b2, groupsToTreeData as b3, getBuiltinTreeData as b4, getGroupsByCategory as b5, createContextFactory as b6, prepareUrlsToFetchForDynamicRenderer as b7, deepMerge as b8, getSortedKinds as b9, getSortedKindsAll as ba, hslFromString as bb, getUppercase as bc, kindByGvr as bd, pluralByKind as be, namespacedByGvr as bf, getLinkToBuiltinForm as bg, getLinkToApiForm as bh, isMultilineString as bi, isMultilineFromYaml as bj, includesArray as bk, getResourceLink as bl, getNamespaceLink as bm, convertBytes as bn, formatBytesAuto as bo, toBytes as bp, convertStorage as bq, parseValueWithUnit as br, convertCores as bs, formatCoresAuto as bt, toCores as bu, convertCompute as bv, parseCoresWithUnit as bw, formatDateAuto as bx, isValidRFC3339 as by, usePermissions as c, useDirectUnknownResource as d, useK8sSmartResource as e, jsxRuntimeExports as f, EditIcon as g, getLinkToForm as h, DeleteModal as i, jp as j, DeleteModalMany as k, getClusterList as l, createNewEntry as m, updateEntry as n, deleteEntry as o, parseAll as p, getApiResources as q, getApiResourceSingle as r, serializeLabelsWithNoEncoding$1 as s, getBuiltinResources as t, useMultiQuery as u, getBuiltinResourceSingle as v, getCrdResources as w, getCrdResourceSingle as x, getApiResourceTypes as y, getApiResourceTypesByApiGroup as z };
|
|
88984
|
+
//# sourceMappingURL=index-DclFY72w.mjs.map
|