@cobaltcore-dev/aurora 2.1.1 → 2.2.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.
Files changed (173) hide show
  1. package/README.md +31 -25
  2. package/dist/client/AuroraApp.d.ts +9 -2
  3. package/dist/client/context/AppConfigContext.d.ts +44 -0
  4. package/dist/client/index.d.ts +2 -0
  5. package/dist/client/index.js +41221 -845
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/client/trpcClient.d.ts +314 -0
  8. package/dist/client/utils/appConfigGating.d.ts +21 -0
  9. package/dist/server/index.d.ts +694 -3
  10. package/dist/server/index.js +1748 -722
  11. package/package.json +3 -3
  12. package/dist/client/AuthProvider-CVSAwW9f.mjs +0 -83
  13. package/dist/client/AuthProvider-CVSAwW9f.mjs.map +0 -1
  14. package/dist/client/ContentHeader-fKKZVu-o.mjs +0 -116
  15. package/dist/client/ContentHeader-fKKZVu-o.mjs.map +0 -1
  16. package/dist/client/DeleteFlavorModal-C4nAi7gY.mjs +0 -724
  17. package/dist/client/DeleteFlavorModal-C4nAi7gY.mjs.map +0 -1
  18. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs +0 -26
  19. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs.map +0 -1
  20. package/dist/client/FiltersInput-Becwxo_J.mjs +0 -85
  21. package/dist/client/FiltersInput-Becwxo_J.mjs.map +0 -1
  22. package/dist/client/FloatingIpActionModals-Cq10WljB.mjs +0 -466
  23. package/dist/client/FloatingIpActionModals-Cq10WljB.mjs.map +0 -1
  24. package/dist/client/RouteIdLevelDefaultError-DPF_x2tG.mjs +0 -26
  25. package/dist/client/RouteIdLevelDefaultError-DPF_x2tG.mjs.map +0 -1
  26. package/dist/client/Slot-CWb612-_.mjs +0 -28
  27. package/dist/client/Slot-CWb612-_.mjs.map +0 -1
  28. package/dist/client/SortInput-4g7nSTHW.mjs +0 -34
  29. package/dist/client/SortInput-4g7nSTHW.mjs.map +0 -1
  30. package/dist/client/StorageNotFound-B-zVinVD.mjs +0 -30
  31. package/dist/client/StorageNotFound-B-zVinVD.mjs.map +0 -1
  32. package/dist/client/TwoColumnDescriptionList-DKS42RKa.mjs +0 -28
  33. package/dist/client/TwoColumnDescriptionList-DKS42RKa.mjs.map +0 -1
  34. package/dist/client/_-CAsCx-Ay.mjs +0 -6
  35. package/dist/client/_-CAsCx-Ay.mjs.map +0 -1
  36. package/dist/client/_auth-SrDjHL6j.mjs +0 -12
  37. package/dist/client/_auth-SrDjHL6j.mjs.map +0 -1
  38. package/dist/client/_flavorId-BPvssEzn.mjs +0 -277
  39. package/dist/client/_flavorId-BPvssEzn.mjs.map +0 -1
  40. package/dist/client/_flavorId-CFUBcU-l.mjs +0 -27
  41. package/dist/client/_flavorId-CFUBcU-l.mjs.map +0 -1
  42. package/dist/client/_flavorId-CZcIp0Ih.mjs +0 -22
  43. package/dist/client/_flavorId-CZcIp0Ih.mjs.map +0 -1
  44. package/dist/client/_floatingIpId-B8r64AL9.mjs +0 -196
  45. package/dist/client/_floatingIpId-B8r64AL9.mjs.map +0 -1
  46. package/dist/client/_floatingIpId-lEobpOER.mjs +0 -26
  47. package/dist/client/_floatingIpId-lEobpOER.mjs.map +0 -1
  48. package/dist/client/_imageId-BAezmV0Y.mjs +0 -526
  49. package/dist/client/_imageId-BAezmV0Y.mjs.map +0 -1
  50. package/dist/client/_imageId-D-jqz3e3.mjs +0 -40
  51. package/dist/client/_imageId-D-jqz3e3.mjs.map +0 -1
  52. package/dist/client/_imageId-gMdrdnVt.mjs +0 -22
  53. package/dist/client/_imageId-gMdrdnVt.mjs.map +0 -1
  54. package/dist/client/_projectId-BYccdAtX.mjs +0 -77
  55. package/dist/client/_projectId-BYccdAtX.mjs.map +0 -1
  56. package/dist/client/_projectId-CBjZC1tv.mjs +0 -283
  57. package/dist/client/_projectId-CBjZC1tv.mjs.map +0 -1
  58. package/dist/client/_projectId-CLEa1zgw.mjs +0 -30
  59. package/dist/client/_projectId-CLEa1zgw.mjs.map +0 -1
  60. package/dist/client/_projectId-D3VOH5lN.mjs +0 -94
  61. package/dist/client/_projectId-D3VOH5lN.mjs.map +0 -1
  62. package/dist/client/_securityGroupId-BwgZnoiR.mjs +0 -29
  63. package/dist/client/_securityGroupId-BwgZnoiR.mjs.map +0 -1
  64. package/dist/client/_securityGroupId-Cz2NUHdB.mjs +0 -1819
  65. package/dist/client/_securityGroupId-Cz2NUHdB.mjs.map +0 -1
  66. package/dist/client/_serviceType-DS8DxsrP.mjs +0 -20
  67. package/dist/client/_serviceType-DS8DxsrP.mjs.map +0 -1
  68. package/dist/client/_serviceType-M8d9rOT6.mjs +0 -6
  69. package/dist/client/_serviceType-M8d9rOT6.mjs.map +0 -1
  70. package/dist/client/_storageType-BNpP1A2N.mjs +0 -13
  71. package/dist/client/_storageType-BNpP1A2N.mjs.map +0 -1
  72. package/dist/client/_storageType-BxSGKhAI.mjs +0 -15
  73. package/dist/client/_storageType-BxSGKhAI.mjs.map +0 -1
  74. package/dist/client/_storageType-DZYCmiLt.mjs +0 -30
  75. package/dist/client/_storageType-DZYCmiLt.mjs.map +0 -1
  76. package/dist/client/_storageType-UqAMP-8d.mjs +0 -859
  77. package/dist/client/_storageType-UqAMP-8d.mjs.map +0 -1
  78. package/dist/client/_storageType-u51_7OwJ.mjs +0 -7
  79. package/dist/client/_storageType-u51_7OwJ.mjs.map +0 -1
  80. package/dist/client/about-BmQTyLWc.mjs +0 -92
  81. package/dist/client/about-BmQTyLWc.mjs.map +0 -1
  82. package/dist/client/assets/__mocks__/svgMock.d.ts +0 -3
  83. package/dist/client/aurora-CIml-f2f.mjs +0 -19
  84. package/dist/client/aurora-CIml-f2f.mjs.map +0 -1
  85. package/dist/client/build-WuxXRAqf.mjs +0 -14530
  86. package/dist/client/build-WuxXRAqf.mjs.map +0 -1
  87. package/dist/client/cn-DM4Cy3jv.mjs +0 -10
  88. package/dist/client/cn-DM4Cy3jv.mjs.map +0 -1
  89. package/dist/client/flavors-CJVSNz6R.mjs +0 -15
  90. package/dist/client/flavors-CJVSNz6R.mjs.map +0 -1
  91. package/dist/client/flavors-CflJDIEH.mjs +0 -667
  92. package/dist/client/flavors-CflJDIEH.mjs.map +0 -1
  93. package/dist/client/flavors-DWMZ6TuJ.mjs +0 -8
  94. package/dist/client/flavors-DWMZ6TuJ.mjs.map +0 -1
  95. package/dist/client/floatingips-Cz9k80cc.mjs +0 -8
  96. package/dist/client/floatingips-Cz9k80cc.mjs.map +0 -1
  97. package/dist/client/floatingips-DXnRlLvV.mjs +0 -551
  98. package/dist/client/floatingips-DXnRlLvV.mjs.map +0 -1
  99. package/dist/client/floatingips-HRbuLxiN.mjs +0 -22
  100. package/dist/client/floatingips-HRbuLxiN.mjs.map +0 -1
  101. package/dist/client/floatingips-nN1kQmsu.mjs +0 -14
  102. package/dist/client/floatingips-nN1kQmsu.mjs.map +0 -1
  103. package/dist/client/formatBytes-CZv_XyCY.mjs +0 -38
  104. package/dist/client/formatBytes-CZv_XyCY.mjs.map +0 -1
  105. package/dist/client/helpers-1PpYf-fC.mjs +0 -6
  106. package/dist/client/helpers-1PpYf-fC.mjs.map +0 -1
  107. package/dist/client/hooks-D0yKIumu.mjs +0 -22
  108. package/dist/client/hooks-D0yKIumu.mjs.map +0 -1
  109. package/dist/client/imageHelpers-DBhL2ebL.mjs +0 -1272
  110. package/dist/client/imageHelpers-DBhL2ebL.mjs.map +0 -1
  111. package/dist/client/images-BsylWUiH.mjs +0 -2011
  112. package/dist/client/images-BsylWUiH.mjs.map +0 -1
  113. package/dist/client/images-NBf2bV43.mjs +0 -8
  114. package/dist/client/images-NBf2bV43.mjs.map +0 -1
  115. package/dist/client/images-zQq1nSVv.mjs +0 -15
  116. package/dist/client/images-zQq1nSVv.mjs.map +0 -1
  117. package/dist/client/md-kvaGCNAK.mjs +0 -336
  118. package/dist/client/md-kvaGCNAK.mjs.map +0 -1
  119. package/dist/client/network-DuZm76BZ.mjs +0 -8
  120. package/dist/client/network-DuZm76BZ.mjs.map +0 -1
  121. package/dist/client/objects-BudUAfWY.mjs +0 -12909
  122. package/dist/client/objects-BudUAfWY.mjs.map +0 -1
  123. package/dist/client/objects-Dc7sKUr8.mjs +0 -67
  124. package/dist/client/objects-Dc7sKUr8.mjs.map +0 -1
  125. package/dist/client/objects-Dw7oeTq2.mjs +0 -80
  126. package/dist/client/objects-Dw7oeTq2.mjs.map +0 -1
  127. package/dist/client/objects-_g7nGIn5.mjs +0 -25
  128. package/dist/client/objects-_g7nGIn5.mjs.map +0 -1
  129. package/dist/client/objects-eBxvY6_n.mjs +0 -78
  130. package/dist/client/objects-eBxvY6_n.mjs.map +0 -1
  131. package/dist/client/projects-yiK0HGSA.mjs +0 -7
  132. package/dist/client/projects-yiK0HGSA.mjs.map +0 -1
  133. package/dist/client/routeInfo-DP3v74Wg.mjs +0 -19
  134. package/dist/client/routeInfo-DP3v74Wg.mjs.map +0 -1
  135. package/dist/client/routes-CJj7SR_K.mjs +0 -10
  136. package/dist/client/routes-CJj7SR_K.mjs.map +0 -1
  137. package/dist/client/routes-xofA3ksU.mjs +0 -110
  138. package/dist/client/routes-xofA3ksU.mjs.map +0 -1
  139. package/dist/client/securitygroups-CSmsBzUb.mjs +0 -581
  140. package/dist/client/securitygroups-CSmsBzUb.mjs.map +0 -1
  141. package/dist/client/securitygroups-CtKne8UQ.mjs +0 -8
  142. package/dist/client/securitygroups-CtKne8UQ.mjs.map +0 -1
  143. package/dist/client/securitygroups-T7kaNFEp.mjs +0 -15
  144. package/dist/client/securitygroups-T7kaNFEp.mjs.map +0 -1
  145. package/dist/client/securitygroups-WLB1_IM6.mjs +0 -22
  146. package/dist/client/securitygroups-WLB1_IM6.mjs.map +0 -1
  147. package/dist/client/securitygroups-o0IXZM6S.mjs +0 -14
  148. package/dist/client/securitygroups-o0IXZM6S.mjs.map +0 -1
  149. package/dist/client/serviceCatalog-B3lKWC9V.mjs +0 -6
  150. package/dist/client/serviceCatalog-B3lKWC9V.mjs.map +0 -1
  151. package/dist/client/services-D1PbooD1.mjs +0 -6
  152. package/dist/client/services-D1PbooD1.mjs.map +0 -1
  153. package/dist/client/services-DEMVtFyn.mjs +0 -9
  154. package/dist/client/services-DEMVtFyn.mjs.map +0 -1
  155. package/dist/client/storageProviders-CJ5rOh13.mjs +0 -15
  156. package/dist/client/storageProviders-CJ5rOh13.mjs.map +0 -1
  157. package/dist/client/trpcClient-D7gpR7YG.mjs +0 -71
  158. package/dist/client/trpcClient-D7gpR7YG.mjs.map +0 -1
  159. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs +0 -54
  160. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs.map +0 -1
  161. package/dist/client/useErrorTranslation-Dc0eE8Zt.mjs +0 -83
  162. package/dist/client/useErrorTranslation-Dc0eE8Zt.mjs.map +0 -1
  163. package/dist/client/useModal-DCs1OJh7.mjs +0 -12
  164. package/dist/client/useModal-DCs1OJh7.mjs.map +0 -1
  165. package/dist/client/useModalTracking-BYd37pXm.mjs +0 -37
  166. package/dist/client/useModalTracking-BYd37pXm.mjs.map +0 -1
  167. package/dist/client/useProjectId-DBc5lpoU.mjs +0 -11
  168. package/dist/client/useProjectId-DBc5lpoU.mjs.map +0 -1
  169. package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs +0 -294
  170. package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs.map +0 -1
  171. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs +0 -19
  172. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs.map +0 -1
  173. package/dist/client/utils/trpcErrors.d.ts +0 -13
