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