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