@@ -1,2011 +0,0 @@
1
- import { C as e, D as t, K as n, L as r, O as i, Q as a, R as o, S as s, T as c, U as l, V as u, X as d, a as f, c as p, ft as m, g as h, h as g, i as _, it as v, l as y, m as b, o as x, ot as S, p as C, r as w, rt as T, st as E, t as D, x as O } from "./build-WuxXRAqf.mjs";
2
- import { a as k, i as A } from "./trpcClient-D7gpR7YG.mjs";
3
- import { t as j } from "./cn-DM4Cy3jv.mjs";
4
- import { t as M } from "./images-zQq1nSVv.mjs";
5
- import { t as ee } from "./useProjectId-DBc5lpoU.mjs";
6
- import { t as N } from "./SortInput-4g7nSTHW.mjs";
7
- import { t as P } from "./useModalTracking-BYd37pXm.mjs";
8
- import { t as F } from "./ContentHeader-fKKZVu-o.mjs";
9
- import "./hooks-D0yKIumu.mjs";
10
- import { A as I, C as L, D as R, E as te, F as z, I as B, L as ne, M as V, N as H, O as re, P as U, R as W, S as ie, T as ae, _ as oe, a as se, b as ce, c as le, d as ue, f as de, g as fe, h as pe, i as me, j as he, k as ge, l as _e, m as ve, n as G, o as ye, p as be, r as xe, s as Se, t as Ce, u as we, v as Te, w as Ee, x as De, y as Oe } from "./imageHelpers-DBhL2ebL.mjs";
11
- import { n as ke, t as Ae } from "./FiltersInput-Becwxo_J.mjs";
12
- import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
13
- import { Suspense as je, startTransition as Me, use as Ne, useCallback as Pe, useEffect as Y, useMemo as X, useRef as Fe, useState as Z } from "react";
14
- import { useNavigate as Ie, useParams as Le, useSearch as Re } from "@tanstack/react-router";
15
- import { TRPCClientError as ze } from "@trpc/client";
16
- import { Trans as Q, useLingui as $ } from "@lingui/react";
17
- import { z as Be } from "zod";
18
- import { ErrorBoundary as Ve } from "react-error-boundary";
19
- import { useForm as He, useStore as Ue } from "@tanstack/react-form";
20
- import "@trpc/server";
21
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/ImageTableRow.tsx
22
- function We({ image: e, isSelected: r, isPending: i, isAccepted: a, permissions: o, onEditDetails: s, onEditMetadata: l, onDelete: u, onSelect: d, onActivationStatusChange: f, onManageAccess: p, onUpdateVisibility: m, uploadId: g, uploadProgressPercent: _, onMemberStatusChanged: v, showSelectColumn: y = !1 }) {
23
- let { i18n: b, _: x } = $(), { id: C, name: T, status: A, visibility: j, size: M, disk_format: ee, created_at: N } = e, P = T || b._({ id: "MEIAzV" }), { projectId: F } = Le({ from: "/_auth/projects/$projectId/compute/images/" }), I = Ie(), L = k.useUtils(), R = k.compute.updateImageMember.useMutation({ onSuccess: () => {
24
- L.compute.listImagesWithPagination.invalidate(), L.compute.listSharedImagesByMemberStatus.invalidate();
25
- } }), te = async (e) => {
26
- try {
27
- await R.mutateAsync({
28
- project_id: F,
29
- imageId: C,
30
- memberId: F,
31
- status: e
32
- });
33
- let { message: t, ...n } = oe(e);
34
- S.info(t, n), v?.();
35
- } catch (e) {
36
- let t = e?.message, { message: n, ...r } = fe(t);
37
- S.error(n, r);
38
- }
39
- }, V = i || a, H = e.owner === F, re = R.isPending;
40
- return /*#__PURE__*/ J(c, {
41
- "data-testid": `image-row-${C}`,
42
- onClick: () => I({
43
- to: "/projects/$projectId/compute/images/$imageId",
44
- params: {
45
- projectId: F,
46
- imageId: C
47
- }
48
- }),
49
- children: [
50
- y && /*#__PURE__*/ q(D, {
51
- onClick: (e) => e.stopPropagation(),
52
- children: /*#__PURE__*/ q(E, {
53
- checked: r,
54
- onChange: () => d(e)
55
- })
56
- }),
57
- /*#__PURE__*/ q(D, { children: A }),
58
- /*#__PURE__*/ q(D, { children: P }),
59
- /*#__PURE__*/ q(D, { children: j }),
60
- /*#__PURE__*/ q(D, { children: e.protected ? b._({ id: "l75CjT" }) : b._({ id: "1UzENP" }) }),
61
- /*#__PURE__*/ q(D, { children: g && g === C ? `${_}%` : /*#__PURE__*/ q(W, { size: M }) }),
62
- /*#__PURE__*/ q(D, { children: ee || b._({ id: "fj5byd" }) }),
63
- /*#__PURE__*/ q(D, { children: N ? new Date(N).toLocaleDateString() : b._({ id: "fj5byd" }) }),
64
- /*#__PURE__*/ q(D, {
65
- onClick: (e) => e.stopPropagation(),
66
- children: re ? /*#__PURE__*/ q(n, {
67
- variant: "primary",
68
- size: "small"
69
- }) : /*#__PURE__*/ q(t, { children: /*#__PURE__*/ J(h, { children: [
70
- V && !H && o.canUpdateMember && /*#__PURE__*/ J(K, { children: [
71
- /*#__PURE__*/ q(O, {
72
- label: b._({ id: "v0hPHE" }),
73
- onClick: () => I({
74
- to: "/projects/$projectId/compute/images/$imageId",
75
- params: {
76
- projectId: F,
77
- imageId: C
78
- }
79
- })
80
- }),
81
- /*#__PURE__*/ q(w, {}),
82
- i && /*#__PURE__*/ q(O, {
83
- label: b._({ id: "g3UF2V" }),
84
- onClick: () => te(ne.ACCEPTED)
85
- }),
86
- /*#__PURE__*/ q(O, {
87
- label: b._({ id: "1t/NnN" }),
88
- onClick: () => te(ne.REJECTED)
89
- })
90
- ] }),
91
- !V && /*#__PURE__*/ q(O, {
92
- label: b._({ id: "v0hPHE" }),
93
- onClick: () => I({
94
- to: "/projects/$projectId/compute/images/$imageId",
95
- params: {
96
- projectId: F,
97
- imageId: C
98
- }
99
- })
100
- }),
101
- !V && o.canUpdate && /*#__PURE__*/ J(K, { children: [
102
- /*#__PURE__*/ q(O, {
103
- label: b._({ id: "Y1YKad" }),
104
- onClick: () => s(e)
105
- }),
106
- /*#__PURE__*/ q(O, {
107
- label: b._({ id: "SIfYq6" }),
108
- onClick: () => l(e)
109
- }),
110
- /*#__PURE__*/ q(w, {}),
111
- e.visibility === B.SHARED && (o.canCreateMember || o.canDeleteMember) && /*#__PURE__*/ q(O, {
112
- label: b._({ id: "cWbW6w" }),
113
- onClick: () => p(e)
114
- }),
115
- e.visibility === B.PRIVATE && /*#__PURE__*/ q(O, {
116
- label: b._({ id: "gMYsdZ" }),
117
- onClick: () => m(e.id, B.SHARED, P)
118
- }),
119
- /*#__PURE__*/ q(O, {
120
- label: e.status === z.DEACTIVATED ? b._({ id: "RSFkXF" }) : b._({ id: "hQr1Cr" }),
121
- onClick: () => f(e)
122
- })
123
- ] }),
124
- !V && o.canDelete && !e.protected && /*#__PURE__*/ J(K, { children: [/*#__PURE__*/ q(w, {}), /*#__PURE__*/ q(O, {
125
- label: b._({ id: "KWa0gi" }),
126
- onClick: () => u(e)
127
- })] })
128
- ] }) })
129
- })
130
- ]
131
- }, C);
132
- }
133
- //#endregion
134
- //#region src/server/Compute/helpers/imageHelpers.ts
135
- var Ge = {
136
- qcow2: [
137
- "bare",
138
- "ova",
139
- "docker"
140
- ],
141
- raw: [
142
- "bare",
143
- "ova",
144
- "docker"
145
- ],
146
- vmdk: ["bare", "ova"],
147
- vhd: ["bare", "ova"],
148
- vhdx: ["bare", "ova"],
149
- vdi: ["bare", "ova"],
150
- iso: ["bare"],
151
- ami: ["ami"],
152
- aki: ["aki"],
153
- ari: ["ari"],
154
- ploop: ["bare"]
155
- }, Ke = {
156
- qcow2: "bare",
157
- raw: "bare",
158
- vmdk: "bare",
159
- vhd: "bare",
160
- vhdx: "bare",
161
- vdi: "bare",
162
- iso: "bare",
163
- ami: "ami",
164
- aki: "aki",
165
- ari: "ari",
166
- ploop: "bare"
167
- };
168
- function qe(e) {
169
- return Ge[e] || [];
170
- }
171
- function Je(e) {
172
- return Ke[e] || "";
173
- }
174
- function Ye(e, t) {
175
- return qe(e).includes(t);
176
- }
177
- //#endregion
178
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/CreateImageModal.tsx
179
- var Xe = {
180
- name: "",
181
- tags: [],
182
- visibility: B.PRIVATE,
183
- disk_format: void 0,
184
- container_format: void 0,
185
- protected: !1,
186
- min_disk: 0,
187
- min_ram: 0
188
- }, Ze = ({ isOpen: e, onClose: t, onCreate: n, isLoading: i = !1, isUploadPending: s = !1, uploadProgressPercent: c, onCancelUpload: u }) => {
189
- let { i18n: f, _: p } = $(), [h, y] = Z({ ...Xe }), [x, S] = Z(""), [w, D] = Z(null), [O, k] = Z({}), [A, M] = Z(!1), [ee, N] = Z(null), P = h.name.trim() !== "" && w !== 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, F = X(() => h.disk_format ? qe(h.disk_format) : [], [h.disk_format]), I = [
190
- ".qcow2",
191
- ".raw",
192
- ".vmdk",
193
- ".vhd",
194
- ".vhdx",
195
- ".vdi",
196
- ".ami",
197
- ".ari",
198
- ".aki",
199
- ".iso",
200
- ".ploop",
201
- ".img"
202
- ], L = I.join(", "), R = (e) => {
203
- let { name: t, value: n, type: r, checked: i } = e.target;
204
- y((e) => ({
205
- ...e,
206
- [t]: r === "checkbox" ? i : n
207
- })), O[t] && k((e) => {
208
- let n = { ...e };
209
- return delete n[t], n;
210
- });
211
- }, te = (e) => {
212
- let { name: t, value: n } = e.target;
213
- t === "name" && (!n || n.trim() === "") && k((e) => ({
214
- ...e,
215
- name: f._({ id: "wyIOMP" })
216
- }));
217
- }, z = (e, t) => {
218
- if (e === "disk_format") {
219
- let e = t, n = Je(e);
220
- y((t) => ({
221
- ...t,
222
- disk_format: e,
223
- container_format: n
224
- }));
225
- } else y((n) => ({
226
- ...n,
227
- [e]: t
228
- }));
229
- O[e] && k((t) => {
230
- let n = { ...t };
231
- return delete n[e], n;
232
- });
233
- }, ne = (e, t) => {
234
- let n = t === "" ? 0 : parseInt(t, 10);
235
- isNaN(n) || (y((t) => ({
236
- ...t,
237
- [e]: n
238
- })), O[e] && k((t) => {
239
- let n = { ...t };
240
- return delete n[e], n;
241
- }));
242
- }, V = (e, t) => {
243
- t < 0 && (e === "min_disk" ? k((e) => ({
244
- ...e,
245
- min_disk: f._({ id: "K3bUTE" })
246
- })) : e === "min_ram" && k((e) => ({
247
- ...e,
248
- min_ram: f._({ id: "PEGvy+" })
249
- })));
250
- }, H = (e) => {
251
- let t = e.name.toLowerCase();
252
- I.some((e) => t.endsWith(e)) ? (D(e), O.file && k((e) => {
253
- let t = { ...e };
254
- return delete t.file, t;
255
- })) : k((e) => ({
256
- ...e,
257
- file: f._({
258
- id: "qzIZOL",
259
- values: { supportedFileFormats: L }
260
- })
261
- }));
262
- }, re = (e) => {
263
- let t = e.target.files?.[0];
264
- t && H(t);
265
- }, W = (e) => {
266
- e.preventDefault(), e.stopPropagation(), M(!0);
267
- }, ie = (e) => {
268
- e.preventDefault(), e.stopPropagation(), M(!1);
269
- }, ae = (e) => {
270
- e.preventDefault(), e.stopPropagation(), M(!1);
271
- let t = e.dataTransfer.files;
272
- t && t.length > 0 && H(t[0]);
273
- }, oe = (e) => {
274
- S(e.target.value);
275
- }, se = () => {
276
- let e = x.trim();
277
- if (e !== "") {
278
- if (h.tags.includes(e)) {
279
- S("");
280
- return;
281
- }
282
- y((t) => ({
283
- ...t,
284
- tags: [...t.tags, e]
285
- })), S("");
286
- }
287
- }, ce = (e) => {
288
- e.key === "Enter" && (e.preventDefault(), se());
289
- }, le = (e) => {
290
- y((t) => ({
291
- ...t,
292
- tags: t.tags.filter((t) => t !== e)
293
- }));
294
- }, ue = () => {
295
- let e = {};
296
- return (!h.name || h.name.trim() === "") && (e.name = f._({ id: "wyIOMP" })), w || (e.file = f._({ id: "aTqCTq" })), (!h.disk_format || h.disk_format.trim() === "") && (e.disk_format = f._({ id: "LK0pQN" })), (!h.container_format || h.container_format.trim() === "") && (e.container_format = f._({ id: "J4DKSM" })), h.disk_format && h.container_format && (Ye(h.disk_format, h.container_format) || (e.container_format = f._({ id: "BgMp/T" }))), h.min_disk < 0 && (e.min_disk = f._({ id: "K3bUTE" })), h.min_ram < 0 && (e.min_ram = f._({ id: "PEGvy+" })), k(e), Object.keys(e).length === 0;
297
- }, de = async (e) => {
298
- if (e.preventDefault(), N(null), !ue()) {
299
- N(f._({ id: "CBFSfX" }));
300
- return;
301
- }
302
- try {
303
- await n({
304
- name: h.name.trim(),
305
- tags: h.tags,
306
- visibility: h.visibility,
307
- disk_format: h.disk_format,
308
- container_format: h.container_format,
309
- protected: h.protected,
310
- min_disk: h.min_disk,
311
- min_ram: h.min_ram
312
- }, w), fe();
313
- } catch (e) {
314
- let t = e instanceof Error ? e.message : f._({ id: "TQn3hH" });
315
- N(t);
316
- }
317
- }, fe = () => {
318
- y({ ...Xe }), S(""), D(null), k({}), N(null), t();
319
- }, pe = i && s, me = i && !s;
320
- return /*#__PURE__*/ J(d, {
321
- open: e,
322
- onCancel: pe ? u : i ? void 0 : fe,
323
- size: "large",
324
- title: f._({ id: "xw2UtT" }),
325
- onConfirm: i ? void 0 : de,
326
- confirmButtonLabel: i ? void 0 : f._({ id: "a/nTb8" }),
327
- cancelButtonLabel: pe ? f._({ id: "tsaPT/" }) : f._({ id: "dEgA5A" }),
328
- disableConfirmButton: i || !P,
329
- disableCancelButton: me,
330
- closeable: !0,
331
- disableCloseButton: i,
332
- closeOnEsc: !i,
333
- children: [i && /*#__PURE__*/ q("div", {
334
- className: "mt-4",
335
- children: c ? /*#__PURE__*/ q("div", {
336
- className: "bg-neutral-quaternary w-full rounded-full",
337
- children: /*#__PURE__*/ J("div", {
338
- 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",
339
- style: { width: `${c}%` },
340
- children: [c, "%"]
341
- })
342
- }) : /*#__PURE__*/ q(T, {
343
- status: "progress",
344
- title: s ? f._({ id: "ca4F3Y" }) : f._({ id: "T6jnH+" }),
345
- className: "mt-0"
346
- })
347
- }), !i && /*#__PURE__*/ J(m, {
348
- className: "mb-6",
349
- children: [
350
- ee && /*#__PURE__*/ q(r, {
351
- variant: "error",
352
- className: "mb-6",
353
- children: ee
354
- }),
355
- /*#__PURE__*/ q(C, {
356
- className: "mb-6",
357
- children: /*#__PURE__*/ q(g, { children: /*#__PURE__*/ J("div", {
358
- className: "w-full",
359
- children: [
360
- /*#__PURE__*/ J("label", {
361
- htmlFor: "image-file",
362
- className: "mb-2 block text-sm font-medium text-gray-900",
363
- children: [f._({ id: "UKwOYH" }), /*#__PURE__*/ q("span", {
364
- className: "ml-1 text-red-500",
365
- children: "*"
366
- })]
367
- }),
368
- /*#__PURE__*/ q("div", {
369
- className: "flex w-full items-center justify-center",
370
- children: /*#__PURE__*/ J("label", {
371
- htmlFor: "image-file",
372
- onDragOver: W,
373
- onDragLeave: ie,
374
- onDrop: ae,
375
- className: j("flex h-24 w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed transition-all", A ? "border-blue-500 bg-blue-50" : "border-gray-300 bg-gray-50 hover:bg-gray-100"),
376
- children: [/*#__PURE__*/ J("div", {
377
- className: "flex flex-col items-center justify-center pt-3 pb-3",
378
- children: [
379
- /*#__PURE__*/ q("svg", {
380
- className: j("mb-1 h-6 w-6 transition-colors", A ? "text-blue-500" : "text-gray-500"),
381
- "aria-hidden": "true",
382
- xmlns: "http://www.w3.org/2000/svg",
383
- fill: "none",
384
- viewBox: "0 0 20 16",
385
- children: /*#__PURE__*/ q("path", {
386
- stroke: "currentColor",
387
- strokeLinecap: "round",
388
- strokeLinejoin: "round",
389
- strokeWidth: "2",
390
- d: "M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 5.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"
391
- })
392
- }),
393
- /*#__PURE__*/ q("p", {
394
- className: j("text-xs transition-colors", A ? "font-semibold text-blue-600" : "text-gray-500"),
395
- children: A ? /*#__PURE__*/ q("span", { children: f._({ id: "vXmL4D" }) }) : /*#__PURE__*/ J(K, { children: [
396
- /*#__PURE__*/ q("span", {
397
- className: "font-semibold",
398
- children: f._({ id: "gYe+hC" })
399
- }),
400
- " ",
401
- f._({ id: "Np28ib" })
402
- ] })
403
- }),
404
- /*#__PURE__*/ q("p", {
405
- className: "text-xs text-gray-400",
406
- children: f._({ id: "jBIkmi" })
407
- })
408
- ]
409
- }), /*#__PURE__*/ q("input", {
410
- id: "image-file",
411
- type: "file",
412
- className: "hidden",
413
- onChange: re,
414
- accept: L,
415
- disabled: i
416
- })]
417
- })
418
- }),
419
- w && /*#__PURE__*/ J("div", {
420
- className: "mt-2 flex items-center justify-between rounded-lg border border-green-200 bg-green-50 p-2 text-xs",
421
- children: [/*#__PURE__*/ J("div", {
422
- className: "flex items-center",
423
- children: [/*#__PURE__*/ q("svg", {
424
- className: "mr-2 h-4 w-4 text-green-600",
425
- fill: "currentColor",
426
- viewBox: "0 0 20 20",
427
- children: /*#__PURE__*/ q("path", {
428
- fillRule: "evenodd",
429
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
430
- clipRule: "evenodd"
431
- })
432
- }), /*#__PURE__*/ q("span", {
433
- className: "text-gray-700",
434
- children: w.name
435
- })]
436
- }), /*#__PURE__*/ q("button", {
437
- type: "button",
438
- onClick: () => {
439
- D(null), O.file && k((e) => {
440
- let t = { ...e };
441
- return delete t.file, t;
442
- });
443
- },
444
- className: "font-medium text-red-600 hover:text-red-800",
445
- disabled: i,
446
- children: f._({ id: "t/YqKh" })
447
- })]
448
- }),
449
- O.file && /*#__PURE__*/ q("p", {
450
- className: "text-theme-error mt-1 text-xs text-red-600",
451
- children: O.file
452
- })
453
- ]
454
- }) })
455
- }),
456
- /*#__PURE__*/ J(C, {
457
- className: "mb-6",
458
- children: [
459
- /*#__PURE__*/ q(g, {
460
- className: "mb-6",
461
- children: /*#__PURE__*/ q(b, {
462
- id: "name",
463
- name: "name",
464
- label: f._({ id: "ExLULX" }),
465
- value: h.name,
466
- onChange: R,
467
- onBlur: te,
468
- required: !0,
469
- errortext: O.name,
470
- disabled: i
471
- })
472
- }),
473
- /*#__PURE__*/ q(g, {
474
- className: "mb-6",
475
- children: /*#__PURE__*/ J("div", {
476
- className: "w-full",
477
- children: [/*#__PURE__*/ J(a, {
478
- gap: "1",
479
- direction: "horizontal",
480
- alignment: "start",
481
- children: [/*#__PURE__*/ q("div", {
482
- className: "flex-1",
483
- children: /*#__PURE__*/ q(b, {
484
- id: "tags",
485
- name: "tags",
486
- label: f._({ id: "OYHzN1" }),
487
- value: x,
488
- onChange: oe,
489
- onKeyDown: ce,
490
- helptext: f._({ id: "PpMrSG" }),
491
- disabled: i
492
- })
493
- }), /*#__PURE__*/ q(_, {
494
- onClick: se,
495
- disabled: i || x.trim() === "",
496
- children: /*#__PURE__*/ q(Q, { id: "m16xKo" })
497
- })]
498
- }), h.tags.length > 0 && /*#__PURE__*/ q(a, {
499
- gap: "1",
500
- wrap: !0,
501
- alignment: "center",
502
- className: "mt-1",
503
- children: h.tags.map((e) => /*#__PURE__*/ q(l, {
504
- closeable: !0,
505
- pillKey: "",
506
- pillValue: e,
507
- onClose: () => le(e)
508
- }, e))
509
- })]
510
- })
511
- }),
512
- /*#__PURE__*/ q(g, {
513
- className: "mb-6",
514
- children: /*#__PURE__*/ J(v, {
515
- id: "visibility",
516
- name: "visibility",
517
- label: f._({ id: "2q/Q7x" }),
518
- value: h.visibility,
519
- onChange: (e) => z("visibility", e),
520
- disabled: i,
521
- loading: i,
522
- children: [
523
- /*#__PURE__*/ q(o, {
524
- value: B.PUBLIC,
525
- label: f._({ id: "7d1a0d" })
526
- }),
527
- /*#__PURE__*/ q(o, {
528
- value: B.PRIVATE,
529
- label: f._({ id: "zwBp5t" })
530
- }),
531
- /*#__PURE__*/ q(o, {
532
- value: B.SHARED,
533
- label: f._({ id: "0Gd0NU" })
534
- }),
535
- /*#__PURE__*/ q(o, {
536
- value: B.COMMUNITY,
537
- label: f._({ id: "chL5IG" })
538
- })
539
- ]
540
- })
541
- }),
542
- /*#__PURE__*/ q(g, {
543
- className: "mb-6",
544
- children: /*#__PURE__*/ J(a, {
545
- direction: "horizontal",
546
- gap: "3",
547
- distribution: "evenly",
548
- className: "w-full",
549
- children: [/*#__PURE__*/ q("div", {
550
- className: "flex-1",
551
- children: /*#__PURE__*/ J(v, {
552
- id: "disk_format",
553
- name: "disk_format",
554
- label: f._({ id: "NopYGU" }),
555
- value: h.disk_format,
556
- onChange: (e) => z("disk_format", e),
557
- disabled: i,
558
- loading: i,
559
- required: !0,
560
- errortext: O.disk_format,
561
- children: [
562
- /*#__PURE__*/ q(o, {
563
- value: U.QCOW2,
564
- label: "QCOW2 - QEMU Emulator"
565
- }),
566
- /*#__PURE__*/ q(o, {
567
- value: U.RAW,
568
- label: "Raw"
569
- }),
570
- /*#__PURE__*/ q(o, {
571
- value: U.VMDK,
572
- label: "VMDK - Virtual Machine Disk"
573
- }),
574
- /*#__PURE__*/ q(o, {
575
- value: U.VHD,
576
- label: "VHD - Virtual Hard Disk"
577
- }),
578
- /*#__PURE__*/ q(o, {
579
- value: U.VHDX,
580
- label: "VHDX - Virtual Hard Disk Extended"
581
- }),
582
- /*#__PURE__*/ q(o, {
583
- value: U.VDI,
584
- label: "VDI - Virtual Disk Image"
585
- }),
586
- /*#__PURE__*/ q(o, {
587
- value: U.AMI,
588
- label: "AMI - Amazon Machine Image"
589
- }),
590
- /*#__PURE__*/ q(o, {
591
- value: U.ARI,
592
- label: "ARI - Amazon Ramdisk Image"
593
- }),
594
- /*#__PURE__*/ q(o, {
595
- value: U.AKI,
596
- label: "AKI - Amazon Kernel Image"
597
- }),
598
- /*#__PURE__*/ q(o, {
599
- value: U.ISO,
600
- label: "ISO - Optical Disk Image"
601
- }),
602
- /*#__PURE__*/ q(o, {
603
- value: U.PLOOP,
604
- label: "PLOOP - Virtuozzo/Parallels Loopback Disk"
605
- })
606
- ]
607
- })
608
- }), /*#__PURE__*/ q("div", {
609
- className: "flex-1",
610
- children: /*#__PURE__*/ q(v, {
611
- id: "container_format",
612
- name: "container_format",
613
- label: f._({ id: "6/xipy" }),
614
- value: h.container_format,
615
- onChange: (e) => z("container_format", e),
616
- disabled: i || !h.disk_format || !F.length,
617
- required: !0,
618
- errortext: O.container_format,
619
- helptext: !F.length && f._({ id: "A7CVME" }),
620
- children: F.map((e) => /*#__PURE__*/ q(o, {
621
- value: e,
622
- label: e.toUpperCase()
623
- }, e))
624
- })
625
- })]
626
- })
627
- }),
628
- /*#__PURE__*/ q(g, {
629
- className: "mb-0",
630
- children: /*#__PURE__*/ q(E, {
631
- id: "protected",
632
- name: "protected",
633
- label: f._({ id: "644xgx" }),
634
- checked: h.protected,
635
- onChange: R,
636
- helptext: f._({ id: "aV6KPH" }),
637
- disabled: i
638
- })
639
- })
640
- ]
641
- }),
642
- /*#__PURE__*/ q(C, {
643
- className: "mb-6",
644
- children: /*#__PURE__*/ q(g, {
645
- className: "mb-0",
646
- children: /*#__PURE__*/ J(a, {
647
- direction: "horizontal",
648
- gap: "3",
649
- distribution: "evenly",
650
- className: "w-full",
651
- children: [/*#__PURE__*/ q("div", {
652
- className: "flex-1",
653
- children: /*#__PURE__*/ q(b, {
654
- id: "min_disk",
655
- name: "min_disk",
656
- label: f._({ id: "NixRmA" }),
657
- type: "number",
658
- value: String(h.min_disk),
659
- onChange: (e) => ne("min_disk", e.target.value),
660
- onBlur: () => V("min_disk", h.min_disk),
661
- helptext: f._({ id: "4fh0Wj" }),
662
- errortext: O.min_disk,
663
- disabled: i
664
- })
665
- }), /*#__PURE__*/ q("div", {
666
- className: "flex-1",
667
- children: /*#__PURE__*/ q(b, {
668
- id: "min_ram",
669
- name: "min_ram",
670
- label: f._({ id: "CgZxr7" }),
671
- type: "number",
672
- value: String(h.min_ram),
673
- onChange: (e) => ne("min_ram", e.target.value),
674
- onBlur: () => V("min_ram", h.min_ram),
675
- helptext: f._({ id: "KsIM0b" }),
676
- errortext: O.min_ram,
677
- disabled: i
678
- })
679
- })]
680
- })
681
- })
682
- })
683
- ]
684
- })]
685
- });
686
- }, Qe = 20, $e = 100, et = ({ deletableImages: e, protectedImages: t, isOpen: n, isLoading: r, onClose: i, onDelete: o }) => {
687
- let { i18n: s, _: c } = $(), [l, u] = Z(null), { trackClose: f, markSubmitted: p, resetTracking: h } = P({
688
- isOpen: n,
689
- actionPrefix: "compute.images.delete"
690
- }), g = Be.object({ confirm: Be.string().refine((e) => e === "delete", { message: s._({ id: "QytzQr" }) }) }), _ = He({
691
- defaultValues: { confirm: "" },
692
- validators: { onSubmit: g },
693
- onSubmit: async () => {
694
- l === null && !r ? (p(), o(e.map((e) => e.id))) : S();
695
- }
696
- }), v = Ue(_.store, (e) => e.isSubmitting || e.values.confirm !== "delete"), y = e.length, x = t.length, S = () => {
697
- f(), u(null), _.reset(), h(), i();
698
- };
699
- if (l !== null) {
700
- let e = l.errors.slice(0, $e), t = l.errors.length - e.length;
701
- return /*#__PURE__*/ q(d, {
702
- open: n,
703
- onCancel: S,
704
- title: /*#__PURE__*/ q(Q, { id: "ExvQL2" }),
705
- size: "large",
706
- confirmButtonLabel: s._({ id: "DPfwMq" }),
707
- onConfirm: _.handleSubmit,
708
- children: /*#__PURE__*/ J(a, {
709
- direction: "vertical",
710
- gap: "4",
711
- children: [(() => {
712
- let e = l.deletedCount, t = l.errorCount;
713
- return /*#__PURE__*/ q("p", {
714
- className: "text-theme-default",
715
- children: /*#__PURE__*/ q(Q, {
716
- id: "deleteResults.summary",
717
- values: {
718
- deletedCount: e,
719
- errorCount: t
720
- }
721
- })
722
- });
723
- })(), l.errors.length > 0 && /*#__PURE__*/ J("div", { children: [/*#__PURE__*/ q("p", {
724
- className: "text-theme-light mb-2 text-sm",
725
- children: /*#__PURE__*/ q(Q, { id: "SDohXA" })
726
- }), /*#__PURE__*/ q("div", {
727
- className: "bg-theme-background-lvl-2 max-h-96 overflow-y-auto rounded p-4",
728
- children: /*#__PURE__*/ J(a, {
729
- direction: "vertical",
730
- gap: "2",
731
- children: [e.map((e) => /*#__PURE__*/ J("div", {
732
- className: "border-theme-background-lvl-3 border-b pb-2 last:border-0 last:pb-0",
733
- children: [/*#__PURE__*/ q("div", {
734
- className: "overflow-x-hidden font-medium [overflow-wrap:anywhere]",
735
- title: e.imageId,
736
- children: e.imageId
737
- }), e.message && /*#__PURE__*/ q("div", {
738
- className: "text-juno-red mt-1 text-sm",
739
- children: e.message
740
- })]
741
- }, e.imageId)), t > 0 && /*#__PURE__*/ q("div", {
742
- className: "text-theme-light pt-2 text-sm",
743
- children: /*#__PURE__*/ q(Q, {
744
- id: "K4EkxW",
745
- values: { hiddenErrorCount: t }
746
- })
747
- })]
748
- })
749
- })] })]
750
- })
751
- });
752
- }
753
- let w = e.slice(0, Qe), T = e.length - w.length, E = t.slice(0, Qe), D = t.length - E.length, O = r ? s._({ id: "EF2EU9" }) : y === 1 ? s._({ id: "KWa0gi" }) : s._({ id: "JtHgVz" });
754
- return /*#__PURE__*/ q(d, {
755
- open: n,
756
- onCancel: S,
757
- title: /*#__PURE__*/ q(Q, {
758
- id: "FZc7ea",
759
- values: { deletableCount: y }
760
- }),
761
- size: "large",
762
- confirmButtonLabel: O,
763
- confirmButtonVariant: "primary-danger",
764
- onConfirm: _.handleSubmit,
765
- cancelButtonLabel: s._({ id: "dEgA5A" }),
766
- disableConfirmButton: v || r,
767
- disableCancelButton: r,
768
- disableCloseButton: r,
769
- children: /*#__PURE__*/ J(a, {
770
- direction: "vertical",
771
- gap: "4",
772
- children: [
773
- /*#__PURE__*/ q("p", {
774
- className: "text-theme-default",
775
- children: /*#__PURE__*/ q(Q, { id: "V89FyE" })
776
- }),
777
- /*#__PURE__*/ J("div", {
778
- className: "space-y-3",
779
- children: [x > 0 && /*#__PURE__*/ J("div", { children: [/*#__PURE__*/ q("p", {
780
- className: "text-sm font-semibold",
781
- children: /*#__PURE__*/ q(Q, {
782
- id: "k1lWHA",
783
- values: { protectedCount: x }
784
- })
785
- }), /*#__PURE__*/ q("div", {
786
- className: "bg-theme-background-lvl-2 mt-2 max-h-48 overflow-y-auto rounded p-3",
787
- children: /*#__PURE__*/ J(a, {
788
- direction: "vertical",
789
- gap: "1",
790
- children: [E.map((e) => /*#__PURE__*/ J("div", {
791
- className: "text-theme-default text-sm",
792
- children: [/*#__PURE__*/ q("span", {
793
- className: "font-medium",
794
- children: e.name || s._({ id: "MEIAzV" })
795
- }), /*#__PURE__*/ J("span", {
796
- className: "text-theme-light ml-2 text-xs",
797
- children: [
798
- "(",
799
- e.id,
800
- ")"
801
- ]
802
- })]
803
- }, e.id)), D > 0 && /*#__PURE__*/ q("div", {
804
- className: "text-theme-light pt-2 text-sm",
805
- children: /*#__PURE__*/ q(Q, {
806
- id: "yZrrKY",
807
- values: { hiddenProtectedCount: D }
808
- })
809
- })]
810
- })
811
- })] }), y > 0 && /*#__PURE__*/ J("div", { children: [/*#__PURE__*/ q("p", {
812
- className: "text-sm font-semibold",
813
- children: /*#__PURE__*/ q(Q, {
814
- id: "A1M+ku",
815
- values: { deletableCount: y }
816
- })
817
- }), /*#__PURE__*/ q("div", {
818
- className: "bg-theme-background-lvl-2 mt-2 max-h-48 overflow-y-auto rounded p-3",
819
- children: /*#__PURE__*/ J(a, {
820
- direction: "vertical",
821
- gap: "1",
822
- children: [w.map((e) => /*#__PURE__*/ J("div", {
823
- className: "text-theme-default text-sm",
824
- children: [/*#__PURE__*/ q("span", {
825
- className: "font-medium",
826
- children: e.name || s._({ id: "MEIAzV" })
827
- }), /*#__PURE__*/ J("span", {
828
- className: "text-theme-light ml-2 text-xs",
829
- children: [
830
- "(",
831
- e.id,
832
- ")"
833
- ]
834
- })]
835
- }, e.id)), T > 0 && /*#__PURE__*/ q("div", {
836
- className: "text-theme-light pt-2 text-sm",
837
- children: /*#__PURE__*/ q(Q, {
838
- id: "0TREPo",
839
- values: { hiddenDeletableCount: T }
840
- })
841
- })]
842
- })
843
- })] })]
844
- }),
845
- /*#__PURE__*/ q(m, {
846
- className: "mb-0",
847
- id: "delete-images-form",
848
- onSubmit: (e) => {
849
- e.preventDefault(), _.handleSubmit();
850
- },
851
- children: /*#__PURE__*/ q(C, { children: /*#__PURE__*/ q(_.Field, {
852
- name: "confirm",
853
- children: (e) => /*#__PURE__*/ q(b, {
854
- label: s._({ id: "QytzQr" }),
855
- id: e.name,
856
- name: e.name,
857
- value: e.state.value,
858
- onChange: (t) => e.handleChange(t.target.value),
859
- invalid: e.state.meta.errors.length > 0,
860
- errortext: e.state.meta.errors.map((e) => typeof e == "string" ? e : e?.message).join(", ") || void 0,
861
- autoFocus: !0,
862
- disabled: r,
863
- required: !0
864
- })
865
- }) })
866
- })
867
- ]
868
- })
869
- });
870
- }, tt = ({ activeImages: e, deactivatedImages: t, isOpen: n, isLoading: r, onClose: i, onDeactivate: a }) => {
871
- let { i18n: o, _: s } = $(), c = e.length, l = t.length, u = (t) => {
872
- t.preventDefault(), a(e.map((e) => e.id));
873
- };
874
- return /*#__PURE__*/ q(d, {
875
- onCancel: i,
876
- size: "small",
877
- title: /*#__PURE__*/ q(Q, {
878
- id: "9SJ9QF",
879
- values: { activeCount: c }
880
- }),
881
- open: n,
882
- onConfirm: (e) => {
883
- u(e), i();
884
- },
885
- confirmButtonLabel: o._({ id: "5y3O+A" }),
886
- cancelButtonLabel: o._({ id: "dEgA5A" }),
887
- disableConfirmButton: r,
888
- disableCancelButton: r,
889
- disableCloseButton: r,
890
- children: r ? /*#__PURE__*/ q(T, {
891
- status: "progress",
892
- title: o._({ id: "ZVOPtb" }),
893
- className: "mt-0"
894
- }) : /*#__PURE__*/ q("div", {
895
- className: "my-6",
896
- children: c > 0 && /*#__PURE__*/ J(K, { children: [
897
- /*#__PURE__*/ q("p", {
898
- className: "mb-6",
899
- children: /*#__PURE__*/ q(Q, { id: "d3QRaL" })
900
- }),
901
- l > 0 && /*#__PURE__*/ J("div", {
902
- className: "mb-6",
903
- children: [/*#__PURE__*/ q("p", {
904
- className: "text-sm font-semibold",
905
- children: /*#__PURE__*/ q(Q, {
906
- id: "6enkjl",
907
- values: { deactivatedCount: l }
908
- })
909
- }), /*#__PURE__*/ q("div", {
910
- className: "jn:bg-theme-background-lvl-1 mt-2 max-h-24 overflow-y-auto rounded p-4",
911
- children: /*#__PURE__*/ q("div", {
912
- className: "space-y-1",
913
- children: t.map((e) => /*#__PURE__*/ J("div", {
914
- className: "text-theme-default text-sm",
915
- children: [/*#__PURE__*/ q("span", {
916
- className: "font-medium",
917
- children: e.name || o._({ id: "MEIAzV" })
918
- }), /*#__PURE__*/ J("span", {
919
- className: "text-theme-light ml-2 text-xs",
920
- children: [
921
- "(",
922
- e.id,
923
- ")"
924
- ]
925
- })]
926
- }, e.id))
927
- })
928
- })]
929
- }),
930
- /*#__PURE__*/ J("div", {
931
- className: "mb-6",
932
- children: [/*#__PURE__*/ q("p", {
933
- className: "text-sm font-semibold",
934
- children: /*#__PURE__*/ q(Q, {
935
- id: "v8OJPu",
936
- values: { activeCount: c }
937
- })
938
- }), /*#__PURE__*/ q("div", {
939
- className: "jn:bg-theme-background-lvl-1 mt-2 max-h-24 overflow-y-auto rounded p-4",
940
- children: /*#__PURE__*/ q("div", {
941
- className: "space-y-1",
942
- children: e.map((e) => /*#__PURE__*/ J("div", {
943
- className: "text-theme-default text-sm",
944
- children: [/*#__PURE__*/ q("span", {
945
- className: "font-medium",
946
- children: e.name || o._({ id: "MEIAzV" })
947
- }), /*#__PURE__*/ J("span", {
948
- className: "text-theme-light ml-2 text-xs",
949
- children: [
950
- "(",
951
- e.id,
952
- ")"
953
- ]
954
- })]
955
- }, e.id))
956
- })
957
- })]
958
- })
959
- ] })
960
- })
961
- });
962
- }, nt = ({ deactivatedImages: e, activeImages: t, isOpen: n, isLoading: r, onClose: i, onActivate: a }) => {
963
- let { i18n: o, _: s } = $(), c = e.length, l = t.length;
964
- return /*#__PURE__*/ q(d, {
965
- onCancel: i,
966
- size: "small",
967
- title: /*#__PURE__*/ q(Q, {
968
- id: "yETT/b",
969
- values: { deactivatedCount: c }
970
- }),
971
- open: n,
972
- onConfirm: (t) => {
973
- t.preventDefault(), a(e.map((e) => e.id));
974
- },
975
- confirmButtonLabel: o._({ id: "FQBaXG" }),
976
- cancelButtonLabel: o._({ id: "dEgA5A" }),
977
- disableConfirmButton: r,
978
- disableCancelButton: r,
979
- disableCloseButton: r,
980
- children: r ? /*#__PURE__*/ q(T, {
981
- status: "progress",
982
- title: o._({ id: "nuetDT" }),
983
- className: "mt-0"
984
- }) : /*#__PURE__*/ q("div", {
985
- className: "my-6",
986
- children: c > 0 && /*#__PURE__*/ J(K, { children: [
987
- /*#__PURE__*/ q("p", {
988
- className: "mb-6",
989
- children: /*#__PURE__*/ q(Q, { id: "5UiM8J" })
990
- }),
991
- l > 0 && /*#__PURE__*/ J("div", {
992
- className: "mb-6",
993
- children: [/*#__PURE__*/ q("p", {
994
- className: "text-sm font-semibold",
995
- children: /*#__PURE__*/ q(Q, {
996
- id: "QoVs5e",
997
- values: { activeCount: l }
998
- })
999
- }), /*#__PURE__*/ q("div", {
1000
- className: "jn:bg-theme-background-lvl-1 mt-2 max-h-24 overflow-y-auto rounded p-4",
1001
- children: /*#__PURE__*/ q("div", {
1002
- className: "space-y-1",
1003
- children: t.map((e) => /*#__PURE__*/ J("div", {
1004
- className: "text-theme-default text-sm",
1005
- children: [/*#__PURE__*/ q("span", {
1006
- className: "font-medium",
1007
- children: e.name || o._({ id: "MEIAzV" })
1008
- }), /*#__PURE__*/ J("span", {
1009
- className: "text-theme-light ml-2 text-xs",
1010
- children: [
1011
- "(",
1012
- e.id,
1013
- ")"
1014
- ]
1015
- })]
1016
- }, e.id))
1017
- })
1018
- })]
1019
- }),
1020
- /*#__PURE__*/ J("div", {
1021
- className: "mb-6",
1022
- children: [/*#__PURE__*/ q("p", {
1023
- className: "text-sm font-semibold",
1024
- children: /*#__PURE__*/ q(Q, {
1025
- id: "ezGecL",
1026
- values: { deactivatedCount: c }
1027
- })
1028
- }), /*#__PURE__*/ q("div", {
1029
- className: "jn:bg-theme-background-lvl-1 mt-2 max-h-24 overflow-y-auto rounded p-4",
1030
- children: /*#__PURE__*/ q("div", {
1031
- className: "space-y-1",
1032
- children: e.map((e) => /*#__PURE__*/ J("div", {
1033
- className: "text-theme-default text-sm",
1034
- children: [/*#__PURE__*/ q("span", {
1035
- className: "font-medium",
1036
- children: e.name || o._({ id: "MEIAzV" })
1037
- }), /*#__PURE__*/ J("span", {
1038
- className: "text-theme-light ml-2 text-xs",
1039
- children: [
1040
- "(",
1041
- e.id,
1042
- ")"
1043
- ]
1044
- })]
1045
- }, e.id))
1046
- })
1047
- })]
1048
- })
1049
- ] })
1050
- })
1051
- });
1052
- };
1053
- //#endregion
1054
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/ImageListView.tsx
1055
- function rt({ images: e, permissions: t, isFetching: n, currentPage: r = 1, totalPages: i = 1, onPageChange: a, children: o, selectedImages: l, setSelectedImages: d, deleteAllModalOpen: f, setDeleteAllModalOpen: p, deactivateAllModalOpen: m, setDeactivateAllModalOpen: h, activateAllModalOpen: g, setActivateAllModalOpen: _, createModalOpen: v, setCreateModalOpen: y, deletableImages: b, protectedImages: C, activeImages: w, deactivatedImages: E, onImageUpdated: O, onImageDeleted: j, onMemberStatusChanged: M, hasAnyBulkAction: N, pendingSharedIds: P, acceptedSharedIds: F }) {
1056
- let B = ee(), [ne, H] = Z(!1), [U, W] = Z(!1), [oe, fe] = Z(!1), [ke, Ae] = Z(!1), [je, Me] = Z(!1), [Ne, Pe] = Z(!1), [Y, X] = Z(null), [Ie, Le] = Z(!1), [Re, Be] = Z(null), [Ve, He] = Z(!1), Ue = Fe(null), Ge = Fe(!1), { i18n: Ke, _: qe } = $(), Je = k.useUtils(), Ye = k.compute.deleteImage.useMutation(), Xe = k.compute.deactivateImage.useMutation({ onSuccess: () => {
1057
- Je.compute.getImageById.invalidate();
1058
- } }), Qe = k.compute.reactivateImage.useMutation({ onSuccess: () => {
1059
- Je.compute.getImageById.invalidate();
1060
- } }), $e = k.compute.deleteImages.useMutation({ onSuccess: () => {
1061
- d([]);
1062
- } }), rt = k.compute.activateImages.useMutation({ onSuccess: () => {
1063
- d([]);
1064
- } }), it = k.compute.deactivateImages.useMutation({ onSuccess: () => {
1065
- d([]);
1066
- } }), at = k.compute.updateImage.useMutation({ onSuccess: (e) => {
1067
- Je.compute.getImageById.setData({
1068
- project_id: B,
1069
- imageId: e.id
1070
- }, e);
1071
- } }), ot = k.compute.createImage.useMutation(), st = k.compute.updateImageVisibility.useMutation(), { data: ct } = k.compute.watchUploadProgress.useSubscription({
1072
- project_id: B,
1073
- uploadId: Re || ""
1074
- }, { enabled: !!Re && Ve }), lt = Ye.isPending || Xe.isPending || Qe.isPending || $e.isPending || rt.isPending || it.isPending || at.isPending, ut = async (e, t, n) => {
1075
- try {
1076
- O(await st.mutateAsync({
1077
- project_id: B,
1078
- imageId: e,
1079
- visibility: t
1080
- }));
1081
- let { message: r, ...i } = he(n, t);
1082
- S.success(r, i);
1083
- } catch (e) {
1084
- let r = e?.message || Ke._({
1085
- id: "J9cmxx",
1086
- values: { newVisibility: t }
1087
- }), { message: i, ...a } = I(n, r);
1088
- S.error(i, a);
1089
- }
1090
- }, dt = async (e) => {
1091
- if (!Y) return !1;
1092
- let t = Y.id, n = e.name || Y.name || t;
1093
- try {
1094
- let r = Ce(e, Y), i = await at.mutateAsync({
1095
- project_id: B,
1096
- imageId: t,
1097
- operations: r
1098
- });
1099
- H(!1);
1100
- let { message: a, ...o } = re(n);
1101
- return S.success(a, o), X(i), O(i), !0;
1102
- } catch (e) {
1103
- let t = e?.message ?? "", { message: r, ...i } = R(n, t);
1104
- return S.error(r, i), X(null), !1;
1105
- }
1106
- }, ft = async (e, t) => {
1107
- let n = e.name || "Unnamed", r = null;
1108
- try {
1109
- Le(!0);
1110
- let i = await ot.mutateAsync({
1111
- project_id: B,
1112
- ...e
1113
- });
1114
- r = i.id;
1115
- let a = new AbortController();
1116
- Ue.current = a, Ge.current = !1, Be(i.id), He(!0), await A.compute.uploadImage.mutate(t, {
1117
- signal: a.signal,
1118
- context: { headers: {
1119
- "x-project-id": B,
1120
- "x-upload-id": i.id,
1121
- "x-upload-size": String(t.size)
1122
- } }
1123
- });
1124
- let { message: o, ...s } = De(n);
1125
- S.success(o, s), O(i), M();
1126
- } catch (e) {
1127
- if (Ge.current) {
1128
- if (r) try {
1129
- await Ye.mutateAsync({
1130
- project_id: B,
1131
- imageId: r
1132
- }), j(r);
1133
- } catch (e) {
1134
- let t = e?.message ?? "", { message: n, ...i } = Ee(r, t);
1135
- S.error(n, i);
1136
- }
1137
- return;
1138
- }
1139
- if (e instanceof ze && e.data?.path === "compute.createImage") {
1140
- let { message: t, ...r } = ce(n, e.message);
1141
- S.error(t, r);
1142
- } else {
1143
- let n = e?.message ?? "", { message: r, ...i } = te(t.name, n);
1144
- S.error(r, i);
1145
- }
1146
- } finally {
1147
- Ue.current = null, Ge.current = !1, Le(!1), y(!1), He(!1), Be(null);
1148
- }
1149
- }, pt = () => {
1150
- Ge.current = !0, Ue.current?.abort();
1151
- let { message: e, ...t } = ge();
1152
- S.info(e, t);
1153
- }, mt = async (e) => {
1154
- H(!1), W(!1);
1155
- let t = e.name || e.id, n = e.id;
1156
- try {
1157
- await Ye.mutateAsync({
1158
- project_id: B,
1159
- imageId: n
1160
- });
1161
- let { message: e, ...r } = ae(t);
1162
- S.success(e, r), j(n);
1163
- } catch (e) {
1164
- let t = e?.message ?? "", { message: r, ...i } = Ee(n, t);
1165
- S.error(r, i);
1166
- }
1167
- X(null);
1168
- }, ht = async (e) => {
1169
- e.status === z.DEACTIVATED ? (X(e), Me(!0)) : (X(e), Ae(!0));
1170
- }, gt = async (e) => {
1171
- let t = e.name || e.id, n = e.id;
1172
- try {
1173
- await Qe.mutateAsync({
1174
- project_id: B,
1175
- imageId: n
1176
- }), O({
1177
- ...e,
1178
- status: z.ACTIVE
1179
- }), Me(!1), X(null);
1180
- let { message: r, ...i } = Te(t);
1181
- S.success(r, i);
1182
- } catch (e) {
1183
- let t = e?.message ?? "", { message: r, ...i } = Oe(n, t);
1184
- S.error(r, i);
1185
- }
1186
- }, _t = async (e) => {
1187
- let t = e.name || e.id, n = e.id;
1188
- try {
1189
- await Xe.mutateAsync({
1190
- project_id: B,
1191
- imageId: n
1192
- }), O({
1193
- ...e,
1194
- status: z.DEACTIVATED
1195
- }), Ae(!1), X(null);
1196
- let { message: r, ...i } = ie(t);
1197
- S.success(r, i);
1198
- } catch (e) {
1199
- let t = e?.message ?? "", { message: r, ...i } = L(n, t);
1200
- S.error(r, i);
1201
- }
1202
- }, vt = (e) => {
1203
- X(e), H(!0);
1204
- }, yt = (e) => {
1205
- X(e), W(!0);
1206
- }, bt = (e) => {
1207
- X(e), fe(!0);
1208
- }, xt = (e) => {
1209
- X(e), Pe(!0);
1210
- }, St = () => {
1211
- X(null), H(!1);
1212
- }, Ct = () => {
1213
- X(null), W(!1), Je.compute.listImagesWithPagination.invalidate();
1214
- }, wt = () => {
1215
- X(null), fe(!1);
1216
- }, Tt = () => {
1217
- X(null), Ae(!1);
1218
- }, Et = () => {
1219
- X(null), Me(!1);
1220
- }, Dt = () => {
1221
- X(null), Pe(!1);
1222
- }, Ot = async (e) => {
1223
- p(!1);
1224
- try {
1225
- let t = await $e.mutateAsync({
1226
- project_id: B,
1227
- imageIds: e
1228
- }), n = t.successful.length, r = t.failed.length, i = e.length;
1229
- if (r === 0) {
1230
- let { message: e, ...t } = pe(n, i);
1231
- S.success(e, t);
1232
- } else if (n === 0) {
1233
- let { message: e, ...t } = be(r, i);
1234
- S.error(e, t);
1235
- } else {
1236
- let { message: e, ...t } = ve(n, r);
1237
- S.warning(e, t);
1238
- }
1239
- t.successful.length > 0 && j(t.successful);
1240
- } catch (t) {
1241
- let n = t?.message ?? "";
1242
- console.log("Bulk delete error: ", n);
1243
- let { message: r, ...i } = be(e.length, e.length);
1244
- S.error(r, i);
1245
- }
1246
- }, kt = async (t) => {
1247
- _(!1);
1248
- try {
1249
- let n = await rt.mutateAsync({
1250
- project_id: B,
1251
- imageIds: t
1252
- }), r = n.successful.length, i = n.failed.length, a = t.length;
1253
- if (n.successful.forEach((t) => {
1254
- let n = e.find((e) => e.id === t);
1255
- n && O({
1256
- ...n,
1257
- status: z.ACTIVE
1258
- });
1259
- }), i === 0) {
1260
- let { message: e, ...t } = _e(r, a);
1261
- S.success(e, t);
1262
- } else if (r === 0) {
1263
- let { message: e, ...t } = Se(i, a);
1264
- S.error(e, t);
1265
- } else {
1266
- let { message: e, ...t } = le(r, i);
1267
- S.warning(e, t);
1268
- }
1269
- } catch (e) {
1270
- let n = e?.message ?? "";
1271
- console.log("Bulk activate error: ", n);
1272
- let { message: r, ...i } = Se(t.length, t.length);
1273
- S.error(r, i);
1274
- }
1275
- }, At = async (t) => {
1276
- h(!1);
1277
- try {
1278
- let n = await it.mutateAsync({
1279
- project_id: B,
1280
- imageIds: t
1281
- }), r = n.successful.length, i = n.failed.length, a = t.length;
1282
- if (n.successful.forEach((t) => {
1283
- let n = e.find((e) => e.id === t);
1284
- n && O({
1285
- ...n,
1286
- status: z.DEACTIVATED
1287
- });
1288
- }), i === 0) {
1289
- let { message: e, ...t } = de(r, a);
1290
- S.success(e, t);
1291
- } else if (r === 0) {
1292
- let { message: e, ...t } = we(i, a);
1293
- S.error(e, t);
1294
- } else {
1295
- let { message: e, ...t } = ue(r, i);
1296
- S.warning(e, t);
1297
- }
1298
- } catch (e) {
1299
- let n = e?.message ?? "";
1300
- console.log("Bulk deactivate error: ", n);
1301
- let { message: r, ...i } = we(t.length, t.length);
1302
- S.error(r, i);
1303
- }
1304
- }, jt = (e) => {
1305
- e >= 1 && e <= i && a?.(e);
1306
- };
1307
- return lt ? /*#__PURE__*/ q("div", {
1308
- "data-testid": "loading",
1309
- children: /*#__PURE__*/ q(c, { children: /*#__PURE__*/ q(D, {
1310
- colSpan: 3,
1311
- children: /*#__PURE__*/ q(T, {
1312
- status: "progress",
1313
- title: Ke._({ id: "Z3FXyt" })
1314
- })
1315
- }) })
1316
- }) : /*#__PURE__*/ J(K, { children: [/*#__PURE__*/ q(K, { children: o }), /*#__PURE__*/ J("div", {
1317
- className: "relative",
1318
- children: [
1319
- n && /*#__PURE__*/ q("div", {
1320
- className: "bg-theme-background-lvl-0/50 absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm",
1321
- children: /*#__PURE__*/ q(T, {
1322
- status: "progress",
1323
- title: Ke._({ id: "HBpi4q" })
1324
- })
1325
- }),
1326
- /*#__PURE__*/ J(K, { children: [/*#__PURE__*/ J(x, {
1327
- columns: N ? 9 : 8,
1328
- minContentColumns: N ? [0, 8] : [7],
1329
- className: "images",
1330
- "data-testid": "images-table",
1331
- children: [/*#__PURE__*/ J(c, { children: [
1332
- N && /*#__PURE__*/ q(s, {}),
1333
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "uAQUqI" }) }),
1334
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "ExLULX" }) }),
1335
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "2q/Q7x" }) }),
1336
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "644xgx" }) }),
1337
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "Cj2Gtd" }) }),
1338
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "NopYGU" }) }),
1339
- /*#__PURE__*/ q(s, { children: /*#__PURE__*/ q(Q, { id: "d+F6q9" }) }),
1340
- /*#__PURE__*/ q(s, {})
1341
- ] }), e.length > 0 ? e.map((e) => /*#__PURE__*/ q(We, {
1342
- image: e,
1343
- isSelected: l.includes(e.id),
1344
- isPending: P.has(e.id),
1345
- isAccepted: F.has(e.id),
1346
- permissions: t,
1347
- onEditDetails: vt,
1348
- onEditMetadata: yt,
1349
- onDelete: bt,
1350
- onManageAccess: xt,
1351
- showSelectColumn: N,
1352
- onSelect: (e) => {
1353
- if (l.includes(e.id)) return d(l.filter((t) => t !== e.id));
1354
- d([...l, e.id]);
1355
- },
1356
- onActivationStatusChange: ht,
1357
- onUpdateVisibility: ut,
1358
- uploadId: Re,
1359
- uploadProgressPercent: ct?.percent,
1360
- onMemberStatusChanged: M
1361
- }, e.id)) : /*#__PURE__*/ q(c, { children: /*#__PURE__*/ q(D, {
1362
- colSpan: N ? 9 : 8,
1363
- children: /*#__PURE__*/ q(T, {
1364
- status: "empty",
1365
- title: Ke._({ id: "eYlnXt" }),
1366
- body: Ke._({ id: "qvF2D8" })
1367
- })
1368
- }) })]
1369
- }), i > 1 && /*#__PURE__*/ q("div", {
1370
- className: "flex justify-center py-4",
1371
- children: /*#__PURE__*/ q(u, {
1372
- variant: "input",
1373
- currentPage: r,
1374
- pages: i,
1375
- onPressPrevious: () => jt(Math.max(r - 1, 1)),
1376
- onPressNext: () => jt(Math.min(r + 1, i)),
1377
- onSelectChange: (e) => {
1378
- jt(e);
1379
- },
1380
- onInputChange: () => {},
1381
- onKeyDown: (e) => {
1382
- if (e.key === "Enter") {
1383
- let t = e.target.value;
1384
- if (t !== "") {
1385
- let e = parseInt(t, 10);
1386
- !isNaN(e) && e >= 1 && e <= i && jt(e);
1387
- }
1388
- }
1389
- }
1390
- })
1391
- })] }),
1392
- Y && /*#__PURE__*/ J(K, { children: [
1393
- /*#__PURE__*/ q(V, {
1394
- isOpen: ne,
1395
- onClose: St,
1396
- image: Y,
1397
- onSave: dt,
1398
- isLoading: at.isPending
1399
- }),
1400
- /*#__PURE__*/ q(ye, {
1401
- client: A,
1402
- isOpen: U,
1403
- onClose: Ct,
1404
- image: Y,
1405
- projectId: B
1406
- }, "edit-metadata-modal"),
1407
- /*#__PURE__*/ q(se, {
1408
- image: Y,
1409
- isOpen: oe,
1410
- isLoading: lt,
1411
- isDisabled: Y.protected || !t.canDelete,
1412
- onClose: wt,
1413
- onDelete: mt
1414
- }),
1415
- /*#__PURE__*/ q(xe, {
1416
- image: Y,
1417
- isOpen: ke,
1418
- isLoading: Xe.isPending,
1419
- onClose: Tt,
1420
- onDeactivate: _t
1421
- }),
1422
- /*#__PURE__*/ q(me, {
1423
- image: Y,
1424
- isOpen: je,
1425
- isLoading: Qe.isPending,
1426
- onClose: Et,
1427
- onActivate: gt
1428
- }),
1429
- /*#__PURE__*/ q(G, {
1430
- image: Y,
1431
- isOpen: Ne,
1432
- onClose: Dt,
1433
- permissions: t
1434
- })
1435
- ] }),
1436
- /*#__PURE__*/ q(et, {
1437
- isOpen: f,
1438
- deletableImages: b,
1439
- protectedImages: C,
1440
- isLoading: lt,
1441
- onClose: () => p(!1),
1442
- onDelete: Ot
1443
- }),
1444
- /*#__PURE__*/ q(tt, {
1445
- isOpen: m,
1446
- activeImages: w,
1447
- deactivatedImages: E,
1448
- isLoading: lt,
1449
- onClose: () => h(!1),
1450
- onDeactivate: At
1451
- }),
1452
- /*#__PURE__*/ q(nt, {
1453
- isOpen: g,
1454
- deactivatedImages: E,
1455
- activeImages: w,
1456
- isLoading: lt,
1457
- onClose: () => _(!1),
1458
- onActivate: kt
1459
- }),
1460
- /*#__PURE__*/ q(Ze, {
1461
- isOpen: v,
1462
- onClose: () => y(!1),
1463
- onCreate: ft,
1464
- isLoading: ot.isPending || Ve || Ie,
1465
- isUploadPending: Ve && !!Re,
1466
- uploadProgressPercent: ct?.percent,
1467
- onCancelUpload: pt
1468
- })
1469
- ]
1470
- })] });
1471
- }
1472
- //#endregion
1473
- //#region src/client/routes/_auth/projects/$projectId/compute/images/urlHelpers.ts
1474
- var it = (e) => {
1475
- let t = [];
1476
- return e.status && (e.status.startsWith("in:") ? e.status.replace("in:", "").split(",") : [e.status]).forEach((e) => {
1477
- t.push({
1478
- name: "status",
1479
- value: e
1480
- });
1481
- }), e.visibility && t.push({
1482
- name: "visibility",
1483
- value: e.visibility
1484
- }), e.disk_format && (e.disk_format.startsWith("in:") ? e.disk_format.replace("in:", "").split(",") : [e.disk_format]).forEach((e) => {
1485
- t.push({
1486
- name: "disk_format",
1487
- value: e
1488
- });
1489
- }), e.container_format && (e.container_format.startsWith("in:") ? e.container_format.replace("in:", "").split(",") : [e.container_format]).forEach((e) => {
1490
- t.push({
1491
- name: "container_format",
1492
- value: e
1493
- });
1494
- }), e.protected && t.push({
1495
- name: "protected",
1496
- value: e.protected
1497
- }), t;
1498
- }, at = (e, t) => {
1499
- let n = {};
1500
- if (!e?.length) return n;
1501
- let r = e.filter((e) => !e.inactive).reduce((e, t) => (e[t.name] || (e[t.name] = []), e[t.name].push(t.value), e), {});
1502
- return Object.entries(r).forEach(([e, r]) => {
1503
- t.find((t) => t.filterName === e)?.supportsMultiValue && r.length > 1 ? n[e] = `in:${r.join(",")}` : n[e] = r[0];
1504
- }), n;
1505
- }, ot = (e, t, n) => e.some((e) => e.name === t.name && e.value === t.value) ? e : n.find((e) => e.filterName === t.name)?.supportsMultiValue ? [...e, t] : [...e.filter((e) => e.name !== t.name), t], st = (e, t, n) => {
1506
- let r = {
1507
- search: n.search,
1508
- sortBy: n.sortBy,
1509
- sortDirection: n.sortDirection,
1510
- memberStatus: n.memberStatus === "all" ? void 0 : n.memberStatus
1511
- };
1512
- if (!e?.length) return r;
1513
- let i = e.filter((e) => !e.inactive).reduce((e, t) => (e[t.name] || (e[t.name] = []), e[t.name].push(t.value), e), {});
1514
- return Object.entries(i).forEach(([e, n]) => {
1515
- t.find((t) => t.filterName === e)?.supportsMultiValue && n.length > 1 ? r[e] = `in:${n.join(",")}` : r[e] = n[0];
1516
- }), r;
1517
- }, ct = {
1518
- images: [],
1519
- first: void 0,
1520
- next: void 0,
1521
- schema: "/v2/schemas/images",
1522
- listError: void 0
1523
- }, lt = (e, t, n, r, i, a, o) => a.member_status && a.member_status !== "all" ? e.compute.listSharedImagesByMemberStatus.query({
1524
- project_id: t,
1525
- memberStatus: a.member_status,
1526
- name: i || void 0,
1527
- status: a.status,
1528
- disk_format: a.disk_format,
1529
- container_format: a.container_format,
1530
- protected: a.protected,
1531
- sort: `${n}:${r}`
1532
- }).then((e) => ({
1533
- ...ct,
1534
- images: e
1535
- })).catch((e) => {
1536
- if (e instanceof ze && e.data?.code === "FORBIDDEN") return {
1537
- ...ct,
1538
- listError: e.message
1539
- };
1540
- throw e;
1541
- }) : e.compute.listImagesWithSearch.query({
1542
- project_id: t,
1543
- sort: `${n}:${r}`,
1544
- name: i || void 0,
1545
- ...a,
1546
- member_status: void 0,
1547
- marker: o
1548
- }).then((e) => ({
1549
- ...e,
1550
- listError: void 0
1551
- })).catch((e) => {
1552
- if (e instanceof ze && e.data?.code === "FORBIDDEN") return {
1553
- ...ct,
1554
- listError: e.message
1555
- };
1556
- throw e;
1557
- }), ut = (e, t) => e.compute.canUser.query({
1558
- project_id: t,
1559
- permission: [
1560
- "images:create",
1561
- "images:delete",
1562
- "images:update",
1563
- "images:create_member",
1564
- "images:delete_member",
1565
- "images:update_member"
1566
- ]
1567
- }).then(([e, t, n, r, i, a]) => ({
1568
- canCreate: e,
1569
- canDelete: t,
1570
- canUpdate: n,
1571
- canCreateMember: r,
1572
- canDeleteMember: i,
1573
- canUpdateMember: a ?? !1
1574
- }));
1575
- //#endregion
1576
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/List.tsx
1577
- function dt(e) {
1578
- if (e) return e.includes("?") ? new URL(e, "http://dummy.com").searchParams.get("marker") || void 0 : e;
1579
- }
1580
- function ft({ imagesPromise: n, imageOverrides: r, deletedImageIds: o, permissionsPromise: s, searchTerm: c, setSearchTerm: l, sortSettings: u, handleSortChange: d, filterSettings: m, handleFilterChange: g, selectedImages: v, setSelectedImages: b, createModalOpen: x, setCreateModalOpen: S, deleteAllModalOpen: C, setDeleteAllModalOpen: T, deactivateAllModalOpen: D, setDeactivateAllModalOpen: A, activateAllModalOpen: j, setActivateAllModalOpen: M, memberStatusView: P, setMemberStatusView: F, isFetching: I, currentPage: L, onPageChange: R, onImageUpdated: te, onImageDeleted: B, onMemberStatusChanged: ne }) {
1581
- let { i18n: V, _: H } = $(), re = ee(), U = Ne(n), W = Ne(s), [ie, ae] = Z(c), oe = Fe(void 0), se = k.compute.listSharedImagesByMemberStatus.useQuery({
1582
- project_id: re,
1583
- memberStatus: "pending"
1584
- }, { retry: !1 }), ce = k.compute.listSharedImagesByMemberStatus.useQuery({
1585
- project_id: re,
1586
- memberStatus: "accepted"
1587
- }, { retry: !1 }), le = new Set((se.data ?? []).map((e) => e.id)), ue = new Set((ce.data ?? []).map((e) => e.id));
1588
- if (Y(() => () => clearTimeout(oe.current), []), U.listError) return /*#__PURE__*/ q("p", { children: U.listError });
1589
- let de = U.images.filter((e) => !o.has(e.id)).map((e) => r.get(e.id) ?? e), fe = !!U.next, pe = U.totalCount ?? (fe ? 50 * (L + 1) : de.length), me = Math.max(1, Math.ceil(pe / 50)), he = Math.min(L, me);
1590
- Y(() => {
1591
- L !== he && R(he);
1592
- }, [
1593
- L,
1594
- he,
1595
- R
1596
- ]);
1597
- let ge = P === "pending" || P === "accepted" ? {
1598
- ...m,
1599
- filters: m.filters.filter((e) => e.filterName !== "visibility"),
1600
- selectedFilters: (m.selectedFilters || []).filter((e) => e.name !== "visibility")
1601
- } : m, _e = U.totalCount === void 0 ? de.slice((he - 1) * 50, he * 50) : de, ve = new Set(_e.map((e) => e.id)), G = v.filter((e) => ve.has(e)), ye = _e, be = new Map(_e.map((e) => [e.id, e])), xe = G.map((e) => be.get(e)).filter(Boolean).filter((e) => e.owner === re), Se = xe.filter((e) => e.protected !== !0), Ce = xe.filter((e) => e.protected === !0), we = xe.filter((e) => e.status === z.ACTIVE), Te = xe.filter((e) => e.status === z.DEACTIVATED), Ee = !W.canDelete || G.length === 0 || _e.filter((e) => G.includes(e.id)).every((e) => e.protected), De = !W.canUpdate || G.length === 0 || _e.filter((e) => G.includes(e.id)).every((e) => e.status === z.DEACTIVATED), Oe = !W.canUpdate || G.length === 0 || _e.filter((e) => G.includes(e.id)).every((e) => e.status === z.ACTIVE), je = {
1602
- items: [
1603
- {
1604
- label: V._({ id: "SFo0kK" }),
1605
- value: "all"
1606
- },
1607
- {
1608
- label: V._({ id: "thHAVL" }),
1609
- value: "accepted"
1610
- },
1611
- {
1612
- label: V._({ id: "E4QYe7" }),
1613
- value: "pending"
1614
- }
1615
- ],
1616
- activeItem: P,
1617
- onActiveItemChange: (e) => F(e)
1618
- };
1619
- return /*#__PURE__*/ J(K, { children: [
1620
- /*#__PURE__*/ J(a, {
1621
- distribution: "between",
1622
- alignment: "center",
1623
- gap: "2",
1624
- className: "pb-2",
1625
- children: [/*#__PURE__*/ q(i, {
1626
- activeItem: P,
1627
- onActiveItemChange: je.onActiveItemChange,
1628
- children: je.items.map((e) => /*#__PURE__*/ q(f, {
1629
- label: e.label,
1630
- value: e.value
1631
- }, e.value))
1632
- }), /*#__PURE__*/ J(a, {
1633
- gap: "2",
1634
- alignment: "center",
1635
- children: [/*#__PURE__*/ q(N, {
1636
- options: u.options,
1637
- sortBy: u.sortBy,
1638
- sortDirection: u.sortDirection ?? "desc",
1639
- selectClassName: "min-w-40",
1640
- onSortByChange: (e) => d({
1641
- ...u,
1642
- sortBy: e,
1643
- sortDirection: u.sortDirection
1644
- }),
1645
- onSortDirectionChange: (e) => d({
1646
- ...u,
1647
- sortDirection: e
1648
- })
1649
- }), W.canCreate && /*#__PURE__*/ q(_, {
1650
- onClick: () => S(!0),
1651
- variant: "primary",
1652
- children: /*#__PURE__*/ q(Q, { id: "a/nTb8" })
1653
- })]
1654
- })]
1655
- }),
1656
- /*#__PURE__*/ q(y, { children: /*#__PURE__*/ J(a, {
1657
- direction: "vertical",
1658
- gap: "2",
1659
- children: [/*#__PURE__*/ J(a, {
1660
- distribution: "between",
1661
- alignment: "center",
1662
- children: [/*#__PURE__*/ q(Ae, {
1663
- filters: ge.filters,
1664
- selectClassName: "sm:min-w-40",
1665
- comboboxClassName: "sm:min-w-40",
1666
- onChange: (e) => {
1667
- let t = ot(ge.selectedFilters || [], e, ge.filters);
1668
- t !== (ge.selectedFilters || []) && g({
1669
- ...m,
1670
- selectedFilters: t
1671
- });
1672
- }
1673
- }), /*#__PURE__*/ q(e, {
1674
- "data-testid": "searchbar",
1675
- value: ie,
1676
- onInput: (e) => {
1677
- let t = e.currentTarget.value;
1678
- ae(t), clearTimeout(oe.current), oe.current = window.setTimeout(() => l(t), 500);
1679
- },
1680
- onSearch: (e) => {
1681
- clearTimeout(oe.current), l(typeof e == "string" ? e : "");
1682
- },
1683
- onClear: () => {
1684
- clearTimeout(oe.current), ae(""), l("");
1685
- }
1686
- })]
1687
- }), ge.selectedFilters && ge.selectedFilters.length > 0 && /*#__PURE__*/ q(ke, {
1688
- selectedFilters: ge.selectedFilters,
1689
- onDelete: (e) => g({
1690
- ...m,
1691
- selectedFilters: (m.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
1692
- }),
1693
- onClear: () => g({
1694
- ...m,
1695
- selectedFilters: []
1696
- })
1697
- })]
1698
- }) }),
1699
- (W.canDelete || W.canUpdate) && /*#__PURE__*/ q(y, { children: /*#__PURE__*/ q(a, {
1700
- distribution: "between",
1701
- alignment: "center",
1702
- children: /*#__PURE__*/ J(a, {
1703
- gap: "2",
1704
- alignment: "center",
1705
- children: [/*#__PURE__*/ q(E, {
1706
- checked: G.length > 0 && ye.every((e) => G.includes(e.id)),
1707
- indeterminate: G.length > 0 && !ye.every((e) => G.includes(e.id)),
1708
- onChange: () => {
1709
- let e = ye.map((e) => e.id);
1710
- e.every((e) => G.includes(e)) ? b(G.filter((t) => !e.includes(t))) : b([.../* @__PURE__ */ new Set([...G, ...e])]);
1711
- }
1712
- }), /*#__PURE__*/ J(t, { children: [/*#__PURE__*/ q(p, {
1713
- as: "div",
1714
- children: /*#__PURE__*/ q(_, {
1715
- size: "small",
1716
- icon: "moreVert",
1717
- label: V._({ id: "7L01XJ" })
1718
- })
1719
- }), /*#__PURE__*/ J(h, { children: [
1720
- W.canUpdate && /*#__PURE__*/ q(O, {
1721
- disabled: Oe,
1722
- label: V._({ id: "d/I0J3" }),
1723
- onClick: () => M(!0)
1724
- }),
1725
- W.canUpdate && /*#__PURE__*/ q(O, {
1726
- disabled: De,
1727
- label: V._({ id: "UmQ3/m" }),
1728
- onClick: () => A(!0)
1729
- }),
1730
- W.canDelete && /*#__PURE__*/ J(K, { children: [/*#__PURE__*/ q(w, {}), /*#__PURE__*/ q(O, {
1731
- disabled: Ee,
1732
- label: V._({ id: "c6b6fz" }),
1733
- onClick: () => T(!0)
1734
- })] })
1735
- ] })] })]
1736
- })
1737
- }) }),
1738
- /*#__PURE__*/ q(rt, {
1739
- images: ye,
1740
- permissions: W,
1741
- isFetching: I,
1742
- currentPage: he,
1743
- totalPages: me,
1744
- onPageChange: R,
1745
- selectedImages: v,
1746
- setSelectedImages: b,
1747
- deleteAllModalOpen: C,
1748
- setDeleteAllModalOpen: T,
1749
- deactivateAllModalOpen: D,
1750
- setDeactivateAllModalOpen: A,
1751
- activateAllModalOpen: j,
1752
- setActivateAllModalOpen: M,
1753
- createModalOpen: x,
1754
- setCreateModalOpen: S,
1755
- deletableImages: Se,
1756
- protectedImages: Ce,
1757
- activeImages: we,
1758
- deactivatedImages: Te,
1759
- onImageUpdated: te,
1760
- onImageDeleted: B,
1761
- onMemberStatusChanged: ne,
1762
- hasAnyBulkAction: W.canDelete || W.canUpdate,
1763
- pendingSharedIds: le,
1764
- acceptedSharedIds: ue
1765
- })
1766
- ] });
1767
- }
1768
- var pt = ({ client: e, project: t }) => {
1769
- let { i18n: n, _: r } = $(), i = Ie(), a = Re({ strict: !1 }), [o, s] = Z({
1770
- options: [
1771
- {
1772
- label: n._({ id: "88kg0+" }),
1773
- value: "created_at"
1774
- },
1775
- {
1776
- label: n._({ id: "ExLULX" }),
1777
- value: "name"
1778
- },
1779
- {
1780
- label: n._({ id: "Cj2Gtd" }),
1781
- value: "size"
1782
- },
1783
- {
1784
- label: n._({ id: "uAQUqI" }),
1785
- value: "status"
1786
- }
1787
- ],
1788
- sortBy: a.sortBy || "created_at",
1789
- sortDirection: a.sortDirection || "desc"
1790
- }), [c, l] = Z({
1791
- filters: [
1792
- {
1793
- displayName: n._({ id: "uAQUqI" }),
1794
- filterName: "status",
1795
- values: Object.values(z),
1796
- supportsMultiValue: !0
1797
- },
1798
- {
1799
- displayName: n._({ id: "2q/Q7x" }),
1800
- filterName: "visibility",
1801
- values: Object.values(B),
1802
- supportsMultiValue: !1
1803
- },
1804
- {
1805
- displayName: n._({ id: "NopYGU" }),
1806
- filterName: "disk_format",
1807
- values: Object.values(U),
1808
- supportsMultiValue: !0
1809
- },
1810
- {
1811
- displayName: n._({ id: "6/xipy" }),
1812
- filterName: "container_format",
1813
- values: Object.values(H),
1814
- supportsMultiValue: !0
1815
- },
1816
- {
1817
- displayName: n._({ id: "644xgx" }),
1818
- filterName: "protected",
1819
- values: ["true", "false"],
1820
- supportsMultiValue: !1
1821
- }
1822
- ],
1823
- selectedFilters: it(a)
1824
- }), [u, d] = Z(a.search || ""), f = a.page ?? 1, [p, m] = Z([]), [h, g] = Z(!1), [_, v] = Z(!1), [y, b] = Z(!1), [x, S] = Z(!1), C = a.memberStatus ?? "all", [w, E] = Z(!0), [D, O] = Z(/* @__PURE__ */ new Map()), [k, A] = Z(/* @__PURE__ */ new Set()), [j, M] = Z(/* @__PURE__ */ new Map([[1, void 0]])), [ee, N] = Z(() => new Promise(() => {})), [P] = Z(() => ut(e, t)), F = Pe((e, t) => e === "pending" || e === "accepted" ? (t || []).filter((e) => e.name !== "visibility") : t || [], []), I = Pe((e) => {
1825
- O((t) => new Map(t).set(e.id, e));
1826
- }, []), L = Pe((e) => {
1827
- A((t) => {
1828
- let n = new Set(t);
1829
- return Array.isArray(e) ? e.forEach((e) => n.add(e)) : n.add(e), n;
1830
- });
1831
- }, []), R = Pe(() => {
1832
- O(/* @__PURE__ */ new Map()), E(!0);
1833
- let n = a.memberStatus ?? "all", r = n === "all" ? void 0 : n;
1834
- Me(() => {
1835
- let i = F(n, c.selectedFilters), a = j.get(f), s = lt(e, t, o.sortBy, o.sortDirection, u, {
1836
- ...at(i, c.filters),
1837
- member_status: r
1838
- }, a);
1839
- s.then((e) => {
1840
- M((t) => {
1841
- if (!e.next) return t;
1842
- let n = f + 1;
1843
- return t.has(n) ? t : new Map(t).set(n, dt(e.next));
1844
- });
1845
- }).catch(() => {}).finally(() => E(!1)), N(s);
1846
- });
1847
- }, [
1848
- e,
1849
- o,
1850
- u,
1851
- c,
1852
- a.memberStatus,
1853
- f,
1854
- j
1855
- ]);
1856
- Y(() => {
1857
- let n = it(a), r = a.sortBy || "created_at", o = a.sortDirection || "desc", u = a.search || "", f = a.page ?? 1;
1858
- l((e) => ({
1859
- ...e,
1860
- selectedFilters: n
1861
- })), s((e) => ({
1862
- ...e,
1863
- sortBy: r,
1864
- sortDirection: o
1865
- })), d(u), m([]), O(/* @__PURE__ */ new Map()), E(!0);
1866
- let p = a.memberStatus ?? "all", h = p === "all" ? void 0 : p;
1867
- Me(() => {
1868
- let a = F(p, n), s = j.get(f);
1869
- if (!s && f > 1) {
1870
- i({ search: (e) => ({
1871
- ...e,
1872
- page: void 0
1873
- }) }), E(!1);
1874
- return;
1875
- }
1876
- let l = lt(e, t, r, o, u, {
1877
- ...at(a, c.filters),
1878
- member_status: h
1879
- }, s);
1880
- l.then((e) => {
1881
- M((t) => {
1882
- if (!e.next) return t;
1883
- let n = f + 1;
1884
- return t.has(n) ? t : new Map(t).set(n, dt(e.next));
1885
- });
1886
- }).catch(() => {}).finally(() => E(!1)), N(l);
1887
- });
1888
- }, [
1889
- a.status,
1890
- a.visibility,
1891
- a.disk_format,
1892
- a.container_format,
1893
- a.protected,
1894
- a.sortBy,
1895
- a.sortDirection,
1896
- a.search,
1897
- a.memberStatus,
1898
- a.page
1899
- ]);
1900
- let te = (e) => {
1901
- let t = {
1902
- options: e.options,
1903
- sortBy: e.sortBy?.toString() || "created_at",
1904
- sortDirection: e.sortDirection || "desc"
1905
- };
1906
- s(t), M(/* @__PURE__ */ new Map([[1, void 0]])), i({
1907
- search: (e) => ({
1908
- ...e,
1909
- sortBy: t.sortBy,
1910
- sortDirection: t.sortDirection,
1911
- page: void 0
1912
- }),
1913
- replace: !0
1914
- });
1915
- }, ne = (e) => {
1916
- l(e), M(/* @__PURE__ */ new Map([[1, void 0]])), i({
1917
- search: (t) => st(e.selectedFilters || [], e.filters, {
1918
- search: t.search,
1919
- sortBy: t.sortBy,
1920
- sortDirection: t.sortDirection,
1921
- memberStatus: t.memberStatus
1922
- }),
1923
- replace: !0
1924
- });
1925
- }, V = (e) => {
1926
- let t = typeof e == "string" ? e : "";
1927
- d(t), M(/* @__PURE__ */ new Map([[1, void 0]])), i({
1928
- search: (e) => ({
1929
- ...e,
1930
- search: t || void 0,
1931
- page: void 0
1932
- }),
1933
- replace: !0
1934
- });
1935
- }, re = (e) => {
1936
- M(/* @__PURE__ */ new Map([[1, void 0]])), i({ search: (t) => ({
1937
- sortBy: t.sortBy,
1938
- sortDirection: t.sortDirection,
1939
- search: t.search,
1940
- memberStatus: e === "all" ? void 0 : e
1941
- }) });
1942
- }, W = Pe((e) => {
1943
- i({ search: (t) => ({
1944
- ...t,
1945
- page: e === 1 ? void 0 : e
1946
- }) });
1947
- }, [i]);
1948
- return /*#__PURE__*/ q("div", {
1949
- className: "relative",
1950
- children: /*#__PURE__*/ q(Ve, {
1951
- fallbackRender: ({ error: e }) => /*#__PURE__*/ q(T, {
1952
- status: "error",
1953
- title: n._({ id: "v2JOoQ" }),
1954
- body: e instanceof Error ? e.message : n._({ id: "6YfMI7" })
1955
- }),
1956
- children: /*#__PURE__*/ q(je, {
1957
- fallback: /*#__PURE__*/ q(T, {
1958
- status: "progress",
1959
- title: n._({ id: "HBpi4q" })
1960
- }),
1961
- children: /*#__PURE__*/ q(ft, {
1962
- imagesPromise: ee,
1963
- imageOverrides: D,
1964
- deletedImageIds: k,
1965
- permissionsPromise: P,
1966
- searchTerm: u,
1967
- setSearchTerm: V,
1968
- sortSettings: o,
1969
- handleSortChange: te,
1970
- filterSettings: c,
1971
- handleFilterChange: ne,
1972
- selectedImages: p,
1973
- setSelectedImages: m,
1974
- createModalOpen: h,
1975
- setCreateModalOpen: g,
1976
- deleteAllModalOpen: _,
1977
- setDeleteAllModalOpen: v,
1978
- deactivateAllModalOpen: y,
1979
- setDeactivateAllModalOpen: b,
1980
- activateAllModalOpen: x,
1981
- setActivateAllModalOpen: S,
1982
- memberStatusView: C,
1983
- setMemberStatusView: re,
1984
- isFetching: w,
1985
- currentPage: f,
1986
- onPageChange: W,
1987
- onImageUpdated: I,
1988
- onImageDeleted: L,
1989
- onMemberStatusChanged: R
1990
- })
1991
- })
1992
- })
1993
- });
1994
- };
1995
- //#endregion
1996
- //#region src/client/routes/_auth/projects/$projectId/compute/images/index.tsx?tsr-split=component
1997
- function mt() {
1998
- let { i18n: e, _: t } = $(), { projectId: n } = M.useParams(), { trpcClient: r } = M.useRouteContext();
1999
- if (!r) throw Error("trpcClient is not available in route context");
2000
- return /*#__PURE__*/ J(K, { children: [/*#__PURE__*/ q(F, {
2001
- title: e._({ id: "an5hVd" }),
2002
- projectId: n
2003
- }), /*#__PURE__*/ q(pt, {
2004
- client: r,
2005
- project: n
2006
- })] });
2007
- }
2008
- //#endregion
2009
- export { mt as component };
2010
-
2011
- //# sourceMappingURL=images-BsylWUiH.mjs.map