@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.73 → 0.0.1-alpha.75
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 +191 -59
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +193 -58
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/atoms/Icons/PauseCircleIcon.d.ts +2 -0
- package/dist/types/components/atoms/Icons/ResumeCircleIcon.d.ts +2 -0
- package/dist/types/components/atoms/Icons/index.d.ts +2 -0
- package/dist/types/components/molecules/BlackholeForm/index.d.ts +1 -0
- package/dist/types/components/molecules/Terminals/NodeTerminal/NodeTerminal.d.ts +1 -0
- package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/MonacoEditor/styled.d.ts +546 -2
- package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/YamlEditorSingleton.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/utils.d.ts +8 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +11 -0
- package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +1 -0
- package/dist/types/components/organisms/DynamicRendererWithProviders/factoryConfigProvider.d.ts +9 -0
- package/package.json +1 -1
|
@@ -8388,6 +8388,30 @@ const UnlockedIcon = () => {
|
|
|
8388
8388
|
) });
|
|
8389
8389
|
};
|
|
8390
8390
|
|
|
8391
|
+
const PauseCircleIcon = () => {
|
|
8392
|
+
const { token } = theme.useToken();
|
|
8393
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "35", height: "35", viewBox: "0 0 35 35", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8394
|
+
"path",
|
|
8395
|
+
{
|
|
8396
|
+
d: "M17.5 0C7.83594 0 0 7.83594 0 17.5C0 27.1641 7.83594 35 17.5 35C27.1641 35 35 27.1641 35 17.5C35 7.83594 27.1641 0 17.5 0ZM14.375 23.4375C14.375 23.6094 14.2344 23.75 14.0625 23.75H12.1875C12.0156 23.75 11.875 23.6094 11.875 23.4375V11.5625C11.875 11.3906 12.0156 11.25 12.1875 11.25H14.0625C14.2344 11.25 14.375 11.3906 14.375 11.5625V23.4375ZM23.125 23.4375C23.125 23.6094 22.9844 23.75 22.8125 23.75H20.9375C20.7656 23.75 20.625 23.6094 20.625 23.4375V11.5625C20.625 11.3906 20.7656 11.25 20.9375 11.25H22.8125C22.9844 11.25 23.125 11.3906 23.125 11.5625V23.4375Z",
|
|
8397
|
+
fill: token.colorText,
|
|
8398
|
+
fillOpacity: "0.88"
|
|
8399
|
+
}
|
|
8400
|
+
) });
|
|
8401
|
+
};
|
|
8402
|
+
|
|
8403
|
+
const ResumeCircleIcon = () => {
|
|
8404
|
+
const { token } = theme.useToken();
|
|
8405
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "35", height: "35", viewBox: "0 0 35 35", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8406
|
+
"path",
|
|
8407
|
+
{
|
|
8408
|
+
d: "M18 0.5C8.33594 0.5 0.5 8.33594 0.5 18C0.5 27.6641 8.33594 35.5 18 35.5C27.6641 35.5 35.5 27.6641 35.5 18C35.5 8.33594 27.6641 0.5 18 0.5ZM23.6289 18.2695L15.0977 24.4766C15.0509 24.5102 14.9958 24.5302 14.9383 24.5346C14.8809 24.5389 14.8234 24.5273 14.7721 24.501C14.7208 24.4748 14.6778 24.4349 14.6477 24.3858C14.6176 24.3367 14.6017 24.2803 14.6016 24.2227V11.8164C14.6014 11.7587 14.6172 11.7021 14.6472 11.6528C14.6772 11.6035 14.7203 11.5635 14.7717 11.5372C14.8231 11.5109 14.8807 11.4994 14.9382 11.5038C14.9958 11.5083 15.051 11.5286 15.0977 11.5625L23.6289 17.7656C23.6692 17.7941 23.7021 17.8319 23.7248 17.8757C23.7475 17.9196 23.7593 17.9682 23.7593 18.0176C23.7593 18.0669 23.7475 18.1156 23.7248 18.1594C23.7021 18.2033 23.6692 18.241 23.6289 18.2695Z",
|
|
8409
|
+
fill: token.colorText,
|
|
8410
|
+
fillOpacity: "0.88"
|
|
8411
|
+
}
|
|
8412
|
+
) });
|
|
8413
|
+
};
|
|
8414
|
+
|
|
8391
8415
|
const ContentContainer = st.div`
|
|
8392
8416
|
border: 1px solid ${({ $borderColor }) => $borderColor};
|
|
8393
8417
|
border-radius: 6px;
|
|
@@ -41608,7 +41632,7 @@ const Styled$g = {
|
|
|
41608
41632
|
BigText: BigText$1
|
|
41609
41633
|
};
|
|
41610
41634
|
|
|
41611
|
-
const YamlEditorSingleton = ({
|
|
41635
|
+
const YamlEditorSingleton$1 = ({
|
|
41612
41636
|
theme: theme$1,
|
|
41613
41637
|
cluster,
|
|
41614
41638
|
prefillValuesSchema,
|
|
@@ -41636,13 +41660,14 @@ const YamlEditorSingleton = ({
|
|
|
41636
41660
|
const { namespace } = currentValues.metadata;
|
|
41637
41661
|
const { name } = currentValues.metadata;
|
|
41638
41662
|
const body = currentValues;
|
|
41639
|
-
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "
|
|
41663
|
+
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis"}/${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${typeName}/${isCreate ? "" : name}`;
|
|
41640
41664
|
if (isCreate) {
|
|
41641
41665
|
createNewEntry({ endpoint, body }).then((res) => {
|
|
41642
41666
|
console.log(res);
|
|
41643
41667
|
if (backlink) {
|
|
41644
41668
|
navigate(backlink);
|
|
41645
41669
|
}
|
|
41670
|
+
setIsLoading(false);
|
|
41646
41671
|
}).catch((error2) => {
|
|
41647
41672
|
console.log("Form submit error", error2);
|
|
41648
41673
|
setIsLoading(false);
|
|
@@ -41654,6 +41679,7 @@ const YamlEditorSingleton = ({
|
|
|
41654
41679
|
if (backlink) {
|
|
41655
41680
|
navigate(backlink);
|
|
41656
41681
|
}
|
|
41682
|
+
setIsLoading(false);
|
|
41657
41683
|
}).catch((error2) => {
|
|
41658
41684
|
console.log("Form submit error", error2);
|
|
41659
41685
|
setIsLoading(false);
|
|
@@ -43907,7 +43933,7 @@ const BlackholeFormDataProvider = ({
|
|
|
43907
43933
|
}
|
|
43908
43934
|
if (modeData?.current === "Manual") {
|
|
43909
43935
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43910
|
-
YamlEditorSingleton,
|
|
43936
|
+
YamlEditorSingleton$1,
|
|
43911
43937
|
{
|
|
43912
43938
|
theme,
|
|
43913
43939
|
cluster,
|
|
@@ -45062,7 +45088,7 @@ const PodTerminal$1 = ({ cluster, namespace, podName, containers, substractHeigh
|
|
|
45062
45088
|
}
|
|
45063
45089
|
}
|
|
45064
45090
|
) }),
|
|
45065
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space:
|
|
45091
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
|
|
45066
45092
|
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45067
45093
|
XTerminal$2,
|
|
45068
45094
|
{
|
|
@@ -45258,8 +45284,8 @@ const Styled$4 = {
|
|
|
45258
45284
|
CustomSelect: CustomSelect$2
|
|
45259
45285
|
};
|
|
45260
45286
|
|
|
45261
|
-
const NodeTerminal$1 = ({ cluster, nodeName, substractHeight }) => {
|
|
45262
|
-
const [currentProfile, setCurrentProfile] = useState("general");
|
|
45287
|
+
const NodeTerminal$1 = ({ cluster, nodeName, substractHeight, defaultProfile }) => {
|
|
45288
|
+
const [currentProfile, setCurrentProfile] = useState(defaultProfile || "general");
|
|
45263
45289
|
const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/terminalNode/terminalNode`;
|
|
45264
45290
|
const profiles = ["legacy", "general", "baseline", "netadmin", "restricted", "sysadmin"];
|
|
45265
45291
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -45274,7 +45300,7 @@ const NodeTerminal$1 = ({ cluster, nodeName, substractHeight }) => {
|
|
|
45274
45300
|
onChange: (value) => setCurrentProfile(value)
|
|
45275
45301
|
}
|
|
45276
45302
|
) }),
|
|
45277
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space:
|
|
45303
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
|
|
45278
45304
|
currentProfile && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45279
45305
|
XTerminal$1,
|
|
45280
45306
|
{
|
|
@@ -45419,7 +45445,7 @@ const PodLogs$1 = ({ cluster, namespace, podName, containers, substractHeight })
|
|
|
45419
45445
|
}
|
|
45420
45446
|
}
|
|
45421
45447
|
) }),
|
|
45422
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space:
|
|
45448
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
|
|
45423
45449
|
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45424
45450
|
XTerminal,
|
|
45425
45451
|
{
|
|
@@ -45447,15 +45473,17 @@ const CustomCard = st.div`
|
|
|
45447
45473
|
scrollbar-width: thin;
|
|
45448
45474
|
}
|
|
45449
45475
|
`;
|
|
45450
|
-
const
|
|
45451
|
-
|
|
45452
|
-
|
|
45453
|
-
|
|
45476
|
+
const VisibilityContainer = st.div`
|
|
45477
|
+
visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
|
|
45478
|
+
`;
|
|
45479
|
+
const CursorPointerDiv = st.div`
|
|
45480
|
+
cursor: pointer;
|
|
45454
45481
|
`;
|
|
45455
45482
|
const Styled$1 = {
|
|
45456
45483
|
FullWidthDiv,
|
|
45457
45484
|
CustomCard,
|
|
45458
|
-
|
|
45485
|
+
VisibilityContainer,
|
|
45486
|
+
CursorPointerDiv
|
|
45459
45487
|
};
|
|
45460
45488
|
|
|
45461
45489
|
const MonacoEditor = ({
|
|
@@ -45525,29 +45553,32 @@ const MonacoEditor = ({
|
|
|
45525
45553
|
};
|
|
45526
45554
|
}, [endpoint, namespace, podName, container, previous]);
|
|
45527
45555
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45528
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.
|
|
45529
|
-
|
|
45530
|
-
|
|
45531
|
-
|
|
45532
|
-
|
|
45533
|
-
|
|
45534
|
-
|
|
45535
|
-
|
|
45536
|
-
|
|
45537
|
-
|
|
45538
|
-
|
|
45539
|
-
|
|
45540
|
-
|
|
45541
|
-
|
|
45542
|
-
|
|
45543
|
-
|
|
45544
|
-
|
|
45545
|
-
|
|
45546
|
-
|
|
45547
|
-
|
|
45548
|
-
|
|
45549
|
-
|
|
45550
|
-
|
|
45556
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.VisibilityContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "start", align: "center", gap: 16, children: [
|
|
45557
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45558
|
+
Styled$1.CursorPointerDiv,
|
|
45559
|
+
{
|
|
45560
|
+
onClick: () => {
|
|
45561
|
+
if (isPaused) {
|
|
45562
|
+
setIsPaused(false);
|
|
45563
|
+
socketRef.current?.send(
|
|
45564
|
+
JSON.stringify({
|
|
45565
|
+
type: "continue"
|
|
45566
|
+
})
|
|
45567
|
+
);
|
|
45568
|
+
} else {
|
|
45569
|
+
setIsPaused(true);
|
|
45570
|
+
socketRef.current?.send(
|
|
45571
|
+
JSON.stringify({
|
|
45572
|
+
type: "stop"
|
|
45573
|
+
})
|
|
45574
|
+
);
|
|
45575
|
+
}
|
|
45576
|
+
},
|
|
45577
|
+
children: isPaused ? /* @__PURE__ */ jsxRuntimeExports.jsx(ResumeCircleIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(PauseCircleIcon, {})
|
|
45578
|
+
}
|
|
45579
|
+
),
|
|
45580
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isPaused ? "Not streaming events" : "Streaming events" })
|
|
45581
|
+
] }) }),
|
|
45551
45582
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
|
|
45552
45583
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45553
45584
|
Ft,
|
|
@@ -45635,7 +45666,7 @@ const PodLogsMonaco = ({
|
|
|
45635
45666
|
}
|
|
45636
45667
|
) })
|
|
45637
45668
|
] }),
|
|
45638
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space:
|
|
45669
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
|
|
45639
45670
|
currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45640
45671
|
MonacoEditor,
|
|
45641
45672
|
{
|
|
@@ -46026,7 +46057,7 @@ const useTheme = () => {
|
|
|
46026
46057
|
return useContext(ThemeContext);
|
|
46027
46058
|
};
|
|
46028
46059
|
|
|
46029
|
-
const parseMutliqueryText$
|
|
46060
|
+
const parseMutliqueryText$4 = ({ text, multiQueryData }) => {
|
|
46030
46061
|
if (!text) return "";
|
|
46031
46062
|
return text.replace(/\{reqs\[(\d+)\]\[((?:\s*['"][^'"]+['"]\s*,?)+)\]\}/g, (match, reqIndexStr, rawPath) => {
|
|
46032
46063
|
try {
|
|
@@ -46080,14 +46111,14 @@ const EnrichedTable = ({
|
|
|
46080
46111
|
replaceValues
|
|
46081
46112
|
});
|
|
46082
46113
|
const fetchUrlPrepared = prepareTemplate({
|
|
46083
|
-
template: parseMutliqueryText$
|
|
46114
|
+
template: parseMutliqueryText$4({ text: fetchUrl, multiQueryData }),
|
|
46084
46115
|
replaceValues
|
|
46085
46116
|
});
|
|
46086
46117
|
let labelsSuffix;
|
|
46087
46118
|
if (labelsSelector) {
|
|
46088
46119
|
const parsedObject = Object.fromEntries(
|
|
46089
46120
|
Object.entries(labelsSelector).map(
|
|
46090
|
-
([key, value]) => [key, prepareTemplate({ template: parseMutliqueryText$
|
|
46121
|
+
([key, value]) => [key, prepareTemplate({ template: parseMutliqueryText$4({ text: value, multiQueryData }), replaceValues })]
|
|
46091
46122
|
)
|
|
46092
46123
|
);
|
|
46093
46124
|
const serializedLabels = serializeLabels(parsedObject);
|
|
@@ -46100,7 +46131,7 @@ const EnrichedTable = ({
|
|
|
46100
46131
|
}
|
|
46101
46132
|
let fieldSelectorSuffix;
|
|
46102
46133
|
if (fieldSelector) {
|
|
46103
|
-
const preparedFieldSelectorValueText = parseMutliqueryText$
|
|
46134
|
+
const preparedFieldSelectorValueText = parseMutliqueryText$4({ text: fieldSelector?.parsedText, multiQueryData });
|
|
46104
46135
|
const preparedFieldSelectorValueTextWithPartsOfUrl = prepareTemplate({
|
|
46105
46136
|
template: preparedFieldSelectorValueText,
|
|
46106
46137
|
replaceValues
|
|
@@ -46163,7 +46194,7 @@ const EnrichedTable = ({
|
|
|
46163
46194
|
] });
|
|
46164
46195
|
};
|
|
46165
46196
|
|
|
46166
|
-
const parseMutliqueryText$
|
|
46197
|
+
const parseMutliqueryText$3 = ({ text, multiQueryData }) => {
|
|
46167
46198
|
if (!text) return "";
|
|
46168
46199
|
return text.replace(/\{reqs\[(\d+)\]\[((?:\s*['"][^'"]+['"]\s*,?)+)\]\}/g, (match, reqIndexStr, rawPath) => {
|
|
46169
46200
|
try {
|
|
@@ -46201,15 +46232,15 @@ const PodTerminal = ({
|
|
|
46201
46232
|
return acc;
|
|
46202
46233
|
}, {});
|
|
46203
46234
|
const clusterPrepared = prepareTemplate({
|
|
46204
|
-
template: parseMutliqueryText$
|
|
46235
|
+
template: parseMutliqueryText$3({ text: cluster, multiQueryData }),
|
|
46205
46236
|
replaceValues
|
|
46206
46237
|
});
|
|
46207
46238
|
const namespacePrepared = prepareTemplate({
|
|
46208
|
-
template: parseMutliqueryText$
|
|
46239
|
+
template: parseMutliqueryText$3({ text: namespace, multiQueryData }),
|
|
46209
46240
|
replaceValues
|
|
46210
46241
|
});
|
|
46211
46242
|
const podNamePrepared = prepareTemplate({
|
|
46212
|
-
template: parseMutliqueryText$
|
|
46243
|
+
template: parseMutliqueryText$3({ text: podName, multiQueryData }),
|
|
46213
46244
|
replaceValues
|
|
46214
46245
|
});
|
|
46215
46246
|
const {
|
|
@@ -46246,7 +46277,7 @@ const PodTerminal = ({
|
|
|
46246
46277
|
namespace: namespacePrepared,
|
|
46247
46278
|
podName: podNamePrepared,
|
|
46248
46279
|
containers,
|
|
46249
|
-
substractHeight: substractHeight ||
|
|
46280
|
+
substractHeight: substractHeight || 340,
|
|
46250
46281
|
...props
|
|
46251
46282
|
}
|
|
46252
46283
|
),
|
|
@@ -46254,7 +46285,11 @@ const PodTerminal = ({
|
|
|
46254
46285
|
] });
|
|
46255
46286
|
};
|
|
46256
46287
|
|
|
46257
|
-
const
|
|
46288
|
+
const factoryConfigContext = createContextFactory();
|
|
46289
|
+
const FactoryConfigContextProvider = factoryConfigContext.Provider;
|
|
46290
|
+
const useFactoryConfig = factoryConfigContext.useTypedContext;
|
|
46291
|
+
|
|
46292
|
+
const parseMutliqueryText$2 = ({ text, multiQueryData }) => {
|
|
46258
46293
|
if (!text) return "";
|
|
46259
46294
|
return text.replace(/\{reqs\[(\d+)\]\[((?:\s*['"][^'"]+['"]\s*,?)+)\]\}/g, (match, reqIndexStr, rawPath) => {
|
|
46260
46295
|
try {
|
|
@@ -46284,17 +46319,18 @@ const NodeTerminal = ({
|
|
|
46284
46319
|
substractHeight,
|
|
46285
46320
|
...props
|
|
46286
46321
|
} = data;
|
|
46322
|
+
const { nodeTerminalDefaultProfile } = useFactoryConfig();
|
|
46287
46323
|
const partsOfUrl = usePartsOfUrl();
|
|
46288
46324
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
46289
46325
|
acc[index.toString()] = value;
|
|
46290
46326
|
return acc;
|
|
46291
46327
|
}, {});
|
|
46292
46328
|
const clusterPrepared = prepareTemplate({
|
|
46293
|
-
template: parseMutliqueryText$
|
|
46329
|
+
template: parseMutliqueryText$2({ text: cluster, multiQueryData }),
|
|
46294
46330
|
replaceValues
|
|
46295
46331
|
});
|
|
46296
46332
|
const nodeNamePrepared = prepareTemplate({
|
|
46297
|
-
template: parseMutliqueryText$
|
|
46333
|
+
template: parseMutliqueryText$2({ text: nodeName, multiQueryData }),
|
|
46298
46334
|
replaceValues
|
|
46299
46335
|
});
|
|
46300
46336
|
if (isMultiqueryLoading) {
|
|
@@ -46306,7 +46342,8 @@ const NodeTerminal = ({
|
|
|
46306
46342
|
{
|
|
46307
46343
|
cluster: clusterPrepared,
|
|
46308
46344
|
nodeName: nodeNamePrepared,
|
|
46309
|
-
substractHeight: substractHeight ||
|
|
46345
|
+
substractHeight: substractHeight || 340,
|
|
46346
|
+
defaultProfile: nodeTerminalDefaultProfile,
|
|
46310
46347
|
...props
|
|
46311
46348
|
}
|
|
46312
46349
|
),
|
|
@@ -46314,7 +46351,7 @@ const NodeTerminal = ({
|
|
|
46314
46351
|
] });
|
|
46315
46352
|
};
|
|
46316
46353
|
|
|
46317
|
-
const parseMutliqueryText = ({ text, multiQueryData }) => {
|
|
46354
|
+
const parseMutliqueryText$1 = ({ text, multiQueryData }) => {
|
|
46318
46355
|
if (!text) return "";
|
|
46319
46356
|
return text.replace(/\{reqs\[(\d+)\]\[((?:\s*['"][^'"]+['"]\s*,?)+)\]\}/g, (match, reqIndexStr, rawPath) => {
|
|
46320
46357
|
try {
|
|
@@ -46353,15 +46390,15 @@ const PodLogs = ({
|
|
|
46353
46390
|
return acc;
|
|
46354
46391
|
}, {});
|
|
46355
46392
|
const clusterPrepared = prepareTemplate({
|
|
46356
|
-
template: parseMutliqueryText({ text: cluster, multiQueryData }),
|
|
46393
|
+
template: parseMutliqueryText$1({ text: cluster, multiQueryData }),
|
|
46357
46394
|
replaceValues
|
|
46358
46395
|
});
|
|
46359
46396
|
const namespacePrepared = prepareTemplate({
|
|
46360
|
-
template: parseMutliqueryText({ text: namespace, multiQueryData }),
|
|
46397
|
+
template: parseMutliqueryText$1({ text: namespace, multiQueryData }),
|
|
46361
46398
|
replaceValues
|
|
46362
46399
|
});
|
|
46363
46400
|
const podNamePrepared = prepareTemplate({
|
|
46364
|
-
template: parseMutliqueryText({ text: podName, multiQueryData }),
|
|
46401
|
+
template: parseMutliqueryText$1({ text: podName, multiQueryData }),
|
|
46365
46402
|
replaceValues
|
|
46366
46403
|
});
|
|
46367
46404
|
const {
|
|
@@ -46399,7 +46436,7 @@ const PodLogs = ({
|
|
|
46399
46436
|
podName: podNamePrepared,
|
|
46400
46437
|
containers,
|
|
46401
46438
|
theme,
|
|
46402
|
-
substractHeight: substractHeight ||
|
|
46439
|
+
substractHeight: substractHeight || 340 + 35 + 8,
|
|
46403
46440
|
rawPodInfo: podInfo,
|
|
46404
46441
|
...props
|
|
46405
46442
|
}
|
|
@@ -46408,6 +46445,100 @@ const PodLogs = ({
|
|
|
46408
46445
|
] });
|
|
46409
46446
|
};
|
|
46410
46447
|
|
|
46448
|
+
const parseMutliqueryText = ({ text, multiQueryData }) => {
|
|
46449
|
+
if (!text) return "";
|
|
46450
|
+
return text.replace(/\{reqs\[(\d+)\]\[((?:\s*['"][^'"]+['"]\s*,?)+)\]\}/g, (match, reqIndexStr, rawPath) => {
|
|
46451
|
+
try {
|
|
46452
|
+
const reqIndex = parseInt(reqIndexStr, 10);
|
|
46453
|
+
const path = Array.from(rawPath.matchAll(/['"]([^'"]+)['"]/g)).map(
|
|
46454
|
+
(m) => m[1]
|
|
46455
|
+
);
|
|
46456
|
+
const value = _$1.get(multiQueryData[`req${reqIndex}`], path);
|
|
46457
|
+
return value != null ? String(value) : "";
|
|
46458
|
+
} catch {
|
|
46459
|
+
return match;
|
|
46460
|
+
}
|
|
46461
|
+
});
|
|
46462
|
+
};
|
|
46463
|
+
|
|
46464
|
+
const YamlEditorSingleton = ({
|
|
46465
|
+
data,
|
|
46466
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46467
|
+
children
|
|
46468
|
+
}) => {
|
|
46469
|
+
const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
|
|
46470
|
+
const {
|
|
46471
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46472
|
+
id,
|
|
46473
|
+
cluster,
|
|
46474
|
+
isNameSpaced,
|
|
46475
|
+
type,
|
|
46476
|
+
apiGroup,
|
|
46477
|
+
apiVersion,
|
|
46478
|
+
typeName,
|
|
46479
|
+
prefillValuesRequestIndex,
|
|
46480
|
+
substractHeight,
|
|
46481
|
+
...props
|
|
46482
|
+
} = data;
|
|
46483
|
+
const [height, setHeight] = useState(0);
|
|
46484
|
+
useEffect(() => {
|
|
46485
|
+
const height2 = window.innerHeight - (substractHeight || 340);
|
|
46486
|
+
setHeight(height2);
|
|
46487
|
+
const handleResize = () => {
|
|
46488
|
+
setHeight(height2);
|
|
46489
|
+
};
|
|
46490
|
+
window.addEventListener("resize", handleResize);
|
|
46491
|
+
return () => {
|
|
46492
|
+
window.removeEventListener("resize", handleResize);
|
|
46493
|
+
};
|
|
46494
|
+
}, [substractHeight]);
|
|
46495
|
+
const theme = useTheme();
|
|
46496
|
+
const partsOfUrl = usePartsOfUrl();
|
|
46497
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
46498
|
+
acc[index.toString()] = value;
|
|
46499
|
+
return acc;
|
|
46500
|
+
}, {});
|
|
46501
|
+
const clusterPrepared = prepareTemplate({
|
|
46502
|
+
template: parseMutliqueryText({ text: cluster, multiQueryData }),
|
|
46503
|
+
replaceValues
|
|
46504
|
+
});
|
|
46505
|
+
const apiGroupPrepared = prepareTemplate({
|
|
46506
|
+
template: parseMutliqueryText({ text: apiGroup, multiQueryData }),
|
|
46507
|
+
replaceValues
|
|
46508
|
+
});
|
|
46509
|
+
const apiVersionPrepared = prepareTemplate({
|
|
46510
|
+
template: parseMutliqueryText({ text: apiVersion, multiQueryData }),
|
|
46511
|
+
replaceValues
|
|
46512
|
+
});
|
|
46513
|
+
const typeNamePrepared = prepareTemplate({
|
|
46514
|
+
template: parseMutliqueryText({ text: typeName, multiQueryData }),
|
|
46515
|
+
replaceValues
|
|
46516
|
+
});
|
|
46517
|
+
const prefillValues = multiQueryData[`req${prefillValuesRequestIndex}`];
|
|
46518
|
+
if (isMultiqueryLoading) {
|
|
46519
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
46520
|
+
}
|
|
46521
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
46522
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
46523
|
+
YamlEditorSingleton$1,
|
|
46524
|
+
{
|
|
46525
|
+
cluster: clusterPrepared,
|
|
46526
|
+
theme,
|
|
46527
|
+
prefillValuesSchema: prefillValues,
|
|
46528
|
+
isNameSpaced,
|
|
46529
|
+
isCreate: false,
|
|
46530
|
+
type,
|
|
46531
|
+
apiGroupApiVersion: type === "builtin" ? "api/v1" : `${apiGroupPrepared}/${apiVersionPrepared}`,
|
|
46532
|
+
typeName: typeNamePrepared,
|
|
46533
|
+
designNewLayout: true,
|
|
46534
|
+
designNewLayoutHeight: height,
|
|
46535
|
+
...props
|
|
46536
|
+
}
|
|
46537
|
+
),
|
|
46538
|
+
children
|
|
46539
|
+
] });
|
|
46540
|
+
};
|
|
46541
|
+
|
|
46411
46542
|
const DynamicComponents = {
|
|
46412
46543
|
DefaultDiv,
|
|
46413
46544
|
antdText: AntdText,
|
|
@@ -46429,7 +46560,8 @@ const DynamicComponents = {
|
|
|
46429
46560
|
EnrichedTable,
|
|
46430
46561
|
PodTerminal,
|
|
46431
46562
|
NodeTerminal,
|
|
46432
|
-
PodLogs
|
|
46563
|
+
PodLogs,
|
|
46564
|
+
YamlEditorSingleton
|
|
46433
46565
|
};
|
|
46434
46566
|
|
|
46435
46567
|
const prepareUrlsToFetchForDynamicRenderer = ({
|
|
@@ -46450,12 +46582,12 @@ const prepareUrlsToFetchForDynamicRenderer = ({
|
|
|
46450
46582
|
|
|
46451
46583
|
const DynamicRendererWithProviders = (props) => {
|
|
46452
46584
|
const location = useLocation();
|
|
46453
|
-
const { urlsToFetch, theme } = props;
|
|
46585
|
+
const { urlsToFetch, theme, nodeTerminalDefaultProfile } = props;
|
|
46454
46586
|
const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
|
|
46455
46587
|
urls: urlsToFetch,
|
|
46456
46588
|
locationPathname: location.pathname
|
|
46457
46589
|
});
|
|
46458
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) }) });
|
|
46590
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FactoryConfigContextProvider, { value: { nodeTerminalDefaultProfile }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) }) }) });
|
|
46459
46591
|
};
|
|
46460
46592
|
|
|
46461
46593
|
const isLeafNode = (value) => {
|
|
@@ -46931,5 +47063,5 @@ const useCrdData = ({
|
|
|
46931
47063
|
});
|
|
46932
47064
|
};
|
|
46933
47065
|
|
|
46934
|
-
export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, NodeTerminal$1 as NodeTerminal, PlusIcon, PodLogs$1 as PodLogs, PodLogsMonaco, PodTerminal$1 as PodTerminal, ProjectInfoCard$1 as ProjectInfoCard, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UnlockedIcon, UpIcon, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getObjectFormItemsDraft, getPrefixSubarrays, getStringByName, getSwagger, groupsToTreeData, isFlatObject, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
|
|
47066
|
+
export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, NodeTerminal$1 as NodeTerminal, PauseCircleIcon, PlusIcon, PodLogs$1 as PodLogs, PodLogsMonaco, PodTerminal$1 as PodTerminal, ProjectInfoCard$1 as ProjectInfoCard, ResumeCircleIcon, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UnlockedIcon, UpIcon, YamlEditorSingleton$1 as YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getObjectFormItemsDraft, getPrefixSubarrays, getStringByName, getSwagger, groupsToTreeData, isFlatObject, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
|
|
46935
47067
|
//# sourceMappingURL=openapi-k8s-toolkit.es.js.map
|