@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.22 → 1.4.0-alpha.24
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-CR0966Fg.mjs → index-DfXU2S4O.mjs} +2 -2
- package/dist/{index-CR0966Fg.mjs.map → index-DfXU2S4O.mjs.map} +1 -1
- package/dist/{index-q08n_WgU.mjs → index-PHzKotN_.mjs} +374 -98
- package/dist/{index-q08n_WgU.mjs.map → index-PHzKotN_.mjs.map} +1 -1
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +372 -96
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/prefills.d.ts +6 -3
- package/dist/types/components/organisms/DynamicComponents/types/Volumes.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/parsedText.d.ts +1 -0
- package/dist/types/hooks/useApiResource.d.ts +2 -1
- package/dist/types/hooks/useApisResourceTypes.d.ts +4 -2
- package/dist/types/hooks/useBuiltinResource.d.ts +2 -1
- package/dist/types/hooks/useBuiltinResourceTypes.d.ts +2 -1
- package/dist/types/hooks/useK8sSmartResource/useSmartResourceParams.d.ts +3 -2
- package/dist/types/hooks/useResourceScope/useResourceScope.d.ts +2 -1
- package/dist/types/localTypes/bff/form.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9550,8 +9550,13 @@ const checkIfBuiltInInstanceNamespaceScoped = async ({
|
|
|
9550
9550
|
return data;
|
|
9551
9551
|
};
|
|
9552
9552
|
|
|
9553
|
-
const useSmartResourceParams = ({
|
|
9553
|
+
const useSmartResourceParams = ({
|
|
9554
|
+
cluster,
|
|
9555
|
+
namespace,
|
|
9556
|
+
enabler
|
|
9557
|
+
}) => {
|
|
9554
9558
|
const [searchParams] = useSearchParams();
|
|
9559
|
+
const clusterPrepared = cluster ?? "";
|
|
9555
9560
|
const rawEntries = useMemo(() => {
|
|
9556
9561
|
const raw = searchParams.get("resources");
|
|
9557
9562
|
if (!raw) return [];
|
|
@@ -9559,19 +9564,20 @@ const useSmartResourceParams = ({ cluster, namespace }) => {
|
|
|
9559
9564
|
const [apiGroup = "", apiVersion = "", plural = ""] = entry.split("/");
|
|
9560
9565
|
const normalizedGroup = apiGroup === "builtin" || apiGroup === "" ? void 0 : apiGroup;
|
|
9561
9566
|
return {
|
|
9562
|
-
cluster,
|
|
9567
|
+
cluster: clusterPrepared,
|
|
9563
9568
|
plural,
|
|
9564
9569
|
apiGroup: normalizedGroup,
|
|
9565
9570
|
apiVersion
|
|
9566
9571
|
};
|
|
9567
9572
|
}).filter((e) => Boolean(e.plural));
|
|
9568
|
-
}, [searchParams,
|
|
9573
|
+
}, [searchParams, clusterPrepared]);
|
|
9569
9574
|
const scopeQueries = useQueries({
|
|
9570
9575
|
queries: rawEntries.map((e) => {
|
|
9571
9576
|
const isApi = Boolean(e.apiGroup);
|
|
9577
|
+
const scopeEnabler = Boolean((enabler ?? true) && e.cluster && e.plural && (!isApi || e.apiVersion));
|
|
9572
9578
|
return {
|
|
9573
9579
|
queryKey: ["resource-scope", e.cluster, isApi ? e.apiGroup : "builtin", e.apiVersion ?? "", e.plural],
|
|
9574
|
-
enabled:
|
|
9580
|
+
enabled: scopeEnabler,
|
|
9575
9581
|
queryFn: () => {
|
|
9576
9582
|
if (isApi) {
|
|
9577
9583
|
return checkIfApiInstanceNamespaceScoped({
|
|
@@ -34859,41 +34865,6 @@ const AntdText = ({
|
|
|
34859
34865
|
};
|
|
34860
34866
|
|
|
34861
34867
|
const MultiQueryContext = createContext(void 0);
|
|
34862
|
-
const makeEmptyEntry = () => ({
|
|
34863
|
-
data: void 0,
|
|
34864
|
-
isLoading: false,
|
|
34865
|
-
isError: false,
|
|
34866
|
-
error: null
|
|
34867
|
-
});
|
|
34868
|
-
const aggReducer = (state, action) => {
|
|
34869
|
-
switch (action.type) {
|
|
34870
|
-
case "RESET":
|
|
34871
|
-
return { entries: Array.from({ length: action.total }, makeEmptyEntry) };
|
|
34872
|
-
case "SET_ENTRY": {
|
|
34873
|
-
const entries = state.entries.slice();
|
|
34874
|
-
entries[action.index] = action.entry;
|
|
34875
|
-
return { entries };
|
|
34876
|
-
}
|
|
34877
|
-
default:
|
|
34878
|
-
return state;
|
|
34879
|
-
}
|
|
34880
|
-
};
|
|
34881
|
-
const K8sFetcher = ({ index, params, dispatch }) => {
|
|
34882
|
-
const res = useK8sSmartResource(params);
|
|
34883
|
-
useEffect(() => {
|
|
34884
|
-
dispatch({
|
|
34885
|
-
type: "SET_ENTRY",
|
|
34886
|
-
index,
|
|
34887
|
-
entry: {
|
|
34888
|
-
data: res.data,
|
|
34889
|
-
isLoading: res.isLoading,
|
|
34890
|
-
isError: res.isError,
|
|
34891
|
-
error: res.error ?? null
|
|
34892
|
-
}
|
|
34893
|
-
});
|
|
34894
|
-
}, [index, res.data, res.isLoading, res.isError, res.error, dispatch]);
|
|
34895
|
-
return null;
|
|
34896
|
-
};
|
|
34897
34868
|
const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
34898
34869
|
const k8sItems = useMemo(
|
|
34899
34870
|
() => items.filter((x) => typeof x !== "string"),
|
|
@@ -34902,10 +34873,7 @@ const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
|
34902
34873
|
const urlItems = useMemo(() => items.filter((x) => typeof x === "string"), [items]);
|
|
34903
34874
|
const k8sCount = k8sItems.length;
|
|
34904
34875
|
const urlCount = urlItems.length;
|
|
34905
|
-
const
|
|
34906
|
-
useEffect(() => {
|
|
34907
|
-
dispatch({ type: "RESET", total: k8sCount });
|
|
34908
|
-
}, [k8sCount]);
|
|
34876
|
+
const k8sResults = useManyK8sSmartResource(k8sItems);
|
|
34909
34877
|
const urlQueries = useQueries({
|
|
34910
34878
|
queries: urlItems.map((url, i) => ({
|
|
34911
34879
|
queryKey: ["multi-url", i, url],
|
|
@@ -34923,10 +34891,10 @@ const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
|
34923
34891
|
const hasExtraReq0 = typeof dataToApplyToContext !== "undefined";
|
|
34924
34892
|
const baseIndex = hasExtraReq0 ? 1 : 0;
|
|
34925
34893
|
for (let i = 0; i < k8sCount; i++) {
|
|
34926
|
-
const
|
|
34894
|
+
const result = k8sResults[i];
|
|
34927
34895
|
const idx = baseIndex + i;
|
|
34928
|
-
data[`req${idx}`] =
|
|
34929
|
-
errors[idx] =
|
|
34896
|
+
data[`req${idx}`] = result?.data;
|
|
34897
|
+
errors[idx] = result?.isError ? result.error ?? null : null;
|
|
34930
34898
|
}
|
|
34931
34899
|
for (let i = 0; i < urlCount; i++) {
|
|
34932
34900
|
const q = urlQueries[i];
|
|
@@ -34938,17 +34906,11 @@ const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
|
34938
34906
|
data.req0 = dataToApplyToContext;
|
|
34939
34907
|
errors[0] = null;
|
|
34940
34908
|
}
|
|
34941
|
-
const isLoading =
|
|
34942
|
-
const isError =
|
|
34909
|
+
const isLoading = k8sResults.some((r) => r.isLoading) || urlQueries.some((q) => q.isLoading);
|
|
34910
|
+
const isError = k8sResults.some((r) => r.isError) || urlQueries.some((q) => q.isError);
|
|
34943
34911
|
return { data, isLoading, isError, errors };
|
|
34944
34912
|
})();
|
|
34945
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
34946
|
-
k8sItems.map((params, i) => (
|
|
34947
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
34948
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(K8sFetcher, { index: i, params, dispatch }, i)
|
|
34949
|
-
)),
|
|
34950
|
-
children
|
|
34951
|
-
] });
|
|
34913
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryContext.Provider, { value, children });
|
|
34952
34914
|
};
|
|
34953
34915
|
const useMultiQuery = () => {
|
|
34954
34916
|
const ctx = useContext(MultiQueryContext);
|
|
@@ -35010,12 +34972,13 @@ const AntdLink = ({
|
|
|
35010
34972
|
return acc;
|
|
35011
34973
|
}, {});
|
|
35012
34974
|
const textPrepared = parseAll({ text, replaceValues, multiQueryData });
|
|
34975
|
+
const tooltipPrepared = typeof linkProps.title === "string" ? parseAll({ text: linkProps.title, replaceValues, multiQueryData }) : void 0;
|
|
35013
34976
|
const hrefPrepared = parseAll({ text: href, replaceValues, multiQueryData });
|
|
35014
34977
|
const isExternal = isExternalHref(hrefPrepared);
|
|
35015
34978
|
if (isMultiqueryLoading) {
|
|
35016
34979
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
35017
34980
|
}
|
|
35018
|
-
|
|
34981
|
+
const content = /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35019
34982
|
Typography.Link,
|
|
35020
34983
|
{
|
|
35021
34984
|
href: hrefPrepared,
|
|
@@ -35033,6 +34996,10 @@ const AntdLink = ({
|
|
|
35033
34996
|
]
|
|
35034
34997
|
}
|
|
35035
34998
|
);
|
|
34999
|
+
if (tooltipPrepared) {
|
|
35000
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { title: tooltipPrepared, children: content });
|
|
35001
|
+
}
|
|
35002
|
+
return content;
|
|
35036
35003
|
};
|
|
35037
35004
|
|
|
35038
35005
|
const AntdCard = ({
|
|
@@ -35277,8 +35244,13 @@ const ParsedText = ({ data }) => {
|
|
|
35277
35244
|
return acc;
|
|
35278
35245
|
}, {});
|
|
35279
35246
|
const parsedText = parseAll({ text: data.text, replaceValues, multiQueryData });
|
|
35247
|
+
const parsedTooltip = data.tooltip ? parseAll({ text: data.tooltip, replaceValues, multiQueryData }) : void 0;
|
|
35280
35248
|
const formattedText = data.formatter ? formatLocalDate(parsedText) : parsedText;
|
|
35281
|
-
|
|
35249
|
+
const content = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: data.style, children: formattedText });
|
|
35250
|
+
if (parsedTooltip) {
|
|
35251
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { title: parsedTooltip, children: content });
|
|
35252
|
+
}
|
|
35253
|
+
return content;
|
|
35282
35254
|
};
|
|
35283
35255
|
|
|
35284
35256
|
const MappedParsedText = ({ data }) => {
|
|
@@ -78649,7 +78621,7 @@ const TolerationsModal = ({
|
|
|
78649
78621
|
};
|
|
78650
78622
|
|
|
78651
78623
|
const LazyEnrichedTableModal = lazy(
|
|
78652
|
-
() => import('./index-
|
|
78624
|
+
() => import('./index-DfXU2S4O.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
|
|
78653
78625
|
);
|
|
78654
78626
|
const renderActiveType = (activeType, extraProps) => {
|
|
78655
78627
|
if (!activeType) return null;
|
|
@@ -81299,12 +81271,129 @@ const ActionsDropdown = ({ data, children }) => {
|
|
|
81299
81271
|
] });
|
|
81300
81272
|
};
|
|
81301
81273
|
|
|
81302
|
-
const
|
|
81274
|
+
const ellipsisStyle = {
|
|
81275
|
+
display: "inline-block",
|
|
81276
|
+
overflow: "hidden",
|
|
81277
|
+
textOverflow: "ellipsis",
|
|
81278
|
+
whiteSpace: "nowrap",
|
|
81279
|
+
verticalAlign: "bottom"
|
|
81280
|
+
};
|
|
81281
|
+
const VOLUME_TYPE_LABELS = {
|
|
81282
|
+
awsElasticBlockStore: "AwsElasticBlockStore",
|
|
81283
|
+
azureDisk: "AzureDisk",
|
|
81284
|
+
azureFile: "AzureFile",
|
|
81285
|
+
cephfs: "Cephfs",
|
|
81286
|
+
cinder: "Cinder",
|
|
81287
|
+
configMap: "ConfigMap",
|
|
81288
|
+
csi: "CSI",
|
|
81289
|
+
downwardAPI: "DownwardAPI",
|
|
81290
|
+
emptyDir: "EmptyDir",
|
|
81291
|
+
ephemeral: "Ephemeral",
|
|
81292
|
+
fc: "FC",
|
|
81293
|
+
flexVolume: "FlexVolume",
|
|
81294
|
+
flocker: "Flocker",
|
|
81295
|
+
gcePersistentDisk: "GcePersistentDisk",
|
|
81296
|
+
gitRepo: "GitRepo",
|
|
81297
|
+
glusterfs: "Glusterfs",
|
|
81298
|
+
hostPath: "HostPath",
|
|
81299
|
+
image: "Image",
|
|
81300
|
+
iscsi: "ISCSI",
|
|
81301
|
+
nfs: "NFS",
|
|
81302
|
+
persistentVolumeClaim: "PersistentVolumeClaim",
|
|
81303
|
+
photonPersistentDisk: "PhotonPersistentDisk",
|
|
81304
|
+
portworxVolume: "PortworxVolume",
|
|
81305
|
+
projected: "Projected",
|
|
81306
|
+
quobyte: "Quobyte",
|
|
81307
|
+
rbd: "RBD",
|
|
81308
|
+
scaleIO: "ScaleIO",
|
|
81309
|
+
secret: "Secret",
|
|
81310
|
+
storageos: "StorageOS",
|
|
81311
|
+
vsphereVolume: "VsphereVolume"
|
|
81312
|
+
};
|
|
81313
|
+
const getVolumeDisplayName = (typeKey, volumeConfig, fallbackName) => {
|
|
81314
|
+
switch (typeKey) {
|
|
81315
|
+
case "configMap":
|
|
81316
|
+
return volumeConfig?.name || fallbackName;
|
|
81317
|
+
case "secret":
|
|
81318
|
+
return volumeConfig?.secretName || fallbackName;
|
|
81319
|
+
case "persistentVolumeClaim":
|
|
81320
|
+
return volumeConfig?.claimName || fallbackName;
|
|
81321
|
+
case "azureDisk":
|
|
81322
|
+
return volumeConfig?.diskName || fallbackName;
|
|
81323
|
+
case "csi":
|
|
81324
|
+
return volumeConfig?.driver || fallbackName;
|
|
81325
|
+
case "image":
|
|
81326
|
+
return volumeConfig?.reference || fallbackName;
|
|
81327
|
+
case "projected":
|
|
81328
|
+
return Array.isArray(volumeConfig?.sources) && volumeConfig.sources.length > 0 ? `${volumeConfig.sources.length} sources` : fallbackName;
|
|
81329
|
+
default:
|
|
81330
|
+
return volumeConfig?.volumeID || volumeConfig?.path || volumeConfig?.targetWWNs?.[0] || volumeConfig?.datasetName || volumeConfig?.repository || volumeConfig?.server || volumeConfig?.name || fallbackName;
|
|
81331
|
+
}
|
|
81332
|
+
};
|
|
81333
|
+
const getVolumeTypeMeta = (volumeName, vol) => {
|
|
81334
|
+
if (!vol) return { typeResource: "Volume", typeKey: "volume", typeName: volumeName };
|
|
81335
|
+
const matchedType = Object.keys(VOLUME_TYPE_LABELS).find((typeKey) => Boolean(vol[typeKey]));
|
|
81336
|
+
if (matchedType) {
|
|
81337
|
+
return {
|
|
81338
|
+
typeResource: VOLUME_TYPE_LABELS[matchedType],
|
|
81339
|
+
typeKey: matchedType,
|
|
81340
|
+
typeName: getVolumeDisplayName(matchedType, vol[matchedType], volumeName)
|
|
81341
|
+
};
|
|
81342
|
+
}
|
|
81343
|
+
return { typeResource: "Volume", typeKey: "volume", typeName: volumeName };
|
|
81344
|
+
};
|
|
81345
|
+
const getProjectedSourceMeta = (projectedSource, fallbackName) => {
|
|
81346
|
+
if (!projectedSource || typeof projectedSource !== "object") {
|
|
81347
|
+
return { typeResource: "Projected", typeKey: "projected", typeName: fallbackName };
|
|
81348
|
+
}
|
|
81349
|
+
const projectedTypeKey = Object.keys(projectedSource).find(
|
|
81350
|
+
(typeKey) => ["configMap", "secret", "downwardAPI", "serviceAccountToken", "clusterTrustBundle"].includes(typeKey)
|
|
81351
|
+
);
|
|
81352
|
+
if (!projectedTypeKey) {
|
|
81353
|
+
return { typeResource: "Projected", typeKey: "projected", typeName: fallbackName };
|
|
81354
|
+
}
|
|
81355
|
+
const sourceConfig = projectedSource[projectedTypeKey];
|
|
81356
|
+
if (projectedTypeKey === "configMap") {
|
|
81357
|
+
return {
|
|
81358
|
+
typeResource: "ConfigMap",
|
|
81359
|
+
typeKey: "configMap",
|
|
81360
|
+
typeName: sourceConfig?.name || fallbackName
|
|
81361
|
+
};
|
|
81362
|
+
}
|
|
81363
|
+
if (projectedTypeKey === "secret") {
|
|
81364
|
+
return {
|
|
81365
|
+
typeResource: "Secret",
|
|
81366
|
+
typeKey: "secret",
|
|
81367
|
+
typeName: sourceConfig?.name || fallbackName
|
|
81368
|
+
};
|
|
81369
|
+
}
|
|
81370
|
+
if (projectedTypeKey === "downwardAPI") {
|
|
81371
|
+
return {
|
|
81372
|
+
typeResource: "DownwardAPI",
|
|
81373
|
+
typeKey: "downwardAPI",
|
|
81374
|
+
typeName: sourceConfig?.items?.[0]?.path || fallbackName
|
|
81375
|
+
};
|
|
81376
|
+
}
|
|
81377
|
+
if (projectedTypeKey === "serviceAccountToken") {
|
|
81378
|
+
return {
|
|
81379
|
+
typeResource: "ServiceAccountToken",
|
|
81380
|
+
typeKey: "serviceAccountToken",
|
|
81381
|
+
typeName: sourceConfig?.path || fallbackName
|
|
81382
|
+
};
|
|
81383
|
+
}
|
|
81384
|
+
return {
|
|
81385
|
+
typeResource: "ClusterTrustBundle",
|
|
81386
|
+
typeKey: "clusterTrustBundle",
|
|
81387
|
+
typeName: sourceConfig?.path || sourceConfig?.name || fallbackName
|
|
81388
|
+
};
|
|
81389
|
+
};
|
|
81390
|
+
const getVolumeTypeMetas = (volumeName, volumesMap) => {
|
|
81303
81391
|
const vol = volumesMap[volumeName];
|
|
81304
|
-
if (!vol) return
|
|
81305
|
-
if (vol
|
|
81306
|
-
|
|
81307
|
-
|
|
81392
|
+
if (!vol) return [getVolumeTypeMeta(volumeName, vol)];
|
|
81393
|
+
if (Array.isArray(vol?.projected?.sources) && vol.projected.sources.length > 0) {
|
|
81394
|
+
return vol.projected.sources.map((source) => getProjectedSourceMeta(source, volumeName));
|
|
81395
|
+
}
|
|
81396
|
+
return [getVolumeTypeMeta(volumeName, vol)];
|
|
81308
81397
|
};
|
|
81309
81398
|
const columns = [
|
|
81310
81399
|
{ title: "Name", dataIndex: "name", key: "name" },
|
|
@@ -81315,7 +81404,33 @@ const columns = [
|
|
|
81315
81404
|
{ title: "Utilized by", dataIndex: "containerName", key: "containerName" }
|
|
81316
81405
|
// { title: 'Type', dataIndex: 'typeResource', key: 'typeResource' },
|
|
81317
81406
|
];
|
|
81407
|
+
const undefinedValues = [
|
|
81408
|
+
{ key: "name", value: "-" },
|
|
81409
|
+
{ key: "mountPath", value: "-" },
|
|
81410
|
+
{ key: "subPath", value: "-" },
|
|
81411
|
+
{ key: "typeName", value: "-" },
|
|
81412
|
+
{ key: "access", value: "-" },
|
|
81413
|
+
{ key: "containerName", value: "-" }
|
|
81414
|
+
];
|
|
81415
|
+
const withUndefinedFallback = (value, fallback = "-") => value === void 0 || value === null || value === "" ? fallback : value;
|
|
81318
81416
|
const customColumns = {
|
|
81417
|
+
mountPath: {
|
|
81418
|
+
type: "factory",
|
|
81419
|
+
customProps: {
|
|
81420
|
+
disableEventBubbling: true,
|
|
81421
|
+
items: [
|
|
81422
|
+
{
|
|
81423
|
+
type: "parsedText",
|
|
81424
|
+
data: {
|
|
81425
|
+
id: "mountPath-text",
|
|
81426
|
+
text: "{reqsJsonPath[0]['.mountPath']['-']}",
|
|
81427
|
+
tooltip: "{reqsJsonPath[0]['.mountPath']['-']}",
|
|
81428
|
+
style: ellipsisStyle
|
|
81429
|
+
}
|
|
81430
|
+
}
|
|
81431
|
+
]
|
|
81432
|
+
}
|
|
81433
|
+
},
|
|
81319
81434
|
typeName: {
|
|
81320
81435
|
type: "factory",
|
|
81321
81436
|
customProps: {
|
|
@@ -81338,11 +81453,77 @@ const customColumns = {
|
|
|
81338
81453
|
}
|
|
81339
81454
|
},
|
|
81340
81455
|
{
|
|
81341
|
-
type: "
|
|
81456
|
+
type: "VisibilityContainer",
|
|
81342
81457
|
data: {
|
|
81343
|
-
id: "typeName-
|
|
81344
|
-
|
|
81345
|
-
|
|
81458
|
+
id: "typeName-link-visible",
|
|
81459
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81460
|
+
criteria: "equals",
|
|
81461
|
+
valueToCompare: ["configMap", "secret"]
|
|
81462
|
+
},
|
|
81463
|
+
children: [
|
|
81464
|
+
{
|
|
81465
|
+
type: "VisibilityContainer",
|
|
81466
|
+
data: {
|
|
81467
|
+
id: "typeName-configmap-link-visible",
|
|
81468
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81469
|
+
criteria: "equals",
|
|
81470
|
+
valueToCompare: ["configMap"]
|
|
81471
|
+
},
|
|
81472
|
+
children: [
|
|
81473
|
+
{
|
|
81474
|
+
type: "antdLink",
|
|
81475
|
+
data: {
|
|
81476
|
+
href: "/openapi-ui/{2}/{3}/factory/configmap-details/v1/configmaps/{reqsJsonPath[0]['.typeName']['-']}",
|
|
81477
|
+
id: "typeName-link",
|
|
81478
|
+
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81479
|
+
title: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81480
|
+
style: ellipsisStyle
|
|
81481
|
+
}
|
|
81482
|
+
}
|
|
81483
|
+
]
|
|
81484
|
+
},
|
|
81485
|
+
{
|
|
81486
|
+
type: "VisibilityContainer",
|
|
81487
|
+
data: {
|
|
81488
|
+
id: "typeName-secret-link-visible",
|
|
81489
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81490
|
+
criteria: "equals",
|
|
81491
|
+
valueToCompare: ["secret"]
|
|
81492
|
+
},
|
|
81493
|
+
children: [
|
|
81494
|
+
{
|
|
81495
|
+
type: "antdLink",
|
|
81496
|
+
data: {
|
|
81497
|
+
href: "/openapi-ui/{2}/{3}/factory/secret-details/v1/secrets/{reqsJsonPath[0]['.typeName']['-']}",
|
|
81498
|
+
id: "typeName-secret-link",
|
|
81499
|
+
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81500
|
+
title: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81501
|
+
style: ellipsisStyle
|
|
81502
|
+
}
|
|
81503
|
+
}
|
|
81504
|
+
]
|
|
81505
|
+
}
|
|
81506
|
+
]
|
|
81507
|
+
},
|
|
81508
|
+
{
|
|
81509
|
+
type: "VisibilityContainer",
|
|
81510
|
+
data: {
|
|
81511
|
+
id: "typeName-text-visible",
|
|
81512
|
+
value: "{reqsJsonPath[0]['.typeKey']['-']}",
|
|
81513
|
+
criteria: "notEquals",
|
|
81514
|
+
valueToCompare: ["configMap", "secret"]
|
|
81515
|
+
},
|
|
81516
|
+
children: [
|
|
81517
|
+
{
|
|
81518
|
+
type: "parsedText",
|
|
81519
|
+
data: {
|
|
81520
|
+
id: "typeName-text",
|
|
81521
|
+
text: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81522
|
+
tooltip: "{reqsJsonPath[0]['.typeName']['-']}",
|
|
81523
|
+
style: ellipsisStyle
|
|
81524
|
+
}
|
|
81525
|
+
}
|
|
81526
|
+
]
|
|
81346
81527
|
}
|
|
81347
81528
|
]
|
|
81348
81529
|
}
|
|
@@ -81371,10 +81552,13 @@ const customColumns = {
|
|
|
81371
81552
|
}
|
|
81372
81553
|
},
|
|
81373
81554
|
{
|
|
81374
|
-
type: "
|
|
81555
|
+
type: "antdLink",
|
|
81375
81556
|
data: {
|
|
81376
|
-
|
|
81377
|
-
|
|
81557
|
+
href: "/openapi-ui/{2}/{3}/factory/container-details/v1/containers/{reqsJsonPath[0]['.podName']['-']}/{reqsJsonPath[0]['.containerName']['-']}",
|
|
81558
|
+
id: "container-link",
|
|
81559
|
+
text: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81560
|
+
title: "{reqsJsonPath[0]['.containerName']['-']}",
|
|
81561
|
+
style: ellipsisStyle
|
|
81378
81562
|
}
|
|
81379
81563
|
}
|
|
81380
81564
|
]
|
|
@@ -81384,7 +81568,7 @@ const customColumns = {
|
|
|
81384
81568
|
}
|
|
81385
81569
|
};
|
|
81386
81570
|
const Volumes = ({ data, children }) => {
|
|
81387
|
-
const { id, reqIndex, jsonPathToSpec, errorText, containerStyle } = data;
|
|
81571
|
+
const { id, reqIndex, jsonPathToSpec, jsonPathToPodName, errorText, containerStyle } = data;
|
|
81388
81572
|
const theme = useTheme();
|
|
81389
81573
|
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
|
|
81390
81574
|
const dataSource = useMemo(() => {
|
|
@@ -81394,6 +81578,9 @@ const Volumes = ({ data, children }) => {
|
|
|
81394
81578
|
const specResult = jp.query(jsonRoot2 || {}, `$${jsonPathToSpec}`);
|
|
81395
81579
|
const spec = specResult?.[0];
|
|
81396
81580
|
if (!spec) return [];
|
|
81581
|
+
const namespace = jsonRoot2?.metadata?.namespace || spec?.metadata?.namespace || "";
|
|
81582
|
+
const podNameFromPath = jsonPathToPodName ? jp.query(jsonRoot2 || {}, `$${jsonPathToPodName}`)?.[0] : void 0;
|
|
81583
|
+
const podName = podNameFromPath || jsonRoot2?.metadata?.name || spec?.metadata?.name || "-";
|
|
81397
81584
|
const containers = Array.isArray(spec.containers) ? spec.containers : [];
|
|
81398
81585
|
const volumes = Array.isArray(spec.volumes) ? spec.volumes : [];
|
|
81399
81586
|
const volumesMap = Array.isArray(volumes) ? volumes.reduce((acc, v) => {
|
|
@@ -81402,15 +81589,23 @@ const Volumes = ({ data, children }) => {
|
|
|
81402
81589
|
}, {}) : {};
|
|
81403
81590
|
return containers.flatMap((container, cIdx) => {
|
|
81404
81591
|
const mounts = Array.isArray(container.volumeMounts) ? container.volumeMounts : [];
|
|
81405
|
-
return mounts.
|
|
81406
|
-
|
|
81407
|
-
|
|
81408
|
-
|
|
81409
|
-
|
|
81410
|
-
|
|
81411
|
-
|
|
81592
|
+
return mounts.flatMap(
|
|
81593
|
+
(mount, mIdx) => getVolumeTypeMetas(mount.name, volumesMap).map((typeMeta, typeIdx) => ({
|
|
81594
|
+
...typeMeta,
|
|
81595
|
+
...mount,
|
|
81596
|
+
name: withUndefinedFallback(mount.name),
|
|
81597
|
+
mountPath: withUndefinedFallback(mount.mountPath),
|
|
81598
|
+
subPath: withUndefinedFallback(mount.subPath),
|
|
81599
|
+
typeName: withUndefinedFallback(typeMeta.typeName),
|
|
81600
|
+
containerName: withUndefinedFallback(container.name || `container-${cIdx}`),
|
|
81601
|
+
podName,
|
|
81602
|
+
namespace,
|
|
81603
|
+
access: withUndefinedFallback(mount.readOnly ? "RO" : "RW"),
|
|
81604
|
+
key: `${cIdx}-${mIdx}-${typeIdx}`
|
|
81605
|
+
}))
|
|
81606
|
+
);
|
|
81412
81607
|
});
|
|
81413
|
-
}, [multiQueryData, isMultiQueryLoading, isMultiQueryErrors, reqIndex, jsonPathToSpec]);
|
|
81608
|
+
}, [multiQueryData, isMultiQueryLoading, isMultiQueryErrors, reqIndex, jsonPathToSpec, jsonPathToPodName]);
|
|
81414
81609
|
if (isMultiQueryLoading) {
|
|
81415
81610
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
81416
81611
|
}
|
|
@@ -81431,6 +81626,7 @@ const Volumes = ({ data, children }) => {
|
|
|
81431
81626
|
theme,
|
|
81432
81627
|
columns,
|
|
81433
81628
|
dataSource,
|
|
81629
|
+
additionalPrinterColumnsUndefinedValues: undefinedValues,
|
|
81434
81630
|
additionalPrinterColumnsKeyTypeProps: customColumns,
|
|
81435
81631
|
withoutControls: true,
|
|
81436
81632
|
tableProps: { disablePagination: true }
|
|
@@ -85396,6 +85592,7 @@ const buildConcretePathForNewItem = (tpl, arrayPath, newIndex) => {
|
|
|
85396
85592
|
const result = [...realizedPrefix, newIndex, ...w.slice(arrayPath.length + 1)];
|
|
85397
85593
|
return result;
|
|
85398
85594
|
};
|
|
85595
|
+
const getConcretePathsForNewArrayItem = (templates, arrayPath, newIndex) => templates.filter((tpl) => templateMatchesArray(tpl, arrayPath)).map((tpl) => buildConcretePathForNewItem(tpl, arrayPath, newIndex));
|
|
85399
85596
|
const scrubLiteralWildcardKeys = (input) => {
|
|
85400
85597
|
if (Array.isArray(input)) return input.map(scrubLiteralWildcardKeys);
|
|
85401
85598
|
if (_$1.isPlainObject(input)) {
|
|
@@ -85593,7 +85790,15 @@ const BlackholeForm = ({
|
|
|
85593
85790
|
return value;
|
|
85594
85791
|
});
|
|
85595
85792
|
};
|
|
85596
|
-
const
|
|
85793
|
+
const exactPersistedPaths = useMemo(
|
|
85794
|
+
() => (persistedPaths || []).filter((path) => !path.some((seg) => seg === "*")),
|
|
85795
|
+
[persistedPaths]
|
|
85796
|
+
);
|
|
85797
|
+
const persistedWildcardTemplates = useMemo(
|
|
85798
|
+
() => (persistedPaths || []).filter((path) => path.some((seg) => seg === "*")).map((path) => ({ wildcardPath: sanitizeWildcardPath(path) })),
|
|
85799
|
+
[persistedPaths]
|
|
85800
|
+
);
|
|
85801
|
+
const [persistedKeys, setPersistedKeys] = useState(exactPersistedPaths);
|
|
85597
85802
|
const [resolvedHiddenPaths, setResolvedHiddenPaths] = useState([]);
|
|
85598
85803
|
const blockedPathsRef = useRef(/* @__PURE__ */ new Set());
|
|
85599
85804
|
const manualBlockedPathsRef = useRef(/* @__PURE__ */ new Set());
|
|
@@ -85770,7 +85975,9 @@ const BlackholeForm = ({
|
|
|
85770
85975
|
if (!matches) continue;
|
|
85771
85976
|
const concretePath = buildConcretePathForNewItem(tpl, arrayPath, newIndex);
|
|
85772
85977
|
const current = form.getFieldValue(concretePath);
|
|
85773
|
-
|
|
85978
|
+
const isItemLevelWildcard = tpl.wildcardPath[tpl.wildcardPath.length - 1] === "*";
|
|
85979
|
+
const isEffectivelyEmpty = typeof current === "undefined" || isItemLevelWildcard && _$1.isPlainObject(current) && _$1.isEmpty(current);
|
|
85980
|
+
if (isEffectivelyEmpty) {
|
|
85774
85981
|
const toSet = _$1.cloneDeep(tpl.value);
|
|
85775
85982
|
form.setFieldValue(concretePath, toSet);
|
|
85776
85983
|
}
|
|
@@ -85778,6 +85985,29 @@ const BlackholeForm = ({
|
|
|
85778
85985
|
},
|
|
85779
85986
|
[form, prefillTemplates]
|
|
85780
85987
|
);
|
|
85988
|
+
const applyPersistedForNewArrayItem = useCallback(
|
|
85989
|
+
(arrayPath, newIndex) => {
|
|
85990
|
+
const concretePaths = getConcretePathsForNewArrayItem(
|
|
85991
|
+
persistedWildcardTemplates,
|
|
85992
|
+
arrayPath,
|
|
85993
|
+
newIndex
|
|
85994
|
+
);
|
|
85995
|
+
if (!concretePaths.length) return;
|
|
85996
|
+
setPersistedKeys((prev) => {
|
|
85997
|
+
const seen = new Set(prev.map((x) => JSON.stringify(x)));
|
|
85998
|
+
const merged = [...prev];
|
|
85999
|
+
concretePaths.forEach((path) => {
|
|
86000
|
+
const key = JSON.stringify(path);
|
|
86001
|
+
if (!seen.has(key)) {
|
|
86002
|
+
seen.add(key);
|
|
86003
|
+
merged.push(path);
|
|
86004
|
+
}
|
|
86005
|
+
});
|
|
86006
|
+
return merged;
|
|
86007
|
+
});
|
|
86008
|
+
},
|
|
86009
|
+
[persistedWildcardTemplates]
|
|
86010
|
+
);
|
|
85781
86011
|
const hiddenWildcardTemplates = useMemo(() => {
|
|
85782
86012
|
const raw = hiddenPaths ?? [];
|
|
85783
86013
|
raw.forEach((p, i) => wdbg(`#${i}`, p));
|
|
@@ -85814,7 +86044,26 @@ const BlackholeForm = ({
|
|
|
85814
86044
|
}
|
|
85815
86045
|
return merged;
|
|
85816
86046
|
});
|
|
85817
|
-
|
|
86047
|
+
const persistedResolved = expandWildcardTemplates(
|
|
86048
|
+
persistedWildcardTemplates.map((tpl) => tpl.wildcardPath),
|
|
86049
|
+
initialValues,
|
|
86050
|
+
{
|
|
86051
|
+
includeMissingFinalForWildcard: true
|
|
86052
|
+
}
|
|
86053
|
+
);
|
|
86054
|
+
setPersistedKeys((prev) => {
|
|
86055
|
+
const seen = new Set(prev.map((x) => JSON.stringify(x)));
|
|
86056
|
+
const merged = [...prev];
|
|
86057
|
+
for (const p of persistedResolved) {
|
|
86058
|
+
const k = JSON.stringify(p);
|
|
86059
|
+
if (!seen.has(k)) {
|
|
86060
|
+
seen.add(k);
|
|
86061
|
+
merged.push(p);
|
|
86062
|
+
}
|
|
86063
|
+
}
|
|
86064
|
+
return merged;
|
|
86065
|
+
});
|
|
86066
|
+
}, [initialValues, hiddenWildcardTemplates, expandedWildcardTemplates, persistedWildcardTemplates]);
|
|
85818
86067
|
const resolvedHiddenStringPaths = useMemo(
|
|
85819
86068
|
() => resolvedHiddenPaths.map(toStringPath),
|
|
85820
86069
|
[resolvedHiddenPaths]
|
|
@@ -85956,6 +86205,7 @@ const BlackholeForm = ({
|
|
|
85956
86205
|
}
|
|
85957
86206
|
blockedPathsRef.current.delete(JSON.stringify(itemPath));
|
|
85958
86207
|
applyPrefillForNewArrayItem(arrayPath, i);
|
|
86208
|
+
applyPersistedForNewArrayItem(arrayPath, i);
|
|
85959
86209
|
}
|
|
85960
86210
|
}
|
|
85961
86211
|
}
|
|
@@ -85968,6 +86218,7 @@ const BlackholeForm = ({
|
|
|
85968
86218
|
const arrayPath = JSON.parse(k);
|
|
85969
86219
|
for (let i = prevLen; i < newLen; i++) {
|
|
85970
86220
|
applyPrefillForNewArrayItem(arrayPath, i);
|
|
86221
|
+
applyPersistedForNewArrayItem(arrayPath, i);
|
|
85971
86222
|
}
|
|
85972
86223
|
}
|
|
85973
86224
|
}
|
|
@@ -85986,6 +86237,7 @@ const BlackholeForm = ({
|
|
|
85986
86237
|
persistedKeys,
|
|
85987
86238
|
debouncedPostValuesToYaml,
|
|
85988
86239
|
applyPrefillForNewArrayItem,
|
|
86240
|
+
applyPersistedForNewArrayItem,
|
|
85989
86241
|
hiddenWildcardTemplates,
|
|
85990
86242
|
expandedWildcardTemplates
|
|
85991
86243
|
]
|
|
@@ -86401,6 +86653,13 @@ const BlackholeFormProvider = ({
|
|
|
86401
86653
|
plural: "customformsoverrides",
|
|
86402
86654
|
isEnabled: Boolean(cluster && forcingCustomization.baseApiGroup && forcingCustomization.baseApiVersion)
|
|
86403
86655
|
});
|
|
86656
|
+
const { data: prefillsData, isLoading: prefillsLoading } = useK8sSmartResource({
|
|
86657
|
+
cluster,
|
|
86658
|
+
apiGroup: forcingCustomization.baseApiGroup,
|
|
86659
|
+
apiVersion: forcingCustomization.baseApiVersion,
|
|
86660
|
+
plural: "customformsprefills",
|
|
86661
|
+
isEnabled: Boolean(cluster && forcingCustomization.baseApiGroup && forcingCustomization.baseApiVersion)
|
|
86662
|
+
});
|
|
86404
86663
|
const { data: mappingData, isLoading: mappingLoading } = useK8sSmartResource({
|
|
86405
86664
|
cluster,
|
|
86406
86665
|
apiGroup: forcingCustomization.baseApiGroup,
|
|
@@ -86436,20 +86695,28 @@ const BlackholeFormProvider = ({
|
|
|
86436
86695
|
const hasForcedMatchingOverride = Boolean(
|
|
86437
86696
|
forcedCustomizationId && overridesData?.items?.some((item) => item?.spec?.customizationId === forcedCustomizationId)
|
|
86438
86697
|
);
|
|
86439
|
-
const
|
|
86698
|
+
const hasMatchingPrefill = Boolean(
|
|
86699
|
+
customizationId && prefillsData?.items?.some((item) => item?.spec?.customizationId === customizationId)
|
|
86700
|
+
);
|
|
86701
|
+
const hasForcedMatchingPrefill = Boolean(
|
|
86702
|
+
forcedCustomizationId && prefillsData?.items?.some((item) => item?.spec?.customizationId === forcedCustomizationId)
|
|
86703
|
+
);
|
|
86704
|
+
const isResolutionReady = !customizationId || !overridesLoading && !prefillsLoading && !mappingLoading;
|
|
86440
86705
|
const resolvedCustomizationId = isResolutionReady ? hasMatchingOverride ? customizationId : hasForcedMatchingOverride ? forcedCustomizationId : forcingCustomization.fallbackId : void 0;
|
|
86706
|
+
const resolvedCustomizationIdPrefill = isResolutionReady ? hasMatchingPrefill ? customizationId : hasForcedMatchingPrefill ? forcedCustomizationId : forcingCustomization.fallbackId : void 0;
|
|
86441
86707
|
useEffect(() => {
|
|
86442
86708
|
if (!cluster) {
|
|
86443
86709
|
setIsLoading(false);
|
|
86444
86710
|
return;
|
|
86445
86711
|
}
|
|
86446
86712
|
if (!isResolutionReady) return;
|
|
86447
|
-
if (customizationId && !resolvedCustomizationId) return;
|
|
86713
|
+
if (customizationId && (!resolvedCustomizationId || !resolvedCustomizationIdPrefill)) return;
|
|
86448
86714
|
setIsLoading(true);
|
|
86449
86715
|
const payload = {
|
|
86450
86716
|
data,
|
|
86451
86717
|
cluster,
|
|
86452
|
-
customizationId: resolvedCustomizationId
|
|
86718
|
+
customizationId: resolvedCustomizationId,
|
|
86719
|
+
customizationIdPrefill: resolvedCustomizationIdPrefill
|
|
86453
86720
|
};
|
|
86454
86721
|
axios.post(`/api/clusters/${cluster}/openapi-bff/forms/formPrepare/prepareFormProps`, payload).then(({ data: data2 }) => {
|
|
86455
86722
|
if (data2.isNamespaced) {
|
|
@@ -86487,6 +86754,7 @@ const BlackholeFormProvider = ({
|
|
|
86487
86754
|
data,
|
|
86488
86755
|
customizationId,
|
|
86489
86756
|
resolvedCustomizationId,
|
|
86757
|
+
resolvedCustomizationIdPrefill,
|
|
86490
86758
|
isResolutionReady,
|
|
86491
86759
|
fallbackToManualMode,
|
|
86492
86760
|
applyForceViewMode
|
|
@@ -90859,7 +91127,8 @@ const useApiResourceSingle = ({
|
|
|
90859
91127
|
apiVersion,
|
|
90860
91128
|
plural,
|
|
90861
91129
|
name,
|
|
90862
|
-
refetchInterval
|
|
91130
|
+
refetchInterval,
|
|
91131
|
+
enabler
|
|
90863
91132
|
}) => {
|
|
90864
91133
|
return useQuery({
|
|
90865
91134
|
queryKey: ["useApiResourceSingle", cluster, namespace, apiGroup, apiVersion, plural, name],
|
|
@@ -90871,7 +91140,8 @@ const useApiResourceSingle = ({
|
|
|
90871
91140
|
plural,
|
|
90872
91141
|
name
|
|
90873
91142
|
})).data,
|
|
90874
|
-
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
91143
|
+
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
|
|
91144
|
+
enabled: enabler ?? true
|
|
90875
91145
|
});
|
|
90876
91146
|
};
|
|
90877
91147
|
|
|
@@ -90913,12 +91183,14 @@ const useBuiltinResourceSingle = ({
|
|
|
90913
91183
|
namespace,
|
|
90914
91184
|
plural,
|
|
90915
91185
|
name,
|
|
90916
|
-
refetchInterval
|
|
91186
|
+
refetchInterval,
|
|
91187
|
+
enabler
|
|
90917
91188
|
}) => {
|
|
90918
91189
|
return useQuery({
|
|
90919
91190
|
queryKey: ["useBuiltinResourceSingle", cluster, namespace, plural, name],
|
|
90920
91191
|
queryFn: async () => (await getBuiltinResourceSingle({ cluster, namespace, plural, name })).data,
|
|
90921
|
-
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
91192
|
+
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
|
|
91193
|
+
enabled: enabler ?? true
|
|
90922
91194
|
});
|
|
90923
91195
|
};
|
|
90924
91196
|
|
|
@@ -90974,7 +91246,7 @@ const useCrdResourceSingle = ({
|
|
|
90974
91246
|
});
|
|
90975
91247
|
};
|
|
90976
91248
|
|
|
90977
|
-
const useApisResourceTypes = ({ cluster }) => {
|
|
91249
|
+
const useApisResourceTypes = ({ cluster, enabler }) => {
|
|
90978
91250
|
return useQuery({
|
|
90979
91251
|
queryKey: ["useApisResourceTypes", cluster],
|
|
90980
91252
|
queryFn: async () => {
|
|
@@ -90985,13 +91257,15 @@ const useApisResourceTypes = ({ cluster }) => {
|
|
|
90985
91257
|
}
|
|
90986
91258
|
return data;
|
|
90987
91259
|
},
|
|
90988
|
-
refetchInterval: 5e3
|
|
91260
|
+
refetchInterval: 5e3,
|
|
91261
|
+
enabled: enabler ?? true
|
|
90989
91262
|
});
|
|
90990
91263
|
};
|
|
90991
91264
|
const useApiResourceTypesByGroup = ({
|
|
90992
91265
|
cluster,
|
|
90993
91266
|
apiGroup,
|
|
90994
|
-
apiVersion
|
|
91267
|
+
apiVersion,
|
|
91268
|
+
enabler
|
|
90995
91269
|
}) => {
|
|
90996
91270
|
return useQuery({
|
|
90997
91271
|
queryKey: ["useApiResourceTypesByGroup", cluster, apiGroup, apiVersion],
|
|
@@ -91007,11 +91281,12 @@ const useApiResourceTypesByGroup = ({
|
|
|
91007
91281
|
}
|
|
91008
91282
|
return data;
|
|
91009
91283
|
},
|
|
91010
|
-
refetchInterval: 5e3
|
|
91284
|
+
refetchInterval: 5e3,
|
|
91285
|
+
enabled: enabler ?? true
|
|
91011
91286
|
});
|
|
91012
91287
|
};
|
|
91013
91288
|
|
|
91014
|
-
const useBuiltinResourceTypes = ({ cluster }) => {
|
|
91289
|
+
const useBuiltinResourceTypes = ({ cluster, enabler }) => {
|
|
91015
91290
|
return useQuery({
|
|
91016
91291
|
queryKey: ["useBuiltinResourceTypes", cluster],
|
|
91017
91292
|
queryFn: async () => {
|
|
@@ -91022,7 +91297,8 @@ const useBuiltinResourceTypes = ({ cluster }) => {
|
|
|
91022
91297
|
}
|
|
91023
91298
|
return data;
|
|
91024
91299
|
},
|
|
91025
|
-
refetchInterval: 5e3
|
|
91300
|
+
refetchInterval: 5e3,
|
|
91301
|
+
enabled: enabler ?? true
|
|
91026
91302
|
});
|
|
91027
91303
|
};
|
|
91028
91304
|
|
|
@@ -91049,9 +91325,9 @@ const useCrdData = ({
|
|
|
91049
91325
|
});
|
|
91050
91326
|
};
|
|
91051
91327
|
|
|
91052
|
-
const useResourceScope = ({ plural, cluster, apiGroup, apiVersion }) => {
|
|
91328
|
+
const useResourceScope = ({ plural, cluster, apiGroup, apiVersion, enabler }) => {
|
|
91053
91329
|
const computedResourceType = apiGroup ? "api" : "builtin";
|
|
91054
|
-
const enabled = Boolean(cluster) && Boolean(plural) && (computedResourceType === "builtin" || Boolean(apiVersion));
|
|
91330
|
+
const enabled = (enabler ?? true) && Boolean(cluster) && Boolean(plural) && (computedResourceType === "builtin" || Boolean(apiVersion));
|
|
91055
91331
|
return useQuery({
|
|
91056
91332
|
queryKey: ["resource-scope", computedResourceType, cluster, plural, apiGroup, apiVersion],
|
|
91057
91333
|
enabled,
|
|
@@ -91094,4 +91370,4 @@ const usePluginManifest = ({
|
|
|
91094
91370
|
};
|
|
91095
91371
|
|
|
91096
91372
|
export { useInfiniteSentinel as $, getBuiltinResourceTypes as A, getCrdData as B, getDirectUnknownResource as C, DeleteIcon as D, EnrichedTableProvider as E, checkPermission as F, getSwagger as G, filterIfApiInstanceNamespaceScoped as H, filterIfBuiltInInstanceNamespaceScoped as I, checkIfApiInstanceNamespaceScoped as J, checkIfBuiltInInstanceNamespaceScoped as K, getKinds as L, useClusterList as M, useApiResources as N, useApiResourceSingle as O, PaddingContainer as P, useBuiltinResources as Q, ReadOnlyModal as R, useBuiltinResourceSingle as S, useCrdResources as T, useCrdResourceSingle as U, useApisResourceTypes as V, useApiResourceTypesByGroup as W, useBuiltinResourceTypes as X, useCrdData as Y, useListWatch as Z, _$1 as _, useTheme as a, parseQuotaValueCpu as a$, useK8sVerbs as a0, useManyK8sSmartResource as a1, useSmartResourceParams as a2, useResourceScope as a3, useKinds as a4, usePluginManifest as a5, Spacer$1 as a6, TreeWithSearch as a7, ConfirmModal as a8, UpIcon as a9, EnrichedTable as aA, ClusterListTable as aB, getEnrichedColumns as aC, getEnrichedColumnsWithControls as aD, YamlEditorSingleton$1 as aE, BlackholeFormProvider as aF, BlackholeForm as aG, getObjectFormItemsDraft as aH, MarketPlace as aI, MarketplaceCard as aJ, ProjectInfoCard as aK, PodTerminal as aL, NodeTerminal as aM, PodLogs as aN, PodLogsMonaco as aO, VMVNC as aP, Search as aQ, Events as aR, DynamicRenderer as aS, DynamicComponents as aT, DynamicRendererWithProviders as aU, prepareTemplate as aV, isFlatObject as aW, filterSelectOptions as aX, getStringByName as aY, floorToDecimal as aZ, parseQuotaValue as a_, DownIcon as aa, BackToDefaultIcon as ab, SuccessIcon as ac, feedbackIcons as ad, PlusIcon as ae, MinusIcon as af, LockedIcon as ag, UnlockedIcon as ah, PauseCircleIcon as ai, ResumeCircleIcon as aj, LookingGlassIcon as ak, EarthIcon as al, ContentCard$1 as am, FlexGrow as an, UncontrolledSelect as ao, CustomSelect$4 as ap, CursorPointerTag as aq, CursorPointerTagMinContent as ar, CursorDefaultDiv as as, ResourceLink as at, ManageableBreadcrumbsProvider as au, prepareDataForManageableBreadcrumbs as av, ManageableBreadcrumbs as aw, ManageableSidebarProvider as ax, prepareDataForManageableSidebar as ay, ManageableSidebar as az, usePartsOfUrl as b, parseQuotaValueMemoryAndStorage as b0, normalizeValuesForQuotasToNumber as b1, getAllPathsFromObj as b2, getPrefixSubarrays as b3, groupsToTreeData as b4, getBuiltinTreeData as b5, getGroupsByCategory as b6, createContextFactory as b7, prepareUrlsToFetchForDynamicRenderer as b8, deepMerge as b9, getSortedKinds as ba, getSortedKindsAll as bb, hslFromString as bc, getUppercase as bd, kindByGvr as be, pluralByKind as bf, namespacedByGvr as bg, getLinkToBuiltinForm as bh, getLinkToApiForm as bi, isMultilineString as bj, isMultilineFromYaml as bk, includesArray as bl, getResourceLink as bm, getNamespaceLink as bn, convertBytes as bo, formatBytesAuto as bp, toBytes as bq, convertStorage as br, parseValueWithUnit as bs, convertCores as bt, formatCoresAuto as bu, toCores as bv, convertCompute as bw, parseCoresWithUnit as bx, formatDateAuto as by, isValidRFC3339 as bz, usePermissions as c, useDirectUnknownResource as d, useK8sSmartResource as e, jsxRuntimeExports as f, EditIcon as g, getLinkToForm as h, DeleteModal as i, jp as j, DeleteModalMany as k, getClusterList as l, createNewEntry as m, updateEntry as n, deleteEntry as o, parseAll as p, getApiResources as q, getApiResourceSingle as r, serializeLabelsWithNoEncoding$1 as s, getBuiltinResources as t, useMultiQuery as u, getBuiltinResourceSingle as v, getCrdResources as w, getCrdResourceSingle as x, getApiResourceTypes as y, getApiResourceTypesByApiGroup as z };
|
|
91097
|
-
//# sourceMappingURL=index-
|
|
91373
|
+
//# sourceMappingURL=index-PHzKotN_.mjs.map
|