@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.12 → 1.1.0-alpha.14
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 +374 -385
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +374 -385
- 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 +22 -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,
|
|
@@ -38395,13 +38378,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38395
38378
|
keysToForcedLabel,
|
|
38396
38379
|
forcedRelatedValuePath,
|
|
38397
38380
|
jsonPathToArrayOfRefs,
|
|
38381
|
+
forcedApiVersion,
|
|
38398
38382
|
forcedNamespace,
|
|
38399
38383
|
baseFactoryNamespacedAPIKey,
|
|
38400
38384
|
baseFactoryClusterSceopedAPIKey,
|
|
38401
38385
|
baseFactoryNamespacedBuiltinKey,
|
|
38402
38386
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38403
|
-
|
|
38404
|
-
|
|
38387
|
+
baseNavigationPlural,
|
|
38388
|
+
baseNavigationName,
|
|
38405
38389
|
...props
|
|
38406
38390
|
} = data;
|
|
38407
38391
|
const theme = useTheme();
|
|
@@ -38410,10 +38394,17 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38410
38394
|
acc[index.toString()] = value;
|
|
38411
38395
|
return acc;
|
|
38412
38396
|
}, {});
|
|
38413
|
-
const
|
|
38414
|
-
|
|
38415
|
-
|
|
38416
|
-
|
|
38397
|
+
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
38398
|
+
const preparedForcedApiVersion = forcedApiVersion ? forcedApiVersion.map(({ kind, apiVersion }) => ({
|
|
38399
|
+
kind: prepareTemplate({
|
|
38400
|
+
template: kind,
|
|
38401
|
+
replaceValues
|
|
38402
|
+
}),
|
|
38403
|
+
apiVersion: prepareTemplate({
|
|
38404
|
+
template: apiVersion,
|
|
38405
|
+
replaceValues
|
|
38406
|
+
})
|
|
38407
|
+
})) : void 0;
|
|
38417
38408
|
const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
|
|
38418
38409
|
template: forcedNamespace,
|
|
38419
38410
|
replaceValues
|
|
@@ -38422,17 +38413,24 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38422
38413
|
if (jsonRoot === void 0) {
|
|
38423
38414
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
|
|
38424
38415
|
}
|
|
38425
|
-
const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)
|
|
38416
|
+
const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`).flat();
|
|
38426
38417
|
if (!Array.isArray(refsArr)) {
|
|
38427
38418
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
|
|
38428
38419
|
}
|
|
38429
38420
|
if (refsArr.length === 0) {
|
|
38430
38421
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
|
|
38431
38422
|
}
|
|
38432
|
-
|
|
38423
|
+
const refsArrWithForcedApiVersion = refsArr.map((el) => {
|
|
38424
|
+
const forceFound = preparedForcedApiVersion?.find((force) => force.kind === el.kind);
|
|
38425
|
+
if (forceFound) {
|
|
38426
|
+
return { ...el, apiVersion: forceFound.apiVersion };
|
|
38427
|
+
}
|
|
38428
|
+
return el;
|
|
38429
|
+
});
|
|
38430
|
+
if (refsArrWithForcedApiVersion.some((el) => !isOwnerReference(el))) {
|
|
38433
38431
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
|
|
38434
38432
|
}
|
|
38435
|
-
const guardedRefsArr =
|
|
38433
|
+
const guardedRefsArr = refsArrWithForcedApiVersion;
|
|
38436
38434
|
if (isMultiqueryLoading) {
|
|
38437
38435
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
38438
38436
|
}
|
|
@@ -38442,7 +38440,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38442
38440
|
{
|
|
38443
38441
|
theme,
|
|
38444
38442
|
baseprefix,
|
|
38445
|
-
cluster:
|
|
38443
|
+
cluster: clusterPrepared,
|
|
38446
38444
|
refsArr: guardedRefsArr,
|
|
38447
38445
|
keysToForcedLabel,
|
|
38448
38446
|
forcedRelatedValuePath,
|
|
@@ -38453,8 +38451,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38453
38451
|
baseFactoryClusterSceopedAPIKey,
|
|
38454
38452
|
baseFactoryNamespacedBuiltinKey,
|
|
38455
38453
|
baseFactoryClusterSceopedBuiltinKey,
|
|
38456
|
-
|
|
38457
|
-
|
|
38454
|
+
baseNavigationPlural,
|
|
38455
|
+
baseNavigationName,
|
|
38458
38456
|
listFlexProps,
|
|
38459
38457
|
...props
|
|
38460
38458
|
}
|
|
@@ -38778,7 +38776,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38778
38776
|
);
|
|
38779
38777
|
};
|
|
38780
38778
|
|
|
38781
|
-
const STRING_KEYS = [
|
|
38779
|
+
const STRING_KEYS = [
|
|
38780
|
+
"cluster",
|
|
38781
|
+
"apiGroup",
|
|
38782
|
+
"apiVersion",
|
|
38783
|
+
"plural",
|
|
38784
|
+
"namespace",
|
|
38785
|
+
"fieldSelector",
|
|
38786
|
+
"labelSelector"
|
|
38787
|
+
];
|
|
38782
38788
|
const DynamicRendererWithProviders = (props) => {
|
|
38783
38789
|
const location = reactRouterDom.useLocation();
|
|
38784
38790
|
const { urlsToFetch, dataToApplyToContext, theme, nodeTerminalDefaultProfile, disableEventBubbling } = props;
|
|
@@ -38850,6 +38856,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38850
38856
|
}) => {
|
|
38851
38857
|
if (possibleCustomTypeWithProps) {
|
|
38852
38858
|
const { type, customProps } = possibleCustomTypeWithProps;
|
|
38859
|
+
if (type === "factory") {
|
|
38860
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TableFactory, { record, customProps, theme });
|
|
38861
|
+
}
|
|
38853
38862
|
if (value === void 0 && possibleUndefinedValue) {
|
|
38854
38863
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ShortenedTextWithTooltip, { trimLength: possibleTrimLength, text: possibleUndefinedValue });
|
|
38855
38864
|
}
|
|
@@ -38887,9 +38896,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38887
38896
|
}
|
|
38888
38897
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TrimmedTags, { tags, trimLength: possibleTrimLength });
|
|
38889
38898
|
}
|
|
38890
|
-
if (type === "factory") {
|
|
38891
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TableFactory, { record, customProps, theme });
|
|
38892
|
-
}
|
|
38893
38899
|
}
|
|
38894
38900
|
if (value === null) {
|
|
38895
38901
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "null" });
|
|
@@ -39070,13 +39076,13 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39070
39076
|
domEvent.preventDefault();
|
|
39071
39077
|
if (key === "edit") {
|
|
39072
39078
|
navigate(
|
|
39073
|
-
`${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}`
|
|
39074
39080
|
);
|
|
39075
39081
|
}
|
|
39076
39082
|
if (key === "delete") {
|
|
39077
39083
|
value.onDeleteHandle(
|
|
39078
|
-
value.
|
|
39079
|
-
`${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}`
|
|
39080
39086
|
);
|
|
39081
39087
|
}
|
|
39082
39088
|
}
|
|
@@ -39177,8 +39183,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39177
39183
|
selectData.onChange(
|
|
39178
39184
|
selectedRowKeys,
|
|
39179
39185
|
rows.map(({ internalDataForControls }) => ({
|
|
39180
|
-
name: internalDataForControls.
|
|
39181
|
-
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}`
|
|
39182
39188
|
}))
|
|
39183
39189
|
);
|
|
39184
39190
|
}
|
|
@@ -39279,8 +39285,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39279
39285
|
syntheticProject: dataForControls.syntheticProject,
|
|
39280
39286
|
pathPrefix: dataForControls.pathPrefix,
|
|
39281
39287
|
apiGroupAndVersion: dataForControls.apiVersion,
|
|
39282
|
-
|
|
39283
|
-
|
|
39288
|
+
plural: dataForControls.plural,
|
|
39289
|
+
name: el.metadata.name,
|
|
39284
39290
|
namespace: el.metadata.namespace || void 0,
|
|
39285
39291
|
backlink: dataForControls.backlink,
|
|
39286
39292
|
deletePathPrefix: dataForControls.deletePathPrefix,
|
|
@@ -39362,8 +39368,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39362
39368
|
synthetichProject: dataForControls.syntheticProject,
|
|
39363
39369
|
pathPrefix: dataForControls.pathPrefix,
|
|
39364
39370
|
apiGroupAndVersion: dataForControls.apiVersion,
|
|
39365
|
-
|
|
39366
|
-
|
|
39371
|
+
plural: dataForControls.plural,
|
|
39372
|
+
name: el.metadata.name,
|
|
39367
39373
|
namespace: el.metadata.namespace || void 0,
|
|
39368
39374
|
backlink: dataForControls.backlink,
|
|
39369
39375
|
deletePathPrefix: dataForControls.deletePathPrefix,
|
|
@@ -39408,18 +39414,18 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39408
39414
|
const [isLoading, setIsLoading] = K.useState(false);
|
|
39409
39415
|
const [isError, setIsError] = K.useState(false);
|
|
39410
39416
|
const updatePermission = usePermissions({
|
|
39411
|
-
|
|
39412
|
-
|
|
39417
|
+
apiGroup: dataForControls?.apiGroup,
|
|
39418
|
+
plural: dataForControls?.plural || "",
|
|
39413
39419
|
namespace,
|
|
39414
|
-
|
|
39420
|
+
cluster,
|
|
39415
39421
|
verb: "update",
|
|
39416
39422
|
refetchInterval: false
|
|
39417
39423
|
});
|
|
39418
39424
|
const deletePermission = usePermissions({
|
|
39419
|
-
|
|
39420
|
-
|
|
39425
|
+
apiGroup: dataForControls?.apiGroup,
|
|
39426
|
+
plural: dataForControls?.plural || "",
|
|
39421
39427
|
namespace,
|
|
39422
|
-
|
|
39428
|
+
cluster,
|
|
39423
39429
|
verb: "delete",
|
|
39424
39430
|
refetchInterval: false
|
|
39425
39431
|
});
|
|
@@ -39427,7 +39433,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39427
39433
|
setIsError(void 0);
|
|
39428
39434
|
setIsLoading(true);
|
|
39429
39435
|
const payload = {
|
|
39430
|
-
|
|
39436
|
+
cluster,
|
|
39431
39437
|
customizationId,
|
|
39432
39438
|
tableMappingsReplaceValues,
|
|
39433
39439
|
forceDefaultAdditionalPrinterColumns,
|
|
@@ -39470,7 +39476,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
39470
39476
|
cluster: dataForControls.cluster,
|
|
39471
39477
|
syntheticProject: dataForControls.syntheticProject,
|
|
39472
39478
|
pathPrefix: !dataForControls.apiGroup || dataForControls.apiGroup.length === 0 ? "forms/builtin" : "forms/apis",
|
|
39473
|
-
|
|
39479
|
+
plural: dataForControls.plural,
|
|
39474
39480
|
apiVersion: !dataForControls.apiGroup || dataForControls.apiGroup.length === 0 ? dataForControls.apiVersion : `${dataForControls.apiGroup}/${dataForControls.apiVersion}`,
|
|
39475
39481
|
backlink: encodeURIComponent(fullPath),
|
|
39476
39482
|
onDeleteHandle: dataForControlsInternal.onDeleteHandle,
|
|
@@ -47047,7 +47053,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
47047
47053
|
isCreate,
|
|
47048
47054
|
type,
|
|
47049
47055
|
apiGroupApiVersion,
|
|
47050
|
-
|
|
47056
|
+
plural,
|
|
47051
47057
|
backlink,
|
|
47052
47058
|
designNewLayout,
|
|
47053
47059
|
designNewLayoutHeight,
|
|
@@ -47113,7 +47119,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
47113
47119
|
const { namespace } = currentValues.metadata;
|
|
47114
47120
|
const { name } = currentValues.metadata;
|
|
47115
47121
|
const body = currentValues;
|
|
47116
|
-
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}`;
|
|
47117
47123
|
if (isCreate) {
|
|
47118
47124
|
createNewEntry({ endpoint, body }).then((res) => {
|
|
47119
47125
|
console.log(res);
|
|
@@ -47946,7 +47952,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
47946
47952
|
const onValuesChangeCallBack = useOnValuesChangeCallback();
|
|
47947
47953
|
const isTouchedPeristed = useIsTouchedPersisted();
|
|
47948
47954
|
const updateTouched = useUpdateIsTouchedPersisted();
|
|
47949
|
-
const {
|
|
47955
|
+
const { cluster, namespace, syntheticProject, name: entryName } = urlParams;
|
|
47950
47956
|
const form = antd.Form.useFormInstance();
|
|
47951
47957
|
const fieldValue = antd.Form.useWatch(name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name, form);
|
|
47952
47958
|
const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
|
|
@@ -47999,7 +48005,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
47999
48005
|
}, [relatedPath, form, arrName, fixedName, relatedFieldValue, onValuesChangeCallBack, isTouchedPeristed]);
|
|
48000
48006
|
const uri = prepareTemplate({
|
|
48001
48007
|
template: customProps.valueUri,
|
|
48002
|
-
replaceValues: {
|
|
48008
|
+
replaceValues: { cluster, namespace, syntheticProject, relatedFieldValue, name: entryName }
|
|
48003
48009
|
});
|
|
48004
48010
|
const {
|
|
48005
48011
|
data: optionsObj,
|
|
@@ -48297,47 +48303,47 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
48297
48303
|
urlParams,
|
|
48298
48304
|
onRemoveByMinus
|
|
48299
48305
|
}) => {
|
|
48300
|
-
const {
|
|
48306
|
+
const { cluster, namespace, syntheticProject, name: entryName } = urlParams;
|
|
48301
48307
|
const minMaxAndStep = isEdit ? customProps.edit : customProps.add;
|
|
48302
48308
|
const minValueUri = minMaxAndStep.min.type === "resourceValue" ? prepareTemplate({
|
|
48303
48309
|
template: minMaxAndStep.min.valueUri,
|
|
48304
|
-
replaceValues: {
|
|
48310
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48305
48311
|
}) : void 0;
|
|
48306
48312
|
const minSubstractFirstValueUri = minMaxAndStep.min.type === "substractResourceValues" ? prepareTemplate({
|
|
48307
48313
|
template: minMaxAndStep.min.firstValueUri,
|
|
48308
|
-
replaceValues: {
|
|
48314
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48309
48315
|
}) : void 0;
|
|
48310
48316
|
const minSubstractSecondValueUri = minMaxAndStep.min.type === "substractResourceValues" ? prepareTemplate({
|
|
48311
48317
|
template: minMaxAndStep.min.secondValueUri,
|
|
48312
|
-
replaceValues: {
|
|
48318
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48313
48319
|
}) : void 0;
|
|
48314
48320
|
const minAddFirstValueUri = minMaxAndStep.min.type === "addResourceValues" ? prepareTemplate({
|
|
48315
48321
|
template: minMaxAndStep.min.firstValueUri,
|
|
48316
|
-
replaceValues: {
|
|
48322
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48317
48323
|
}) : void 0;
|
|
48318
48324
|
const minAddSecondValueUri = minMaxAndStep.min.type === "addResourceValues" ? prepareTemplate({
|
|
48319
48325
|
template: minMaxAndStep.min.secondValueUri,
|
|
48320
|
-
replaceValues: {
|
|
48326
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48321
48327
|
}) : void 0;
|
|
48322
48328
|
const maxValueUri = minMaxAndStep.max.type === "resourceValue" ? prepareTemplate({
|
|
48323
48329
|
template: minMaxAndStep.max.valueUri,
|
|
48324
|
-
replaceValues: {
|
|
48330
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48325
48331
|
}) : void 0;
|
|
48326
48332
|
const maxSubstractFirstValueUri = minMaxAndStep.max.type === "substractResourceValues" ? prepareTemplate({
|
|
48327
48333
|
template: minMaxAndStep.max.firstValueUri,
|
|
48328
|
-
replaceValues: {
|
|
48334
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48329
48335
|
}) : void 0;
|
|
48330
48336
|
const maxSubstractSecondValueUri = minMaxAndStep.max.type === "substractResourceValues" ? prepareTemplate({
|
|
48331
48337
|
template: minMaxAndStep.max.secondValueUri,
|
|
48332
|
-
replaceValues: {
|
|
48338
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48333
48339
|
}) : void 0;
|
|
48334
48340
|
const maxAddFirstValueUri = minMaxAndStep.max.type === "addResourceValues" ? prepareTemplate({
|
|
48335
48341
|
template: minMaxAndStep.max.firstValueUri,
|
|
48336
|
-
replaceValues: {
|
|
48342
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48337
48343
|
}) : void 0;
|
|
48338
48344
|
const maxAddSecondValueUri = minMaxAndStep.max.type === "addResourceValues" ? prepareTemplate({
|
|
48339
48345
|
template: minMaxAndStep.max.secondValueUri,
|
|
48340
|
-
replaceValues: {
|
|
48346
|
+
replaceValues: { cluster, namespace, syntheticProject, name: entryName }
|
|
48341
48347
|
}) : void 0;
|
|
48342
48348
|
const {
|
|
48343
48349
|
data: minValueObj,
|
|
@@ -50179,8 +50185,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50179
50185
|
isCreate,
|
|
50180
50186
|
type,
|
|
50181
50187
|
apiGroupApiVersion,
|
|
50182
|
-
|
|
50183
|
-
|
|
50188
|
+
kind,
|
|
50189
|
+
plural,
|
|
50184
50190
|
backlink,
|
|
50185
50191
|
designNewLayout,
|
|
50186
50192
|
designNewLayoutHeight
|
|
@@ -50215,8 +50221,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50215
50221
|
const yamlToValuesAbortRef = K.useRef(null);
|
|
50216
50222
|
const isAnyFieldFocusedRef = K.useRef(false);
|
|
50217
50223
|
const editorUri = K.useMemo(
|
|
50218
|
-
() => `inmemory://openapi-ui/${cluster}/${apiGroupApiVersion}/${type}/${
|
|
50219
|
-
[cluster, apiGroupApiVersion, type,
|
|
50224
|
+
() => `inmemory://openapi-ui/${cluster}/${apiGroupApiVersion}/${type}/${plural}/${kind}${isCreate ? "/create" : "/edit"}.yaml`,
|
|
50225
|
+
[cluster, apiGroupApiVersion, type, plural, kind, isCreate]
|
|
50220
50226
|
);
|
|
50221
50227
|
K.useEffect(() => {
|
|
50222
50228
|
valuesToYamlReqId.current++;
|
|
@@ -50234,19 +50240,19 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50234
50240
|
setYamlValues(void 0);
|
|
50235
50241
|
}, [editorUri]);
|
|
50236
50242
|
const createPermission = usePermissions({
|
|
50237
|
-
|
|
50238
|
-
|
|
50243
|
+
apiGroup: type === "builtin" ? void 0 : urlParamsForPermissions.apiGroup ? urlParamsForPermissions.apiGroup : "",
|
|
50244
|
+
plural: urlParamsForPermissions.plural || "",
|
|
50239
50245
|
namespace: isNameSpaced ? namespaceFromFormData : void 0,
|
|
50240
|
-
|
|
50246
|
+
cluster,
|
|
50241
50247
|
verb: "create",
|
|
50242
50248
|
refetchInterval: false,
|
|
50243
50249
|
enabler: isCreate === true
|
|
50244
50250
|
});
|
|
50245
50251
|
const updatePermission = usePermissions({
|
|
50246
|
-
|
|
50247
|
-
|
|
50252
|
+
apiGroup: type === "builtin" ? void 0 : urlParamsForPermissions.apiGroup ? urlParamsForPermissions.apiGroup : "",
|
|
50253
|
+
plural: urlParamsForPermissions.plural || "",
|
|
50248
50254
|
namespace: isNameSpaced ? namespaceFromFormData : void 0,
|
|
50249
|
-
|
|
50255
|
+
cluster,
|
|
50250
50256
|
verb: "update",
|
|
50251
50257
|
refetchInterval: false,
|
|
50252
50258
|
enabler: isCreate !== true
|
|
@@ -50276,7 +50282,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50276
50282
|
payload
|
|
50277
50283
|
).then(({ data }) => {
|
|
50278
50284
|
const body = data;
|
|
50279
|
-
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}`;
|
|
50280
50286
|
if (isCreate) {
|
|
50281
50287
|
createNewEntry({ endpoint, body }).then((res) => {
|
|
50282
50288
|
console.log(res);
|
|
@@ -50334,7 +50340,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50334
50340
|
const allValues2 = {};
|
|
50335
50341
|
if (isCreate) {
|
|
50336
50342
|
_$1.set(allValues2, ["apiVersion"], apiGroupApiVersion === "api/v1" ? "v1" : apiGroupApiVersion);
|
|
50337
|
-
_$1.set(allValues2, ["kind"],
|
|
50343
|
+
_$1.set(allValues2, ["kind"], kind);
|
|
50338
50344
|
}
|
|
50339
50345
|
if (formsPrefills) {
|
|
50340
50346
|
formsPrefills.spec.values.forEach(({ path, value }) => {
|
|
@@ -50354,7 +50360,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50354
50360
|
}
|
|
50355
50361
|
const sorted = Object.fromEntries(Object.entries(allValues2).sort(([a], [b]) => a.localeCompare(b)));
|
|
50356
50362
|
return sorted;
|
|
50357
|
-
}, [formsPrefills, prefillValueNamespaceOnly, isCreate, apiGroupApiVersion,
|
|
50363
|
+
}, [formsPrefills, prefillValueNamespaceOnly, isCreate, apiGroupApiVersion, kind, normalizedPrefill]);
|
|
50358
50364
|
const prefillTemplates = K.useMemo(() => {
|
|
50359
50365
|
const templates = [];
|
|
50360
50366
|
if (formsPrefills?.spec?.values?.length) {
|
|
@@ -50725,7 +50731,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50725
50731
|
return true;
|
|
50726
50732
|
});
|
|
50727
50733
|
setExpandedKeys([...uniqueKeys]);
|
|
50728
|
-
}, [apiGroupApiVersion, formsPrefills, prefillValuesSchema, type,
|
|
50734
|
+
}, [apiGroupApiVersion, formsPrefills, prefillValuesSchema, type, plural]);
|
|
50729
50735
|
K.useEffect(() => {
|
|
50730
50736
|
if (!initialValues) return;
|
|
50731
50737
|
setProperties((prev) => {
|
|
@@ -50984,7 +50990,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50984
50990
|
setIsLoading(true);
|
|
50985
50991
|
const payload = {
|
|
50986
50992
|
data,
|
|
50987
|
-
|
|
50993
|
+
cluster,
|
|
50988
50994
|
customizationId
|
|
50989
50995
|
};
|
|
50990
50996
|
axios.post(`/api/clusters/${cluster}/openapi-bff/forms/formPrepare/prepareFormProps`, payload).then(({ data: data2 }) => {
|
|
@@ -51003,10 +51009,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51003
51009
|
expandedPaths: data2.expandedPaths || [],
|
|
51004
51010
|
persistedPaths: data2.persistedPaths || [],
|
|
51005
51011
|
sortPaths: data2.sortPaths,
|
|
51006
|
-
|
|
51012
|
+
kind: data2.kind || "",
|
|
51007
51013
|
formPrefills: data2.formPrefills,
|
|
51008
51014
|
namespacesData: data2.namespacesData
|
|
51009
51015
|
});
|
|
51016
|
+
setIsError(void 0);
|
|
51010
51017
|
}
|
|
51011
51018
|
}).catch((e) => {
|
|
51012
51019
|
setIsError(e.message);
|
|
@@ -51028,7 +51035,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51028
51035
|
type: data.type,
|
|
51029
51036
|
isNameSpaced: isNamespaced,
|
|
51030
51037
|
apiGroupApiVersion: data.type === "builtin" ? "api/v1" : `${data.apiGroup}/${data.apiVersion}`,
|
|
51031
|
-
|
|
51038
|
+
plural: data.plural,
|
|
51032
51039
|
backlink,
|
|
51033
51040
|
designNewLayout,
|
|
51034
51041
|
designNewLayoutHeight
|
|
@@ -51064,8 +51071,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51064
51071
|
type: data.type,
|
|
51065
51072
|
isNameSpaced: isNamespaced ? preparedData.namespacesData : false,
|
|
51066
51073
|
apiGroupApiVersion: data.type === "builtin" ? "api/v1" : `${data.apiGroup}/${data.apiVersion}`,
|
|
51067
|
-
|
|
51068
|
-
|
|
51074
|
+
kind: preparedData.kind,
|
|
51075
|
+
plural: data.plural,
|
|
51069
51076
|
backlink,
|
|
51070
51077
|
designNewLayout,
|
|
51071
51078
|
designNewLayoutHeight
|
|
@@ -51156,11 +51163,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51156
51163
|
}
|
|
51157
51164
|
|
|
51158
51165
|
const AddEditFormModal = ({
|
|
51159
|
-
|
|
51166
|
+
cluster,
|
|
51160
51167
|
baseApiGroup,
|
|
51161
51168
|
baseApiVersion,
|
|
51162
|
-
|
|
51163
|
-
|
|
51169
|
+
marketplacePlural,
|
|
51170
|
+
marketplaceKind,
|
|
51164
51171
|
isOpen,
|
|
51165
51172
|
setIsOpen,
|
|
51166
51173
|
setError,
|
|
@@ -51176,7 +51183,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51176
51183
|
type: "direct",
|
|
51177
51184
|
apiGroup: "",
|
|
51178
51185
|
apiVersion: "",
|
|
51179
|
-
|
|
51186
|
+
plural: "",
|
|
51180
51187
|
pathToNav: "",
|
|
51181
51188
|
tags: [],
|
|
51182
51189
|
disabled: false,
|
|
@@ -51185,10 +51192,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51185
51192
|
const onSubmit = (values) => {
|
|
51186
51193
|
if (typeof isOpen === "boolean") {
|
|
51187
51194
|
createNewEntry({
|
|
51188
|
-
endpoint: `/api/clusters/${
|
|
51195
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseApiGroup}/${baseApiVersion}/${marketplacePlural}`,
|
|
51189
51196
|
body: {
|
|
51190
51197
|
apiVersion: `${baseApiGroup}/${baseApiVersion}`,
|
|
51191
|
-
kind:
|
|
51198
|
+
kind: marketplaceKind,
|
|
51192
51199
|
metadata: {
|
|
51193
51200
|
name: v4()
|
|
51194
51201
|
},
|
|
@@ -51205,10 +51212,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51205
51212
|
return;
|
|
51206
51213
|
}
|
|
51207
51214
|
updateEntry({
|
|
51208
|
-
endpoint: `/api/clusters/${
|
|
51215
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseApiGroup}/${baseApiVersion}/${marketplacePlural}/${isOpen.metadata.name}`,
|
|
51209
51216
|
body: {
|
|
51210
51217
|
apiVersion: `${baseApiGroup}/${baseApiVersion}`,
|
|
51211
|
-
kind:
|
|
51218
|
+
kind: marketplaceKind,
|
|
51212
51219
|
metadata: {
|
|
51213
51220
|
name: isOpen.metadata.name,
|
|
51214
51221
|
resourceVersion: isOpen.metadata.resourceVersion
|
|
@@ -51254,7 +51261,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51254
51261
|
) }),
|
|
51255
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" }) }),
|
|
51256
51263
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Form.Item, { label: "Enter API version", name: "apiVersion", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { disabled: type === "direct" }) }),
|
|
51257
|
-
/* @__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" }) }),
|
|
51258
51265
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Form.Item, { label: "Enter path", name: "pathToNav", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { disabled: type !== "direct" }) }),
|
|
51259
51266
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Form.Item, { label: "Tags", name: "tags", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51260
51267
|
antd.Select,
|
|
@@ -51273,11 +51280,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51273
51280
|
};
|
|
51274
51281
|
|
|
51275
51282
|
const getPathToNav = ({
|
|
51276
|
-
|
|
51283
|
+
cluster,
|
|
51277
51284
|
namespace,
|
|
51278
51285
|
type,
|
|
51279
51286
|
pathToNav,
|
|
51280
|
-
|
|
51287
|
+
plural,
|
|
51281
51288
|
apiGroup,
|
|
51282
51289
|
apiVersion,
|
|
51283
51290
|
baseprefix
|
|
@@ -51287,19 +51294,19 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51287
51294
|
return pathToNav;
|
|
51288
51295
|
}
|
|
51289
51296
|
if (type === "crd") {
|
|
51290
|
-
return `/${baseprefix}/${
|
|
51297
|
+
return `/${baseprefix}/${cluster}/${namespace}/crd-table/${apiGroup}/${apiVersion}/${apiExtensionVersion}/${plural}`;
|
|
51291
51298
|
}
|
|
51292
51299
|
if (type === "nonCrd") {
|
|
51293
|
-
return `/${baseprefix}/${
|
|
51300
|
+
return `/${baseprefix}/${cluster}/${namespace}/api-table/${apiGroup}/${apiVersion}/${plural}`;
|
|
51294
51301
|
}
|
|
51295
|
-
return `/${baseprefix}/${
|
|
51302
|
+
return `/${baseprefix}/${cluster}/${namespace}/builtin-table/${plural}`;
|
|
51296
51303
|
};
|
|
51297
51304
|
const getCreatePathToNav = ({
|
|
51298
|
-
|
|
51305
|
+
cluster,
|
|
51299
51306
|
namespace,
|
|
51300
51307
|
type,
|
|
51301
51308
|
pathToNav,
|
|
51302
|
-
|
|
51309
|
+
plural,
|
|
51303
51310
|
apiGroup,
|
|
51304
51311
|
apiVersion,
|
|
51305
51312
|
baseprefix
|
|
@@ -51308,12 +51315,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51308
51315
|
return pathToNav;
|
|
51309
51316
|
}
|
|
51310
51317
|
if (type === "crd") {
|
|
51311
|
-
return `/${baseprefix}/${
|
|
51318
|
+
return `/${baseprefix}/${cluster}/${namespace}/forms/crds/${apiGroup}/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
|
|
51312
51319
|
}
|
|
51313
51320
|
if (type === "nonCrd") {
|
|
51314
|
-
return `/${baseprefix}/${
|
|
51321
|
+
return `/${baseprefix}/${cluster}/${namespace}/forms/apis/${apiGroup}/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
|
|
51315
51322
|
}
|
|
51316
|
-
return `/${baseprefix}/${
|
|
51323
|
+
return `/${baseprefix}/${cluster}/${namespace}/forms/builtin/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
|
|
51317
51324
|
};
|
|
51318
51325
|
|
|
51319
51326
|
const CustomCard$4 = styled(antd.Card)`
|
|
@@ -51403,11 +51410,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51403
51410
|
description,
|
|
51404
51411
|
name,
|
|
51405
51412
|
icon,
|
|
51406
|
-
|
|
51413
|
+
cluster,
|
|
51407
51414
|
namespace,
|
|
51408
51415
|
type,
|
|
51409
51416
|
pathToNav,
|
|
51410
|
-
|
|
51417
|
+
plural,
|
|
51411
51418
|
apiGroup,
|
|
51412
51419
|
apiVersion,
|
|
51413
51420
|
tags,
|
|
@@ -51429,29 +51436,29 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51429
51436
|
decodedIcon = "Can't decode";
|
|
51430
51437
|
}
|
|
51431
51438
|
const navigateUrl = addedMode || standalone ? getPathToNav({
|
|
51432
|
-
|
|
51439
|
+
cluster,
|
|
51433
51440
|
namespace,
|
|
51434
51441
|
type,
|
|
51435
51442
|
pathToNav,
|
|
51436
|
-
|
|
51443
|
+
plural,
|
|
51437
51444
|
apiGroup,
|
|
51438
51445
|
apiVersion,
|
|
51439
51446
|
baseprefix
|
|
51440
51447
|
}) : getCreatePathToNav({
|
|
51441
|
-
|
|
51448
|
+
cluster,
|
|
51442
51449
|
namespace,
|
|
51443
51450
|
type,
|
|
51444
51451
|
pathToNav,
|
|
51445
|
-
|
|
51452
|
+
plural,
|
|
51446
51453
|
apiGroup,
|
|
51447
51454
|
apiVersion,
|
|
51448
51455
|
baseprefix
|
|
51449
51456
|
});
|
|
51450
51457
|
const { data: k8sList, error: k8sListError } = useK8sSmartResource({
|
|
51451
|
-
cluster
|
|
51458
|
+
cluster,
|
|
51452
51459
|
namespace,
|
|
51453
|
-
|
|
51454
|
-
|
|
51460
|
+
apiGroup,
|
|
51461
|
+
apiVersion: apiVersion || "",
|
|
51455
51462
|
plural: type,
|
|
51456
51463
|
isEnabled: Boolean(apiVersion && addedMode && type !== "direct")
|
|
51457
51464
|
});
|
|
@@ -51562,12 +51569,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51562
51569
|
};
|
|
51563
51570
|
|
|
51564
51571
|
const MarketPlace = ({
|
|
51565
|
-
|
|
51572
|
+
cluster,
|
|
51566
51573
|
namespace,
|
|
51567
51574
|
baseApiGroup,
|
|
51568
51575
|
baseApiVersion,
|
|
51569
|
-
|
|
51570
|
-
|
|
51576
|
+
marketplacePlural,
|
|
51577
|
+
marketplaceKind,
|
|
51571
51578
|
baseprefix,
|
|
51572
51579
|
standalone,
|
|
51573
51580
|
forceAddedMode,
|
|
@@ -51588,30 +51595,29 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51588
51595
|
isLoading,
|
|
51589
51596
|
error
|
|
51590
51597
|
} = useK8sSmartResource({
|
|
51591
|
-
cluster
|
|
51592
|
-
|
|
51593
|
-
|
|
51594
|
-
plural:
|
|
51595
|
-
isEnabled: Boolean(clusterName !== void 0)
|
|
51598
|
+
cluster,
|
|
51599
|
+
apiGroup: baseApiGroup,
|
|
51600
|
+
apiVersion: baseApiVersion,
|
|
51601
|
+
plural: marketplacePlural
|
|
51596
51602
|
});
|
|
51597
51603
|
const createPermission = usePermissions({
|
|
51598
|
-
|
|
51599
|
-
|
|
51600
|
-
|
|
51604
|
+
apiGroup: baseApiGroup,
|
|
51605
|
+
plural: marketplacePlural,
|
|
51606
|
+
cluster,
|
|
51601
51607
|
verb: "create",
|
|
51602
51608
|
refetchInterval: false
|
|
51603
51609
|
});
|
|
51604
51610
|
const updatePermission = usePermissions({
|
|
51605
|
-
|
|
51606
|
-
|
|
51607
|
-
|
|
51611
|
+
apiGroup: baseApiGroup,
|
|
51612
|
+
plural: marketplacePlural,
|
|
51613
|
+
cluster,
|
|
51608
51614
|
verb: "update",
|
|
51609
51615
|
refetchInterval: false
|
|
51610
51616
|
});
|
|
51611
51617
|
const deletePermission = usePermissions({
|
|
51612
|
-
|
|
51613
|
-
|
|
51614
|
-
|
|
51618
|
+
apiGroup: baseApiGroup,
|
|
51619
|
+
plural: marketplacePlural,
|
|
51620
|
+
cluster,
|
|
51615
51621
|
verb: "delete",
|
|
51616
51622
|
refetchInterval: false
|
|
51617
51623
|
});
|
|
@@ -51698,8 +51704,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51698
51704
|
}
|
|
51699
51705
|
),
|
|
51700
51706
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 22, wrap: true, children: [
|
|
51701
|
-
|
|
51702
|
-
({ name, description, icon, type, pathToNav,
|
|
51707
|
+
namespace && filteredAndSortedData.map(
|
|
51708
|
+
({ name, description, icon, type, pathToNav, plural, apiGroup, apiVersion, tags, disabled }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51703
51709
|
MarketplaceCard,
|
|
51704
51710
|
{
|
|
51705
51711
|
baseprefix,
|
|
@@ -51708,11 +51714,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51708
51714
|
icon,
|
|
51709
51715
|
isEditMode,
|
|
51710
51716
|
name,
|
|
51711
|
-
|
|
51717
|
+
cluster,
|
|
51712
51718
|
namespace,
|
|
51713
51719
|
type,
|
|
51714
51720
|
pathToNav,
|
|
51715
|
-
|
|
51721
|
+
plural,
|
|
51716
51722
|
apiGroup,
|
|
51717
51723
|
apiVersion,
|
|
51718
51724
|
tags,
|
|
@@ -51742,11 +51748,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51742
51748
|
isAddEditOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51743
51749
|
AddEditFormModal,
|
|
51744
51750
|
{
|
|
51745
|
-
|
|
51751
|
+
cluster,
|
|
51746
51752
|
baseApiGroup,
|
|
51747
51753
|
baseApiVersion,
|
|
51748
|
-
|
|
51749
|
-
|
|
51754
|
+
marketplacePlural,
|
|
51755
|
+
marketplaceKind,
|
|
51750
51756
|
isOpen: isAddEditOpen,
|
|
51751
51757
|
setError: setCreateUpdateError,
|
|
51752
51758
|
setIsOpen: setIsAddEditOpen,
|
|
@@ -51759,7 +51765,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51759
51765
|
{
|
|
51760
51766
|
name: isDeleteOpen.name,
|
|
51761
51767
|
onClose: () => setIsDeleteOpen(false),
|
|
51762
|
-
endpoint: `/api/clusters/${
|
|
51768
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseApiGroup}/${baseApiVersion}/${marketplacePlural}/${isDeleteOpen.name}`
|
|
51763
51769
|
}
|
|
51764
51770
|
)
|
|
51765
51771
|
] });
|
|
@@ -51878,14 +51884,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51878
51884
|
ActionMenuPlaceholder};
|
|
51879
51885
|
|
|
51880
51886
|
const ProjectInfoCard = ({
|
|
51881
|
-
|
|
51887
|
+
cluster,
|
|
51882
51888
|
namespace,
|
|
51883
51889
|
baseApiGroup,
|
|
51884
51890
|
baseApiVersion,
|
|
51885
51891
|
baseProjectApiGroup,
|
|
51886
51892
|
baseProjectVersion,
|
|
51887
|
-
|
|
51888
|
-
|
|
51893
|
+
marketplacePlural,
|
|
51894
|
+
projectPlural,
|
|
51889
51895
|
baseprefix,
|
|
51890
51896
|
accessGroups,
|
|
51891
51897
|
showZeroResources,
|
|
@@ -51897,45 +51903,43 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51897
51903
|
isLoading: marketplaceIsLoading
|
|
51898
51904
|
// error: marketplaceError,
|
|
51899
51905
|
} = useK8sSmartResource({
|
|
51900
|
-
cluster
|
|
51901
|
-
|
|
51902
|
-
|
|
51903
|
-
plural:
|
|
51904
|
-
isEnabled: Boolean(clusterName !== void 0)
|
|
51906
|
+
cluster,
|
|
51907
|
+
apiGroup: baseApiGroup,
|
|
51908
|
+
apiVersion: baseApiVersion,
|
|
51909
|
+
plural: marketplacePlural
|
|
51905
51910
|
});
|
|
51906
51911
|
const {
|
|
51907
51912
|
data: projectArr,
|
|
51908
51913
|
isLoading,
|
|
51909
51914
|
error
|
|
51910
51915
|
} = useK8sSmartResource({
|
|
51911
|
-
cluster
|
|
51912
|
-
|
|
51913
|
-
|
|
51914
|
-
plural:
|
|
51915
|
-
fieldSelector: `metadata.name=${namespace}
|
|
51916
|
-
isEnabled: Boolean(clusterName !== void 0)
|
|
51916
|
+
cluster,
|
|
51917
|
+
apiGroup: baseProjectApiGroup,
|
|
51918
|
+
apiVersion: baseProjectVersion,
|
|
51919
|
+
plural: projectPlural,
|
|
51920
|
+
fieldSelector: `metadata.name=${namespace}`
|
|
51917
51921
|
});
|
|
51918
51922
|
const project = projectArr && projectArr.items && projectArr.items.length > 0 ? projectArr.items[0] : void 0;
|
|
51919
51923
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = K.useState(false);
|
|
51920
51924
|
const updatePermission = usePermissions({
|
|
51921
|
-
|
|
51922
|
-
|
|
51923
|
-
|
|
51925
|
+
apiGroup: baseProjectApiGroup,
|
|
51926
|
+
plural: projectPlural,
|
|
51927
|
+
cluster,
|
|
51924
51928
|
verb: "update",
|
|
51925
51929
|
refetchInterval: false
|
|
51926
51930
|
});
|
|
51927
51931
|
const deletePermission = usePermissions({
|
|
51928
|
-
|
|
51929
|
-
|
|
51930
|
-
|
|
51932
|
+
apiGroup: baseProjectApiGroup,
|
|
51933
|
+
plural: projectPlural,
|
|
51934
|
+
cluster,
|
|
51931
51935
|
verb: "delete",
|
|
51932
51936
|
refetchInterval: false
|
|
51933
51937
|
});
|
|
51934
51938
|
const openUpdate = K.useCallback(() => {
|
|
51935
51939
|
navigate(
|
|
51936
|
-
`/${baseprefix}/${
|
|
51940
|
+
`/${baseprefix}/${cluster}/forms/apis/${baseProjectApiGroup}/${baseProjectVersion}/${projectPlural}/${namespace}?backlink=${baseprefix}/clusters/${cluster}`
|
|
51937
51941
|
);
|
|
51938
|
-
}, [baseprefix,
|
|
51942
|
+
}, [baseprefix, cluster, namespace, baseProjectApiGroup, baseProjectVersion, projectPlural, navigate]);
|
|
51939
51943
|
if (isLoading) {
|
|
51940
51944
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {});
|
|
51941
51945
|
}
|
|
@@ -51964,7 +51968,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51964
51968
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 12, $samespace: true }),
|
|
51965
51969
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 22, wrap: true, children: [
|
|
51966
51970
|
marketplaceIsLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
|
|
51967
|
-
|
|
51971
|
+
namespace && marketplacePanels?.items.map(({ spec }) => spec).sort().map(({ name, description, icon, type, pathToNav, plural, apiGroup, apiVersion, tags, disabled }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51968
51972
|
MarketplaceCard,
|
|
51969
51973
|
{
|
|
51970
51974
|
baseprefix,
|
|
@@ -51973,11 +51977,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51973
51977
|
icon,
|
|
51974
51978
|
isEditMode: false,
|
|
51975
51979
|
name,
|
|
51976
|
-
|
|
51980
|
+
cluster,
|
|
51977
51981
|
namespace,
|
|
51978
51982
|
type,
|
|
51979
51983
|
pathToNav,
|
|
51980
|
-
|
|
51984
|
+
plural,
|
|
51981
51985
|
apiGroup,
|
|
51982
51986
|
apiVersion,
|
|
51983
51987
|
tags,
|
|
@@ -51993,9 +51997,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
51993
51997
|
name: project.metadata.name,
|
|
51994
51998
|
onClose: () => {
|
|
51995
51999
|
setIsDeleteModalOpen(false);
|
|
51996
|
-
navigate(`${baseprefix}/clusters/${
|
|
52000
|
+
navigate(`${baseprefix}/clusters/${cluster}`);
|
|
51997
52001
|
},
|
|
51998
|
-
endpoint: `/api/clusters/${
|
|
52002
|
+
endpoint: `/api/clusters/${cluster}/k8s/apis/${baseProjectApiGroup}/${baseProjectVersion}/${projectPlural}/${project.metadata.name}`
|
|
51999
52003
|
}
|
|
52000
52004
|
)
|
|
52001
52005
|
] });
|
|
@@ -53538,14 +53542,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53538
53542
|
baseFactoryNamespacedBuiltinKey,
|
|
53539
53543
|
baseFactoryClusterSceopedBuiltinKey,
|
|
53540
53544
|
baseNamespaceFactoryKey,
|
|
53541
|
-
|
|
53542
|
-
|
|
53545
|
+
baseNavigationPlural,
|
|
53546
|
+
baseNavigationName
|
|
53543
53547
|
}) => {
|
|
53544
53548
|
const { token } = antd.theme.useToken();
|
|
53545
53549
|
const [kindIndex, setKindIndex] = K.useState();
|
|
53546
53550
|
const [kindsWithVersion, setKindWithVersion] = K.useState();
|
|
53547
53551
|
K.useEffect(() => {
|
|
53548
|
-
getKinds({
|
|
53552
|
+
getKinds({ cluster }).then((data) => {
|
|
53549
53553
|
setKindIndex(data);
|
|
53550
53554
|
setKindWithVersion(getSortedKindsAll(data));
|
|
53551
53555
|
}).catch((error) => {
|
|
@@ -53554,10 +53558,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53554
53558
|
}, [cluster]);
|
|
53555
53559
|
const { data: navigationDataArr } = useK8sSmartResource({
|
|
53556
53560
|
cluster,
|
|
53557
|
-
|
|
53558
|
-
|
|
53559
|
-
plural:
|
|
53560
|
-
fieldSelector: `metadata.name=${
|
|
53561
|
+
apiGroup: "front.in-cloud.io",
|
|
53562
|
+
apiVersion: "v1alpha1",
|
|
53563
|
+
plural: baseNavigationPlural,
|
|
53564
|
+
fieldSelector: `metadata.name=${baseNavigationName}`
|
|
53561
53565
|
});
|
|
53562
53566
|
const [isPaused, setIsPaused] = K.useState(false);
|
|
53563
53567
|
const pausedRef = K.useRef(isPaused);
|
|
@@ -53901,44 +53905,44 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53901
53905
|
};
|
|
53902
53906
|
|
|
53903
53907
|
const filterIfApiInstanceNamespaceScoped = async ({
|
|
53908
|
+
cluster,
|
|
53904
53909
|
namespace,
|
|
53905
|
-
data,
|
|
53906
53910
|
apiGroup,
|
|
53907
53911
|
apiVersion,
|
|
53908
|
-
|
|
53912
|
+
data
|
|
53909
53913
|
}) => {
|
|
53910
53914
|
const payload = {
|
|
53915
|
+
cluster,
|
|
53911
53916
|
namespace,
|
|
53912
|
-
data,
|
|
53913
53917
|
apiGroup,
|
|
53914
53918
|
apiVersion,
|
|
53915
|
-
|
|
53919
|
+
data
|
|
53916
53920
|
};
|
|
53917
53921
|
const result = await axios.post(
|
|
53918
|
-
`/api/clusters/${
|
|
53922
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/filterScopes/filterIfApiNamespaceScoped`,
|
|
53919
53923
|
payload
|
|
53920
53924
|
);
|
|
53921
53925
|
return result.data;
|
|
53922
53926
|
};
|
|
53923
53927
|
const filterIfBuiltInInstanceNamespaceScoped = async ({
|
|
53928
|
+
cluster,
|
|
53924
53929
|
namespace,
|
|
53925
|
-
data
|
|
53926
|
-
clusterName
|
|
53930
|
+
data
|
|
53927
53931
|
}) => {
|
|
53928
53932
|
const payload = {
|
|
53933
|
+
cluster,
|
|
53929
53934
|
namespace,
|
|
53930
|
-
data
|
|
53931
|
-
clusterName
|
|
53935
|
+
data
|
|
53932
53936
|
};
|
|
53933
53937
|
const result = await axios.post(
|
|
53934
|
-
`/api/clusters/${
|
|
53938
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/filterScopes/filterIfBuiltInNamespaceScoped`,
|
|
53935
53939
|
payload
|
|
53936
53940
|
);
|
|
53937
53941
|
return result.data;
|
|
53938
53942
|
};
|
|
53939
53943
|
|
|
53940
53944
|
const getGroupsByCategory = async ({
|
|
53941
|
-
|
|
53945
|
+
cluster,
|
|
53942
53946
|
apiGroupListData,
|
|
53943
53947
|
builtinResourceTypesData,
|
|
53944
53948
|
namespace,
|
|
@@ -53950,7 +53954,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53950
53954
|
const filteredBuiltinData = await filterIfBuiltInInstanceNamespaceScoped({
|
|
53951
53955
|
namespace,
|
|
53952
53956
|
data: builtinResourceTypesData,
|
|
53953
|
-
|
|
53957
|
+
cluster
|
|
53954
53958
|
});
|
|
53955
53959
|
return { crdGroups, nonCrdGroups, builtinGroups: filteredBuiltinData, apiExtensionVersion };
|
|
53956
53960
|
};
|
|
@@ -54065,12 +54069,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54065
54069
|
};
|
|
54066
54070
|
|
|
54067
54071
|
const getApiResources = async ({
|
|
54068
|
-
|
|
54072
|
+
cluster,
|
|
54069
54073
|
namespace,
|
|
54070
54074
|
apiGroup,
|
|
54071
54075
|
apiVersion,
|
|
54072
|
-
|
|
54073
|
-
|
|
54076
|
+
plural,
|
|
54077
|
+
name,
|
|
54074
54078
|
labels,
|
|
54075
54079
|
fields,
|
|
54076
54080
|
limit
|
|
@@ -54087,27 +54091,27 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54087
54091
|
}
|
|
54088
54092
|
const searchParams = params.toString();
|
|
54089
54093
|
return axios.get(
|
|
54090
|
-
`/api/clusters/${
|
|
54094
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${plural}${name ? `/${name}` : ""}${searchParams.length > 0 ? `?${searchParams}` : ""}`
|
|
54091
54095
|
);
|
|
54092
54096
|
};
|
|
54093
54097
|
const getApiResourceSingle = async ({
|
|
54094
|
-
|
|
54098
|
+
cluster,
|
|
54095
54099
|
namespace,
|
|
54096
54100
|
apiGroup,
|
|
54097
54101
|
apiVersion,
|
|
54098
|
-
|
|
54099
|
-
|
|
54102
|
+
plural,
|
|
54103
|
+
name
|
|
54100
54104
|
}) => {
|
|
54101
54105
|
return axios.get(
|
|
54102
|
-
`/api/clusters/${
|
|
54106
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${plural}/${name}`
|
|
54103
54107
|
);
|
|
54104
54108
|
};
|
|
54105
54109
|
|
|
54106
54110
|
const getBuiltinResources = async ({
|
|
54107
|
-
|
|
54111
|
+
cluster,
|
|
54108
54112
|
namespace,
|
|
54109
|
-
|
|
54110
|
-
|
|
54113
|
+
plural,
|
|
54114
|
+
name,
|
|
54111
54115
|
labels,
|
|
54112
54116
|
fields,
|
|
54113
54117
|
limit
|
|
@@ -54124,105 +54128,101 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54124
54128
|
}
|
|
54125
54129
|
const searchParams = params.toString();
|
|
54126
54130
|
return axios.get(
|
|
54127
|
-
`/api/clusters/${
|
|
54131
|
+
`/api/clusters/${cluster}/k8s/api/v1${namespace ? `/namespaces/${namespace}` : ""}/${plural}${name ? `/${name}` : ""}${searchParams.length > 0 ? `?${searchParams}` : ""}`
|
|
54128
54132
|
);
|
|
54129
54133
|
};
|
|
54130
54134
|
const getBuiltinResourceSingle = async ({
|
|
54131
|
-
|
|
54135
|
+
cluster,
|
|
54132
54136
|
namespace,
|
|
54133
|
-
|
|
54134
|
-
|
|
54137
|
+
plural,
|
|
54138
|
+
name
|
|
54135
54139
|
}) => {
|
|
54136
54140
|
return axios.get(
|
|
54137
|
-
`/api/clusters/${
|
|
54141
|
+
`/api/clusters/${cluster}/k8s/api/v1${namespace ? `/namespaces/${namespace}` : ""}/${plural}/${name}`
|
|
54138
54142
|
);
|
|
54139
54143
|
};
|
|
54140
54144
|
|
|
54141
54145
|
const getCrdResources = async ({
|
|
54142
|
-
|
|
54146
|
+
cluster,
|
|
54143
54147
|
namespace,
|
|
54144
54148
|
apiGroup,
|
|
54145
54149
|
apiVersion,
|
|
54146
54150
|
crdName
|
|
54147
54151
|
}) => {
|
|
54148
54152
|
return axios.get(
|
|
54149
|
-
`/api/clusters/${
|
|
54153
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${crdName}`
|
|
54150
54154
|
);
|
|
54151
54155
|
};
|
|
54152
54156
|
const getCrdResourceSingle = async ({
|
|
54153
|
-
|
|
54157
|
+
cluster,
|
|
54154
54158
|
namespace,
|
|
54155
54159
|
apiGroup,
|
|
54156
54160
|
apiVersion,
|
|
54157
54161
|
crdName,
|
|
54158
|
-
|
|
54162
|
+
name
|
|
54159
54163
|
}) => {
|
|
54160
54164
|
return axios.get(
|
|
54161
|
-
`/api/clusters/${
|
|
54165
|
+
`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}${namespace ? `/namespaces/${namespace}` : ""}/${crdName}/${name}`
|
|
54162
54166
|
);
|
|
54163
54167
|
};
|
|
54164
54168
|
|
|
54165
|
-
const getApiResourceTypes = async ({
|
|
54166
|
-
return axios.get(`/api/clusters/${
|
|
54169
|
+
const getApiResourceTypes = async ({ cluster }) => {
|
|
54170
|
+
return axios.get(`/api/clusters/${cluster}/k8s/apis/`);
|
|
54167
54171
|
};
|
|
54168
54172
|
const getApiResourceTypesByApiGroup = async ({
|
|
54169
|
-
|
|
54173
|
+
cluster,
|
|
54170
54174
|
apiGroup,
|
|
54171
54175
|
apiVersion
|
|
54172
54176
|
}) => {
|
|
54173
|
-
return axios.get(`/api/clusters/${
|
|
54177
|
+
return axios.get(`/api/clusters/${cluster}/k8s/apis/${apiGroup}/${apiVersion}/`);
|
|
54174
54178
|
};
|
|
54175
54179
|
|
|
54176
|
-
const getBuiltinResourceTypes = async ({
|
|
54177
|
-
|
|
54178
|
-
}) => {
|
|
54179
|
-
return axios.get(`/api/clusters/${clusterName}/k8s/api/v1`);
|
|
54180
|
+
const getBuiltinResourceTypes = async ({ cluster }) => {
|
|
54181
|
+
return axios.get(`/api/clusters/${cluster}/k8s/api/v1`);
|
|
54180
54182
|
};
|
|
54181
54183
|
|
|
54182
54184
|
const getCrdData = async ({
|
|
54183
|
-
|
|
54185
|
+
cluster,
|
|
54184
54186
|
apiExtensionVersion,
|
|
54185
54187
|
crdName
|
|
54186
54188
|
}) => {
|
|
54187
54189
|
return axios.get(
|
|
54188
|
-
`/api/clusters/${
|
|
54190
|
+
`/api/clusters/${cluster}/k8s/apis/apiextensions.k8s.io/${apiExtensionVersion}/customresourcedefinitions/${crdName}`
|
|
54189
54191
|
);
|
|
54190
54192
|
};
|
|
54191
54193
|
|
|
54192
|
-
const getSwagger = async ({
|
|
54193
|
-
|
|
54194
|
-
}) => {
|
|
54195
|
-
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}`);
|
|
54196
54196
|
};
|
|
54197
54197
|
|
|
54198
54198
|
const checkIfApiInstanceNamespaceScoped = async ({
|
|
54199
|
-
|
|
54199
|
+
plural,
|
|
54200
54200
|
apiGroup,
|
|
54201
54201
|
apiVersion,
|
|
54202
|
-
|
|
54202
|
+
cluster
|
|
54203
54203
|
}) => {
|
|
54204
54204
|
const payload = {
|
|
54205
|
-
|
|
54205
|
+
plural,
|
|
54206
54206
|
apiGroup,
|
|
54207
54207
|
apiVersion,
|
|
54208
|
-
|
|
54208
|
+
cluster
|
|
54209
54209
|
};
|
|
54210
54210
|
const { data } = await axios.post(
|
|
54211
|
-
`/api/clusters/${
|
|
54211
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/checkScopes/checkIfApiNamespaceScoped`,
|
|
54212
54212
|
payload
|
|
54213
54213
|
);
|
|
54214
54214
|
return data;
|
|
54215
54215
|
};
|
|
54216
54216
|
const checkIfBuiltInInstanceNamespaceScoped = async ({
|
|
54217
|
-
|
|
54218
|
-
|
|
54217
|
+
plural,
|
|
54218
|
+
cluster
|
|
54219
54219
|
}) => {
|
|
54220
54220
|
const payload = {
|
|
54221
|
-
|
|
54222
|
-
|
|
54221
|
+
plural,
|
|
54222
|
+
cluster
|
|
54223
54223
|
};
|
|
54224
54224
|
const { data } = await axios.post(
|
|
54225
|
-
`/api/clusters/${
|
|
54225
|
+
`/api/clusters/${cluster}/openapi-bff/scopes/checkScopes/checkIfBuiltInNamespaceScoped`,
|
|
54226
54226
|
payload
|
|
54227
54227
|
);
|
|
54228
54228
|
return data;
|
|
@@ -54237,12 +54237,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54237
54237
|
};
|
|
54238
54238
|
|
|
54239
54239
|
const useApiResources = ({
|
|
54240
|
-
|
|
54240
|
+
cluster,
|
|
54241
54241
|
namespace,
|
|
54242
54242
|
apiGroup,
|
|
54243
54243
|
apiVersion,
|
|
54244
|
-
|
|
54245
|
-
|
|
54244
|
+
plural,
|
|
54245
|
+
name,
|
|
54246
54246
|
labels,
|
|
54247
54247
|
fields,
|
|
54248
54248
|
limit,
|
|
@@ -54250,26 +54250,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54250
54250
|
isEnabled
|
|
54251
54251
|
}) => {
|
|
54252
54252
|
return reactQuery.useQuery({
|
|
54253
|
-
queryKey: [
|
|
54254
|
-
"useApiResources",
|
|
54255
|
-
clusterName,
|
|
54256
|
-
namespace,
|
|
54257
|
-
apiGroup,
|
|
54258
|
-
apiVersion,
|
|
54259
|
-
typeName,
|
|
54260
|
-
specificName,
|
|
54261
|
-
labels,
|
|
54262
|
-
fields,
|
|
54263
|
-
limit
|
|
54264
|
-
],
|
|
54253
|
+
queryKey: ["useApiResources", cluster, namespace, apiGroup, apiVersion, plural, name, labels, fields, limit],
|
|
54265
54254
|
queryFn: async () => {
|
|
54266
54255
|
const response = await getApiResources({
|
|
54267
|
-
|
|
54256
|
+
cluster,
|
|
54268
54257
|
namespace,
|
|
54269
54258
|
apiGroup,
|
|
54270
54259
|
apiVersion,
|
|
54271
|
-
|
|
54272
|
-
|
|
54260
|
+
plural,
|
|
54261
|
+
name,
|
|
54273
54262
|
labels,
|
|
54274
54263
|
fields,
|
|
54275
54264
|
limit
|
|
@@ -54285,33 +54274,33 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54285
54274
|
});
|
|
54286
54275
|
};
|
|
54287
54276
|
const useApiResourceSingle = ({
|
|
54288
|
-
|
|
54277
|
+
cluster,
|
|
54289
54278
|
namespace,
|
|
54290
54279
|
apiGroup,
|
|
54291
54280
|
apiVersion,
|
|
54292
|
-
|
|
54293
|
-
|
|
54281
|
+
plural,
|
|
54282
|
+
name,
|
|
54294
54283
|
refetchInterval
|
|
54295
54284
|
}) => {
|
|
54296
54285
|
return reactQuery.useQuery({
|
|
54297
|
-
queryKey: ["useApiResourceSingle",
|
|
54286
|
+
queryKey: ["useApiResourceSingle", cluster, namespace, apiGroup, apiVersion, plural, name],
|
|
54298
54287
|
queryFn: async () => (await getApiResourceSingle({
|
|
54299
|
-
|
|
54288
|
+
cluster,
|
|
54300
54289
|
namespace,
|
|
54301
54290
|
apiGroup,
|
|
54302
54291
|
apiVersion,
|
|
54303
|
-
|
|
54304
|
-
|
|
54292
|
+
plural,
|
|
54293
|
+
name
|
|
54305
54294
|
})).data,
|
|
54306
54295
|
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
54307
54296
|
});
|
|
54308
54297
|
};
|
|
54309
54298
|
|
|
54310
54299
|
const useBuiltinResources = ({
|
|
54311
|
-
|
|
54300
|
+
cluster,
|
|
54312
54301
|
namespace,
|
|
54313
|
-
|
|
54314
|
-
|
|
54302
|
+
plural,
|
|
54303
|
+
name,
|
|
54315
54304
|
labels,
|
|
54316
54305
|
fields,
|
|
54317
54306
|
limit,
|
|
@@ -54319,13 +54308,13 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54319
54308
|
isEnabled
|
|
54320
54309
|
}) => {
|
|
54321
54310
|
return reactQuery.useQuery({
|
|
54322
|
-
queryKey: ["useBuiltinResourceType",
|
|
54311
|
+
queryKey: ["useBuiltinResourceType", cluster, namespace, plural, name, labels, fields, limit],
|
|
54323
54312
|
queryFn: async () => {
|
|
54324
54313
|
const response = await getBuiltinResources({
|
|
54325
|
-
|
|
54314
|
+
cluster,
|
|
54326
54315
|
namespace,
|
|
54327
|
-
|
|
54328
|
-
|
|
54316
|
+
plural,
|
|
54317
|
+
name,
|
|
54329
54318
|
labels,
|
|
54330
54319
|
fields,
|
|
54331
54320
|
limit
|
|
@@ -54341,21 +54330,21 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54341
54330
|
});
|
|
54342
54331
|
};
|
|
54343
54332
|
const useBuiltinResourceSingle = ({
|
|
54344
|
-
|
|
54333
|
+
cluster,
|
|
54345
54334
|
namespace,
|
|
54346
|
-
|
|
54347
|
-
|
|
54335
|
+
plural,
|
|
54336
|
+
name,
|
|
54348
54337
|
refetchInterval
|
|
54349
54338
|
}) => {
|
|
54350
54339
|
return reactQuery.useQuery({
|
|
54351
|
-
queryKey: ["useBuiltinResourceSingle",
|
|
54352
|
-
queryFn: async () => (await getBuiltinResourceSingle({
|
|
54340
|
+
queryKey: ["useBuiltinResourceSingle", cluster, namespace, plural, name],
|
|
54341
|
+
queryFn: async () => (await getBuiltinResourceSingle({ cluster, namespace, plural, name })).data,
|
|
54353
54342
|
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
54354
54343
|
});
|
|
54355
54344
|
};
|
|
54356
54345
|
|
|
54357
54346
|
const useCrdResources = ({
|
|
54358
|
-
|
|
54347
|
+
cluster,
|
|
54359
54348
|
namespace,
|
|
54360
54349
|
apiGroup,
|
|
54361
54350
|
apiVersion,
|
|
@@ -54364,10 +54353,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54364
54353
|
isEnabled
|
|
54365
54354
|
}) => {
|
|
54366
54355
|
return reactQuery.useQuery({
|
|
54367
|
-
queryKey: ["useCrdResources",
|
|
54356
|
+
queryKey: ["useCrdResources", cluster, namespace, apiGroup, apiVersion, crdName],
|
|
54368
54357
|
queryFn: async () => {
|
|
54369
54358
|
const response = await getCrdResources({
|
|
54370
|
-
|
|
54359
|
+
cluster,
|
|
54371
54360
|
namespace,
|
|
54372
54361
|
apiGroup,
|
|
54373
54362
|
apiVersion,
|
|
@@ -54384,33 +54373,33 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54384
54373
|
});
|
|
54385
54374
|
};
|
|
54386
54375
|
const useCrdResourceSingle = ({
|
|
54387
|
-
|
|
54376
|
+
cluster,
|
|
54388
54377
|
namespace,
|
|
54389
54378
|
apiGroup,
|
|
54390
54379
|
apiVersion,
|
|
54391
54380
|
crdName,
|
|
54392
|
-
|
|
54381
|
+
name,
|
|
54393
54382
|
refetchInterval
|
|
54394
54383
|
}) => {
|
|
54395
54384
|
return reactQuery.useQuery({
|
|
54396
|
-
queryKey: ["useCrdResourceSingle",
|
|
54385
|
+
queryKey: ["useCrdResourceSingle", cluster, namespace, apiGroup, apiVersion, crdName, name],
|
|
54397
54386
|
queryFn: async () => (await getCrdResourceSingle({
|
|
54398
|
-
|
|
54387
|
+
cluster,
|
|
54399
54388
|
namespace,
|
|
54400
54389
|
apiGroup,
|
|
54401
54390
|
apiVersion,
|
|
54402
54391
|
crdName,
|
|
54403
|
-
|
|
54392
|
+
name
|
|
54404
54393
|
})).data,
|
|
54405
54394
|
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
|
|
54406
54395
|
});
|
|
54407
54396
|
};
|
|
54408
54397
|
|
|
54409
|
-
const useApisResourceTypes = ({
|
|
54398
|
+
const useApisResourceTypes = ({ cluster }) => {
|
|
54410
54399
|
return reactQuery.useQuery({
|
|
54411
|
-
queryKey: ["useApisResourceTypes",
|
|
54400
|
+
queryKey: ["useApisResourceTypes", cluster],
|
|
54412
54401
|
queryFn: async () => {
|
|
54413
|
-
const response = await getApiResourceTypes({
|
|
54402
|
+
const response = await getApiResourceTypes({ cluster });
|
|
54414
54403
|
const data = JSON.parse(JSON.stringify(response.data));
|
|
54415
54404
|
if (data.metadata?.resourceVersion) {
|
|
54416
54405
|
delete data.metadata.resourceVersion;
|
|
@@ -54421,15 +54410,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54421
54410
|
});
|
|
54422
54411
|
};
|
|
54423
54412
|
const useApiResourceTypesByGroup = ({
|
|
54424
|
-
|
|
54413
|
+
cluster,
|
|
54425
54414
|
apiGroup,
|
|
54426
54415
|
apiVersion
|
|
54427
54416
|
}) => {
|
|
54428
54417
|
return reactQuery.useQuery({
|
|
54429
|
-
queryKey: ["useApiResourceTypesByGroup",
|
|
54418
|
+
queryKey: ["useApiResourceTypesByGroup", cluster, apiGroup, apiVersion],
|
|
54430
54419
|
queryFn: async () => {
|
|
54431
54420
|
const response = await getApiResourceTypesByApiGroup({
|
|
54432
|
-
|
|
54421
|
+
cluster,
|
|
54433
54422
|
apiGroup,
|
|
54434
54423
|
apiVersion
|
|
54435
54424
|
});
|
|
@@ -54443,11 +54432,11 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54443
54432
|
});
|
|
54444
54433
|
};
|
|
54445
54434
|
|
|
54446
|
-
const useBuiltinResourceTypes = ({
|
|
54435
|
+
const useBuiltinResourceTypes = ({ cluster }) => {
|
|
54447
54436
|
return reactQuery.useQuery({
|
|
54448
|
-
queryKey: ["useBuiltinResourceTypes",
|
|
54437
|
+
queryKey: ["useBuiltinResourceTypes", cluster],
|
|
54449
54438
|
queryFn: async () => {
|
|
54450
|
-
const response = await getBuiltinResourceTypes({
|
|
54439
|
+
const response = await getBuiltinResourceTypes({ cluster });
|
|
54451
54440
|
const data = JSON.parse(JSON.stringify(response.data));
|
|
54452
54441
|
if (data.metadata?.resourceVersion) {
|
|
54453
54442
|
delete data.metadata.resourceVersion;
|
|
@@ -54459,15 +54448,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
54459
54448
|
};
|
|
54460
54449
|
|
|
54461
54450
|
const useCrdData = ({
|
|
54462
|
-
|
|
54451
|
+
cluster,
|
|
54463
54452
|
apiExtensionVersion,
|
|
54464
54453
|
crdName
|
|
54465
54454
|
}) => {
|
|
54466
54455
|
return reactQuery.useQuery({
|
|
54467
|
-
queryKey: ["useCrdData",
|
|
54456
|
+
queryKey: ["useCrdData", cluster, apiExtensionVersion, crdName],
|
|
54468
54457
|
queryFn: async () => {
|
|
54469
54458
|
const response = await getCrdData({
|
|
54470
|
-
|
|
54459
|
+
cluster,
|
|
54471
54460
|
apiExtensionVersion,
|
|
54472
54461
|
crdName
|
|
54473
54462
|
});
|