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