@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.97 → 0.0.1-alpha.98
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 +786 -95
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +785 -94
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -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 +17 -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 +17 -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 +2 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +35 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o, { useDebugValue, createElement, useRef, useContext, useState, useLayoutEffect, useEffect, useMemo, memo, useCallback, createContext, Suspense, Fragment } from 'react';
|
|
2
2
|
import { Input, Tree, Modal, Alert, theme, Select, Tag, Breadcrumb, Spin, Menu, Tooltip, Space, Button, Flex, Table, notification, Typography, Form, Row, Col, Slider, InputNumber, Switch, Card, Dropdown, Result, Progress, Tabs, Popover } from 'antd';
|
|
3
|
-
import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, SearchOutlined, CheckOutlined, CloseOutlined, EditOutlined, DeleteOutlined, CaretDownOutlined, CaretRightOutlined, BugOutlined, PlusOutlined, EllipsisOutlined } from '@ant-design/icons';
|
|
3
|
+
import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, SearchOutlined, CheckOutlined, CloseOutlined, EditOutlined, DeleteOutlined, CaretDownOutlined, CaretRightOutlined, BugOutlined, PlusOutlined, EllipsisOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
|
4
4
|
import { useQuery, useQueries, useQueryClient } from '@tanstack/react-query';
|
|
5
5
|
import { Link, useNavigate, useLocation } from 'react-router-dom';
|
|
6
6
|
|
|
@@ -2504,7 +2504,7 @@ const CustomTreeProvider = st.div`
|
|
|
2504
2504
|
justify-content: center;
|
|
2505
2505
|
}
|
|
2506
2506
|
`;
|
|
2507
|
-
const Styled$
|
|
2507
|
+
const Styled$s = {
|
|
2508
2508
|
CustomTreeProvider
|
|
2509
2509
|
};
|
|
2510
2510
|
|
|
@@ -2569,7 +2569,7 @@ const TreeWithSearch = ({ treeData, onSelect }) => {
|
|
|
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$s.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2573
2573
|
Tree,
|
|
2574
2574
|
{
|
|
2575
2575
|
treeData: loop(treeData),
|
|
@@ -8443,14 +8443,14 @@ const ContentContainer = st.div`
|
|
|
8443
8443
|
display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
|
|
8444
8444
|
flex-flow: ${({ $flexFlow }) => $flexFlow};
|
|
8445
8445
|
`;
|
|
8446
|
-
const Styled$
|
|
8446
|
+
const Styled$r = {
|
|
8447
8447
|
ContentContainer
|
|
8448
8448
|
};
|
|
8449
8449
|
|
|
8450
8450
|
const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
|
|
8451
8451
|
const { token } = theme.useToken();
|
|
8452
8452
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8453
|
-
Styled$
|
|
8453
|
+
Styled$r.ContentContainer,
|
|
8454
8454
|
{
|
|
8455
8455
|
$flexGrow: flexGrow,
|
|
8456
8456
|
$bgColor: token.colorBgContainer,
|
|
@@ -8511,13 +8511,13 @@ const UncontrolledSelect$1 = st(Select)`
|
|
|
8511
8511
|
padding-inline: 8px;
|
|
8512
8512
|
}
|
|
8513
8513
|
`;
|
|
8514
|
-
const Styled$
|
|
8514
|
+
const Styled$q = {
|
|
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$q.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
|
|
8521
8521
|
};
|
|
8522
8522
|
|
|
8523
8523
|
const CustomSelect$5 = st(Select)`
|
|
@@ -8563,13 +8563,13 @@ const CustomSelect$5 = st(Select)`
|
|
|
8563
8563
|
margin-block: 0 !important;
|
|
8564
8564
|
}
|
|
8565
8565
|
`;
|
|
8566
|
-
const Styled$
|
|
8566
|
+
const Styled$p = {
|
|
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$p.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
|
|
8573
8573
|
};
|
|
8574
8574
|
|
|
8575
8575
|
const CursorPointerTag = st(Tag)`
|
|
@@ -8679,7 +8679,7 @@ const NoWrapContainer = st.div`
|
|
|
8679
8679
|
flex-wrap: nowrap !important;
|
|
8680
8680
|
}
|
|
8681
8681
|
`;
|
|
8682
|
-
const Styled$
|
|
8682
|
+
const Styled$o = {
|
|
8683
8683
|
PositionRelativeContainer,
|
|
8684
8684
|
FullWidthContainer,
|
|
8685
8685
|
NoWrapContainer
|
|
@@ -8722,9 +8722,9 @@ const CollapsibleBreadcrumb = ({ items }) => {
|
|
|
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$o.PositionRelativeContainer, { children: [
|
|
8726
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items: renderItems() }) }),
|
|
8727
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
|
|
8728
8728
|
] });
|
|
8729
8729
|
};
|
|
8730
8730
|
|
|
@@ -8732,12 +8732,12 @@ const HeightDiv = st.div`
|
|
|
8732
8732
|
min-height: 22px;
|
|
8733
8733
|
width: 100%;
|
|
8734
8734
|
`;
|
|
8735
|
-
const Styled$
|
|
8735
|
+
const Styled$n = {
|
|
8736
8736
|
HeightDiv
|
|
8737
8737
|
};
|
|
8738
8738
|
|
|
8739
8739
|
const ManageableBreadcrumbs = ({ data }) => {
|
|
8740
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8740
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
|
|
8741
8741
|
};
|
|
8742
8742
|
const ManageableBreadcrumbsWithDataProvider = ({
|
|
8743
8743
|
uri,
|
|
@@ -8761,7 +8761,7 @@ const ManageableBreadcrumbsWithDataProvider = ({
|
|
|
8761
8761
|
return null;
|
|
8762
8762
|
}
|
|
8763
8763
|
if (rawDataLoading) {
|
|
8764
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8764
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) });
|
|
8765
8765
|
}
|
|
8766
8766
|
if (!rawData) {
|
|
8767
8767
|
return null;
|
|
@@ -8776,7 +8776,7 @@ const ManageableBreadcrumbsWithDataProvider = ({
|
|
|
8776
8776
|
idToCompare
|
|
8777
8777
|
});
|
|
8778
8778
|
if (!result) {
|
|
8779
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8779
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.HeightDiv, {});
|
|
8780
8780
|
}
|
|
8781
8781
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result });
|
|
8782
8782
|
};
|
|
@@ -8867,7 +8867,7 @@ const CustomMenu = st(Menu)`
|
|
|
8867
8867
|
margin: 0 !important;
|
|
8868
8868
|
}
|
|
8869
8869
|
`;
|
|
8870
|
-
const Styled$
|
|
8870
|
+
const Styled$m = {
|
|
8871
8871
|
CustomMenu
|
|
8872
8872
|
};
|
|
8873
8873
|
|
|
@@ -8894,7 +8894,7 @@ const ManageableSidebar = ({ data, noMarginTop }) => {
|
|
|
8894
8894
|
setSelectedKeys(data.selectedKeys);
|
|
8895
8895
|
}, [data.selectedKeys]);
|
|
8896
8896
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8897
|
-
Styled$
|
|
8897
|
+
Styled$m.CustomMenu,
|
|
8898
8898
|
{
|
|
8899
8899
|
selectedKeys,
|
|
8900
8900
|
onSelect: () => {
|
|
@@ -26171,7 +26171,7 @@ const ShortenedText = st.div`
|
|
|
26171
26171
|
white-space: nowrap;
|
|
26172
26172
|
text-overflow: ellipsis;
|
|
26173
26173
|
`;
|
|
26174
|
-
const Styled$
|
|
26174
|
+
const Styled$l = {
|
|
26175
26175
|
ShortenedText
|
|
26176
26176
|
};
|
|
26177
26177
|
|
|
@@ -26180,7 +26180,7 @@ const ShortenedTextWithTooltip = ({ text, trimLength, maxWidth = 200 }) => {
|
|
|
26180
26180
|
const trimmedText = text.substring(0, trimLength);
|
|
26181
26181
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: text, placement: "top", children: trimmedText });
|
|
26182
26182
|
}
|
|
26183
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
26183
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$l.ShortenedText, { $maxWidth: maxWidth, children: text }) });
|
|
26184
26184
|
};
|
|
26185
26185
|
|
|
26186
26186
|
const FilterDropdown = ({
|
|
@@ -41720,7 +41720,7 @@ const BorderRadiusContainer$1 = st.div`
|
|
|
41720
41720
|
border-radius: 8px;
|
|
41721
41721
|
}
|
|
41722
41722
|
`;
|
|
41723
|
-
const Styled$
|
|
41723
|
+
const Styled$k = {
|
|
41724
41724
|
BorderRadiusContainer: BorderRadiusContainer$1
|
|
41725
41725
|
};
|
|
41726
41726
|
|
|
@@ -41729,7 +41729,7 @@ const YamlEditor = ({ theme, currentValues, onChange }) => {
|
|
|
41729
41729
|
useEffect(() => {
|
|
41730
41730
|
setYamlData(stringify(currentValues));
|
|
41731
41731
|
}, [currentValues]);
|
|
41732
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41732
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$k.BorderRadiusContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41733
41733
|
Ft,
|
|
41734
41734
|
{
|
|
41735
41735
|
defaultLanguage: "yaml",
|
|
@@ -41768,7 +41768,7 @@ const BigText$1 = st.div`
|
|
|
41768
41768
|
font-size: 16px;
|
|
41769
41769
|
line-height: 24px;
|
|
41770
41770
|
`;
|
|
41771
|
-
const Styled$
|
|
41771
|
+
const Styled$j = {
|
|
41772
41772
|
BorderRadiusContainer,
|
|
41773
41773
|
ControlsRowContainer: ControlsRowContainer$1,
|
|
41774
41774
|
BigText: BigText$1
|
|
@@ -41847,7 +41847,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
41847
41847
|
};
|
|
41848
41848
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
41849
41849
|
contextHolder,
|
|
41850
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41850
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.BorderRadiusContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41851
41851
|
Ft,
|
|
41852
41852
|
{
|
|
41853
41853
|
defaultLanguage: "yaml",
|
|
@@ -41863,7 +41863,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
41863
41863
|
}
|
|
41864
41864
|
}
|
|
41865
41865
|
) }),
|
|
41866
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
41867
41867
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
|
|
41868
41868
|
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => navigate(backlink), children: "Cancel" })
|
|
41869
41869
|
] }) }),
|
|
@@ -41873,7 +41873,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
41873
41873
|
open: !!error,
|
|
41874
41874
|
onOk: () => setError(void 0),
|
|
41875
41875
|
onCancel: () => setError(void 0),
|
|
41876
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
41876
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.BigText, { children: "Error!" }) }),
|
|
41877
41877
|
cancelButtonProps: { style: { display: "none" } },
|
|
41878
41878
|
children: [
|
|
41879
41879
|
"An error has occurred: ",
|
|
@@ -41953,7 +41953,7 @@ const Content$1 = st.div`
|
|
|
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$i = {
|
|
41957
41957
|
Container: Container$1,
|
|
41958
41958
|
TitleBar,
|
|
41959
41959
|
Content: Content$1
|
|
@@ -41980,14 +41980,14 @@ const CustomCollapse = ({
|
|
|
41980
41980
|
}
|
|
41981
41981
|
};
|
|
41982
41982
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
41983
|
-
Styled$
|
|
41983
|
+
Styled$i.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(Flex, { justify: "space-between", children: [
|
|
41990
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
41990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$i.TitleBar, { onClick: () => toggleCollapse(), children: [
|
|
41991
41991
|
!designNewLayout && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(CaretDownOutlined, { size: 14 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(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 @@ const CustomCollapse = ({
|
|
|
41998
41998
|
persistedCheckbox
|
|
41999
41999
|
] })
|
|
42000
42000
|
] }),
|
|
42001
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
42001
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$i.Content, { $isOpen: isOpen, $designNewLayout: designNewLayout, children })
|
|
42002
42002
|
]
|
|
42003
42003
|
}
|
|
42004
42004
|
);
|
|
@@ -42032,13 +42032,13 @@ const CustomSizeTitle = st.div`
|
|
|
42032
42032
|
const Content = st.div`
|
|
42033
42033
|
padding: ${({ $designNewLayout }) => $designNewLayout ? "0 0 0 6px" : "4px"};
|
|
42034
42034
|
`;
|
|
42035
|
-
const Styled$
|
|
42035
|
+
const Styled$h = {
|
|
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$h.Content, { $designNewLayout: designNewLayout, children });
|
|
42042
42042
|
};
|
|
42043
42043
|
|
|
42044
42044
|
const arraysEqual = (arr1, arr2) => {
|
|
@@ -42714,7 +42714,7 @@ const CrossContainer = st.div`
|
|
|
42714
42714
|
cursor: pointer;
|
|
42715
42715
|
padding-top: 11px;
|
|
42716
42716
|
`;
|
|
42717
|
-
const Styled$
|
|
42717
|
+
const Styled$g = {
|
|
42718
42718
|
SwitchAndCrossContainer,
|
|
42719
42719
|
CrossContainer
|
|
42720
42720
|
};
|
|
@@ -42739,7 +42739,7 @@ const FormBooleanInput = ({
|
|
|
42739
42739
|
onRemoveByMinus && /* @__PURE__ */ jsxRuntimeExports.jsx(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$g.SwitchAndCrossContainer, { children: [
|
|
42743
42743
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
42744
42744
|
ResetedFormItem,
|
|
42745
42745
|
{
|
|
@@ -42749,7 +42749,7 @@ const FormBooleanInput = ({
|
|
|
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$g.CrossContainer,
|
|
42753
42753
|
{
|
|
42754
42754
|
onClick: () => {
|
|
42755
42755
|
if (makeValueUndefined) {
|
|
@@ -42947,7 +42947,7 @@ const OverflowContainer$1 = st.div`
|
|
|
42947
42947
|
overflow-x: auto;
|
|
42948
42948
|
scrollbar-width: thin;
|
|
42949
42949
|
`;
|
|
42950
|
-
const ResetedFormList = st(Form.List)`
|
|
42950
|
+
const ResetedFormList$2 = st(Form.List)`
|
|
42951
42951
|
margin-bottom: 8px;
|
|
42952
42952
|
`;
|
|
42953
42953
|
const ControlsRowContainer = st.div`
|
|
@@ -42965,8 +42965,8 @@ const BigText = st.div`
|
|
|
42965
42965
|
font-size: 16px;
|
|
42966
42966
|
line-height: 24px;
|
|
42967
42967
|
`;
|
|
42968
|
-
const Styled$
|
|
42969
|
-
ResetedFormList,
|
|
42968
|
+
const Styled$f = {
|
|
42969
|
+
ResetedFormList: ResetedFormList$2,
|
|
42970
42970
|
Container,
|
|
42971
42971
|
OverflowContainer: OverflowContainer$1,
|
|
42972
42972
|
ControlsRowContainer,
|
|
@@ -43213,7 +43213,7 @@ const getArrayFormItemFromSwagger = ({
|
|
|
43213
43213
|
}
|
|
43214
43214
|
),
|
|
43215
43215
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43216
|
-
Styled$
|
|
43216
|
+
Styled$f.ResetedFormList,
|
|
43217
43217
|
{
|
|
43218
43218
|
name: arrName || name,
|
|
43219
43219
|
rules: !forceNonRequired && required?.includes(getStringByName(name)) ? [
|
|
@@ -43940,8 +43940,8 @@ const BlackholeForm = ({
|
|
|
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$f.Container, { $designNewLayout: designNewLayout, $designNewLayoutHeight: designNewLayoutHeight, children: [
|
|
43944
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.OverflowContainer, { ref: overflowRef, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43945
43945
|
Form,
|
|
43946
43946
|
{
|
|
43947
43947
|
form,
|
|
@@ -43985,7 +43985,7 @@ const BlackholeForm = ({
|
|
|
43985
43985
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(YamlEditor, { theme: theme$1, currentValues: yamlValues || {}, onChange: onYamlChangeCallback }) })
|
|
43986
43986
|
] }),
|
|
43987
43987
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FlexGrow, {}),
|
|
43988
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
43988
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
43989
43989
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
|
|
43990
43990
|
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => navigate(backlink), children: "Cancel" }),
|
|
43991
43991
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => setIsDebugModalOpen(true), icon: /* @__PURE__ */ jsxRuntimeExports.jsx(BugOutlined, {}) }),
|
|
@@ -43997,7 +43997,7 @@ const BlackholeForm = ({
|
|
|
43997
43997
|
open: !!error,
|
|
43998
43998
|
onOk: () => setError(void 0),
|
|
43999
43999
|
onCancel: () => setError(void 0),
|
|
44000
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44000
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.BigText, { children: "Error!" }) }),
|
|
44001
44001
|
cancelButtonProps: { style: { display: "none" } },
|
|
44002
44002
|
children: [
|
|
44003
44003
|
"An error has occurred: ",
|
|
@@ -44013,7 +44013,7 @@ const BlackholeForm = ({
|
|
|
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$f.DebugContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(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 @@ const CustomCard$5 = st(Card)`
|
|
|
44167
44167
|
padding: 8px;
|
|
44168
44168
|
}
|
|
44169
44169
|
`;
|
|
44170
|
-
const Styled$
|
|
44170
|
+
const Styled$e = {
|
|
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$e.CustomCard, { onClick: onAddClick, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusOutlined, {}) });
|
|
44176
44176
|
};
|
|
44177
44177
|
|
|
44178
44178
|
const byteToHex = [];
|
|
@@ -44476,7 +44476,7 @@ const EditButtonContainer = st.div`
|
|
|
44476
44476
|
bottom: 6px;
|
|
44477
44477
|
right: 6px;
|
|
44478
44478
|
`;
|
|
44479
|
-
const Styled$
|
|
44479
|
+
const Styled$d = {
|
|
44480
44480
|
CustomCard: CustomCard$4,
|
|
44481
44481
|
ImageContainer,
|
|
44482
44482
|
OverflowContainer,
|
|
@@ -44553,14 +44553,14 @@ const MarketplaceCard$1 = ({
|
|
|
44553
44553
|
return null;
|
|
44554
44554
|
}
|
|
44555
44555
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44556
|
-
Styled$
|
|
44556
|
+
Styled$d.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(Flex, { vertical: true, style: { width: "100%", height: "100%" }, justify: "spaceBetween", children: [
|
|
44562
44562
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", children: [
|
|
44563
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44563
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.ImageContainer, { dangerouslySetInnerHTML: { __html: decodedIcon } }),
|
|
44564
44564
|
isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44565
44565
|
"div",
|
|
44566
44566
|
{
|
|
@@ -44581,8 +44581,8 @@ const MarketplaceCard$1 = ({
|
|
|
44581
44581
|
}
|
|
44582
44582
|
)
|
|
44583
44583
|
] }),
|
|
44584
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
44585
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
44584
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$d.OverflowContainer, { children: [
|
|
44585
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$d.TitleContainer, { children: [
|
|
44586
44586
|
name,
|
|
44587
44587
|
" ",
|
|
44588
44588
|
addedMode && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
@@ -44590,10 +44590,10 @@ const MarketplaceCard$1 = ({
|
|
|
44590
44590
|
k8sList?.items?.length
|
|
44591
44591
|
] })
|
|
44592
44592
|
] }),
|
|
44593
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44594
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44593
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.TagsContainer, { children: tags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.CustomTag, { children: tag }, tag)) }),
|
|
44594
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.DescriptionContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", children: description }) })
|
|
44595
44595
|
] }),
|
|
44596
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
44596
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.EditButtonContainer, { children: isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44597
44597
|
"div",
|
|
44598
44598
|
{
|
|
44599
44599
|
onClick: (e) => {
|
|
@@ -44651,7 +44651,7 @@ const BigValue = st.div`
|
|
|
44651
44651
|
line-clamp: 1;
|
|
44652
44652
|
word-break: break-all;
|
|
44653
44653
|
`;
|
|
44654
|
-
const Styled$
|
|
44654
|
+
const Styled$c = {
|
|
44655
44655
|
BigValue
|
|
44656
44656
|
};
|
|
44657
44657
|
|
|
@@ -44762,7 +44762,7 @@ const MarketPlace = ({
|
|
|
44762
44762
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", children: [
|
|
44763
44763
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 12, vertical: true, children: [
|
|
44764
44764
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(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$c.BigValue, { children: "Marketplace" }) })
|
|
44766
44766
|
] }) }),
|
|
44767
44767
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 12, vertical: true, children: [
|
|
44768
44768
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SearchTextInput, { uniqueTags, selectedTags, onSelectedTags: setSelectedTags }),
|
|
@@ -44966,7 +44966,7 @@ st.div`
|
|
|
44966
44966
|
line-clamp: 1;
|
|
44967
44967
|
word-break: break-all;
|
|
44968
44968
|
`;
|
|
44969
|
-
const Styled$
|
|
44969
|
+
const Styled$b = {
|
|
44970
44970
|
ActionMenuPlaceholder};
|
|
44971
44971
|
|
|
44972
44972
|
const ProjectInfoCard$1 = ({
|
|
@@ -45044,7 +45044,7 @@ const ProjectInfoCard$1 = ({
|
|
|
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$b.ActionMenuPlaceholder, {}) }),
|
|
45048
45048
|
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownAccessGroups, { accessGroups })
|
|
45049
45049
|
] }) })
|
|
45050
45050
|
] }),
|
|
@@ -45130,7 +45130,7 @@ const FullWidthDiv$3 = st.div`
|
|
|
45130
45130
|
width: 100%;
|
|
45131
45131
|
height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
|
|
45132
45132
|
`;
|
|
45133
|
-
const Styled$
|
|
45133
|
+
const Styled$a = {
|
|
45134
45134
|
FullWidthDiv: FullWidthDiv$3,
|
|
45135
45135
|
CustomCard: CustomCard$3
|
|
45136
45136
|
};
|
|
@@ -45215,7 +45215,7 @@ const XTerminal$2 = ({ endpoint, namespace, podName, container, substractHeight
|
|
|
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$a.CustomCard, { $isVisible: !isLoading && !error, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$a.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
|
|
45219
45219
|
isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
|
|
45220
45220
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx(Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
|
|
45221
45221
|
] });
|
|
@@ -45226,7 +45226,7 @@ const CustomSelect$3 = st.div`
|
|
|
45226
45226
|
width: 200px;
|
|
45227
45227
|
}
|
|
45228
45228
|
`;
|
|
45229
|
-
const Styled$
|
|
45229
|
+
const Styled$9 = {
|
|
45230
45230
|
CustomSelect: CustomSelect$3
|
|
45231
45231
|
};
|
|
45232
45232
|
|
|
@@ -45237,7 +45237,7 @@ const PodTerminal$1 = ({ cluster, namespace, podName, containers, substractHeigh
|
|
|
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$9.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45241
45241
|
Select,
|
|
45242
45242
|
{
|
|
45243
45243
|
placeholder: "Select container",
|
|
@@ -45289,7 +45289,7 @@ const ProgressContainer = st.div`
|
|
|
45289
45289
|
align-items: center;
|
|
45290
45290
|
gap: 8px;
|
|
45291
45291
|
`;
|
|
45292
|
-
const Styled$
|
|
45292
|
+
const Styled$8 = {
|
|
45293
45293
|
FullWidthDiv: FullWidthDiv$2,
|
|
45294
45294
|
CustomCard: CustomCard$2,
|
|
45295
45295
|
ProgressContainer
|
|
@@ -45421,8 +45421,8 @@ const XTerminal$1 = ({ endpoint, nodeName, profile, substractHeight }) => {
|
|
|
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$8.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$8.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
|
|
45425
|
+
!isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$8.ProgressContainer, { $substractHeight: substractHeight, children: [
|
|
45426
45426
|
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
|
|
45427
45427
|
!isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Progress, { type: "circle", percent: progressPercent }),
|
|
45428
45428
|
warmupMessage && /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { children: [
|
|
@@ -45443,7 +45443,7 @@ const CustomSelect$2 = st.div`
|
|
|
45443
45443
|
width: 200px;
|
|
45444
45444
|
}
|
|
45445
45445
|
`;
|
|
45446
|
-
const Styled$
|
|
45446
|
+
const Styled$7 = {
|
|
45447
45447
|
CustomSelect: CustomSelect$2
|
|
45448
45448
|
};
|
|
45449
45449
|
|
|
@@ -45452,7 +45452,7 @@ const NodeTerminal$1 = ({ cluster, nodeName, substractHeight, defaultProfile })
|
|
|
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$7.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45456
45456
|
Select,
|
|
45457
45457
|
{
|
|
45458
45458
|
placeholder: "Select profile",
|
|
@@ -45491,7 +45491,7 @@ const FullWidthDiv$1 = st.div`
|
|
|
45491
45491
|
width: 100%;
|
|
45492
45492
|
height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
|
|
45493
45493
|
`;
|
|
45494
|
-
const Styled$
|
|
45494
|
+
const Styled$6 = {
|
|
45495
45495
|
FullWidthDiv: FullWidthDiv$1,
|
|
45496
45496
|
CustomCard: CustomCard$1
|
|
45497
45497
|
};
|
|
@@ -45572,7 +45572,7 @@ const XTerminal = ({ endpoint, namespace, podName, container, substractHeight })
|
|
|
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$6.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
|
|
45576
45576
|
isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
|
|
45577
45577
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx(Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
|
|
45578
45578
|
] });
|
|
@@ -45583,7 +45583,7 @@ const CustomSelect$1 = st.div`
|
|
|
45583
45583
|
width: 200px;
|
|
45584
45584
|
}
|
|
45585
45585
|
`;
|
|
45586
|
-
const Styled$
|
|
45586
|
+
const Styled$5 = {
|
|
45587
45587
|
CustomSelect: CustomSelect$1
|
|
45588
45588
|
};
|
|
45589
45589
|
|
|
@@ -45594,7 +45594,7 @@ const PodLogs$1 = ({ cluster, namespace, podName, containers, substractHeight })
|
|
|
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$5.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45598
45598
|
Select,
|
|
45599
45599
|
{
|
|
45600
45600
|
placeholder: "Select container",
|
|
@@ -45644,7 +45644,7 @@ const CursorPointerDiv = st.div`
|
|
|
45644
45644
|
cursor: pointer;
|
|
45645
45645
|
user-select: none;
|
|
45646
45646
|
`;
|
|
45647
|
-
const Styled$
|
|
45647
|
+
const Styled$4 = {
|
|
45648
45648
|
FullWidthDiv,
|
|
45649
45649
|
CustomCard,
|
|
45650
45650
|
VisibilityContainer: VisibilityContainer$2,
|
|
@@ -45718,9 +45718,9 @@ const MonacoEditor = ({
|
|
|
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$4.VisibilityContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "start", align: "center", gap: 16, children: [
|
|
45722
45722
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45723
|
-
Styled$
|
|
45723
|
+
Styled$4.CursorPointerDiv,
|
|
45724
45724
|
{
|
|
45725
45725
|
onClick: () => {
|
|
45726
45726
|
if (isPaused) {
|
|
@@ -45745,7 +45745,7 @@ const MonacoEditor = ({
|
|
|
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$4.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45749
45749
|
Ft,
|
|
45750
45750
|
{
|
|
45751
45751
|
defaultLanguage: "plaintext",
|
|
@@ -45776,7 +45776,7 @@ const CustomSelect = st.div`
|
|
|
45776
45776
|
width: 200px;
|
|
45777
45777
|
}
|
|
45778
45778
|
`;
|
|
45779
|
-
const Styled$
|
|
45779
|
+
const Styled$3 = {
|
|
45780
45780
|
TopRowContent,
|
|
45781
45781
|
CustomSelect
|
|
45782
45782
|
};
|
|
@@ -45822,8 +45822,8 @@ const PodLogsMonaco = ({
|
|
|
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$3.TopRowContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
|
|
45826
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45827
45827
|
Select,
|
|
45828
45828
|
{
|
|
45829
45829
|
placeholder: "Select container",
|
|
@@ -45838,7 +45838,7 @@ const PodLogsMonaco = ({
|
|
|
45838
45838
|
}
|
|
45839
45839
|
}
|
|
45840
45840
|
) }),
|
|
45841
|
-
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
45841
|
+
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45842
45842
|
Select,
|
|
45843
45843
|
{
|
|
45844
45844
|
placeholder: "Select current/previous",
|
|
@@ -46751,7 +46751,7 @@ const YamlEditorSingleton = ({
|
|
|
46751
46751
|
const VisibilityContainer$1 = st.div`
|
|
46752
46752
|
display: ${({ $hidden }) => $hidden ? "none" : "block"};
|
|
46753
46753
|
`;
|
|
46754
|
-
const Styled = {
|
|
46754
|
+
const Styled$2 = {
|
|
46755
46755
|
VisibilityContainer: VisibilityContainer$1
|
|
46756
46756
|
};
|
|
46757
46757
|
|
|
@@ -46774,7 +46774,7 @@ const VisibilityContainer = ({
|
|
|
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$2.VisibilityContainer, { $hidden: valuePrepared === "~undefined-value~", children });
|
|
46778
46778
|
};
|
|
46779
46779
|
|
|
46780
46780
|
const unknownToString = (value) => {
|
|
@@ -46786,7 +46786,7 @@ const unknownToString = (value) => {
|
|
|
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 @@ const parseArrayOfAny$2 = (value) => {
|
|
|
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 @@ const ArrayOfObjectsToKeyValues = ({ data, children }) => {
|
|
|
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$3 = (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 @@ const ItemCounter = ({
|
|
|
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$3(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 @@ const ItemCounter = ({
|
|
|
46924
46924
|
] });
|
|
46925
46925
|
};
|
|
46926
46926
|
|
|
46927
|
-
const getItemsInside = (value) => {
|
|
46927
|
+
const getItemsInside$2 = (value) => {
|
|
46928
46928
|
if (!Array.isArray(value)) {
|
|
46929
46929
|
return { error: "Value on jsonPath is not an array" };
|
|
46930
46930
|
}
|
|
@@ -46968,7 +46968,7 @@ const KeyCounter = ({
|
|
|
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$2(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 @@ const truncate = (text, max) => {
|
|
|
46998
46998
|
return text.length > max ? text.slice(0, max) + "..." : text;
|
|
46999
46999
|
};
|
|
47000
47000
|
|
|
47001
|
-
const EditModal = ({
|
|
47001
|
+
const EditModal$2 = ({
|
|
47002
47002
|
open,
|
|
47003
47003
|
close,
|
|
47004
47004
|
values,
|
|
@@ -47224,11 +47224,10 @@ const Labels = ({ data, children }) => {
|
|
|
47224
47224
|
children,
|
|
47225
47225
|
contextHolder,
|
|
47226
47226
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47227
|
-
EditModal,
|
|
47227
|
+
EditModal$2,
|
|
47228
47228
|
{
|
|
47229
47229
|
open,
|
|
47230
47230
|
close: () => setOpen(false),
|
|
47231
|
-
values: labelsRaw,
|
|
47232
47231
|
openNotificationSuccess,
|
|
47233
47232
|
modalTitle: modalTitlePrepared,
|
|
47234
47233
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
@@ -47289,7 +47288,7 @@ const Labels = ({ data, children }) => {
|
|
|
47289
47288
|
children,
|
|
47290
47289
|
contextHolder,
|
|
47291
47290
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47292
|
-
EditModal,
|
|
47291
|
+
EditModal$2,
|
|
47293
47292
|
{
|
|
47294
47293
|
open,
|
|
47295
47294
|
close: () => setOpen(false),
|
|
@@ -47366,6 +47365,696 @@ const LabelsToSearchParams = ({ data, children }) => {
|
|
|
47366
47365
|
] });
|
|
47367
47366
|
};
|
|
47368
47367
|
|
|
47368
|
+
const ResetedFormList$1 = st(Form.List)`
|
|
47369
|
+
margin-bottom: 8px;
|
|
47370
|
+
`;
|
|
47371
|
+
const Styled$1 = {
|
|
47372
|
+
ResetedFormList: ResetedFormList$1
|
|
47373
|
+
};
|
|
47374
|
+
|
|
47375
|
+
const EditModal$1 = ({
|
|
47376
|
+
open,
|
|
47377
|
+
close,
|
|
47378
|
+
values,
|
|
47379
|
+
openNotificationSuccess,
|
|
47380
|
+
modalTitle,
|
|
47381
|
+
modalDescriptionText,
|
|
47382
|
+
inputLabel,
|
|
47383
|
+
endpoint,
|
|
47384
|
+
pathToValue,
|
|
47385
|
+
editModalWidth,
|
|
47386
|
+
cols
|
|
47387
|
+
}) => {
|
|
47388
|
+
const queryClient = useQueryClient();
|
|
47389
|
+
const [error, setError] = useState();
|
|
47390
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
47391
|
+
const [form] = Form.useForm();
|
|
47392
|
+
const taints = Form.useWatch("taints", form);
|
|
47393
|
+
useEffect(() => {
|
|
47394
|
+
if (open) {
|
|
47395
|
+
form.setFieldsValue({
|
|
47396
|
+
taints: values || []
|
|
47397
|
+
});
|
|
47398
|
+
}
|
|
47399
|
+
}, [open, form]);
|
|
47400
|
+
const submit = () => {
|
|
47401
|
+
form.validateFields().then(() => {
|
|
47402
|
+
console.log(JSON.stringify(taints));
|
|
47403
|
+
setIsLoading(true);
|
|
47404
|
+
setError(void 0);
|
|
47405
|
+
patchEntryWithReplaceOp({ endpoint, pathToValue, body: taints }).then(() => {
|
|
47406
|
+
queryClient.invalidateQueries({ queryKey: ["multi"] });
|
|
47407
|
+
if (openNotificationSuccess) {
|
|
47408
|
+
openNotificationSuccess();
|
|
47409
|
+
}
|
|
47410
|
+
setIsLoading(false);
|
|
47411
|
+
setError(void 0);
|
|
47412
|
+
close();
|
|
47413
|
+
}).catch((error2) => {
|
|
47414
|
+
setIsLoading(false);
|
|
47415
|
+
setError(error2);
|
|
47416
|
+
});
|
|
47417
|
+
}).catch(() => console.log("Validating error"));
|
|
47418
|
+
};
|
|
47419
|
+
const effectOptions = ["NoSchedule", "PreferNoSchedule", "NoExecute"];
|
|
47420
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
47421
|
+
Modal,
|
|
47422
|
+
{
|
|
47423
|
+
title: modalTitle,
|
|
47424
|
+
open,
|
|
47425
|
+
onOk: () => submit(),
|
|
47426
|
+
onCancel: () => {
|
|
47427
|
+
close();
|
|
47428
|
+
form.resetFields();
|
|
47429
|
+
setIsLoading(false);
|
|
47430
|
+
setError(void 0);
|
|
47431
|
+
},
|
|
47432
|
+
okText: "Save",
|
|
47433
|
+
confirmLoading: isLoading,
|
|
47434
|
+
maskClosable: false,
|
|
47435
|
+
width: editModalWidth || 520,
|
|
47436
|
+
destroyOnHidden: true,
|
|
47437
|
+
centered: true,
|
|
47438
|
+
children: [
|
|
47439
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
|
|
47440
|
+
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47441
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: modalDescriptionText }),
|
|
47442
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
47443
|
+
] }),
|
|
47444
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { form, children: [
|
|
47445
|
+
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, children: inputLabel }),
|
|
47446
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47447
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { gutter: [16, 16], children: [
|
|
47448
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Key" }) }),
|
|
47449
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Value" }) }),
|
|
47450
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Effect" }) }),
|
|
47451
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
|
|
47452
|
+
] }),
|
|
47453
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47454
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.ResetedFormList, { name: "taints", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47455
|
+
fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { gutter: [16, 16], children: [
|
|
47456
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47457
|
+
ResetedFormItem,
|
|
47458
|
+
{
|
|
47459
|
+
...restField,
|
|
47460
|
+
name: [name, "key"],
|
|
47461
|
+
rules: [
|
|
47462
|
+
{
|
|
47463
|
+
validator: (_, v) => v === void 0 || typeof v === "string" ? Promise.resolve() : Promise.reject(new Error("Key must be a string."))
|
|
47464
|
+
}
|
|
47465
|
+
],
|
|
47466
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { placeholder: "e.g. dedicated" })
|
|
47467
|
+
}
|
|
47468
|
+
) }),
|
|
47469
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47470
|
+
ResetedFormItem,
|
|
47471
|
+
{
|
|
47472
|
+
...restField,
|
|
47473
|
+
name: [name, "value"],
|
|
47474
|
+
rules: [
|
|
47475
|
+
{
|
|
47476
|
+
validator: (_, v) => v === void 0 || typeof v === "string" ? Promise.resolve() : Promise.reject(new Error("Value must be a string."))
|
|
47477
|
+
}
|
|
47478
|
+
],
|
|
47479
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { placeholder: "e.g. batch" })
|
|
47480
|
+
}
|
|
47481
|
+
) }),
|
|
47482
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47483
|
+
ResetedFormItem,
|
|
47484
|
+
{
|
|
47485
|
+
...restField,
|
|
47486
|
+
name: [name, "effect"],
|
|
47487
|
+
rules: [
|
|
47488
|
+
{ required: true, message: "Effect is required." },
|
|
47489
|
+
{
|
|
47490
|
+
validator: (_, v) => v && effectOptions.includes(v) ? Promise.resolve() : Promise.reject(new Error("Select a valid effect."))
|
|
47491
|
+
}
|
|
47492
|
+
],
|
|
47493
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47494
|
+
Select,
|
|
47495
|
+
{
|
|
47496
|
+
placeholder: "Select effect",
|
|
47497
|
+
options: effectOptions.map((eff) => ({ label: eff, value: eff }))
|
|
47498
|
+
}
|
|
47499
|
+
)
|
|
47500
|
+
}
|
|
47501
|
+
) }),
|
|
47502
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", type: "text", onClick: () => remove(name), children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) }) })
|
|
47503
|
+
] }, key)),
|
|
47504
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResetedFormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "text", size: "small", onClick: () => add(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon, {}) }) })
|
|
47505
|
+
] }) })
|
|
47506
|
+
] })
|
|
47507
|
+
]
|
|
47508
|
+
}
|
|
47509
|
+
);
|
|
47510
|
+
};
|
|
47511
|
+
|
|
47512
|
+
const flattenOnce$1 = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
47513
|
+
const ALLOWED_EFFECTS$1 = /* @__PURE__ */ new Set(["NoSchedule", "PreferNoSchedule", "NoExecute"]);
|
|
47514
|
+
const isTaintLike = (x) => {
|
|
47515
|
+
if (x === null || typeof x !== "object" || Array.isArray(x)) return false;
|
|
47516
|
+
const o = x;
|
|
47517
|
+
if (typeof o.effect !== "string" || !ALLOWED_EFFECTS$1.has(o.effect)) return false;
|
|
47518
|
+
if ("key" in o && typeof o.key !== "string") return false;
|
|
47519
|
+
if ("value" in o && typeof o.value !== "string") return false;
|
|
47520
|
+
return true;
|
|
47521
|
+
};
|
|
47522
|
+
const filterTaintLikes = (input) => {
|
|
47523
|
+
if (!Array.isArray(input)) return [];
|
|
47524
|
+
return input.filter(isTaintLike);
|
|
47525
|
+
};
|
|
47526
|
+
const getItemsInside$1 = (value) => {
|
|
47527
|
+
if (!Array.isArray(value)) {
|
|
47528
|
+
return { error: "Value on jsonPath is not an array" };
|
|
47529
|
+
}
|
|
47530
|
+
let flattenArrayOfUnknown = [];
|
|
47531
|
+
try {
|
|
47532
|
+
flattenArrayOfUnknown = flattenOnce$1(value);
|
|
47533
|
+
} catch (e) {
|
|
47534
|
+
console.log(e);
|
|
47535
|
+
return { error: "Error while flattening" };
|
|
47536
|
+
}
|
|
47537
|
+
return { counter: flattenArrayOfUnknown.length, taints: filterTaintLikes(flattenArrayOfUnknown) };
|
|
47538
|
+
};
|
|
47539
|
+
|
|
47540
|
+
const Taints = ({ data, children }) => {
|
|
47541
|
+
const {
|
|
47542
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47543
|
+
id,
|
|
47544
|
+
reqIndex,
|
|
47545
|
+
jsonPathToArray,
|
|
47546
|
+
text,
|
|
47547
|
+
errorText,
|
|
47548
|
+
style,
|
|
47549
|
+
notificationSuccessMessage,
|
|
47550
|
+
notificationSuccessMessageDescription,
|
|
47551
|
+
modalTitle,
|
|
47552
|
+
modalDescriptionText,
|
|
47553
|
+
inputLabel,
|
|
47554
|
+
containerStyle,
|
|
47555
|
+
endpoint,
|
|
47556
|
+
pathToValue,
|
|
47557
|
+
editModalWidth,
|
|
47558
|
+
cols
|
|
47559
|
+
} = data;
|
|
47560
|
+
const [api, contextHolder] = notification.useNotification();
|
|
47561
|
+
const [open, setOpen] = useState(false);
|
|
47562
|
+
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
47563
|
+
const partsOfUrl = usePartsOfUrl();
|
|
47564
|
+
if (isMultiQueryLoading) {
|
|
47565
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
47566
|
+
}
|
|
47567
|
+
if (isMultiQueryErrors) {
|
|
47568
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
47569
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
47570
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
47571
|
+
] });
|
|
47572
|
+
}
|
|
47573
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
47574
|
+
acc[index.toString()] = value;
|
|
47575
|
+
return acc;
|
|
47576
|
+
}, {});
|
|
47577
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
47578
|
+
if (jsonRoot === void 0) {
|
|
47579
|
+
console.log("Item Counter: ${id}: No root for json path");
|
|
47580
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
|
|
47581
|
+
}
|
|
47582
|
+
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToArray}`);
|
|
47583
|
+
const { counter, taints, error: errorArrayOfObjects } = getItemsInside$1(anythingForNow);
|
|
47584
|
+
const notificationSuccessMessagePrepared = notificationSuccessMessage ? parseAll({
|
|
47585
|
+
text: notificationSuccessMessage,
|
|
47586
|
+
replaceValues,
|
|
47587
|
+
multiQueryData
|
|
47588
|
+
}) : "Success";
|
|
47589
|
+
const notificationSuccessMessageDescriptionPrepared = notificationSuccessMessageDescription ? parseAll({
|
|
47590
|
+
text: notificationSuccessMessageDescription,
|
|
47591
|
+
replaceValues,
|
|
47592
|
+
multiQueryData
|
|
47593
|
+
}) : "Success";
|
|
47594
|
+
const modalTitlePrepared = modalTitle ? parseAll({ text: modalTitle, replaceValues, multiQueryData }) : "Edit";
|
|
47595
|
+
const modalDescriptionTextPrepared = modalDescriptionText ? parseAll({ text: modalDescriptionText, replaceValues, multiQueryData }) : void 0;
|
|
47596
|
+
const inputLabelPrepared = inputLabel ? parseAll({ text: inputLabel, replaceValues, multiQueryData }) : void 0;
|
|
47597
|
+
const endpointPrepared = endpoint ? parseAll({ text: endpoint, replaceValues, multiQueryData }) : "no-endpoint-provided";
|
|
47598
|
+
const pathToValuePrepared = pathToValue ? parseAll({ text: pathToValue, replaceValues, multiQueryData }) : "no-pathToValue-provided";
|
|
47599
|
+
const openNotificationSuccess = () => {
|
|
47600
|
+
api.success({
|
|
47601
|
+
message: notificationSuccessMessagePrepared,
|
|
47602
|
+
description: notificationSuccessMessageDescriptionPrepared,
|
|
47603
|
+
placement: "bottomRight"
|
|
47604
|
+
});
|
|
47605
|
+
};
|
|
47606
|
+
if (errorArrayOfObjects) {
|
|
47607
|
+
console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
|
|
47608
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
47610
|
+
errorText,
|
|
47611
|
+
" ",
|
|
47612
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47613
|
+
Button,
|
|
47614
|
+
{
|
|
47615
|
+
type: "text",
|
|
47616
|
+
size: "small",
|
|
47617
|
+
onClick: (e) => {
|
|
47618
|
+
e.stopPropagation();
|
|
47619
|
+
setOpen(true);
|
|
47620
|
+
},
|
|
47621
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
47622
|
+
}
|
|
47623
|
+
)
|
|
47624
|
+
] }) }),
|
|
47625
|
+
contextHolder,
|
|
47626
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47627
|
+
EditModal$1,
|
|
47628
|
+
{
|
|
47629
|
+
open,
|
|
47630
|
+
close: () => setOpen(false),
|
|
47631
|
+
values: taints,
|
|
47632
|
+
openNotificationSuccess,
|
|
47633
|
+
modalTitle: modalTitlePrepared,
|
|
47634
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
47635
|
+
inputLabel: inputLabelPrepared,
|
|
47636
|
+
endpoint: endpointPrepared,
|
|
47637
|
+
pathToValue: pathToValuePrepared,
|
|
47638
|
+
editModalWidth,
|
|
47639
|
+
cols
|
|
47640
|
+
}
|
|
47641
|
+
)
|
|
47642
|
+
] });
|
|
47643
|
+
}
|
|
47644
|
+
const parsedText = parseAll({ text, replaceValues, multiQueryData });
|
|
47645
|
+
const parsedTextWithCounter = parsedText.replace("~counter~", String(counter || 0));
|
|
47646
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47647
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
47648
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
47649
|
+
parsedTextWithCounter,
|
|
47650
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47651
|
+
Button,
|
|
47652
|
+
{
|
|
47653
|
+
type: "text",
|
|
47654
|
+
size: "small",
|
|
47655
|
+
onClick: (e) => {
|
|
47656
|
+
e.stopPropagation();
|
|
47657
|
+
setOpen(true);
|
|
47658
|
+
},
|
|
47659
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
47660
|
+
}
|
|
47661
|
+
)
|
|
47662
|
+
] }),
|
|
47663
|
+
children
|
|
47664
|
+
] }),
|
|
47665
|
+
contextHolder,
|
|
47666
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47667
|
+
EditModal$1,
|
|
47668
|
+
{
|
|
47669
|
+
open,
|
|
47670
|
+
close: () => setOpen(false),
|
|
47671
|
+
values: taints,
|
|
47672
|
+
openNotificationSuccess,
|
|
47673
|
+
modalTitle: modalTitlePrepared,
|
|
47674
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
47675
|
+
inputLabel: inputLabelPrepared,
|
|
47676
|
+
endpoint: endpointPrepared,
|
|
47677
|
+
pathToValue: pathToValuePrepared,
|
|
47678
|
+
editModalWidth,
|
|
47679
|
+
cols
|
|
47680
|
+
}
|
|
47681
|
+
)
|
|
47682
|
+
] });
|
|
47683
|
+
};
|
|
47684
|
+
|
|
47685
|
+
const ResetedFormList = st(Form.List)`
|
|
47686
|
+
margin-bottom: 8px;
|
|
47687
|
+
`;
|
|
47688
|
+
const Styled = {
|
|
47689
|
+
ResetedFormList
|
|
47690
|
+
};
|
|
47691
|
+
|
|
47692
|
+
const EditModal = ({
|
|
47693
|
+
open,
|
|
47694
|
+
close,
|
|
47695
|
+
values,
|
|
47696
|
+
openNotificationSuccess,
|
|
47697
|
+
modalTitle,
|
|
47698
|
+
modalDescriptionText,
|
|
47699
|
+
inputLabel,
|
|
47700
|
+
endpoint,
|
|
47701
|
+
pathToValue,
|
|
47702
|
+
editModalWidth,
|
|
47703
|
+
cols
|
|
47704
|
+
}) => {
|
|
47705
|
+
const queryClient = useQueryClient();
|
|
47706
|
+
const [error, setError] = useState();
|
|
47707
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
47708
|
+
const [form] = Form.useForm();
|
|
47709
|
+
const tolerations = Form.useWatch("tolerations", form);
|
|
47710
|
+
useEffect(() => {
|
|
47711
|
+
if (open) {
|
|
47712
|
+
form.setFieldsValue({
|
|
47713
|
+
tolerations: values || []
|
|
47714
|
+
});
|
|
47715
|
+
}
|
|
47716
|
+
}, [open, form]);
|
|
47717
|
+
const submit = () => {
|
|
47718
|
+
form.validateFields().then(() => {
|
|
47719
|
+
console.log(JSON.stringify(tolerations));
|
|
47720
|
+
setIsLoading(true);
|
|
47721
|
+
setError(void 0);
|
|
47722
|
+
patchEntryWithReplaceOp({ endpoint, pathToValue, body: tolerations }).then(() => {
|
|
47723
|
+
queryClient.invalidateQueries({ queryKey: ["multi"] });
|
|
47724
|
+
if (openNotificationSuccess) {
|
|
47725
|
+
openNotificationSuccess();
|
|
47726
|
+
}
|
|
47727
|
+
setIsLoading(false);
|
|
47728
|
+
setError(void 0);
|
|
47729
|
+
close();
|
|
47730
|
+
}).catch((error2) => {
|
|
47731
|
+
setIsLoading(false);
|
|
47732
|
+
setError(error2);
|
|
47733
|
+
});
|
|
47734
|
+
}).catch(() => console.log("Validating error"));
|
|
47735
|
+
};
|
|
47736
|
+
const operatorOptions = ["Exists", "Equal"];
|
|
47737
|
+
const effectOptions = ["NoSchedule", "PreferNoSchedule", "NoExecute"];
|
|
47738
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
47739
|
+
Modal,
|
|
47740
|
+
{
|
|
47741
|
+
title: modalTitle,
|
|
47742
|
+
open,
|
|
47743
|
+
onOk: () => submit(),
|
|
47744
|
+
onCancel: () => {
|
|
47745
|
+
close();
|
|
47746
|
+
form.resetFields();
|
|
47747
|
+
setIsLoading(false);
|
|
47748
|
+
setError(void 0);
|
|
47749
|
+
},
|
|
47750
|
+
okText: "Save",
|
|
47751
|
+
confirmLoading: isLoading,
|
|
47752
|
+
maskClosable: false,
|
|
47753
|
+
width: editModalWidth || 520,
|
|
47754
|
+
destroyOnHidden: true,
|
|
47755
|
+
centered: true,
|
|
47756
|
+
children: [
|
|
47757
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
|
|
47758
|
+
modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47759
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: modalDescriptionText }),
|
|
47760
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
|
|
47761
|
+
] }),
|
|
47762
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { form, children: [
|
|
47763
|
+
inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, children: inputLabel }),
|
|
47764
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47765
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { gutter: [16, 16], children: [
|
|
47766
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
47767
|
+
"Key",
|
|
47768
|
+
" ",
|
|
47769
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Required when operator is Equal; optional for Exists.", children: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoCircleOutlined, {}) })
|
|
47770
|
+
] }) }) }),
|
|
47771
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Operator" }) }),
|
|
47772
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
47773
|
+
"Value",
|
|
47774
|
+
" ",
|
|
47775
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Required for Equal; must be empty for Exists.", children: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoCircleOutlined, {}) })
|
|
47776
|
+
] }) }) }),
|
|
47777
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Effect" }) }),
|
|
47778
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[4], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
|
|
47779
|
+
] }),
|
|
47780
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
47781
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled.ResetedFormList, { name: "tolerations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47782
|
+
fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { gutter: [16, 16], children: [
|
|
47783
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47784
|
+
ResetedFormItem,
|
|
47785
|
+
{
|
|
47786
|
+
...restField,
|
|
47787
|
+
name: [name, "key"],
|
|
47788
|
+
rules: [
|
|
47789
|
+
({ getFieldValue }) => ({
|
|
47790
|
+
validator(_, v) {
|
|
47791
|
+
const op = getFieldValue(["tolerations", name, "operator"]);
|
|
47792
|
+
if (op === "Equal" && (!v || v === "")) {
|
|
47793
|
+
return Promise.reject(new Error("Key is required when operator is Equal."));
|
|
47794
|
+
}
|
|
47795
|
+
return Promise.resolve();
|
|
47796
|
+
}
|
|
47797
|
+
})
|
|
47798
|
+
],
|
|
47799
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { placeholder: "key" })
|
|
47800
|
+
}
|
|
47801
|
+
) }),
|
|
47802
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[1], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47803
|
+
ResetedFormItem,
|
|
47804
|
+
{
|
|
47805
|
+
...restField,
|
|
47806
|
+
name: [name, "operator"],
|
|
47807
|
+
rules: [
|
|
47808
|
+
{ required: true, message: "Operator is required." },
|
|
47809
|
+
{
|
|
47810
|
+
validator: (_, v) => v && operatorOptions.includes(v) ? Promise.resolve() : Promise.reject(new Error("Select a valid operator."))
|
|
47811
|
+
}
|
|
47812
|
+
],
|
|
47813
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47814
|
+
Select,
|
|
47815
|
+
{
|
|
47816
|
+
placeholder: "Select operator",
|
|
47817
|
+
options: operatorOptions.map((op) => ({ label: op, value: op }))
|
|
47818
|
+
}
|
|
47819
|
+
)
|
|
47820
|
+
}
|
|
47821
|
+
) }),
|
|
47822
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47823
|
+
ResetedFormItem,
|
|
47824
|
+
{
|
|
47825
|
+
...restField,
|
|
47826
|
+
name: [name, "value"],
|
|
47827
|
+
rules: [
|
|
47828
|
+
({ getFieldValue }) => ({
|
|
47829
|
+
validator(_, v) {
|
|
47830
|
+
const op = getFieldValue(["tolerations", name, "operator"]);
|
|
47831
|
+
if (op === "Equal" && (!v || v === "")) {
|
|
47832
|
+
return Promise.reject(new Error("Value is required when operator is Equal."));
|
|
47833
|
+
}
|
|
47834
|
+
if (op === "Exists" && v) {
|
|
47835
|
+
return Promise.reject(new Error("Value must be empty when operator is Exists."));
|
|
47836
|
+
}
|
|
47837
|
+
return Promise.resolve();
|
|
47838
|
+
}
|
|
47839
|
+
})
|
|
47840
|
+
],
|
|
47841
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { placeholder: "value" })
|
|
47842
|
+
}
|
|
47843
|
+
) }),
|
|
47844
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47845
|
+
ResetedFormItem,
|
|
47846
|
+
{
|
|
47847
|
+
...restField,
|
|
47848
|
+
name: [name, "effect"],
|
|
47849
|
+
rules: [
|
|
47850
|
+
{ required: true, message: "Effect is required." },
|
|
47851
|
+
{
|
|
47852
|
+
validator: (_, v) => v && effectOptions.includes(v) ? Promise.resolve() : Promise.reject(new Error("Select a valid effect."))
|
|
47853
|
+
}
|
|
47854
|
+
],
|
|
47855
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47856
|
+
Select,
|
|
47857
|
+
{
|
|
47858
|
+
placeholder: "Select effect",
|
|
47859
|
+
options: effectOptions.map((eff) => ({ label: eff, value: eff }))
|
|
47860
|
+
}
|
|
47861
|
+
)
|
|
47862
|
+
}
|
|
47863
|
+
) }),
|
|
47864
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: cols[4], children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", type: "text", onClick: () => remove(name), children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) }) })
|
|
47865
|
+
] }, key)),
|
|
47866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResetedFormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "text", size: "small", onClick: () => add(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon, {}) }) })
|
|
47867
|
+
] }) })
|
|
47868
|
+
] })
|
|
47869
|
+
]
|
|
47870
|
+
}
|
|
47871
|
+
);
|
|
47872
|
+
};
|
|
47873
|
+
|
|
47874
|
+
const flattenOnce = (arr) => arr.reduce((acc, row) => [...acc, ...row], []);
|
|
47875
|
+
const ALLOWED_OPERATORS = /* @__PURE__ */ new Set(["Exists", "Equal"]);
|
|
47876
|
+
const ALLOWED_EFFECTS = /* @__PURE__ */ new Set(["NoSchedule", "PreferNoSchedule", "NoExecute"]);
|
|
47877
|
+
const isToleration = (x) => {
|
|
47878
|
+
if (x === null || typeof x !== "object" || Array.isArray(x)) return false;
|
|
47879
|
+
const o = x;
|
|
47880
|
+
if ("key" in o && typeof o.key !== "string") return false;
|
|
47881
|
+
if ("value" in o && typeof o.value !== "string") return false;
|
|
47882
|
+
if ("operator" in o) {
|
|
47883
|
+
if (typeof o.operator !== "string" || !ALLOWED_OPERATORS.has(o.operator)) {
|
|
47884
|
+
return false;
|
|
47885
|
+
}
|
|
47886
|
+
}
|
|
47887
|
+
if ("effect" in o) {
|
|
47888
|
+
if (typeof o.effect !== "string" || !ALLOWED_EFFECTS.has(o.effect)) {
|
|
47889
|
+
return false;
|
|
47890
|
+
}
|
|
47891
|
+
}
|
|
47892
|
+
return true;
|
|
47893
|
+
};
|
|
47894
|
+
const filterTolerations = (input) => {
|
|
47895
|
+
if (!Array.isArray(input)) return [];
|
|
47896
|
+
return input.filter(isToleration);
|
|
47897
|
+
};
|
|
47898
|
+
const getItemsInside = (value) => {
|
|
47899
|
+
if (!Array.isArray(value)) {
|
|
47900
|
+
return { error: "Value on jsonPath is not an array" };
|
|
47901
|
+
}
|
|
47902
|
+
let flattenArrayOfUnknown = [];
|
|
47903
|
+
try {
|
|
47904
|
+
flattenArrayOfUnknown = flattenOnce(value);
|
|
47905
|
+
} catch (e) {
|
|
47906
|
+
console.log(e);
|
|
47907
|
+
return { error: "Error while flattening" };
|
|
47908
|
+
}
|
|
47909
|
+
return { counter: flattenArrayOfUnknown.length, tolerations: filterTolerations(flattenArrayOfUnknown) };
|
|
47910
|
+
};
|
|
47911
|
+
|
|
47912
|
+
const Tolerations = ({
|
|
47913
|
+
data,
|
|
47914
|
+
children
|
|
47915
|
+
}) => {
|
|
47916
|
+
const {
|
|
47917
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47918
|
+
id,
|
|
47919
|
+
reqIndex,
|
|
47920
|
+
jsonPathToArray,
|
|
47921
|
+
text,
|
|
47922
|
+
errorText,
|
|
47923
|
+
notificationSuccessMessage,
|
|
47924
|
+
notificationSuccessMessageDescription,
|
|
47925
|
+
modalTitle,
|
|
47926
|
+
modalDescriptionText,
|
|
47927
|
+
inputLabel,
|
|
47928
|
+
containerStyle,
|
|
47929
|
+
endpoint,
|
|
47930
|
+
pathToValue,
|
|
47931
|
+
editModalWidth,
|
|
47932
|
+
cols
|
|
47933
|
+
} = data;
|
|
47934
|
+
const [api, contextHolder] = notification.useNotification();
|
|
47935
|
+
const [open, setOpen] = useState(false);
|
|
47936
|
+
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
47937
|
+
const partsOfUrl = usePartsOfUrl();
|
|
47938
|
+
if (isMultiQueryLoading) {
|
|
47939
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
47940
|
+
}
|
|
47941
|
+
if (isMultiQueryErrors) {
|
|
47942
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
47943
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
47944
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
47945
|
+
] });
|
|
47946
|
+
}
|
|
47947
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
47948
|
+
acc[index.toString()] = value;
|
|
47949
|
+
return acc;
|
|
47950
|
+
}, {});
|
|
47951
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
47952
|
+
if (jsonRoot === void 0) {
|
|
47953
|
+
console.log("Item Counter: ${id}: No root for json path");
|
|
47954
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
|
|
47955
|
+
}
|
|
47956
|
+
const anythingForNow = jp.query(jsonRoot, `$${jsonPathToArray}`);
|
|
47957
|
+
const { counter, tolerations, error: errorArrayOfObjects } = getItemsInside(anythingForNow);
|
|
47958
|
+
const notificationSuccessMessagePrepared = notificationSuccessMessage ? parseAll({
|
|
47959
|
+
text: notificationSuccessMessage,
|
|
47960
|
+
replaceValues,
|
|
47961
|
+
multiQueryData
|
|
47962
|
+
}) : "Success";
|
|
47963
|
+
const notificationSuccessMessageDescriptionPrepared = notificationSuccessMessageDescription ? parseAll({
|
|
47964
|
+
text: notificationSuccessMessageDescription,
|
|
47965
|
+
replaceValues,
|
|
47966
|
+
multiQueryData
|
|
47967
|
+
}) : "Success";
|
|
47968
|
+
const modalTitlePrepared = modalTitle ? parseAll({ text: modalTitle, replaceValues, multiQueryData }) : "Edit";
|
|
47969
|
+
const modalDescriptionTextPrepared = modalDescriptionText ? parseAll({ text: modalDescriptionText, replaceValues, multiQueryData }) : void 0;
|
|
47970
|
+
const inputLabelPrepared = inputLabel ? parseAll({ text: inputLabel, replaceValues, multiQueryData }) : void 0;
|
|
47971
|
+
const endpointPrepared = endpoint ? parseAll({ text: endpoint, replaceValues, multiQueryData }) : "no-endpoint-provided";
|
|
47972
|
+
const pathToValuePrepared = pathToValue ? parseAll({ text: pathToValue, replaceValues, multiQueryData }) : "no-pathToValue-provided";
|
|
47973
|
+
const openNotificationSuccess = () => {
|
|
47974
|
+
api.success({
|
|
47975
|
+
message: notificationSuccessMessagePrepared,
|
|
47976
|
+
description: notificationSuccessMessageDescriptionPrepared,
|
|
47977
|
+
placement: "bottomRight"
|
|
47978
|
+
});
|
|
47979
|
+
};
|
|
47980
|
+
if (errorArrayOfObjects) {
|
|
47981
|
+
console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
|
|
47982
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
47983
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
47984
|
+
errorText,
|
|
47985
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47986
|
+
Button,
|
|
47987
|
+
{
|
|
47988
|
+
type: "text",
|
|
47989
|
+
size: "small",
|
|
47990
|
+
onClick: (e) => {
|
|
47991
|
+
e.stopPropagation();
|
|
47992
|
+
setOpen(true);
|
|
47993
|
+
},
|
|
47994
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
47995
|
+
}
|
|
47996
|
+
)
|
|
47997
|
+
] }) }),
|
|
47998
|
+
contextHolder,
|
|
47999
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48000
|
+
EditModal,
|
|
48001
|
+
{
|
|
48002
|
+
open,
|
|
48003
|
+
close: () => setOpen(false),
|
|
48004
|
+
values: tolerations,
|
|
48005
|
+
openNotificationSuccess,
|
|
48006
|
+
modalTitle: modalTitlePrepared,
|
|
48007
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
48008
|
+
inputLabel: inputLabelPrepared,
|
|
48009
|
+
endpoint: endpointPrepared,
|
|
48010
|
+
pathToValue: pathToValuePrepared,
|
|
48011
|
+
editModalWidth,
|
|
48012
|
+
cols
|
|
48013
|
+
}
|
|
48014
|
+
)
|
|
48015
|
+
] });
|
|
48016
|
+
}
|
|
48017
|
+
const parsedText = parseAll({ text, replaceValues, multiQueryData });
|
|
48018
|
+
const parsedTextWithCounter = parsedText.replace("~counter~", String(counter || 0));
|
|
48019
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
48020
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
48021
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
48022
|
+
parsedTextWithCounter,
|
|
48023
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48024
|
+
Button,
|
|
48025
|
+
{
|
|
48026
|
+
type: "text",
|
|
48027
|
+
size: "small",
|
|
48028
|
+
onClick: (e) => {
|
|
48029
|
+
e.stopPropagation();
|
|
48030
|
+
setOpen(true);
|
|
48031
|
+
},
|
|
48032
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {})
|
|
48033
|
+
}
|
|
48034
|
+
)
|
|
48035
|
+
] }),
|
|
48036
|
+
children
|
|
48037
|
+
] }),
|
|
48038
|
+
contextHolder,
|
|
48039
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48040
|
+
EditModal,
|
|
48041
|
+
{
|
|
48042
|
+
open,
|
|
48043
|
+
close: () => setOpen(false),
|
|
48044
|
+
values: tolerations,
|
|
48045
|
+
openNotificationSuccess,
|
|
48046
|
+
modalTitle: modalTitlePrepared,
|
|
48047
|
+
modalDescriptionText: modalDescriptionTextPrepared,
|
|
48048
|
+
inputLabel: inputLabelPrepared,
|
|
48049
|
+
endpoint: endpointPrepared,
|
|
48050
|
+
pathToValue: pathToValuePrepared,
|
|
48051
|
+
editModalWidth,
|
|
48052
|
+
cols
|
|
48053
|
+
}
|
|
48054
|
+
)
|
|
48055
|
+
] });
|
|
48056
|
+
};
|
|
48057
|
+
|
|
47369
48058
|
const DynamicComponents = {
|
|
47370
48059
|
DefaultDiv,
|
|
47371
48060
|
antdText: AntdText,
|
|
@@ -47395,7 +48084,9 @@ const DynamicComponents = {
|
|
|
47395
48084
|
ItemCounter,
|
|
47396
48085
|
Labels,
|
|
47397
48086
|
LabelsToSearchParams,
|
|
47398
|
-
KeyCounter
|
|
48087
|
+
KeyCounter,
|
|
48088
|
+
Taints,
|
|
48089
|
+
Tolerations
|
|
47399
48090
|
};
|
|
47400
48091
|
|
|
47401
48092
|
const prepareUrlsToFetchForDynamicRenderer = ({
|