@cobaltcore-dev/aurora 0.18.0 → 0.19.1
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/client/App.d.ts +12 -0
- package/dist/client/{BucketToastNotifications-D2Cq2VrV.mjs → BucketToastNotifications-BGd2wVmh.mjs} +2 -2
- package/dist/client/{BucketToastNotifications-D2Cq2VrV.mjs.map → BucketToastNotifications-BGd2wVmh.mjs.map} +1 -1
- package/dist/client/DeletePcaModal-BU6kbKsw.mjs +80 -0
- package/dist/client/DeletePcaModal-BU6kbKsw.mjs.map +1 -0
- package/dist/client/DetailsInfo-BUyuYpJj.mjs +52 -0
- package/dist/client/DetailsInfo-BUyuYpJj.mjs.map +1 -0
- package/dist/client/{FloatingIpActionModals-sJlSFIsK.mjs → FloatingIpActionModals-DAtZoYGS.mjs} +22 -22
- package/dist/client/{FloatingIpActionModals-sJlSFIsK.mjs.map → FloatingIpActionModals-DAtZoYGS.mjs.map} +1 -1
- package/dist/client/{ImageToastNotifications-CISH3c_d.mjs → ImageToastNotifications-BhjU1bfT.mjs} +7 -7
- package/dist/client/{ImageToastNotifications-CISH3c_d.mjs.map → ImageToastNotifications-BhjU1bfT.mjs.map} +1 -1
- package/dist/client/{_flavorId-Cx5tf2KQ.mjs → _flavorId-BQY7YhNx.mjs} +2 -2
- package/dist/client/{_flavorId-Cx5tf2KQ.mjs.map → _flavorId-BQY7YhNx.mjs.map} +1 -1
- package/dist/client/{_flavorId-C6RJfhh8.mjs → _flavorId-sS1sg_DZ.mjs} +3 -3
- package/dist/client/{_flavorId-C6RJfhh8.mjs.map → _flavorId-sS1sg_DZ.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-C4Sa8tMa.mjs → _floatingIpId-BHZGh8U8.mjs} +2 -2
- package/dist/client/{_floatingIpId-C4Sa8tMa.mjs.map → _floatingIpId-BHZGh8U8.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-CAUBZ5WD2.mjs → _floatingIpId-CR3aD38l2.mjs} +5 -5
- package/dist/client/{_floatingIpId-CAUBZ5WD2.mjs.map → _floatingIpId-CR3aD38l2.mjs.map} +1 -1
- package/dist/client/{_imageId-DpXNAIbD.mjs → _imageId-Cf-Xdksv.mjs} +3 -3
- package/dist/client/{_imageId-DpXNAIbD.mjs.map → _imageId-Cf-Xdksv.mjs.map} +1 -1
- package/dist/client/_pcaId-B7j0sXnY.mjs +545 -0
- package/dist/client/_pcaId-B7j0sXnY.mjs.map +1 -0
- package/dist/client/{_projectId-fEA6fnFQ.mjs → _projectId-Cq9JnhRj.mjs} +3 -3
- package/dist/client/{_projectId-fEA6fnFQ.mjs.map → _projectId-Cq9JnhRj.mjs.map} +1 -1
- package/dist/client/{_projectId-w-tZz0FI.mjs → _projectId-D8FHe0gr.mjs} +2 -2
- package/dist/client/{_projectId-w-tZz0FI.mjs.map → _projectId-D8FHe0gr.mjs.map} +1 -1
- package/dist/client/{_projectId-qvINx3Dx.mjs → _projectId-Ig3QqYzt.mjs} +2 -2
- package/dist/client/{_projectId-qvINx3Dx.mjs.map → _projectId-Ig3QqYzt.mjs.map} +1 -1
- package/dist/client/{_projectId-BOaPmCuz.mjs → _projectId-b4NGeECR.mjs} +3 -3
- package/dist/client/{_projectId-BOaPmCuz.mjs.map → _projectId-b4NGeECR.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-B6_lD8ry.mjs → _securityGroupId-BVSsCus9.mjs} +2 -2
- package/dist/client/{_securityGroupId-B6_lD8ry.mjs.map → _securityGroupId-BVSsCus9.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-D9FHSkNU.mjs → _securityGroupId-gwV4eB0s.mjs} +16 -16
- package/dist/client/{_securityGroupId-D9FHSkNU.mjs.map → _securityGroupId-gwV4eB0s.mjs.map} +1 -1
- package/dist/client/{_storageType-ZFnIALny.mjs → _storageType-CH2khFcZ.mjs} +2 -2
- package/dist/client/{_storageType-ZFnIALny.mjs.map → _storageType-CH2khFcZ.mjs.map} +1 -1
- package/dist/client/{_storageType-MgntkZb6.mjs → _storageType-D-1H6SX1.mjs} +856 -856
- package/dist/client/{_storageType-MgntkZb6.mjs.map → _storageType-D-1H6SX1.mjs.map} +1 -1
- package/dist/client/analytics/setupRouterAnalytics.d.ts +20 -0
- package/dist/client/assets/__mocks__/svgMock.d.ts +3 -0
- package/dist/client/build-DgeVmENN.mjs.map +1 -1
- package/dist/client/components/Auth/SessionExpirationTimer.d.ts +4 -0
- package/dist/client/components/ClipboardText.d.ts +10 -0
- package/dist/client/components/ContentHeader/ContentHeader.d.ts +10 -0
- package/dist/client/components/Error/RouteError.d.ts +9 -0
- package/dist/client/components/Error/StatusError.d.ts +11 -0
- package/dist/client/components/JsonEditor.d.ts +39 -0
- package/dist/client/components/ListToolbar/FiltersInput.d.ts +6 -0
- package/dist/client/components/ListToolbar/SelectedFilters.d.ts +24 -0
- package/dist/client/components/ListToolbar/SortInput.d.ts +11 -0
- package/dist/client/components/ListToolbar/index.d.ts +26 -0
- package/dist/client/components/ListToolbar/types.d.ts +116 -0
- package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +12 -0
- package/dist/client/components/Slot.d.ts +7 -0
- package/dist/client/components/navigation/LanguageSelect.d.ts +3 -0
- package/dist/client/components/navigation/MainNavigation.d.ts +10 -0
- package/dist/client/components/navigation/UserMenu.d.ts +1 -0
- package/dist/client/components/navigation/types.d.ts +4 -0
- package/dist/client/{floatingips-DOGKGGkC.mjs → floatingips-DyBEotB8.mjs} +10 -10
- package/dist/client/{floatingips-DOGKGGkC.mjs.map → floatingips-DyBEotB8.mjs.map} +1 -1
- package/dist/client/hooks/index.d.ts +15 -0
- package/dist/client/hooks/useDomainId.d.ts +21 -0
- package/dist/client/hooks/useModalTracking.d.ts +33 -0
- package/dist/client/hooks/useProjectId.d.ts +22 -0
- package/dist/client/hooks-iGiEkLTp.mjs +12 -0
- package/dist/client/hooks-iGiEkLTp.mjs.map +1 -0
- package/dist/client/{images-B1wqMKYw.mjs → images-BklbSacK.mjs} +2 -2
- package/dist/client/{images-B1wqMKYw.mjs.map → images-BklbSacK.mjs.map} +1 -1
- package/dist/client/{images-D5UsQi8i.mjs → images-C3voJ3B1.mjs} +259 -259
- package/dist/client/{images-D5UsQi8i.mjs.map → images-C3voJ3B1.mjs.map} +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +337 -344
- package/dist/client/index.js.map +1 -1
- package/dist/client/md-CyCflQee.mjs.map +1 -1
- package/dist/client/{objects-DpgXMFrG.mjs → objects-B3Z8h4RU.mjs} +2 -2
- package/dist/client/{objects-DpgXMFrG.mjs.map → objects-B3Z8h4RU.mjs.map} +1 -1
- package/dist/client/{objects-Deo1Ic1A.mjs → objects-CGOfO00N.mjs} +499 -475
- package/dist/client/objects-CGOfO00N.mjs.map +1 -0
- package/dist/client/{pca-DztTIs18.mjs → pca-72YR_Pk0.mjs} +3 -3
- package/dist/client/pca-72YR_Pk0.mjs.map +1 -0
- package/dist/client/pca-CsBx_IDO.mjs +251 -0
- package/dist/client/pca-CsBx_IDO.mjs.map +1 -0
- package/dist/client/pcaAccess-Br4kVjLQ.mjs +9 -0
- package/dist/client/pcaAccess-Br4kVjLQ.mjs.map +1 -0
- package/dist/client/router.d.ts +7 -0
- package/dist/client/{securitygroups-BRtHaTLm.mjs → securitygroups-8vRbXmBL.mjs} +3 -3
- package/dist/client/{securitygroups-BRtHaTLm.mjs.map → securitygroups-8vRbXmBL.mjs.map} +1 -1
- package/dist/client/store/AuthProvider.d.ts +23 -0
- package/dist/client/trpcClient-BxcNKnhv.mjs +65 -0
- package/dist/client/trpcClient-BxcNKnhv.mjs.map +1 -0
- package/dist/client/trpcClient.d.ts +56 -49
- package/dist/client/utils/buildFilterParams.d.ts +5 -0
- package/dist/client/utils/cn.d.ts +27 -0
- package/dist/client/utils/formatBytes.d.ts +40 -0
- package/dist/client/utils/formatFloatingIpStatus.d.ts +6 -0
- package/dist/client/utils/languageDetection.d.ts +11 -0
- package/dist/client/utils/trpcErrors.d.ts +13 -0
- package/dist/client/utils/useErrorTranslation.d.ts +4 -0
- package/dist/client/utils/useListWithFiltering.d.ts +84 -0
- package/dist/client/utils/useModal.d.ts +3 -0
- package/dist/server/index.d.ts +51 -49
- package/dist/server/index.js +53 -23
- package/package.json +4 -2
- package/dist/client/_pcaId-DY9GPV7t.mjs +0 -479
- package/dist/client/_pcaId-DY9GPV7t.mjs.map +0 -1
- package/dist/client/_pcaId-ldtkXsbp.mjs +0 -36
- package/dist/client/_pcaId-ldtkXsbp.mjs.map +0 -1
- package/dist/client/constants-COPE2ktv.mjs +0 -153
- package/dist/client/constants-COPE2ktv.mjs.map +0 -1
- package/dist/client/hooks-DvdvErNv.mjs +0 -2
- package/dist/client/objects-Deo1Ic1A.mjs.map +0 -1
- package/dist/client/pca-B7WldCGw.mjs +0 -202
- package/dist/client/pca-B7WldCGw.mjs.map +0 -1
- package/dist/client/pca-DztTIs18.mjs.map +0 -1
- package/dist/client/pcaAccess-BYUY700H.mjs +0 -9
- package/dist/client/pcaAccess-BYUY700H.mjs.map +0 -1
- package/dist/client/trpcClient-Dy_MP_Pv.mjs +0 -57
- package/dist/client/trpcClient-Dy_MP_Pv.mjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, E as r, G as i, H as a, I as o, J as s, K as c, M as l, P as u, R as d, U as f, X as p, Y as m, at as h, c as g, ct as _, dt as v, g as y, lt as ee, m as b, n as te, o as x, r as S, rt as C, st as w, tt as T, ut as E, y as
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import "./
|
|
1
|
+
import { A as e, B as t, C as n, E as r, G as i, H as a, I as o, J as s, K as c, M as l, P as u, R as d, U as f, X as p, Y as m, at as h, c as g, ct as _, dt as v, g as y, lt as ee, m as b, n as te, o as x, r as S, rt as C, st as w, tt as T, ut as E, y as D } from "./build-DgeVmENN.mjs";
|
|
2
|
+
import { n as O, r as k } from "./trpcClient-BxcNKnhv.mjs";
|
|
3
|
+
import { t as ne } from "./cn-DM4Cy3jv.mjs";
|
|
4
|
+
import { t as A } from "./images-BklbSacK.mjs";
|
|
5
|
+
import { t as j } from "./useProjectId-DBc5lpoU.mjs";
|
|
6
|
+
import "./hooks-iGiEkLTp.mjs";
|
|
7
|
+
import { t as M } from "./ContentHeader-BIScbvb4.mjs";
|
|
8
|
+
import { t as N } from "./SortInput-DjaEHvcO.mjs";
|
|
9
|
+
import { A as P, C as re, D as ie, E as F, F as ae, I, M as L, N as R, O as oe, P as z, S as se, T as B, _ as ce, a as le, b as V, c as H, d as U, f as W, g as ue, h as de, i as fe, j as pe, k as me, l as he, m as ge, n as _e, o as ve, p as ye, r as be, s as xe, t as Se, u as Ce, v as we, w as Te, x as Ee, y as De } from "./ImageToastNotifications-BhjU1bfT.mjs";
|
|
10
10
|
import { n as Oe, t as ke } from "./FiltersInput-cOaaRpcQ.mjs";
|
|
11
11
|
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
12
12
|
import { Suspense as Ae, startTransition as je, use as Me, useCallback as Ne, useEffect as Pe, useMemo as Fe, useRef as Ie, useState as J } from "react";
|
|
@@ -18,27 +18,27 @@ import { ErrorBoundary as Ve } from "react-error-boundary";
|
|
|
18
18
|
import "@trpc/server";
|
|
19
19
|
//#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageTableRow.tsx
|
|
20
20
|
function He({ image: t, isSelected: n, isPending: a, isAccepted: o, permissions: s, onEditDetails: l, onEditMetadata: u, onDelete: d, onSelect: f, onActivationStatusChange: p, onManageAccess: m, onUpdateVisibility: g, setToastData: _, uploadId: v, uploadProgressPercent: y, onMemberStatusChanged: b, showSelectColumn: te = !1 }) {
|
|
21
|
-
let { i18n: x, _: S } = Z(), { id: w, name: T, status: E, visibility:
|
|
22
|
-
|
|
21
|
+
let { i18n: x, _: S } = Z(), { id: w, name: T, status: E, visibility: D, size: O, disk_format: ne, created_at: A, owner: j } = t, M = T || x._({ id: "MEIAzV" }), { projectId: N } = Re({ from: "/_auth/projects/$projectId/compute/images/" }), P = Le(), re = k.useUtils(), ie = k.compute.updateImageMember.useMutation({ onSuccess: () => {
|
|
22
|
+
re.compute.listImagesWithPagination.invalidate(), re.compute.listSharedImagesByMemberStatus.invalidate();
|
|
23
23
|
} }), F = async (e) => {
|
|
24
24
|
try {
|
|
25
|
-
await
|
|
26
|
-
project_id:
|
|
25
|
+
await ie.mutateAsync({
|
|
26
|
+
project_id: N,
|
|
27
27
|
imageId: w,
|
|
28
|
-
memberId:
|
|
28
|
+
memberId: N,
|
|
29
29
|
status: e
|
|
30
30
|
}), _(U(e, { onDismiss: () => _(null) })), b?.();
|
|
31
31
|
} catch (e) {
|
|
32
32
|
let t = e?.message;
|
|
33
|
-
_(
|
|
33
|
+
_(Ce(t, { onDismiss: () => _(null) }));
|
|
34
34
|
}
|
|
35
|
-
}, L =
|
|
35
|
+
}, L = N === j, oe = a || o, se = ie.isPending;
|
|
36
36
|
return /*#__PURE__*/ q(r, {
|
|
37
37
|
"data-testid": `image-row-${w}`,
|
|
38
|
-
onClick: () =>
|
|
38
|
+
onClick: () => P({
|
|
39
39
|
to: "/projects/$projectId/compute/images/$imageId",
|
|
40
40
|
params: {
|
|
41
|
-
projectId:
|
|
41
|
+
projectId: N,
|
|
42
42
|
imageId: w
|
|
43
43
|
}
|
|
44
44
|
}),
|
|
@@ -51,36 +51,36 @@ function He({ image: t, isSelected: n, isPending: a, isAccepted: o, permissions:
|
|
|
51
51
|
})
|
|
52
52
|
}),
|
|
53
53
|
/*#__PURE__*/ K(i, { children: E }),
|
|
54
|
-
/*#__PURE__*/ K(i, { children:
|
|
55
|
-
/*#__PURE__*/ K(i, { children:
|
|
54
|
+
/*#__PURE__*/ K(i, { children: M }),
|
|
55
|
+
/*#__PURE__*/ K(i, { children: D }),
|
|
56
56
|
/*#__PURE__*/ K(i, { children: t.protected ? x._({ id: "l75CjT" }) : x._({ id: "1UzENP" }) }),
|
|
57
|
-
/*#__PURE__*/ K(i, { children: v && v === w ? `${y}%` : /*#__PURE__*/ K(
|
|
58
|
-
/*#__PURE__*/ K(i, { children:
|
|
59
|
-
/*#__PURE__*/ K(i, { children:
|
|
57
|
+
/*#__PURE__*/ K(i, { children: v && v === w ? `${y}%` : /*#__PURE__*/ K(I, { size: O }) }),
|
|
58
|
+
/*#__PURE__*/ K(i, { children: ne || x._({ id: "fj5byd" }) }),
|
|
59
|
+
/*#__PURE__*/ K(i, { children: A ? new Date(A).toLocaleDateString() : x._({ id: "fj5byd" }) }),
|
|
60
60
|
/*#__PURE__*/ K(i, {
|
|
61
61
|
onClick: (e) => e.stopPropagation(),
|
|
62
|
-
children:
|
|
62
|
+
children: se ? /*#__PURE__*/ K(c, {
|
|
63
63
|
variant: "primary",
|
|
64
64
|
size: "small"
|
|
65
65
|
}) : /*#__PURE__*/ K(C, { children: /*#__PURE__*/ q(e, { children: [
|
|
66
66
|
/*#__PURE__*/ K(h, {
|
|
67
67
|
label: x._({ id: "v0hPHE" }),
|
|
68
|
-
onClick: () =>
|
|
68
|
+
onClick: () => P({
|
|
69
69
|
to: "/projects/$projectId/compute/images/$imageId",
|
|
70
70
|
params: {
|
|
71
|
-
projectId:
|
|
71
|
+
projectId: N,
|
|
72
72
|
imageId: w
|
|
73
73
|
}
|
|
74
74
|
})
|
|
75
75
|
}),
|
|
76
|
-
|
|
76
|
+
oe && s.canUpdateMember && /*#__PURE__*/ q(G, { children: [a && /*#__PURE__*/ K(h, {
|
|
77
77
|
label: x._({ id: "g3UF2V" }),
|
|
78
|
-
onClick: () => F(
|
|
78
|
+
onClick: () => F(ae.ACCEPTED)
|
|
79
79
|
}), /*#__PURE__*/ K(h, {
|
|
80
80
|
label: x._({ id: "1t/NnN" }),
|
|
81
|
-
onClick: () => F(
|
|
81
|
+
onClick: () => F(ae.REJECTED)
|
|
82
82
|
})] }),
|
|
83
|
-
!
|
|
83
|
+
!oe && s.canUpdate && /*#__PURE__*/ q(G, { children: [
|
|
84
84
|
/*#__PURE__*/ K(h, {
|
|
85
85
|
label: x._({ id: "Y1YKad" }),
|
|
86
86
|
onClick: () => l(t)
|
|
@@ -90,19 +90,19 @@ function He({ image: t, isSelected: n, isPending: a, isAccepted: o, permissions:
|
|
|
90
90
|
onClick: () => u(t)
|
|
91
91
|
}),
|
|
92
92
|
/*#__PURE__*/ K(h, {
|
|
93
|
-
label: t.status ===
|
|
93
|
+
label: t.status === R.DEACTIVATED ? x._({ id: "FQBaXG" }) : x._({ id: "5y3O+A" }),
|
|
94
94
|
onClick: () => p(t)
|
|
95
95
|
}),
|
|
96
|
-
t.visibility ===
|
|
96
|
+
t.visibility === z.SHARED && L && (s.canCreateMember || s.canDeleteMember) && /*#__PURE__*/ K(h, {
|
|
97
97
|
label: x._({ id: "cWbW6w" }),
|
|
98
98
|
onClick: () => m(t)
|
|
99
99
|
}),
|
|
100
|
-
t.visibility ===
|
|
100
|
+
t.visibility === z.PRIVATE && /*#__PURE__*/ K(h, {
|
|
101
101
|
label: x._({ id: "gMYsdZ" }),
|
|
102
|
-
onClick: () => g(t.id,
|
|
102
|
+
onClick: () => g(t.id, z.SHARED, M)
|
|
103
103
|
})
|
|
104
104
|
] }),
|
|
105
|
-
!
|
|
105
|
+
!oe && s.canDelete && !t.protected && /*#__PURE__*/ K(h, {
|
|
106
106
|
label: x._({ id: "cnGeoo" }),
|
|
107
107
|
onClick: () => d(t)
|
|
108
108
|
})
|
|
@@ -160,14 +160,14 @@ function qe(e, t) {
|
|
|
160
160
|
var Je = {
|
|
161
161
|
name: "",
|
|
162
162
|
tags: [],
|
|
163
|
-
visibility:
|
|
163
|
+
visibility: z.PRIVATE,
|
|
164
164
|
disk_format: void 0,
|
|
165
165
|
container_format: void 0,
|
|
166
166
|
protected: !1,
|
|
167
167
|
min_disk: 0,
|
|
168
168
|
min_ram: 0
|
|
169
169
|
}, Ye = ({ isOpen: e, onClose: n, onCreate: r, isLoading: i = !1, isUploadPending: s = !1, uploadProgressPercent: l }) => {
|
|
170
|
-
let { i18n: u, _: d } = Z(), [p, m] = J({ ...Je }), [h, _] = J(""), [y, te] = J(null), [C, w] = J({}), [E,
|
|
170
|
+
let { i18n: u, _: d } = Z(), [p, m] = J({ ...Je }), [h, _] = J(""), [y, te] = J(null), [C, w] = J({}), [E, O] = J(!1), [k, A] = J(null), j = p.name.trim() !== "" && y !== null && p.disk_format !== void 0 && p.disk_format.trim() !== "" && p.container_format !== void 0 && p.container_format.trim() !== "" && p.min_disk >= 0 && p.min_ram >= 0, M = Fe(() => p.disk_format ? Ge(p.disk_format) : [], [p.disk_format]), N = [
|
|
171
171
|
".qcow2",
|
|
172
172
|
".raw",
|
|
173
173
|
".vmdk",
|
|
@@ -180,7 +180,7 @@ var Je = {
|
|
|
180
180
|
".iso",
|
|
181
181
|
".ploop",
|
|
182
182
|
".img"
|
|
183
|
-
],
|
|
183
|
+
], P = N.join(", "), re = (e) => {
|
|
184
184
|
let { name: t, value: n, type: r, checked: i } = e.target;
|
|
185
185
|
m((e) => ({
|
|
186
186
|
...e,
|
|
@@ -189,13 +189,13 @@ var Je = {
|
|
|
189
189
|
let n = { ...e };
|
|
190
190
|
return delete n[t], n;
|
|
191
191
|
});
|
|
192
|
-
},
|
|
192
|
+
}, ie = (e) => {
|
|
193
193
|
let { name: t, value: n } = e.target;
|
|
194
194
|
t === "name" && (!n || n.trim() === "") && w((e) => ({
|
|
195
195
|
...e,
|
|
196
196
|
name: u._({ id: "wyIOMP" })
|
|
197
197
|
}));
|
|
198
|
-
},
|
|
198
|
+
}, F = (e, t) => {
|
|
199
199
|
if (e === "disk_format") {
|
|
200
200
|
let e = t, n = Ke(e);
|
|
201
201
|
m((t) => ({
|
|
@@ -211,7 +211,7 @@ var Je = {
|
|
|
211
211
|
let n = { ...t };
|
|
212
212
|
return delete n[e], n;
|
|
213
213
|
});
|
|
214
|
-
},
|
|
214
|
+
}, ae = (e, t) => {
|
|
215
215
|
let n = t === "" ? 0 : parseInt(t, 10);
|
|
216
216
|
isNaN(n) || (m((t) => ({
|
|
217
217
|
...t,
|
|
@@ -228,32 +228,32 @@ var Je = {
|
|
|
228
228
|
...e,
|
|
229
229
|
min_ram: u._({ id: "PEGvy+" })
|
|
230
230
|
})));
|
|
231
|
-
},
|
|
231
|
+
}, R = (e) => {
|
|
232
232
|
let t = e.name.toLowerCase();
|
|
233
|
-
|
|
233
|
+
N.some((e) => t.endsWith(e)) ? (te(e), C.file && w((e) => {
|
|
234
234
|
let t = { ...e };
|
|
235
235
|
return delete t.file, t;
|
|
236
236
|
})) : w((e) => ({
|
|
237
237
|
...e,
|
|
238
238
|
file: u._({
|
|
239
239
|
id: "qzIZOL",
|
|
240
|
-
values: { supportedFileFormats:
|
|
240
|
+
values: { supportedFileFormats: P }
|
|
241
241
|
})
|
|
242
242
|
}));
|
|
243
|
-
},
|
|
243
|
+
}, oe = (e) => {
|
|
244
244
|
let t = e.target.files?.[0];
|
|
245
|
-
t &&
|
|
246
|
-
}, B = (e) => {
|
|
247
|
-
e.preventDefault(), e.stopPropagation(), D(!0);
|
|
248
|
-
}, V = (e) => {
|
|
249
|
-
e.preventDefault(), e.stopPropagation(), D(!1);
|
|
245
|
+
t && R(t);
|
|
250
246
|
}, se = (e) => {
|
|
251
|
-
e.preventDefault(), e.stopPropagation(),
|
|
252
|
-
|
|
253
|
-
|
|
247
|
+
e.preventDefault(), e.stopPropagation(), O(!0);
|
|
248
|
+
}, B = (e) => {
|
|
249
|
+
e.preventDefault(), e.stopPropagation(), O(!1);
|
|
254
250
|
}, ce = (e) => {
|
|
251
|
+
e.preventDefault(), e.stopPropagation(), O(!1);
|
|
252
|
+
let t = e.dataTransfer.files;
|
|
253
|
+
t && t.length > 0 && R(t[0]);
|
|
254
|
+
}, le = (e) => {
|
|
255
255
|
_(e.target.value);
|
|
256
|
-
},
|
|
256
|
+
}, V = () => {
|
|
257
257
|
let e = h.trim();
|
|
258
258
|
if (e !== "") {
|
|
259
259
|
if (p.tags.includes(e)) {
|
|
@@ -265,9 +265,9 @@ var Je = {
|
|
|
265
265
|
tags: [...t.tags, e]
|
|
266
266
|
})), _("");
|
|
267
267
|
}
|
|
268
|
+
}, H = (e) => {
|
|
269
|
+
e.key === "Enter" && (e.preventDefault(), V());
|
|
268
270
|
}, U = (e) => {
|
|
269
|
-
e.key === "Enter" && (e.preventDefault(), H());
|
|
270
|
-
}, le = (e) => {
|
|
271
271
|
m((t) => ({
|
|
272
272
|
...t,
|
|
273
273
|
tags: t.tags.filter((t) => t !== e)
|
|
@@ -276,8 +276,8 @@ var Je = {
|
|
|
276
276
|
let e = {};
|
|
277
277
|
return (!p.name || p.name.trim() === "") && (e.name = u._({ id: "wyIOMP" })), y || (e.file = u._({ id: "aTqCTq" })), (!p.disk_format || p.disk_format.trim() === "") && (e.disk_format = u._({ id: "LK0pQN" })), (!p.container_format || p.container_format.trim() === "") && (e.container_format = u._({ id: "J4DKSM" })), p.disk_format && p.container_format && (qe(p.disk_format, p.container_format) || (e.container_format = u._({ id: "BgMp/T" }))), p.min_disk < 0 && (e.min_disk = u._({ id: "K3bUTE" })), p.min_ram < 0 && (e.min_ram = u._({ id: "PEGvy+" })), w(e), Object.keys(e).length === 0;
|
|
278
278
|
}, ue = async (e) => {
|
|
279
|
-
if (e.preventDefault(),
|
|
280
|
-
|
|
279
|
+
if (e.preventDefault(), A(null), !W()) {
|
|
280
|
+
A(u._({ id: "CBFSfX" }));
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
283
|
try {
|
|
@@ -292,10 +292,10 @@ var Je = {
|
|
|
292
292
|
min_ram: p.min_ram
|
|
293
293
|
}, y), de();
|
|
294
294
|
} catch (e) {
|
|
295
|
-
|
|
295
|
+
A(e instanceof Error ? e.message : u._({ id: "TQn3hH" }));
|
|
296
296
|
}
|
|
297
297
|
}, de = () => {
|
|
298
|
-
m({ ...Je }), _(""), te(null), w({}),
|
|
298
|
+
m({ ...Je }), _(""), te(null), w({}), A(null), n();
|
|
299
299
|
};
|
|
300
300
|
return /*#__PURE__*/ q(S, {
|
|
301
301
|
open: e,
|
|
@@ -305,7 +305,7 @@ var Je = {
|
|
|
305
305
|
onConfirm: ue,
|
|
306
306
|
confirmButtonLabel: u._({ id: "a/nTb8" }),
|
|
307
307
|
cancelButtonLabel: u._({ id: "dEgA5A" }),
|
|
308
|
-
disableConfirmButton: i || !
|
|
308
|
+
disableConfirmButton: i || !j,
|
|
309
309
|
closeable: !i,
|
|
310
310
|
closeOnEsc: !i,
|
|
311
311
|
children: [
|
|
@@ -330,10 +330,10 @@ var Je = {
|
|
|
330
330
|
!i && /*#__PURE__*/ q(x, {
|
|
331
331
|
className: "mb-6",
|
|
332
332
|
children: [
|
|
333
|
-
|
|
333
|
+
k && /*#__PURE__*/ K(t, {
|
|
334
334
|
variant: "error",
|
|
335
335
|
className: "mb-6",
|
|
336
|
-
children:
|
|
336
|
+
children: k
|
|
337
337
|
}),
|
|
338
338
|
/*#__PURE__*/ K(a, {
|
|
339
339
|
className: "mb-6",
|
|
@@ -352,15 +352,15 @@ var Je = {
|
|
|
352
352
|
className: "flex w-full items-center justify-center",
|
|
353
353
|
children: /*#__PURE__*/ q("label", {
|
|
354
354
|
htmlFor: "image-file",
|
|
355
|
-
onDragOver:
|
|
356
|
-
onDragLeave:
|
|
357
|
-
onDrop:
|
|
358
|
-
className:
|
|
355
|
+
onDragOver: se,
|
|
356
|
+
onDragLeave: B,
|
|
357
|
+
onDrop: ce,
|
|
358
|
+
className: ne("flex h-24 w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed transition-all", E ? "border-blue-500 bg-blue-50" : "border-gray-300 bg-gray-50 hover:bg-gray-100"),
|
|
359
359
|
children: [/*#__PURE__*/ q("div", {
|
|
360
360
|
className: "flex flex-col items-center justify-center pt-3 pb-3",
|
|
361
361
|
children: [
|
|
362
362
|
/*#__PURE__*/ K("svg", {
|
|
363
|
-
className:
|
|
363
|
+
className: ne("mb-1 h-6 w-6 transition-colors", E ? "text-blue-500" : "text-gray-500"),
|
|
364
364
|
"aria-hidden": "true",
|
|
365
365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
366
366
|
fill: "none",
|
|
@@ -374,7 +374,7 @@ var Je = {
|
|
|
374
374
|
})
|
|
375
375
|
}),
|
|
376
376
|
/*#__PURE__*/ K("p", {
|
|
377
|
-
className:
|
|
377
|
+
className: ne("text-xs transition-colors", E ? "font-semibold text-blue-600" : "text-gray-500"),
|
|
378
378
|
children: E ? /*#__PURE__*/ K("span", { children: u._({ id: "vXmL4D" }) }) : /*#__PURE__*/ q(G, { children: [
|
|
379
379
|
/*#__PURE__*/ K("span", {
|
|
380
380
|
className: "font-semibold",
|
|
@@ -393,8 +393,8 @@ var Je = {
|
|
|
393
393
|
id: "image-file",
|
|
394
394
|
type: "file",
|
|
395
395
|
className: "hidden",
|
|
396
|
-
onChange:
|
|
397
|
-
accept:
|
|
396
|
+
onChange: oe,
|
|
397
|
+
accept: P,
|
|
398
398
|
disabled: i
|
|
399
399
|
})]
|
|
400
400
|
})
|
|
@@ -446,8 +446,8 @@ var Je = {
|
|
|
446
446
|
name: "name",
|
|
447
447
|
label: u._({ id: "ExLULX" }),
|
|
448
448
|
value: p.name,
|
|
449
|
-
onChange:
|
|
450
|
-
onBlur:
|
|
449
|
+
onChange: re,
|
|
450
|
+
onBlur: ie,
|
|
451
451
|
required: !0,
|
|
452
452
|
errortext: C.name,
|
|
453
453
|
placeholder: u._({ id: "PsEGri" }),
|
|
@@ -469,15 +469,15 @@ var Je = {
|
|
|
469
469
|
name: "tags",
|
|
470
470
|
label: u._({ id: "OYHzN1" }),
|
|
471
471
|
value: h,
|
|
472
|
-
onChange:
|
|
473
|
-
onKeyDown:
|
|
472
|
+
onChange: le,
|
|
473
|
+
onKeyDown: H,
|
|
474
474
|
helptext: u._({ id: "AN0DBJ" }),
|
|
475
475
|
placeholder: u._({ id: "tmpGvt" }),
|
|
476
476
|
disabled: i
|
|
477
477
|
})
|
|
478
|
-
}), /*#__PURE__*/ K(
|
|
478
|
+
}), /*#__PURE__*/ K(D, {
|
|
479
479
|
variant: "primary",
|
|
480
|
-
onClick:
|
|
480
|
+
onClick: V,
|
|
481
481
|
disabled: i || h.trim() === "",
|
|
482
482
|
children: /*#__PURE__*/ K(X, { id: "m16xKo" })
|
|
483
483
|
})]
|
|
@@ -490,7 +490,7 @@ var Je = {
|
|
|
490
490
|
closeable: !0,
|
|
491
491
|
pillKey: "",
|
|
492
492
|
pillValue: e,
|
|
493
|
-
onClose: () =>
|
|
493
|
+
onClose: () => U(e)
|
|
494
494
|
}, e))
|
|
495
495
|
})]
|
|
496
496
|
})
|
|
@@ -502,24 +502,24 @@ var Je = {
|
|
|
502
502
|
name: "visibility",
|
|
503
503
|
label: u._({ id: "2q/Q7x" }),
|
|
504
504
|
value: p.visibility,
|
|
505
|
-
onChange: (e) =>
|
|
505
|
+
onChange: (e) => F("visibility", e),
|
|
506
506
|
disabled: i,
|
|
507
507
|
loading: i,
|
|
508
508
|
children: [
|
|
509
509
|
/*#__PURE__*/ K(b, {
|
|
510
|
-
value:
|
|
510
|
+
value: z.PUBLIC,
|
|
511
511
|
label: u._({ id: "7d1a0d" })
|
|
512
512
|
}),
|
|
513
513
|
/*#__PURE__*/ K(b, {
|
|
514
|
-
value:
|
|
514
|
+
value: z.PRIVATE,
|
|
515
515
|
label: u._({ id: "zwBp5t" })
|
|
516
516
|
}),
|
|
517
517
|
/*#__PURE__*/ K(b, {
|
|
518
|
-
value:
|
|
518
|
+
value: z.SHARED,
|
|
519
519
|
label: u._({ id: "0Gd0NU" })
|
|
520
520
|
}),
|
|
521
521
|
/*#__PURE__*/ K(b, {
|
|
522
|
-
value:
|
|
522
|
+
value: z.COMMUNITY,
|
|
523
523
|
label: u._({ id: "chL5IG" })
|
|
524
524
|
})
|
|
525
525
|
]
|
|
@@ -539,54 +539,54 @@ var Je = {
|
|
|
539
539
|
name: "disk_format",
|
|
540
540
|
label: u._({ id: "NopYGU" }),
|
|
541
541
|
value: p.disk_format,
|
|
542
|
-
onChange: (e) =>
|
|
542
|
+
onChange: (e) => F("disk_format", e),
|
|
543
543
|
disabled: i,
|
|
544
544
|
loading: i,
|
|
545
545
|
required: !0,
|
|
546
546
|
errortext: C.disk_format,
|
|
547
547
|
children: [
|
|
548
548
|
/*#__PURE__*/ K(b, {
|
|
549
|
-
value:
|
|
549
|
+
value: L.QCOW2,
|
|
550
550
|
label: "QCOW2 - QEMU Emulator"
|
|
551
551
|
}),
|
|
552
552
|
/*#__PURE__*/ K(b, {
|
|
553
|
-
value:
|
|
553
|
+
value: L.RAW,
|
|
554
554
|
label: "Raw"
|
|
555
555
|
}),
|
|
556
556
|
/*#__PURE__*/ K(b, {
|
|
557
|
-
value:
|
|
557
|
+
value: L.VMDK,
|
|
558
558
|
label: "VMDK - Virtual Machine Disk"
|
|
559
559
|
}),
|
|
560
560
|
/*#__PURE__*/ K(b, {
|
|
561
|
-
value:
|
|
561
|
+
value: L.VHD,
|
|
562
562
|
label: "VHD - Virtual Hard Disk"
|
|
563
563
|
}),
|
|
564
564
|
/*#__PURE__*/ K(b, {
|
|
565
|
-
value:
|
|
565
|
+
value: L.VHDX,
|
|
566
566
|
label: "VHDX - Virtual Hard Disk Extended"
|
|
567
567
|
}),
|
|
568
568
|
/*#__PURE__*/ K(b, {
|
|
569
|
-
value:
|
|
569
|
+
value: L.VDI,
|
|
570
570
|
label: "VDI - Virtual Disk Image"
|
|
571
571
|
}),
|
|
572
572
|
/*#__PURE__*/ K(b, {
|
|
573
|
-
value:
|
|
573
|
+
value: L.AMI,
|
|
574
574
|
label: "AMI - Amazon Machine Image"
|
|
575
575
|
}),
|
|
576
576
|
/*#__PURE__*/ K(b, {
|
|
577
|
-
value:
|
|
577
|
+
value: L.ARI,
|
|
578
578
|
label: "ARI - Amazon Ramdisk Image"
|
|
579
579
|
}),
|
|
580
580
|
/*#__PURE__*/ K(b, {
|
|
581
|
-
value:
|
|
581
|
+
value: L.AKI,
|
|
582
582
|
label: "AKI - Amazon Kernel Image"
|
|
583
583
|
}),
|
|
584
584
|
/*#__PURE__*/ K(b, {
|
|
585
|
-
value:
|
|
585
|
+
value: L.ISO,
|
|
586
586
|
label: "ISO - Optical Disk Image"
|
|
587
587
|
}),
|
|
588
588
|
/*#__PURE__*/ K(b, {
|
|
589
|
-
value:
|
|
589
|
+
value: L.PLOOP,
|
|
590
590
|
label: "PLOOP - Virtuozzo/Parallels Loopback Disk"
|
|
591
591
|
})
|
|
592
592
|
]
|
|
@@ -598,12 +598,12 @@ var Je = {
|
|
|
598
598
|
name: "container_format",
|
|
599
599
|
label: u._({ id: "6/xipy" }),
|
|
600
600
|
value: p.container_format,
|
|
601
|
-
onChange: (e) =>
|
|
602
|
-
disabled: i || !p.disk_format || !
|
|
601
|
+
onChange: (e) => F("container_format", e),
|
|
602
|
+
disabled: i || !p.disk_format || !M.length,
|
|
603
603
|
required: !0,
|
|
604
604
|
errortext: C.container_format,
|
|
605
|
-
helptext: !
|
|
606
|
-
children:
|
|
605
|
+
helptext: !M.length && u._({ id: "A7CVME" }),
|
|
606
|
+
children: M.map((e) => /*#__PURE__*/ K(b, {
|
|
607
607
|
value: e,
|
|
608
608
|
label: e.toUpperCase()
|
|
609
609
|
}, e))
|
|
@@ -618,7 +618,7 @@ var Je = {
|
|
|
618
618
|
name: "protected",
|
|
619
619
|
label: u._({ id: "644xgx" }),
|
|
620
620
|
checked: p.protected,
|
|
621
|
-
onChange:
|
|
621
|
+
onChange: re,
|
|
622
622
|
helptext: u._({ id: "aV6KPH" }),
|
|
623
623
|
disabled: i
|
|
624
624
|
})
|
|
@@ -642,7 +642,7 @@ var Je = {
|
|
|
642
642
|
label: u._({ id: "NixRmA" }),
|
|
643
643
|
type: "number",
|
|
644
644
|
value: String(p.min_disk),
|
|
645
|
-
onChange: (e) =>
|
|
645
|
+
onChange: (e) => ae("min_disk", e.target.value),
|
|
646
646
|
onBlur: () => I("min_disk", p.min_disk),
|
|
647
647
|
helptext: u._({ id: "4fh0Wj" }),
|
|
648
648
|
errortext: C.min_disk,
|
|
@@ -656,7 +656,7 @@ var Je = {
|
|
|
656
656
|
label: u._({ id: "CgZxr7" }),
|
|
657
657
|
type: "number",
|
|
658
658
|
value: String(p.min_ram),
|
|
659
|
-
onChange: (e) =>
|
|
659
|
+
onChange: (e) => ae("min_ram", e.target.value),
|
|
660
660
|
onBlur: () => I("min_ram", p.min_ram),
|
|
661
661
|
helptext: u._({ id: "KsIM0b" }),
|
|
662
662
|
errortext: C.min_ram,
|
|
@@ -679,11 +679,11 @@ var Je = {
|
|
|
679
679
|
open: r,
|
|
680
680
|
modalFooter: /*#__PURE__*/ K(y, {
|
|
681
681
|
className: "flex justify-end",
|
|
682
|
-
children: /*#__PURE__*/ q(E, { children: [/*#__PURE__*/ K(
|
|
682
|
+
children: /*#__PURE__*/ q(E, { children: [/*#__PURE__*/ K(D, {
|
|
683
683
|
variant: "default",
|
|
684
684
|
onClick: a,
|
|
685
685
|
children: /*#__PURE__*/ K(X, { id: "dEgA5A" })
|
|
686
|
-
}), /*#__PURE__*/ K(
|
|
686
|
+
}), /*#__PURE__*/ K(D, {
|
|
687
687
|
variant: "primary-danger",
|
|
688
688
|
onClick: (t) => {
|
|
689
689
|
t.preventDefault(), o(e);
|
|
@@ -944,7 +944,7 @@ var Je = {
|
|
|
944
944
|
})]
|
|
945
945
|
});
|
|
946
946
|
}, $e = ({ isOpen: e, onClose: n, image: r, permissions: { canCreateMember: i, canDeleteMember: a } }) => {
|
|
947
|
-
let { i18n: o, _: s } = Z(), c =
|
|
947
|
+
let { i18n: o, _: s } = Z(), c = j(), [l, u] = J(null), [d, f] = J(!1), { data: p, isLoading: m } = k.compute.listImageMembers.useQuery({
|
|
948
948
|
project_id: c,
|
|
949
949
|
imageId: r?.id || ""
|
|
950
950
|
}, { enabled: e && !!r?.id }), h = () => {
|
|
@@ -965,7 +965,7 @@ var Je = {
|
|
|
965
965
|
text: l.text,
|
|
966
966
|
variant: l.type,
|
|
967
967
|
className: "mb-4"
|
|
968
|
-
}), /*#__PURE__*/ K(
|
|
968
|
+
}), /*#__PURE__*/ K(P, {
|
|
969
969
|
projectId: c,
|
|
970
970
|
image: r,
|
|
971
971
|
imageMembers: p,
|
|
@@ -980,44 +980,44 @@ var Je = {
|
|
|
980
980
|
};
|
|
981
981
|
//#endregion
|
|
982
982
|
//#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageListView.tsx
|
|
983
|
-
function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o, isFetching: s, currentPage: l = 1, totalPages: f = 1, onPageChange: h, children: g, selectedImages: _, setSelectedImages: v, deleteAllModalOpen: y, setDeleteAllModalOpen: b, deactivateAllModalOpen: te, setDeactivateAllModalOpen: x, activateAllModalOpen: S, setActivateAllModalOpen: C, createModalOpen: w, setCreateModalOpen: E, deletableImages:
|
|
984
|
-
let
|
|
983
|
+
function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o, isFetching: s, currentPage: l = 1, totalPages: f = 1, onPageChange: h, children: g, selectedImages: _, setSelectedImages: v, deleteAllModalOpen: y, setDeleteAllModalOpen: b, deactivateAllModalOpen: te, setDeactivateAllModalOpen: x, activateAllModalOpen: S, setActivateAllModalOpen: C, createModalOpen: w, setCreateModalOpen: E, deletableImages: D, protectedImages: ne, activeImages: A, deactivatedImages: M, onImageUpdated: N, onImageDeleted: P, onMemberStatusChanged: ae, hasAnyBulkAction: I }) {
|
|
984
|
+
let L = j(), [z, U] = J(null), [pe, Ce] = J(!1), [Oe, ke] = J(!1), [Ae, je] = J(!1), [Me, Ne] = J(!1), [Fe, Ie] = J(!1), [Le, Re] = J(!1), [Y, Z] = J(null), [Ve, Ue] = J(!1), [We, Ge] = J(null), [Ke, qe] = J(!1), [Je, et] = J(l.toString());
|
|
985
985
|
Pe(() => {
|
|
986
986
|
et(l.toString());
|
|
987
987
|
}, [l]);
|
|
988
|
-
let Q =
|
|
988
|
+
let Q = k.useUtils(), tt = k.compute.deleteImage.useMutation({ onSuccess: () => {
|
|
989
989
|
Q.compute.listImagesWithPagination.invalidate();
|
|
990
|
-
} }), nt =
|
|
990
|
+
} }), nt = k.compute.deactivateImage.useMutation({ onSuccess: () => {
|
|
991
991
|
Q.compute.listImagesWithPagination.invalidate(), Q.compute.getImageById.invalidate();
|
|
992
|
-
} }), rt =
|
|
992
|
+
} }), rt = k.compute.reactivateImage.useMutation({ onSuccess: () => {
|
|
993
993
|
Q.compute.listImagesWithPagination.invalidate(), Q.compute.getImageById.invalidate();
|
|
994
|
-
} }), it =
|
|
994
|
+
} }), it = k.compute.deleteImages.useMutation({ onSuccess: () => {
|
|
995
995
|
Q.compute.listImagesWithPagination.invalidate(), v([]);
|
|
996
|
-
} }), at =
|
|
996
|
+
} }), at = k.compute.activateImages.useMutation({ onSuccess: () => {
|
|
997
997
|
Q.compute.listImagesWithPagination.invalidate(), v([]);
|
|
998
|
-
} }), ot =
|
|
998
|
+
} }), ot = k.compute.deactivateImages.useMutation({ onSuccess: () => {
|
|
999
999
|
Q.compute.listImagesWithPagination.invalidate(), v([]);
|
|
1000
|
-
} }), st =
|
|
1000
|
+
} }), st = k.compute.updateImage.useMutation({ onSuccess: (e) => {
|
|
1001
1001
|
Q.compute.listImagesWithPagination.invalidate(), Q.compute.getImageById.setData({
|
|
1002
|
-
project_id:
|
|
1002
|
+
project_id: L,
|
|
1003
1003
|
imageId: e.id
|
|
1004
1004
|
}, e);
|
|
1005
|
-
} }), ct =
|
|
1005
|
+
} }), ct = k.compute.createImage.useMutation({ onSuccess: () => {
|
|
1006
1006
|
Q.compute.listImagesWithPagination.invalidate();
|
|
1007
|
-
} }), lt =
|
|
1008
|
-
|
|
1009
|
-
} }), { data: ut } =
|
|
1010
|
-
project_id:
|
|
1007
|
+
} }), lt = k.compute.updateImageVisibility.useMutation({ onSuccess: (e) => {
|
|
1008
|
+
N(e);
|
|
1009
|
+
} }), { data: ut } = k.compute.watchUploadProgress.useSubscription({
|
|
1010
|
+
project_id: L,
|
|
1011
1011
|
uploadId: We || ""
|
|
1012
1012
|
}, { enabled: !!We && Ke }), dt = tt.isPending || nt.isPending || rt.isPending || it.isPending || at.isPending || ot.isPending || st.isPending, $ = () => U(null), ft = async (e, t, n) => {
|
|
1013
1013
|
try {
|
|
1014
1014
|
await lt.mutateAsync({
|
|
1015
|
-
project_id:
|
|
1015
|
+
project_id: L,
|
|
1016
1016
|
imageId: e,
|
|
1017
1017
|
visibility: t
|
|
1018
|
-
}), U(
|
|
1018
|
+
}), U(Te(n, t, { onDismiss: $ }));
|
|
1019
1019
|
} catch (e) {
|
|
1020
|
-
U(
|
|
1020
|
+
U(re(n, e?.message || Be._({
|
|
1021
1021
|
id: "J9cmxx",
|
|
1022
1022
|
values: { newVisibility: t }
|
|
1023
1023
|
}), { onDismiss: $ }));
|
|
@@ -1044,76 +1044,76 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1044
1044
|
let t = Y.id, n = e.name || Y.name || t;
|
|
1045
1045
|
try {
|
|
1046
1046
|
let r = pt(e, Y), i = await st.mutateAsync({
|
|
1047
|
-
project_id:
|
|
1047
|
+
project_id: L,
|
|
1048
1048
|
imageId: t,
|
|
1049
1049
|
operations: r
|
|
1050
1050
|
});
|
|
1051
|
-
return
|
|
1051
|
+
return Ce(!1), U(se(n, { onDismiss: $ })), Z(i), N(i), !0;
|
|
1052
1052
|
} catch (e) {
|
|
1053
1053
|
let { message: t } = e;
|
|
1054
|
-
return U(
|
|
1054
|
+
return U(Ee(n, t, { onDismiss: $ })), Z(null), !1;
|
|
1055
1055
|
}
|
|
1056
1056
|
}, ht = async (e, t) => {
|
|
1057
1057
|
let n = e.name || "Unnamed";
|
|
1058
1058
|
try {
|
|
1059
1059
|
Ue(!0);
|
|
1060
1060
|
let r = await ct.mutateAsync({
|
|
1061
|
-
project_id:
|
|
1061
|
+
project_id: L,
|
|
1062
1062
|
...e
|
|
1063
1063
|
});
|
|
1064
|
-
Ge(r.id), qe(!0), await
|
|
1065
|
-
"x-project-id":
|
|
1064
|
+
Ge(r.id), qe(!0), await O.compute.uploadImage.mutate(t, { context: { headers: {
|
|
1065
|
+
"x-project-id": L,
|
|
1066
1066
|
"x-upload-id": r.id,
|
|
1067
1067
|
"x-upload-size": String(t.size)
|
|
1068
|
-
} } }), U(
|
|
1068
|
+
} } }), U(de(n, { onDismiss: $ })), Q.compute.listImagesWithPagination.invalidate();
|
|
1069
1069
|
} catch (e) {
|
|
1070
|
-
if (e instanceof ze && e.data.path === "compute.createImage") U(
|
|
1070
|
+
if (e instanceof ze && e.data.path === "compute.createImage") U(ge(n, e.message, { onDismiss: $ }));
|
|
1071
1071
|
else {
|
|
1072
1072
|
let { message: n } = e;
|
|
1073
|
-
U(
|
|
1073
|
+
U(V(t.name, n, { onDismiss: $ }));
|
|
1074
1074
|
}
|
|
1075
1075
|
} finally {
|
|
1076
1076
|
Ue(!1), E(!1), qe(!1), Ge(null);
|
|
1077
1077
|
}
|
|
1078
1078
|
}, gt = async (e) => {
|
|
1079
|
-
|
|
1079
|
+
Ce(!1), ke(!1);
|
|
1080
1080
|
let t = e.name || e.id, n = e.id;
|
|
1081
1081
|
try {
|
|
1082
1082
|
await tt.mutateAsync({
|
|
1083
|
-
project_id:
|
|
1083
|
+
project_id: L,
|
|
1084
1084
|
imageId: n
|
|
1085
|
-
}), U(
|
|
1085
|
+
}), U(De(t, { onDismiss: $ })), P(n);
|
|
1086
1086
|
} catch (e) {
|
|
1087
1087
|
let { message: t } = e;
|
|
1088
|
-
U(
|
|
1088
|
+
U(we(n, t, { onDismiss: $ }));
|
|
1089
1089
|
}
|
|
1090
1090
|
Z(null);
|
|
1091
1091
|
}, _t = async (e) => {
|
|
1092
|
-
e.status ===
|
|
1092
|
+
e.status === R.DEACTIVATED ? (Z(e), Ie(!0)) : (Z(e), Ne(!0));
|
|
1093
1093
|
}, vt = async (e) => {
|
|
1094
1094
|
let t = e.name || e.id, n = e.id;
|
|
1095
1095
|
try {
|
|
1096
1096
|
await rt.mutateAsync({
|
|
1097
|
-
project_id:
|
|
1097
|
+
project_id: L,
|
|
1098
1098
|
imageId: n
|
|
1099
|
-
}), Ie(!1), Z(null), U(
|
|
1099
|
+
}), Ie(!1), Z(null), U(W(t, { onDismiss: $ }));
|
|
1100
1100
|
} catch (e) {
|
|
1101
1101
|
let { message: t } = e;
|
|
1102
|
-
U(
|
|
1102
|
+
U(ye(n, t, { onDismiss: $ }));
|
|
1103
1103
|
}
|
|
1104
1104
|
}, yt = async (e) => {
|
|
1105
1105
|
let t = e.name || e.id, n = e.id;
|
|
1106
1106
|
try {
|
|
1107
1107
|
await nt.mutateAsync({
|
|
1108
|
-
project_id:
|
|
1108
|
+
project_id: L,
|
|
1109
1109
|
imageId: n
|
|
1110
|
-
}), Ne(!1), Z(null), U(
|
|
1110
|
+
}), Ne(!1), Z(null), U(ue(t, { onDismiss: $ }));
|
|
1111
1111
|
} catch (e) {
|
|
1112
1112
|
let { message: t } = e;
|
|
1113
|
-
U(
|
|
1113
|
+
U(ce(n, t, { onDismiss: $ }));
|
|
1114
1114
|
}
|
|
1115
1115
|
}, bt = (e) => {
|
|
1116
|
-
Z(e),
|
|
1116
|
+
Z(e), Ce(!0);
|
|
1117
1117
|
}, xt = (e) => {
|
|
1118
1118
|
Z(e), ke(!0);
|
|
1119
1119
|
}, St = (e) => {
|
|
@@ -1121,7 +1121,7 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1121
1121
|
}, Ct = (e) => {
|
|
1122
1122
|
Z(e), Re(!0);
|
|
1123
1123
|
}, wt = () => {
|
|
1124
|
-
Z(null),
|
|
1124
|
+
Z(null), Ce(!1);
|
|
1125
1125
|
}, Tt = () => {
|
|
1126
1126
|
Z(null), ke(!1);
|
|
1127
1127
|
}, Et = () => {
|
|
@@ -1136,37 +1136,37 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1136
1136
|
b(!1);
|
|
1137
1137
|
try {
|
|
1138
1138
|
let t = await it.mutateAsync({
|
|
1139
|
-
project_id:
|
|
1139
|
+
project_id: L,
|
|
1140
1140
|
imageIds: e
|
|
1141
1141
|
}), n = t.successful.length, r = t.failed.length, i = e.length;
|
|
1142
|
-
U(r === 0 ?
|
|
1142
|
+
U(r === 0 ? he(n, i, { onDismiss: $ }) : n === 0 ? xe(r, i, { onDismiss: $ }) : H(n, r, { onDismiss: $ })), t.successful.length > 0 && P(t.successful);
|
|
1143
1143
|
} catch (t) {
|
|
1144
1144
|
let { message: n } = t;
|
|
1145
|
-
console.log("Bulk delete error: ", n), U(
|
|
1145
|
+
console.log("Bulk delete error: ", n), U(xe(e.length, e.length, { onDismiss: $ }));
|
|
1146
1146
|
}
|
|
1147
1147
|
}, jt = async (e) => {
|
|
1148
1148
|
C(!1);
|
|
1149
1149
|
try {
|
|
1150
1150
|
let t = await at.mutateAsync({
|
|
1151
|
-
project_id:
|
|
1151
|
+
project_id: L,
|
|
1152
1152
|
imageIds: e
|
|
1153
1153
|
}), n = t.successful.length, r = t.failed.length, i = e.length;
|
|
1154
|
-
U(r === 0 ?
|
|
1154
|
+
U(r === 0 ? be(n, i, { onDismiss: $ }) : n === 0 ? Se(r, i, { onDismiss: $ }) : _e(n, r, { onDismiss: $ }));
|
|
1155
1155
|
} catch (t) {
|
|
1156
1156
|
let { message: n } = t;
|
|
1157
|
-
console.log("Bulk activate error: ", n), U(
|
|
1157
|
+
console.log("Bulk activate error: ", n), U(Se(e.length, e.length, { onDismiss: $ }));
|
|
1158
1158
|
}
|
|
1159
1159
|
}, Mt = async (e) => {
|
|
1160
1160
|
x(!1);
|
|
1161
1161
|
try {
|
|
1162
1162
|
let t = await ot.mutateAsync({
|
|
1163
|
-
project_id:
|
|
1163
|
+
project_id: L,
|
|
1164
1164
|
imageIds: e
|
|
1165
1165
|
}), n = t.successful.length, r = t.failed.length, i = e.length;
|
|
1166
|
-
U(r === 0 ?
|
|
1166
|
+
U(r === 0 ? ve(n, i, { onDismiss: $ }) : n === 0 ? fe(r, i, { onDismiss: $ }) : le(n, r, { onDismiss: $ }));
|
|
1167
1167
|
} catch (t) {
|
|
1168
1168
|
let { message: n } = t;
|
|
1169
|
-
console.log("Bulk deactivate error: ", n), U(
|
|
1169
|
+
console.log("Bulk deactivate error: ", n), U(fe(e.length, e.length, { onDismiss: $ }));
|
|
1170
1170
|
}
|
|
1171
1171
|
}, Nt = (e) => {
|
|
1172
1172
|
e >= 1 && e <= f && (h?.(e), et(e.toString()));
|
|
@@ -1202,12 +1202,12 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1202
1202
|
})
|
|
1203
1203
|
}),
|
|
1204
1204
|
e.length > 0 ? /*#__PURE__*/ q(G, { children: [/*#__PURE__*/ q(u, {
|
|
1205
|
-
columns:
|
|
1206
|
-
minContentColumns:
|
|
1205
|
+
columns: I ? 9 : 8,
|
|
1206
|
+
minContentColumns: I ? [0, 8] : [7],
|
|
1207
1207
|
className: "images",
|
|
1208
1208
|
"data-testid": "images-table",
|
|
1209
1209
|
children: [/*#__PURE__*/ q(r, { children: [
|
|
1210
|
-
|
|
1210
|
+
I && /*#__PURE__*/ K(d, { children: /*#__PURE__*/ K(ee, {
|
|
1211
1211
|
checked: (() => {
|
|
1212
1212
|
let t = e.map((e) => e.id);
|
|
1213
1213
|
return t.length > 0 && t.every((e) => _.includes(e));
|
|
@@ -1235,7 +1235,7 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1235
1235
|
onEditMetadata: xt,
|
|
1236
1236
|
onDelete: St,
|
|
1237
1237
|
onManageAccess: Ct,
|
|
1238
|
-
showSelectColumn:
|
|
1238
|
+
showSelectColumn: I,
|
|
1239
1239
|
onSelect: (e) => {
|
|
1240
1240
|
if (_.includes(e.id)) return v(_.filter((t) => t !== e.id));
|
|
1241
1241
|
v([..._, e.id]);
|
|
@@ -1245,7 +1245,7 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1245
1245
|
setToastData: U,
|
|
1246
1246
|
uploadId: We,
|
|
1247
1247
|
uploadProgressPercent: ut?.percent,
|
|
1248
|
-
onMemberStatusChanged:
|
|
1248
|
+
onMemberStatusChanged: ae
|
|
1249
1249
|
}, e.id))]
|
|
1250
1250
|
}), f > 1 && /*#__PURE__*/ K("div", {
|
|
1251
1251
|
className: "flex justify-center py-4",
|
|
@@ -1279,21 +1279,21 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1279
1279
|
}) })
|
|
1280
1280
|
}),
|
|
1281
1281
|
Y && /*#__PURE__*/ q(G, { children: [
|
|
1282
|
-
/*#__PURE__*/ K(
|
|
1283
|
-
isOpen:
|
|
1282
|
+
/*#__PURE__*/ K(me, {
|
|
1283
|
+
isOpen: pe,
|
|
1284
1284
|
onClose: wt,
|
|
1285
1285
|
image: Y,
|
|
1286
1286
|
onSave: mt,
|
|
1287
1287
|
isLoading: st.isPending
|
|
1288
1288
|
}),
|
|
1289
|
-
/*#__PURE__*/ K(
|
|
1289
|
+
/*#__PURE__*/ K(oe, {
|
|
1290
1290
|
isOpen: Oe,
|
|
1291
1291
|
onClose: Tt,
|
|
1292
1292
|
image: Y,
|
|
1293
1293
|
onSave: mt,
|
|
1294
1294
|
isLoading: st.isPending
|
|
1295
1295
|
}),
|
|
1296
|
-
/*#__PURE__*/ K(
|
|
1296
|
+
/*#__PURE__*/ K(ie, {
|
|
1297
1297
|
image: Y,
|
|
1298
1298
|
isOpen: Ae,
|
|
1299
1299
|
isLoading: dt,
|
|
@@ -1308,7 +1308,7 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1308
1308
|
onClose: Dt,
|
|
1309
1309
|
onDeactivate: yt
|
|
1310
1310
|
}),
|
|
1311
|
-
/*#__PURE__*/ K(
|
|
1311
|
+
/*#__PURE__*/ K(F, {
|
|
1312
1312
|
image: Y,
|
|
1313
1313
|
isOpen: Fe,
|
|
1314
1314
|
isLoading: rt.isPending,
|
|
@@ -1324,24 +1324,24 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1324
1324
|
] }),
|
|
1325
1325
|
/*#__PURE__*/ K(Xe, {
|
|
1326
1326
|
isOpen: y,
|
|
1327
|
-
deletableImages:
|
|
1328
|
-
protectedImages:
|
|
1327
|
+
deletableImages: D,
|
|
1328
|
+
protectedImages: ne,
|
|
1329
1329
|
isLoading: dt,
|
|
1330
1330
|
onClose: () => b(!1),
|
|
1331
1331
|
onDelete: At
|
|
1332
1332
|
}),
|
|
1333
1333
|
/*#__PURE__*/ K(Ze, {
|
|
1334
1334
|
isOpen: te,
|
|
1335
|
-
activeImages:
|
|
1336
|
-
deactivatedImages:
|
|
1335
|
+
activeImages: A,
|
|
1336
|
+
deactivatedImages: M,
|
|
1337
1337
|
isLoading: dt,
|
|
1338
1338
|
onClose: () => x(!1),
|
|
1339
1339
|
onDeactivate: Mt
|
|
1340
1340
|
}),
|
|
1341
1341
|
/*#__PURE__*/ K(Qe, {
|
|
1342
1342
|
isOpen: S,
|
|
1343
|
-
deactivatedImages:
|
|
1344
|
-
activeImages:
|
|
1343
|
+
deactivatedImages: M,
|
|
1344
|
+
activeImages: A,
|
|
1345
1345
|
isLoading: dt,
|
|
1346
1346
|
onClose: () => C(!1),
|
|
1347
1347
|
onActivate: jt
|
|
@@ -1358,8 +1358,8 @@ function et({ images: e, suggestedImages: t, acceptedImages: a, permissions: o,
|
|
|
1358
1358
|
})
|
|
1359
1359
|
]
|
|
1360
1360
|
}),
|
|
1361
|
-
|
|
1362
|
-
...
|
|
1361
|
+
z && /*#__PURE__*/ K(p, {
|
|
1362
|
+
...z,
|
|
1363
1363
|
className: "border-theme-light fixed top-5 right-5 z-50 rounded-lg border shadow-lg"
|
|
1364
1364
|
})
|
|
1365
1365
|
] });
|
|
@@ -1466,50 +1466,50 @@ var Q = (e) => {
|
|
|
1466
1466
|
canDeleteMember: i,
|
|
1467
1467
|
canUpdateMember: a ?? !1
|
|
1468
1468
|
})), st = 50;
|
|
1469
|
-
function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissionsPromise: i, searchTerm: a, setSearchTerm: o, sortSettings: c, handleSortChange: u, filterSettings: d, handleFilterChange: f, selectedImages: p, setSelectedImages: m, createModalOpen: g, setCreateModalOpen: v, deleteAllModalOpen: y, setDeleteAllModalOpen: b, deactivateAllModalOpen: x, setDeactivateAllModalOpen: S, activateAllModalOpen: E, setActivateAllModalOpen:
|
|
1470
|
-
let { i18n:
|
|
1471
|
-
if (Pe(() => () => clearTimeout(
|
|
1472
|
-
let
|
|
1469
|
+
function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissionsPromise: i, searchTerm: a, setSearchTerm: o, sortSettings: c, handleSortChange: u, filterSettings: d, handleFilterChange: f, selectedImages: p, setSelectedImages: m, createModalOpen: g, setCreateModalOpen: v, deleteAllModalOpen: y, setDeleteAllModalOpen: b, deactivateAllModalOpen: x, setDeactivateAllModalOpen: S, activateAllModalOpen: E, setActivateAllModalOpen: O, memberStatusView: k, setMemberStatusView: ne, isFetching: A, currentPage: j, onPageChange: M, onImageUpdated: P, onImageDeleted: re, onMemberStatusChanged: ie }) {
|
|
1470
|
+
let { i18n: F, _: ae } = Z(), I = Me(t), L = Me(i), [oe, z] = J(a), se = Ie(void 0);
|
|
1471
|
+
if (Pe(() => () => clearTimeout(se.current), []), I.listError) return /*#__PURE__*/ K("p", { children: I.listError });
|
|
1472
|
+
let B = I.images.filter((e) => !r.has(e.id)).map((e) => n.get(e.id) ?? e), ce = Math.max(1, Math.ceil(B.length / st)), le = Math.min(j, ce), V = B.slice((le - 1) * st, le * st);
|
|
1473
1473
|
Pe(() => {
|
|
1474
|
-
|
|
1474
|
+
j !== 1 && j > ce && M(1);
|
|
1475
1475
|
}, [
|
|
1476
|
-
|
|
1477
|
-
|
|
1476
|
+
ce,
|
|
1477
|
+
j,
|
|
1478
1478
|
M
|
|
1479
1479
|
]);
|
|
1480
|
-
let
|
|
1480
|
+
let H = k === "pending" || k === "accepted" ? {
|
|
1481
1481
|
...d,
|
|
1482
1482
|
filters: d.filters.filter((e) => e.filterName !== "visibility"),
|
|
1483
1483
|
selectedFilters: (d.selectedFilters || []).filter((e) => e.name !== "visibility")
|
|
1484
|
-
} : d,
|
|
1485
|
-
let t =
|
|
1484
|
+
} : d, U = new Set(B.map((e) => e.id)), W = p.filter((e) => U.has(e)), ue = W.filter((e) => {
|
|
1485
|
+
let t = B.find((t) => t.id === e);
|
|
1486
1486
|
return t && !t.protected;
|
|
1487
1487
|
}), de = W.filter((e) => {
|
|
1488
|
-
let t =
|
|
1488
|
+
let t = B.find((t) => t.id === e);
|
|
1489
1489
|
return t && t.protected;
|
|
1490
1490
|
}), fe = W.filter((e) => {
|
|
1491
|
-
let t =
|
|
1492
|
-
return t && t.status ===
|
|
1491
|
+
let t = B.find((t) => t.id === e);
|
|
1492
|
+
return t && t.status === R.ACTIVE;
|
|
1493
1493
|
}), pe = W.filter((e) => {
|
|
1494
|
-
let t =
|
|
1495
|
-
return t && t.status ===
|
|
1496
|
-
}), me = !L.canDelete || W.length === 0 ||
|
|
1494
|
+
let t = B.find((t) => t.id === e);
|
|
1495
|
+
return t && t.status === R.DEACTIVATED;
|
|
1496
|
+
}), me = !L.canDelete || W.length === 0 || B.filter((e) => W.includes(e.id)).every((e) => e.protected), he = !L.canUpdate || W.length === 0 || B.filter((e) => W.includes(e.id)).every((e) => e.status === R.DEACTIVATED), ge = !L.canUpdate || W.length === 0 || B.filter((e) => W.includes(e.id)).every((e) => e.status === R.ACTIVE), _e = {
|
|
1497
1497
|
items: [
|
|
1498
1498
|
{
|
|
1499
|
-
label:
|
|
1499
|
+
label: F._({ id: "SFo0kK" }),
|
|
1500
1500
|
value: "all"
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
|
-
label:
|
|
1503
|
+
label: F._({ id: "thHAVL" }),
|
|
1504
1504
|
value: "accepted"
|
|
1505
1505
|
},
|
|
1506
1506
|
{
|
|
1507
|
-
label:
|
|
1507
|
+
label: F._({ id: "E4QYe7" }),
|
|
1508
1508
|
value: "pending"
|
|
1509
1509
|
}
|
|
1510
1510
|
],
|
|
1511
|
-
activeItem:
|
|
1512
|
-
onActiveItemChange: (e) =>
|
|
1511
|
+
activeItem: k,
|
|
1512
|
+
onActiveItemChange: (e) => ne(e)
|
|
1513
1513
|
};
|
|
1514
1514
|
return /*#__PURE__*/ q(G, { children: [
|
|
1515
1515
|
/*#__PURE__*/ q(T, {
|
|
@@ -1517,7 +1517,7 @@ function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissio
|
|
|
1517
1517
|
alignment: "center",
|
|
1518
1518
|
gap: "2",
|
|
1519
1519
|
children: [/*#__PURE__*/ K(l, {
|
|
1520
|
-
activeItem:
|
|
1520
|
+
activeItem: k,
|
|
1521
1521
|
onActiveItemChange: _e.onActiveItemChange,
|
|
1522
1522
|
children: _e.items.map((e) => /*#__PURE__*/ K(s, {
|
|
1523
1523
|
label: e.label,
|
|
@@ -1526,7 +1526,7 @@ function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissio
|
|
|
1526
1526
|
}), /*#__PURE__*/ q(T, {
|
|
1527
1527
|
gap: "0.5",
|
|
1528
1528
|
alignment: "center",
|
|
1529
|
-
children: [/*#__PURE__*/ K(
|
|
1529
|
+
children: [/*#__PURE__*/ K(N, {
|
|
1530
1530
|
options: c.options,
|
|
1531
1531
|
sortBy: c.sortBy,
|
|
1532
1532
|
sortDirection: c.sortDirection ?? "desc",
|
|
@@ -1539,7 +1539,7 @@ function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissio
|
|
|
1539
1539
|
...c,
|
|
1540
1540
|
sortDirection: e
|
|
1541
1541
|
})
|
|
1542
|
-
}), L.canCreate && /*#__PURE__*/ K(
|
|
1542
|
+
}), L.canCreate && /*#__PURE__*/ K(D, {
|
|
1543
1543
|
onClick: () => v(!0),
|
|
1544
1544
|
variant: "primary",
|
|
1545
1545
|
children: /*#__PURE__*/ K(X, { id: "a/nTb8" })
|
|
@@ -1553,31 +1553,31 @@ function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissio
|
|
|
1553
1553
|
distribution: "between",
|
|
1554
1554
|
alignment: "center",
|
|
1555
1555
|
children: [/*#__PURE__*/ K(ke, {
|
|
1556
|
-
filters:
|
|
1556
|
+
filters: H.filters,
|
|
1557
1557
|
onChange: (e) => {
|
|
1558
|
-
let t = nt(
|
|
1559
|
-
t !== (
|
|
1558
|
+
let t = nt(H.selectedFilters || [], e, H.filters);
|
|
1559
|
+
t !== (H.selectedFilters || []) && f({
|
|
1560
1560
|
...d,
|
|
1561
1561
|
selectedFilters: t
|
|
1562
1562
|
});
|
|
1563
1563
|
}
|
|
1564
1564
|
}), /*#__PURE__*/ K(te, {
|
|
1565
|
-
placeholder:
|
|
1565
|
+
placeholder: F._({ id: "0cl0a5" }),
|
|
1566
1566
|
"data-testid": "searchbar",
|
|
1567
|
-
value:
|
|
1567
|
+
value: oe,
|
|
1568
1568
|
onInput: (e) => {
|
|
1569
1569
|
let t = e.currentTarget.value;
|
|
1570
|
-
z(t), clearTimeout(
|
|
1570
|
+
z(t), clearTimeout(se.current), se.current = window.setTimeout(() => o(t), 500);
|
|
1571
1571
|
},
|
|
1572
1572
|
onSearch: (e) => {
|
|
1573
|
-
clearTimeout(
|
|
1573
|
+
clearTimeout(se.current), o(typeof e == "string" ? e : "");
|
|
1574
1574
|
},
|
|
1575
1575
|
onClear: () => {
|
|
1576
|
-
clearTimeout(
|
|
1576
|
+
clearTimeout(se.current), z(""), o("");
|
|
1577
1577
|
}
|
|
1578
1578
|
})]
|
|
1579
|
-
}),
|
|
1580
|
-
selectedFilters:
|
|
1579
|
+
}), H.selectedFilters && H.selectedFilters.length > 0 && /*#__PURE__*/ K(Oe, {
|
|
1580
|
+
selectedFilters: H.selectedFilters,
|
|
1581
1581
|
onDelete: (e) => f({
|
|
1582
1582
|
...d,
|
|
1583
1583
|
selectedFilters: (d.selectedFilters || []).filter((t) => !(t.name === e.name && t.value === e.value))
|
|
@@ -1595,46 +1595,46 @@ function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissio
|
|
|
1595
1595
|
gap: "2",
|
|
1596
1596
|
alignment: "center",
|
|
1597
1597
|
children: [/*#__PURE__*/ K(ee, {
|
|
1598
|
-
checked: W.length > 0 &&
|
|
1599
|
-
indeterminate: W.length > 0 && !
|
|
1598
|
+
checked: W.length > 0 && V.every((e) => W.includes(e.id)),
|
|
1599
|
+
indeterminate: W.length > 0 && !V.every((e) => W.includes(e.id)),
|
|
1600
1600
|
onChange: () => {
|
|
1601
|
-
let e =
|
|
1601
|
+
let e = V.map((e) => e.id);
|
|
1602
1602
|
e.every((e) => W.includes(e)) ? m(W.filter((t) => !e.includes(t))) : m([...new Set([...W, ...e])]);
|
|
1603
1603
|
}
|
|
1604
1604
|
}), /*#__PURE__*/ q(C, { children: [/*#__PURE__*/ K(w, {
|
|
1605
1605
|
as: "div",
|
|
1606
|
-
children: /*#__PURE__*/ K(
|
|
1606
|
+
children: /*#__PURE__*/ K(D, {
|
|
1607
1607
|
size: "small",
|
|
1608
1608
|
icon: "moreVert",
|
|
1609
|
-
label:
|
|
1609
|
+
label: F._({ id: "7L01XJ" })
|
|
1610
1610
|
})
|
|
1611
1611
|
}), /*#__PURE__*/ q(e, { children: [
|
|
1612
1612
|
L.canDelete && /*#__PURE__*/ K(h, {
|
|
1613
1613
|
disabled: me,
|
|
1614
|
-
label:
|
|
1614
|
+
label: F._({ id: "c6b6fz" }),
|
|
1615
1615
|
onClick: () => b(!0)
|
|
1616
1616
|
}),
|
|
1617
1617
|
L.canUpdate && /*#__PURE__*/ K(h, {
|
|
1618
1618
|
disabled: he,
|
|
1619
|
-
label:
|
|
1619
|
+
label: F._({ id: "UmQ3/m" }),
|
|
1620
1620
|
onClick: () => S(!0)
|
|
1621
1621
|
}),
|
|
1622
1622
|
L.canUpdate && /*#__PURE__*/ K(h, {
|
|
1623
1623
|
disabled: ge,
|
|
1624
|
-
label:
|
|
1625
|
-
onClick: () =>
|
|
1624
|
+
label: F._({ id: "d/I0J3" }),
|
|
1625
|
+
onClick: () => O(!0)
|
|
1626
1626
|
})
|
|
1627
1627
|
] })] })]
|
|
1628
1628
|
})
|
|
1629
1629
|
}) }),
|
|
1630
1630
|
/*#__PURE__*/ K(et, {
|
|
1631
|
-
images:
|
|
1632
|
-
suggestedImages:
|
|
1633
|
-
acceptedImages:
|
|
1631
|
+
images: V,
|
|
1632
|
+
suggestedImages: k === "pending" ? V : [],
|
|
1633
|
+
acceptedImages: k === "accepted" ? V : [],
|
|
1634
1634
|
permissions: L,
|
|
1635
|
-
isFetching:
|
|
1636
|
-
currentPage:
|
|
1637
|
-
totalPages:
|
|
1635
|
+
isFetching: A,
|
|
1636
|
+
currentPage: le,
|
|
1637
|
+
totalPages: ce,
|
|
1638
1638
|
onPageChange: M,
|
|
1639
1639
|
selectedImages: p,
|
|
1640
1640
|
setSelectedImages: m,
|
|
@@ -1643,16 +1643,16 @@ function ct({ imagesPromise: t, imageOverrides: n, deletedImageIds: r, permissio
|
|
|
1643
1643
|
deactivateAllModalOpen: x,
|
|
1644
1644
|
setDeactivateAllModalOpen: S,
|
|
1645
1645
|
activateAllModalOpen: E,
|
|
1646
|
-
setActivateAllModalOpen:
|
|
1646
|
+
setActivateAllModalOpen: O,
|
|
1647
1647
|
createModalOpen: g,
|
|
1648
1648
|
setCreateModalOpen: v,
|
|
1649
1649
|
deletableImages: ue,
|
|
1650
1650
|
protectedImages: de,
|
|
1651
1651
|
activeImages: fe,
|
|
1652
1652
|
deactivatedImages: pe,
|
|
1653
|
-
onImageUpdated:
|
|
1654
|
-
onImageDeleted:
|
|
1655
|
-
onMemberStatusChanged:
|
|
1653
|
+
onImageUpdated: P,
|
|
1654
|
+
onImageDeleted: re,
|
|
1655
|
+
onMemberStatusChanged: ie,
|
|
1656
1656
|
hasAnyBulkAction: L.canDelete || L.canUpdate
|
|
1657
1657
|
})
|
|
1658
1658
|
] });
|
|
@@ -1688,25 +1688,25 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1688
1688
|
{
|
|
1689
1689
|
displayName: r._({ id: "uAQUqI" }),
|
|
1690
1690
|
filterName: "status",
|
|
1691
|
-
values: Object.values(
|
|
1691
|
+
values: Object.values(R),
|
|
1692
1692
|
supportsMultiValue: !0
|
|
1693
1693
|
},
|
|
1694
1694
|
{
|
|
1695
1695
|
displayName: r._({ id: "2q/Q7x" }),
|
|
1696
1696
|
filterName: "visibility",
|
|
1697
|
-
values: Object.values(
|
|
1697
|
+
values: Object.values(z),
|
|
1698
1698
|
supportsMultiValue: !1
|
|
1699
1699
|
},
|
|
1700
1700
|
{
|
|
1701
1701
|
displayName: r._({ id: "NopYGU" }),
|
|
1702
1702
|
filterName: "disk_format",
|
|
1703
|
-
values: Object.values(
|
|
1703
|
+
values: Object.values(L),
|
|
1704
1704
|
supportsMultiValue: !0
|
|
1705
1705
|
},
|
|
1706
1706
|
{
|
|
1707
1707
|
displayName: r._({ id: "6/xipy" }),
|
|
1708
1708
|
filterName: "container_format",
|
|
1709
|
-
values: Object.values(
|
|
1709
|
+
values: Object.values(pe),
|
|
1710
1710
|
supportsMultiValue: !0
|
|
1711
1711
|
},
|
|
1712
1712
|
{
|
|
@@ -1717,22 +1717,22 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
],
|
|
1719
1719
|
selectedFilters: Q(o)
|
|
1720
|
-
}), [f, p] = J(o.search || ""), m = o.page ?? 1, [h, g] = J([]), [_, v] = J(!1), [y, ee] = J(!1), [b, te] = J(!1), [x, S] = J(!1), C = o.memberStatus ?? "all", [w, E] = J(!0), [
|
|
1721
|
-
|
|
1722
|
-
}, []),
|
|
1723
|
-
|
|
1720
|
+
}), [f, p] = J(o.search || ""), m = o.page ?? 1, [h, g] = J([]), [_, v] = J(!1), [y, ee] = J(!1), [b, te] = J(!1), [x, S] = J(!1), C = o.memberStatus ?? "all", [w, E] = J(!0), [D, O] = J(/* @__PURE__ */ new Map()), [k, ne] = J(/* @__PURE__ */ new Set()), [A, j] = J(() => new Promise(() => {})), [M] = J(() => ot(e, n)), N = Ne((e) => {
|
|
1721
|
+
O((t) => new Map(t).set(e.id, e));
|
|
1722
|
+
}, []), P = Ne((e) => {
|
|
1723
|
+
ne((t) => {
|
|
1724
1724
|
let n = new Set(t);
|
|
1725
1725
|
return Array.isArray(e) ? e.forEach((e) => n.add(e)) : n.add(e), n;
|
|
1726
1726
|
});
|
|
1727
|
-
}, []),
|
|
1728
|
-
|
|
1727
|
+
}, []), re = Ne(() => {
|
|
1728
|
+
O(/* @__PURE__ */ new Map()), E(!0);
|
|
1729
1729
|
let t = o.memberStatus ?? "all", r = t === "all" ? void 0 : t;
|
|
1730
1730
|
je(() => {
|
|
1731
1731
|
let i = t === "pending" || t === "accepted" ? (u.selectedFilters || []).filter((e) => e.name !== "visibility") : u.selectedFilters || [], a = at(e, n, s.sortBy, s.sortDirection, f, {
|
|
1732
1732
|
...tt(i, u.filters),
|
|
1733
1733
|
member_status: r
|
|
1734
1734
|
});
|
|
1735
|
-
a.catch(() => {}).finally(() => E(!1)),
|
|
1735
|
+
a.catch(() => {}).finally(() => E(!1)), j(a);
|
|
1736
1736
|
});
|
|
1737
1737
|
}, [
|
|
1738
1738
|
e,
|
|
@@ -1750,14 +1750,14 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1750
1750
|
...e,
|
|
1751
1751
|
sortBy: r,
|
|
1752
1752
|
sortDirection: i
|
|
1753
|
-
})), p(a), g([]),
|
|
1753
|
+
})), p(a), g([]), O(/* @__PURE__ */ new Map()), E(!0);
|
|
1754
1754
|
let s = o.memberStatus ?? "all", c = s === "all" ? void 0 : s;
|
|
1755
1755
|
je(() => {
|
|
1756
1756
|
let o = at(e, n, r, i, a, {
|
|
1757
1757
|
...tt(s === "pending" || s === "accepted" ? (t || []).filter((e) => e.name !== "visibility") : t || [], u.filters),
|
|
1758
1758
|
member_status: c
|
|
1759
1759
|
});
|
|
1760
|
-
o.catch(() => {}).finally(() => E(!1)),
|
|
1760
|
+
o.catch(() => {}).finally(() => E(!1)), j(o);
|
|
1761
1761
|
});
|
|
1762
1762
|
}, [
|
|
1763
1763
|
o.status,
|
|
@@ -1770,7 +1770,7 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1770
1770
|
o.search,
|
|
1771
1771
|
o.memberStatus
|
|
1772
1772
|
]);
|
|
1773
|
-
let
|
|
1773
|
+
let ie = (e) => {
|
|
1774
1774
|
let t = {
|
|
1775
1775
|
options: e.options,
|
|
1776
1776
|
sortBy: e.sortBy?.toString() || "created_at",
|
|
@@ -1785,7 +1785,7 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1785
1785
|
}),
|
|
1786
1786
|
replace: !0
|
|
1787
1787
|
});
|
|
1788
|
-
},
|
|
1788
|
+
}, F = (e) => {
|
|
1789
1789
|
d(e), a({
|
|
1790
1790
|
search: (t) => rt(e.selectedFilters || [], e.filters, {
|
|
1791
1791
|
search: t.search,
|
|
@@ -1795,7 +1795,7 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1795
1795
|
}),
|
|
1796
1796
|
replace: !0
|
|
1797
1797
|
});
|
|
1798
|
-
},
|
|
1798
|
+
}, ae = (e) => {
|
|
1799
1799
|
let t = typeof e == "string" ? e : "";
|
|
1800
1800
|
p(t), a({
|
|
1801
1801
|
search: (e) => ({
|
|
@@ -1805,14 +1805,14 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1805
1805
|
}),
|
|
1806
1806
|
replace: !0
|
|
1807
1807
|
});
|
|
1808
|
-
},
|
|
1808
|
+
}, I = (e) => {
|
|
1809
1809
|
a({ search: (t) => ({
|
|
1810
1810
|
sortBy: t.sortBy,
|
|
1811
1811
|
sortDirection: t.sortDirection,
|
|
1812
1812
|
search: t.search,
|
|
1813
1813
|
memberStatus: e === "all" ? void 0 : e
|
|
1814
1814
|
}) });
|
|
1815
|
-
},
|
|
1815
|
+
}, oe = Ne((e) => {
|
|
1816
1816
|
a({ search: (t) => ({
|
|
1817
1817
|
...t,
|
|
1818
1818
|
page: e === 1 ? void 0 : e
|
|
@@ -1838,16 +1838,16 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1838
1838
|
}), /*#__PURE__*/ K(X, { id: "HBpi4q" })]
|
|
1839
1839
|
}),
|
|
1840
1840
|
children: /*#__PURE__*/ K(ct, {
|
|
1841
|
-
imagesPromise:
|
|
1842
|
-
imageOverrides:
|
|
1843
|
-
deletedImageIds:
|
|
1844
|
-
permissionsPromise:
|
|
1841
|
+
imagesPromise: A,
|
|
1842
|
+
imageOverrides: D,
|
|
1843
|
+
deletedImageIds: k,
|
|
1844
|
+
permissionsPromise: M,
|
|
1845
1845
|
searchTerm: f,
|
|
1846
|
-
setSearchTerm:
|
|
1846
|
+
setSearchTerm: ae,
|
|
1847
1847
|
sortSettings: s,
|
|
1848
|
-
handleSortChange:
|
|
1848
|
+
handleSortChange: ie,
|
|
1849
1849
|
filterSettings: u,
|
|
1850
|
-
handleFilterChange:
|
|
1850
|
+
handleFilterChange: F,
|
|
1851
1851
|
selectedImages: h,
|
|
1852
1852
|
setSelectedImages: g,
|
|
1853
1853
|
createModalOpen: _,
|
|
@@ -1859,13 +1859,13 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1859
1859
|
activateAllModalOpen: x,
|
|
1860
1860
|
setActivateAllModalOpen: S,
|
|
1861
1861
|
memberStatusView: C,
|
|
1862
|
-
setMemberStatusView:
|
|
1862
|
+
setMemberStatusView: I,
|
|
1863
1863
|
isFetching: w,
|
|
1864
1864
|
currentPage: m,
|
|
1865
|
-
onPageChange:
|
|
1866
|
-
onImageUpdated:
|
|
1867
|
-
onImageDeleted:
|
|
1868
|
-
onMemberStatusChanged:
|
|
1865
|
+
onPageChange: oe,
|
|
1866
|
+
onImageUpdated: N,
|
|
1867
|
+
onImageDeleted: P,
|
|
1868
|
+
onMemberStatusChanged: re
|
|
1869
1869
|
})
|
|
1870
1870
|
})
|
|
1871
1871
|
})
|
|
@@ -1874,9 +1874,9 @@ var lt = ({ client: e, project: n }) => {
|
|
|
1874
1874
|
//#endregion
|
|
1875
1875
|
//#region src/client/routes/_auth/projects/$projectId/compute/images/index.tsx?tsr-split=component
|
|
1876
1876
|
function ut() {
|
|
1877
|
-
let { i18n: e, _: t } = Z(), { projectId: n } =
|
|
1877
|
+
let { i18n: e, _: t } = Z(), { projectId: n } = A.useParams(), { trpcClient: r } = A.useRouteContext();
|
|
1878
1878
|
if (!r) throw Error("trpcClient is not available in route context");
|
|
1879
|
-
return /*#__PURE__*/ q(G, { children: [/*#__PURE__*/ K(
|
|
1879
|
+
return /*#__PURE__*/ q(G, { children: [/*#__PURE__*/ K(M, {
|
|
1880
1880
|
title: e._({ id: "an5hVd" }),
|
|
1881
1881
|
projectId: n
|
|
1882
1882
|
}), /*#__PURE__*/ K(lt, {
|
|
@@ -1887,4 +1887,4 @@ function ut() {
|
|
|
1887
1887
|
//#endregion
|
|
1888
1888
|
export { ut as component };
|
|
1889
1889
|
|
|
1890
|
-
//# sourceMappingURL=images-
|
|
1890
|
+
//# sourceMappingURL=images-C3voJ3B1.mjs.map
|