@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.13 → 1.1.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/openapi-k8s-toolkit.es.js +350 -379
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +350 -379
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/api/bff/scopes/checkScopes.d.ts +6 -6
- package/dist/types/api/bff/scopes/filterScopes.d.ts +4 -4
- package/dist/types/api/bff/search/getKinds.d.ts +2 -2
- package/dist/types/api/bff/swagger/getSwagger.d.ts +2 -2
- package/dist/types/api/getApiResource.d.ts +8 -8
- package/dist/types/api/getApiResourceTypes.d.ts +4 -4
- package/dist/types/api/getBuiltinResource.d.ts +8 -8
- package/dist/types/api/getBuiltinResourceTypes.d.ts +2 -2
- package/dist/types/api/getCrdData.d.ts +2 -2
- package/dist/types/api/getCrdResource.d.ts +5 -5
- package/dist/types/api/permissions.d.ts +4 -4
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.d.ts +3 -3
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/BlackholeFormProvider.d.ts +3 -3
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/types.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/EnrichedTableProvider.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/utils.d.ts +1 -1
- package/dist/types/components/molecules/Events/Events.d.ts +2 -2
- package/dist/types/components/molecules/MarketPlace/MarketPlace.d.ts +3 -3
- package/dist/types/components/molecules/MarketPlace/molecules/AddEditFormModal/AddEditFormModal.d.ts +3 -3
- package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/MarketplaceCard.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/utils.d.ts +9 -9
- package/dist/types/components/molecules/ProjectInfoCard/ProjectInfoCard.d.ts +3 -3
- package/dist/types/components/molecules/YamlEditorSingleton/YamlEditorSingleton.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/RefsList.d.ts +2 -2
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +18 -18
- package/dist/types/hooks/useApiResource.d.ts +8 -8
- package/dist/types/hooks/useApisResourceTypes.d.ts +4 -4
- package/dist/types/hooks/useBuiltinResource.d.ts +8 -8
- package/dist/types/hooks/useBuiltinResourceTypes.d.ts +2 -2
- package/dist/types/hooks/useCrdData.d.ts +2 -2
- package/dist/types/hooks/useCrdResource.d.ts +5 -5
- package/dist/types/hooks/useK8sSmartResource.d.ts +3 -3
- package/dist/types/hooks/usePermissions.d.ts +4 -4
- package/dist/types/localTypes/bff/form.d.ts +5 -5
- package/dist/types/localTypes/bff/scopes.d.ts +6 -6
- package/dist/types/localTypes/bff/table.d.ts +2 -2
- package/dist/types/localTypes/form.d.ts +2 -2
- package/dist/types/localTypes/marketplace.d.ts +1 -1
- package/dist/types/utils/getGroupsByCategory/getGroupsByCategory.d.ts +2 -2
- package/dist/types/utils/tableLocations/tableLocations.d.ts +5 -5
- package/package.json +1 -1
|
@@ -7892,6 +7892,13 @@ const patchEntryWithReplaceOp = async ({
|
|
|
7892
7892
|
"Content-Type": "application/json-patch+json"
|
|
7893
7893
|
}
|
|
7894
7894
|
};
|
|
7895
|
+
const addOp = [
|
|
7896
|
+
{
|
|
7897
|
+
op: "add",
|
|
7898
|
+
path: pathToValue,
|
|
7899
|
+
value: body
|
|
7900
|
+
}
|
|
7901
|
+
];
|
|
7895
7902
|
const replaceOp = [
|
|
7896
7903
|
{
|
|
7897
7904
|
op: "replace",
|
|
@@ -7900,24 +7907,11 @@ const patchEntryWithReplaceOp = async ({
|
|
|
7900
7907
|
}
|
|
7901
7908
|
];
|
|
7902
7909
|
try {
|
|
7903
|
-
|
|
7910
|
+
await axios.patch(endpoint, addOp, config);
|
|
7904
7911
|
} catch (error) {
|
|
7905
|
-
|
|
7906
|
-
throw error;
|
|
7907
|
-
}
|
|
7908
|
-
const status = error.response?.status;
|
|
7909
|
-
if (status !== 422) {
|
|
7910
|
-
throw error;
|
|
7911
|
-
}
|
|
7912
|
-
const addOp = [
|
|
7913
|
-
{
|
|
7914
|
-
op: "add",
|
|
7915
|
-
path: pathToValue,
|
|
7916
|
-
value: body
|
|
7917
|
-
}
|
|
7918
|
-
];
|
|
7919
|
-
return axios.patch(endpoint, addOp, config);
|
|
7912
|
+
console.error(`Error trying to add: ${error}`);
|
|
7920
7913
|
}
|
|
7914
|
+
return axios.patch(endpoint, replaceOp, config);
|
|
7921
7915
|
};
|
|
7922
7916
|
const patchEntryWithDeleteOp = async ({
|
|
7923
7917
|
endpoint,
|
|
@@ -9183,23 +9177,23 @@ const useListWatch = ({
|
|
|
9183
9177
|
};
|
|
9184
9178
|
};
|
|
9185
9179
|
|
|
9186
|
-
const buildApiPrefix = (
|
|
9187
|
-
const g = (
|
|
9188
|
-
const v = (
|
|
9180
|
+
const buildApiPrefix = (apiGroup, apiVersion) => {
|
|
9181
|
+
const g = (apiGroup ?? "").trim();
|
|
9182
|
+
const v = (apiVersion ?? "").trim();
|
|
9189
9183
|
const isCore = !g || g === "core" || g === "v1";
|
|
9190
9184
|
return isCore ? `/api/${v}` : `/apis/${g}/${v}`;
|
|
9191
9185
|
};
|
|
9192
9186
|
const buildListUri = ({
|
|
9193
9187
|
cluster,
|
|
9194
|
-
|
|
9195
|
-
|
|
9188
|
+
apiGroup,
|
|
9189
|
+
apiVersion,
|
|
9196
9190
|
plural,
|
|
9197
9191
|
namespace,
|
|
9198
9192
|
fieldSelector,
|
|
9199
9193
|
labelSelector,
|
|
9200
9194
|
limit
|
|
9201
9195
|
}) => {
|
|
9202
|
-
const prefix = buildApiPrefix(
|
|
9196
|
+
const prefix = buildApiPrefix(apiGroup, apiVersion);
|
|
9203
9197
|
const ns = namespace ? `/namespaces/${namespace}` : "";
|
|
9204
9198
|
const base = `/api/clusters/${cluster}/k8s${prefix}${ns}/${plural}/`;
|
|
9205
9199
|
const params = new URLSearchParams();
|
|
@@ -9210,8 +9204,8 @@ const buildListUri = ({
|
|
|
9210
9204
|
};
|
|
9211
9205
|
const useK8sSmartResource = ({
|
|
9212
9206
|
cluster,
|
|
9213
|
-
|
|
9214
|
-
|
|
9207
|
+
apiGroup,
|
|
9208
|
+
apiVersion,
|
|
9215
9209
|
plural,
|
|
9216
9210
|
namespace,
|
|
9217
9211
|
fieldSelector,
|
|
@@ -9229,15 +9223,15 @@ const useK8sSmartResource = ({
|
|
|
9229
9223
|
error: verbsErrorObj
|
|
9230
9224
|
} = useK8sVerbs({
|
|
9231
9225
|
cluster,
|
|
9232
|
-
group,
|
|
9233
|
-
version,
|
|
9226
|
+
group: apiGroup,
|
|
9227
|
+
version: apiVersion,
|
|
9234
9228
|
plural,
|
|
9235
9229
|
isEnabled: Boolean(isEnabled && cluster && cluster.length > 0)
|
|
9236
9230
|
});
|
|
9237
9231
|
const listUri = buildListUri({
|
|
9238
9232
|
cluster,
|
|
9239
|
-
|
|
9240
|
-
|
|
9233
|
+
apiGroup,
|
|
9234
|
+
apiVersion,
|
|
9241
9235
|
plural,
|
|
9242
9236
|
namespace,
|
|
9243
9237
|
fieldSelector,
|
|
@@ -9257,8 +9251,8 @@ const useK8sSmartResource = ({
|
|
|
9257
9251
|
queryKey: [
|
|
9258
9252
|
"k8s-list",
|
|
9259
9253
|
cluster,
|
|
9260
|
-
|
|
9261
|
-
|
|
9254
|
+
apiGroup || "",
|
|
9255
|
+
apiVersion,
|
|
9262
9256
|
namespace || "",
|
|
9263
9257
|
plural,
|
|
9264
9258
|
fieldSelector || "",
|
|
@@ -9279,8 +9273,8 @@ const useK8sSmartResource = ({
|
|
|
9279
9273
|
isEnabled: watchEnabled,
|
|
9280
9274
|
pageSize: limit,
|
|
9281
9275
|
query: {
|
|
9282
|
-
apiGroup
|
|
9283
|
-
apiVersion
|
|
9276
|
+
apiGroup,
|
|
9277
|
+
apiVersion,
|
|
9284
9278
|
plural,
|
|
9285
9279
|
namespace,
|
|
9286
9280
|
fieldSelector,
|
|
@@ -9379,9 +9373,9 @@ const ManageableBreadcrumbsProvider = ({
|
|
|
9379
9373
|
isError: rawDataError,
|
|
9380
9374
|
isLoading: rawDataLoading
|
|
9381
9375
|
} = useK8sSmartResource({
|
|
9382
|
-
cluster
|
|
9383
|
-
|
|
9384
|
-
|
|
9376
|
+
cluster,
|
|
9377
|
+
apiGroup,
|
|
9378
|
+
apiVersion,
|
|
9385
9379
|
plural,
|
|
9386
9380
|
isEnabled
|
|
9387
9381
|
});
|
|
@@ -9591,8 +9585,8 @@ const ManageableSidebarProvider = ({
|
|
|
9591
9585
|
isLoading: rawDataLoading
|
|
9592
9586
|
} = useK8sSmartResource({
|
|
9593
9587
|
cluster,
|
|
9594
|
-
|
|
9595
|
-
|
|
9588
|
+
apiGroup,
|
|
9589
|
+
apiVersion,
|
|
9596
9590
|
plural,
|
|
9597
9591
|
isEnabled
|
|
9598
9592
|
});
|
|
@@ -34219,21 +34213,15 @@ const ProjectInfoCard$1 = ({
|
|
|
34219
34213
|
data,
|
|
34220
34214
|
children
|
|
34221
34215
|
}) => {
|
|
34222
|
-
const { id,
|
|
34216
|
+
const { id, cluster, namespace, accessGroups, ...props } = data;
|
|
34223
34217
|
const { data: multiQueryData, isError, errors } = useMultiQuery();
|
|
34224
34218
|
const partsOfUrl = usePartsOfUrl();
|
|
34225
34219
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
34226
34220
|
acc[index.toString()] = value;
|
|
34227
34221
|
return acc;
|
|
34228
34222
|
}, {});
|
|
34229
|
-
const
|
|
34230
|
-
|
|
34231
|
-
replaceValues
|
|
34232
|
-
});
|
|
34233
|
-
const namespace = prepareTemplate({
|
|
34234
|
-
template: namespacePartOfUrl,
|
|
34235
|
-
replaceValues
|
|
34236
|
-
});
|
|
34223
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
34224
|
+
const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
|
|
34237
34225
|
const parsedAccessGroups = accessGroups.map(
|
|
34238
34226
|
(accessGroup) => parseAll({ text: accessGroup, replaceValues, multiQueryData })
|
|
34239
34227
|
);
|
|
@@ -34243,7 +34231,7 @@ const ProjectInfoCard$1 = ({
|
|
|
34243
34231
|
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34244
34232
|
] });
|
|
34245
34233
|
}
|
|
34246
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, {
|
|
34234
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, { cluster: clusterPrepared, namespace: namespacePrepared, accessGroups: parsedAccessGroups, ...props, children });
|
|
34247
34235
|
};
|
|
34248
34236
|
|
|
34249
34237
|
const MarketplaceCard$1 = ({
|
|
@@ -34251,21 +34239,22 @@ const MarketplaceCard$1 = ({
|
|
|
34251
34239
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34252
34240
|
children
|
|
34253
34241
|
}) => {
|
|
34254
|
-
const { id,
|
|
34242
|
+
const { id, cluster, namespace, ...props } = data;
|
|
34243
|
+
const { data: multiQueryData, isError, errors } = useMultiQuery();
|
|
34255
34244
|
const partsOfUrl = usePartsOfUrl();
|
|
34256
34245
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
34257
34246
|
acc[index.toString()] = value;
|
|
34258
34247
|
return acc;
|
|
34259
34248
|
}, {});
|
|
34260
|
-
const
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34264
|
-
|
|
34265
|
-
|
|
34266
|
-
|
|
34267
|
-
}
|
|
34268
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(MarketPlace, {
|
|
34249
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
34250
|
+
const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
|
|
34251
|
+
if (isError) {
|
|
34252
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
34254
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34255
|
+
] });
|
|
34256
|
+
}
|
|
34257
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(MarketPlace, { cluster: clusterPrepared, namespace: namespacePrepared, ...props });
|
|
34269
34258
|
};
|
|
34270
34259
|
|
|
34271
34260
|
const ContentCard = ({
|
|
@@ -34393,7 +34382,7 @@ const SidebarProvider = ({
|
|
|
34393
34382
|
};
|
|
34394
34383
|
|
|
34395
34384
|
const checkPermission = async ({
|
|
34396
|
-
|
|
34385
|
+
cluster,
|
|
34397
34386
|
body
|
|
34398
34387
|
}) => {
|
|
34399
34388
|
const data = JSON.stringify({
|
|
@@ -34401,15 +34390,15 @@ const checkPermission = async ({
|
|
|
34401
34390
|
kind: "SelfSubjectAccessReview",
|
|
34402
34391
|
spec: {
|
|
34403
34392
|
resourceAttributes: {
|
|
34404
|
-
...body.
|
|
34405
|
-
resource: body.
|
|
34393
|
+
...body.apiGroup ? { group: body.apiGroup } : {},
|
|
34394
|
+
resource: body.plural,
|
|
34406
34395
|
verb: body.verb,
|
|
34407
34396
|
...body.namespace ? { namespace: body.namespace } : {},
|
|
34408
34397
|
...body.name ? { name: body.name } : {}
|
|
34409
34398
|
}
|
|
34410
34399
|
}
|
|
34411
34400
|
});
|
|
34412
|
-
return axios.post(`/api/clusters/${
|
|
34401
|
+
return axios.post(`/api/clusters/${cluster}/k8s/apis/authorization.k8s.io/v1/selfsubjectaccessreviews`, data, {
|
|
34413
34402
|
method: "POST",
|
|
34414
34403
|
headers: {
|
|
34415
34404
|
"Content-Type": "application/json"
|
|
@@ -34418,23 +34407,23 @@ const checkPermission = async ({
|
|
|
34418
34407
|
};
|
|
34419
34408
|
|
|
34420
34409
|
const usePermissions = ({
|
|
34421
|
-
|
|
34410
|
+
cluster,
|
|
34422
34411
|
namespace,
|
|
34423
|
-
|
|
34424
|
-
|
|
34412
|
+
apiGroup,
|
|
34413
|
+
plural,
|
|
34425
34414
|
verb,
|
|
34426
34415
|
name,
|
|
34427
34416
|
refetchInterval,
|
|
34428
34417
|
enabler
|
|
34429
34418
|
}) => {
|
|
34430
34419
|
return useQuery({
|
|
34431
|
-
queryKey: ["usePermissions",
|
|
34420
|
+
queryKey: ["usePermissions", cluster, namespace, apiGroup, plural, verb, name],
|
|
34432
34421
|
queryFn: async () => (await checkPermission({
|
|
34433
|
-
|
|
34422
|
+
cluster,
|
|
34434
34423
|
body: {
|
|
34435
34424
|
namespace,
|
|
34436
|
-
|
|
34437
|
-
|
|
34425
|
+
apiGroup,
|
|
34426
|
+
plural,
|
|
34438
34427
|
verb
|
|
34439
34428
|
}
|
|
34440
34429
|
})).data,
|
|
@@ -34451,7 +34440,7 @@ const getLinkToBuiltinForm = ({
|
|
|
34451
34440
|
baseprefix,
|
|
34452
34441
|
namespace,
|
|
34453
34442
|
syntheticProject,
|
|
34454
|
-
|
|
34443
|
+
plural,
|
|
34455
34444
|
inside,
|
|
34456
34445
|
fullPath
|
|
34457
34446
|
}) => {
|
|
@@ -34460,7 +34449,7 @@ const getLinkToBuiltinForm = ({
|
|
|
34460
34449
|
const backlink = getBackLinkToTable({
|
|
34461
34450
|
fullPath
|
|
34462
34451
|
});
|
|
34463
|
-
return `${mainRoute}/forms/builtin/v1/${
|
|
34452
|
+
return `${mainRoute}/forms/builtin/v1/${plural}?backlink=${backlink}`;
|
|
34464
34453
|
};
|
|
34465
34454
|
const getLinkToApiForm = ({
|
|
34466
34455
|
cluster,
|
|
@@ -34469,7 +34458,7 @@ const getLinkToApiForm = ({
|
|
|
34469
34458
|
syntheticProject,
|
|
34470
34459
|
apiGroup,
|
|
34471
34460
|
apiVersion,
|
|
34472
|
-
|
|
34461
|
+
plural,
|
|
34473
34462
|
inside,
|
|
34474
34463
|
fullPath
|
|
34475
34464
|
}) => {
|
|
@@ -34478,7 +34467,7 @@ const getLinkToApiForm = ({
|
|
|
34478
34467
|
const backlink = getBackLinkToTable({
|
|
34479
34468
|
fullPath
|
|
34480
34469
|
});
|
|
34481
|
-
return `${mainRoute}/forms/apis/${apiGroup}/${apiVersion}/${
|
|
34470
|
+
return `${mainRoute}/forms/apis/${apiGroup}/${apiVersion}/${plural}?backlink=${backlink}`;
|
|
34482
34471
|
};
|
|
34483
34472
|
const getLinkToForm = ({
|
|
34484
34473
|
apiGroup,
|
|
@@ -34525,7 +34514,7 @@ const EnrichedTable$1 = ({
|
|
|
34525
34514
|
fetchUrl,
|
|
34526
34515
|
k8sResourceToFetch,
|
|
34527
34516
|
pathToItems,
|
|
34528
|
-
|
|
34517
|
+
cluster,
|
|
34529
34518
|
labelSelector,
|
|
34530
34519
|
labelSelectorFull,
|
|
34531
34520
|
fieldSelector,
|
|
@@ -34541,36 +34530,33 @@ const EnrichedTable$1 = ({
|
|
|
34541
34530
|
acc[index.toString()] = value;
|
|
34542
34531
|
return acc;
|
|
34543
34532
|
}, {});
|
|
34544
|
-
const
|
|
34545
|
-
template: clusterNamePartOfUrl,
|
|
34546
|
-
replaceValues
|
|
34547
|
-
});
|
|
34533
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
34548
34534
|
const namespacePrepared = namespace ? parseAll({ text: namespace, replaceValues, multiQueryData }) : void 0;
|
|
34549
34535
|
const k8sResourcePrePrepared = k8sResource ? {
|
|
34550
34536
|
apiGroup: k8sResource.apiGroup ? parseAll({ text: k8sResource.apiGroup, replaceValues, multiQueryData }) : void 0,
|
|
34551
34537
|
apiVersion: parseAll({ text: k8sResource.apiVersion, replaceValues, multiQueryData }),
|
|
34552
|
-
|
|
34538
|
+
plural: parseAll({ text: k8sResource.plural, replaceValues, multiQueryData })
|
|
34553
34539
|
} : void 0;
|
|
34554
|
-
const k8sResourcePrepared = k8sResourcePrePrepared?.apiGroup === "-" ? { apiVersion: k8sResourcePrePrepared.apiVersion,
|
|
34540
|
+
const k8sResourcePrepared = k8sResourcePrePrepared?.apiGroup === "-" ? { apiVersion: k8sResourcePrePrepared.apiVersion, plural: k8sResourcePrePrepared.plural } : k8sResourcePrePrepared;
|
|
34555
34541
|
const dataForControlsPrepared = dataForControls ? {
|
|
34556
|
-
cluster:
|
|
34542
|
+
cluster: clusterPrepared,
|
|
34557
34543
|
syntheticProject: dataForControls.syntheticProject ? parseAll({ text: dataForControls.syntheticProject, replaceValues, multiQueryData }) : void 0,
|
|
34558
|
-
|
|
34544
|
+
plural: parseAll({ text: dataForControls.plural, replaceValues, multiQueryData }),
|
|
34559
34545
|
apiGroup: dataForControls.apiGroup ? parseAll({ text: dataForControls.apiGroup, replaceValues, multiQueryData }) : void 0,
|
|
34560
34546
|
apiVersion: parseAll({ text: dataForControls.apiVersion, replaceValues, multiQueryData })
|
|
34561
34547
|
} : void 0;
|
|
34562
34548
|
const createPermission = usePermissions({
|
|
34563
|
-
|
|
34564
|
-
|
|
34549
|
+
apiGroup: dataForControlsPrepared?.apiGroup,
|
|
34550
|
+
plural: dataForControlsPrepared?.plural || "",
|
|
34565
34551
|
namespace: namespacePrepared,
|
|
34566
|
-
|
|
34552
|
+
cluster: clusterPrepared,
|
|
34567
34553
|
verb: "create",
|
|
34568
34554
|
refetchInterval: false
|
|
34569
34555
|
});
|
|
34570
34556
|
const fetchUrlPrepared = fetchUrl ? parseAll({ text: fetchUrl, replaceValues, multiQueryData }) : void 0;
|
|
34571
34557
|
const k8sResourceToFetchPrepared = k8sResourceToFetch ? {
|
|
34572
|
-
|
|
34573
|
-
|
|
34558
|
+
apiGroup: k8sResourceToFetch.apiGroup ? parseAll({ text: k8sResourceToFetch.apiGroup, replaceValues, multiQueryData }) : void 0,
|
|
34559
|
+
apiVersion: parseAll({ text: k8sResourceToFetch.apiVersion, replaceValues, multiQueryData }),
|
|
34574
34560
|
plural: parseAll({ text: k8sResourceToFetch.plural, replaceValues, multiQueryData }),
|
|
34575
34561
|
namespace: k8sResourceToFetch.namespace ? parseAll({ text: k8sResourceToFetch.namespace, replaceValues, multiQueryData }) : void 0
|
|
34576
34562
|
} : void 0;
|
|
@@ -34617,10 +34603,10 @@ const EnrichedTable$1 = ({
|
|
|
34617
34603
|
isLoading: isFetchedDataSocketLoading,
|
|
34618
34604
|
error: fetchedDataSocketError
|
|
34619
34605
|
} = useK8sSmartResource({
|
|
34620
|
-
cluster:
|
|
34606
|
+
cluster: clusterPrepared || "",
|
|
34621
34607
|
namespace: k8sResourceToFetchPrepared?.namespace,
|
|
34622
|
-
|
|
34623
|
-
|
|
34608
|
+
apiGroup: k8sResourceToFetchPrepared?.apiGroup,
|
|
34609
|
+
apiVersion: k8sResourceToFetchPrepared?.apiVersion || "",
|
|
34624
34610
|
plural: k8sResourceToFetchPrepared?.plural || "",
|
|
34625
34611
|
fieldSelector: sParams.get("fieldSelector") || void 0,
|
|
34626
34612
|
labelSelector: sParams.get("labelSelector") || void 0,
|
|
@@ -34671,7 +34657,7 @@ const EnrichedTable$1 = ({
|
|
|
34671
34657
|
EnrichedTableProvider,
|
|
34672
34658
|
{
|
|
34673
34659
|
tableMappingsReplaceValues: replaceValues,
|
|
34674
|
-
cluster:
|
|
34660
|
+
cluster: clusterPrepared,
|
|
34675
34661
|
namespace: namespacePrepared,
|
|
34676
34662
|
theme,
|
|
34677
34663
|
dataItems: items,
|
|
@@ -34705,13 +34691,13 @@ const EnrichedTable$1 = ({
|
|
|
34705
34691
|
type: "primary",
|
|
34706
34692
|
onClick: () => {
|
|
34707
34693
|
const url = getLinkToForm({
|
|
34708
|
-
cluster:
|
|
34694
|
+
cluster: clusterPrepared,
|
|
34709
34695
|
baseprefix,
|
|
34710
34696
|
namespace: namespacePrepared,
|
|
34711
34697
|
syntheticProject: params.syntheticProject,
|
|
34712
34698
|
apiGroup: dataForControlsPrepared.apiGroup,
|
|
34713
34699
|
apiVersion: dataForControlsPrepared.apiVersion,
|
|
34714
|
-
|
|
34700
|
+
plural: dataForControlsPrepared.plural,
|
|
34715
34701
|
fullPath
|
|
34716
34702
|
});
|
|
34717
34703
|
navigate(url);
|
|
@@ -34792,7 +34778,7 @@ const PodTerminal$1 = ({
|
|
|
34792
34778
|
} = useK8sSmartResource({
|
|
34793
34779
|
cluster: clusterPrepared,
|
|
34794
34780
|
namespace: namespacePrepared,
|
|
34795
|
-
|
|
34781
|
+
apiVersion: "v1",
|
|
34796
34782
|
plural: "pods",
|
|
34797
34783
|
fieldSelector: `metadata.name=${podNamePrepared}`,
|
|
34798
34784
|
isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
|
|
@@ -34911,7 +34897,7 @@ const PodLogs$1 = ({
|
|
|
34911
34897
|
} = useK8sSmartResource({
|
|
34912
34898
|
cluster: clusterPrepared,
|
|
34913
34899
|
namespace: namespacePrepared,
|
|
34914
|
-
|
|
34900
|
+
apiVersion: "v1",
|
|
34915
34901
|
plural: "pods",
|
|
34916
34902
|
fieldSelector: `metadata.name=${podNamePrepared}`,
|
|
34917
34903
|
isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
|
|
@@ -34997,7 +34983,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
34997
34983
|
type,
|
|
34998
34984
|
apiGroup,
|
|
34999
34985
|
apiVersion,
|
|
35000
|
-
|
|
34986
|
+
plural,
|
|
35001
34987
|
forcedKind,
|
|
35002
34988
|
prefillValuesRequestIndex,
|
|
35003
34989
|
pathToData,
|
|
@@ -35025,7 +35011,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
35025
35011
|
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
35026
35012
|
const apiGroupPrepared = apiGroup ? parseAll({ text: apiGroup, replaceValues, multiQueryData }) : "no-api-group";
|
|
35027
35013
|
const apiVersionPrepared = apiVersion ? parseAll({ text: apiVersion, replaceValues, multiQueryData }) : "no-api-version";
|
|
35028
|
-
const
|
|
35014
|
+
const pluralPrepared = parseAll({ text: plural, replaceValues, multiQueryData });
|
|
35029
35015
|
const prefillValuesRaw = multiQueryData[`req${prefillValuesRequestIndex}`];
|
|
35030
35016
|
const prefillValues = pathToData ? getDataByPath({ prefillValuesRaw, pathToData }) : prefillValuesRaw;
|
|
35031
35017
|
const prefillValuesWithForces = getPrefillValuesWithForces({ prefillValues, forcedKind, apiGroup, apiVersion });
|
|
@@ -35043,7 +35029,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
35043
35029
|
isCreate: false,
|
|
35044
35030
|
type,
|
|
35045
35031
|
apiGroupApiVersion: type === "builtin" ? "api/v1" : `${apiGroupPrepared}/${apiVersionPrepared}`,
|
|
35046
|
-
|
|
35032
|
+
plural: pluralPrepared,
|
|
35047
35033
|
designNewLayout: true,
|
|
35048
35034
|
designNewLayoutHeight: height,
|
|
35049
35035
|
openNotification: true,
|
|
@@ -38030,7 +38016,7 @@ const Events$1 = ({
|
|
|
38030
38016
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38031
38017
|
id,
|
|
38032
38018
|
baseprefix,
|
|
38033
|
-
|
|
38019
|
+
cluster,
|
|
38034
38020
|
wsUrl,
|
|
38035
38021
|
pageSize,
|
|
38036
38022
|
substractHeight,
|
|
@@ -38043,8 +38029,8 @@ const Events$1 = ({
|
|
|
38043
38029
|
baseFactoryNamespacedBuiltinKey,
|
|
38044
38030
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38045
38031
|
baseNamespaceFactoryKey,
|
|
38046
|
-
|
|
38047
|
-
|
|
38032
|
+
baseNavigationPlural,
|
|
38033
|
+
baseNavigationName,
|
|
38048
38034
|
...props
|
|
38049
38035
|
} = data;
|
|
38050
38036
|
const theme = useTheme();
|
|
@@ -38053,10 +38039,7 @@ const Events$1 = ({
|
|
|
38053
38039
|
acc[index.toString()] = value;
|
|
38054
38040
|
return acc;
|
|
38055
38041
|
}, {});
|
|
38056
|
-
const
|
|
38057
|
-
template: clusterNamePartOfUrl,
|
|
38058
|
-
replaceValues
|
|
38059
|
-
});
|
|
38042
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
38060
38043
|
const wsUrlPrepared = parseAll({ text: wsUrl, replaceValues, multiQueryData });
|
|
38061
38044
|
const params = new URLSearchParams();
|
|
38062
38045
|
if (limit) {
|
|
@@ -38100,7 +38083,7 @@ const Events$1 = ({
|
|
|
38100
38083
|
{
|
|
38101
38084
|
theme,
|
|
38102
38085
|
baseprefix,
|
|
38103
|
-
cluster:
|
|
38086
|
+
cluster: clusterPrepared,
|
|
38104
38087
|
wsUrl: wsUrlWithParams,
|
|
38105
38088
|
pageSize,
|
|
38106
38089
|
substractHeight: substractHeight || 340,
|
|
@@ -38109,8 +38092,8 @@ const Events$1 = ({
|
|
|
38109
38092
|
baseFactoryNamespacedBuiltinKey,
|
|
38110
38093
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38111
38094
|
baseNamespaceFactoryKey,
|
|
38112
|
-
|
|
38113
|
-
|
|
38095
|
+
baseNavigationPlural,
|
|
38096
|
+
baseNavigationName,
|
|
38114
38097
|
...props
|
|
38115
38098
|
}
|
|
38116
38099
|
),
|
|
@@ -38118,8 +38101,8 @@ const Events$1 = ({
|
|
|
38118
38101
|
] });
|
|
38119
38102
|
};
|
|
38120
38103
|
|
|
38121
|
-
const getKinds = async ({
|
|
38122
|
-
const result = await axios.get(`/api/clusters/${
|
|
38104
|
+
const getKinds = async ({ cluster }) => {
|
|
38105
|
+
const result = await axios.get(`/api/clusters/${cluster}/openapi-bff/search/kinds/getKinds`);
|
|
38123
38106
|
return result.data;
|
|
38124
38107
|
};
|
|
38125
38108
|
|
|
@@ -38316,14 +38299,14 @@ const RefsList = ({
|
|
|
38316
38299
|
baseFactoryClusterSceopedAPIKey,
|
|
38317
38300
|
baseFactoryNamespacedBuiltinKey,
|
|
38318
38301
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38319
|
-
|
|
38320
|
-
|
|
38302
|
+
baseNavigationPlural,
|
|
38303
|
+
baseNavigationName,
|
|
38321
38304
|
listFlexProps
|
|
38322
38305
|
}) => {
|
|
38323
38306
|
const [kindIndex, setKindIndex] = useState();
|
|
38324
38307
|
const [kindsWithVersion, setKindWithVersion] = useState();
|
|
38325
38308
|
useEffect(() => {
|
|
38326
|
-
getKinds({
|
|
38309
|
+
getKinds({ cluster }).then((data) => {
|
|
38327
38310
|
setKindIndex(data);
|
|
38328
38311
|
setKindWithVersion(getSortedKindsAll(data));
|
|
38329
38312
|
}).catch((error) => {
|
|
@@ -38332,10 +38315,10 @@ const RefsList = ({
|
|
|
38332
38315
|
}, [cluster]);
|
|
38333
38316
|
const { data: navigationDataArr } = useK8sSmartResource({
|
|
38334
38317
|
cluster,
|
|
38335
|
-
|
|
38336
|
-
|
|
38337
|
-
plural:
|
|
38338
|
-
fieldSelector: `metadata.name=${
|
|
38318
|
+
apiGroup: "front.in-cloud.io",
|
|
38319
|
+
apiVersion: "v1alpha1",
|
|
38320
|
+
plural: baseNavigationPlural,
|
|
38321
|
+
fieldSelector: `metadata.name=${baseNavigationName}`
|
|
38339
38322
|
});
|
|
38340
38323
|
const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
|
|
38341
38324
|
const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
|
|
@@ -38385,7 +38368,7 @@ const OwnerRefs = ({
|
|
|
38385
38368
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38386
38369
|
id,
|
|
38387
38370
|
baseprefix,
|
|
38388
|
-
|
|
38371
|
+
cluster,
|
|
38389
38372
|
reqIndex,
|
|
38390
38373
|
errorText,
|
|
38391
38374
|
notArrayErrorText,
|
|
@@ -38402,8 +38385,8 @@ const OwnerRefs = ({
|
|
|
38402
38385
|
baseFactoryClusterSceopedAPIKey,
|
|
38403
38386
|
baseFactoryNamespacedBuiltinKey,
|
|
38404
38387
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38405
|
-
|
|
38406
|
-
|
|
38388
|
+
baseNavigationPlural,
|
|
38389
|
+
baseNavigationName,
|
|
38407
38390
|
...props
|
|
38408
38391
|
} = data;
|
|
38409
38392
|
const theme = useTheme();
|
|
@@ -38412,10 +38395,7 @@ const OwnerRefs = ({
|
|
|
38412
38395
|
acc[index.toString()] = value;
|
|
38413
38396
|
return acc;
|
|
38414
38397
|
}, {});
|
|
38415
|
-
const
|
|
38416
|
-
template: clusterNamePartOfUrl,
|
|
38417
|
-
replaceValues
|
|
38418
|
-
});
|
|
38398
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
38419
38399
|
const preparedForcedApiVersion = forcedApiVersion ? forcedApiVersion.map(({ kind, apiVersion }) => ({
|
|
38420
38400
|
kind: prepareTemplate({
|
|
38421
38401
|
template: kind,
|
|
@@ -38461,7 +38441,7 @@ const OwnerRefs = ({
|
|
|
38461
38441
|
{
|
|
38462
38442
|
theme,
|
|
38463
38443
|
baseprefix,
|
|
38464
|
-
cluster:
|
|
38444
|
+
cluster: clusterPrepared,
|
|
38465
38445
|
refsArr: guardedRefsArr,
|
|
38466
38446
|
keysToForcedLabel,
|
|
38467
38447
|
forcedRelatedValuePath,
|
|
@@ -38472,8 +38452,8 @@ const OwnerRefs = ({
|
|
|
38472
38452
|
baseFactoryClusterSceopedAPIKey,
|
|
38473
38453
|
baseFactoryNamespacedBuiltinKey,
|
|
38474
38454
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38475
|
-
|
|
38476
|
-
|
|
38455
|
+
baseNavigationPlural,
|
|
38456
|
+
baseNavigationName,
|
|
38477
38457
|
listFlexProps,
|
|
38478
38458
|
...props
|
|
38479
38459
|
}
|
|
@@ -38797,7 +38777,15 @@ const prepareUrlsToFetchForDynamicRenderer = ({
|
|
|
38797
38777
|
);
|
|
38798
38778
|
};
|
|
38799
38779
|
|
|
38800
|
-
const STRING_KEYS = [
|
|
38780
|
+
const STRING_KEYS = [
|
|
38781
|
+
"cluster",
|
|
38782
|
+
"apiGroup",
|
|
38783
|
+
"apiVersion",
|
|
38784
|
+
"plural",
|
|
38785
|
+
"namespace",
|
|
38786
|
+
"fieldSelector",
|
|
38787
|
+
"labelSelector"
|
|
38788
|
+
];
|
|
38801
38789
|
const DynamicRendererWithProviders = (props) => {
|
|
38802
38790
|
const location = useLocation();
|
|
38803
38791
|
const { urlsToFetch, dataToApplyToContext, theme, nodeTerminalDefaultProfile, disableEventBubbling } = props;
|
|
@@ -39089,13 +39077,13 @@ const getEnrichedColumnsWithControls = ({
|
|
|
39089
39077
|
domEvent.preventDefault();
|
|
39090
39078
|
if (key === "edit") {
|
|
39091
39079
|
navigate(
|
|
39092
|
-
`${baseprefix}/${value.cluster}${value.namespace ? `/${value.namespace}` : ""}${value.syntheticProject ? `/${value.syntheticProject}` : ""}/${value.pathPrefix}/${value.apiGroupAndVersion}/${value.
|
|
39080
|
+
`${baseprefix}/${value.cluster}${value.namespace ? `/${value.namespace}` : ""}${value.syntheticProject ? `/${value.syntheticProject}` : ""}/${value.pathPrefix}/${value.apiGroupAndVersion}/${value.plural}/${value.name}?backlink=${value.backlink}`
|
|
39093
39081
|
);
|
|
39094
39082
|
}
|
|
39095
39083
|
if (key === "delete") {
|
|
39096
39084
|
value.onDeleteHandle(
|
|
39097
|
-
value.
|
|
39098
|
-
`${value.deletePathPrefix}/${value.apiGroupAndVersion}${value.namespace ? `/namespaces/${value.namespace}` : ""}/${value.
|
|
39085
|
+
value.name,
|
|
39086
|
+
`${value.deletePathPrefix}/${value.apiGroupAndVersion}${value.namespace ? `/namespaces/${value.namespace}` : ""}/${value.plural}/${value.name}`
|
|
39099
39087
|
);
|
|
39100
39088
|
}
|
|
39101
39089
|
}
|
|
@@ -39196,8 +39184,8 @@ const EnrichedTable = ({
|
|
|
39196
39184
|
selectData.onChange(
|
|
39197
39185
|
selectedRowKeys,
|
|
39198
39186
|
rows.map(({ internalDataForControls }) => ({
|
|
39199
|
-
name: internalDataForControls.
|
|
39200
|
-
endpoint: `${internalDataForControls.deletePathPrefix}/${internalDataForControls.apiGroupAndVersion}${internalDataForControls.namespace ? `/namespaces/${internalDataForControls.namespace}` : ""}/${internalDataForControls.
|
|
39187
|
+
name: internalDataForControls.name,
|
|
39188
|
+
endpoint: `${internalDataForControls.deletePathPrefix}/${internalDataForControls.apiGroupAndVersion}${internalDataForControls.namespace ? `/namespaces/${internalDataForControls.namespace}` : ""}/${internalDataForControls.plural}/${internalDataForControls.name}`
|
|
39201
39189
|
}))
|
|
39202
39190
|
);
|
|
39203
39191
|
}
|
|
@@ -39298,8 +39286,8 @@ const prepare = ({
|
|
|
39298
39286
|
syntheticProject: dataForControls.syntheticProject,
|
|
39299
39287
|
pathPrefix: dataForControls.pathPrefix,
|
|
39300
39288
|
apiGroupAndVersion: dataForControls.apiVersion,
|
|
39301
|
-
|
|
39302
|
-
|
|
39289
|
+
plural: dataForControls.plural,
|
|
39290
|
+
name: el.metadata.name,
|
|
39303
39291
|
namespace: el.metadata.namespace || void 0,
|
|
39304
39292
|
backlink: dataForControls.backlink,
|
|
39305
39293
|
deletePathPrefix: dataForControls.deletePathPrefix,
|
|
@@ -39381,8 +39369,8 @@ const prepare = ({
|
|
|
39381
39369
|
synthetichProject: dataForControls.syntheticProject,
|
|
39382
39370
|
pathPrefix: dataForControls.pathPrefix,
|
|
39383
39371
|
apiGroupAndVersion: dataForControls.apiVersion,
|
|
39384
|
-
|
|
39385
|
-
|
|
39372
|
+
plural: dataForControls.plural,
|
|
39373
|
+
name: el.metadata.name,
|
|
39386
39374
|
namespace: el.metadata.namespace || void 0,
|
|
39387
39375
|
backlink: dataForControls.backlink,
|
|
39388
39376
|
deletePathPrefix: dataForControls.deletePathPrefix,
|
|
@@ -39427,18 +39415,18 @@ const EnrichedTableProvider = ({
|
|
|
39427
39415
|
const [isLoading, setIsLoading] = useState(false);
|
|
39428
39416
|
const [isError, setIsError] = useState(false);
|
|
39429
39417
|
const updatePermission = usePermissions({
|
|
39430
|
-
|
|
39431
|
-
|
|
39418
|
+
apiGroup: dataForControls?.apiGroup,
|
|
39419
|
+
plural: dataForControls?.plural || "",
|
|
39432
39420
|
namespace,
|
|
39433
|
-
|
|
39421
|
+
cluster,
|
|
39434
39422
|
verb: "update",
|
|
39435
39423
|
refetchInterval: false
|
|
39436
39424
|
});
|
|
39437
39425
|
const deletePermission = usePermissions({
|
|
39438
|
-
|
|
39439
|
-
|
|
39426
|
+
apiGroup: dataForControls?.apiGroup,
|
|
39427
|
+
plural: dataForControls?.plural || "",
|
|
39440
39428
|
namespace,
|
|
39441
|
-
|
|
39429
|
+
cluster,
|
|
39442
39430
|
verb: "delete",
|
|
39443
39431
|
refetchInterval: false
|
|
39444
39432
|
});
|
|
@@ -39446,7 +39434,7 @@ const EnrichedTableProvider = ({
|
|
|
39446
39434
|
setIsError(void 0);
|
|
39447
39435
|
setIsLoading(true);
|
|
39448
39436
|
const payload = {
|
|
39449
|
-
|
|
39437
|
+
cluster,
|
|
39450
39438
|
customizationId,
|
|
39451
39439
|
tableMappingsReplaceValues,
|
|
39452
39440
|
forceDefaultAdditionalPrinterColumns,
|
|
@@ -39489,7 +39477,7 @@ const EnrichedTableProvider = ({
|
|
|
39489
39477
|
cluster: dataForControls.cluster,
|
|
39490
39478
|
syntheticProject: dataForControls.syntheticProject,
|
|
39491
39479
|
pathPrefix: !dataForControls.apiGroup || dataForControls.apiGroup.length === 0 ? "forms/builtin" : "forms/apis",
|
|
39492
|
-
|
|
39480
|
+
plural: dataForControls.plural,
|
|
39493
39481
|
apiVersion: !dataForControls.apiGroup || dataForControls.apiGroup.length === 0 ? dataForControls.apiVersion : `${dataForControls.apiGroup}/${dataForControls.apiVersion}`,
|
|
39494
39482
|
backlink: encodeURIComponent(fullPath),
|
|
39495
39483
|
onDeleteHandle: dataForControlsInternal.onDeleteHandle,
|
|
@@ -47066,7 +47054,7 @@ const YamlEditorSingleton = ({
|
|
|
47066
47054
|
isCreate,
|
|
47067
47055
|
type,
|
|
47068
47056
|
apiGroupApiVersion,
|
|
47069
|
-
|
|
47057
|
+
plural,
|
|
47070
47058
|
backlink,
|
|
47071
47059
|
designNewLayout,
|
|
47072
47060
|
designNewLayoutHeight,
|
|
@@ -47132,7 +47120,7 @@ const YamlEditorSingleton = ({
|
|
|
47132
47120
|
const { namespace } = currentValues.metadata;
|
|
47133
47121
|
const { name } = currentValues.metadata;
|
|
47134
47122
|
const body = currentValues;
|
|
47135
|
-
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${
|
|
47123
|
+
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${plural}/${isCreate ? "" : name}`;
|
|
47136
47124
|
if (isCreate) {
|
|
47137
47125
|
createNewEntry({ endpoint, body }).then((res) => {
|
|
47138
47126
|
console.log(res);
|
|
@@ -47965,7 +47953,7 @@ const FormListInput = ({
|
|
|
47965
47953
|
const onValuesChangeCallBack = useOnValuesChangeCallback();
|
|
47966
47954
|
const isTouchedPeristed = useIsTouchedPersisted();
|
|
47967
47955
|
const updateTouched = useUpdateIsTouchedPersisted();
|
|
47968
|
-
const {
|
|
47956
|
+
const { cluster, namespace, syntheticProject, name: entryName } = urlParams;
|
|
47969
47957
|
const form = Form.useFormInstance();
|
|
47970
47958
|
const fieldValue = Form.useWatch(name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name, form);
|
|
47971
47959
|
const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
|
|
@@ -48018,7 +48006,7 @@ const FormListInput = ({
|
|
|
48018
48006
|
}, [relatedPath, form, arrName, fixedName, relatedFieldValue, onValuesChangeCallBack, isTouchedPeristed]);
|
|
48019
48007
|
const uri = prepareTemplate({
|
|
48020
48008
|
template: customProps.valueUri,
|
|
48021
|
-
replaceValues: {
|
|
48009
|
+
replaceValues: { cluster, namespace, syntheticProject, relatedFieldValue, name: entryName }
|
|
48022
48010
|
});
|
|
48023
48011
|
const {
|
|
48024
48012
|
data: optionsObj,
|
|
@@ -48316,47 +48304,47 @@ const FormRangeInput = ({
|
|
|
48316
48304
|
urlParams,
|
|
48317
48305
|
onRemoveByMinus
|
|
48318
48306
|
}) => {
|
|
48319
|
-
const {
|
|
48307
|
+
const { cluster, namespace, syntheticProject, name: entryName } = urlParams;
|
|
48320
48308
|
const minMaxAndStep = isEdit ? customProps.edit : customProps.add;
|
|
48321
48309
|
const minValueUri = minMaxAndStep.min.type === "resourceValue" ? prepareTemplate({
|
|
48322
48310
|
template: minMaxAndStep.min.valueUri,
|
|
48323
|
-
replaceValues: {
|
|
48311
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48324
48312
|
}) : void 0;
|
|
48325
48313
|
const minSubstractFirstValueUri = minMaxAndStep.min.type === "substractResourceValues" ? prepareTemplate({
|
|
48326
48314
|
template: minMaxAndStep.min.firstValueUri,
|
|
48327
|
-
replaceValues: {
|
|
48315
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48328
48316
|
}) : void 0;
|
|
48329
48317
|
const minSubstractSecondValueUri = minMaxAndStep.min.type === "substractResourceValues" ? prepareTemplate({
|
|
48330
48318
|
template: minMaxAndStep.min.secondValueUri,
|
|
48331
|
-
replaceValues: {
|
|
48319
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48332
48320
|
}) : void 0;
|
|
48333
48321
|
const minAddFirstValueUri = minMaxAndStep.min.type === "addResourceValues" ? prepareTemplate({
|
|
48334
48322
|
template: minMaxAndStep.min.firstValueUri,
|
|
48335
|
-
replaceValues: {
|
|
48323
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48336
48324
|
}) : void 0;
|
|
48337
48325
|
const minAddSecondValueUri = minMaxAndStep.min.type === "addResourceValues" ? prepareTemplate({
|
|
48338
48326
|
template: minMaxAndStep.min.secondValueUri,
|
|
48339
|
-
replaceValues: {
|
|
48327
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48340
48328
|
}) : void 0;
|
|
48341
48329
|
const maxValueUri = minMaxAndStep.max.type === "resourceValue" ? prepareTemplate({
|
|
48342
48330
|
template: minMaxAndStep.max.valueUri,
|
|
48343
|
-
replaceValues: {
|
|
48331
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48344
48332
|
}) : void 0;
|
|
48345
48333
|
const maxSubstractFirstValueUri = minMaxAndStep.max.type === "substractResourceValues" ? prepareTemplate({
|
|
48346
48334
|
template: minMaxAndStep.max.firstValueUri,
|
|
48347
|
-
replaceValues: {
|
|
48335
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48348
48336
|
}) : void 0;
|
|
48349
48337
|
const maxSubstractSecondValueUri = minMaxAndStep.max.type === "substractResourceValues" ? prepareTemplate({
|
|
48350
48338
|
template: minMaxAndStep.max.secondValueUri,
|
|
48351
|
-
replaceValues: {
|
|
48339
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48352
48340
|
}) : void 0;
|
|
48353
48341
|
const maxAddFirstValueUri = minMaxAndStep.max.type === "addResourceValues" ? prepareTemplate({
|
|
48354
48342
|
template: minMaxAndStep.max.firstValueUri,
|
|
48355
|
-
replaceValues: {
|
|
48343
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48356
48344
|
}) : void 0;
|
|
48357
48345
|
const maxAddSecondValueUri = minMaxAndStep.max.type === "addResourceValues" ? prepareTemplate({
|
|
48358
48346
|
template: minMaxAndStep.max.secondValueUri,
|
|
48359
|
-
replaceValues: {
|
|
48347
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48360
48348
|
}) : void 0;
|
|
48361
48349
|
const {
|
|
48362
48350
|
data: minValueObj,
|
|
@@ -50198,8 +50186,8 @@ const BlackholeForm = ({
|
|
|
50198
50186
|
isCreate,
|
|
50199
50187
|
type,
|
|
50200
50188
|
apiGroupApiVersion,
|
|
50201
|
-
|
|
50202
|
-
|
|
50189
|
+
kind,
|
|
50190
|
+
plural,
|
|
50203
50191
|
backlink,
|
|
50204
50192
|
designNewLayout,
|
|
50205
50193
|
designNewLayoutHeight
|
|
@@ -50234,8 +50222,8 @@ const BlackholeForm = ({
|
|
|
50234
50222
|
const yamlToValuesAbortRef = useRef(null);
|
|
50235
50223
|
const isAnyFieldFocusedRef = useRef(false);
|
|
50236
50224
|
const editorUri = useMemo(
|
|
50237
|
-
() => `inmemory://openapi-ui/${cluster}/${apiGroupApiVersion}/${type}/${
|
|
50238
|
-
[cluster, apiGroupApiVersion, type,
|
|
50225
|
+
() => `inmemory://openapi-ui/${cluster}/${apiGroupApiVersion}/${type}/${plural}/${kind}${isCreate ? "/create" : "/edit"}.yaml`,
|
|
50226
|
+
[cluster, apiGroupApiVersion, type, plural, kind, isCreate]
|
|
50239
50227
|
);
|
|
50240
50228
|
useEffect(() => {
|
|
50241
50229
|
valuesToYamlReqId.current++;
|
|
@@ -50253,19 +50241,19 @@ const BlackholeForm = ({
|
|
|
50253
50241
|
setYamlValues(void 0);
|
|
50254
50242
|
}, [editorUri]);
|
|
50255
50243
|
const createPermission = usePermissions({
|
|
50256
|
-
|
|
50257
|
-
|
|
50244
|
+
apiGroup: type === "builtin" ? void 0 : urlParamsForPermissions.apiGroup ? urlParamsForPermissions.apiGroup : "",
|
|
50245
|
+
plural: urlParamsForPermissions.plural || "",
|
|
50258
50246
|
namespace: isNameSpaced ? namespaceFromFormData : void 0,
|
|
50259
|
-
|
|
50247
|
+
cluster,
|
|
50260
50248
|
verb: "create",
|
|
50261
50249
|
refetchInterval: false,
|
|
50262
50250
|
enabler: isCreate === true
|
|
50263
50251
|
});
|
|
50264
50252
|
const updatePermission = usePermissions({
|
|
50265
|
-
|
|
50266
|
-
|
|
50253
|
+
apiGroup: type === "builtin" ? void 0 : urlParamsForPermissions.apiGroup ? urlParamsForPermissions.apiGroup : "",
|
|
50254
|
+
plural: urlParamsForPermissions.plural || "",
|
|
50267
50255
|
namespace: isNameSpaced ? namespaceFromFormData : void 0,
|
|
50268
|
-
|
|
50256
|
+
cluster,
|
|
50269
50257
|
verb: "update",
|
|
50270
50258
|
refetchInterval: false,
|
|
50271
50259
|
enabler: isCreate !== true
|
|
@@ -50295,7 +50283,7 @@ const BlackholeForm = ({
|
|
|
50295
50283
|
payload
|
|
50296
50284
|
).then(({ data }) => {
|
|
50297
50285
|
const body = data;
|
|
50298
|
-
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${
|
|
50286
|
+
const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${plural}/${isCreate ? "" : name}`;
|
|
50299
50287
|
if (isCreate) {
|
|
50300
50288
|
createNewEntry({ endpoint, body }).then((res) => {
|
|
50301
50289
|
console.log(res);
|
|
@@ -50353,7 +50341,7 @@ const BlackholeForm = ({
|
|
|
50353
50341
|
const allValues2 = {};
|
|
50354
50342
|
if (isCreate) {
|
|
50355
50343
|
_$1.set(allValues2, ["apiVersion"], apiGroupApiVersion === "api/v1" ? "v1" : apiGroupApiVersion);
|
|
50356
|
-
_$1.set(allValues2, ["kind"],
|
|
50344
|
+
_$1.set(allValues2, ["kind"], kind);
|
|
50357
50345
|
}
|
|
50358
50346
|
if (formsPrefills) {
|
|
50359
50347
|
formsPrefills.spec.values.forEach(({ path, value }) => {
|
|
@@ -50373,7 +50361,7 @@ const BlackholeForm = ({
|
|
|
50373
50361
|
}
|
|
50374
50362
|
const sorted = Object.fromEntries(Object.entries(allValues2).sort(([a], [b]) => a.localeCompare(b)));
|
|
50375
50363
|
return sorted;
|
|
50376
|
-
}, [formsPrefills, prefillValueNamespaceOnly, isCreate, apiGroupApiVersion,
|
|
50364
|
+
}, [formsPrefills, prefillValueNamespaceOnly, isCreate, apiGroupApiVersion, kind, normalizedPrefill]);
|
|
50377
50365
|
const prefillTemplates = useMemo(() => {
|
|
50378
50366
|
const templates = [];
|
|
50379
50367
|
if (formsPrefills?.spec?.values?.length) {
|
|
@@ -50744,7 +50732,7 @@ const BlackholeForm = ({
|
|
|
50744
50732
|
return true;
|
|
50745
50733
|
});
|
|
50746
50734
|
setExpandedKeys([...uniqueKeys]);
|
|
50747
|
-
}, [apiGroupApiVersion, formsPrefills, prefillValuesSchema, type,
|
|
50735
|
+
}, [apiGroupApiVersion, formsPrefills, prefillValuesSchema, type, plural]);
|
|
50748
50736
|
useEffect(() => {
|
|
50749
50737
|
if (!initialValues) return;
|
|
50750
50738
|
setProperties((prev) => {
|
|
@@ -51003,7 +50991,7 @@ const BlackholeFormProvider = ({
|
|
|
51003
50991
|
setIsLoading(true);
|
|
51004
50992
|
const payload = {
|
|
51005
50993
|
data,
|
|
51006
|
-
|
|
50994
|
+
cluster,
|
|
51007
50995
|
customizationId
|
|
51008
50996
|
};
|
|
51009
50997
|
axios.post(`/api/clusters/${cluster}/openapi-bff/forms/formPrepare/prepareFormProps`, payload).then(({ data: data2 }) => {
|
|
@@ -51022,10 +51010,11 @@ const BlackholeFormProvider = ({
|
|
|
51022
51010
|
expandedPaths: data2.expandedPaths || [],
|
|
51023
51011
|
persistedPaths: data2.persistedPaths || [],
|
|
51024
51012
|
sortPaths: data2.sortPaths,
|
|
51025
|
-
|
|
51013
|
+
kind: data2.kind || "",
|
|
51026
51014
|
formPrefills: data2.formPrefills,
|
|
51027
51015
|
namespacesData: data2.namespacesData
|
|
51028
51016
|
});
|
|
51017
|
+
setIsError(void 0);
|
|
51029
51018
|
}
|
|
51030
51019
|
}).catch((e) => {
|
|
51031
51020
|
setIsError(e.message);
|
|
@@ -51047,7 +51036,7 @@ const BlackholeFormProvider = ({
|
|
|
51047
51036
|
type: data.type,
|
|
51048
51037
|
isNameSpaced: isNamespaced,
|
|
51049
51038
|
apiGroupApiVersion: data.type === "builtin" ? "api/v1" : `${data.apiGroup}/${data.apiVersion}`,
|
|
51050
|
-
|
|
51039
|
+
plural: data.plural,
|
|
51051
51040
|
backlink,
|
|
51052
51041
|
designNewLayout,
|
|
51053
51042
|
designNewLayoutHeight
|
|
@@ -51083,8 +51072,8 @@ const BlackholeFormProvider = ({
|
|
|
51083
51072
|
type: data.type,
|
|
51084
51073
|
isNameSpaced: isNamespaced ? preparedData.namespacesData : false,
|
|
51085
51074
|
apiGroupApiVersion: data.type === "builtin" ? "api/v1" : `${data.apiGroup}/${data.apiVersion}`,
|
|
51086
|
-
|
|
51087
|
-
|
|
51075
|
+
kind: preparedData.kind,
|
|
51076
|
+
plural: data.plural,
|
|
51088
51077
|
backlink,
|
|
51089
51078
|
designNewLayout,
|
|
51090
51079
|
designNewLayoutHeight
|
|
@@ -51175,11 +51164,11 @@ function v4(options, buf, offset) {
|
|
|
51175
51164
|
}
|
|
51176
51165
|
|
|
51177
51166
|
const AddEditFormModal = ({
|
|
51178
|
-
|
|
51167
|
+
cluster,
|
|
51179
51168
|
baseApiGroup,
|
|
51180
51169
|
baseApiVersion,
|
|
51181
|
-
|
|
51182
|
-
|
|
51170
|
+
marketplacePlural,
|
|
51171
|
+
marketplaceKind,
|
|
51183
51172
|
isOpen,
|
|
51184
51173
|
setIsOpen,
|
|
51185
51174
|
setError,
|
|
@@ -51195,7 +51184,7 @@ const AddEditFormModal = ({
|
|
|
51195
51184
|
type: "direct",
|
|
51196
51185
|
apiGroup: "",
|
|
51197
51186
|
apiVersion: "",
|
|
51198
|
-
|
|
51187
|
+
plural: "",
|
|
51199
51188
|
pathToNav: "",
|
|
51200
51189
|
tags: [],
|
|
51201
51190
|
disabled: false,
|
|
@@ -51204,10 +51193,10 @@ const AddEditFormModal = ({
|
|
|
51204
51193
|
const onSubmit = (values) => {
|
|
51205
51194
|
if (typeof isOpen === "boolean") {
|
|
51206
51195
|
createNewEntry({
|
|
51207
|
-
endpoint: `/api/clusters/${
|
|
51196
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseApiGroup}/${baseApiVersion}/${marketplacePlural}`,
|
|
51208
51197
|
body: {
|
|
51209
51198
|
apiVersion: `${baseApiGroup}/${baseApiVersion}`,
|
|
51210
|
-
kind:
|
|
51199
|
+
kind: marketplaceKind,
|
|
51211
51200
|
metadata: {
|
|
51212
51201
|
name: v4()
|
|
51213
51202
|
},
|
|
@@ -51224,10 +51213,10 @@ const AddEditFormModal = ({
|
|
|
51224
51213
|
return;
|
|
51225
51214
|
}
|
|
51226
51215
|
updateEntry({
|
|
51227
|
-
endpoint: `/api/clusters/${
|
|
51216
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseApiGroup}/${baseApiVersion}/${marketplacePlural}/${isOpen.metadata.name}`,
|
|
51228
51217
|
body: {
|
|
51229
51218
|
apiVersion: `${baseApiGroup}/${baseApiVersion}`,
|
|
51230
|
-
kind:
|
|
51219
|
+
kind: marketplaceKind,
|
|
51231
51220
|
metadata: {
|
|
51232
51221
|
name: isOpen.metadata.name,
|
|
51233
51222
|
resourceVersion: isOpen.metadata.resourceVersion
|
|
@@ -51273,7 +51262,7 @@ const AddEditFormModal = ({
|
|
|
51273
51262
|
) }),
|
|
51274
51263
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Enter API group", name: "apiGroup", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { disabled: type === "direct" || type === "built-in" }) }),
|
|
51275
51264
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Enter API version", name: "apiVersion", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { disabled: type === "direct" }) }),
|
|
51276
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Enter resource type", name: "
|
|
51265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Enter resource type", name: "plural", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { disabled: type === "direct" }) }),
|
|
51277
51266
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Enter path", name: "pathToNav", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { disabled: type !== "direct" }) }),
|
|
51278
51267
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Tags", name: "tags", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51279
51268
|
Select,
|
|
@@ -51292,11 +51281,11 @@ const AddEditFormModal = ({
|
|
|
51292
51281
|
};
|
|
51293
51282
|
|
|
51294
51283
|
const getPathToNav = ({
|
|
51295
|
-
|
|
51284
|
+
cluster,
|
|
51296
51285
|
namespace,
|
|
51297
51286
|
type,
|
|
51298
51287
|
pathToNav,
|
|
51299
|
-
|
|
51288
|
+
plural,
|
|
51300
51289
|
apiGroup,
|
|
51301
51290
|
apiVersion,
|
|
51302
51291
|
baseprefix
|
|
@@ -51306,19 +51295,19 @@ const getPathToNav = ({
|
|
|
51306
51295
|
return pathToNav;
|
|
51307
51296
|
}
|
|
51308
51297
|
if (type === "crd") {
|
|
51309
|
-
return `/${baseprefix}/${
|
|
51298
|
+
return `/${baseprefix}/${cluster}/${namespace}/crd-table/${apiGroup}/${apiVersion}/${apiExtensionVersion}/${plural}`;
|
|
51310
51299
|
}
|
|
51311
51300
|
if (type === "nonCrd") {
|
|
51312
|
-
return `/${baseprefix}/${
|
|
51301
|
+
return `/${baseprefix}/${cluster}/${namespace}/api-table/${apiGroup}/${apiVersion}/${plural}`;
|
|
51313
51302
|
}
|
|
51314
|
-
return `/${baseprefix}/${
|
|
51303
|
+
return `/${baseprefix}/${cluster}/${namespace}/builtin-table/${plural}`;
|
|
51315
51304
|
};
|
|
51316
51305
|
const getCreatePathToNav = ({
|
|
51317
|
-
|
|
51306
|
+
cluster,
|
|
51318
51307
|
namespace,
|
|
51319
51308
|
type,
|
|
51320
51309
|
pathToNav,
|
|
51321
|
-
|
|
51310
|
+
plural,
|
|
51322
51311
|
apiGroup,
|
|
51323
51312
|
apiVersion,
|
|
51324
51313
|
baseprefix
|
|
@@ -51327,12 +51316,12 @@ const getCreatePathToNav = ({
|
|
|
51327
51316
|
return pathToNav;
|
|
51328
51317
|
}
|
|
51329
51318
|
if (type === "crd") {
|
|
51330
|
-
return `/${baseprefix}/${
|
|
51319
|
+
return `/${baseprefix}/${cluster}/${namespace}/forms/crds/${apiGroup}/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
|
|
51331
51320
|
}
|
|
51332
51321
|
if (type === "nonCrd") {
|
|
51333
|
-
return `/${baseprefix}/${
|
|
51322
|
+
return `/${baseprefix}/${cluster}/${namespace}/forms/apis/${apiGroup}/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
|
|
51334
51323
|
}
|
|
51335
|
-
return `/${baseprefix}/${
|
|
51324
|
+
return `/${baseprefix}/${cluster}/${namespace}/forms/builtin/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
|
|
51336
51325
|
};
|
|
51337
51326
|
|
|
51338
51327
|
const CustomCard$4 = styled(Card$1)`
|
|
@@ -51422,11 +51411,11 @@ const MarketplaceCard = ({
|
|
|
51422
51411
|
description,
|
|
51423
51412
|
name,
|
|
51424
51413
|
icon,
|
|
51425
|
-
|
|
51414
|
+
cluster,
|
|
51426
51415
|
namespace,
|
|
51427
51416
|
type,
|
|
51428
51417
|
pathToNav,
|
|
51429
|
-
|
|
51418
|
+
plural,
|
|
51430
51419
|
apiGroup,
|
|
51431
51420
|
apiVersion,
|
|
51432
51421
|
tags,
|
|
@@ -51448,29 +51437,29 @@ const MarketplaceCard = ({
|
|
|
51448
51437
|
decodedIcon = "Can't decode";
|
|
51449
51438
|
}
|
|
51450
51439
|
const navigateUrl = addedMode || standalone ? getPathToNav({
|
|
51451
|
-
|
|
51440
|
+
cluster,
|
|
51452
51441
|
namespace,
|
|
51453
51442
|
type,
|
|
51454
51443
|
pathToNav,
|
|
51455
|
-
|
|
51444
|
+
plural,
|
|
51456
51445
|
apiGroup,
|
|
51457
51446
|
apiVersion,
|
|
51458
51447
|
baseprefix
|
|
51459
51448
|
}) : getCreatePathToNav({
|
|
51460
|
-
|
|
51449
|
+
cluster,
|
|
51461
51450
|
namespace,
|
|
51462
51451
|
type,
|
|
51463
51452
|
pathToNav,
|
|
51464
|
-
|
|
51453
|
+
plural,
|
|
51465
51454
|
apiGroup,
|
|
51466
51455
|
apiVersion,
|
|
51467
51456
|
baseprefix
|
|
51468
51457
|
});
|
|
51469
51458
|
const { data: k8sList, error: k8sListError } = useK8sSmartResource({
|
|
51470
|
-
cluster
|
|
51459
|
+
cluster,
|
|
51471
51460
|
namespace,
|
|
51472
|
-
|
|
51473
|
-
|
|
51461
|
+
apiGroup,
|
|
51462
|
+
apiVersion: apiVersion || "",
|
|
51474
51463
|
plural: type,
|
|
51475
51464
|
isEnabled: Boolean(apiVersion && addedMode && type !== "direct")
|
|
51476
51465
|
});
|
|
@@ -51581,12 +51570,12 @@ const Styled$c = {
|
|
|
51581
51570
|
};
|
|
51582
51571
|
|
|
51583
51572
|
const MarketPlace = ({
|
|
51584
|
-
|
|
51573
|
+
cluster,
|
|
51585
51574
|
namespace,
|
|
51586
51575
|
baseApiGroup,
|
|
51587
51576
|
baseApiVersion,
|
|
51588
|
-
|
|
51589
|
-
|
|
51577
|
+
marketplacePlural,
|
|
51578
|
+
marketplaceKind,
|
|
51590
51579
|
baseprefix,
|
|
51591
51580
|
standalone,
|
|
51592
51581
|
forceAddedMode,
|
|
@@ -51607,30 +51596,29 @@ const MarketPlace = ({
|
|
|
51607
51596
|
isLoading,
|
|
51608
51597
|
error
|
|
51609
51598
|
} = useK8sSmartResource({
|
|
51610
|
-
cluster
|
|
51611
|
-
|
|
51612
|
-
|
|
51613
|
-
plural:
|
|
51614
|
-
isEnabled: Boolean(clusterName !== void 0)
|
|
51599
|
+
cluster,
|
|
51600
|
+
apiGroup: baseApiGroup,
|
|
51601
|
+
apiVersion: baseApiVersion,
|
|
51602
|
+
plural: marketplacePlural
|
|
51615
51603
|
});
|
|
51616
51604
|
const createPermission = usePermissions({
|
|
51617
|
-
|
|
51618
|
-
|
|
51619
|
-
|
|
51605
|
+
apiGroup: baseApiGroup,
|
|
51606
|
+
plural: marketplacePlural,
|
|
51607
|
+
cluster,
|
|
51620
51608
|
verb: "create",
|
|
51621
51609
|
refetchInterval: false
|
|
51622
51610
|
});
|
|
51623
51611
|
const updatePermission = usePermissions({
|
|
51624
|
-
|
|
51625
|
-
|
|
51626
|
-
|
|
51612
|
+
apiGroup: baseApiGroup,
|
|
51613
|
+
plural: marketplacePlural,
|
|
51614
|
+
cluster,
|
|
51627
51615
|
verb: "update",
|
|
51628
51616
|
refetchInterval: false
|
|
51629
51617
|
});
|
|
51630
51618
|
const deletePermission = usePermissions({
|
|
51631
|
-
|
|
51632
|
-
|
|
51633
|
-
|
|
51619
|
+
apiGroup: baseApiGroup,
|
|
51620
|
+
plural: marketplacePlural,
|
|
51621
|
+
cluster,
|
|
51634
51622
|
verb: "delete",
|
|
51635
51623
|
refetchInterval: false
|
|
51636
51624
|
});
|
|
@@ -51717,8 +51705,8 @@ const MarketPlace = ({
|
|
|
51717
51705
|
}
|
|
51718
51706
|
),
|
|
51719
51707
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 22, wrap: true, children: [
|
|
51720
|
-
|
|
51721
|
-
({ name, description, icon, type, pathToNav,
|
|
51708
|
+
namespace && filteredAndSortedData.map(
|
|
51709
|
+
({ name, description, icon, type, pathToNav, plural, apiGroup, apiVersion, tags, disabled }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51722
51710
|
MarketplaceCard,
|
|
51723
51711
|
{
|
|
51724
51712
|
baseprefix,
|
|
@@ -51727,11 +51715,11 @@ const MarketPlace = ({
|
|
|
51727
51715
|
icon,
|
|
51728
51716
|
isEditMode,
|
|
51729
51717
|
name,
|
|
51730
|
-
|
|
51718
|
+
cluster,
|
|
51731
51719
|
namespace,
|
|
51732
51720
|
type,
|
|
51733
51721
|
pathToNav,
|
|
51734
|
-
|
|
51722
|
+
plural,
|
|
51735
51723
|
apiGroup,
|
|
51736
51724
|
apiVersion,
|
|
51737
51725
|
tags,
|
|
@@ -51761,11 +51749,11 @@ const MarketPlace = ({
|
|
|
51761
51749
|
isAddEditOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51762
51750
|
AddEditFormModal,
|
|
51763
51751
|
{
|
|
51764
|
-
|
|
51752
|
+
cluster,
|
|
51765
51753
|
baseApiGroup,
|
|
51766
51754
|
baseApiVersion,
|
|
51767
|
-
|
|
51768
|
-
|
|
51755
|
+
marketplacePlural,
|
|
51756
|
+
marketplaceKind,
|
|
51769
51757
|
isOpen: isAddEditOpen,
|
|
51770
51758
|
setError: setCreateUpdateError,
|
|
51771
51759
|
setIsOpen: setIsAddEditOpen,
|
|
@@ -51778,7 +51766,7 @@ const MarketPlace = ({
|
|
|
51778
51766
|
{
|
|
51779
51767
|
name: isDeleteOpen.name,
|
|
51780
51768
|
onClose: () => setIsDeleteOpen(false),
|
|
51781
|
-
endpoint: `/api/clusters/${
|
|
51769
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseApiGroup}/${baseApiVersion}/${marketplacePlural}/${isDeleteOpen.name}`
|
|
51782
51770
|
}
|
|
51783
51771
|
)
|
|
51784
51772
|
] });
|
|
@@ -51897,14 +51885,14 @@ const Styled$b = {
|
|
|
51897
51885
|
ActionMenuPlaceholder};
|
|
51898
51886
|
|
|
51899
51887
|
const ProjectInfoCard = ({
|
|
51900
|
-
|
|
51888
|
+
cluster,
|
|
51901
51889
|
namespace,
|
|
51902
51890
|
baseApiGroup,
|
|
51903
51891
|
baseApiVersion,
|
|
51904
51892
|
baseProjectApiGroup,
|
|
51905
51893
|
baseProjectVersion,
|
|
51906
|
-
|
|
51907
|
-
|
|
51894
|
+
marketplacePlural,
|
|
51895
|
+
projectPlural,
|
|
51908
51896
|
baseprefix,
|
|
51909
51897
|
accessGroups,
|
|
51910
51898
|
showZeroResources,
|
|
@@ -51916,45 +51904,43 @@ const ProjectInfoCard = ({
|
|
|
51916
51904
|
isLoading: marketplaceIsLoading
|
|
51917
51905
|
// error: marketplaceError,
|
|
51918
51906
|
} = useK8sSmartResource({
|
|
51919
|
-
cluster
|
|
51920
|
-
|
|
51921
|
-
|
|
51922
|
-
plural:
|
|
51923
|
-
isEnabled: Boolean(clusterName !== void 0)
|
|
51907
|
+
cluster,
|
|
51908
|
+
apiGroup: baseApiGroup,
|
|
51909
|
+
apiVersion: baseApiVersion,
|
|
51910
|
+
plural: marketplacePlural
|
|
51924
51911
|
});
|
|
51925
51912
|
const {
|
|
51926
51913
|
data: projectArr,
|
|
51927
51914
|
isLoading,
|
|
51928
51915
|
error
|
|
51929
51916
|
} = useK8sSmartResource({
|
|
51930
|
-
cluster
|
|
51931
|
-
|
|
51932
|
-
|
|
51933
|
-
plural:
|
|
51934
|
-
fieldSelector: `metadata.name=${namespace}
|
|
51935
|
-
isEnabled: Boolean(clusterName !== void 0)
|
|
51917
|
+
cluster,
|
|
51918
|
+
apiGroup: baseProjectApiGroup,
|
|
51919
|
+
apiVersion: baseProjectVersion,
|
|
51920
|
+
plural: projectPlural,
|
|
51921
|
+
fieldSelector: `metadata.name=${namespace}`
|
|
51936
51922
|
});
|
|
51937
51923
|
const project = projectArr && projectArr.items && projectArr.items.length > 0 ? projectArr.items[0] : void 0;
|
|
51938
51924
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
|
51939
51925
|
const updatePermission = usePermissions({
|
|
51940
|
-
|
|
51941
|
-
|
|
51942
|
-
|
|
51926
|
+
apiGroup: baseProjectApiGroup,
|
|
51927
|
+
plural: projectPlural,
|
|
51928
|
+
cluster,
|
|
51943
51929
|
verb: "update",
|
|
51944
51930
|
refetchInterval: false
|
|
51945
51931
|
});
|
|
51946
51932
|
const deletePermission = usePermissions({
|
|
51947
|
-
|
|
51948
|
-
|
|
51949
|
-
|
|
51933
|
+
apiGroup: baseProjectApiGroup,
|
|
51934
|
+
plural: projectPlural,
|
|
51935
|
+
cluster,
|
|
51950
51936
|
verb: "delete",
|
|
51951
51937
|
refetchInterval: false
|
|
51952
51938
|
});
|
|
51953
51939
|
const openUpdate = useCallback(() => {
|
|
51954
51940
|
navigate(
|
|
51955
|
-
`/${baseprefix}/${
|
|
51941
|
+
`/${baseprefix}/${cluster}/forms/apis/${baseProjectApiGroup}/${baseProjectVersion}/${projectPlural}/${namespace}?backlink=${baseprefix}/clusters/${cluster}`
|
|
51956
51942
|
);
|
|
51957
|
-
}, [baseprefix,
|
|
51943
|
+
}, [baseprefix, cluster, namespace, baseProjectApiGroup, baseProjectVersion, projectPlural, navigate]);
|
|
51958
51944
|
if (isLoading) {
|
|
51959
51945
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {});
|
|
51960
51946
|
}
|
|
@@ -51983,7 +51969,7 @@ const ProjectInfoCard = ({
|
|
|
51983
51969
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 12, $samespace: true }),
|
|
51984
51970
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 22, wrap: true, children: [
|
|
51985
51971
|
marketplaceIsLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
|
|
51986
|
-
|
|
51972
|
+
namespace && marketplacePanels?.items.map(({ spec }) => spec).sort().map(({ name, description, icon, type, pathToNav, plural, apiGroup, apiVersion, tags, disabled }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51987
51973
|
MarketplaceCard,
|
|
51988
51974
|
{
|
|
51989
51975
|
baseprefix,
|
|
@@ -51992,11 +51978,11 @@ const ProjectInfoCard = ({
|
|
|
51992
51978
|
icon,
|
|
51993
51979
|
isEditMode: false,
|
|
51994
51980
|
name,
|
|
51995
|
-
|
|
51981
|
+
cluster,
|
|
51996
51982
|
namespace,
|
|
51997
51983
|
type,
|
|
51998
51984
|
pathToNav,
|
|
51999
|
-
|
|
51985
|
+
plural,
|
|
52000
51986
|
apiGroup,
|
|
52001
51987
|
apiVersion,
|
|
52002
51988
|
tags,
|
|
@@ -52012,9 +51998,9 @@ const ProjectInfoCard = ({
|
|
|
52012
51998
|
name: project.metadata.name,
|
|
52013
51999
|
onClose: () => {
|
|
52014
52000
|
setIsDeleteModalOpen(false);
|
|
52015
|
-
navigate(`${baseprefix}/clusters/${
|
|
52001
|
+
navigate(`${baseprefix}/clusters/${cluster}`);
|
|
52016
52002
|
},
|
|
52017
|
-
endpoint: `/api/clusters/${
|
|
52003
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseProjectApiGroup}/${baseProjectVersion}/${projectPlural}/${project.metadata.name}`
|
|
52018
52004
|
}
|
|
52019
52005
|
)
|
|
52020
52006
|
] });
|
|
@@ -53557,14 +53543,14 @@ const Events = ({
|
|
|
53557
53543
|
baseFactoryNamespacedBuiltinKey,
|
|
53558
53544
|
baseFactoryClusterSceopedBuiltinKey,
|
|
53559
53545
|
baseNamespaceFactoryKey,
|
|
53560
|
-
|
|
53561
|
-
|
|
53546
|
+
baseNavigationPlural,
|
|
53547
|
+
baseNavigationName
|
|
53562
53548
|
}) => {
|
|
53563
53549
|
const { token } = theme.useToken();
|
|
53564
53550
|
const [kindIndex, setKindIndex] = useState();
|
|
53565
53551
|
const [kindsWithVersion, setKindWithVersion] = useState();
|
|
53566
53552
|
useEffect(() => {
|
|
53567
|
-
getKinds({
|
|
53553
|
+
getKinds({ cluster }).then((data) => {
|
|
53568
53554
|
setKindIndex(data);
|
|
53569
53555
|
setKindWithVersion(getSortedKindsAll(data));
|
|
53570
53556
|
}).catch((error) => {
|
|
@@ -53573,10 +53559,10 @@ const Events = ({
|
|
|
53573
53559
|
}, [cluster]);
|
|
53574
53560
|
const { data: navigationDataArr } = useK8sSmartResource({
|
|
53575
53561
|
cluster,
|
|
53576
|
-
|
|
53577
|
-
|
|
53578
|
-
plural:
|
|
53579
|
-
fieldSelector: `metadata.name=${
|
|
53562
|
+
apiGroup: "front.in-cloud.io",
|
|
53563
|
+
apiVersion: "v1alpha1",
|
|
53564
|
+
plural: baseNavigationPlural,
|
|
53565
|
+
fieldSelector: `metadata.name=${baseNavigationName}`
|
|
53580
53566
|
});
|
|
53581
53567
|
const [isPaused, setIsPaused] = useState(false);
|
|
53582
53568
|
const pausedRef = useRef(isPaused);
|
|
@@ -53920,44 +53906,44 @@ const getBuiltinTreeData = (apis) => {
|
|
|
53920
53906
|
};
|
|
53921
53907
|
|
|
53922
53908
|
const filterIfApiInstanceNamespaceScoped = async ({
|
|
53909
|
+
cluster,
|
|
53923
53910
|
namespace,
|
|
53924
|
-
data,
|
|
53925
53911
|
apiGroup,
|
|
53926
53912
|
apiVersion,
|
|
53927
|
-
|
|
53913
|
+
data
|
|
53928
53914
|
}) => {
|
|
53929
53915
|
const payload = {
|
|
53916
|
+
cluster,
|
|
53930
53917
|
namespace,
|
|
53931
|
-
data,
|
|
53932
53918
|
apiGroup,
|
|
53933
53919
|
apiVersion,
|
|
53934
|
-
|
|
53920
|
+
data
|
|
53935
53921
|
};
|
|
53936
53922
|
const result = await axios.post(
|
|
53937
|
-
`/api/clusters/${
|
|
53923
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/filterScopes/filterIfApiNamespaceScoped`,
|
|
53938
53924
|
payload
|
|
53939
53925
|
);
|
|
53940
53926
|
return result.data;
|
|
53941
53927
|
};
|
|
53942
53928
|
const filterIfBuiltInInstanceNamespaceScoped = async ({
|
|
53929
|
+
cluster,
|
|
53943
53930
|
namespace,
|
|
53944
|
-
data
|
|
53945
|
-
clusterName
|
|
53931
|
+
data
|
|
53946
53932
|
}) => {
|
|
53947
53933
|
const payload = {
|
|
53934
|
+
cluster,
|
|
53948
53935
|
namespace,
|
|
53949
|
-
data
|
|
53950
|
-
clusterName
|
|
53936
|
+
data
|
|
53951
53937
|
};
|
|
53952
53938
|
const result = await axios.post(
|
|
53953
|
-
`/api/clusters/${
|
|
53939
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/filterScopes/filterIfBuiltInNamespaceScoped`,
|
|
53954
53940
|
payload
|
|
53955
53941
|
);
|
|
53956
53942
|
return result.data;
|
|
53957
53943
|
};
|
|
53958
53944
|
|
|
53959
53945
|
const getGroupsByCategory = async ({
|
|
53960
|
-
|
|
53946
|
+
cluster,
|
|
53961
53947
|
apiGroupListData,
|
|
53962
53948
|
builtinResourceTypesData,
|
|
53963
53949
|
namespace,
|
|
@@ -53969,7 +53955,7 @@ const getGroupsByCategory = async ({
|
|
|
53969
53955
|
const filteredBuiltinData = await filterIfBuiltInInstanceNamespaceScoped({
|
|
53970
53956
|
namespace,
|
|
53971
53957
|
data: builtinResourceTypesData,
|
|
53972
|
-
|
|
53958
|
+
cluster
|
|
53973
53959
|
});
|
|
53974
53960
|
return { crdGroups, nonCrdGroups, builtinGroups: filteredBuiltinData, apiExtensionVersion };
|
|
53975
53961
|
};
|
|
@@ -54084,12 +54070,12 @@ const getClusterList = async () => {
|
|
|
54084
54070
|
};
|
|
54085
54071
|
|
|
54086
54072
|
const getApiResources = async ({
|
|
54087
|
-
|
|
54073
|
+
cluster,
|
|
54088
54074
|
namespace,
|
|
54089
54075
|
apiGroup,
|
|
54090
54076
|
apiVersion,
|
|
54091
|
-
|
|
54092
|
-
|
|
54077
|
+
plural,
|
|
54078
|
+
name,
|
|
54093
54079
|
labels,
|
|
54094
54080
|
fields,
|
|
54095
54081
|
limit
|
|
@@ -54106,27 +54092,27 @@ const getApiResources = async ({
|
|
|
54106
54092
|
}
|
|
54107
54093
|
const searchParams = params.toString();
|
|
54108
54094
|
return axios.get(
|
|
54109
|
-
`/api/clusters/${
|
|
54095
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${plural}${name ? `/${name}` : ""}${searchParams.length > 0 ? `?${searchParams}` : ""}`
|
|
54110
54096
|
);
|
|
54111
54097
|
};
|
|
54112
54098
|
const getApiResourceSingle = async ({
|
|
54113
|
-
|
|
54099
|
+
cluster,
|
|
54114
54100
|
namespace,
|
|
54115
54101
|
apiGroup,
|
|
54116
54102
|
apiVersion,
|
|
54117
|
-
|
|
54118
|
-
|
|
54103
|
+
plural,
|
|
54104
|
+
name
|
|
54119
54105
|
}) => {
|
|
54120
54106
|
return axios.get(
|
|
54121
|
-
`/api/clusters/${
|
|
54107
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${plural}/${name}`
|
|
54122
54108
|
);
|
|
54123
54109
|
};
|
|
54124
54110
|
|
|
54125
54111
|
const getBuiltinResources = async ({
|
|
54126
|
-
|
|
54112
|
+
cluster,
|
|
54127
54113
|
namespace,
|
|
54128
|
-
|
|
54129
|
-
|
|
54114
|
+
plural,
|
|
54115
|
+
name,
|
|
54130
54116
|
labels,
|
|
54131
54117
|
fields,
|
|
54132
54118
|
limit
|
|
@@ -54143,105 +54129,101 @@ const getBuiltinResources = async ({
|
|
|
54143
54129
|
}
|
|
54144
54130
|
const searchParams = params.toString();
|
|
54145
54131
|
return axios.get(
|
|
54146
|
-
`/api/clusters/${
|
|
54132
|
+
`/api/clusters/${cluster}/k8s/api/v1${namespace ? `/namespaces/${namespace}` : ""}/${plural}${name ? `/${name}` : ""}${searchParams.length > 0 ? `?${searchParams}` : ""}`
|
|
54147
54133
|
);
|
|
54148
54134
|
};
|
|
54149
54135
|
const getBuiltinResourceSingle = async ({
|
|
54150
|
-
|
|
54136
|
+
cluster,
|
|
54151
54137
|
namespace,
|
|
54152
|
-
|
|
54153
|
-
|
|
54138
|
+
plural,
|
|
54139
|
+
name
|
|
54154
54140
|
}) => {
|
|
54155
54141
|
return axios.get(
|
|
54156
|
-
`/api/clusters/${
|
|
54142
|
+
`/api/clusters/${cluster}/k8s/api/v1${namespace ? `/namespaces/${namespace}` : ""}/${plural}/${name}`
|
|
54157
54143
|
);
|
|
54158
54144
|
};
|
|
54159
54145
|
|
|
54160
54146
|
const getCrdResources = async ({
|
|
54161
|
-
|
|
54147
|
+
cluster,
|
|
54162
54148
|
namespace,
|
|
54163
54149
|
apiGroup,
|
|
54164
54150
|
apiVersion,
|
|
54165
54151
|
crdName
|
|
54166
54152
|
}) => {
|
|
54167
54153
|
return axios.get(
|
|
54168
|
-
`/api/clusters/${
|
|
54154
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${crdName}`
|
|
54169
54155
|
);
|
|
54170
54156
|
};
|
|
54171
54157
|
const getCrdResourceSingle = async ({
|
|
54172
|
-
|
|
54158
|
+
cluster,
|
|
54173
54159
|
namespace,
|
|
54174
54160
|
apiGroup,
|
|
54175
54161
|
apiVersion,
|
|
54176
54162
|
crdName,
|
|
54177
|
-
|
|
54163
|
+
name
|
|
54178
54164
|
}) => {
|
|
54179
54165
|
return axios.get(
|
|
54180
|
-
`/api/clusters/${
|
|
54166
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${crdName}/${name}`
|
|
54181
54167
|
);
|
|
54182
54168
|
};
|
|
54183
54169
|
|
|
54184
|
-
const getApiResourceTypes = async ({
|
|
54185
|
-
return axios.get(`/api/clusters/${
|
|
54170
|
+
const getApiResourceTypes = async ({ cluster }) => {
|
|
54171
|
+
return axios.get(`/api/clusters/${cluster}/k8s/apis/`);
|
|
54186
54172
|
};
|
|
54187
54173
|
const getApiResourceTypesByApiGroup = async ({
|
|
54188
|
-
|
|
54174
|
+
cluster,
|
|
54189
54175
|
apiGroup,
|
|
54190
54176
|
apiVersion
|
|
54191
54177
|
}) => {
|
|
54192
|
-
return axios.get(`/api/clusters/${
|
|
54178
|
+
return axios.get(`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}/`);
|
|
54193
54179
|
};
|
|
54194
54180
|
|
|
54195
|
-
const getBuiltinResourceTypes = async ({
|
|
54196
|
-
|
|
54197
|
-
}) => {
|
|
54198
|
-
return axios.get(`/api/clusters/${clusterName}/k8s/api/v1`);
|
|
54181
|
+
const getBuiltinResourceTypes = async ({ cluster }) => {
|
|
54182
|
+
return axios.get(`/api/clusters/${cluster}/k8s/api/v1`);
|
|
54199
54183
|
};
|
|
54200
54184
|
|
|
54201
54185
|
const getCrdData = async ({
|
|
54202
|
-
|
|
54186
|
+
cluster,
|
|
54203
54187
|
apiExtensionVersion,
|
|
54204
54188
|
crdName
|
|
54205
54189
|
}) => {
|
|
54206
54190
|
return axios.get(
|
|
54207
|
-
`/api/clusters/${
|
|
54191
|
+
`/api/clusters/${cluster}/k8s/apis/apiextensions.k8s.io/${apiExtensionVersion}/customresourcedefinitions/${crdName}`
|
|
54208
54192
|
);
|
|
54209
54193
|
};
|
|
54210
54194
|
|
|
54211
|
-
const getSwagger = async ({
|
|
54212
|
-
|
|
54213
|
-
}) => {
|
|
54214
|
-
return axios.get(`/api/clusters/${clusterName}/openapi-bff/swagger/swagger/${clusterName}`);
|
|
54195
|
+
const getSwagger = async ({ cluster }) => {
|
|
54196
|
+
return axios.get(`/api/clusters/${cluster}/openapi-bff/swagger/swagger/${cluster}`);
|
|
54215
54197
|
};
|
|
54216
54198
|
|
|
54217
54199
|
const checkIfApiInstanceNamespaceScoped = async ({
|
|
54218
|
-
|
|
54200
|
+
plural,
|
|
54219
54201
|
apiGroup,
|
|
54220
54202
|
apiVersion,
|
|
54221
|
-
|
|
54203
|
+
cluster
|
|
54222
54204
|
}) => {
|
|
54223
54205
|
const payload = {
|
|
54224
|
-
|
|
54206
|
+
plural,
|
|
54225
54207
|
apiGroup,
|
|
54226
54208
|
apiVersion,
|
|
54227
|
-
|
|
54209
|
+
cluster
|
|
54228
54210
|
};
|
|
54229
54211
|
const { data } = await axios.post(
|
|
54230
|
-
`/api/clusters/${
|
|
54212
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/checkScopes/checkIfApiNamespaceScoped`,
|
|
54231
54213
|
payload
|
|
54232
54214
|
);
|
|
54233
54215
|
return data;
|
|
54234
54216
|
};
|
|
54235
54217
|
const checkIfBuiltInInstanceNamespaceScoped = async ({
|
|
54236
|
-
|
|
54237
|
-
|
|
54218
|
+
plural,
|
|
54219
|
+
cluster
|
|
54238
54220
|
}) => {
|
|
54239
54221
|
const payload = {
|
|
54240
|
-
|
|
54241
|
-
|
|
54222
|
+
plural,
|
|
54223
|
+
cluster
|
|
54242
54224
|
};
|
|
54243
54225
|
const { data } = await axios.post(
|
|
54244
|
-
`/api/clusters/${
|
|
54226
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/checkScopes/checkIfBuiltInNamespaceScoped`,
|
|
54245
54227
|
payload
|
|
54246
54228
|
);
|
|
54247
54229
|
return data;
|
|
@@ -54256,12 +54238,12 @@ const useClusterList = ({ refetchInterval }) => {
|
|
|
54256
54238
|
};
|
|
54257
54239
|
|
|
54258
54240
|
const useApiResources = ({
|
|
54259
|
-
|
|
54241
|
+
cluster,
|
|
54260
54242
|
namespace,
|
|
54261
54243
|
apiGroup,
|
|
54262
54244
|
apiVersion,
|
|
54263
|
-
|
|
54264
|
-
|
|
54245
|
+
plural,
|
|
54246
|
+
name,
|
|
54265
54247
|
labels,
|
|
54266
54248
|
fields,
|
|
54267
54249
|
limit,
|
|
@@ -54269,26 +54251,15 @@ const useApiResources = ({
|
|
|
54269
54251
|
isEnabled
|
|
54270
54252
|
}) => {
|
|
54271
54253
|
return useQuery({
|
|
54272
|
-
queryKey: [
|
|
54273
|
-
"useApiResources",
|
|
54274
|
-
clusterName,
|
|
54275
|
-
namespace,
|
|
54276
|
-
apiGroup,
|
|
54277
|
-
apiVersion,
|
|
54278
|
-
typeName,
|
|
54279
|
-
specificName,
|
|
54280
|
-
labels,
|
|
54281
|
-
fields,
|
|
54282
|
-
limit
|
|
54283
|
-
],
|
|
54254
|
+
queryKey: ["useApiResources", cluster, namespace, apiGroup, apiVersion, plural, name, labels, fields, limit],
|
|
54284
54255
|
queryFn: async () => {
|
|
54285
54256
|
const response = await getApiResources({
|
|
54286
|
-
|
|
54257
|
+
cluster,
|
|
54287
54258
|
namespace,
|
|
54288
54259
|
apiGroup,
|
|
54289
54260
|
apiVersion,
|
|
54290
|
-
|
|
54291
|
-
|
|
54261
|
+
plural,
|
|
54262
|
+
name,
|
|
54292
54263
|
labels,
|
|
54293
54264
|
fields,
|
|
54294
54265
|
limit
|
|
@@ -54304,33 +54275,33 @@ const useApiResources = ({
|
|
|
54304
54275
|
});
|
|
54305
54276
|
};
|
|
54306
54277
|
const useApiResourceSingle = ({
|
|
54307
|
-
|
|
54278
|
+
cluster,
|
|
54308
54279
|
namespace,
|
|
54309
54280
|
apiGroup,
|
|
54310
54281
|
apiVersion,
|
|
54311
|
-
|
|
54312
|
-
|
|
54282
|
+
plural,
|
|
54283
|
+
name,
|
|
54313
54284
|
refetchInterval
|
|
54314
54285
|
}) => {
|
|
54315
54286
|
return useQuery({
|
|
54316
|
-
queryKey: ["useApiResourceSingle",
|
|
54287
|
+
queryKey: ["useApiResourceSingle", cluster, namespace, apiGroup, apiVersion, plural, name],
|
|
54317
54288
|
queryFn: async () => (await getApiResourceSingle({
|
|
54318
|
-
|
|
54289
|
+
cluster,
|
|
54319
54290
|
namespace,
|
|
54320
54291
|
apiGroup,
|
|
54321
54292
|
apiVersion,
|
|
54322
|
-
|
|
54323
|
-
|
|
54293
|
+
plural,
|
|
54294
|
+
name
|
|
54324
54295
|
})).data,
|
|
54325
54296
|
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
54326
54297
|
});
|
|
54327
54298
|
};
|
|
54328
54299
|
|
|
54329
54300
|
const useBuiltinResources = ({
|
|
54330
|
-
|
|
54301
|
+
cluster,
|
|
54331
54302
|
namespace,
|
|
54332
|
-
|
|
54333
|
-
|
|
54303
|
+
plural,
|
|
54304
|
+
name,
|
|
54334
54305
|
labels,
|
|
54335
54306
|
fields,
|
|
54336
54307
|
limit,
|
|
@@ -54338,13 +54309,13 @@ const useBuiltinResources = ({
|
|
|
54338
54309
|
isEnabled
|
|
54339
54310
|
}) => {
|
|
54340
54311
|
return useQuery({
|
|
54341
|
-
queryKey: ["useBuiltinResourceType",
|
|
54312
|
+
queryKey: ["useBuiltinResourceType", cluster, namespace, plural, name, labels, fields, limit],
|
|
54342
54313
|
queryFn: async () => {
|
|
54343
54314
|
const response = await getBuiltinResources({
|
|
54344
|
-
|
|
54315
|
+
cluster,
|
|
54345
54316
|
namespace,
|
|
54346
|
-
|
|
54347
|
-
|
|
54317
|
+
plural,
|
|
54318
|
+
name,
|
|
54348
54319
|
labels,
|
|
54349
54320
|
fields,
|
|
54350
54321
|
limit
|
|
@@ -54360,21 +54331,21 @@ const useBuiltinResources = ({
|
|
|
54360
54331
|
});
|
|
54361
54332
|
};
|
|
54362
54333
|
const useBuiltinResourceSingle = ({
|
|
54363
|
-
|
|
54334
|
+
cluster,
|
|
54364
54335
|
namespace,
|
|
54365
|
-
|
|
54366
|
-
|
|
54336
|
+
plural,
|
|
54337
|
+
name,
|
|
54367
54338
|
refetchInterval
|
|
54368
54339
|
}) => {
|
|
54369
54340
|
return useQuery({
|
|
54370
|
-
queryKey: ["useBuiltinResourceSingle",
|
|
54371
|
-
queryFn: async () => (await getBuiltinResourceSingle({
|
|
54341
|
+
queryKey: ["useBuiltinResourceSingle", cluster, namespace, plural, name],
|
|
54342
|
+
queryFn: async () => (await getBuiltinResourceSingle({ cluster, namespace, plural, name })).data,
|
|
54372
54343
|
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
54373
54344
|
});
|
|
54374
54345
|
};
|
|
54375
54346
|
|
|
54376
54347
|
const useCrdResources = ({
|
|
54377
|
-
|
|
54348
|
+
cluster,
|
|
54378
54349
|
namespace,
|
|
54379
54350
|
apiGroup,
|
|
54380
54351
|
apiVersion,
|
|
@@ -54383,10 +54354,10 @@ const useCrdResources = ({
|
|
|
54383
54354
|
isEnabled
|
|
54384
54355
|
}) => {
|
|
54385
54356
|
return useQuery({
|
|
54386
|
-
queryKey: ["useCrdResources",
|
|
54357
|
+
queryKey: ["useCrdResources", cluster, namespace, apiGroup, apiVersion, crdName],
|
|
54387
54358
|
queryFn: async () => {
|
|
54388
54359
|
const response = await getCrdResources({
|
|
54389
|
-
|
|
54360
|
+
cluster,
|
|
54390
54361
|
namespace,
|
|
54391
54362
|
apiGroup,
|
|
54392
54363
|
apiVersion,
|
|
@@ -54403,33 +54374,33 @@ const useCrdResources = ({
|
|
|
54403
54374
|
});
|
|
54404
54375
|
};
|
|
54405
54376
|
const useCrdResourceSingle = ({
|
|
54406
|
-
|
|
54377
|
+
cluster,
|
|
54407
54378
|
namespace,
|
|
54408
54379
|
apiGroup,
|
|
54409
54380
|
apiVersion,
|
|
54410
54381
|
crdName,
|
|
54411
|
-
|
|
54382
|
+
name,
|
|
54412
54383
|
refetchInterval
|
|
54413
54384
|
}) => {
|
|
54414
54385
|
return useQuery({
|
|
54415
|
-
queryKey: ["useCrdResourceSingle",
|
|
54386
|
+
queryKey: ["useCrdResourceSingle", cluster, namespace, apiGroup, apiVersion, crdName, name],
|
|
54416
54387
|
queryFn: async () => (await getCrdResourceSingle({
|
|
54417
|
-
|
|
54388
|
+
cluster,
|
|
54418
54389
|
namespace,
|
|
54419
54390
|
apiGroup,
|
|
54420
54391
|
apiVersion,
|
|
54421
54392
|
crdName,
|
|
54422
|
-
|
|
54393
|
+
name
|
|
54423
54394
|
})).data,
|
|
54424
54395
|
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
54425
54396
|
});
|
|
54426
54397
|
};
|
|
54427
54398
|
|
|
54428
|
-
const useApisResourceTypes = ({
|
|
54399
|
+
const useApisResourceTypes = ({ cluster }) => {
|
|
54429
54400
|
return useQuery({
|
|
54430
|
-
queryKey: ["useApisResourceTypes",
|
|
54401
|
+
queryKey: ["useApisResourceTypes", cluster],
|
|
54431
54402
|
queryFn: async () => {
|
|
54432
|
-
const response = await getApiResourceTypes({
|
|
54403
|
+
const response = await getApiResourceTypes({ cluster });
|
|
54433
54404
|
const data = JSON.parse(JSON.stringify(response.data));
|
|
54434
54405
|
if (data.metadata?.resourceVersion) {
|
|
54435
54406
|
delete data.metadata.resourceVersion;
|
|
@@ -54440,15 +54411,15 @@ const useApisResourceTypes = ({ clusterName }) => {
|
|
|
54440
54411
|
});
|
|
54441
54412
|
};
|
|
54442
54413
|
const useApiResourceTypesByGroup = ({
|
|
54443
|
-
|
|
54414
|
+
cluster,
|
|
54444
54415
|
apiGroup,
|
|
54445
54416
|
apiVersion
|
|
54446
54417
|
}) => {
|
|
54447
54418
|
return useQuery({
|
|
54448
|
-
queryKey: ["useApiResourceTypesByGroup",
|
|
54419
|
+
queryKey: ["useApiResourceTypesByGroup", cluster, apiGroup, apiVersion],
|
|
54449
54420
|
queryFn: async () => {
|
|
54450
54421
|
const response = await getApiResourceTypesByApiGroup({
|
|
54451
|
-
|
|
54422
|
+
cluster,
|
|
54452
54423
|
apiGroup,
|
|
54453
54424
|
apiVersion
|
|
54454
54425
|
});
|
|
@@ -54462,11 +54433,11 @@ const useApiResourceTypesByGroup = ({
|
|
|
54462
54433
|
});
|
|
54463
54434
|
};
|
|
54464
54435
|
|
|
54465
|
-
const useBuiltinResourceTypes = ({
|
|
54436
|
+
const useBuiltinResourceTypes = ({ cluster }) => {
|
|
54466
54437
|
return useQuery({
|
|
54467
|
-
queryKey: ["useBuiltinResourceTypes",
|
|
54438
|
+
queryKey: ["useBuiltinResourceTypes", cluster],
|
|
54468
54439
|
queryFn: async () => {
|
|
54469
|
-
const response = await getBuiltinResourceTypes({
|
|
54440
|
+
const response = await getBuiltinResourceTypes({ cluster });
|
|
54470
54441
|
const data = JSON.parse(JSON.stringify(response.data));
|
|
54471
54442
|
if (data.metadata?.resourceVersion) {
|
|
54472
54443
|
delete data.metadata.resourceVersion;
|
|
@@ -54478,15 +54449,15 @@ const useBuiltinResourceTypes = ({ clusterName }) => {
|
|
|
54478
54449
|
};
|
|
54479
54450
|
|
|
54480
54451
|
const useCrdData = ({
|
|
54481
|
-
|
|
54452
|
+
cluster,
|
|
54482
54453
|
apiExtensionVersion,
|
|
54483
54454
|
crdName
|
|
54484
54455
|
}) => {
|
|
54485
54456
|
return useQuery({
|
|
54486
|
-
queryKey: ["useCrdData",
|
|
54457
|
+
queryKey: ["useCrdData", cluster, apiExtensionVersion, crdName],
|
|
54487
54458
|
queryFn: async () => {
|
|
54488
54459
|
const response = await getCrdData({
|
|
54489
|
-
|
|
54460
|
+
cluster,
|
|
54490
54461
|
apiExtensionVersion,
|
|
54491
54462
|
crdName
|
|
54492
54463
|
});
|