@cobaltcore-dev/aurora 0.5.0 → 0.7.0
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/README.md +59 -13
- package/dist/client/{ContentHeader-xQVhO2yT.mjs → ContentHeader-kx1Th5Sq.mjs} +18 -18
- package/dist/client/{ContentHeader-xQVhO2yT.mjs.map → ContentHeader-kx1Th5Sq.mjs.map} +1 -1
- package/dist/client/{DeleteFlavorModal-CHTUZ3YV.mjs → DeleteFlavorModal-C3cb7YiJ.mjs} +155 -155
- package/dist/client/{DeleteFlavorModal-CHTUZ3YV.mjs.map → DeleteFlavorModal-C3cb7YiJ.mjs.map} +1 -1
- package/dist/client/{EditSecurityGroupModal-CWHHx2Xk.mjs → EditSecurityGroupModal-CpP54WIK.mjs} +18 -18
- package/dist/client/{EditSecurityGroupModal-CWHHx2Xk.mjs.map → EditSecurityGroupModal-CpP54WIK.mjs.map} +1 -1
- package/dist/client/{FiltersInput-UKJpNFdr.mjs → FiltersInput-DxcyR6Bp.mjs} +18 -18
- package/dist/client/{FiltersInput-UKJpNFdr.mjs.map → FiltersInput-DxcyR6Bp.mjs.map} +1 -1
- package/dist/client/{FloatingIpActionModals-caXn6bYo.mjs → FloatingIpActionModals-BP8RWHbu.mjs} +55 -55
- package/dist/client/{FloatingIpActionModals-caXn6bYo.mjs.map → FloatingIpActionModals-BP8RWHbu.mjs.map} +1 -1
- package/dist/client/{ImageToastNotifications-BWimIzu_.mjs → ImageToastNotifications-TZ3EfQg-.mjs} +323 -371
- package/dist/client/ImageToastNotifications-TZ3EfQg-.mjs.map +1 -0
- package/dist/client/{RouteError-CUj_m3gu.mjs → RouteError-QSV7qOoJ.mjs} +2 -2
- package/dist/client/{RouteError-CUj_m3gu.mjs.map → RouteError-QSV7qOoJ.mjs.map} +1 -1
- package/dist/client/{SortInput-GQlQBlAj.mjs → SortInput-CYv2_Pur.mjs} +5 -5
- package/dist/client/{SortInput-GQlQBlAj.mjs.map → SortInput-CYv2_Pur.mjs.map} +1 -1
- package/dist/client/_auth-DXJkv9QO.mjs.map +1 -1
- package/dist/client/{_flavorId-sUWG0xuy.mjs → _flavorId-C2x43-6S.mjs} +9 -9
- package/dist/client/{_flavorId-sUWG0xuy.mjs.map → _flavorId-C2x43-6S.mjs.map} +1 -1
- package/dist/client/{_flavorId-C5dc1N_j.mjs → _flavorId-CR8ZUI-P.mjs} +46 -46
- package/dist/client/{_flavorId-C5dc1N_j.mjs.map → _flavorId-CR8ZUI-P.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-CT4y-60o.mjs → _floatingIpId-BCk41_Lb.mjs} +2 -2
- package/dist/client/{_floatingIpId-CT4y-60o.mjs.map → _floatingIpId-BCk41_Lb.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-COK_TBrz2.mjs → _floatingIpId-BGrOAmPT.mjs} +33 -33
- package/dist/client/_floatingIpId-BGrOAmPT.mjs.map +1 -0
- package/dist/client/_imageId-CvfD832b.mjs +534 -0
- package/dist/client/{_imageId-n3RcnhAR.mjs.map → _imageId-CvfD832b.mjs.map} +1 -1
- package/dist/client/_pcaId-BxBt5DXi.mjs +459 -0
- package/dist/client/_pcaId-BxBt5DXi.mjs.map +1 -0
- package/dist/client/{_pcaId-ChnM_t-9.mjs → _pcaId-DOHycvCf.mjs} +2 -2
- package/dist/client/{_pcaId-ChnM_t-9.mjs.map → _pcaId-DOHycvCf.mjs.map} +1 -1
- package/dist/client/{_projectId-26bw-_rm.mjs → _projectId-BDSWnMGj.mjs} +3 -3
- package/dist/client/{_projectId-26bw-_rm.mjs.map → _projectId-BDSWnMGj.mjs.map} +1 -1
- package/dist/client/{_projectId-Dhb4AyBD.mjs → _projectId-DOgwFiqD.mjs} +2 -2
- package/dist/client/{_projectId-Dhb4AyBD.mjs.map → _projectId-DOgwFiqD.mjs.map} +1 -1
- package/dist/client/_projectId-DS4nR59B.mjs +299 -0
- package/dist/client/_projectId-DS4nR59B.mjs.map +1 -0
- package/dist/client/{_projectId-BK9UqeYw.mjs → _projectId-MxcHrXW4.mjs} +12 -12
- package/dist/client/_projectId-MxcHrXW4.mjs.map +1 -0
- package/dist/client/{_securityGroupId-CR1mKICQ.mjs → _securityGroupId-CJJanWiY.mjs} +2 -2
- package/dist/client/{_securityGroupId-CR1mKICQ.mjs.map → _securityGroupId-CJJanWiY.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-DroYG6cA.mjs → _securityGroupId-KKw4RPdH.mjs} +328 -328
- package/dist/client/{_securityGroupId-DroYG6cA.mjs.map → _securityGroupId-KKw4RPdH.mjs.map} +1 -1
- package/dist/client/{containers-DGY2hoWw.mjs → _storageType-4wSxI__0.mjs} +18 -15
- package/dist/client/_storageType-4wSxI__0.mjs.map +1 -0
- package/dist/client/{containers-ZMFTRaQL.mjs → _storageType-DYjo-6ej.mjs} +1054 -1088
- package/dist/client/_storageType-DYjo-6ej.mjs.map +1 -0
- package/dist/client/{containers-xfsYgRyf.mjs → _storageType-zeSZe--V.mjs} +2 -2
- package/dist/client/_storageType-zeSZe--V.mjs.map +1 -0
- package/dist/client/{about-969pIiZ9.mjs → about-Bo9vxGHy.mjs} +8 -8
- package/dist/client/{about-969pIiZ9.mjs.map → about-Bo9vxGHy.mjs.map} +1 -1
- package/dist/client/{build-DracvfrJ.mjs → build-DeJcDjPi.mjs} +3798 -3372
- package/dist/client/build-DeJcDjPi.mjs.map +1 -0
- package/dist/client/constants-BmcGYeR-.mjs +153 -0
- package/dist/client/constants-BmcGYeR-.mjs.map +1 -0
- package/dist/client/{flavors-C4GtoybP.mjs → flavors-BxFVqgnb.mjs} +2 -2
- package/dist/client/{flavors-C4GtoybP.mjs.map → flavors-BxFVqgnb.mjs.map} +1 -1
- package/dist/client/{flavors-CpirO_nr.mjs → flavors-CfdgjsZY.mjs} +192 -192
- package/dist/client/{flavors-CpirO_nr.mjs.map → flavors-CfdgjsZY.mjs.map} +1 -1
- package/dist/client/{floatingips-BUf_oLRl.mjs → floatingips-ByRb82wS.mjs} +123 -123
- package/dist/client/{floatingips-BUf_oLRl.mjs.map → floatingips-ByRb82wS.mjs.map} +1 -1
- package/dist/client/{images-Da1t5KPh.mjs → images-CKqIXUq52.mjs} +613 -613
- package/dist/client/images-CKqIXUq52.mjs.map +1 -0
- package/dist/client/{images-CsonlmFx.mjs → images-C_dX7nY6.mjs} +2 -2
- package/dist/client/{images-CsonlmFx.mjs.map → images-C_dX7nY6.mjs.map} +1 -1
- package/dist/client/{images-QnWf63uj.mjs → images-CenluYV8.mjs} +2 -2
- package/dist/client/{images-QnWf63uj.mjs.map → images-CenluYV8.mjs.map} +1 -1
- package/dist/client/index.js +391 -431
- package/dist/client/index.js.map +1 -1
- package/dist/client/{md-sBiSNVSQ.mjs → md-CYTrL5dq.mjs} +52 -16
- package/dist/client/{md-sBiSNVSQ.mjs.map → md-CYTrL5dq.mjs.map} +1 -1
- package/dist/client/{objects-H0NN_Sja.mjs → objects-BJM6YeuF.mjs} +2131 -1883
- package/dist/client/objects-BJM6YeuF.mjs.map +1 -0
- package/dist/client/{objects-B89dYCBq.mjs → objects-gxSjvbvF.mjs} +36 -21
- package/dist/client/objects-gxSjvbvF.mjs.map +1 -0
- package/dist/client/{objects-CuFLUOe1.mjs → objects-o2Cj_ndZ.mjs} +2 -2
- package/dist/client/objects-o2Cj_ndZ.mjs.map +1 -0
- package/dist/client/{pca-CtU6REww.mjs → pca-Bl8NmoVZ.mjs} +2 -2
- package/dist/client/{pca-CtU6REww.mjs.map → pca-Bl8NmoVZ.mjs.map} +1 -1
- package/dist/client/pca-RSiWpJs9.mjs +182 -0
- package/dist/client/pca-RSiWpJs9.mjs.map +1 -0
- package/dist/client/{projects-DNXsDnJM.mjs → projects-CgclWI16.mjs} +33 -27
- package/dist/client/{projects-DNXsDnJM.mjs.map → projects-CgclWI16.mjs.map} +1 -1
- package/dist/client/{projects-dhnQkuvV.mjs → projects-D2iewAzu.mjs} +2 -2
- package/dist/client/{projects-dhnQkuvV.mjs.map → projects-D2iewAzu.mjs.map} +1 -1
- package/dist/client/{projects-C-sjd9T5.mjs → projects-pe2_dCnV.mjs} +2 -2
- package/dist/client/{projects-C-sjd9T5.mjs.map → projects-pe2_dCnV.mjs.map} +1 -1
- package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
- package/dist/client/{securitygroups-wHdrxZXd.mjs → securitygroups-DahZkVYQ.mjs} +111 -111
- package/dist/client/{securitygroups-wHdrxZXd.mjs.map → securitygroups-DahZkVYQ.mjs.map} +1 -1
- package/dist/client/{useListWithFiltering-DrgUwXef.mjs → useListWithFiltering-DaYcu5AB.mjs} +12 -12
- package/dist/client/{useListWithFiltering-DrgUwXef.mjs.map → useListWithFiltering-DaYcu5AB.mjs.map} +1 -1
- package/dist/server/index.d.ts +571 -2
- package/dist/server/index.js +29 -211
- package/package.json +4 -5
- package/dist/client/ImageToastNotifications-BWimIzu_.mjs.map +0 -1
- package/dist/client/_floatingIpId-COK_TBrz2.mjs.map +0 -1
- package/dist/client/_imageId-n3RcnhAR.mjs +0 -534
- package/dist/client/_pcaId-B-f_6kqs.mjs +0 -466
- package/dist/client/_pcaId-B-f_6kqs.mjs.map +0 -1
- package/dist/client/_projectId-BK9UqeYw.mjs.map +0 -1
- package/dist/client/_projectId-CCtpAQ8m.mjs +0 -299
- package/dist/client/_projectId-CCtpAQ8m.mjs.map +0 -1
- package/dist/client/build-DracvfrJ.mjs.map +0 -1
- package/dist/client/constants-4lVQXort.mjs +0 -128
- package/dist/client/constants-4lVQXort.mjs.map +0 -1
- package/dist/client/containers-DGY2hoWw.mjs.map +0 -1
- package/dist/client/containers-ZMFTRaQL.mjs.map +0 -1
- package/dist/client/containers-xfsYgRyf.mjs.map +0 -1
- package/dist/client/images-Da1t5KPh.mjs.map +0 -1
- package/dist/client/objects-B89dYCBq.mjs.map +0 -1
- package/dist/client/objects-CuFLUOe1.mjs.map +0 -1
- package/dist/client/objects-H0NN_Sja.mjs.map +0 -1
- package/dist/client/pca-C-UFjicP.mjs +0 -167
- package/dist/client/pca-C-UFjicP.mjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B as e, C as t,
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { A as
|
|
1
|
+
import { B as e, C as t, F as n, G as r, H as i, J as a, N as o, P as s, Q as c, R as l, U as u, X as d, a as f, at as p, ct as m, f as h, i as g, it as _, j as ee, k as v, lt as y, n as b, ot as te, q as ne, r as x, s as S, tt as C, u as w, w as T, x as re } from "./build-DeJcDjPi.mjs";
|
|
2
|
+
import { n as E, r as D } from "./trpcClient-BzPUgiM2.mjs";
|
|
3
|
+
import { t as ie } from "./cn-DM4Cy3jv.mjs";
|
|
4
|
+
import { t as O } from "./images-CenluYV8.mjs";
|
|
5
|
+
import { t as k } from "./ContentHeader-kx1Th5Sq.mjs";
|
|
6
|
+
import { t as A } from "./SortInput-CYv2_Pur.mjs";
|
|
7
|
+
import { A as j, C as ae, D as oe, E as se, F as M, I as N, M as P, N as F, O as I, P as L, S as R, T as z, _ as B, a as ce, b as le, c as V, d as H, f as ue, g as U, 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-TZ3EfQg-.mjs";
|
|
8
8
|
import { t as Oe } from "./useProjectId-DBc5lpoU.mjs";
|
|
9
9
|
import "./hooks-dSArr2Ca.mjs";
|
|
10
|
-
import { n as ke, t as Ae } from "./FiltersInput-
|
|
10
|
+
import { n as ke, t as Ae } from "./FiltersInput-DxcyR6Bp.mjs";
|
|
11
11
|
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
12
12
|
import { Suspense as je, startTransition as Me, use as Ne, useCallback as Pe, useEffect as Fe, useMemo as Ie, useRef as Le, useState as q } from "react";
|
|
13
13
|
import { useNavigate as Re, useParams as J, useSearch as Y } from "@tanstack/react-router";
|
|
@@ -17,99 +17,99 @@ import { i18n as Be } from "@lingui/core";
|
|
|
17
17
|
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
|
-
function He({ image: e, isSelected: t, isPending:
|
|
21
|
-
let { i18n:
|
|
22
|
-
|
|
23
|
-
} }),
|
|
20
|
+
function He({ image: e, isSelected: t, isPending: n, isAccepted: i, permissions: a, onEditDetails: o, onEditMetadata: c, onDelete: u, onSelect: d, onActivationStatusChange: f, onManageAccess: p, onUpdateVisibility: m, setToastData: h, uploadId: g, uploadProgressPercent: ee, onMemberStatusChanged: v, showSelectColumn: y = !1 }) {
|
|
21
|
+
let { i18n: b, _: ne } = Z(), { id: x, name: S, status: w, visibility: re, size: E, disk_format: ie, created_at: O, owner: k } = e, A = S || b._({ id: "MEIAzV" }), { projectId: j } = J({ from: "/_auth/projects/$projectId/compute/images/" }), ae = Re(), oe = D.useUtils(), se = D.compute.updateImageMember.useMutation({ onSuccess: () => {
|
|
22
|
+
oe.compute.listImagesWithPagination.invalidate(), oe.compute.listSharedImagesByMemberStatus.invalidate();
|
|
23
|
+
} }), P = async (e) => {
|
|
24
24
|
try {
|
|
25
|
-
await
|
|
26
|
-
project_id:
|
|
27
|
-
imageId:
|
|
28
|
-
memberId:
|
|
25
|
+
await se.mutateAsync({
|
|
26
|
+
project_id: j,
|
|
27
|
+
imageId: x,
|
|
28
|
+
memberId: j,
|
|
29
29
|
status: e
|
|
30
|
-
}),
|
|
30
|
+
}), h(H(e, { onDismiss: () => h(null) })), v?.();
|
|
31
31
|
} catch (e) {
|
|
32
32
|
let t = e?.message;
|
|
33
|
-
|
|
33
|
+
h(Ce(t, { onDismiss: () => h(null) }));
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
return /*#__PURE__*/ K(
|
|
37
|
-
"data-testid": `image-row-${
|
|
38
|
-
onClick: () =>
|
|
35
|
+
}, I = j === k, R = n || i, z = se.isPending;
|
|
36
|
+
return /*#__PURE__*/ K(T, {
|
|
37
|
+
"data-testid": `image-row-${x}`,
|
|
38
|
+
onClick: () => ae({
|
|
39
39
|
to: "/projects/$projectId/compute/images/$imageId",
|
|
40
40
|
params: {
|
|
41
|
-
projectId:
|
|
42
|
-
imageId:
|
|
41
|
+
projectId: j,
|
|
42
|
+
imageId: x
|
|
43
43
|
}
|
|
44
44
|
}),
|
|
45
45
|
children: [
|
|
46
|
-
|
|
46
|
+
y && /*#__PURE__*/ G(r, {
|
|
47
47
|
onClick: (e) => e.stopPropagation(),
|
|
48
48
|
children: /*#__PURE__*/ G(te, {
|
|
49
49
|
checked: t,
|
|
50
|
-
onChange: () =>
|
|
50
|
+
onChange: () => d(e)
|
|
51
51
|
})
|
|
52
52
|
}),
|
|
53
|
-
/*#__PURE__*/ G(
|
|
54
|
-
/*#__PURE__*/ G(
|
|
55
|
-
/*#__PURE__*/ G(
|
|
56
|
-
/*#__PURE__*/ G(
|
|
57
|
-
/*#__PURE__*/ G(
|
|
58
|
-
/*#__PURE__*/ G(
|
|
59
|
-
/*#__PURE__*/ G(
|
|
60
|
-
/*#__PURE__*/ G(
|
|
53
|
+
/*#__PURE__*/ G(r, { children: w }),
|
|
54
|
+
/*#__PURE__*/ G(r, { children: A }),
|
|
55
|
+
/*#__PURE__*/ G(r, { children: re }),
|
|
56
|
+
/*#__PURE__*/ G(r, { children: e.protected ? b._({ id: "l75CjT" }) : b._({ id: "1UzENP" }) }),
|
|
57
|
+
/*#__PURE__*/ G(r, { children: g && g === x ? `${ee}%` : /*#__PURE__*/ G(N, { size: E }) }),
|
|
58
|
+
/*#__PURE__*/ G(r, { children: ie || b._({ id: "fj5byd" }) }),
|
|
59
|
+
/*#__PURE__*/ G(r, { children: O ? new Date(O).toLocaleDateString() : b._({ id: "fj5byd" }) }),
|
|
60
|
+
/*#__PURE__*/ G(r, {
|
|
61
61
|
onClick: (e) => e.stopPropagation(),
|
|
62
|
-
children:
|
|
62
|
+
children: z ? /*#__PURE__*/ G(l, {
|
|
63
63
|
variant: "primary",
|
|
64
64
|
size: "small"
|
|
65
|
-
}) : /*#__PURE__*/ G(
|
|
66
|
-
/*#__PURE__*/ G(
|
|
67
|
-
label:
|
|
68
|
-
onClick: () =>
|
|
65
|
+
}) : /*#__PURE__*/ G(s, { children: /*#__PURE__*/ K(C, { children: [
|
|
66
|
+
/*#__PURE__*/ G(_, {
|
|
67
|
+
label: b._({ id: "v0hPHE" }),
|
|
68
|
+
onClick: () => ae({
|
|
69
69
|
to: "/projects/$projectId/compute/images/$imageId",
|
|
70
70
|
params: {
|
|
71
|
-
projectId:
|
|
72
|
-
imageId:
|
|
71
|
+
projectId: j,
|
|
72
|
+
imageId: x
|
|
73
73
|
}
|
|
74
74
|
})
|
|
75
75
|
}),
|
|
76
|
-
|
|
77
|
-
label:
|
|
78
|
-
onClick: () =>
|
|
79
|
-
}), /*#__PURE__*/ G(
|
|
80
|
-
label:
|
|
81
|
-
onClick: () =>
|
|
76
|
+
R && a.canUpdateMember && /*#__PURE__*/ K(W, { children: [n && /*#__PURE__*/ G(_, {
|
|
77
|
+
label: b._({ id: "g3UF2V" }),
|
|
78
|
+
onClick: () => P(M.ACCEPTED)
|
|
79
|
+
}), /*#__PURE__*/ G(_, {
|
|
80
|
+
label: b._({ id: "1t/NnN" }),
|
|
81
|
+
onClick: () => P(M.REJECTED)
|
|
82
82
|
})] }),
|
|
83
|
-
!
|
|
84
|
-
/*#__PURE__*/ G(
|
|
85
|
-
label:
|
|
86
|
-
onClick: () =>
|
|
83
|
+
!R && a.canUpdate && /*#__PURE__*/ K(W, { children: [
|
|
84
|
+
/*#__PURE__*/ G(_, {
|
|
85
|
+
label: b._({ id: "Y1YKad" }),
|
|
86
|
+
onClick: () => o(e)
|
|
87
87
|
}),
|
|
88
|
-
/*#__PURE__*/ G(
|
|
89
|
-
label:
|
|
90
|
-
onClick: () =>
|
|
88
|
+
/*#__PURE__*/ G(_, {
|
|
89
|
+
label: b._({ id: "SIfYq6" }),
|
|
90
|
+
onClick: () => c(e)
|
|
91
91
|
}),
|
|
92
|
-
/*#__PURE__*/ G(
|
|
93
|
-
label: e.status ===
|
|
94
|
-
onClick: () =>
|
|
92
|
+
/*#__PURE__*/ G(_, {
|
|
93
|
+
label: e.status === F.DEACTIVATED ? b._({ id: "FQBaXG" }) : b._({ id: "5y3O+A" }),
|
|
94
|
+
onClick: () => f(e)
|
|
95
95
|
}),
|
|
96
|
-
e.visibility ===
|
|
97
|
-
label:
|
|
98
|
-
onClick: () =>
|
|
96
|
+
e.visibility === L.SHARED && I && (a.canCreateMember || a.canDeleteMember) && /*#__PURE__*/ G(_, {
|
|
97
|
+
label: b._({ id: "cWbW6w" }),
|
|
98
|
+
onClick: () => p(e)
|
|
99
99
|
}),
|
|
100
|
-
e.visibility ===
|
|
101
|
-
label:
|
|
102
|
-
onClick: () =>
|
|
100
|
+
e.visibility === L.PRIVATE && /*#__PURE__*/ G(_, {
|
|
101
|
+
label: b._({ id: "gMYsdZ" }),
|
|
102
|
+
onClick: () => m(e.id, L.SHARED, A)
|
|
103
103
|
})
|
|
104
104
|
] }),
|
|
105
|
-
!
|
|
106
|
-
label:
|
|
107
|
-
onClick: () =>
|
|
105
|
+
!R && a.canDelete && !e.protected && /*#__PURE__*/ G(_, {
|
|
106
|
+
label: b._({ id: "cnGeoo" }),
|
|
107
|
+
onClick: () => u(e)
|
|
108
108
|
})
|
|
109
109
|
] }) })
|
|
110
110
|
})
|
|
111
111
|
]
|
|
112
|
-
},
|
|
112
|
+
}, x);
|
|
113
113
|
}
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region src/server/Compute/helpers/imageHelpers.ts
|
|
@@ -160,14 +160,14 @@ function Q(e, t) {
|
|
|
160
160
|
var qe = {
|
|
161
161
|
name: "",
|
|
162
162
|
tags: [],
|
|
163
|
-
visibility:
|
|
163
|
+
visibility: L.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
|
-
}, Je = ({ isOpen:
|
|
170
|
-
let { i18n:
|
|
169
|
+
}, Je = ({ isOpen: t, onClose: n, onCreate: r, isLoading: a = !1, isUploadPending: o = !1, uploadProgressPercent: s }) => {
|
|
170
|
+
let { i18n: d, _: p } = Z(), [h, g] = q({ ...qe }), [_, v] = q(""), [b, ne] = q(null), [C, T] = q({}), [re, E] = q(!1), [D, O] = q(null), k = h.name.trim() !== "" && b !== null && h.disk_format !== void 0 && h.disk_format.trim() !== "" && h.container_format !== void 0 && h.container_format.trim() !== "" && h.min_disk >= 0 && h.min_ram >= 0, A = Ie(() => h.disk_format ? Ge(h.disk_format) : [], [h.disk_format]), j = [
|
|
171
171
|
".qcow2",
|
|
172
172
|
".raw",
|
|
173
173
|
".vmdk",
|
|
@@ -180,170 +180,170 @@ var qe = {
|
|
|
180
180
|
".iso",
|
|
181
181
|
".ploop",
|
|
182
182
|
".img"
|
|
183
|
-
],
|
|
183
|
+
], ae = j.join(", "), oe = (e) => {
|
|
184
184
|
let { name: t, value: n, type: r, checked: i } = e.target;
|
|
185
|
-
|
|
185
|
+
g((e) => ({
|
|
186
186
|
...e,
|
|
187
187
|
[t]: r === "checkbox" ? i : n
|
|
188
|
-
})),
|
|
188
|
+
})), C[t] && T((e) => {
|
|
189
189
|
let n = { ...e };
|
|
190
190
|
return delete n[t], n;
|
|
191
191
|
});
|
|
192
|
-
},
|
|
192
|
+
}, se = (e) => {
|
|
193
193
|
let { name: t, value: n } = e.target;
|
|
194
|
-
t === "name" && (!n || n.trim() === "") &&
|
|
194
|
+
t === "name" && (!n || n.trim() === "") && T((e) => ({
|
|
195
195
|
...e,
|
|
196
|
-
name:
|
|
196
|
+
name: d._({ id: "wyIOMP" })
|
|
197
197
|
}));
|
|
198
|
-
},
|
|
198
|
+
}, M = (e, t) => {
|
|
199
199
|
if (e === "disk_format") {
|
|
200
200
|
let e = t, n = Ke(e);
|
|
201
|
-
|
|
201
|
+
g((t) => ({
|
|
202
202
|
...t,
|
|
203
203
|
disk_format: e,
|
|
204
204
|
container_format: n
|
|
205
205
|
}));
|
|
206
|
-
} else
|
|
206
|
+
} else g((n) => ({
|
|
207
207
|
...n,
|
|
208
208
|
[e]: t
|
|
209
209
|
}));
|
|
210
|
-
|
|
210
|
+
C[e] && T((t) => {
|
|
211
211
|
let n = { ...t };
|
|
212
212
|
return delete n[e], n;
|
|
213
213
|
});
|
|
214
|
-
},
|
|
214
|
+
}, N = (e, t) => {
|
|
215
215
|
let n = t === "" ? 0 : parseInt(t, 10);
|
|
216
|
-
isNaN(n) || (
|
|
216
|
+
isNaN(n) || (g((t) => ({
|
|
217
217
|
...t,
|
|
218
218
|
[e]: n
|
|
219
|
-
})),
|
|
219
|
+
})), C[e] && T((t) => {
|
|
220
220
|
let n = { ...t };
|
|
221
221
|
return delete n[e], n;
|
|
222
222
|
}));
|
|
223
|
-
},
|
|
224
|
-
t < 0 && (e === "min_disk" ?
|
|
223
|
+
}, F = (e, t) => {
|
|
224
|
+
t < 0 && (e === "min_disk" ? T((e) => ({
|
|
225
225
|
...e,
|
|
226
|
-
min_disk:
|
|
227
|
-
})) : e === "min_ram" &&
|
|
226
|
+
min_disk: d._({ id: "K3bUTE" })
|
|
227
|
+
})) : e === "min_ram" && T((e) => ({
|
|
228
228
|
...e,
|
|
229
|
-
min_ram:
|
|
229
|
+
min_ram: d._({ id: "PEGvy+" })
|
|
230
230
|
})));
|
|
231
|
-
},
|
|
231
|
+
}, I = (e) => {
|
|
232
232
|
let t = e.name.toLowerCase();
|
|
233
|
-
|
|
233
|
+
j.some((e) => t.endsWith(e)) ? (ne(e), C.file && T((e) => {
|
|
234
234
|
let t = { ...e };
|
|
235
235
|
return delete t.file, t;
|
|
236
|
-
})) :
|
|
236
|
+
})) : T((e) => ({
|
|
237
237
|
...e,
|
|
238
|
-
file:
|
|
238
|
+
file: d._({
|
|
239
239
|
id: "qzIZOL",
|
|
240
|
-
values: { supportedFileFormats:
|
|
240
|
+
values: { supportedFileFormats: ae }
|
|
241
241
|
})
|
|
242
242
|
}));
|
|
243
|
-
},
|
|
243
|
+
}, R = (e) => {
|
|
244
244
|
let t = e.target.files?.[0];
|
|
245
|
-
t &&
|
|
246
|
-
},
|
|
247
|
-
e.preventDefault(), e.stopPropagation(),
|
|
245
|
+
t && I(t);
|
|
246
|
+
}, z = (e) => {
|
|
247
|
+
e.preventDefault(), e.stopPropagation(), E(!0);
|
|
248
248
|
}, B = (e) => {
|
|
249
|
-
e.preventDefault(), e.stopPropagation(),
|
|
249
|
+
e.preventDefault(), e.stopPropagation(), E(!1);
|
|
250
250
|
}, ce = (e) => {
|
|
251
|
-
e.preventDefault(), e.stopPropagation(),
|
|
251
|
+
e.preventDefault(), e.stopPropagation(), E(!1);
|
|
252
252
|
let t = e.dataTransfer.files;
|
|
253
|
-
t && t.length > 0 &&
|
|
253
|
+
t && t.length > 0 && I(t[0]);
|
|
254
254
|
}, le = (e) => {
|
|
255
|
-
|
|
255
|
+
v(e.target.value);
|
|
256
256
|
}, V = () => {
|
|
257
|
-
let e =
|
|
257
|
+
let e = _.trim();
|
|
258
258
|
if (e !== "") {
|
|
259
|
-
if (
|
|
260
|
-
|
|
259
|
+
if (h.tags.includes(e)) {
|
|
260
|
+
v("");
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
|
|
263
|
+
g((t) => ({
|
|
264
264
|
...t,
|
|
265
265
|
tags: [...t.tags, e]
|
|
266
|
-
})),
|
|
266
|
+
})), v("");
|
|
267
267
|
}
|
|
268
268
|
}, H = (e) => {
|
|
269
269
|
e.key === "Enter" && (e.preventDefault(), V());
|
|
270
270
|
}, ue = (e) => {
|
|
271
|
-
|
|
271
|
+
g((t) => ({
|
|
272
272
|
...t,
|
|
273
273
|
tags: t.tags.filter((t) => t !== e)
|
|
274
274
|
}));
|
|
275
275
|
}, U = () => {
|
|
276
276
|
let e = {};
|
|
277
|
-
return (!
|
|
277
|
+
return (!h.name || h.name.trim() === "") && (e.name = d._({ id: "wyIOMP" })), b || (e.file = d._({ id: "aTqCTq" })), (!h.disk_format || h.disk_format.trim() === "") && (e.disk_format = d._({ id: "LK0pQN" })), (!h.container_format || h.container_format.trim() === "") && (e.container_format = d._({ id: "J4DKSM" })), h.disk_format && h.container_format && (Q(h.disk_format, h.container_format) || (e.container_format = d._({ id: "BgMp/T" }))), h.min_disk < 0 && (e.min_disk = d._({ id: "K3bUTE" })), h.min_ram < 0 && (e.min_ram = d._({ id: "PEGvy+" })), T(e), Object.keys(e).length === 0;
|
|
278
278
|
}, de = async (e) => {
|
|
279
|
-
if (e.preventDefault(),
|
|
280
|
-
|
|
279
|
+
if (e.preventDefault(), O(null), !U()) {
|
|
280
|
+
O(d._({ id: "CBFSfX" }));
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
283
|
try {
|
|
284
|
-
await
|
|
285
|
-
name:
|
|
286
|
-
tags:
|
|
287
|
-
visibility:
|
|
288
|
-
disk_format:
|
|
289
|
-
container_format:
|
|
290
|
-
protected:
|
|
291
|
-
min_disk:
|
|
292
|
-
min_ram:
|
|
293
|
-
},
|
|
284
|
+
await r({
|
|
285
|
+
name: h.name.trim(),
|
|
286
|
+
tags: h.tags,
|
|
287
|
+
visibility: h.visibility,
|
|
288
|
+
disk_format: h.disk_format,
|
|
289
|
+
container_format: h.container_format,
|
|
290
|
+
protected: h.protected,
|
|
291
|
+
min_disk: h.min_disk,
|
|
292
|
+
min_ram: h.min_ram
|
|
293
|
+
}, b), fe();
|
|
294
294
|
} catch (e) {
|
|
295
|
-
|
|
295
|
+
O(e instanceof Error ? e.message : d._({ id: "TQn3hH" }));
|
|
296
296
|
}
|
|
297
297
|
}, fe = () => {
|
|
298
|
-
|
|
298
|
+
g({ ...qe }), v(""), ne(null), T({}), O(null), n();
|
|
299
299
|
};
|
|
300
|
-
return /*#__PURE__*/ K(
|
|
301
|
-
open:
|
|
302
|
-
onCancel:
|
|
300
|
+
return /*#__PURE__*/ K(x, {
|
|
301
|
+
open: t,
|
|
302
|
+
onCancel: a ? void 0 : fe,
|
|
303
303
|
size: "large",
|
|
304
|
-
title:
|
|
304
|
+
title: d._({ id: "xw2UtT" }),
|
|
305
305
|
onConfirm: de,
|
|
306
|
-
confirmButtonLabel:
|
|
307
|
-
cancelButtonLabel:
|
|
308
|
-
disableConfirmButton:
|
|
309
|
-
closeable: !
|
|
310
|
-
closeOnEsc: !
|
|
306
|
+
confirmButtonLabel: d._({ id: "a/nTb8" }),
|
|
307
|
+
cancelButtonLabel: d._({ id: "dEgA5A" }),
|
|
308
|
+
disableConfirmButton: a || !k,
|
|
309
|
+
closeable: !a,
|
|
310
|
+
closeOnEsc: !a,
|
|
311
311
|
children: [
|
|
312
|
-
|
|
312
|
+
a && !s && /*#__PURE__*/ K(c, {
|
|
313
313
|
distribution: "center",
|
|
314
314
|
alignment: "center",
|
|
315
315
|
className: "mt-4",
|
|
316
316
|
children: [
|
|
317
|
-
/*#__PURE__*/ G(
|
|
318
|
-
!
|
|
319
|
-
|
|
317
|
+
/*#__PURE__*/ G(l, { variant: "primary" }),
|
|
318
|
+
!o && /*#__PURE__*/ G(X, { id: "98Fs4G" }),
|
|
319
|
+
o && /*#__PURE__*/ G(X, { id: "3q1GLx" })
|
|
320
320
|
]
|
|
321
321
|
}),
|
|
322
|
-
|
|
322
|
+
a && !!s && /*#__PURE__*/ G("div", {
|
|
323
323
|
className: "bg-neutral-quaternary mt-4 w-full rounded-full",
|
|
324
324
|
children: /*#__PURE__*/ K("div", {
|
|
325
325
|
className: "bg-theme-info flex h-4 items-center justify-center rounded-full p-0.5 text-center text-xs leading-none font-medium text-white",
|
|
326
|
-
style: { width: `${
|
|
327
|
-
children: [
|
|
326
|
+
style: { width: `${s}%` },
|
|
327
|
+
children: [s, "%"]
|
|
328
328
|
})
|
|
329
329
|
}),
|
|
330
|
-
!
|
|
330
|
+
!a && /*#__PURE__*/ K(f, {
|
|
331
331
|
className: "mb-6",
|
|
332
332
|
children: [
|
|
333
|
-
|
|
333
|
+
D && /*#__PURE__*/ G(e, {
|
|
334
334
|
variant: "error",
|
|
335
335
|
className: "mb-6",
|
|
336
|
-
children:
|
|
336
|
+
children: D
|
|
337
337
|
}),
|
|
338
|
-
/*#__PURE__*/ G(
|
|
338
|
+
/*#__PURE__*/ G(i, {
|
|
339
339
|
className: "mb-6",
|
|
340
|
-
children: /*#__PURE__*/ G(
|
|
340
|
+
children: /*#__PURE__*/ G(S, { children: /*#__PURE__*/ K("div", {
|
|
341
341
|
className: "w-full",
|
|
342
342
|
children: [
|
|
343
343
|
/*#__PURE__*/ K("label", {
|
|
344
344
|
htmlFor: "image-file",
|
|
345
345
|
className: "mb-2 block text-sm font-medium text-gray-900",
|
|
346
|
-
children: [
|
|
346
|
+
children: [d._({ id: "UKwOYH" }), /*#__PURE__*/ G("span", {
|
|
347
347
|
className: "ml-1 text-red-500",
|
|
348
348
|
children: "*"
|
|
349
349
|
})]
|
|
@@ -352,15 +352,15 @@ var qe = {
|
|
|
352
352
|
className: "flex w-full items-center justify-center",
|
|
353
353
|
children: /*#__PURE__*/ K("label", {
|
|
354
354
|
htmlFor: "image-file",
|
|
355
|
-
onDragOver:
|
|
355
|
+
onDragOver: z,
|
|
356
356
|
onDragLeave: B,
|
|
357
357
|
onDrop: ce,
|
|
358
|
-
className:
|
|
358
|
+
className: ie("flex h-24 w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed transition-all", re ? "border-blue-500 bg-blue-50" : "border-gray-300 bg-gray-50 hover:bg-gray-100"),
|
|
359
359
|
children: [/*#__PURE__*/ K("div", {
|
|
360
360
|
className: "flex flex-col items-center justify-center pt-3 pb-3",
|
|
361
361
|
children: [
|
|
362
362
|
/*#__PURE__*/ G("svg", {
|
|
363
|
-
className:
|
|
363
|
+
className: ie("mb-1 h-6 w-6 transition-colors", re ? "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,32 +374,32 @@ var qe = {
|
|
|
374
374
|
})
|
|
375
375
|
}),
|
|
376
376
|
/*#__PURE__*/ G("p", {
|
|
377
|
-
className:
|
|
378
|
-
children:
|
|
377
|
+
className: ie("text-xs transition-colors", re ? "font-semibold text-blue-600" : "text-gray-500"),
|
|
378
|
+
children: re ? /*#__PURE__*/ G("span", { children: d._({ id: "vXmL4D" }) }) : /*#__PURE__*/ K(W, { children: [
|
|
379
379
|
/*#__PURE__*/ G("span", {
|
|
380
380
|
className: "font-semibold",
|
|
381
|
-
children:
|
|
381
|
+
children: d._({ id: "gYe+hC" })
|
|
382
382
|
}),
|
|
383
383
|
" ",
|
|
384
|
-
|
|
384
|
+
d._({ id: "Np28ib" })
|
|
385
385
|
] })
|
|
386
386
|
}),
|
|
387
387
|
/*#__PURE__*/ G("p", {
|
|
388
388
|
className: "text-xs text-gray-400",
|
|
389
|
-
children:
|
|
389
|
+
children: d._({ id: "jBIkmi" })
|
|
390
390
|
})
|
|
391
391
|
]
|
|
392
392
|
}), /*#__PURE__*/ G("input", {
|
|
393
393
|
id: "image-file",
|
|
394
394
|
type: "file",
|
|
395
395
|
className: "hidden",
|
|
396
|
-
onChange:
|
|
397
|
-
accept:
|
|
398
|
-
disabled:
|
|
396
|
+
onChange: R,
|
|
397
|
+
accept: ae,
|
|
398
|
+
disabled: a
|
|
399
399
|
})]
|
|
400
400
|
})
|
|
401
401
|
}),
|
|
402
|
-
|
|
402
|
+
b && /*#__PURE__*/ K("div", {
|
|
403
403
|
className: "mt-2 flex items-center justify-between rounded-lg border border-green-200 bg-green-50 p-2 text-xs",
|
|
404
404
|
children: [/*#__PURE__*/ K("div", {
|
|
405
405
|
className: "flex items-center",
|
|
@@ -414,79 +414,79 @@ var qe = {
|
|
|
414
414
|
})
|
|
415
415
|
}), /*#__PURE__*/ G("span", {
|
|
416
416
|
className: "text-gray-700",
|
|
417
|
-
children:
|
|
417
|
+
children: b.name
|
|
418
418
|
})]
|
|
419
419
|
}), /*#__PURE__*/ G("button", {
|
|
420
420
|
type: "button",
|
|
421
421
|
onClick: () => {
|
|
422
|
-
|
|
422
|
+
ne(null), C.file && T((e) => {
|
|
423
423
|
let t = { ...e };
|
|
424
424
|
return delete t.file, t;
|
|
425
425
|
});
|
|
426
426
|
},
|
|
427
427
|
className: "font-medium text-red-600 hover:text-red-800",
|
|
428
|
-
disabled:
|
|
429
|
-
children:
|
|
428
|
+
disabled: a,
|
|
429
|
+
children: d._({ id: "t/YqKh" })
|
|
430
430
|
})]
|
|
431
431
|
}),
|
|
432
|
-
|
|
432
|
+
C.file && /*#__PURE__*/ G("p", {
|
|
433
433
|
className: "text-theme-error mt-1 text-xs text-red-600",
|
|
434
|
-
children:
|
|
434
|
+
children: C.file
|
|
435
435
|
})
|
|
436
436
|
]
|
|
437
437
|
}) })
|
|
438
438
|
}),
|
|
439
|
-
/*#__PURE__*/ K(
|
|
439
|
+
/*#__PURE__*/ K(i, {
|
|
440
440
|
className: "mb-6",
|
|
441
441
|
children: [
|
|
442
|
-
/*#__PURE__*/ G(
|
|
442
|
+
/*#__PURE__*/ G(S, {
|
|
443
443
|
className: "mb-6",
|
|
444
|
-
children: /*#__PURE__*/ G(
|
|
444
|
+
children: /*#__PURE__*/ G(u, {
|
|
445
445
|
id: "name",
|
|
446
446
|
name: "name",
|
|
447
|
-
label:
|
|
448
|
-
value:
|
|
449
|
-
onChange:
|
|
450
|
-
onBlur:
|
|
447
|
+
label: d._({ id: "ExLULX" }),
|
|
448
|
+
value: h.name,
|
|
449
|
+
onChange: oe,
|
|
450
|
+
onBlur: se,
|
|
451
451
|
required: !0,
|
|
452
|
-
errortext:
|
|
453
|
-
placeholder:
|
|
454
|
-
disabled:
|
|
452
|
+
errortext: C.name,
|
|
453
|
+
placeholder: d._({ id: "PsEGri" }),
|
|
454
|
+
disabled: a
|
|
455
455
|
})
|
|
456
456
|
}),
|
|
457
|
-
/*#__PURE__*/ G(
|
|
457
|
+
/*#__PURE__*/ G(S, {
|
|
458
458
|
className: "mb-6",
|
|
459
459
|
children: /*#__PURE__*/ K("div", {
|
|
460
460
|
className: "w-full",
|
|
461
|
-
children: [/*#__PURE__*/ K(
|
|
461
|
+
children: [/*#__PURE__*/ K(c, {
|
|
462
462
|
gap: "1",
|
|
463
463
|
direction: "horizontal",
|
|
464
464
|
alignment: "start",
|
|
465
465
|
children: [/*#__PURE__*/ G("div", {
|
|
466
466
|
className: "flex-1",
|
|
467
|
-
children: /*#__PURE__*/ G(
|
|
467
|
+
children: /*#__PURE__*/ G(u, {
|
|
468
468
|
id: "tags",
|
|
469
469
|
name: "tags",
|
|
470
|
-
label:
|
|
471
|
-
value:
|
|
470
|
+
label: d._({ id: "OYHzN1" }),
|
|
471
|
+
value: _,
|
|
472
472
|
onChange: le,
|
|
473
473
|
onKeyDown: H,
|
|
474
|
-
helptext:
|
|
475
|
-
placeholder:
|
|
476
|
-
disabled:
|
|
474
|
+
helptext: d._({ id: "AN0DBJ" }),
|
|
475
|
+
placeholder: d._({ id: "tmpGvt" }),
|
|
476
|
+
disabled: a
|
|
477
477
|
})
|
|
478
478
|
}), /*#__PURE__*/ G(m, {
|
|
479
479
|
variant: "primary",
|
|
480
480
|
onClick: V,
|
|
481
|
-
disabled:
|
|
481
|
+
disabled: a || _.trim() === "",
|
|
482
482
|
children: /*#__PURE__*/ G(X, { id: "m16xKo" })
|
|
483
483
|
})]
|
|
484
|
-
}),
|
|
484
|
+
}), h.tags.length > 0 && /*#__PURE__*/ G(c, {
|
|
485
485
|
gap: "1",
|
|
486
486
|
wrap: !0,
|
|
487
487
|
alignment: "center",
|
|
488
488
|
className: "mt-1",
|
|
489
|
-
children:
|
|
489
|
+
children: h.tags.map((e) => /*#__PURE__*/ G(ee, {
|
|
490
490
|
closeable: !0,
|
|
491
491
|
pillKey: "",
|
|
492
492
|
pillValue: e,
|
|
@@ -495,115 +495,115 @@ var qe = {
|
|
|
495
495
|
})]
|
|
496
496
|
})
|
|
497
497
|
}),
|
|
498
|
-
/*#__PURE__*/ G(
|
|
498
|
+
/*#__PURE__*/ G(S, {
|
|
499
499
|
className: "mb-6",
|
|
500
|
-
children: /*#__PURE__*/ K(
|
|
500
|
+
children: /*#__PURE__*/ K(y, {
|
|
501
501
|
id: "visibility",
|
|
502
502
|
name: "visibility",
|
|
503
|
-
label:
|
|
504
|
-
value:
|
|
505
|
-
onChange: (e) =>
|
|
506
|
-
disabled:
|
|
507
|
-
loading:
|
|
503
|
+
label: d._({ id: "2q/Q7x" }),
|
|
504
|
+
value: h.visibility,
|
|
505
|
+
onChange: (e) => M("visibility", e),
|
|
506
|
+
disabled: a,
|
|
507
|
+
loading: a,
|
|
508
508
|
children: [
|
|
509
|
-
/*#__PURE__*/ G(
|
|
510
|
-
value:
|
|
511
|
-
label:
|
|
509
|
+
/*#__PURE__*/ G(w, {
|
|
510
|
+
value: L.PUBLIC,
|
|
511
|
+
label: d._({ id: "7d1a0d" })
|
|
512
512
|
}),
|
|
513
|
-
/*#__PURE__*/ G(
|
|
514
|
-
value:
|
|
515
|
-
label:
|
|
513
|
+
/*#__PURE__*/ G(w, {
|
|
514
|
+
value: L.PRIVATE,
|
|
515
|
+
label: d._({ id: "zwBp5t" })
|
|
516
516
|
}),
|
|
517
|
-
/*#__PURE__*/ G(
|
|
518
|
-
value:
|
|
519
|
-
label:
|
|
517
|
+
/*#__PURE__*/ G(w, {
|
|
518
|
+
value: L.SHARED,
|
|
519
|
+
label: d._({ id: "0Gd0NU" })
|
|
520
520
|
}),
|
|
521
|
-
/*#__PURE__*/ G(
|
|
522
|
-
value:
|
|
523
|
-
label:
|
|
521
|
+
/*#__PURE__*/ G(w, {
|
|
522
|
+
value: L.COMMUNITY,
|
|
523
|
+
label: d._({ id: "chL5IG" })
|
|
524
524
|
})
|
|
525
525
|
]
|
|
526
526
|
})
|
|
527
527
|
}),
|
|
528
|
-
/*#__PURE__*/ G(
|
|
528
|
+
/*#__PURE__*/ G(S, {
|
|
529
529
|
className: "mb-6",
|
|
530
|
-
children: /*#__PURE__*/ K(
|
|
530
|
+
children: /*#__PURE__*/ K(c, {
|
|
531
531
|
direction: "horizontal",
|
|
532
532
|
gap: "3",
|
|
533
533
|
distribution: "evenly",
|
|
534
534
|
className: "w-full",
|
|
535
535
|
children: [/*#__PURE__*/ G("div", {
|
|
536
536
|
className: "flex-1",
|
|
537
|
-
children: /*#__PURE__*/ K(
|
|
537
|
+
children: /*#__PURE__*/ K(y, {
|
|
538
538
|
id: "disk_format",
|
|
539
539
|
name: "disk_format",
|
|
540
|
-
label:
|
|
541
|
-
value:
|
|
542
|
-
onChange: (e) =>
|
|
543
|
-
disabled:
|
|
544
|
-
loading:
|
|
540
|
+
label: d._({ id: "NopYGU" }),
|
|
541
|
+
value: h.disk_format,
|
|
542
|
+
onChange: (e) => M("disk_format", e),
|
|
543
|
+
disabled: a,
|
|
544
|
+
loading: a,
|
|
545
545
|
required: !0,
|
|
546
|
-
errortext:
|
|
546
|
+
errortext: C.disk_format,
|
|
547
547
|
children: [
|
|
548
|
-
/*#__PURE__*/ G(
|
|
549
|
-
value:
|
|
548
|
+
/*#__PURE__*/ G(w, {
|
|
549
|
+
value: P.QCOW2,
|
|
550
550
|
label: "QCOW2 - QEMU Emulator"
|
|
551
551
|
}),
|
|
552
|
-
/*#__PURE__*/ G(
|
|
553
|
-
value:
|
|
552
|
+
/*#__PURE__*/ G(w, {
|
|
553
|
+
value: P.RAW,
|
|
554
554
|
label: "Raw"
|
|
555
555
|
}),
|
|
556
|
-
/*#__PURE__*/ G(
|
|
557
|
-
value:
|
|
556
|
+
/*#__PURE__*/ G(w, {
|
|
557
|
+
value: P.VMDK,
|
|
558
558
|
label: "VMDK - Virtual Machine Disk"
|
|
559
559
|
}),
|
|
560
|
-
/*#__PURE__*/ G(
|
|
561
|
-
value:
|
|
560
|
+
/*#__PURE__*/ G(w, {
|
|
561
|
+
value: P.VHD,
|
|
562
562
|
label: "VHD - Virtual Hard Disk"
|
|
563
563
|
}),
|
|
564
|
-
/*#__PURE__*/ G(
|
|
565
|
-
value:
|
|
564
|
+
/*#__PURE__*/ G(w, {
|
|
565
|
+
value: P.VHDX,
|
|
566
566
|
label: "VHDX - Virtual Hard Disk Extended"
|
|
567
567
|
}),
|
|
568
|
-
/*#__PURE__*/ G(
|
|
569
|
-
value:
|
|
568
|
+
/*#__PURE__*/ G(w, {
|
|
569
|
+
value: P.VDI,
|
|
570
570
|
label: "VDI - Virtual Disk Image"
|
|
571
571
|
}),
|
|
572
|
-
/*#__PURE__*/ G(
|
|
573
|
-
value:
|
|
572
|
+
/*#__PURE__*/ G(w, {
|
|
573
|
+
value: P.AMI,
|
|
574
574
|
label: "AMI - Amazon Machine Image"
|
|
575
575
|
}),
|
|
576
|
-
/*#__PURE__*/ G(
|
|
577
|
-
value:
|
|
576
|
+
/*#__PURE__*/ G(w, {
|
|
577
|
+
value: P.ARI,
|
|
578
578
|
label: "ARI - Amazon Ramdisk Image"
|
|
579
579
|
}),
|
|
580
|
-
/*#__PURE__*/ G(
|
|
581
|
-
value:
|
|
580
|
+
/*#__PURE__*/ G(w, {
|
|
581
|
+
value: P.AKI,
|
|
582
582
|
label: "AKI - Amazon Kernel Image"
|
|
583
583
|
}),
|
|
584
|
-
/*#__PURE__*/ G(
|
|
585
|
-
value:
|
|
584
|
+
/*#__PURE__*/ G(w, {
|
|
585
|
+
value: P.ISO,
|
|
586
586
|
label: "ISO - Optical Disk Image"
|
|
587
587
|
}),
|
|
588
|
-
/*#__PURE__*/ G(
|
|
589
|
-
value:
|
|
588
|
+
/*#__PURE__*/ G(w, {
|
|
589
|
+
value: P.PLOOP,
|
|
590
590
|
label: "PLOOP - Virtuozzo/Parallels Loopback Disk"
|
|
591
591
|
})
|
|
592
592
|
]
|
|
593
593
|
})
|
|
594
594
|
}), /*#__PURE__*/ G("div", {
|
|
595
595
|
className: "flex-1",
|
|
596
|
-
children: /*#__PURE__*/ G(
|
|
596
|
+
children: /*#__PURE__*/ G(y, {
|
|
597
597
|
id: "container_format",
|
|
598
598
|
name: "container_format",
|
|
599
|
-
label:
|
|
600
|
-
value:
|
|
601
|
-
onChange: (e) =>
|
|
602
|
-
disabled:
|
|
599
|
+
label: d._({ id: "6/xipy" }),
|
|
600
|
+
value: h.container_format,
|
|
601
|
+
onChange: (e) => M("container_format", e),
|
|
602
|
+
disabled: a || !h.disk_format || !A.length,
|
|
603
603
|
required: !0,
|
|
604
|
-
errortext:
|
|
605
|
-
helptext: !
|
|
606
|
-
children:
|
|
604
|
+
errortext: C.container_format,
|
|
605
|
+
helptext: !A.length && d._({ id: "A7CVME" }),
|
|
606
|
+
children: A.map((e) => /*#__PURE__*/ G(w, {
|
|
607
607
|
value: e,
|
|
608
608
|
label: e.toUpperCase()
|
|
609
609
|
}, e))
|
|
@@ -611,56 +611,56 @@ var qe = {
|
|
|
611
611
|
})]
|
|
612
612
|
})
|
|
613
613
|
}),
|
|
614
|
-
/*#__PURE__*/ G(
|
|
614
|
+
/*#__PURE__*/ G(S, {
|
|
615
615
|
className: "mb-0",
|
|
616
616
|
children: /*#__PURE__*/ G(te, {
|
|
617
617
|
id: "protected",
|
|
618
618
|
name: "protected",
|
|
619
|
-
label:
|
|
620
|
-
checked:
|
|
621
|
-
onChange:
|
|
622
|
-
helptext:
|
|
623
|
-
disabled:
|
|
619
|
+
label: d._({ id: "644xgx" }),
|
|
620
|
+
checked: h.protected,
|
|
621
|
+
onChange: oe,
|
|
622
|
+
helptext: d._({ id: "aV6KPH" }),
|
|
623
|
+
disabled: a
|
|
624
624
|
})
|
|
625
625
|
})
|
|
626
626
|
]
|
|
627
627
|
}),
|
|
628
|
-
/*#__PURE__*/ G(
|
|
628
|
+
/*#__PURE__*/ G(i, {
|
|
629
629
|
className: "mb-6",
|
|
630
|
-
children: /*#__PURE__*/ G(
|
|
630
|
+
children: /*#__PURE__*/ G(S, {
|
|
631
631
|
className: "mb-0",
|
|
632
|
-
children: /*#__PURE__*/ K(
|
|
632
|
+
children: /*#__PURE__*/ K(c, {
|
|
633
633
|
direction: "horizontal",
|
|
634
634
|
gap: "3",
|
|
635
635
|
distribution: "evenly",
|
|
636
636
|
className: "w-full",
|
|
637
637
|
children: [/*#__PURE__*/ G("div", {
|
|
638
638
|
className: "flex-1",
|
|
639
|
-
children: /*#__PURE__*/ G(
|
|
639
|
+
children: /*#__PURE__*/ G(u, {
|
|
640
640
|
id: "min_disk",
|
|
641
641
|
name: "min_disk",
|
|
642
|
-
label:
|
|
642
|
+
label: d._({ id: "NixRmA" }),
|
|
643
643
|
type: "number",
|
|
644
|
-
value: String(
|
|
645
|
-
onChange: (e) =>
|
|
646
|
-
onBlur: () =>
|
|
647
|
-
helptext:
|
|
648
|
-
errortext:
|
|
649
|
-
disabled:
|
|
644
|
+
value: String(h.min_disk),
|
|
645
|
+
onChange: (e) => N("min_disk", e.target.value),
|
|
646
|
+
onBlur: () => F("min_disk", h.min_disk),
|
|
647
|
+
helptext: d._({ id: "4fh0Wj" }),
|
|
648
|
+
errortext: C.min_disk,
|
|
649
|
+
disabled: a
|
|
650
650
|
})
|
|
651
651
|
}), /*#__PURE__*/ G("div", {
|
|
652
652
|
className: "flex-1",
|
|
653
|
-
children: /*#__PURE__*/ G(
|
|
653
|
+
children: /*#__PURE__*/ G(u, {
|
|
654
654
|
id: "min_ram",
|
|
655
655
|
name: "min_ram",
|
|
656
|
-
label:
|
|
656
|
+
label: d._({ id: "CgZxr7" }),
|
|
657
657
|
type: "number",
|
|
658
|
-
value: String(
|
|
659
|
-
onChange: (e) =>
|
|
660
|
-
onBlur: () =>
|
|
661
|
-
helptext:
|
|
662
|
-
errortext:
|
|
663
|
-
disabled:
|
|
658
|
+
value: String(h.min_ram),
|
|
659
|
+
onChange: (e) => N("min_ram", e.target.value),
|
|
660
|
+
onBlur: () => F("min_ram", h.min_ram),
|
|
661
|
+
helptext: d._({ id: "KsIM0b" }),
|
|
662
|
+
errortext: C.min_ram,
|
|
663
|
+
disabled: a
|
|
664
664
|
})
|
|
665
665
|
})]
|
|
666
666
|
})
|
|
@@ -671,15 +671,15 @@ var qe = {
|
|
|
671
671
|
]
|
|
672
672
|
});
|
|
673
673
|
}, Ye = ({ deletableImages: t, protectedImages: n, isOpen: r, isLoading: i, onClose: a, onDelete: o }) => {
|
|
674
|
-
let { i18n:
|
|
675
|
-
return /*#__PURE__*/ K(
|
|
674
|
+
let { i18n: s, _: u } = Z(), d = t.length, f = n.length;
|
|
675
|
+
return /*#__PURE__*/ K(x, {
|
|
676
676
|
onCancel: a,
|
|
677
677
|
size: "small",
|
|
678
|
-
title:
|
|
678
|
+
title: s._({ id: "JtHgVz" }),
|
|
679
679
|
open: r,
|
|
680
|
-
modalFooter: /*#__PURE__*/ G(
|
|
680
|
+
modalFooter: /*#__PURE__*/ G(h, {
|
|
681
681
|
className: "flex justify-end",
|
|
682
|
-
children: /*#__PURE__*/ K(
|
|
682
|
+
children: /*#__PURE__*/ K(g, { children: [/*#__PURE__*/ G(m, {
|
|
683
683
|
variant: "default",
|
|
684
684
|
onClick: a,
|
|
685
685
|
children: /*#__PURE__*/ G(X, { id: "dEgA5A" })
|
|
@@ -693,17 +693,17 @@ var qe = {
|
|
|
693
693
|
children: /*#__PURE__*/ G(X, { id: "cnGeoo" })
|
|
694
694
|
})] })
|
|
695
695
|
}),
|
|
696
|
-
children: [i && /*#__PURE__*/ G(
|
|
696
|
+
children: [i && /*#__PURE__*/ G(c, {
|
|
697
697
|
distribution: "center",
|
|
698
698
|
alignment: "center",
|
|
699
|
-
children: /*#__PURE__*/ G(
|
|
699
|
+
children: /*#__PURE__*/ G(l, { variant: "primary" })
|
|
700
700
|
}), !i && /*#__PURE__*/ K("div", {
|
|
701
701
|
className: "my-6",
|
|
702
702
|
children: [
|
|
703
|
-
|
|
704
|
-
text:
|
|
703
|
+
d > 0 && /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ G(e, {
|
|
704
|
+
text: s._({
|
|
705
705
|
id: "Dh1qvV",
|
|
706
|
-
values: { deletableCount:
|
|
706
|
+
values: { deletableCount: d }
|
|
707
707
|
}),
|
|
708
708
|
variant: "danger",
|
|
709
709
|
className: "mb-6"
|
|
@@ -713,7 +713,7 @@ var qe = {
|
|
|
713
713
|
className: "jn:text-theme-high mb-3 font-semibold",
|
|
714
714
|
children: /*#__PURE__*/ G(X, {
|
|
715
715
|
id: "rwBVXS",
|
|
716
|
-
values: { deletableCount:
|
|
716
|
+
values: { deletableCount: d }
|
|
717
717
|
})
|
|
718
718
|
}), /*#__PURE__*/ G("div", {
|
|
719
719
|
className: "jn:bg-theme-background-lvl-1 max-h-24 overflow-y-auto rounded p-4",
|
|
@@ -726,7 +726,7 @@ var qe = {
|
|
|
726
726
|
})
|
|
727
727
|
})]
|
|
728
728
|
})] }),
|
|
729
|
-
|
|
729
|
+
f > 0 && /*#__PURE__*/ K("div", {
|
|
730
730
|
className: "mb-6",
|
|
731
731
|
children: [/*#__PURE__*/ G("h3", {
|
|
732
732
|
className: "jn:text-theme-high mb-3 font-semibold",
|
|
@@ -744,23 +744,23 @@ var qe = {
|
|
|
744
744
|
}),
|
|
745
745
|
/*#__PURE__*/ K("div", {
|
|
746
746
|
className: "jn:bg-theme-background-lvl-2 mb-6 rounded p-4",
|
|
747
|
-
children: [
|
|
747
|
+
children: [d > 0 && /*#__PURE__*/ K("div", {
|
|
748
748
|
className: "mb-2 flex justify-between",
|
|
749
749
|
children: [/*#__PURE__*/ G("span", {
|
|
750
750
|
className: "jn:text-theme-default",
|
|
751
751
|
children: /*#__PURE__*/ G(X, { id: "MJtNLd" })
|
|
752
752
|
}), /*#__PURE__*/ G("span", {
|
|
753
753
|
className: "jn:text-theme-highest font-semibold",
|
|
754
|
-
children:
|
|
754
|
+
children: d
|
|
755
755
|
})]
|
|
756
|
-
}),
|
|
756
|
+
}), f > 0 && /*#__PURE__*/ K("div", {
|
|
757
757
|
className: "flex justify-between",
|
|
758
758
|
children: [/*#__PURE__*/ G("span", {
|
|
759
759
|
className: "jn:text-theme-default",
|
|
760
760
|
children: /*#__PURE__*/ G(X, { id: "QxBGbh" })
|
|
761
761
|
}), /*#__PURE__*/ G("span", {
|
|
762
762
|
className: "jn:text-theme-warning font-semibold",
|
|
763
|
-
children:
|
|
763
|
+
children: f
|
|
764
764
|
})]
|
|
765
765
|
})]
|
|
766
766
|
})
|
|
@@ -768,32 +768,32 @@ var qe = {
|
|
|
768
768
|
})]
|
|
769
769
|
});
|
|
770
770
|
}, Xe = ({ activeImages: e, deactivatedImages: t, isOpen: n, isLoading: r, onClose: i, onDeactivate: a }) => {
|
|
771
|
-
let { i18n: o, _:
|
|
771
|
+
let { i18n: o, _: s } = Z(), u = e.length, d = t.length, f = (t) => {
|
|
772
772
|
t.preventDefault(), a(e);
|
|
773
773
|
};
|
|
774
|
-
return /*#__PURE__*/ K(
|
|
774
|
+
return /*#__PURE__*/ K(x, {
|
|
775
775
|
onCancel: i,
|
|
776
776
|
size: "small",
|
|
777
777
|
title: o._({ id: "+9CXS9" }),
|
|
778
778
|
open: n,
|
|
779
779
|
onConfirm: (e) => {
|
|
780
|
-
|
|
780
|
+
f(e), i();
|
|
781
781
|
},
|
|
782
782
|
confirmButtonLabel: o._({ id: "5y3O+A" }),
|
|
783
783
|
cancelButtonLabel: o._({ id: "dEgA5A" }),
|
|
784
784
|
disableConfirmButton: r,
|
|
785
|
-
children: [r && /*#__PURE__*/ G(
|
|
785
|
+
children: [r && /*#__PURE__*/ G(c, {
|
|
786
786
|
distribution: "center",
|
|
787
787
|
alignment: "center",
|
|
788
|
-
children: /*#__PURE__*/ G(
|
|
788
|
+
children: /*#__PURE__*/ G(l, { variant: "primary" })
|
|
789
789
|
}), !r && /*#__PURE__*/ K("div", {
|
|
790
790
|
className: "my-6",
|
|
791
791
|
children: [
|
|
792
|
-
|
|
792
|
+
u > 0 && /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ G("p", {
|
|
793
793
|
className: "mb-6",
|
|
794
794
|
children: /*#__PURE__*/ G(X, {
|
|
795
795
|
id: "zm7+/D",
|
|
796
|
-
values: { activeCount:
|
|
796
|
+
values: { activeCount: u },
|
|
797
797
|
components: { 0: /*#__PURE__*/ G("strong", {}) }
|
|
798
798
|
})
|
|
799
799
|
}), /*#__PURE__*/ K("div", {
|
|
@@ -802,7 +802,7 @@ var qe = {
|
|
|
802
802
|
className: "jn:text-theme-high mb-3 font-semibold",
|
|
803
803
|
children: /*#__PURE__*/ G(X, {
|
|
804
804
|
id: "ryxYVo",
|
|
805
|
-
values: { activeCount:
|
|
805
|
+
values: { activeCount: u }
|
|
806
806
|
})
|
|
807
807
|
}), /*#__PURE__*/ G("div", {
|
|
808
808
|
className: "jn:bg-theme-background-lvl-1 max-h-24 overflow-y-auto rounded p-4",
|
|
@@ -815,7 +815,7 @@ var qe = {
|
|
|
815
815
|
})
|
|
816
816
|
})]
|
|
817
817
|
})] }),
|
|
818
|
-
|
|
818
|
+
d > 0 && /*#__PURE__*/ K("div", {
|
|
819
819
|
className: "mb-6",
|
|
820
820
|
children: [/*#__PURE__*/ G("h3", {
|
|
821
821
|
className: "jn:text-theme-high mb-3 font-semibold",
|
|
@@ -833,23 +833,23 @@ var qe = {
|
|
|
833
833
|
}),
|
|
834
834
|
/*#__PURE__*/ K("div", {
|
|
835
835
|
className: "jn:bg-theme-background-lvl-2 mb-6 rounded p-4",
|
|
836
|
-
children: [
|
|
836
|
+
children: [u > 0 && /*#__PURE__*/ K("div", {
|
|
837
837
|
className: "mb-2 flex justify-between",
|
|
838
838
|
children: [/*#__PURE__*/ G("span", {
|
|
839
839
|
className: "jn:text-theme-default",
|
|
840
840
|
children: /*#__PURE__*/ G(X, { id: "rD9yV1" })
|
|
841
841
|
}), /*#__PURE__*/ G("span", {
|
|
842
842
|
className: "jn:text-theme-highest font-semibold",
|
|
843
|
-
children:
|
|
843
|
+
children: u
|
|
844
844
|
})]
|
|
845
|
-
}),
|
|
845
|
+
}), d > 0 && /*#__PURE__*/ K("div", {
|
|
846
846
|
className: "flex justify-between",
|
|
847
847
|
children: [/*#__PURE__*/ G("span", {
|
|
848
848
|
className: "jn:text-theme-default",
|
|
849
849
|
children: /*#__PURE__*/ G(X, { id: "NH2fsP" })
|
|
850
850
|
}), /*#__PURE__*/ G("span", {
|
|
851
851
|
className: "jn:text-theme-warning font-semibold",
|
|
852
|
-
children:
|
|
852
|
+
children: d
|
|
853
853
|
})]
|
|
854
854
|
})]
|
|
855
855
|
})
|
|
@@ -857,8 +857,8 @@ var qe = {
|
|
|
857
857
|
})]
|
|
858
858
|
});
|
|
859
859
|
}, Ze = ({ deactivatedImages: e, activeImages: t, isOpen: n, isLoading: r, onClose: i, onActivate: a }) => {
|
|
860
|
-
let { i18n: o, _:
|
|
861
|
-
return /*#__PURE__*/ K(
|
|
860
|
+
let { i18n: o, _: s } = Z(), u = e.length, d = t.length;
|
|
861
|
+
return /*#__PURE__*/ K(x, {
|
|
862
862
|
onCancel: i,
|
|
863
863
|
size: "small",
|
|
864
864
|
title: o._({ id: "UdcGJu" }),
|
|
@@ -869,18 +869,18 @@ var qe = {
|
|
|
869
869
|
confirmButtonLabel: o._({ id: "FQBaXG" }),
|
|
870
870
|
cancelButtonLabel: o._({ id: "dEgA5A" }),
|
|
871
871
|
disableConfirmButton: r,
|
|
872
|
-
children: [r && /*#__PURE__*/ G(
|
|
872
|
+
children: [r && /*#__PURE__*/ G(c, {
|
|
873
873
|
distribution: "center",
|
|
874
874
|
alignment: "center",
|
|
875
|
-
children: /*#__PURE__*/ G(
|
|
875
|
+
children: /*#__PURE__*/ G(l, { variant: "primary" })
|
|
876
876
|
}), !r && /*#__PURE__*/ K("div", {
|
|
877
877
|
className: "my-6",
|
|
878
878
|
children: [
|
|
879
|
-
|
|
879
|
+
u > 0 && /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ G("p", {
|
|
880
880
|
className: "mb-6",
|
|
881
881
|
children: /*#__PURE__*/ G(X, {
|
|
882
882
|
id: "MgZyuJ",
|
|
883
|
-
values: { deactivatedCount:
|
|
883
|
+
values: { deactivatedCount: u },
|
|
884
884
|
components: { 0: /*#__PURE__*/ G("strong", {}) }
|
|
885
885
|
})
|
|
886
886
|
}), /*#__PURE__*/ K("div", {
|
|
@@ -889,7 +889,7 @@ var qe = {
|
|
|
889
889
|
className: "jn:text-theme-high mb-3 font-semibold",
|
|
890
890
|
children: /*#__PURE__*/ G(X, {
|
|
891
891
|
id: "shKIZu",
|
|
892
|
-
values: { deactivatedCount:
|
|
892
|
+
values: { deactivatedCount: u }
|
|
893
893
|
})
|
|
894
894
|
}), /*#__PURE__*/ G("div", {
|
|
895
895
|
className: "jn:bg-theme-background-lvl-1 max-h-24 overflow-y-auto rounded p-4",
|
|
@@ -902,7 +902,7 @@ var qe = {
|
|
|
902
902
|
})
|
|
903
903
|
})]
|
|
904
904
|
})] }),
|
|
905
|
-
|
|
905
|
+
d > 0 && /*#__PURE__*/ K("div", {
|
|
906
906
|
className: "mb-6",
|
|
907
907
|
children: [/*#__PURE__*/ G("h3", {
|
|
908
908
|
className: "jn:text-theme-high mb-3 font-semibold",
|
|
@@ -920,100 +920,100 @@ var qe = {
|
|
|
920
920
|
}),
|
|
921
921
|
/*#__PURE__*/ K("div", {
|
|
922
922
|
className: "jn:bg-theme-background-lvl-2 mb-6 rounded p-4",
|
|
923
|
-
children: [
|
|
923
|
+
children: [u > 0 && /*#__PURE__*/ K("div", {
|
|
924
924
|
className: "mb-2 flex justify-between",
|
|
925
925
|
children: [/*#__PURE__*/ G("span", {
|
|
926
926
|
className: "jn:text-theme-default",
|
|
927
927
|
children: /*#__PURE__*/ G(X, { id: "4fvDRe" })
|
|
928
928
|
}), /*#__PURE__*/ G("span", {
|
|
929
929
|
className: "jn:text-theme-highest font-semibold",
|
|
930
|
-
children:
|
|
930
|
+
children: u
|
|
931
931
|
})]
|
|
932
|
-
}),
|
|
932
|
+
}), d > 0 && /*#__PURE__*/ K("div", {
|
|
933
933
|
className: "flex justify-between",
|
|
934
934
|
children: [/*#__PURE__*/ G("span", {
|
|
935
935
|
className: "jn:text-theme-default",
|
|
936
936
|
children: /*#__PURE__*/ G(X, { id: "x5l/TK" })
|
|
937
937
|
}), /*#__PURE__*/ G("span", {
|
|
938
938
|
className: "jn:text-theme-warning font-semibold",
|
|
939
|
-
children:
|
|
939
|
+
children: d
|
|
940
940
|
})]
|
|
941
941
|
})]
|
|
942
942
|
})
|
|
943
943
|
]
|
|
944
944
|
})]
|
|
945
945
|
});
|
|
946
|
-
}, Qe = ({ isOpen:
|
|
947
|
-
let { i18n:
|
|
948
|
-
project_id:
|
|
949
|
-
imageId:
|
|
950
|
-
}, { enabled:
|
|
951
|
-
|
|
946
|
+
}, Qe = ({ isOpen: t, onClose: n, image: r, permissions: { canCreateMember: i, canDeleteMember: a } }) => {
|
|
947
|
+
let { i18n: o, _: s } = Z(), c = Oe(), [l, u] = q(null), [d, f] = q(!1), { data: p, isLoading: m } = D.compute.listImageMembers.useQuery({
|
|
948
|
+
project_id: c,
|
|
949
|
+
imageId: r?.id || ""
|
|
950
|
+
}, { enabled: t && !!r?.id }), h = () => {
|
|
951
|
+
u(null), f(!1), n();
|
|
952
952
|
};
|
|
953
|
-
if (!
|
|
954
|
-
let
|
|
955
|
-
return /*#__PURE__*/ G(
|
|
956
|
-
onCancel:
|
|
957
|
-
title:
|
|
953
|
+
if (!t || !r) return null;
|
|
954
|
+
let g = r.name || r.id;
|
|
955
|
+
return /*#__PURE__*/ G(x, {
|
|
956
|
+
onCancel: h,
|
|
957
|
+
title: o._({
|
|
958
958
|
id: "UQ7Wyv",
|
|
959
|
-
values: { imageName:
|
|
959
|
+
values: { imageName: g }
|
|
960
960
|
}),
|
|
961
|
-
open:
|
|
961
|
+
open: t,
|
|
962
962
|
size: "xl",
|
|
963
|
-
children: /*#__PURE__*/ K("div", { children: [
|
|
964
|
-
onDismiss: () =>
|
|
965
|
-
text:
|
|
966
|
-
variant:
|
|
963
|
+
children: /*#__PURE__*/ K("div", { children: [l && /*#__PURE__*/ G(e, {
|
|
964
|
+
onDismiss: () => u(null),
|
|
965
|
+
text: l.text,
|
|
966
|
+
variant: l.type,
|
|
967
967
|
className: "mb-4"
|
|
968
|
-
}), /*#__PURE__*/ G(
|
|
969
|
-
projectId:
|
|
970
|
-
image:
|
|
971
|
-
imageMembers:
|
|
972
|
-
isMembersLoading:
|
|
973
|
-
canAdd:
|
|
974
|
-
canRemove:
|
|
975
|
-
isAddingMember:
|
|
976
|
-
setIsAddingMember:
|
|
977
|
-
setMessage:
|
|
968
|
+
}), /*#__PURE__*/ G(j, {
|
|
969
|
+
projectId: c,
|
|
970
|
+
image: r,
|
|
971
|
+
imageMembers: p,
|
|
972
|
+
isMembersLoading: m,
|
|
973
|
+
canAdd: i,
|
|
974
|
+
canRemove: a,
|
|
975
|
+
isAddingMember: d,
|
|
976
|
+
setIsAddingMember: f,
|
|
977
|
+
setMessage: u
|
|
978
978
|
})] })
|
|
979
979
|
});
|
|
980
980
|
};
|
|
981
981
|
//#endregion
|
|
982
982
|
//#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageListView.tsx
|
|
983
|
-
function $e({ images: e, suggestedImages: t, acceptedImages:
|
|
984
|
-
let
|
|
983
|
+
function $e({ images: e, suggestedImages: t, acceptedImages: i, permissions: o, isFetching: s, currentPage: u = 1, totalPages: d = 1, onPageChange: f, children: p, selectedImages: m, setSelectedImages: h, deleteAllModalOpen: g, setDeleteAllModalOpen: _, deactivateAllModalOpen: ee, setDeactivateAllModalOpen: y, activateAllModalOpen: b, setActivateAllModalOpen: x, createModalOpen: S, setCreateModalOpen: C, deletableImages: w, protectedImages: ie, activeImages: O, deactivatedImages: k, onImageUpdated: A, onImageDeleted: j, onMemberStatusChanged: M, hasAnyBulkAction: N }) {
|
|
984
|
+
let P = Oe(), [L, H] = q(null), [pe, Ce] = q(!1), [ke, Ae] = q(!1), [je, Me] = q(!1), [Ne, Pe] = q(!1), [Fe, Ie] = q(!1), [Le, Re] = q(!1), [J, Y] = q(null), [Z, Ve] = q(!1), [Ue, We] = q(null), [Ge, Ke] = q(!1), Q = D.useUtils(), qe = D.compute.deleteImage.useMutation({ onSuccess: () => {
|
|
985
985
|
Q.compute.listImagesWithPagination.invalidate();
|
|
986
|
-
} }), $e =
|
|
986
|
+
} }), $e = D.compute.deactivateImage.useMutation({ onSuccess: () => {
|
|
987
987
|
Q.compute.listImagesWithPagination.invalidate(), Q.compute.getImageById.invalidate();
|
|
988
|
-
} }), et =
|
|
988
|
+
} }), et = D.compute.reactivateImage.useMutation({ onSuccess: () => {
|
|
989
989
|
Q.compute.listImagesWithPagination.invalidate(), Q.compute.getImageById.invalidate();
|
|
990
|
-
} }), tt =
|
|
991
|
-
Q.compute.listImagesWithPagination.invalidate(),
|
|
992
|
-
} }), nt =
|
|
993
|
-
Q.compute.listImagesWithPagination.invalidate(),
|
|
994
|
-
} }), rt =
|
|
995
|
-
Q.compute.listImagesWithPagination.invalidate(),
|
|
996
|
-
} }), it =
|
|
990
|
+
} }), tt = D.compute.deleteImages.useMutation({ onSuccess: () => {
|
|
991
|
+
Q.compute.listImagesWithPagination.invalidate(), h([]);
|
|
992
|
+
} }), nt = D.compute.activateImages.useMutation({ onSuccess: () => {
|
|
993
|
+
Q.compute.listImagesWithPagination.invalidate(), h([]);
|
|
994
|
+
} }), rt = D.compute.deactivateImages.useMutation({ onSuccess: () => {
|
|
995
|
+
Q.compute.listImagesWithPagination.invalidate(), h([]);
|
|
996
|
+
} }), it = D.compute.updateImage.useMutation({ onSuccess: (e) => {
|
|
997
997
|
Q.compute.listImagesWithPagination.invalidate(), Q.compute.getImageById.setData({
|
|
998
|
-
project_id:
|
|
998
|
+
project_id: P,
|
|
999
999
|
imageId: e.id
|
|
1000
1000
|
}, e);
|
|
1001
|
-
} }), at =
|
|
1001
|
+
} }), at = D.compute.createImage.useMutation({ onSuccess: () => {
|
|
1002
1002
|
Q.compute.listImagesWithPagination.invalidate();
|
|
1003
|
-
} }), ot =
|
|
1004
|
-
|
|
1005
|
-
} }), { data: st } =
|
|
1006
|
-
project_id:
|
|
1003
|
+
} }), ot = D.compute.updateImageVisibility.useMutation({ onSuccess: (e) => {
|
|
1004
|
+
A(e);
|
|
1005
|
+
} }), { data: st } = D.compute.watchUploadProgress.useSubscription({
|
|
1006
|
+
project_id: P,
|
|
1007
1007
|
uploadId: Ue || ""
|
|
1008
1008
|
}, { enabled: !!Ue && Ge }), ct = qe.isPending || $e.isPending || et.isPending || tt.isPending || nt.isPending || rt.isPending || it.isPending, $ = () => H(null), lt = async (e, t, n) => {
|
|
1009
1009
|
try {
|
|
1010
1010
|
await ot.mutateAsync({
|
|
1011
|
-
project_id:
|
|
1011
|
+
project_id: P,
|
|
1012
1012
|
imageId: e,
|
|
1013
1013
|
visibility: t
|
|
1014
1014
|
}), H(Te(n, t, { onDismiss: $ }));
|
|
1015
1015
|
} catch (e) {
|
|
1016
|
-
H(
|
|
1016
|
+
H(ae(n, e?.message || Be._({
|
|
1017
1017
|
id: "J9cmxx",
|
|
1018
1018
|
values: { newVisibility: t }
|
|
1019
1019
|
}), { onDismiss: $ }));
|
|
@@ -1040,11 +1040,11 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1040
1040
|
let t = J.id, n = e.name || J.name || t;
|
|
1041
1041
|
try {
|
|
1042
1042
|
let r = ut(e, J), i = await it.mutateAsync({
|
|
1043
|
-
project_id:
|
|
1043
|
+
project_id: P,
|
|
1044
1044
|
imageId: t,
|
|
1045
1045
|
operations: r
|
|
1046
1046
|
});
|
|
1047
|
-
return Ce(!1), H(
|
|
1047
|
+
return Ce(!1), H(R(n, { onDismiss: $ })), Y(i), A(i), !0;
|
|
1048
1048
|
} catch (e) {
|
|
1049
1049
|
let { message: t } = e;
|
|
1050
1050
|
return H(Ee(n, t, { onDismiss: $ })), Y(null), !1;
|
|
@@ -1054,11 +1054,11 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1054
1054
|
try {
|
|
1055
1055
|
Ve(!0);
|
|
1056
1056
|
let r = await at.mutateAsync({
|
|
1057
|
-
project_id:
|
|
1057
|
+
project_id: P,
|
|
1058
1058
|
...e
|
|
1059
1059
|
});
|
|
1060
|
-
We(r.id), Ke(!0), await
|
|
1061
|
-
"x-project-id":
|
|
1060
|
+
We(r.id), Ke(!0), await E.compute.uploadImage.mutate(t, { context: { headers: {
|
|
1061
|
+
"x-project-id": P,
|
|
1062
1062
|
"x-upload-id": r.id,
|
|
1063
1063
|
"x-upload-size": String(t.size)
|
|
1064
1064
|
} } }), H(de(n, { onDismiss: $ })), Q.compute.listImagesWithPagination.invalidate();
|
|
@@ -1069,28 +1069,28 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1069
1069
|
H(le(t.name, n, { onDismiss: $ }));
|
|
1070
1070
|
}
|
|
1071
1071
|
} finally {
|
|
1072
|
-
Ve(!1),
|
|
1072
|
+
Ve(!1), C(!1), Ke(!1), We(null);
|
|
1073
1073
|
}
|
|
1074
1074
|
}, pt = async (e) => {
|
|
1075
1075
|
Ce(!1), Ae(!1);
|
|
1076
1076
|
let t = e.name || e.id, n = e.id;
|
|
1077
1077
|
try {
|
|
1078
1078
|
await qe.mutateAsync({
|
|
1079
|
-
project_id:
|
|
1079
|
+
project_id: P,
|
|
1080
1080
|
imageId: n
|
|
1081
|
-
}), H(De(t, { onDismiss: $ })),
|
|
1081
|
+
}), H(De(t, { onDismiss: $ })), j(n);
|
|
1082
1082
|
} catch (e) {
|
|
1083
1083
|
let { message: t } = e;
|
|
1084
1084
|
H(we(n, t, { onDismiss: $ }));
|
|
1085
1085
|
}
|
|
1086
1086
|
Y(null);
|
|
1087
1087
|
}, mt = async (e) => {
|
|
1088
|
-
e.status ===
|
|
1088
|
+
e.status === F.DEACTIVATED ? (Y(e), Ie(!0)) : (Y(e), Pe(!0));
|
|
1089
1089
|
}, ht = async (e) => {
|
|
1090
1090
|
let t = e.name || e.id, n = e.id;
|
|
1091
1091
|
try {
|
|
1092
1092
|
await et.mutateAsync({
|
|
1093
|
-
project_id:
|
|
1093
|
+
project_id: P,
|
|
1094
1094
|
imageId: n
|
|
1095
1095
|
}), Ie(!1), Y(null), H(ue(t, { onDismiss: $ }));
|
|
1096
1096
|
} catch (e) {
|
|
@@ -1101,7 +1101,7 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1101
1101
|
let t = e.name || e.id, n = e.id;
|
|
1102
1102
|
try {
|
|
1103
1103
|
await $e.mutateAsync({
|
|
1104
|
-
project_id:
|
|
1104
|
+
project_id: P,
|
|
1105
1105
|
imageId: n
|
|
1106
1106
|
}), Pe(!1), Y(null), H(U(t, { onDismiss: $ }));
|
|
1107
1107
|
} catch (e) {
|
|
@@ -1119,26 +1119,26 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1119
1119
|
};
|
|
1120
1120
|
return ct ? /*#__PURE__*/ G("div", {
|
|
1121
1121
|
"data-testid": "loading",
|
|
1122
|
-
children: /*#__PURE__*/ G(
|
|
1122
|
+
children: /*#__PURE__*/ G(T, { children: /*#__PURE__*/ G(r, {
|
|
1123
1123
|
colSpan: 3,
|
|
1124
|
-
children: /*#__PURE__*/ K(
|
|
1124
|
+
children: /*#__PURE__*/ K(c, {
|
|
1125
1125
|
distribution: "center",
|
|
1126
1126
|
alignment: "center",
|
|
1127
|
-
children: [/*#__PURE__*/ G(
|
|
1127
|
+
children: [/*#__PURE__*/ G(l, { variant: "primary" }), /*#__PURE__*/ G(X, { id: "Z3FXyt" })]
|
|
1128
1128
|
})
|
|
1129
1129
|
}) })
|
|
1130
1130
|
}) : /*#__PURE__*/ K(W, { children: [
|
|
1131
|
-
/*#__PURE__*/ G(W, { children:
|
|
1131
|
+
/*#__PURE__*/ G(W, { children: p }),
|
|
1132
1132
|
/*#__PURE__*/ K("div", {
|
|
1133
1133
|
className: "relative",
|
|
1134
1134
|
children: [
|
|
1135
|
-
|
|
1135
|
+
s && /*#__PURE__*/ G("div", {
|
|
1136
1136
|
className: "bg-theme-background-lvl-0/50 absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm",
|
|
1137
|
-
children: /*#__PURE__*/ K(
|
|
1137
|
+
children: /*#__PURE__*/ K(c, {
|
|
1138
1138
|
direction: "vertical",
|
|
1139
1139
|
alignment: "center",
|
|
1140
1140
|
gap: "2",
|
|
1141
|
-
children: [/*#__PURE__*/ G(
|
|
1141
|
+
children: [/*#__PURE__*/ G(l, {
|
|
1142
1142
|
variant: "primary",
|
|
1143
1143
|
size: "large"
|
|
1144
1144
|
}), /*#__PURE__*/ G("span", {
|
|
@@ -1147,70 +1147,70 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1147
1147
|
})]
|
|
1148
1148
|
})
|
|
1149
1149
|
}),
|
|
1150
|
-
e.length > 0 ? /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ K(
|
|
1151
|
-
columns:
|
|
1152
|
-
minContentColumns:
|
|
1150
|
+
e.length > 0 ? /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ K(v, {
|
|
1151
|
+
columns: N ? 9 : 8,
|
|
1152
|
+
minContentColumns: N ? [0, 8] : [7],
|
|
1153
1153
|
className: "images",
|
|
1154
1154
|
"data-testid": "images-table",
|
|
1155
|
-
children: [/*#__PURE__*/ K(
|
|
1156
|
-
|
|
1155
|
+
children: [/*#__PURE__*/ K(T, { children: [
|
|
1156
|
+
N && /*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(te, {
|
|
1157
1157
|
checked: (() => {
|
|
1158
1158
|
let t = e.map((e) => e.id);
|
|
1159
|
-
return t.length > 0 && t.every((e) =>
|
|
1159
|
+
return t.length > 0 && t.every((e) => m.includes(e));
|
|
1160
1160
|
})(),
|
|
1161
1161
|
onChange: () => {
|
|
1162
1162
|
let t = e.map((e) => e.id);
|
|
1163
|
-
return t.every((e) =>
|
|
1163
|
+
return t.every((e) => m.includes(e)) ? h(m.filter((e) => !t.includes(e))) : h([...new Set([...m, ...t])]);
|
|
1164
1164
|
}
|
|
1165
1165
|
}) }),
|
|
1166
|
-
/*#__PURE__*/ G(
|
|
1167
|
-
/*#__PURE__*/ G(
|
|
1168
|
-
/*#__PURE__*/ G(
|
|
1169
|
-
/*#__PURE__*/ G(
|
|
1170
|
-
/*#__PURE__*/ G(
|
|
1171
|
-
/*#__PURE__*/ G(
|
|
1172
|
-
/*#__PURE__*/ G(
|
|
1173
|
-
/*#__PURE__*/ G(
|
|
1166
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "uAQUqI" }) }),
|
|
1167
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "ExLULX" }) }),
|
|
1168
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "2q/Q7x" }) }),
|
|
1169
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "644xgx" }) }),
|
|
1170
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "Cj2Gtd" }) }),
|
|
1171
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "NopYGU" }) }),
|
|
1172
|
+
/*#__PURE__*/ G(n, { children: /*#__PURE__*/ G(X, { id: "d+F6q9" }) }),
|
|
1173
|
+
/*#__PURE__*/ G(n, {})
|
|
1174
1174
|
] }), e.map((e) => /*#__PURE__*/ G(He, {
|
|
1175
1175
|
image: e,
|
|
1176
|
-
isSelected:
|
|
1176
|
+
isSelected: m.includes(e.id),
|
|
1177
1177
|
isPending: !!t.find(({ id: t }) => t === e.id),
|
|
1178
|
-
isAccepted: !!
|
|
1179
|
-
permissions:
|
|
1178
|
+
isAccepted: !!i.find(({ id: t }) => t === e.id),
|
|
1179
|
+
permissions: o,
|
|
1180
1180
|
onEditDetails: _t,
|
|
1181
1181
|
onEditMetadata: vt,
|
|
1182
1182
|
onDelete: yt,
|
|
1183
1183
|
onManageAccess: bt,
|
|
1184
|
-
showSelectColumn:
|
|
1184
|
+
showSelectColumn: N,
|
|
1185
1185
|
onSelect: (e) => {
|
|
1186
|
-
if (
|
|
1187
|
-
|
|
1186
|
+
if (m.includes(e.id)) return h(m.filter((t) => t !== e.id));
|
|
1187
|
+
h([...m, e.id]);
|
|
1188
1188
|
},
|
|
1189
1189
|
onActivationStatusChange: mt,
|
|
1190
1190
|
onUpdateVisibility: lt,
|
|
1191
1191
|
setToastData: H,
|
|
1192
1192
|
uploadId: Ue,
|
|
1193
1193
|
uploadProgressPercent: st?.percent,
|
|
1194
|
-
onMemberStatusChanged:
|
|
1194
|
+
onMemberStatusChanged: M
|
|
1195
1195
|
}, e.id))]
|
|
1196
|
-
}),
|
|
1196
|
+
}), d > 1 && /*#__PURE__*/ G("div", {
|
|
1197
1197
|
className: "flex justify-center py-4",
|
|
1198
|
-
children: /*#__PURE__*/ G(
|
|
1198
|
+
children: /*#__PURE__*/ G(re, {
|
|
1199
1199
|
variant: "input",
|
|
1200
|
-
currentPage:
|
|
1201
|
-
pages:
|
|
1202
|
-
onPressPrevious: () =>
|
|
1203
|
-
onPressNext: () =>
|
|
1204
|
-
onSelectChange: (e) =>
|
|
1200
|
+
currentPage: u,
|
|
1201
|
+
pages: d,
|
|
1202
|
+
onPressPrevious: () => f?.(Math.max(u - 1, 1)),
|
|
1203
|
+
onPressNext: () => f?.(Math.min(u + 1, d)),
|
|
1204
|
+
onSelectChange: (e) => f?.(e)
|
|
1205
1205
|
})
|
|
1206
|
-
})] }) : /*#__PURE__*/ G(
|
|
1206
|
+
})] }) : /*#__PURE__*/ G(v, {
|
|
1207
1207
|
columns: 7,
|
|
1208
1208
|
minContentColumns: [0, 6],
|
|
1209
1209
|
className: "images",
|
|
1210
1210
|
"data-testid": "no-images",
|
|
1211
|
-
children: /*#__PURE__*/ G(
|
|
1211
|
+
children: /*#__PURE__*/ G(T, { children: /*#__PURE__*/ K(r, {
|
|
1212
1212
|
colSpan: 7,
|
|
1213
|
-
children: [/*#__PURE__*/ G(
|
|
1213
|
+
children: [/*#__PURE__*/ G(ne, { children: /*#__PURE__*/ G(X, { id: "eYlnXt" }) }), /*#__PURE__*/ G("p", { children: /*#__PURE__*/ G(X, { id: "qvF2D8" }) })]
|
|
1214
1214
|
}) })
|
|
1215
1215
|
}),
|
|
1216
1216
|
J && /*#__PURE__*/ K(W, { children: [
|
|
@@ -1223,7 +1223,7 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1223
1223
|
onSave: dt,
|
|
1224
1224
|
isLoading: it.isPending
|
|
1225
1225
|
}),
|
|
1226
|
-
/*#__PURE__*/ G(
|
|
1226
|
+
/*#__PURE__*/ G(I, {
|
|
1227
1227
|
isOpen: ke,
|
|
1228
1228
|
onClose: () => {
|
|
1229
1229
|
Y(null), Ae(!1);
|
|
@@ -1232,17 +1232,17 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1232
1232
|
onSave: dt,
|
|
1233
1233
|
isLoading: it.isPending
|
|
1234
1234
|
}),
|
|
1235
|
-
/*#__PURE__*/ G(
|
|
1235
|
+
/*#__PURE__*/ G(oe, {
|
|
1236
1236
|
image: J,
|
|
1237
1237
|
isOpen: je,
|
|
1238
1238
|
isLoading: ct,
|
|
1239
|
-
isDisabled: J.protected || !
|
|
1239
|
+
isDisabled: J.protected || !o.canDelete,
|
|
1240
1240
|
onClose: () => {
|
|
1241
1241
|
Y(null), Me(!1);
|
|
1242
1242
|
},
|
|
1243
1243
|
onDelete: pt
|
|
1244
1244
|
}),
|
|
1245
|
-
/*#__PURE__*/ G(
|
|
1245
|
+
/*#__PURE__*/ G(z, {
|
|
1246
1246
|
image: J,
|
|
1247
1247
|
isOpen: Ne,
|
|
1248
1248
|
isLoading: $e.isPending,
|
|
@@ -1251,7 +1251,7 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1251
1251
|
},
|
|
1252
1252
|
onDeactivate: gt
|
|
1253
1253
|
}),
|
|
1254
|
-
/*#__PURE__*/ G(
|
|
1254
|
+
/*#__PURE__*/ G(se, {
|
|
1255
1255
|
image: J,
|
|
1256
1256
|
isOpen: Fe,
|
|
1257
1257
|
isLoading: et.isPending,
|
|
@@ -1266,23 +1266,23 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1266
1266
|
onClose: () => {
|
|
1267
1267
|
Y(null), Re(!1);
|
|
1268
1268
|
},
|
|
1269
|
-
permissions:
|
|
1269
|
+
permissions: o
|
|
1270
1270
|
})
|
|
1271
1271
|
] }),
|
|
1272
1272
|
/*#__PURE__*/ G(Ye, {
|
|
1273
|
-
isOpen:
|
|
1274
|
-
deletableImages:
|
|
1275
|
-
protectedImages:
|
|
1273
|
+
isOpen: g,
|
|
1274
|
+
deletableImages: w,
|
|
1275
|
+
protectedImages: ie,
|
|
1276
1276
|
isLoading: ct,
|
|
1277
|
-
onClose: () =>
|
|
1277
|
+
onClose: () => _(!1),
|
|
1278
1278
|
onDelete: async (e) => {
|
|
1279
|
-
|
|
1279
|
+
_(!1);
|
|
1280
1280
|
try {
|
|
1281
1281
|
let t = await tt.mutateAsync({
|
|
1282
|
-
project_id:
|
|
1282
|
+
project_id: P,
|
|
1283
1283
|
imageIds: e
|
|
1284
1284
|
}), n = t.successful.length, r = t.failed.length, i = e.length;
|
|
1285
|
-
H(r === 0 ? he(n, i, { onDismiss: $ }) : n === 0 ? xe(r, i, { onDismiss: $ }) : V(n, r, { onDismiss: $ })), t.successful.length > 0 &&
|
|
1285
|
+
H(r === 0 ? he(n, i, { onDismiss: $ }) : n === 0 ? xe(r, i, { onDismiss: $ }) : V(n, r, { onDismiss: $ })), t.successful.length > 0 && j(t.successful);
|
|
1286
1286
|
} catch (t) {
|
|
1287
1287
|
let { message: n } = t;
|
|
1288
1288
|
console.log("Bulk delete error: ", n), H(xe(e.length, e.length, { onDismiss: $ }));
|
|
@@ -1290,16 +1290,16 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1290
1290
|
}
|
|
1291
1291
|
}),
|
|
1292
1292
|
/*#__PURE__*/ G(Xe, {
|
|
1293
|
-
isOpen:
|
|
1294
|
-
activeImages:
|
|
1295
|
-
deactivatedImages:
|
|
1293
|
+
isOpen: ee,
|
|
1294
|
+
activeImages: O,
|
|
1295
|
+
deactivatedImages: k,
|
|
1296
1296
|
isLoading: ct,
|
|
1297
|
-
onClose: () =>
|
|
1297
|
+
onClose: () => y(!1),
|
|
1298
1298
|
onDeactivate: async (e) => {
|
|
1299
|
-
|
|
1299
|
+
y(!1);
|
|
1300
1300
|
try {
|
|
1301
1301
|
let t = await rt.mutateAsync({
|
|
1302
|
-
project_id:
|
|
1302
|
+
project_id: P,
|
|
1303
1303
|
imageIds: e
|
|
1304
1304
|
}), n = t.successful.length, r = t.failed.length, i = e.length;
|
|
1305
1305
|
H(r === 0 ? ve(n, i, { onDismiss: $ }) : n === 0 ? fe(r, i, { onDismiss: $ }) : ce(n, r, { onDismiss: $ }));
|
|
@@ -1310,16 +1310,16 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1310
1310
|
}
|
|
1311
1311
|
}),
|
|
1312
1312
|
/*#__PURE__*/ G(Ze, {
|
|
1313
|
-
isOpen:
|
|
1314
|
-
deactivatedImages:
|
|
1315
|
-
activeImages:
|
|
1313
|
+
isOpen: b,
|
|
1314
|
+
deactivatedImages: k,
|
|
1315
|
+
activeImages: O,
|
|
1316
1316
|
isLoading: ct,
|
|
1317
|
-
onClose: () =>
|
|
1317
|
+
onClose: () => x(!1),
|
|
1318
1318
|
onActivate: async (e) => {
|
|
1319
|
-
|
|
1319
|
+
x(!1);
|
|
1320
1320
|
try {
|
|
1321
1321
|
let t = await nt.mutateAsync({
|
|
1322
|
-
project_id:
|
|
1322
|
+
project_id: P,
|
|
1323
1323
|
imageIds: e
|
|
1324
1324
|
}), n = t.successful.length, r = t.failed.length, i = e.length;
|
|
1325
1325
|
H(r === 0 ? be(n, i, { onDismiss: $ }) : n === 0 ? Se(r, i, { onDismiss: $ }) : _e(n, r, { onDismiss: $ }));
|
|
@@ -1330,9 +1330,9 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1330
1330
|
}
|
|
1331
1331
|
}),
|
|
1332
1332
|
/*#__PURE__*/ G(Je, {
|
|
1333
|
-
isOpen:
|
|
1333
|
+
isOpen: S,
|
|
1334
1334
|
onClose: () => {
|
|
1335
|
-
Ue && Q.compute.listImagesWithPagination.invalidate(),
|
|
1335
|
+
Ue && Q.compute.listImagesWithPagination.invalidate(), C(!1);
|
|
1336
1336
|
},
|
|
1337
1337
|
onCreate: ft,
|
|
1338
1338
|
isLoading: at.isPending || Ge || Z,
|
|
@@ -1341,8 +1341,8 @@ function $e({ images: e, suggestedImages: t, acceptedImages: n, permissions: c,
|
|
|
1341
1341
|
})
|
|
1342
1342
|
]
|
|
1343
1343
|
}),
|
|
1344
|
-
|
|
1345
|
-
...
|
|
1344
|
+
L && /*#__PURE__*/ G(a, {
|
|
1345
|
+
...L,
|
|
1346
1346
|
className: "border-theme-light fixed top-5 right-5 z-50 rounded-lg border shadow-lg"
|
|
1347
1347
|
})
|
|
1348
1348
|
] });
|
|
@@ -1449,22 +1449,22 @@ var et = (e) => {
|
|
|
1449
1449
|
canDeleteMember: i,
|
|
1450
1450
|
canUpdateMember: a ?? !1
|
|
1451
1451
|
})), st = 50;
|
|
1452
|
-
function ct({ imagesPromise: e, imageOverrides:
|
|
1453
|
-
let { i18n:
|
|
1454
|
-
if (Fe(() => () => clearTimeout(
|
|
1455
|
-
let B =
|
|
1452
|
+
function ct({ imagesPromise: e, imageOverrides: n, deletedImageIds: r, permissionsPromise: i, searchTerm: a, setSearchTerm: l, sortSettings: u, handleSortChange: f, filterSettings: h, handleFilterChange: g, selectedImages: ee, setSelectedImages: v, createModalOpen: y, setCreateModalOpen: ne, deleteAllModalOpen: x, setDeleteAllModalOpen: S, deactivateAllModalOpen: w, setDeactivateAllModalOpen: T, activateAllModalOpen: re, setActivateAllModalOpen: E, memberStatusView: D, setMemberStatusView: ie, isFetching: O, currentPage: k, onPageChange: j, onImageUpdated: ae, onImageDeleted: oe, onMemberStatusChanged: se }) {
|
|
1453
|
+
let { i18n: M, _: N } = Z(), P = Ne(e), I = Ne(i), [L, R] = q(a), z = Le(void 0);
|
|
1454
|
+
if (Fe(() => () => clearTimeout(z.current), []), P.listError) return /*#__PURE__*/ G("p", { children: P.listError });
|
|
1455
|
+
let B = P.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(k, ce), V = B.slice((le - 1) * st, le * st);
|
|
1456
1456
|
Fe(() => {
|
|
1457
|
-
|
|
1457
|
+
k !== 1 && k > ce && j(1);
|
|
1458
1458
|
}, [
|
|
1459
1459
|
ce,
|
|
1460
|
-
|
|
1461
|
-
|
|
1460
|
+
k,
|
|
1461
|
+
j
|
|
1462
1462
|
]);
|
|
1463
|
-
let H =
|
|
1464
|
-
...
|
|
1465
|
-
filters:
|
|
1466
|
-
selectedFilters: (
|
|
1467
|
-
} :
|
|
1463
|
+
let H = D === "pending" || D === "accepted" ? {
|
|
1464
|
+
...h,
|
|
1465
|
+
filters: h.filters.filter((e) => e.filterName !== "visibility"),
|
|
1466
|
+
selectedFilters: (h.selectedFilters || []).filter((e) => e.name !== "visibility")
|
|
1467
|
+
} : h, ue = new Set(B.map((e) => e.id)), U = ee.filter((e) => ue.has(e)), de = U.filter((e) => {
|
|
1468
1468
|
let t = B.find((t) => t.id === e);
|
|
1469
1469
|
return t && !t.protected;
|
|
1470
1470
|
}), fe = U.filter((e) => {
|
|
@@ -1472,109 +1472,109 @@ function ct({ imagesPromise: e, imageOverrides: r, deletedImageIds: i, permissio
|
|
|
1472
1472
|
return t && t.protected;
|
|
1473
1473
|
}), pe = U.filter((e) => {
|
|
1474
1474
|
let t = B.find((t) => t.id === e);
|
|
1475
|
-
return t && t.status ===
|
|
1475
|
+
return t && t.status === F.ACTIVE;
|
|
1476
1476
|
}), me = U.filter((e) => {
|
|
1477
1477
|
let t = B.find((t) => t.id === e);
|
|
1478
|
-
return t && t.status ===
|
|
1479
|
-
}), he = !
|
|
1478
|
+
return t && t.status === F.DEACTIVATED;
|
|
1479
|
+
}), he = !I.canDelete || U.length === 0 || B.filter((e) => U.includes(e.id)).every((e) => e.protected), ge = !I.canUpdate || U.length === 0 || B.filter((e) => U.includes(e.id)).every((e) => e.status === F.DEACTIVATED), _e = !I.canUpdate || U.length === 0 || B.filter((e) => U.includes(e.id)).every((e) => e.status === F.ACTIVE), ve = {
|
|
1480
1480
|
items: [
|
|
1481
1481
|
{
|
|
1482
|
-
label:
|
|
1482
|
+
label: M._({ id: "SFo0kK" }),
|
|
1483
1483
|
value: "all"
|
|
1484
1484
|
},
|
|
1485
1485
|
{
|
|
1486
|
-
label:
|
|
1486
|
+
label: M._({ id: "thHAVL" }),
|
|
1487
1487
|
value: "accepted"
|
|
1488
1488
|
},
|
|
1489
1489
|
{
|
|
1490
|
-
label:
|
|
1490
|
+
label: M._({ id: "E4QYe7" }),
|
|
1491
1491
|
value: "pending"
|
|
1492
1492
|
}
|
|
1493
1493
|
],
|
|
1494
|
-
activeItem:
|
|
1495
|
-
onActiveItemChange: (e) =>
|
|
1494
|
+
activeItem: D,
|
|
1495
|
+
onActiveItemChange: (e) => ie(e)
|
|
1496
1496
|
};
|
|
1497
1497
|
return /*#__PURE__*/ K(W, { children: [
|
|
1498
|
-
/*#__PURE__*/ K(
|
|
1498
|
+
/*#__PURE__*/ K(c, {
|
|
1499
1499
|
distribution: "between",
|
|
1500
1500
|
alignment: "center",
|
|
1501
1501
|
gap: "2",
|
|
1502
|
-
children: [/*#__PURE__*/ G(
|
|
1503
|
-
activeItem:
|
|
1502
|
+
children: [/*#__PURE__*/ G(d, {
|
|
1503
|
+
activeItem: D,
|
|
1504
1504
|
onActiveItemChange: ve.onActiveItemChange,
|
|
1505
|
-
children: ve.items.map((e) => /*#__PURE__*/ G(
|
|
1505
|
+
children: ve.items.map((e) => /*#__PURE__*/ G(o, {
|
|
1506
1506
|
label: e.label,
|
|
1507
1507
|
value: e.value
|
|
1508
1508
|
}, e.value))
|
|
1509
|
-
}), /*#__PURE__*/ K(
|
|
1509
|
+
}), /*#__PURE__*/ K(c, {
|
|
1510
1510
|
gap: "0.5",
|
|
1511
1511
|
alignment: "center",
|
|
1512
|
-
children: [/*#__PURE__*/ G(
|
|
1513
|
-
options:
|
|
1514
|
-
sortBy:
|
|
1515
|
-
sortDirection:
|
|
1516
|
-
onSortByChange: (e) =>
|
|
1517
|
-
...
|
|
1512
|
+
children: [/*#__PURE__*/ G(A, {
|
|
1513
|
+
options: u.options,
|
|
1514
|
+
sortBy: u.sortBy,
|
|
1515
|
+
sortDirection: u.sortDirection ?? "desc",
|
|
1516
|
+
onSortByChange: (e) => f({
|
|
1517
|
+
...u,
|
|
1518
1518
|
sortBy: e,
|
|
1519
|
-
sortDirection:
|
|
1519
|
+
sortDirection: u.sortDirection
|
|
1520
1520
|
}),
|
|
1521
|
-
onSortDirectionChange: (e) =>
|
|
1522
|
-
...
|
|
1521
|
+
onSortDirectionChange: (e) => f({
|
|
1522
|
+
...u,
|
|
1523
1523
|
sortDirection: e
|
|
1524
1524
|
})
|
|
1525
|
-
}),
|
|
1526
|
-
onClick: () =>
|
|
1525
|
+
}), I.canCreate && /*#__PURE__*/ G(m, {
|
|
1526
|
+
onClick: () => ne(!0),
|
|
1527
1527
|
variant: "primary",
|
|
1528
1528
|
children: /*#__PURE__*/ G(X, { id: "a/nTb8" })
|
|
1529
1529
|
})]
|
|
1530
1530
|
})]
|
|
1531
1531
|
}),
|
|
1532
|
-
/*#__PURE__*/ G(
|
|
1532
|
+
/*#__PURE__*/ G(p, { children: /*#__PURE__*/ K(c, {
|
|
1533
1533
|
direction: "vertical",
|
|
1534
1534
|
gap: "2",
|
|
1535
|
-
children: [/*#__PURE__*/ K(
|
|
1535
|
+
children: [/*#__PURE__*/ K(c, {
|
|
1536
1536
|
distribution: "between",
|
|
1537
1537
|
alignment: "center",
|
|
1538
1538
|
children: [/*#__PURE__*/ G(Ae, {
|
|
1539
1539
|
filters: H.filters,
|
|
1540
1540
|
onChange: (e) => {
|
|
1541
1541
|
let t = nt(H.selectedFilters || [], e, H.filters);
|
|
1542
|
-
t !== (H.selectedFilters || []) &&
|
|
1543
|
-
...
|
|
1542
|
+
t !== (H.selectedFilters || []) && g({
|
|
1543
|
+
...h,
|
|
1544
1544
|
selectedFilters: t
|
|
1545
1545
|
});
|
|
1546
1546
|
}
|
|
1547
|
-
}), /*#__PURE__*/ G(
|
|
1548
|
-
placeholder:
|
|
1547
|
+
}), /*#__PURE__*/ G(b, {
|
|
1548
|
+
placeholder: M._({ id: "0cl0a5" }),
|
|
1549
1549
|
"data-testid": "searchbar",
|
|
1550
|
-
value:
|
|
1550
|
+
value: L,
|
|
1551
1551
|
onInput: (e) => {
|
|
1552
1552
|
let t = e.currentTarget.value;
|
|
1553
|
-
|
|
1553
|
+
R(t), clearTimeout(z.current), z.current = window.setTimeout(() => l(t), 500);
|
|
1554
1554
|
},
|
|
1555
1555
|
onSearch: (e) => {
|
|
1556
|
-
clearTimeout(
|
|
1556
|
+
clearTimeout(z.current), l(typeof e == "string" ? e : "");
|
|
1557
1557
|
},
|
|
1558
1558
|
onClear: () => {
|
|
1559
|
-
clearTimeout(
|
|
1559
|
+
clearTimeout(z.current), R(""), l("");
|
|
1560
1560
|
}
|
|
1561
1561
|
})]
|
|
1562
1562
|
}), H.selectedFilters && H.selectedFilters.length > 0 && /*#__PURE__*/ G(ke, {
|
|
1563
1563
|
selectedFilters: H.selectedFilters,
|
|
1564
|
-
onDelete: (e) =>
|
|
1565
|
-
...
|
|
1566
|
-
selectedFilters: (
|
|
1564
|
+
onDelete: (e) => g({
|
|
1565
|
+
...h,
|
|
1566
|
+
selectedFilters: (h.selectedFilters || []).filter((t) => !(t.name === e.name && t.value === e.value))
|
|
1567
1567
|
}),
|
|
1568
|
-
onClear: () =>
|
|
1569
|
-
...
|
|
1568
|
+
onClear: () => g({
|
|
1569
|
+
...h,
|
|
1570
1570
|
selectedFilters: []
|
|
1571
1571
|
})
|
|
1572
1572
|
})]
|
|
1573
1573
|
}) }),
|
|
1574
|
-
(
|
|
1574
|
+
(I.canDelete || I.canUpdate) && /*#__PURE__*/ G(p, { children: /*#__PURE__*/ G(c, {
|
|
1575
1575
|
distribution: "between",
|
|
1576
1576
|
alignment: "center",
|
|
1577
|
-
children: /*#__PURE__*/ K(
|
|
1577
|
+
children: /*#__PURE__*/ K(c, {
|
|
1578
1578
|
gap: "2",
|
|
1579
1579
|
alignment: "center",
|
|
1580
1580
|
children: [/*#__PURE__*/ G(te, {
|
|
@@ -1582,184 +1582,184 @@ function ct({ imagesPromise: e, imageOverrides: r, deletedImageIds: i, permissio
|
|
|
1582
1582
|
indeterminate: U.length > 0 && !V.every((e) => U.includes(e.id)),
|
|
1583
1583
|
onChange: () => {
|
|
1584
1584
|
let e = V.map((e) => e.id);
|
|
1585
|
-
e.every((e) => U.includes(e)) ?
|
|
1585
|
+
e.every((e) => U.includes(e)) ? v(U.filter((t) => !e.includes(t))) : v([...new Set([...U, ...e])]);
|
|
1586
1586
|
}
|
|
1587
|
-
}), /*#__PURE__*/ K(
|
|
1587
|
+
}), /*#__PURE__*/ K(s, { children: [/*#__PURE__*/ G(t, {
|
|
1588
1588
|
as: "div",
|
|
1589
1589
|
children: /*#__PURE__*/ G(m, {
|
|
1590
1590
|
size: "small",
|
|
1591
1591
|
icon: "moreVert",
|
|
1592
|
-
label:
|
|
1592
|
+
label: M._({ id: "7L01XJ" })
|
|
1593
1593
|
})
|
|
1594
|
-
}), /*#__PURE__*/ K(
|
|
1595
|
-
|
|
1594
|
+
}), /*#__PURE__*/ K(C, { children: [
|
|
1595
|
+
I.canDelete && /*#__PURE__*/ G(_, {
|
|
1596
1596
|
disabled: he,
|
|
1597
|
-
label:
|
|
1598
|
-
onClick: () =>
|
|
1597
|
+
label: M._({ id: "c6b6fz" }),
|
|
1598
|
+
onClick: () => S(!0)
|
|
1599
1599
|
}),
|
|
1600
|
-
|
|
1600
|
+
I.canUpdate && /*#__PURE__*/ G(_, {
|
|
1601
1601
|
disabled: ge,
|
|
1602
|
-
label:
|
|
1602
|
+
label: M._({ id: "UmQ3/m" }),
|
|
1603
1603
|
onClick: () => T(!0)
|
|
1604
1604
|
}),
|
|
1605
|
-
|
|
1605
|
+
I.canUpdate && /*#__PURE__*/ G(_, {
|
|
1606
1606
|
disabled: _e,
|
|
1607
|
-
label:
|
|
1608
|
-
onClick: () =>
|
|
1607
|
+
label: M._({ id: "d/I0J3" }),
|
|
1608
|
+
onClick: () => E(!0)
|
|
1609
1609
|
})
|
|
1610
1610
|
] })] })]
|
|
1611
1611
|
})
|
|
1612
1612
|
}) }),
|
|
1613
1613
|
/*#__PURE__*/ G($e, {
|
|
1614
1614
|
images: V,
|
|
1615
|
-
suggestedImages:
|
|
1616
|
-
acceptedImages:
|
|
1617
|
-
permissions:
|
|
1618
|
-
isFetching:
|
|
1615
|
+
suggestedImages: D === "pending" ? V : [],
|
|
1616
|
+
acceptedImages: D === "accepted" ? V : [],
|
|
1617
|
+
permissions: I,
|
|
1618
|
+
isFetching: O,
|
|
1619
1619
|
currentPage: le,
|
|
1620
1620
|
totalPages: ce,
|
|
1621
|
-
onPageChange:
|
|
1622
|
-
selectedImages:
|
|
1623
|
-
setSelectedImages:
|
|
1624
|
-
deleteAllModalOpen:
|
|
1625
|
-
setDeleteAllModalOpen:
|
|
1621
|
+
onPageChange: j,
|
|
1622
|
+
selectedImages: ee,
|
|
1623
|
+
setSelectedImages: v,
|
|
1624
|
+
deleteAllModalOpen: x,
|
|
1625
|
+
setDeleteAllModalOpen: S,
|
|
1626
1626
|
deactivateAllModalOpen: w,
|
|
1627
1627
|
setDeactivateAllModalOpen: T,
|
|
1628
|
-
activateAllModalOpen:
|
|
1629
|
-
setActivateAllModalOpen:
|
|
1630
|
-
createModalOpen:
|
|
1631
|
-
setCreateModalOpen:
|
|
1628
|
+
activateAllModalOpen: re,
|
|
1629
|
+
setActivateAllModalOpen: E,
|
|
1630
|
+
createModalOpen: y,
|
|
1631
|
+
setCreateModalOpen: ne,
|
|
1632
1632
|
deletableImages: de,
|
|
1633
1633
|
protectedImages: fe,
|
|
1634
1634
|
activeImages: pe,
|
|
1635
1635
|
deactivatedImages: me,
|
|
1636
|
-
onImageUpdated:
|
|
1637
|
-
onImageDeleted:
|
|
1638
|
-
onMemberStatusChanged:
|
|
1639
|
-
hasAnyBulkAction:
|
|
1636
|
+
onImageUpdated: ae,
|
|
1637
|
+
onImageDeleted: oe,
|
|
1638
|
+
onMemberStatusChanged: se,
|
|
1639
|
+
hasAnyBulkAction: I.canDelete || I.canUpdate
|
|
1640
1640
|
})
|
|
1641
1641
|
] });
|
|
1642
1642
|
}
|
|
1643
|
-
var $ = ({ client:
|
|
1644
|
-
let { i18n:
|
|
1643
|
+
var $ = ({ client: t, project: n }) => {
|
|
1644
|
+
let { i18n: r, _: i } = Z(), a = Re(), o = Y({ strict: !1 }), [s, u] = q({
|
|
1645
1645
|
options: [
|
|
1646
1646
|
{
|
|
1647
|
-
label:
|
|
1647
|
+
label: r._({ id: "88kg0+" }),
|
|
1648
1648
|
value: "created_at"
|
|
1649
1649
|
},
|
|
1650
1650
|
{
|
|
1651
|
-
label:
|
|
1651
|
+
label: r._({ id: "Llcakz" }),
|
|
1652
1652
|
value: "updated_at"
|
|
1653
1653
|
},
|
|
1654
1654
|
{
|
|
1655
|
-
label:
|
|
1655
|
+
label: r._({ id: "6YtxFj" }),
|
|
1656
1656
|
value: "name"
|
|
1657
1657
|
},
|
|
1658
1658
|
{
|
|
1659
|
-
label:
|
|
1659
|
+
label: r._({ id: "Cj2Gtd" }),
|
|
1660
1660
|
value: "size"
|
|
1661
1661
|
},
|
|
1662
1662
|
{
|
|
1663
|
-
label:
|
|
1663
|
+
label: r._({ id: "uAQUqI" }),
|
|
1664
1664
|
value: "status"
|
|
1665
1665
|
}
|
|
1666
1666
|
],
|
|
1667
|
-
sortBy:
|
|
1668
|
-
sortDirection:
|
|
1669
|
-
}), [
|
|
1667
|
+
sortBy: o.sortBy || "created_at",
|
|
1668
|
+
sortDirection: o.sortDirection || "desc"
|
|
1669
|
+
}), [d, f] = q({
|
|
1670
1670
|
filters: [
|
|
1671
1671
|
{
|
|
1672
|
-
displayName:
|
|
1672
|
+
displayName: r._({ id: "uAQUqI" }),
|
|
1673
1673
|
filterName: "status",
|
|
1674
|
-
values: Object.values(
|
|
1674
|
+
values: Object.values(F),
|
|
1675
1675
|
supportsMultiValue: !0
|
|
1676
1676
|
},
|
|
1677
1677
|
{
|
|
1678
|
-
displayName:
|
|
1678
|
+
displayName: r._({ id: "2q/Q7x" }),
|
|
1679
1679
|
filterName: "visibility",
|
|
1680
|
-
values: Object.values(
|
|
1680
|
+
values: Object.values(L),
|
|
1681
1681
|
supportsMultiValue: !1
|
|
1682
1682
|
},
|
|
1683
1683
|
{
|
|
1684
|
-
displayName:
|
|
1684
|
+
displayName: r._({ id: "NopYGU" }),
|
|
1685
1685
|
filterName: "disk_format",
|
|
1686
|
-
values: Object.values(
|
|
1686
|
+
values: Object.values(P),
|
|
1687
1687
|
supportsMultiValue: !0
|
|
1688
1688
|
},
|
|
1689
1689
|
{
|
|
1690
|
-
displayName:
|
|
1690
|
+
displayName: r._({ id: "6/xipy" }),
|
|
1691
1691
|
filterName: "container_format",
|
|
1692
1692
|
values: Object.values(pe),
|
|
1693
1693
|
supportsMultiValue: !0
|
|
1694
1694
|
},
|
|
1695
1695
|
{
|
|
1696
|
-
displayName:
|
|
1696
|
+
displayName: r._({ id: "644xgx" }),
|
|
1697
1697
|
filterName: "protected",
|
|
1698
1698
|
values: ["true", "false"],
|
|
1699
1699
|
supportsMultiValue: !1
|
|
1700
1700
|
}
|
|
1701
1701
|
],
|
|
1702
|
-
selectedFilters: et(
|
|
1703
|
-
}), [
|
|
1704
|
-
|
|
1705
|
-
}, []),
|
|
1706
|
-
|
|
1702
|
+
selectedFilters: et(o)
|
|
1703
|
+
}), [p, m] = q(o.search || ""), h = o.page ?? 1, [g, _] = q([]), [ee, v] = q(!1), [y, b] = q(!1), [te, ne] = q(!1), [x, S] = q(!1), C = o.memberStatus ?? "all", [w, T] = q(!0), [re, E] = q(/* @__PURE__ */ new Map()), [D, ie] = q(/* @__PURE__ */ new Set()), [O, k] = q(() => new Promise(() => {})), [A] = q(() => ot(t, n)), j = Pe((e) => {
|
|
1704
|
+
E((t) => new Map(t).set(e.id, e));
|
|
1705
|
+
}, []), ae = Pe((e) => {
|
|
1706
|
+
ie((t) => {
|
|
1707
1707
|
let n = new Set(t);
|
|
1708
1708
|
return Array.isArray(e) ? e.forEach((e) => n.add(e)) : n.add(e), n;
|
|
1709
1709
|
});
|
|
1710
|
-
}, []),
|
|
1711
|
-
|
|
1712
|
-
let
|
|
1710
|
+
}, []), oe = Pe(() => {
|
|
1711
|
+
E(/* @__PURE__ */ new Map()), T(!0);
|
|
1712
|
+
let e = o.memberStatus ?? "all", r = e === "all" ? void 0 : e;
|
|
1713
1713
|
Me(() => {
|
|
1714
|
-
let i =
|
|
1715
|
-
...tt(i,
|
|
1714
|
+
let i = e === "pending" || e === "accepted" ? (d.selectedFilters || []).filter((e) => e.name !== "visibility") : d.selectedFilters || [], a = at(t, n, s.sortBy, s.sortDirection, p, {
|
|
1715
|
+
...tt(i, d.filters),
|
|
1716
1716
|
member_status: r
|
|
1717
1717
|
});
|
|
1718
|
-
a.catch(() => {}).finally(() =>
|
|
1718
|
+
a.catch(() => {}).finally(() => T(!1)), k(a);
|
|
1719
1719
|
});
|
|
1720
1720
|
}, [
|
|
1721
|
-
|
|
1722
|
-
|
|
1721
|
+
t,
|
|
1722
|
+
s,
|
|
1723
|
+
p,
|
|
1723
1724
|
d,
|
|
1724
|
-
|
|
1725
|
-
a.memberStatus
|
|
1725
|
+
o.memberStatus
|
|
1726
1726
|
]);
|
|
1727
1727
|
Fe(() => {
|
|
1728
|
-
let
|
|
1729
|
-
|
|
1730
|
-
...
|
|
1731
|
-
selectedFilters:
|
|
1732
|
-
})),
|
|
1728
|
+
let e = et(o), r = o.sortBy || "created_at", i = o.sortDirection || "desc", a = o.search || "";
|
|
1729
|
+
f((t) => ({
|
|
1730
|
+
...t,
|
|
1731
|
+
selectedFilters: e
|
|
1732
|
+
})), u((e) => ({
|
|
1733
1733
|
...e,
|
|
1734
1734
|
sortBy: r,
|
|
1735
1735
|
sortDirection: i
|
|
1736
|
-
})),
|
|
1737
|
-
let s =
|
|
1736
|
+
})), m(a), _([]), E(/* @__PURE__ */ new Map()), T(!0);
|
|
1737
|
+
let s = o.memberStatus ?? "all", c = s === "all" ? void 0 : s;
|
|
1738
1738
|
Me(() => {
|
|
1739
|
-
let
|
|
1740
|
-
...tt(s === "pending" || s === "accepted" ? (
|
|
1741
|
-
member_status:
|
|
1739
|
+
let o = at(t, n, r, i, a, {
|
|
1740
|
+
...tt(s === "pending" || s === "accepted" ? (e || []).filter((e) => e.name !== "visibility") : e || [], d.filters),
|
|
1741
|
+
member_status: c
|
|
1742
1742
|
});
|
|
1743
|
-
|
|
1743
|
+
o.catch(() => {}).finally(() => T(!1)), k(o);
|
|
1744
1744
|
});
|
|
1745
1745
|
}, [
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1746
|
+
o.status,
|
|
1747
|
+
o.visibility,
|
|
1748
|
+
o.disk_format,
|
|
1749
|
+
o.container_format,
|
|
1750
|
+
o.protected,
|
|
1751
|
+
o.sortBy,
|
|
1752
|
+
o.sortDirection,
|
|
1753
|
+
o.search,
|
|
1754
|
+
o.memberStatus
|
|
1755
1755
|
]);
|
|
1756
|
-
let
|
|
1756
|
+
let se = (e) => {
|
|
1757
1757
|
let t = {
|
|
1758
1758
|
options: e.options,
|
|
1759
1759
|
sortBy: e.sortBy?.toString() || "created_at",
|
|
1760
1760
|
sortDirection: e.sortDirection || "desc"
|
|
1761
1761
|
};
|
|
1762
|
-
|
|
1762
|
+
u(t), a({
|
|
1763
1763
|
search: (e) => ({
|
|
1764
1764
|
...e,
|
|
1765
1765
|
sortBy: t.sortBy,
|
|
@@ -1768,8 +1768,8 @@ var $ = ({ client: e, project: t }) => {
|
|
|
1768
1768
|
}),
|
|
1769
1769
|
replace: !0
|
|
1770
1770
|
});
|
|
1771
|
-
},
|
|
1772
|
-
|
|
1771
|
+
}, M = (e) => {
|
|
1772
|
+
f(e), a({
|
|
1773
1773
|
search: (t) => rt(e.selectedFilters || [], e.filters, {
|
|
1774
1774
|
search: t.search,
|
|
1775
1775
|
sortBy: t.sortBy,
|
|
@@ -1778,9 +1778,9 @@ var $ = ({ client: e, project: t }) => {
|
|
|
1778
1778
|
}),
|
|
1779
1779
|
replace: !0
|
|
1780
1780
|
});
|
|
1781
|
-
},
|
|
1781
|
+
}, N = (e) => {
|
|
1782
1782
|
let t = typeof e == "string" ? e : "";
|
|
1783
|
-
|
|
1783
|
+
m(t), a({
|
|
1784
1784
|
search: (e) => ({
|
|
1785
1785
|
...e,
|
|
1786
1786
|
search: t || void 0,
|
|
@@ -1788,67 +1788,67 @@ var $ = ({ client: e, project: t }) => {
|
|
|
1788
1788
|
}),
|
|
1789
1789
|
replace: !0
|
|
1790
1790
|
});
|
|
1791
|
-
},
|
|
1792
|
-
|
|
1791
|
+
}, I = (e) => {
|
|
1792
|
+
a({ search: (t) => ({
|
|
1793
1793
|
sortBy: t.sortBy,
|
|
1794
1794
|
sortDirection: t.sortDirection,
|
|
1795
1795
|
search: t.search,
|
|
1796
1796
|
memberStatus: e === "all" ? void 0 : e
|
|
1797
1797
|
}) });
|
|
1798
|
-
},
|
|
1799
|
-
|
|
1798
|
+
}, R = Pe((e) => {
|
|
1799
|
+
a({ search: (t) => ({
|
|
1800
1800
|
...t,
|
|
1801
1801
|
page: e === 1 ? void 0 : e
|
|
1802
1802
|
}) });
|
|
1803
|
-
}, [
|
|
1803
|
+
}, [a]);
|
|
1804
1804
|
return /*#__PURE__*/ G("div", {
|
|
1805
1805
|
className: "relative",
|
|
1806
1806
|
children: /*#__PURE__*/ G(Ve, {
|
|
1807
|
-
fallbackRender: ({ error:
|
|
1807
|
+
fallbackRender: ({ error: t }) => /*#__PURE__*/ G(e, {
|
|
1808
1808
|
variant: "error",
|
|
1809
|
-
text:
|
|
1809
|
+
text: t instanceof Error ? t.message : r._({ id: "W5A0Ly" })
|
|
1810
1810
|
}),
|
|
1811
1811
|
children: /*#__PURE__*/ G(je, {
|
|
1812
|
-
fallback: /*#__PURE__*/ K(
|
|
1812
|
+
fallback: /*#__PURE__*/ K(c, {
|
|
1813
1813
|
className: "fixed inset-0",
|
|
1814
1814
|
distribution: "center",
|
|
1815
1815
|
alignment: "center",
|
|
1816
1816
|
direction: "vertical",
|
|
1817
|
-
children: [/*#__PURE__*/ G(
|
|
1817
|
+
children: [/*#__PURE__*/ G(l, {
|
|
1818
1818
|
variant: "primary",
|
|
1819
1819
|
size: "large",
|
|
1820
1820
|
className: "mb-2"
|
|
1821
1821
|
}), /*#__PURE__*/ G(X, { id: "HBpi4q" })]
|
|
1822
1822
|
}),
|
|
1823
1823
|
children: /*#__PURE__*/ G(ct, {
|
|
1824
|
-
imagesPromise:
|
|
1825
|
-
imageOverrides:
|
|
1826
|
-
deletedImageIds:
|
|
1827
|
-
permissionsPromise:
|
|
1828
|
-
searchTerm:
|
|
1829
|
-
setSearchTerm:
|
|
1830
|
-
sortSettings:
|
|
1831
|
-
handleSortChange:
|
|
1832
|
-
filterSettings:
|
|
1833
|
-
handleFilterChange:
|
|
1834
|
-
selectedImages:
|
|
1835
|
-
setSelectedImages:
|
|
1836
|
-
createModalOpen:
|
|
1837
|
-
setCreateModalOpen:
|
|
1838
|
-
deleteAllModalOpen:
|
|
1839
|
-
setDeleteAllModalOpen:
|
|
1840
|
-
deactivateAllModalOpen:
|
|
1841
|
-
setDeactivateAllModalOpen:
|
|
1842
|
-
activateAllModalOpen:
|
|
1843
|
-
setActivateAllModalOpen:
|
|
1844
|
-
memberStatusView:
|
|
1845
|
-
setMemberStatusView:
|
|
1846
|
-
isFetching:
|
|
1847
|
-
currentPage:
|
|
1848
|
-
onPageChange:
|
|
1849
|
-
onImageUpdated:
|
|
1850
|
-
onImageDeleted:
|
|
1851
|
-
onMemberStatusChanged:
|
|
1824
|
+
imagesPromise: O,
|
|
1825
|
+
imageOverrides: re,
|
|
1826
|
+
deletedImageIds: D,
|
|
1827
|
+
permissionsPromise: A,
|
|
1828
|
+
searchTerm: p,
|
|
1829
|
+
setSearchTerm: N,
|
|
1830
|
+
sortSettings: s,
|
|
1831
|
+
handleSortChange: se,
|
|
1832
|
+
filterSettings: d,
|
|
1833
|
+
handleFilterChange: M,
|
|
1834
|
+
selectedImages: g,
|
|
1835
|
+
setSelectedImages: _,
|
|
1836
|
+
createModalOpen: ee,
|
|
1837
|
+
setCreateModalOpen: v,
|
|
1838
|
+
deleteAllModalOpen: y,
|
|
1839
|
+
setDeleteAllModalOpen: b,
|
|
1840
|
+
deactivateAllModalOpen: te,
|
|
1841
|
+
setDeactivateAllModalOpen: ne,
|
|
1842
|
+
activateAllModalOpen: x,
|
|
1843
|
+
setActivateAllModalOpen: S,
|
|
1844
|
+
memberStatusView: C,
|
|
1845
|
+
setMemberStatusView: I,
|
|
1846
|
+
isFetching: w,
|
|
1847
|
+
currentPage: h,
|
|
1848
|
+
onPageChange: R,
|
|
1849
|
+
onImageUpdated: j,
|
|
1850
|
+
onImageDeleted: ae,
|
|
1851
|
+
onMemberStatusChanged: oe
|
|
1852
1852
|
})
|
|
1853
1853
|
})
|
|
1854
1854
|
})
|
|
@@ -1857,9 +1857,9 @@ var $ = ({ client: e, project: t }) => {
|
|
|
1857
1857
|
//#endregion
|
|
1858
1858
|
//#region src/client/routes/_auth/projects/$projectId/compute/images/index.tsx?tsr-split=component
|
|
1859
1859
|
function lt() {
|
|
1860
|
-
let { i18n: e, _: t } = Z(), { projectId: n } =
|
|
1860
|
+
let { i18n: e, _: t } = Z(), { projectId: n } = O.useParams(), { trpcClient: r } = O.useRouteContext();
|
|
1861
1861
|
if (!r) throw Error("trpcClient is not available in route context");
|
|
1862
|
-
return /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ G(
|
|
1862
|
+
return /*#__PURE__*/ K(W, { children: [/*#__PURE__*/ G(k, {
|
|
1863
1863
|
title: e._({ id: "an5hVd" }),
|
|
1864
1864
|
projectId: n
|
|
1865
1865
|
}), /*#__PURE__*/ G($, {
|
|
@@ -1870,4 +1870,4 @@ function lt() {
|
|
|
1870
1870
|
//#endregion
|
|
1871
1871
|
export { lt as component };
|
|
1872
1872
|
|
|
1873
|
-
//# sourceMappingURL=images-
|
|
1873
|
+
//# sourceMappingURL=images-CKqIXUq52.mjs.map
|