@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.24 → 1.4.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-PHzKotN_.mjs → index-DX9lpTFs.mjs} +316 -92
- package/dist/index-DX9lpTFs.mjs.map +1 -0
- package/dist/{index-DfXU2S4O.mjs → index-DoowX3kQ.mjs} +2 -2
- package/dist/{index-DfXU2S4O.mjs.map → index-DoowX3kQ.mjs.map} +1 -1
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +313 -89
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/AntdResult.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/Volumes.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/utils.d.ts +45 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/Volumes.d.ts +10 -0
- package/dist/types/components/organisms/DynamicComponents/types/antdComponents.d.ts +9 -1
- package/dist/types/components/organisms/DynamicComponents/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/index-PHzKotN_.mjs.map +0 -1
|
@@ -34981,13 +34981,13 @@
|
|
|
34981
34981
|
const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
|
|
34982
34982
|
const partsOfUrl = usePartsOfUrl();
|
|
34983
34983
|
const navigate = reactRouterDom.useNavigate();
|
|
34984
|
-
const { id, text, href, ...linkProps } = data;
|
|
34984
|
+
const { id, text, href, title, ...linkProps } = data;
|
|
34985
34985
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
34986
34986
|
acc[index.toString()] = value;
|
|
34987
34987
|
return acc;
|
|
34988
34988
|
}, {});
|
|
34989
34989
|
const textPrepared = parseAll({ text, replaceValues, multiQueryData });
|
|
34990
|
-
const tooltipPrepared = typeof
|
|
34990
|
+
const tooltipPrepared = typeof title === "string" ? parseAll({ text: title, replaceValues, multiQueryData }) : void 0;
|
|
34991
34991
|
const hrefPrepared = parseAll({ text: href, replaceValues, multiQueryData });
|
|
34992
34992
|
const isExternal = isExternalHref(hrefPrepared);
|
|
34993
34993
|
if (isMultiqueryLoading) {
|
|
@@ -81410,25 +81410,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81410
81410
|
}
|
|
81411
81411
|
return [getVolumeTypeMeta(volumeName, vol)];
|
|
81412
81412
|
};
|
|
81413
|
-
const
|
|
81414
|
-
{ title: "Name", dataIndex: "name", key: "name" },
|
|
81415
|
-
{ title: "Mount Path", dataIndex: "mountPath", key: "mountPath" },
|
|
81416
|
-
{ title: "Sub Path", dataIndex: "subPath", key: "subPath" },
|
|
81417
|
-
{ title: "Type", dataIndex: "typeName", key: "typeName" },
|
|
81418
|
-
{ title: "Access", dataIndex: "access", key: "access" },
|
|
81419
|
-
{ title: "Utilized by", dataIndex: "containerName", key: "containerName" }
|
|
81420
|
-
// { title: 'Type', dataIndex: 'typeResource', key: 'typeResource' },
|
|
81421
|
-
];
|
|
81422
|
-
const undefinedValues = [
|
|
81423
|
-
{ key: "name", value: "-" },
|
|
81424
|
-
{ key: "mountPath", value: "-" },
|
|
81425
|
-
{ key: "subPath", value: "-" },
|
|
81426
|
-
{ key: "typeName", value: "-" },
|
|
81427
|
-
{ key: "access", value: "-" },
|
|
81428
|
-
{ key: "containerName", value: "-" }
|
|
81429
|
-
];
|
|
81430
|
-
const withUndefinedFallback = (value, fallback = "-") => value === void 0 || value === null || value === "" ? fallback : value;
|
|
81431
|
-
const customColumns = {
|
|
81413
|
+
const buildCustomColumns = (containerFactoryKey) => ({
|
|
81432
81414
|
mountPath: {
|
|
81433
81415
|
type: "factory",
|
|
81434
81416
|
customProps: {
|
|
@@ -81471,52 +81453,20 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81471
81453
|
type: "VisibilityContainer",
|
|
81472
81454
|
data: {
|
|
81473
81455
|
id: "typeName-link-visible",
|
|
81474
|
-
value: "{reqsJsonPath[0]['.
|
|
81475
|
-
criteria: "
|
|
81476
|
-
valueToCompare: ["
|
|
81456
|
+
value: "{reqsJsonPath[0]['.typeHref']['']}",
|
|
81457
|
+
criteria: "notEquals",
|
|
81458
|
+
valueToCompare: [""]
|
|
81477
81459
|
},
|
|
81478
81460
|
children: [
|
|
81479
81461
|
{
|
|
81480
|
-
type: "
|
|
81462
|
+
type: "antdLink",
|
|
81481
81463
|
data: {
|
|
81482
|
-
|
|
81483
|
-
|
|
81484
|
-
|
|
81485
|
-
|
|
81486
|
-
|
|
81487
|
-
|
|
81488
|
-
{
|
|
81489
|
-
type: "antdLink",
|
|
81490
|
-
data: {
|
|
81491
|
-
href: "/openapi-ui/{2}/{3}/factory/configmap-details/v1/configmaps/{reqsJsonPath[0]['.typeName']['-']}",
|
|
81492
|
-
id: "typeName-link",
|
|
81493
|
-
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81494
|
-
title: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81495
|
-
style: ellipsisStyle
|
|
81496
|
-
}
|
|
81497
|
-
}
|
|
81498
|
-
]
|
|
81499
|
-
},
|
|
81500
|
-
{
|
|
81501
|
-
type: "VisibilityContainer",
|
|
81502
|
-
data: {
|
|
81503
|
-
id: "typeName-secret-link-visible",
|
|
81504
|
-
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81505
|
-
criteria: "equals",
|
|
81506
|
-
valueToCompare: ["secret"]
|
|
81507
|
-
},
|
|
81508
|
-
children: [
|
|
81509
|
-
{
|
|
81510
|
-
type: "antdLink",
|
|
81511
|
-
data: {
|
|
81512
|
-
href: "/openapi-ui/{2}/{3}/factory/secret-details/v1/secrets/{reqsJsonPath[0]['.typeName']['-']}",
|
|
81513
|
-
id: "typeName-secret-link",
|
|
81514
|
-
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81515
|
-
title: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81516
|
-
style: ellipsisStyle
|
|
81517
|
-
}
|
|
81518
|
-
}
|
|
81519
|
-
]
|
|
81464
|
+
href: "{reqsJsonPath[0]['.typeHref']['']}",
|
|
81465
|
+
id: "typeName-link",
|
|
81466
|
+
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81467
|
+
title: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81468
|
+
style: ellipsisStyle
|
|
81469
|
+
}
|
|
81520
81470
|
}
|
|
81521
81471
|
]
|
|
81522
81472
|
},
|
|
@@ -81524,9 +81474,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81524
81474
|
type: "VisibilityContainer",
|
|
81525
81475
|
data: {
|
|
81526
81476
|
id: "typeName-text-visible",
|
|
81527
|
-
value: "{reqsJsonPath[0]['.
|
|
81528
|
-
criteria: "
|
|
81529
|
-
valueToCompare: ["
|
|
81477
|
+
value: "{reqsJsonPath[0]['.typeHref']['']}",
|
|
81478
|
+
criteria: "equals",
|
|
81479
|
+
valueToCompare: [""]
|
|
81530
81480
|
},
|
|
81531
81481
|
children: [
|
|
81532
81482
|
{
|
|
@@ -81567,13 +81517,18 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81567
81517
|
}
|
|
81568
81518
|
},
|
|
81569
81519
|
{
|
|
81570
|
-
type: "antdLink",
|
|
81571
|
-
data: {
|
|
81572
|
-
href:
|
|
81520
|
+
type: containerFactoryKey ? "antdLink" : "parsedText",
|
|
81521
|
+
data: containerFactoryKey ? {
|
|
81522
|
+
href: `/openapi-ui/{2}/{3}/factory/${containerFactoryKey}/v1/containers/{reqsJsonPath[0]['.podName']['-']}/{reqsJsonPath[0]['.containerName']['-']}`,
|
|
81573
81523
|
id: "container-link",
|
|
81574
81524
|
text: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81575
81525
|
title: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81576
81526
|
style: ellipsisStyle
|
|
81527
|
+
} : {
|
|
81528
|
+
id: "container-text",
|
|
81529
|
+
text: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81530
|
+
tooltip: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81531
|
+
style: ellipsisStyle
|
|
81577
81532
|
}
|
|
81578
81533
|
}
|
|
81579
81534
|
]
|
|
@@ -81581,19 +81536,145 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81581
81536
|
]
|
|
81582
81537
|
}
|
|
81583
81538
|
}
|
|
81539
|
+
});
|
|
81540
|
+
const isLinkableVolumeTypeKey = (typeKey) => typeKey === "configMap" || typeKey === "secret";
|
|
81541
|
+
const isPendingLinkSegment = (value) => !value || value.includes("...") || value.includes("{") || value.includes("}");
|
|
81542
|
+
const getVolumeFactoryKey = ({
|
|
81543
|
+
apiGroup,
|
|
81544
|
+
apiVersion,
|
|
81545
|
+
resource,
|
|
81546
|
+
namespace,
|
|
81547
|
+
baseFactoriesMapping,
|
|
81548
|
+
baseFactoryNamespacedAPIKey,
|
|
81549
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81550
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81551
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
81552
|
+
}) => {
|
|
81553
|
+
if (namespace) {
|
|
81554
|
+
if (apiGroup) {
|
|
81555
|
+
const forcedMapping3 = baseFactoriesMapping?.[`${baseFactoryNamespacedAPIKey}-${apiGroup}-${apiVersion}-${resource}`];
|
|
81556
|
+
return forcedMapping3 || baseFactoryNamespacedAPIKey || "";
|
|
81557
|
+
}
|
|
81558
|
+
const forcedMapping2 = baseFactoriesMapping?.[`${baseFactoryNamespacedBuiltinKey}-${apiVersion}-${resource}`];
|
|
81559
|
+
return forcedMapping2 || baseFactoryNamespacedBuiltinKey || "";
|
|
81560
|
+
}
|
|
81561
|
+
if (apiGroup) {
|
|
81562
|
+
const forcedMapping2 = baseFactoriesMapping?.[`${baseFactoryClusterSceopedAPIKey}-${apiGroup}-${apiVersion}-${resource}`];
|
|
81563
|
+
return forcedMapping2 || baseFactoryClusterSceopedAPIKey || "";
|
|
81564
|
+
}
|
|
81565
|
+
const forcedMapping = baseFactoriesMapping?.[`${baseFactoryClusterSceopedBuiltinKey}-${apiVersion}-${resource}`];
|
|
81566
|
+
return forcedMapping || baseFactoryClusterSceopedBuiltinKey || "";
|
|
81584
81567
|
};
|
|
81568
|
+
const getVolumeResourceLinkPrefix = ({
|
|
81569
|
+
baseprefix,
|
|
81570
|
+
cluster,
|
|
81571
|
+
namespace,
|
|
81572
|
+
apiGroupVersion,
|
|
81573
|
+
pluralName,
|
|
81574
|
+
baseFactoryNamespacedAPIKey,
|
|
81575
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81576
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81577
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
81578
|
+
baseFactoriesMapping
|
|
81579
|
+
}) => {
|
|
81580
|
+
const { apiGroup, apiVersion } = parseApiVersion$1(apiGroupVersion);
|
|
81581
|
+
return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${getVolumeFactoryKey({
|
|
81582
|
+
apiGroup,
|
|
81583
|
+
apiVersion,
|
|
81584
|
+
resource: pluralName,
|
|
81585
|
+
namespace,
|
|
81586
|
+
baseFactoriesMapping,
|
|
81587
|
+
baseFactoryNamespacedAPIKey,
|
|
81588
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81589
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81590
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
81591
|
+
})}/${apiGroupVersion}/${pluralName}`;
|
|
81592
|
+
};
|
|
81593
|
+
const getVolumeTypeHref = ({
|
|
81594
|
+
typeKey,
|
|
81595
|
+
typeName,
|
|
81596
|
+
resourceLinkPrefixes
|
|
81597
|
+
}) => {
|
|
81598
|
+
if (!isLinkableVolumeTypeKey(typeKey)) {
|
|
81599
|
+
return "";
|
|
81600
|
+
}
|
|
81601
|
+
const resourceLinkPrefix = resourceLinkPrefixes?.[typeKey];
|
|
81602
|
+
return resourceLinkPrefix ? `${resourceLinkPrefix}/${typeName}` : "";
|
|
81603
|
+
};
|
|
81604
|
+
|
|
81605
|
+
const columns = [
|
|
81606
|
+
{ title: "Name", dataIndex: "name", key: "name" },
|
|
81607
|
+
{ title: "Mount Path", dataIndex: "mountPath", key: "mountPath" },
|
|
81608
|
+
{ title: "Sub Path", dataIndex: "subPath", key: "subPath" },
|
|
81609
|
+
{ title: "Type", dataIndex: "typeName", key: "typeName" },
|
|
81610
|
+
{ title: "Access", dataIndex: "access", key: "access" },
|
|
81611
|
+
{ title: "Utilized by", dataIndex: "containerName", key: "containerName" }
|
|
81612
|
+
// { title: 'Type', dataIndex: 'typeResource', key: 'typeResource' },
|
|
81613
|
+
];
|
|
81614
|
+
const undefinedValues = [
|
|
81615
|
+
{ key: "name", value: "-" },
|
|
81616
|
+
{ key: "mountPath", value: "-" },
|
|
81617
|
+
{ key: "subPath", value: "-" },
|
|
81618
|
+
{ key: "typeName", value: "-" },
|
|
81619
|
+
{ key: "access", value: "-" },
|
|
81620
|
+
{ key: "containerName", value: "-" }
|
|
81621
|
+
];
|
|
81622
|
+
const withUndefinedFallback = (value, fallback = "-") => value === void 0 || value === null || value === "" ? fallback : value;
|
|
81585
81623
|
const Volumes = ({ data, children }) => {
|
|
81586
|
-
const {
|
|
81624
|
+
const {
|
|
81625
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81626
|
+
id,
|
|
81627
|
+
baseprefix,
|
|
81628
|
+
cluster,
|
|
81629
|
+
reqIndex,
|
|
81630
|
+
jsonPathToSpec,
|
|
81631
|
+
jsonPathToPodName,
|
|
81632
|
+
forcedNamespace,
|
|
81633
|
+
errorText,
|
|
81634
|
+
containerStyle,
|
|
81635
|
+
baseFactoryNamespacedAPIKey,
|
|
81636
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81637
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81638
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
81639
|
+
baseNavigationPluralName,
|
|
81640
|
+
baseNavigationSpecificName,
|
|
81641
|
+
containerFactoryKey
|
|
81642
|
+
} = data;
|
|
81587
81643
|
const theme = useTheme();
|
|
81644
|
+
const partsOfUrl = usePartsOfUrl();
|
|
81588
81645
|
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
81589
|
-
const
|
|
81646
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
81647
|
+
acc[index.toString()] = value;
|
|
81648
|
+
return acc;
|
|
81649
|
+
}, {});
|
|
81650
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
81651
|
+
const forcedNamespacePrepared = forcedNamespace ? parseAll({
|
|
81652
|
+
text: forcedNamespace,
|
|
81653
|
+
replaceValues,
|
|
81654
|
+
multiQueryData
|
|
81655
|
+
}) : void 0;
|
|
81656
|
+
const {
|
|
81657
|
+
data: navigationDataArr,
|
|
81658
|
+
isLoading: isNavigationLoading,
|
|
81659
|
+
isError: isNavigationError
|
|
81660
|
+
} = useK8sSmartResource({
|
|
81661
|
+
cluster: clusterPrepared,
|
|
81662
|
+
apiGroup: "front.in-cloud.io",
|
|
81663
|
+
apiVersion: "v1alpha1",
|
|
81664
|
+
plural: baseNavigationPluralName,
|
|
81665
|
+
fieldSelector: `metadata.name=${baseNavigationSpecificName}`
|
|
81666
|
+
});
|
|
81667
|
+
const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
|
|
81668
|
+
const customColumns = React$1.useMemo(() => buildCustomColumns(containerFactoryKey), [containerFactoryKey]);
|
|
81669
|
+
const dataSourceWithoutHref = React$1.useMemo(() => {
|
|
81590
81670
|
if (isMultiQueryLoading || isMultiQueryErrors || !multiQueryData) return [];
|
|
81591
81671
|
const jsonRoot2 = multiQueryData[`req${reqIndex}`];
|
|
81592
81672
|
if (jsonRoot2 === void 0) return [];
|
|
81593
81673
|
const specResult = jp.query(jsonRoot2 || {}, `$${jsonPathToSpec}`);
|
|
81594
81674
|
const spec = specResult?.[0];
|
|
81595
81675
|
if (!spec) return [];
|
|
81596
|
-
const
|
|
81676
|
+
const fallbackNamespace = jsonRoot2?.metadata?.namespace || spec?.metadata?.namespace || "";
|
|
81677
|
+
const effectiveNamespace = forcedNamespacePrepared || fallbackNamespace;
|
|
81597
81678
|
const podNameFromPath = jsonPathToPodName ? jp.query(jsonRoot2 || {}, `$${jsonPathToPodName}`)?.[0] : void 0;
|
|
81598
81679
|
const podName = podNameFromPath || jsonRoot2?.metadata?.name || spec?.metadata?.name || "-";
|
|
81599
81680
|
const containers = Array.isArray(spec.containers) ? spec.containers : [];
|
|
@@ -81605,23 +81686,113 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81605
81686
|
return containers.flatMap((container, cIdx) => {
|
|
81606
81687
|
const mounts = Array.isArray(container.volumeMounts) ? container.volumeMounts : [];
|
|
81607
81688
|
return mounts.flatMap(
|
|
81608
|
-
(mount, mIdx) => getVolumeTypeMetas(mount.name, volumesMap).map((typeMeta, typeIdx) =>
|
|
81609
|
-
|
|
81610
|
-
|
|
81611
|
-
|
|
81612
|
-
|
|
81613
|
-
|
|
81614
|
-
|
|
81615
|
-
|
|
81616
|
-
|
|
81617
|
-
|
|
81618
|
-
|
|
81619
|
-
|
|
81620
|
-
|
|
81689
|
+
(mount, mIdx) => getVolumeTypeMetas(mount.name, volumesMap).map((typeMeta, typeIdx) => {
|
|
81690
|
+
const typeName = String(withUndefinedFallback(typeMeta.typeName));
|
|
81691
|
+
return {
|
|
81692
|
+
...typeMeta,
|
|
81693
|
+
...mount,
|
|
81694
|
+
name: String(withUndefinedFallback(mount.name)),
|
|
81695
|
+
mountPath: String(withUndefinedFallback(mount.mountPath)),
|
|
81696
|
+
subPath: String(withUndefinedFallback(mount.subPath)),
|
|
81697
|
+
typeName,
|
|
81698
|
+
containerName: String(withUndefinedFallback(container.name || `container-${cIdx}`)),
|
|
81699
|
+
podName: String(podName),
|
|
81700
|
+
namespace: String(effectiveNamespace),
|
|
81701
|
+
access: String(withUndefinedFallback(mount.readOnly ? "RO" : "RW")),
|
|
81702
|
+
key: `${cIdx}-${mIdx}-${typeIdx}`
|
|
81703
|
+
};
|
|
81704
|
+
})
|
|
81621
81705
|
);
|
|
81622
81706
|
});
|
|
81623
|
-
}, [
|
|
81624
|
-
|
|
81707
|
+
}, [
|
|
81708
|
+
multiQueryData,
|
|
81709
|
+
isMultiQueryLoading,
|
|
81710
|
+
isMultiQueryErrors,
|
|
81711
|
+
reqIndex,
|
|
81712
|
+
jsonPathToSpec,
|
|
81713
|
+
jsonPathToPodName,
|
|
81714
|
+
forcedNamespacePrepared
|
|
81715
|
+
]);
|
|
81716
|
+
const hasLinkableVolumeTypes = dataSourceWithoutHref.some(({ typeKey }) => isLinkableVolumeTypeKey(typeKey));
|
|
81717
|
+
const linkableNamespace = dataSourceWithoutHref.find(({ typeKey }) => isLinkableVolumeTypeKey(typeKey))?.namespace;
|
|
81718
|
+
const configMapFactoryKey = hasLinkableVolumeTypes && !isNavigationLoading && !isNavigationError ? getVolumeFactoryKey({
|
|
81719
|
+
apiGroup: void 0,
|
|
81720
|
+
apiVersion: "v1",
|
|
81721
|
+
resource: "configmaps",
|
|
81722
|
+
namespace: linkableNamespace,
|
|
81723
|
+
baseFactoriesMapping,
|
|
81724
|
+
baseFactoryNamespacedAPIKey,
|
|
81725
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81726
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81727
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
81728
|
+
}) : void 0;
|
|
81729
|
+
const secretFactoryKey = hasLinkableVolumeTypes && !isNavigationLoading && !isNavigationError ? getVolumeFactoryKey({
|
|
81730
|
+
apiGroup: void 0,
|
|
81731
|
+
apiVersion: "v1",
|
|
81732
|
+
resource: "secrets",
|
|
81733
|
+
namespace: linkableNamespace,
|
|
81734
|
+
baseFactoriesMapping,
|
|
81735
|
+
baseFactoryNamespacedAPIKey,
|
|
81736
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81737
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81738
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
81739
|
+
}) : void 0;
|
|
81740
|
+
const hasPendingLinkPrefixInputs = hasLinkableVolumeTypes && (isPendingLinkSegment(clusterPrepared) || isPendingLinkSegment(linkableNamespace) || isPendingLinkSegment(configMapFactoryKey) || isPendingLinkSegment(secretFactoryKey));
|
|
81741
|
+
const isLinkPrefixLoading = hasLinkableVolumeTypes && !isMultiQueryErrors && !isNavigationError && (isNavigationLoading || hasPendingLinkPrefixInputs);
|
|
81742
|
+
const resourceLinkPrefixes = React$1.useMemo(() => {
|
|
81743
|
+
if (!hasLinkableVolumeTypes || isLinkPrefixLoading) {
|
|
81744
|
+
return void 0;
|
|
81745
|
+
}
|
|
81746
|
+
return {
|
|
81747
|
+
configMap: getVolumeResourceLinkPrefix({
|
|
81748
|
+
baseprefix,
|
|
81749
|
+
cluster: clusterPrepared,
|
|
81750
|
+
namespace: linkableNamespace,
|
|
81751
|
+
apiGroupVersion: "v1",
|
|
81752
|
+
pluralName: "configmaps",
|
|
81753
|
+
baseFactoryNamespacedAPIKey,
|
|
81754
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81755
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81756
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
81757
|
+
baseFactoriesMapping
|
|
81758
|
+
}) || "",
|
|
81759
|
+
secret: getVolumeResourceLinkPrefix({
|
|
81760
|
+
baseprefix,
|
|
81761
|
+
cluster: clusterPrepared,
|
|
81762
|
+
namespace: linkableNamespace,
|
|
81763
|
+
apiGroupVersion: "v1",
|
|
81764
|
+
pluralName: "secrets",
|
|
81765
|
+
baseFactoryNamespacedAPIKey,
|
|
81766
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81767
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81768
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
81769
|
+
baseFactoriesMapping
|
|
81770
|
+
}) || ""
|
|
81771
|
+
};
|
|
81772
|
+
}, [
|
|
81773
|
+
hasLinkableVolumeTypes,
|
|
81774
|
+
isLinkPrefixLoading,
|
|
81775
|
+
baseprefix,
|
|
81776
|
+
clusterPrepared,
|
|
81777
|
+
linkableNamespace,
|
|
81778
|
+
baseFactoryNamespacedAPIKey,
|
|
81779
|
+
baseFactoryClusterSceopedAPIKey,
|
|
81780
|
+
baseFactoryNamespacedBuiltinKey,
|
|
81781
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
81782
|
+
baseFactoriesMapping
|
|
81783
|
+
]);
|
|
81784
|
+
const dataSource = React$1.useMemo(
|
|
81785
|
+
() => dataSourceWithoutHref.map((row) => ({
|
|
81786
|
+
...row,
|
|
81787
|
+
typeHref: getVolumeTypeHref({
|
|
81788
|
+
typeKey: row.typeKey,
|
|
81789
|
+
typeName: row.typeName,
|
|
81790
|
+
resourceLinkPrefixes
|
|
81791
|
+
})
|
|
81792
|
+
})),
|
|
81793
|
+
[dataSourceWithoutHref, resourceLinkPrefixes]
|
|
81794
|
+
);
|
|
81795
|
+
if (isMultiQueryLoading || isLinkPrefixLoading) {
|
|
81625
81796
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
81626
81797
|
}
|
|
81627
81798
|
if (isMultiQueryErrors) {
|
|
@@ -81651,6 +81822,47 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81651
81822
|
] });
|
|
81652
81823
|
};
|
|
81653
81824
|
|
|
81825
|
+
const httpStatusToResultStatus = (statusCode) => {
|
|
81826
|
+
if (statusCode === 403) return "403";
|
|
81827
|
+
if (statusCode === 404) return "404";
|
|
81828
|
+
if (statusCode && statusCode >= 500) return "500";
|
|
81829
|
+
return "error";
|
|
81830
|
+
};
|
|
81831
|
+
const getDefaultTitle = (status) => {
|
|
81832
|
+
if (status === "403") return "Access Denied";
|
|
81833
|
+
if (status === "404") return "Not Found";
|
|
81834
|
+
if (status === "500") return "Server Error";
|
|
81835
|
+
return "Error";
|
|
81836
|
+
};
|
|
81837
|
+
const AntdResult = ({ data, children }) => {
|
|
81838
|
+
const { data: multiQueryData, isLoading, errors } = useMultiQuery();
|
|
81839
|
+
const partsOfUrl = usePartsOfUrl();
|
|
81840
|
+
if (isLoading) {
|
|
81841
|
+
return null;
|
|
81842
|
+
}
|
|
81843
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
81844
|
+
acc[index.toString()] = value;
|
|
81845
|
+
return acc;
|
|
81846
|
+
}, {});
|
|
81847
|
+
if (typeof data.reqIndex === "number") {
|
|
81848
|
+
const error = errors[data.reqIndex];
|
|
81849
|
+
if (!error) {
|
|
81850
|
+
return children ?? null;
|
|
81851
|
+
}
|
|
81852
|
+
const errorObj = error;
|
|
81853
|
+
const httpStatus = errorObj?.response?.status;
|
|
81854
|
+
const autoStatus = httpStatusToResultStatus(httpStatus);
|
|
81855
|
+
const autoMessage = errorObj?.response?.statusText || errorObj?.message || String(error);
|
|
81856
|
+
const status = data.status ?? autoStatus;
|
|
81857
|
+
const title = data.title ? parseAll({ text: data.title, replaceValues, multiQueryData }) : getDefaultTitle(status);
|
|
81858
|
+
const subTitle = data.subTitle ? parseAll({ text: data.subTitle, replaceValues, multiQueryData }) : autoMessage;
|
|
81859
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status, title, subTitle, style: data.style, children });
|
|
81860
|
+
}
|
|
81861
|
+
const parsedTitle = data.title ? parseAll({ text: data.title, replaceValues, multiQueryData }) : void 0;
|
|
81862
|
+
const parsedSubTitle = data.subTitle ? parseAll({ text: data.subTitle, replaceValues, multiQueryData }) : void 0;
|
|
81863
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: data.status, title: parsedTitle, subTitle: parsedSubTitle, style: data.style, children });
|
|
81864
|
+
};
|
|
81865
|
+
|
|
81654
81866
|
const DynamicComponents = {
|
|
81655
81867
|
DefaultDiv,
|
|
81656
81868
|
antdText: AntdText,
|
|
@@ -81662,6 +81874,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81662
81874
|
antdTabs: AntdTabs,
|
|
81663
81875
|
antdButton: AntdButton,
|
|
81664
81876
|
antdIcons: AntdIcons,
|
|
81877
|
+
antdResult: AntdResult,
|
|
81665
81878
|
partsOfUrl: PartsOfUrl,
|
|
81666
81879
|
multiQuery: MultiQuery,
|
|
81667
81880
|
parsedText: ParsedText,
|
|
@@ -85773,6 +85986,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85773
85986
|
designNewLayoutHeight
|
|
85774
85987
|
}) => {
|
|
85775
85988
|
const { token } = antd.theme.useToken();
|
|
85989
|
+
const { notification: notificationApi } = antd.App.useApp();
|
|
85776
85990
|
const navigate = reactRouterDom.useNavigate();
|
|
85777
85991
|
const [form] = antd.Form.useForm();
|
|
85778
85992
|
const allValues = antd.Form.useWatch([], form);
|
|
@@ -85887,7 +86101,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85887
86101
|
const body = data;
|
|
85888
86102
|
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${plural}/${isCreate ? "" : name}`;
|
|
85889
86103
|
if (isCreate) {
|
|
85890
|
-
createNewEntry({ endpoint, body }).then(() => {
|
|
86104
|
+
createNewEntry({ endpoint, body }).then((res) => {
|
|
86105
|
+
const resName = res.data?.metadata?.name || name;
|
|
86106
|
+
notificationApi.success({
|
|
86107
|
+
message: `${kind} "${resName}" created successfully`,
|
|
86108
|
+
placement: "bottomRight"
|
|
86109
|
+
});
|
|
85891
86110
|
if (resolvedBacklink) {
|
|
85892
86111
|
navigate(resolvedBacklink);
|
|
85893
86112
|
}
|
|
@@ -85901,7 +86120,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85901
86120
|
setError(error2);
|
|
85902
86121
|
});
|
|
85903
86122
|
} else {
|
|
85904
|
-
updateEntry({ endpoint, body }).then(() => {
|
|
86123
|
+
updateEntry({ endpoint, body }).then((res) => {
|
|
86124
|
+
const resName = res.data?.metadata?.name || name;
|
|
86125
|
+
notificationApi.success({
|
|
86126
|
+
message: `${kind} "${resName}" updated successfully`,
|
|
86127
|
+
placement: "bottomRight"
|
|
86128
|
+
});
|
|
85905
86129
|
if (resolvedBacklink) {
|
|
85906
86130
|
navigate(resolvedBacklink);
|
|
85907
86131
|
}
|