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