@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.23 → 1.4.0-alpha.25
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-C3GT20Hj.mjs → index-C4_frU1l.mjs} +299 -80
- package/dist/index-C4_frU1l.mjs.map +1 -0
- package/dist/{index-oRwnOGcM.mjs → index-CVmBLq_Q.mjs} +2 -2
- package/dist/{index-oRwnOGcM.mjs.map → index-CVmBLq_Q.mjs.map} +1 -1
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +296 -77
- 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/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/Volumes.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/antdComponents.d.ts +8 -1
- package/dist/types/components/organisms/DynamicComponents/types/index.d.ts +2 -1
- package/dist/types/components/organisms/DynamicComponents/types/parsedText.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-C3GT20Hj.mjs.map +0 -1
|
@@ -34880,41 +34880,6 @@
|
|
|
34880
34880
|
};
|
|
34881
34881
|
|
|
34882
34882
|
const MultiQueryContext = React$1.createContext(void 0);
|
|
34883
|
-
const makeEmptyEntry = () => ({
|
|
34884
|
-
data: void 0,
|
|
34885
|
-
isLoading: false,
|
|
34886
|
-
isError: false,
|
|
34887
|
-
error: null
|
|
34888
|
-
});
|
|
34889
|
-
const aggReducer = (state, action) => {
|
|
34890
|
-
switch (action.type) {
|
|
34891
|
-
case "RESET":
|
|
34892
|
-
return { entries: Array.from({ length: action.total }, makeEmptyEntry) };
|
|
34893
|
-
case "SET_ENTRY": {
|
|
34894
|
-
const entries = state.entries.slice();
|
|
34895
|
-
entries[action.index] = action.entry;
|
|
34896
|
-
return { entries };
|
|
34897
|
-
}
|
|
34898
|
-
default:
|
|
34899
|
-
return state;
|
|
34900
|
-
}
|
|
34901
|
-
};
|
|
34902
|
-
const K8sFetcher = ({ index, params, dispatch }) => {
|
|
34903
|
-
const res = useK8sSmartResource(params);
|
|
34904
|
-
React$1.useEffect(() => {
|
|
34905
|
-
dispatch({
|
|
34906
|
-
type: "SET_ENTRY",
|
|
34907
|
-
index,
|
|
34908
|
-
entry: {
|
|
34909
|
-
data: res.data,
|
|
34910
|
-
isLoading: res.isLoading,
|
|
34911
|
-
isError: res.isError,
|
|
34912
|
-
error: res.error ?? null
|
|
34913
|
-
}
|
|
34914
|
-
});
|
|
34915
|
-
}, [index, res.data, res.isLoading, res.isError, res.error, dispatch]);
|
|
34916
|
-
return null;
|
|
34917
|
-
};
|
|
34918
34883
|
const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
34919
34884
|
const k8sItems = React$1.useMemo(
|
|
34920
34885
|
() => items.filter((x) => typeof x !== "string"),
|
|
@@ -34923,10 +34888,7 @@
|
|
|
34923
34888
|
const urlItems = React$1.useMemo(() => items.filter((x) => typeof x === "string"), [items]);
|
|
34924
34889
|
const k8sCount = k8sItems.length;
|
|
34925
34890
|
const urlCount = urlItems.length;
|
|
34926
|
-
const
|
|
34927
|
-
React$1.useEffect(() => {
|
|
34928
|
-
dispatch({ type: "RESET", total: k8sCount });
|
|
34929
|
-
}, [k8sCount]);
|
|
34891
|
+
const k8sResults = useManyK8sSmartResource(k8sItems);
|
|
34930
34892
|
const urlQueries = reactQuery.useQueries({
|
|
34931
34893
|
queries: urlItems.map((url, i) => ({
|
|
34932
34894
|
queryKey: ["multi-url", i, url],
|
|
@@ -34944,10 +34906,10 @@
|
|
|
34944
34906
|
const hasExtraReq0 = typeof dataToApplyToContext !== "undefined";
|
|
34945
34907
|
const baseIndex = hasExtraReq0 ? 1 : 0;
|
|
34946
34908
|
for (let i = 0; i < k8sCount; i++) {
|
|
34947
|
-
const
|
|
34909
|
+
const result = k8sResults[i];
|
|
34948
34910
|
const idx = baseIndex + i;
|
|
34949
|
-
data[`req${idx}`] =
|
|
34950
|
-
errors[idx] =
|
|
34911
|
+
data[`req${idx}`] = result?.data;
|
|
34912
|
+
errors[idx] = result?.isError ? result.error ?? null : null;
|
|
34951
34913
|
}
|
|
34952
34914
|
for (let i = 0; i < urlCount; i++) {
|
|
34953
34915
|
const q = urlQueries[i];
|
|
@@ -34959,17 +34921,11 @@
|
|
|
34959
34921
|
data.req0 = dataToApplyToContext;
|
|
34960
34922
|
errors[0] = null;
|
|
34961
34923
|
}
|
|
34962
|
-
const isLoading =
|
|
34963
|
-
const isError =
|
|
34924
|
+
const isLoading = k8sResults.some((r) => r.isLoading) || urlQueries.some((q) => q.isLoading);
|
|
34925
|
+
const isError = k8sResults.some((r) => r.isError) || urlQueries.some((q) => q.isError);
|
|
34964
34926
|
return { data, isLoading, isError, errors };
|
|
34965
34927
|
})();
|
|
34966
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
34967
|
-
k8sItems.map((params, i) => (
|
|
34968
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
34969
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(K8sFetcher, { index: i, params, dispatch }, i)
|
|
34970
|
-
)),
|
|
34971
|
-
children
|
|
34972
|
-
] });
|
|
34928
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryContext.Provider, { value, children });
|
|
34973
34929
|
};
|
|
34974
34930
|
const useMultiQuery = () => {
|
|
34975
34931
|
const ctx = React$1.useContext(MultiQueryContext);
|
|
@@ -35031,12 +34987,13 @@
|
|
|
35031
34987
|
return acc;
|
|
35032
34988
|
}, {});
|
|
35033
34989
|
const textPrepared = parseAll({ text, replaceValues, multiQueryData });
|
|
34990
|
+
const tooltipPrepared = typeof linkProps.title === "string" ? parseAll({ text: linkProps.title, replaceValues, multiQueryData }) : void 0;
|
|
35034
34991
|
const hrefPrepared = parseAll({ text: href, replaceValues, multiQueryData });
|
|
35035
34992
|
const isExternal = isExternalHref(hrefPrepared);
|
|
35036
34993
|
if (isMultiqueryLoading) {
|
|
35037
34994
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
35038
34995
|
}
|
|
35039
|
-
|
|
34996
|
+
const content = /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35040
34997
|
antd.Typography.Link,
|
|
35041
34998
|
{
|
|
35042
34999
|
href: hrefPrepared,
|
|
@@ -35054,6 +35011,10 @@
|
|
|
35054
35011
|
]
|
|
35055
35012
|
}
|
|
35056
35013
|
);
|
|
35014
|
+
if (tooltipPrepared) {
|
|
35015
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: tooltipPrepared, children: content });
|
|
35016
|
+
}
|
|
35017
|
+
return content;
|
|
35057
35018
|
};
|
|
35058
35019
|
|
|
35059
35020
|
const AntdCard = ({
|
|
@@ -35298,8 +35259,13 @@
|
|
|
35298
35259
|
return acc;
|
|
35299
35260
|
}, {});
|
|
35300
35261
|
const parsedText = parseAll({ text: data.text, replaceValues, multiQueryData });
|
|
35262
|
+
const parsedTooltip = data.tooltip ? parseAll({ text: data.tooltip, replaceValues, multiQueryData }) : void 0;
|
|
35301
35263
|
const formattedText = data.formatter ? formatLocalDate(parsedText) : parsedText;
|
|
35302
|
-
|
|
35264
|
+
const content = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: data.style, children: formattedText });
|
|
35265
|
+
if (parsedTooltip) {
|
|
35266
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: parsedTooltip, children: content });
|
|
35267
|
+
}
|
|
35268
|
+
return content;
|
|
35303
35269
|
};
|
|
35304
35270
|
|
|
35305
35271
|
const MappedParsedText = ({ data }) => {
|
|
@@ -81320,12 +81286,129 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81320
81286
|
] });
|
|
81321
81287
|
};
|
|
81322
81288
|
|
|
81323
|
-
const
|
|
81289
|
+
const ellipsisStyle = {
|
|
81290
|
+
display: "inline-block",
|
|
81291
|
+
overflow: "hidden",
|
|
81292
|
+
textOverflow: "ellipsis",
|
|
81293
|
+
whiteSpace: "nowrap",
|
|
81294
|
+
verticalAlign: "bottom"
|
|
81295
|
+
};
|
|
81296
|
+
const VOLUME_TYPE_LABELS = {
|
|
81297
|
+
awsElasticBlockStore: "AwsElasticBlockStore",
|
|
81298
|
+
azureDisk: "AzureDisk",
|
|
81299
|
+
azureFile: "AzureFile",
|
|
81300
|
+
cephfs: "Cephfs",
|
|
81301
|
+
cinder: "Cinder",
|
|
81302
|
+
configMap: "ConfigMap",
|
|
81303
|
+
csi: "CSI",
|
|
81304
|
+
downwardAPI: "DownwardAPI",
|
|
81305
|
+
emptyDir: "EmptyDir",
|
|
81306
|
+
ephemeral: "Ephemeral",
|
|
81307
|
+
fc: "FC",
|
|
81308
|
+
flexVolume: "FlexVolume",
|
|
81309
|
+
flocker: "Flocker",
|
|
81310
|
+
gcePersistentDisk: "GcePersistentDisk",
|
|
81311
|
+
gitRepo: "GitRepo",
|
|
81312
|
+
glusterfs: "Glusterfs",
|
|
81313
|
+
hostPath: "HostPath",
|
|
81314
|
+
image: "Image",
|
|
81315
|
+
iscsi: "ISCSI",
|
|
81316
|
+
nfs: "NFS",
|
|
81317
|
+
persistentVolumeClaim: "PersistentVolumeClaim",
|
|
81318
|
+
photonPersistentDisk: "PhotonPersistentDisk",
|
|
81319
|
+
portworxVolume: "PortworxVolume",
|
|
81320
|
+
projected: "Projected",
|
|
81321
|
+
quobyte: "Quobyte",
|
|
81322
|
+
rbd: "RBD",
|
|
81323
|
+
scaleIO: "ScaleIO",
|
|
81324
|
+
secret: "Secret",
|
|
81325
|
+
storageos: "StorageOS",
|
|
81326
|
+
vsphereVolume: "VsphereVolume"
|
|
81327
|
+
};
|
|
81328
|
+
const getVolumeDisplayName = (typeKey, volumeConfig, fallbackName) => {
|
|
81329
|
+
switch (typeKey) {
|
|
81330
|
+
case "configMap":
|
|
81331
|
+
return volumeConfig?.name || fallbackName;
|
|
81332
|
+
case "secret":
|
|
81333
|
+
return volumeConfig?.secretName || fallbackName;
|
|
81334
|
+
case "persistentVolumeClaim":
|
|
81335
|
+
return volumeConfig?.claimName || fallbackName;
|
|
81336
|
+
case "azureDisk":
|
|
81337
|
+
return volumeConfig?.diskName || fallbackName;
|
|
81338
|
+
case "csi":
|
|
81339
|
+
return volumeConfig?.driver || fallbackName;
|
|
81340
|
+
case "image":
|
|
81341
|
+
return volumeConfig?.reference || fallbackName;
|
|
81342
|
+
case "projected":
|
|
81343
|
+
return Array.isArray(volumeConfig?.sources) && volumeConfig.sources.length > 0 ? `${volumeConfig.sources.length} sources` : fallbackName;
|
|
81344
|
+
default:
|
|
81345
|
+
return volumeConfig?.volumeID || volumeConfig?.path || volumeConfig?.targetWWNs?.[0] || volumeConfig?.datasetName || volumeConfig?.repository || volumeConfig?.server || volumeConfig?.name || fallbackName;
|
|
81346
|
+
}
|
|
81347
|
+
};
|
|
81348
|
+
const getVolumeTypeMeta = (volumeName, vol) => {
|
|
81349
|
+
if (!vol) return { typeResource: "Volume", typeKey: "volume", typeName: volumeName };
|
|
81350
|
+
const matchedType = Object.keys(VOLUME_TYPE_LABELS).find((typeKey) => Boolean(vol[typeKey]));
|
|
81351
|
+
if (matchedType) {
|
|
81352
|
+
return {
|
|
81353
|
+
typeResource: VOLUME_TYPE_LABELS[matchedType],
|
|
81354
|
+
typeKey: matchedType,
|
|
81355
|
+
typeName: getVolumeDisplayName(matchedType, vol[matchedType], volumeName)
|
|
81356
|
+
};
|
|
81357
|
+
}
|
|
81358
|
+
return { typeResource: "Volume", typeKey: "volume", typeName: volumeName };
|
|
81359
|
+
};
|
|
81360
|
+
const getProjectedSourceMeta = (projectedSource, fallbackName) => {
|
|
81361
|
+
if (!projectedSource || typeof projectedSource !== "object") {
|
|
81362
|
+
return { typeResource: "Projected", typeKey: "projected", typeName: fallbackName };
|
|
81363
|
+
}
|
|
81364
|
+
const projectedTypeKey = Object.keys(projectedSource).find(
|
|
81365
|
+
(typeKey) => ["configMap", "secret", "downwardAPI", "serviceAccountToken", "clusterTrustBundle"].includes(typeKey)
|
|
81366
|
+
);
|
|
81367
|
+
if (!projectedTypeKey) {
|
|
81368
|
+
return { typeResource: "Projected", typeKey: "projected", typeName: fallbackName };
|
|
81369
|
+
}
|
|
81370
|
+
const sourceConfig = projectedSource[projectedTypeKey];
|
|
81371
|
+
if (projectedTypeKey === "configMap") {
|
|
81372
|
+
return {
|
|
81373
|
+
typeResource: "ConfigMap",
|
|
81374
|
+
typeKey: "configMap",
|
|
81375
|
+
typeName: sourceConfig?.name || fallbackName
|
|
81376
|
+
};
|
|
81377
|
+
}
|
|
81378
|
+
if (projectedTypeKey === "secret") {
|
|
81379
|
+
return {
|
|
81380
|
+
typeResource: "Secret",
|
|
81381
|
+
typeKey: "secret",
|
|
81382
|
+
typeName: sourceConfig?.name || fallbackName
|
|
81383
|
+
};
|
|
81384
|
+
}
|
|
81385
|
+
if (projectedTypeKey === "downwardAPI") {
|
|
81386
|
+
return {
|
|
81387
|
+
typeResource: "DownwardAPI",
|
|
81388
|
+
typeKey: "downwardAPI",
|
|
81389
|
+
typeName: sourceConfig?.items?.[0]?.path || fallbackName
|
|
81390
|
+
};
|
|
81391
|
+
}
|
|
81392
|
+
if (projectedTypeKey === "serviceAccountToken") {
|
|
81393
|
+
return {
|
|
81394
|
+
typeResource: "ServiceAccountToken",
|
|
81395
|
+
typeKey: "serviceAccountToken",
|
|
81396
|
+
typeName: sourceConfig?.path || fallbackName
|
|
81397
|
+
};
|
|
81398
|
+
}
|
|
81399
|
+
return {
|
|
81400
|
+
typeResource: "ClusterTrustBundle",
|
|
81401
|
+
typeKey: "clusterTrustBundle",
|
|
81402
|
+
typeName: sourceConfig?.path || sourceConfig?.name || fallbackName
|
|
81403
|
+
};
|
|
81404
|
+
};
|
|
81405
|
+
const getVolumeTypeMetas = (volumeName, volumesMap) => {
|
|
81324
81406
|
const vol = volumesMap[volumeName];
|
|
81325
|
-
if (!vol) return
|
|
81326
|
-
if (vol
|
|
81327
|
-
|
|
81328
|
-
|
|
81407
|
+
if (!vol) return [getVolumeTypeMeta(volumeName, vol)];
|
|
81408
|
+
if (Array.isArray(vol?.projected?.sources) && vol.projected.sources.length > 0) {
|
|
81409
|
+
return vol.projected.sources.map((source) => getProjectedSourceMeta(source, volumeName));
|
|
81410
|
+
}
|
|
81411
|
+
return [getVolumeTypeMeta(volumeName, vol)];
|
|
81329
81412
|
};
|
|
81330
81413
|
const columns = [
|
|
81331
81414
|
{ title: "Name", dataIndex: "name", key: "name" },
|
|
@@ -81336,7 +81419,33 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81336
81419
|
{ title: "Utilized by", dataIndex: "containerName", key: "containerName" }
|
|
81337
81420
|
// { title: 'Type', dataIndex: 'typeResource', key: 'typeResource' },
|
|
81338
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;
|
|
81339
81431
|
const customColumns = {
|
|
81432
|
+
mountPath: {
|
|
81433
|
+
type: "factory",
|
|
81434
|
+
customProps: {
|
|
81435
|
+
disableEventBubbling: true,
|
|
81436
|
+
items: [
|
|
81437
|
+
{
|
|
81438
|
+
type: "parsedText",
|
|
81439
|
+
data: {
|
|
81440
|
+
id: "mountPath-text",
|
|
81441
|
+
text: "{reqsJsonPath[0]['.mountPath']['-']}",
|
|
81442
|
+
tooltip: "{reqsJsonPath[0]['.mountPath']['-']}",
|
|
81443
|
+
style: ellipsisStyle
|
|
81444
|
+
}
|
|
81445
|
+
}
|
|
81446
|
+
]
|
|
81447
|
+
}
|
|
81448
|
+
},
|
|
81340
81449
|
typeName: {
|
|
81341
81450
|
type: "factory",
|
|
81342
81451
|
customProps: {
|
|
@@ -81359,11 +81468,77 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81359
81468
|
}
|
|
81360
81469
|
},
|
|
81361
81470
|
{
|
|
81362
|
-
type: "
|
|
81471
|
+
type: "VisibilityContainer",
|
|
81363
81472
|
data: {
|
|
81364
|
-
id: "typeName-
|
|
81365
|
-
|
|
81366
|
-
|
|
81473
|
+
id: "typeName-link-visible",
|
|
81474
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81475
|
+
criteria: "equals",
|
|
81476
|
+
valueToCompare: ["configMap", "secret"]
|
|
81477
|
+
},
|
|
81478
|
+
children: [
|
|
81479
|
+
{
|
|
81480
|
+
type: "VisibilityContainer",
|
|
81481
|
+
data: {
|
|
81482
|
+
id: "typeName-configmap-link-visible",
|
|
81483
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81484
|
+
criteria: "equals",
|
|
81485
|
+
valueToCompare: ["configMap"]
|
|
81486
|
+
},
|
|
81487
|
+
children: [
|
|
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
|
+
]
|
|
81520
|
+
}
|
|
81521
|
+
]
|
|
81522
|
+
},
|
|
81523
|
+
{
|
|
81524
|
+
type: "VisibilityContainer",
|
|
81525
|
+
data: {
|
|
81526
|
+
id: "typeName-text-visible",
|
|
81527
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81528
|
+
criteria: "notEquals",
|
|
81529
|
+
valueToCompare: ["configMap", "secret"]
|
|
81530
|
+
},
|
|
81531
|
+
children: [
|
|
81532
|
+
{
|
|
81533
|
+
type: "parsedText",
|
|
81534
|
+
data: {
|
|
81535
|
+
id: "typeName-text",
|
|
81536
|
+
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81537
|
+
tooltip: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81538
|
+
style: ellipsisStyle
|
|
81539
|
+
}
|
|
81540
|
+
}
|
|
81541
|
+
]
|
|
81367
81542
|
}
|
|
81368
81543
|
]
|
|
81369
81544
|
}
|
|
@@ -81392,10 +81567,13 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81392
81567
|
}
|
|
81393
81568
|
},
|
|
81394
81569
|
{
|
|
81395
|
-
type: "
|
|
81570
|
+
type: "antdLink",
|
|
81396
81571
|
data: {
|
|
81397
|
-
|
|
81398
|
-
|
|
81572
|
+
href: "/openapi-ui/{2}/{3}/factory/container-details/v1/containers/{reqsJsonPath[0]['.podName']['-']}/{reqsJsonPath[0]['.containerName']['-']}",
|
|
81573
|
+
id: "container-link",
|
|
81574
|
+
text: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81575
|
+
title: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81576
|
+
style: ellipsisStyle
|
|
81399
81577
|
}
|
|
81400
81578
|
}
|
|
81401
81579
|
]
|
|
@@ -81405,7 +81583,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81405
81583
|
}
|
|
81406
81584
|
};
|
|
81407
81585
|
const Volumes = ({ data, children }) => {
|
|
81408
|
-
const { id, reqIndex, jsonPathToSpec, errorText, containerStyle } = data;
|
|
81586
|
+
const { id, reqIndex, jsonPathToSpec, jsonPathToPodName, errorText, containerStyle } = data;
|
|
81409
81587
|
const theme = useTheme();
|
|
81410
81588
|
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
81411
81589
|
const dataSource = React$1.useMemo(() => {
|
|
@@ -81415,6 +81593,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81415
81593
|
const specResult = jp.query(jsonRoot2 || {}, `$${jsonPathToSpec}`);
|
|
81416
81594
|
const spec = specResult?.[0];
|
|
81417
81595
|
if (!spec) return [];
|
|
81596
|
+
const namespace = jsonRoot2?.metadata?.namespace || spec?.metadata?.namespace || "";
|
|
81597
|
+
const podNameFromPath = jsonPathToPodName ? jp.query(jsonRoot2 || {}, `$${jsonPathToPodName}`)?.[0] : void 0;
|
|
81598
|
+
const podName = podNameFromPath || jsonRoot2?.metadata?.name || spec?.metadata?.name || "-";
|
|
81418
81599
|
const containers = Array.isArray(spec.containers) ? spec.containers : [];
|
|
81419
81600
|
const volumes = Array.isArray(spec.volumes) ? spec.volumes : [];
|
|
81420
81601
|
const volumesMap = Array.isArray(volumes) ? volumes.reduce((acc, v) => {
|
|
@@ -81423,15 +81604,23 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81423
81604
|
}, {}) : {};
|
|
81424
81605
|
return containers.flatMap((container, cIdx) => {
|
|
81425
81606
|
const mounts = Array.isArray(container.volumeMounts) ? container.volumeMounts : [];
|
|
81426
|
-
return mounts.
|
|
81427
|
-
|
|
81428
|
-
|
|
81429
|
-
|
|
81430
|
-
|
|
81431
|
-
|
|
81432
|
-
|
|
81607
|
+
return mounts.flatMap(
|
|
81608
|
+
(mount, mIdx) => getVolumeTypeMetas(mount.name, volumesMap).map((typeMeta, typeIdx) => ({
|
|
81609
|
+
...typeMeta,
|
|
81610
|
+
...mount,
|
|
81611
|
+
name: withUndefinedFallback(mount.name),
|
|
81612
|
+
mountPath: withUndefinedFallback(mount.mountPath),
|
|
81613
|
+
subPath: withUndefinedFallback(mount.subPath),
|
|
81614
|
+
typeName: withUndefinedFallback(typeMeta.typeName),
|
|
81615
|
+
containerName: withUndefinedFallback(container.name || `container-${cIdx}`),
|
|
81616
|
+
podName,
|
|
81617
|
+
namespace,
|
|
81618
|
+
access: withUndefinedFallback(mount.readOnly ? "RO" : "RW"),
|
|
81619
|
+
key: `${cIdx}-${mIdx}-${typeIdx}`
|
|
81620
|
+
}))
|
|
81621
|
+
);
|
|
81433
81622
|
});
|
|
81434
|
-
}, [multiQueryData, isMultiQueryLoading, isMultiQueryErrors, reqIndex, jsonPathToSpec]);
|
|
81623
|
+
}, [multiQueryData, isMultiQueryLoading, isMultiQueryErrors, reqIndex, jsonPathToSpec, jsonPathToPodName]);
|
|
81435
81624
|
if (isMultiQueryLoading) {
|
|
81436
81625
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
81437
81626
|
}
|
|
@@ -81452,6 +81641,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81452
81641
|
theme,
|
|
81453
81642
|
columns,
|
|
81454
81643
|
dataSource,
|
|
81644
|
+
additionalPrinterColumnsUndefinedValues: undefinedValues,
|
|
81455
81645
|
additionalPrinterColumnsKeyTypeProps: customColumns,
|
|
81456
81646
|
withoutControls: true,
|
|
81457
81647
|
tableProps: { disablePagination: true }
|
|
@@ -81461,6 +81651,21 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81461
81651
|
] });
|
|
81462
81652
|
};
|
|
81463
81653
|
|
|
81654
|
+
const AntdResult = ({ data, children }) => {
|
|
81655
|
+
const { data: multiQueryData, isLoading } = useMultiQuery();
|
|
81656
|
+
const partsOfUrl = usePartsOfUrl();
|
|
81657
|
+
if (isLoading) {
|
|
81658
|
+
return null;
|
|
81659
|
+
}
|
|
81660
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
81661
|
+
acc[index.toString()] = value;
|
|
81662
|
+
return acc;
|
|
81663
|
+
}, {});
|
|
81664
|
+
const parsedTitle = data.title ? parseAll({ text: data.title, replaceValues, multiQueryData }) : void 0;
|
|
81665
|
+
const parsedSubTitle = data.subTitle ? parseAll({ text: data.subTitle, replaceValues, multiQueryData }) : void 0;
|
|
81666
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: data.status, title: parsedTitle, subTitle: parsedSubTitle, style: data.style, children });
|
|
81667
|
+
};
|
|
81668
|
+
|
|
81464
81669
|
const DynamicComponents = {
|
|
81465
81670
|
DefaultDiv,
|
|
81466
81671
|
antdText: AntdText,
|
|
@@ -81472,6 +81677,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
81472
81677
|
antdTabs: AntdTabs,
|
|
81473
81678
|
antdButton: AntdButton,
|
|
81474
81679
|
antdIcons: AntdIcons,
|
|
81680
|
+
antdResult: AntdResult,
|
|
81475
81681
|
partsOfUrl: PartsOfUrl,
|
|
81476
81682
|
multiQuery: MultiQuery,
|
|
81477
81683
|
parsedText: ParsedText,
|
|
@@ -85583,6 +85789,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85583
85789
|
designNewLayoutHeight
|
|
85584
85790
|
}) => {
|
|
85585
85791
|
const { token } = antd.theme.useToken();
|
|
85792
|
+
const { notification: notificationApi } = antd.App.useApp();
|
|
85586
85793
|
const navigate = reactRouterDom.useNavigate();
|
|
85587
85794
|
const [form] = antd.Form.useForm();
|
|
85588
85795
|
const allValues = antd.Form.useWatch([], form);
|
|
@@ -85697,7 +85904,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85697
85904
|
const body = data;
|
|
85698
85905
|
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${plural}/${isCreate ? "" : name}`;
|
|
85699
85906
|
if (isCreate) {
|
|
85700
|
-
createNewEntry({ endpoint, body }).then(() => {
|
|
85907
|
+
createNewEntry({ endpoint, body }).then((res) => {
|
|
85908
|
+
const resName = res.data?.metadata?.name || name;
|
|
85909
|
+
notificationApi.success({
|
|
85910
|
+
message: `${kind} "${resName}" created successfully`,
|
|
85911
|
+
placement: "bottomRight"
|
|
85912
|
+
});
|
|
85701
85913
|
if (resolvedBacklink) {
|
|
85702
85914
|
navigate(resolvedBacklink);
|
|
85703
85915
|
}
|
|
@@ -85711,7 +85923,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85711
85923
|
setError(error2);
|
|
85712
85924
|
});
|
|
85713
85925
|
} else {
|
|
85714
|
-
updateEntry({ endpoint, body }).then(() => {
|
|
85926
|
+
updateEntry({ endpoint, body }).then((res) => {
|
|
85927
|
+
const resName = res.data?.metadata?.name || name;
|
|
85928
|
+
notificationApi.success({
|
|
85929
|
+
message: `${kind} "${resName}" updated successfully`,
|
|
85930
|
+
placement: "bottomRight"
|
|
85931
|
+
});
|
|
85715
85932
|
if (resolvedBacklink) {
|
|
85716
85933
|
navigate(resolvedBacklink);
|
|
85717
85934
|
}
|
|
@@ -85800,7 +86017,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
|
|
|
85800
86017
|
if (!matches) continue;
|
|
85801
86018
|
const concretePath = buildConcretePathForNewItem(tpl, arrayPath, newIndex);
|
|
85802
86019
|
const current = form.getFieldValue(concretePath);
|
|
85803
|
-
|
|
86020
|
+
const isItemLevelWildcard = tpl.wildcardPath[tpl.wildcardPath.length - 1] === "*";
|
|
86021
|
+
const isEffectivelyEmpty = typeof current === "undefined" || isItemLevelWildcard && _$1.isPlainObject(current) && _$1.isEmpty(current);
|
|
86022
|
+
if (isEffectivelyEmpty) {
|
|
85804
86023
|
const toSet = _$1.cloneDeep(tpl.value);
|
|
85805
86024
|
form.setFieldValue(concretePath, toSet);
|
|
85806
86025
|
}
|