@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,3120 +0,0 @@
1
- import { $ as e, A as t, B as n, E as r, G as i, I as a, J as o, M as s, P as c, Q as l, T as u, U as d, Y as f, Z as p, a as m, c as h, et as g, h as _, i as v, m as y, nt as b, ot as x, s as S, w as C } from "./build-BJDfnAyi.mjs";
2
- import { r as w } from "./trpcClient-BxguzNYF.mjs";
3
- import { t as T } from "./containers-BjWqjNOx.mjs";
4
- import { t as E } from "./ContentHeader-BXZoN3B9.mjs";
5
- import { t as D } from "./formatBytes-tQBEnPoL.mjs";
6
- import { t as O } from "./useProjectId-OQv2KBbG.mjs";
7
- import { t as k } from "./ListToolbar-BojRTNbo.mjs";
8
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
9
- import { startTransition as N, useCallback as P, useEffect as F, useRef as ee, useState as I } from "react";
10
- import { useNavigate as L, useParams as R } from "@tanstack/react-router";
11
- import { Trans as z, useLingui as B } from "@lingui/react";
12
- import { i18n as V } from "@lingui/core";
13
- import { ErrorBoundary as H } from "react-error-boundary";
14
- import { useVirtualizer as te } from "@tanstack/react-virtual";
15
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/CreateContainerModal.tsx
16
- var U = ({ isOpen: e, onClose: t, onSuccess: n, onError: r, maxContainerNameLength: i = 256 }) => {
17
- let { i18n: a, _: o } = B(), s = O(), [c, l] = I(""), [d, f] = I(null), p = w.useUtils(), m = w.storage.swift.createContainer.useMutation({
18
- onSuccess: () => {
19
- p.storage.swift.listContainers.invalidate();
20
- let e = c.trim();
21
- n?.(e);
22
- },
23
- onError: (e) => {
24
- r?.(c.trim(), e.message);
25
- },
26
- onSettled: () => {
27
- h();
28
- }
29
- }), h = () => {
30
- l(""), f(null), m.reset(), t();
31
- }, g = (e) => e.trim() ? e.length > i ? (f(a._({
32
- id: "r5SQFW",
33
- values: { maxContainerNameLength: i }
34
- })), !1) : e.includes("/") ? (f(a._({ id: "9J93Xr" })), !1) : (f(null), !0) : (f(a._({ id: "JNGYAW" })), !1), _ = (e) => {
35
- let t = e.target.value;
36
- l(t), d && g(t);
37
- }, v = () => {
38
- g(c) && m.mutate({
39
- project_id: s,
40
- container: c.trim()
41
- });
42
- };
43
- return e ? /* @__PURE__ */ j(x, {
44
- title: a._({ id: "vTh35P" }),
45
- open: e,
46
- onCancel: h,
47
- confirmButtonLabel: a._({ id: "hYgDIe" }),
48
- onConfirm: v,
49
- cancelButtonLabel: a._({ id: "dEgA5A" }),
50
- size: "small",
51
- disableConfirmButton: m.isPending || !c.trim(),
52
- children: /* @__PURE__ */ M(b, {
53
- direction: "vertical",
54
- gap: "6",
55
- children: [/* @__PURE__ */ j("p", {
56
- className: "text-theme-default",
57
- children: /* @__PURE__ */ j(z, { id: "ne/GWZ" })
58
- }), /* @__PURE__ */ j(u, {
59
- label: a._({ id: "SUSS9i" }),
60
- required: !0,
61
- value: c,
62
- onChange: _,
63
- onKeyDown: (e) => {
64
- e.key === "Enter" && v();
65
- },
66
- invalid: !!d,
67
- errortext: d || void 0,
68
- disabled: m.isPending,
69
- autoFocus: !0,
70
- placeholder: a._({ id: "W5FkH9" })
71
- })]
72
- })
73
- }) : null;
74
- }, W = ({ isOpen: e, container: t, onClose: r, onSuccess: o, onError: c }) => {
75
- let { i18n: f, _: p } = B(), m = O(), [g, y] = I(""), [S, C] = I(null), [T, E] = I(!1), k = ee(""), A = () => {
76
- t && navigator.clipboard.writeText(t.name).then(() => {
77
- E(!0), setTimeout(() => E(!1), 2e3);
78
- });
79
- }, N = w.useUtils(), { data: P, isLoading: F, error: L } = w.storage.swift.listObjects.useQuery({
80
- project_id: m,
81
- container: t?.name ?? "",
82
- format: "json",
83
- limit: 100
84
- }, { enabled: e && t !== null }), R = w.storage.swift.emptyContainer.useMutation({
85
- onSuccess: (e) => {
86
- N.storage.swift.listContainers.invalidate(), N.storage.swift.listObjects.invalidate({
87
- project_id: m,
88
- container: k.current
89
- }), o?.(k.current, e);
90
- },
91
- onError: (e) => {
92
- c?.(k.current, e.message);
93
- },
94
- onSettled: () => {
95
- V();
96
- }
97
- }), V = () => {
98
- y(""), C(null), R.reset(), r();
99
- }, H = (e) => {
100
- let t = e.target.value;
101
- y(t), S && C(null);
102
- }, te = () => {
103
- if (t) {
104
- if (g.trim() !== t.name) {
105
- C(f._({ id: "jS4B2+" }));
106
- return;
107
- }
108
- k.current = t.name, R.mutate({
109
- project_id: m,
110
- container: t.name
111
- });
112
- }
113
- }, U = (e) => {
114
- e.key === "Enter" && te();
115
- };
116
- if (!e || !t) return null;
117
- let W = P?.length ?? 0, G = !F && t.count === 0 && W === 0, K = !F && t.count > 0 && W === 0, q = G || K;
118
- return /* @__PURE__ */ M(x, {
119
- title: /* @__PURE__ */ M("span", {
120
- className: "flex max-w-[400px] items-center gap-2",
121
- children: [
122
- /* @__PURE__ */ j("span", {
123
- className: "shrink-0",
124
- children: /* @__PURE__ */ j(z, { id: "5Okch2" })
125
- }),
126
- /* @__PURE__ */ j("span", {
127
- className: "truncate",
128
- title: t.name,
129
- children: t.name
130
- }),
131
- !F && !q && /* @__PURE__ */ j("button", {
132
- type: "button",
133
- onClick: A,
134
- title: T ? f._({ id: "PiH3UR" }) : f._({ id: "NQU1Nn" }),
135
- className: "text-theme-light hover:text-theme-default inline-flex items-center transition-colors",
136
- children: /* @__PURE__ */ j(v, {
137
- icon: T ? "checkCircle" : "contentCopy",
138
- size: "16"
139
- })
140
- })
141
- ]
142
- }),
143
- open: e,
144
- onCancel: V,
145
- confirmButtonLabel: q ? void 0 : f._({ id: "N2S1rs" }),
146
- confirmButtonVariant: "primary-danger",
147
- onConfirm: q ? void 0 : te,
148
- cancelButtonLabel: q ? void 0 : f._({ id: "dEgA5A" }),
149
- modalFooter: q ? /* @__PURE__ */ j(n, {
150
- className: "flex justify-end",
151
- children: /* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(h, {
152
- variant: "primary",
153
- onClick: V,
154
- "data-testid": "empty-info-close-button",
155
- children: /* @__PURE__ */ j(z, { id: "yz7wBu" })
156
- }) })
157
- }) : void 0,
158
- size: "small",
159
- disableConfirmButton: F || R.isPending || !q && !g.trim() || !q && g.trim() !== t.name,
160
- children: [L && /* @__PURE__ */ j("p", {
161
- className: "text-theme-error mb-4",
162
- children: (() => {
163
- let e = L.message;
164
- return /* @__PURE__ */ j(z, {
165
- id: "56IxdF",
166
- values: { errorMessage: e }
167
- });
168
- })()
169
- }), F ? /* @__PURE__ */ M(b, {
170
- direction: "horizontal",
171
- alignment: "center",
172
- gap: "2",
173
- className: "py-4",
174
- children: [/* @__PURE__ */ j(l, { size: "small" }), /* @__PURE__ */ j(z, { id: "ujK/QN" })]
175
- }) : q && !L ? /* @__PURE__ */ j("p", {
176
- className: "text-theme-default py-2",
177
- children: G ? /* @__PURE__ */ j(z, { id: "jNm/qL" }) : /* @__PURE__ */ j(z, { id: "WefafP" })
178
- }) : L ? null : /* @__PURE__ */ M(b, {
179
- direction: "vertical",
180
- gap: "6",
181
- children: [
182
- /* @__PURE__ */ M("p", {
183
- className: "text-theme-default",
184
- children: [
185
- /* @__PURE__ */ j(z, { id: "Ioblgz" }),
186
- /* @__PURE__ */ j("br", {}),
187
- /* @__PURE__ */ j(z, {
188
- id: "kiRrtv",
189
- components: {
190
- 0: /* @__PURE__ */ j("strong", {}),
191
- 1: /* @__PURE__ */ j("strong", {}),
192
- 2: /* @__PURE__ */ j("strong", {})
193
- }
194
- })
195
- ]
196
- }),
197
- /* @__PURE__ */ M("div", {
198
- className: "border-theme-background-lvl-3 overflow-hidden rounded border",
199
- children: [
200
- t.count > W && /* @__PURE__ */ j("p", {
201
- className: "text-theme-light px-3 py-2 text-xs",
202
- children: (() => {
203
- let e = t.count;
204
- return /* @__PURE__ */ j(z, {
205
- id: "1iQtS2",
206
- values: {
207
- actualObjectCount: W,
208
- total: e
209
- }
210
- });
211
- })()
212
- }),
213
- /* @__PURE__ */ j(d, {
214
- columns: 3,
215
- className: "text-sm",
216
- children: /* @__PURE__ */ M(a, { children: [
217
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "6YtxFj" }) }),
218
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "Cj2Gtd" }) }),
219
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "sjMCOP" }) })
220
- ] })
221
- }),
222
- /* @__PURE__ */ j("div", {
223
- className: "max-h-48 overflow-y-auto",
224
- children: /* @__PURE__ */ j(d, {
225
- columns: 3,
226
- className: "text-sm",
227
- children: P.map((e) => /* @__PURE__ */ M(a, { children: [
228
- /* @__PURE__ */ j(s, {
229
- className: "max-w-[200px] truncate",
230
- title: e.name,
231
- children: e.name
232
- }),
233
- /* @__PURE__ */ j(s, { children: D(e.bytes) }),
234
- /* @__PURE__ */ j(s, { children: e.last_modified ? new Date(e.last_modified).toLocaleString() : f._({ id: "fj5byd" }) })
235
- ] }, e.name))
236
- })
237
- })
238
- ]
239
- }),
240
- /* @__PURE__ */ j(u, {
241
- label: f._({ id: "33F2A+" }),
242
- required: !0,
243
- value: g,
244
- onChange: H,
245
- onKeyDown: U,
246
- invalid: !!S,
247
- errortext: S || void 0,
248
- disabled: R.isPending,
249
- autoFocus: !0,
250
- placeholder: t.name
251
- })
252
- ]
253
- })]
254
- });
255
- }, G = ({ isOpen: e, container: t, onClose: r, onSuccess: i, onError: a }) => {
256
- let { i18n: o, _: s } = B(), c = O(), [d, f] = I(""), [p, m] = I(null), [g, v] = I(!1), y = w.useUtils(), { data: S, isLoading: T, error: E } = w.storage.swift.listObjects.useQuery({
257
- project_id: c,
258
- container: t?.name ?? "",
259
- format: "json",
260
- limit: 1
261
- }, { enabled: e && t !== null }), { data: D, error: k } = w.storage.swift.getContainerMetadata.useQuery({
262
- project_id: c,
263
- container: t?.name ?? ""
264
- }, { enabled: e && t !== null }), A = !!(D?.versionsEnabled || D?.versionsLocation || D?.historyLocation), N = w.storage.swift.deleteContainer.useMutation({
265
- onSuccess: () => {
266
- y.storage.swift.listContainers.invalidate(), i?.(t.name);
267
- },
268
- onError: (e) => {
269
- a?.(t.name, e.message);
270
- },
271
- onSettled: () => {
272
- P();
273
- }
274
- });
275
- F(() => {
276
- e || (f(""), m(null), v(!1), N.reset());
277
- }, [e, t?.name]);
278
- let P = () => {
279
- f(""), m(null), v(!1), N.reset(), r();
280
- }, ee = (e) => {
281
- let t = e.target.value;
282
- f(t), p && m(null);
283
- }, L = () => {
284
- if (t && !(E || k)) {
285
- if (d.trim() !== "delete") {
286
- m(o._({ id: "b5aNMO" }));
287
- return;
288
- }
289
- A && !g || N.mutate({
290
- project_id: c,
291
- container: t.name
292
- });
293
- }
294
- }, R = (e) => {
295
- e.key === "Enter" && L();
296
- };
297
- if (!e || !t) return null;
298
- let V = S?.length ?? 0, H = !T && (V > 0 || t.count > 0), te = !T && t.count > 0 && V === 0, U = !!(E || k);
299
- return /* @__PURE__ */ M(x, {
300
- title: /* @__PURE__ */ M("span", {
301
- className: "flex max-w-[400px] items-center gap-2",
302
- children: [/* @__PURE__ */ j("span", {
303
- className: "shrink-0",
304
- children: /* @__PURE__ */ j(z, { id: "Vzlopx" })
305
- }), /* @__PURE__ */ j("span", {
306
- className: "truncate",
307
- title: t.name,
308
- children: t.name
309
- })]
310
- }),
311
- open: e,
312
- onCancel: P,
313
- confirmButtonLabel: H ? void 0 : o._({ id: "cnGeoo" }),
314
- confirmButtonVariant: H ? void 0 : "primary-danger",
315
- onConfirm: H ? void 0 : L,
316
- cancelButtonLabel: H ? void 0 : o._({ id: "dEgA5A" }),
317
- modalFooter: H ? /* @__PURE__ */ j(n, {
318
- className: "flex justify-end",
319
- children: /* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(h, {
320
- variant: "primary",
321
- onClick: P,
322
- "data-testid": "delete-has-objects-close-button",
323
- children: /* @__PURE__ */ j(z, { id: "yz7wBu" })
324
- }) })
325
- }) : void 0,
326
- size: "small",
327
- disableConfirmButton: T || U || N.isPending || !H && d.trim() !== "delete" || !H && A && !g,
328
- children: [(E || k) && /* @__PURE__ */ M(b, {
329
- direction: "vertical",
330
- gap: "2",
331
- className: "mb-4",
332
- role: "alert",
333
- "aria-live": "assertive",
334
- children: [E && /* @__PURE__ */ j("p", {
335
- className: "text-theme-error",
336
- children: (() => {
337
- let e = E.message;
338
- return /* @__PURE__ */ j(z, {
339
- id: "56IxdF",
340
- values: { errorMessage: e }
341
- });
342
- })()
343
- }), k && /* @__PURE__ */ j("p", {
344
- className: "text-theme-error",
345
- children: (() => {
346
- let e = k.message;
347
- return /* @__PURE__ */ j(z, {
348
- id: "BCXapL",
349
- values: { errorMessage: e }
350
- });
351
- })()
352
- })]
353
- }), T ? /* @__PURE__ */ M(b, {
354
- direction: "horizontal",
355
- alignment: "center",
356
- gap: "2",
357
- className: "py-4",
358
- children: [/* @__PURE__ */ j(l, { size: "small" }), /* @__PURE__ */ j(z, { id: "Z3FXyt" })]
359
- }) : H ? /* @__PURE__ */ M(b, {
360
- direction: "vertical",
361
- gap: "3",
362
- children: [/* @__PURE__ */ j("p", {
363
- className: "text-theme-default",
364
- children: /* @__PURE__ */ j(z, { id: "3dBmvU" })
365
- }), te && /* @__PURE__ */ j("p", {
366
- className: "text-theme-default",
367
- children: /* @__PURE__ */ j(z, { id: "x3T4pq" })
368
- })]
369
- }) : /* @__PURE__ */ M(b, {
370
- direction: "vertical",
371
- gap: "6",
372
- children: [
373
- /* @__PURE__ */ M("p", {
374
- className: "text-theme-default",
375
- children: [
376
- /* @__PURE__ */ j(z, { id: "Y8M9Uc" }),
377
- /* @__PURE__ */ j("br", {}),
378
- /* @__PURE__ */ j(z, {
379
- id: "YzUoh9",
380
- components: { 0: /* @__PURE__ */ j("strong", {}) }
381
- })
382
- ]
383
- }),
384
- A && /* @__PURE__ */ j(C, {
385
- label: o._({ id: "V/8B9A" }),
386
- checked: g,
387
- onChange: (e) => v(e.target.checked),
388
- invalid: !g
389
- }),
390
- /* @__PURE__ */ j(u, {
391
- label: o._({ id: "QytzQr" }),
392
- required: !0,
393
- value: d,
394
- onChange: ee,
395
- onKeyDown: R,
396
- invalid: !!p,
397
- errortext: p || void 0,
398
- disabled: N.isPending,
399
- autoFocus: !0,
400
- placeholder: o._({ id: "HNlEFZ" })
401
- })
402
- ]
403
- })]
404
- });
405
- }, K = new Set([
406
- "quota-bytes",
407
- "quota-count",
408
- "web-index",
409
- "web-listings",
410
- "web-listings-css",
411
- "web-error"
412
- ]), q = 50, ne = /^[a-zA-Z0-9!#$%&'*+\-.^_`|~]+$/, re = ({ isOpen: e, container: n, onClose: r, onSuccess: o, onError: f }) => {
413
- let { i18n: g, _ } = B(), S = O(), { data: T, isLoading: E, isError: D, error: k } = w.storage.swift.getContainerMetadata.useQuery({
414
- project_id: S,
415
- container: n?.name ?? ""
416
- }, { enabled: e && n !== null }), A = T?.read === ".r:*,.rlistings", { data: N } = w.storage.swift.getContainerPublicUrl.useQuery({
417
- project_id: S,
418
- container: n?.name ?? ""
419
- }, { enabled: e && n !== null && A }), { data: L } = w.storage.swift.listContainers.useQuery({ project_id: S }, { enabled: e }), [R, V] = I(""), [H, te] = I(""), U = ee(null), W = P((e) => {
420
- let t = e.target.value;
421
- V(t), U.current && clearTimeout(U.current), U.current = setTimeout(() => te(t), 300);
422
- }, []), G = H.trim().length > 0 ? (L ?? []).filter((e) => e.name !== n?.name && e.name.toLowerCase().includes(H.toLowerCase())) : [], re = G.slice(0, q), ie = G.length - re.length, ae = w.useUtils(), [J, oe] = I(""), [se, ce] = I(null), [Y, le] = I(""), [ue, de] = I(null), [fe, X] = I(""), [pe, me] = I(!1), [he, ge] = I(!1), [_e, ve] = I(""), [Z, ye] = I([]), [be, xe] = I({}), [Se, Q] = I(!1), [Ce, we] = I(""), [Te, Ee] = I(""), [De, Oe] = I(null), [ke, Ae] = I(null);
423
- F(() => {
424
- if (!T) return;
425
- oe(T.quotaBytes == null ? "" : String(T.quotaBytes)), le(T.quotaCount == null ? "" : String(T.quotaCount)), ge(!!(T.versionsEnabled || T.versionsLocation || T.historyLocation)), ve(T.versionsLocation || T.historyLocation || "");
426
- let e = T.metadata ?? {};
427
- X(e["web-index"] ?? ""), me(e["web-listings"] === "1" || e["web-listings"] === "true");
428
- let t = T.metadata ?? {};
429
- ye(Object.entries(t).filter(([e]) => !K.has(e)).map(([e, t]) => ({
430
- key: e,
431
- value: t,
432
- isNew: !1,
433
- isEditing: !1,
434
- originalKey: e,
435
- originalValue: t
436
- })));
437
- }, [T]), F(() => {
438
- e || je();
439
- }, [e]);
440
- let je = () => {
441
- oe(""), ce(null), le(""), de(null), X(""), me(!1), ge(!1), ve(""), V(""), te(""), U.current && clearTimeout(U.current), ye([]), xe({}), Q(!1), we(""), Ee(""), Oe(null), Ae(null), Me.reset();
442
- }, Me = w.storage.swift.updateContainerMetadata.useMutation({
443
- onSuccess: () => {
444
- ae.storage.swift.getContainerMetadata.invalidate({ container: n.name }), ae.storage.swift.listContainers.invalidate(), o?.(n.name), We();
445
- },
446
- onError: (e) => {
447
- f?.(n.name, e.message);
448
- }
449
- }), Ne = () => {
450
- let e = !0;
451
- return J !== "" && (isNaN(Number(J)) || Number(J) < 0) ? (ce(g._({ id: "AuQtzx" })), e = !1) : ce(null), Y !== "" && (isNaN(Number(Y)) || Number(Y) < 0) ? (de(g._({ id: "AuQtzx" })), e = !1) : de(null), e;
452
- }, Pe = (e, t) => e.trim() ? ne.test(e) ? /[a-zA-Z0-9]/.test(e) ? K.has(e.toLowerCase()) ? g._({ id: "JeRXll" }) : Z.some((n) => n.key.toLowerCase() === e.toLowerCase() && n.originalKey !== t) ? g._({ id: "i6/ygf" }) : null : g._({ id: "dTNzBI" }) : g._({ id: "XYZLy9" }) : g._({ id: "QV1ZPO" }), Fe = () => {
453
- let e = Pe(Ce);
454
- if (e) {
455
- Oe(e);
456
- return;
457
- }
458
- if (!Te.trim()) {
459
- Ae(g._({ id: "hXUWyd" }));
460
- return;
461
- }
462
- ye([...Z, {
463
- key: Ce.trim(),
464
- value: Te.trim(),
465
- isNew: !0,
466
- isEditing: !1
467
- }]), we(""), Ee(""), Q(!1), Oe(null), Ae(null);
468
- }, Ie = () => {
469
- we(""), Ee(""), Q(!1), Oe(null), Ae(null);
470
- }, Le = (e) => {
471
- ye(Z.map((t, n) => n === e ? {
472
- ...t,
473
- isEditing: !0
474
- } : {
475
- ...t,
476
- isEditing: !1
477
- })), Q(!1);
478
- }, Re = (e) => {
479
- let t = Z[e], n = Pe(t.key, t.originalKey);
480
- if (n) {
481
- xe({ [`edit-${e}`]: n });
482
- return;
483
- }
484
- if (!t.value.trim()) {
485
- xe({ [`edit-${e}`]: g._({ id: "hXUWyd" }) });
486
- return;
487
- }
488
- ye(Z.map((t, n) => n === e ? {
489
- ...t,
490
- isEditing: !1,
491
- key: t.key.trim(),
492
- value: t.value.trim()
493
- } : t)), xe({});
494
- }, ze = (e) => {
495
- ye(Z.map((t, n) => n === e ? {
496
- ...t,
497
- isEditing: !1,
498
- key: t.originalKey ?? t.key,
499
- value: t.originalValue ?? t.value
500
- } : t)), xe({});
501
- }, Be = (e) => {
502
- ye(Z.filter((t, n) => n !== e)), xe({});
503
- }, Ve = (e, t) => {
504
- ye(Z.map((n, r) => r === e ? {
505
- ...n,
506
- key: t
507
- } : n)), xe((t) => {
508
- let n = { ...t };
509
- return delete n[`edit-${e}`], n;
510
- });
511
- }, He = (e, t) => {
512
- ye(Z.map((n, r) => r === e ? {
513
- ...n,
514
- value: t
515
- } : n)), xe((t) => {
516
- let n = { ...t };
517
- return delete n[`edit-${e}`], n;
518
- });
519
- }, Ue = () => {
520
- if (!n || !Ne()) return;
521
- let e = T?.metadata ?? {}, t = {}, r = [];
522
- Z.forEach((e) => {
523
- (e.isNew || e.value !== e.originalValue || e.key !== e.originalKey) && (t[e.key] = e.value, !e.isNew && e.originalKey && e.key !== e.originalKey && r.push(e.originalKey));
524
- });
525
- let i = Object.keys(e).filter((e) => !K.has(e)), a = Z.map((e) => e.originalKey).filter(Boolean);
526
- i.forEach((e) => {
527
- !a.includes(e) && !r.includes(e) && r.push(e);
528
- }), A && (fe ? t["web-index"] = fe : T?.metadata?.["web-index"] && r.push("web-index"), pe ? t["web-listings"] = "1" : T?.metadata?.["web-listings"] && r.push("web-listings"));
529
- let o = !!(T?.versionsEnabled || T?.versionsLocation || T?.historyLocation), s = T?.versionsLocation || T?.historyLocation || "";
530
- Me.mutate({
531
- project_id: S,
532
- container: n.name,
533
- metadata: t,
534
- removeMetadata: r.length ? r : void 0,
535
- quotaBytes: J === "" ? void 0 : Number(J),
536
- quotaCount: Y === "" ? void 0 : Number(Y),
537
- versionsLocation: he && (!o || _e !== s) && _e ? _e : void 0,
538
- removeVersionsLocation: !he && o ? !0 : void 0
539
- });
540
- }, We = () => {
541
- je(), r();
542
- };
543
- if (!e || !n) return null;
544
- let $ = E || Me.isPending, Ge = D && !E, Ke = Z.some((e) => e.isEditing), qe = T?.quotaBytes == null ? "" : String(T.quotaBytes), Je = T?.quotaCount == null ? "" : String(T.quotaCount), Ye = !!T?.versionsEnabled, Xe = T?.versionsLocation || T?.historyLocation || "", Ze = T?.metadata?.["web-index"] ?? "", Qe = T?.metadata?.["web-listings"] === "1" || T?.metadata?.["web-listings"] === "true", $e = Object.keys(T?.metadata ?? {}).filter((e) => !K.has(e)), et = Z.length === $e.length && Z.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue), tt = J === qe && Y === Je && he === Ye && _e === Xe && fe === Ze && pe === Qe && et, nt = T?.quotaBytes == null ? null : `${T.quotaBytes} B`;
545
- return /* @__PURE__ */ M(x, {
546
- title: /* @__PURE__ */ M("span", {
547
- className: "flex max-w-[500px] items-center gap-2",
548
- children: [/* @__PURE__ */ j("span", {
549
- className: "shrink-0",
550
- children: /* @__PURE__ */ j(z, { id: "y02Bu1" })
551
- }), /* @__PURE__ */ j("span", {
552
- className: "truncate",
553
- title: n.name,
554
- children: n.name
555
- })]
556
- }),
557
- open: e,
558
- onCancel: We,
559
- confirmButtonLabel: g._({ id: "tfDRzk" }),
560
- onConfirm: Ue,
561
- cancelButtonLabel: g._({ id: "dEgA5A" }),
562
- size: "large",
563
- disableConfirmButton: $ || Se || Ke || tt || Ge,
564
- children: [Me.isError && /* @__PURE__ */ j("p", {
565
- className: "text-theme-error mb-4",
566
- children: (() => {
567
- let e = Me.error.message;
568
- return /* @__PURE__ */ j(z, {
569
- id: "nUuaq8",
570
- values: { errorMessage: e }
571
- });
572
- })()
573
- }), E ? /* @__PURE__ */ M(b, {
574
- direction: "horizontal",
575
- alignment: "center",
576
- gap: "2",
577
- className: "py-8",
578
- children: [/* @__PURE__ */ j(l, { size: "small" }), /* @__PURE__ */ j(z, { id: "WRZ3Mt" })]
579
- }) : Ge ? /* @__PURE__ */ j("p", {
580
- className: "text-theme-error py-8 text-center",
581
- children: /* @__PURE__ */ j(z, {
582
- id: "BCXapL",
583
- values: { errorMessage: k?.message ?? "Unknown error" }
584
- })
585
- }) : /* @__PURE__ */ j("div", {
586
- className: "max-h-[65vh] overflow-y-auto pr-1 pl-1",
587
- children: /* @__PURE__ */ M(b, {
588
- direction: "vertical",
589
- gap: "6",
590
- children: [
591
- /* @__PURE__ */ M("div", {
592
- className: "grid grid-cols-2 gap-4",
593
- children: [/* @__PURE__ */ j(u, {
594
- label: g._({ id: "z45o5B" }),
595
- value: String(n.count),
596
- disabled: !0,
597
- readOnly: !0
598
- }), /* @__PURE__ */ j(u, {
599
- label: g._({ id: "/InK0O" }),
600
- value: T?.bytesUsed == null ? `${n.bytes.toLocaleString()} B` : `${T.bytesUsed.toLocaleString()} B`,
601
- disabled: !0,
602
- readOnly: !0
603
- })]
604
- }),
605
- /* @__PURE__ */ M("div", {
606
- className: "grid grid-cols-2 gap-4",
607
- children: [/* @__PURE__ */ j("div", { children: /* @__PURE__ */ j(u, {
608
- label: g._({ id: "k0vAWv" }),
609
- value: Y,
610
- onChange: (e) => {
611
- le(e.target.value), ue && de(null);
612
- },
613
- placeholder: g._({ id: "qtoOYG" }),
614
- invalid: !!ue,
615
- errortext: ue ?? void 0,
616
- disabled: $
617
- }) }), /* @__PURE__ */ j("div", { children: /* @__PURE__ */ j(u, {
618
- label: g._({ id: "KOpPMt" }),
619
- value: J,
620
- onChange: (e) => {
621
- oe(e.target.value), se && ce(null);
622
- },
623
- placeholder: g._({ id: "qtoOYG" }),
624
- invalid: !!se,
625
- errortext: se ?? void 0,
626
- disabled: $,
627
- helptext: J && nt ? nt : void 0
628
- }) })]
629
- }),
630
- A && N && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("p", {
631
- className: "text-theme-default mb-1 text-sm font-semibold",
632
- children: [
633
- /* @__PURE__ */ j(z, { id: "mvz5Eo" }),
634
- " ",
635
- /* @__PURE__ */ j("a", {
636
- href: N,
637
- target: "_blank",
638
- rel: "noopener noreferrer",
639
- className: "text-theme-info text-xs font-normal underline",
640
- children: /* @__PURE__ */ j(z, { id: "Alx2/L" })
641
- })
642
- ]
643
- }), /* @__PURE__ */ j(u, {
644
- value: N,
645
- disabled: !0,
646
- readOnly: !0
647
- })] }),
648
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
649
- className: "text-theme-default mb-3 text-sm font-semibold",
650
- children: /* @__PURE__ */ j(z, { id: "6CDYXS" })
651
- }), A ? /* @__PURE__ */ M(b, {
652
- direction: "vertical",
653
- gap: "4",
654
- children: [/* @__PURE__ */ M(b, {
655
- direction: "vertical",
656
- gap: "1",
657
- children: [/* @__PURE__ */ j(C, {
658
- label: g._({ id: "6+7EwD" }),
659
- checked: !!fe,
660
- onChange: (e) => {
661
- e.target.checked ? fe || X("index.html") : X("");
662
- },
663
- disabled: $
664
- }), /* @__PURE__ */ j("div", {
665
- className: "pl-6",
666
- children: /* @__PURE__ */ j(u, {
667
- value: fe,
668
- onChange: (e) => X(e.target.value),
669
- placeholder: "index.html",
670
- disabled: $ || !fe,
671
- className: "flex-1"
672
- })
673
- })]
674
- }), /* @__PURE__ */ M(b, {
675
- direction: "horizontal",
676
- alignment: "start",
677
- gap: "2",
678
- children: [/* @__PURE__ */ j(C, {
679
- label: g._({ id: "NeUjqc" }),
680
- checked: pe,
681
- onChange: (e) => me(e.target.checked),
682
- disabled: $
683
- }), /* @__PURE__ */ M(p, {
684
- triggerEvent: "hover",
685
- children: [/* @__PURE__ */ j(c, { children: /* @__PURE__ */ j(v, {
686
- icon: "help",
687
- size: "16",
688
- className: "text-theme-light cursor-help"
689
- }) }), /* @__PURE__ */ j(t, {
690
- className: "z-10 max-w-[220px]",
691
- children: /* @__PURE__ */ j(z, { id: "Oxl1UN" })
692
- })]
693
- })]
694
- })]
695
- }) : /* @__PURE__ */ j("p", {
696
- className: "text-theme-default text-sm",
697
- children: /* @__PURE__ */ j(z, {
698
- id: "aSsVD3",
699
- components: { 0: /* @__PURE__ */ j("strong", {}) }
700
- })
701
- })] }),
702
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
703
- className: "text-theme-default mb-2 text-sm font-semibold",
704
- children: /* @__PURE__ */ j(z, { id: "jNzyQo" })
705
- }), Ye && !_e ? /* @__PURE__ */ j(C, {
706
- label: g._({ id: "Nvfd2b" }),
707
- checked: !0,
708
- onChange: (e) => {
709
- e.target.checked || (ge(!1), ve(""), V(""), te(""));
710
- },
711
- disabled: !0
712
- }) : !he && !_e ? /* @__PURE__ */ j(C, {
713
- label: g._({ id: "WyKwnD" }),
714
- checked: !1,
715
- onChange: (e) => ge(e.target.checked),
716
- disabled: $
717
- }) : /* @__PURE__ */ M(b, {
718
- direction: "vertical",
719
- gap: "1",
720
- children: [/* @__PURE__ */ j(C, {
721
- label: g._({ id: "b0uU1G" }),
722
- checked: he,
723
- onChange: (e) => {
724
- ge(e.target.checked), e.target.checked || (ve(""), V(""), te(""));
725
- },
726
- disabled: $
727
- }), he && /* @__PURE__ */ j("div", {
728
- className: "pl-6",
729
- children: /* @__PURE__ */ j(m, {
730
- value: _e,
731
- onChange: (e) => ve(e),
732
- onInputChange: W,
733
- placeholder: g._({ id: "a13wDR" }),
734
- helptext: (() => {
735
- if (R.trim().length === 0) return g._({ id: "c+fUtV" });
736
- if (ie > 0) {
737
- let e = q, t = G.length;
738
- return g._({
739
- id: "qzhUb9",
740
- values: {
741
- maxOptions: e,
742
- totalCount: t
743
- }
744
- });
745
- }
746
- })(),
747
- disabled: $,
748
- children: re.map((e) => /* @__PURE__ */ j(y, {
749
- value: e.name,
750
- children: e.name
751
- }, e.name))
752
- })
753
- })]
754
- })] }),
755
- /* @__PURE__ */ M("div", { children: [
756
- /* @__PURE__ */ M(b, {
757
- direction: "horizontal",
758
- alignment: "center",
759
- distribution: "between",
760
- className: "mb-3",
761
- children: [/* @__PURE__ */ j("p", {
762
- className: "text-theme-default text-sm font-semibold",
763
- children: /* @__PURE__ */ j(z, { id: "6GBt0m" })
764
- }), /* @__PURE__ */ j("p", {
765
- className: "text-theme-light text-xs",
766
- children: /* @__PURE__ */ j(z, { id: "kuYWaD" })
767
- })]
768
- }),
769
- /* @__PURE__ */ j(b, {
770
- direction: "horizontal",
771
- className: "jn:bg-theme-background-lvl-1 justify-end p-2",
772
- children: /* @__PURE__ */ j(h, {
773
- label: g._({ id: "sWBLli" }),
774
- onClick: () => Q(!0),
775
- variant: "primary",
776
- icon: "addCircle",
777
- size: "small",
778
- disabled: Se || Ke || $
779
- })
780
- }),
781
- /* @__PURE__ */ M(d, {
782
- columns: 3,
783
- children: [
784
- /* @__PURE__ */ M(a, { children: [
785
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "7sMeHQ" }) }),
786
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "wMHvYH" }) }),
787
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "7L01XJ" }) })
788
- ] }),
789
- Se && /* @__PURE__ */ M(a, { children: [
790
- /* @__PURE__ */ j(s, { children: /* @__PURE__ */ j(u, {
791
- value: Ce,
792
- onChange: (e) => {
793
- we(e.target.value), De && Oe(null);
794
- },
795
- placeholder: g._({ id: "x9AdZ8" }),
796
- errortext: De ?? void 0,
797
- invalid: !!De,
798
- autoFocus: !0
799
- }) }),
800
- /* @__PURE__ */ j(s, { children: /* @__PURE__ */ j(u, {
801
- value: Te,
802
- onChange: (e) => {
803
- Ee(e.target.value), ke && Ae(null);
804
- },
805
- placeholder: g._({ id: "wMHvYH" }),
806
- errortext: ke ?? void 0,
807
- invalid: !!ke
808
- }) }),
809
- /* @__PURE__ */ j(s, { children: /* @__PURE__ */ M(b, {
810
- direction: "horizontal",
811
- gap: "2",
812
- children: [/* @__PURE__ */ j(h, {
813
- size: "small",
814
- variant: "primary",
815
- onClick: Fe,
816
- icon: "check",
817
- title: g._({ id: "tfDRzk" })
818
- }), /* @__PURE__ */ j(h, {
819
- size: "small",
820
- variant: "subdued",
821
- onClick: Ie,
822
- icon: "close",
823
- title: g._({ id: "bzSI52" })
824
- })]
825
- }) })
826
- ] }),
827
- Z.map((e, t) => /* @__PURE__ */ M(a, { children: [
828
- /* @__PURE__ */ j(s, { children: e.isEditing ? /* @__PURE__ */ j(u, {
829
- value: e.key,
830
- onChange: (e) => Ve(t, e.target.value),
831
- errortext: be[`edit-${t}`],
832
- invalid: !!be[`edit-${t}`]
833
- }) : /* @__PURE__ */ j("span", {
834
- className: "block max-w-xs truncate font-mono text-sm",
835
- title: e.key,
836
- children: e.key
837
- }) }),
838
- /* @__PURE__ */ j(s, { children: e.isEditing ? /* @__PURE__ */ j(u, {
839
- value: e.value,
840
- onChange: (e) => He(t, e.target.value)
841
- }) : /* @__PURE__ */ j("span", {
842
- className: "block max-w-md truncate text-sm",
843
- title: e.value,
844
- children: e.value
845
- }) }),
846
- /* @__PURE__ */ j(s, { children: e.isEditing ? /* @__PURE__ */ M(b, {
847
- direction: "horizontal",
848
- gap: "2",
849
- children: [/* @__PURE__ */ j(h, {
850
- size: "small",
851
- variant: "primary",
852
- onClick: () => Re(t),
853
- icon: "check",
854
- title: g._({ id: "tfDRzk" })
855
- }), /* @__PURE__ */ j(h, {
856
- size: "small",
857
- variant: "subdued",
858
- onClick: () => ze(t),
859
- icon: "close",
860
- title: g._({ id: "bzSI52" })
861
- })]
862
- }) : /* @__PURE__ */ M(b, {
863
- direction: "horizontal",
864
- gap: "2",
865
- children: [/* @__PURE__ */ j(h, {
866
- size: "small",
867
- variant: "subdued",
868
- onClick: () => Le(t),
869
- icon: "edit",
870
- title: g._({ id: "ePK91l" }),
871
- disabled: Se || Ke || $
872
- }), /* @__PURE__ */ j(h, {
873
- size: "small",
874
- variant: "primary-danger",
875
- onClick: () => Be(t),
876
- icon: "deleteForever",
877
- title: g._({ id: "cnGeoo" }),
878
- disabled: Se || Ke || $
879
- })]
880
- }) })
881
- ] }, t)),
882
- Z.length === 0 && !Se && /* @__PURE__ */ j(a, { children: /* @__PURE__ */ j(s, {
883
- colSpan: 3,
884
- className: "py-6 text-center",
885
- children: /* @__PURE__ */ j(b, {
886
- alignment: "center",
887
- children: /* @__PURE__ */ j("span", {
888
- className: "text-theme-light text-sm",
889
- children: /* @__PURE__ */ j(z, { id: "F02e8I" })
890
- })
891
- })
892
- }) })
893
- ]
894
- })
895
- ] })
896
- ]
897
- })
898
- })]
899
- });
900
- };
901
- //#endregion
902
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ManageContainerAccessModal.tsx
903
- function ie(e) {
904
- let t = e.trim();
905
- if (t === ".r:*") return {
906
- raw: t,
907
- type: "any-referrer",
908
- description: "",
909
- requiresToken: !1
910
- };
911
- if (t.startsWith(".r:")) {
912
- let e = t.slice(3), n = e.startsWith("-"), r = n ? e.slice(1) : e;
913
- return {
914
- raw: t,
915
- type: n ? "denied-referrer" : "specific-referrer",
916
- host: r,
917
- description: "",
918
- requiresToken: !1
919
- };
920
- }
921
- if (t === ".rlistings") return {
922
- raw: t,
923
- type: "listing-access",
924
- description: "",
925
- requiresToken: !1
926
- };
927
- if (/^[^:]+:\*$/.test(t) && !t.startsWith("*")) {
928
- let [e] = t.split(":");
929
- return {
930
- raw: t,
931
- type: "all-project-users",
932
- projectId: e,
933
- description: "",
934
- requiresToken: !0
935
- };
936
- }
937
- if (t.startsWith("*:")) return {
938
- raw: t,
939
- type: "specific-user-any-project",
940
- userId: t.slice(2),
941
- description: "",
942
- requiresToken: !0
943
- };
944
- if (t.includes(":")) {
945
- let [e, n] = t.split(":");
946
- return {
947
- raw: t,
948
- type: "specific-user",
949
- projectId: e,
950
- userId: n,
951
- description: "",
952
- requiresToken: !0
953
- };
954
- }
955
- return {
956
- raw: t,
957
- type: "unknown",
958
- description: "",
959
- requiresToken: !0
960
- };
961
- }
962
- function ae(e) {
963
- return e.trim() ? e.split(",").map((e) => e.trim()).filter(Boolean).map(ie) : [];
964
- }
965
- var J = [".r:*", ".rlistings"];
966
- function oe(e) {
967
- let t = e.split(",").map((e) => e.trim()).filter(Boolean);
968
- return J.every((e) => t.includes(e));
969
- }
970
- function se(e) {
971
- let t = e.split(",").map((e) => e.trim()).filter(Boolean);
972
- return [...new Set([...J, ...t])].join(",");
973
- }
974
- function ce(e) {
975
- return e.split(",").map((e) => e.trim()).filter((e) => !J.includes(e)).join(",");
976
- }
977
- function Y(e) {
978
- switch (e.type) {
979
- case "any-referrer": return V._({ id: "HVdrr1" });
980
- case "denied-referrer": {
981
- let t = e.host || "";
982
- return V._({
983
- id: "7XQ3QJ",
984
- values: { host: t }
985
- });
986
- }
987
- case "specific-referrer": {
988
- let t = e.host || "";
989
- return V._({
990
- id: "Dqnh7K",
991
- values: { host: t }
992
- });
993
- }
994
- case "listing-access": return V._({ id: "ntNlXu" });
995
- case "all-project-users": {
996
- let t = e.projectId || "";
997
- return V._({
998
- id: "sa4CV6",
999
- values: { projectId: t }
1000
- });
1001
- }
1002
- case "specific-user-any-project": {
1003
- let t = e.userId || "";
1004
- return V._({
1005
- id: "izMhIO",
1006
- values: { userId: t }
1007
- });
1008
- }
1009
- case "specific-user": {
1010
- let t = e.projectId || "", n = e.userId || "";
1011
- return V._({
1012
- id: "cXuXkb",
1013
- values: {
1014
- userId: n,
1015
- projectId: t
1016
- }
1017
- });
1018
- }
1019
- default: return e.raw;
1020
- }
1021
- }
1022
- var le = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: i }) => {
1023
- let { i18n: a, _: o } = B(), s = O(), [c, u] = I(""), [d, f] = I(""), [p, m] = I(!1), [g, _] = I(!1);
1024
- F(() => {
1025
- !c.trim() && !d.trim() && _(!1);
1026
- }, [c, d]);
1027
- let { data: v, isLoading: y, isError: T, error: E } = w.storage.swift.getContainerMetadata.useQuery({
1028
- project_id: s,
1029
- container: t?.name ?? ""
1030
- }, { enabled: e && t !== null });
1031
- F(() => {
1032
- if (!v) return;
1033
- let e = v.read ?? "", t = v.write ?? "";
1034
- u(e), f(t), m(oe(e));
1035
- }, [v]);
1036
- let D = w.useUtils(), k = w.storage.swift.updateContainerMetadata.useMutation({
1037
- onSuccess: () => {
1038
- D.storage.swift.getContainerMetadata.invalidate({
1039
- project_id: s,
1040
- container: t.name
1041
- }), D.storage.swift.listContainers.invalidate(), r?.(t.name), P();
1042
- },
1043
- onError: (e) => {
1044
- i?.(t.name, e.message);
1045
- }
1046
- }), N = ee(k.reset);
1047
- N.current = k.reset;
1048
- let P = () => {
1049
- u(""), f(""), m(!1), _(!1), k.reset(), n();
1050
- };
1051
- F(() => {
1052
- e || (u(""), f(""), m(!1), N.current());
1053
- }, [e]);
1054
- let L = (e) => {
1055
- let t = e.target.checked;
1056
- m(t), u((e) => t ? se(e) : ce(e));
1057
- }, R = (e) => {
1058
- let t = e.target.value;
1059
- u(t), m(oe(t));
1060
- }, V = () => {
1061
- t && k.mutate({
1062
- project_id: s,
1063
- container: t.name,
1064
- read: c.trim(),
1065
- write: d.trim()
1066
- });
1067
- };
1068
- if (!e || !t) return null;
1069
- let H = y || k.isPending, te = c.trim().length > 0 || d.trim().length > 0, U = ae(c), W = ae(d);
1070
- return /* @__PURE__ */ M(x, {
1071
- title: /* @__PURE__ */ M("span", {
1072
- className: "flex items-center gap-2",
1073
- children: [/* @__PURE__ */ j(z, { id: "6Kjltl" }), /* @__PURE__ */ j("span", {
1074
- className: "max-w-[250px] truncate font-mono",
1075
- title: t.name,
1076
- children: t.name
1077
- })]
1078
- }),
1079
- open: e,
1080
- onCancel: P,
1081
- confirmButtonLabel: a._({ id: "tfDRzk" }),
1082
- onConfirm: V,
1083
- cancelButtonLabel: a._({ id: "dEgA5A" }),
1084
- size: "xl",
1085
- disableConfirmButton: H || T,
1086
- children: [k.isError && /* @__PURE__ */ j("p", {
1087
- className: "text-theme-error mb-4",
1088
- children: (() => {
1089
- let e = k.error.message;
1090
- return /* @__PURE__ */ j(z, {
1091
- id: "u2xIeO",
1092
- values: { errorMessage: e }
1093
- });
1094
- })()
1095
- }), /* @__PURE__ */ M("div", {
1096
- className: "max-h-[70vh] overflow-y-auto pr-1 pl-1",
1097
- children: [/* @__PURE__ */ M("div", {
1098
- className: "mb-4",
1099
- children: [/* @__PURE__ */ j("p", {
1100
- className: "text-theme-default mb-2",
1101
- children: /* @__PURE__ */ j(z, { id: "PHsq3v" })
1102
- }), /* @__PURE__ */ j("p", {
1103
- className: "text-theme-default",
1104
- children: /* @__PURE__ */ j(z, { id: "g9m7gK" })
1105
- })]
1106
- }), y ? /* @__PURE__ */ M(b, {
1107
- direction: "horizontal",
1108
- alignment: "center",
1109
- gap: "2",
1110
- className: "py-6",
1111
- children: [/* @__PURE__ */ j(l, { size: "small" }), /* @__PURE__ */ j(z, { id: "poCbZw" })]
1112
- }) : T ? /* @__PURE__ */ j("p", {
1113
- className: "text-theme-error py-2",
1114
- children: /* @__PURE__ */ j(z, {
1115
- id: "QNHur0",
1116
- values: { errorMessage: E?.message ?? "" }
1117
- })
1118
- }) : /* @__PURE__ */ j(A, { children: /* @__PURE__ */ M("div", {
1119
- className: "flex gap-6",
1120
- children: [/* @__PURE__ */ j("div", {
1121
- className: "min-w-0 flex-1",
1122
- children: /* @__PURE__ */ M(b, {
1123
- direction: "vertical",
1124
- gap: "6",
1125
- children: [
1126
- /* @__PURE__ */ M("div", { children: [
1127
- /* @__PURE__ */ j(de, { label: a._({ id: "SBGiGm" }) }),
1128
- /* @__PURE__ */ j(S, {
1129
- value: c,
1130
- onChange: R,
1131
- disabled: H || p,
1132
- placeholder: a._({ id: "FKL6Jv" }),
1133
- className: "font-mono text-sm",
1134
- rows: 3
1135
- }),
1136
- /* @__PURE__ */ j(C, {
1137
- label: a._({ id: "23wBCX" }),
1138
- checked: p,
1139
- onChange: L,
1140
- disabled: H,
1141
- className: "mt-2"
1142
- })
1143
- ] }),
1144
- /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(de, { label: a._({ id: "6qzsuS" }) }), /* @__PURE__ */ j(S, {
1145
- value: d,
1146
- onChange: (e) => {
1147
- let t = e.target.value;
1148
- f(t);
1149
- },
1150
- disabled: H,
1151
- placeholder: a._({ id: "UVFHGY" }),
1152
- className: "font-mono text-sm",
1153
- rows: 3
1154
- })] }),
1155
- te && /* @__PURE__ */ j(h, {
1156
- label: g ? a._({ id: "we28Pq" }) : a._({ id: "YiMCKk" }),
1157
- onClick: () => _((e) => !e),
1158
- variant: "subdued",
1159
- disabled: H
1160
- }),
1161
- g && (U.length > 0 || W.length > 0) && /* @__PURE__ */ M(b, {
1162
- direction: "vertical",
1163
- gap: "4",
1164
- children: [U.length > 0 && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
1165
- className: "text-theme-default mb-2 text-sm font-semibold",
1166
- children: /* @__PURE__ */ j(z, { id: "SBGiGm" })
1167
- }), /* @__PURE__ */ j("div", {
1168
- className: "border-theme-background-lvl-3 divide-theme-background-lvl-3 divide-y rounded border",
1169
- children: U.map((e, t) => /* @__PURE__ */ M("div", {
1170
- className: "flex flex-col gap-1 px-3 py-2",
1171
- children: [/* @__PURE__ */ M("div", {
1172
- className: "flex items-center justify-between gap-3",
1173
- children: [/* @__PURE__ */ j("p", {
1174
- className: "text-theme-default min-w-0 truncate text-sm font-medium",
1175
- title: Y(e),
1176
- children: Y(e)
1177
- }), /* @__PURE__ */ j("p", {
1178
- className: "text-theme-light shrink-0 text-xs",
1179
- children: e.requiresToken ? /* @__PURE__ */ j(z, { id: "z+zpLP" }) : /* @__PURE__ */ j(z, { id: "t7ff15" })
1180
- })]
1181
- }), /* @__PURE__ */ j("code", {
1182
- className: "text-theme-light bg-theme-background-lvl-2 block w-full rounded px-2 py-1 font-mono text-xs break-all",
1183
- children: e.raw
1184
- })]
1185
- }, t))
1186
- })] }), W.length > 0 && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
1187
- className: "text-theme-default mb-2 text-sm font-semibold",
1188
- children: /* @__PURE__ */ j(z, { id: "6qzsuS" })
1189
- }), /* @__PURE__ */ j("div", {
1190
- className: "border-theme-background-lvl-3 divide-theme-background-lvl-3 divide-y rounded border",
1191
- children: W.map((e, t) => /* @__PURE__ */ M("div", {
1192
- className: "flex flex-col gap-1 px-3 py-2",
1193
- children: [/* @__PURE__ */ M("div", {
1194
- className: "flex items-center justify-between gap-3",
1195
- children: [/* @__PURE__ */ j("p", {
1196
- className: "text-theme-default min-w-0 truncate text-sm font-medium",
1197
- title: Y(e),
1198
- children: Y(e)
1199
- }), /* @__PURE__ */ j("p", {
1200
- className: "text-theme-light shrink-0 text-xs",
1201
- children: /* @__PURE__ */ j(z, { id: "z+zpLP" })
1202
- })]
1203
- }), /* @__PURE__ */ j("code", {
1204
- className: "text-theme-light bg-theme-background-lvl-2 block w-full rounded px-2 py-1 font-mono text-xs break-all",
1205
- children: e.raw
1206
- })]
1207
- }, t))
1208
- })] })]
1209
- })
1210
- ]
1211
- })
1212
- }), /* @__PURE__ */ M("div", {
1213
- className: "border-theme-background-lvl-3 w-72 shrink-0 border-l pl-6",
1214
- children: [
1215
- /* @__PURE__ */ j("p", {
1216
- className: "text-theme-light mb-3 text-xs",
1217
- children: /* @__PURE__ */ j(z, { id: "dd2ndz" })
1218
- }),
1219
- /* @__PURE__ */ M(b, {
1220
- direction: "vertical",
1221
- gap: "4",
1222
- children: [
1223
- /* @__PURE__ */ j(ue, {
1224
- code: ".r:*",
1225
- description: a._({ id: "VV1fdg" })
1226
- }),
1227
- /* @__PURE__ */ j(ue, {
1228
- code: ".rlistings",
1229
- description: a._({ id: "s/s1lz" })
1230
- }),
1231
- /* @__PURE__ */ j(ue, {
1232
- code: "PROJECT_ID:USER_ID",
1233
- description: a._({ id: "zhM8FP" })
1234
- }),
1235
- /* @__PURE__ */ j(ue, {
1236
- code: "PROJECT_ID:*",
1237
- description: a._({ id: "BCJPTn" })
1238
- }),
1239
- /* @__PURE__ */ j(ue, {
1240
- code: "*:USER_ID",
1241
- description: a._({ id: "/xnbdQ" })
1242
- })
1243
- ]
1244
- }),
1245
- /* @__PURE__ */ j("p", {
1246
- className: "text-theme-light mt-4 text-xs",
1247
- children: /* @__PURE__ */ j(z, {
1248
- id: "rrjuul",
1249
- components: { 0: /* @__PURE__ */ j("a", {
1250
- href: "https://docs.openstack.org/swift/latest/overview_acl.html",
1251
- target: "_blank",
1252
- rel: "noopener noreferrer",
1253
- className: "text-theme-link underline"
1254
- }) }
1255
- })
1256
- })
1257
- ]
1258
- })]
1259
- }) })]
1260
- })]
1261
- });
1262
- };
1263
- function ue({ code: t, description: n }) {
1264
- return /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(e, {
1265
- variant: "info",
1266
- className: "mb-1 font-mono text-xs",
1267
- children: t
1268
- }), /* @__PURE__ */ j("p", {
1269
- className: "text-theme-light text-xs leading-relaxed",
1270
- children: n
1271
- })] });
1272
- }
1273
- function de({ label: e }) {
1274
- return /* @__PURE__ */ M("div", {
1275
- className: "mb-1 flex items-center gap-1",
1276
- children: [/* @__PURE__ */ j("label", {
1277
- className: "text-theme-default text-sm font-semibold",
1278
- children: e
1279
- }), /* @__PURE__ */ M(p, {
1280
- triggerEvent: "hover",
1281
- children: [/* @__PURE__ */ j(c, { children: /* @__PURE__ */ j(v, {
1282
- icon: "info",
1283
- size: "14",
1284
- className: "text-theme-light cursor-help"
1285
- }) }), /* @__PURE__ */ j(t, {
1286
- className: "z-10 max-w-[350px]",
1287
- children: /* @__PURE__ */ j(z, { id: "AdtLNV" })
1288
- })]
1289
- })]
1290
- });
1291
- }
1292
- //#endregion
1293
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerTableView.tsx
1294
- var fe = ({ containers: e, createModalOpen: t, setCreateModalOpen: n, maxContainerNameLength: o, onCreateSuccess: c, onCreateError: l, onEmptySuccess: u, onEmptyError: p, onDeleteSuccess: m, onDeleteError: h, onPropertiesSuccess: _, onPropertiesError: v, onAclSuccess: y, onAclError: b, selectedContainers: x, setSelectedContainers: S }) => {
1295
- let { projectId: w, provider: T } = R({ from: "/_auth/projects/$projectId/storage/$provider/containers/" }), { i18n: E, _: O } = B(), k = L(), N = ee(null), [P, V] = I(0), [H, K] = I(null), [q, ne] = I(null), [ie, ae] = I(null), [J, oe] = I(null);
1296
- F(() => {
1297
- N.current && V(N.current.offsetWidth - N.current.clientWidth);
1298
- }, [e.length]);
1299
- let se = (e) => {
1300
- try {
1301
- return new Date(e).toLocaleString();
1302
- } catch {
1303
- return E._({ id: "fj5byd" });
1304
- }
1305
- }, ce = te({
1306
- count: e.length,
1307
- getScrollElement: () => N.current,
1308
- estimateSize: () => 48,
1309
- overscan: 10
1310
- }), Y = new Set(x), ue = e.length > 0 && e.every((e) => Y.has(e.name)), de = () => {
1311
- S(ue ? [] : e.map((e) => e.name));
1312
- }, fe = (e) => {
1313
- x.includes(e) ? S(x.filter((t) => t !== e)) : S([...x, e]);
1314
- };
1315
- if (!e || e.length === 0) return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(d, {
1316
- columns: 4,
1317
- className: "containers",
1318
- "data-testid": "no-containers",
1319
- children: /* @__PURE__ */ j(a, { children: /* @__PURE__ */ j(s, {
1320
- colSpan: 4,
1321
- children: /* @__PURE__ */ M("div", {
1322
- className: "py-8 text-center",
1323
- children: [/* @__PURE__ */ j("h3", {
1324
- className: "text-lg font-semibold",
1325
- children: /* @__PURE__ */ j(z, { id: "Hiw1Ha" })
1326
- }), /* @__PURE__ */ j("p", {
1327
- className: "text-theme-light mt-2",
1328
- children: /* @__PURE__ */ j(z, { id: "x1bK0h" })
1329
- })]
1330
- })
1331
- }) })
1332
- }), /* @__PURE__ */ j(U, {
1333
- isOpen: t,
1334
- onClose: () => n(!1),
1335
- onSuccess: c,
1336
- onError: l,
1337
- maxContainerNameLength: o
1338
- })] });
1339
- let X = "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
1340
- return /* @__PURE__ */ M(A, { children: [
1341
- /* @__PURE__ */ M("div", {
1342
- className: "relative",
1343
- children: [/* @__PURE__ */ j("div", {
1344
- style: { paddingRight: `${P}px` },
1345
- children: /* @__PURE__ */ j(d, {
1346
- columns: 6,
1347
- gridColumnTemplate: X,
1348
- className: "containers",
1349
- "data-testid": "containers-table-header",
1350
- children: /* @__PURE__ */ M(a, { children: [
1351
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(C, {
1352
- checked: ue,
1353
- onChange: de,
1354
- "data-testid": "select-all-containers"
1355
- }) }),
1356
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "t0X9+8" }) }),
1357
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "sxbP3b" }) }),
1358
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "sjMCOP" }) }),
1359
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "hgpMHD" }) }),
1360
- /* @__PURE__ */ j(i, { style: { marginRight: `-${P}px` } })
1361
- ] })
1362
- })
1363
- }), /* @__PURE__ */ j("div", {
1364
- ref: N,
1365
- className: "overflow-auto",
1366
- style: { height: "calc(100vh - 510px)" },
1367
- "data-testid": "containers-table-body",
1368
- children: /* @__PURE__ */ j("div", {
1369
- style: {
1370
- height: `${ce.getTotalSize()}px`,
1371
- width: "100%",
1372
- position: "relative"
1373
- },
1374
- children: ce.getVirtualItems().map((t) => {
1375
- let n = e[t.index], i = x.includes(n.name), a = () => k({
1376
- to: "/projects/$projectId/storage/$provider/containers/$containerName/objects",
1377
- params: {
1378
- projectId: w,
1379
- provider: T,
1380
- containerName: n.name
1381
- }
1382
- });
1383
- return /* @__PURE__ */ M("div", {
1384
- "data-index": t.index,
1385
- ref: ce.measureElement,
1386
- className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
1387
- style: {
1388
- position: "absolute",
1389
- top: 0,
1390
- left: 0,
1391
- width: "100%",
1392
- transform: `translateY(${t.start}px)`,
1393
- display: "grid",
1394
- gridTemplateColumns: X,
1395
- alignItems: "stretch"
1396
- },
1397
- "data-testid": `container-row-${n.name}`,
1398
- role: "link",
1399
- tabIndex: 0,
1400
- onClick: a,
1401
- onKeyDown: (e) => {
1402
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
1403
- },
1404
- children: [
1405
- /* @__PURE__ */ j(s, {
1406
- onClick: (e) => e.stopPropagation(),
1407
- onKeyDown: (e) => {
1408
- (e.key === "Enter" || e.key === " ") && e.stopPropagation();
1409
- },
1410
- children: /* @__PURE__ */ j(C, {
1411
- checked: i,
1412
- onChange: () => fe(n.name),
1413
- "data-testid": `select-container-${n.name}`
1414
- })
1415
- }),
1416
- /* @__PURE__ */ j(s, {
1417
- className: "min-w-0 overflow-hidden",
1418
- children: /* @__PURE__ */ j("span", {
1419
- className: "block truncate",
1420
- title: n.name,
1421
- children: n.name
1422
- })
1423
- }),
1424
- /* @__PURE__ */ j(s, { children: n.count.toLocaleString() }),
1425
- /* @__PURE__ */ j(s, { children: n.last_modified ? se(n.last_modified) : E._({ id: "fj5byd" }) }),
1426
- /* @__PURE__ */ j(s, { children: D(n.bytes) }),
1427
- /* @__PURE__ */ j(s, {
1428
- onClick: (e) => e.stopPropagation(),
1429
- children: /* @__PURE__ */ j(g, { children: /* @__PURE__ */ M(r, { children: [
1430
- /* @__PURE__ */ j(f, {
1431
- label: E._({ id: "cWbW6w" }),
1432
- onClick: () => oe(n),
1433
- "data-testid": `access-control-action-${n.name}`
1434
- }),
1435
- /* @__PURE__ */ j(f, {
1436
- label: E._({ id: "Oc8Aqv" }),
1437
- onClick: () => ae(n),
1438
- "data-testid": `properties-action-${n.name}`
1439
- }),
1440
- /* @__PURE__ */ j(f, {
1441
- label: E._({ id: "N2S1rs" }),
1442
- onClick: () => K(n),
1443
- "data-testid": `empty-action-${n.name}`
1444
- }),
1445
- /* @__PURE__ */ j(f, {
1446
- label: E._({ id: "cnGeoo" }),
1447
- onClick: () => ne(n),
1448
- "data-testid": `delete-action-${n.name}`
1449
- })
1450
- ] }) })
1451
- })
1452
- ]
1453
- }, n.name);
1454
- })
1455
- })
1456
- })]
1457
- }),
1458
- /* @__PURE__ */ j(U, {
1459
- isOpen: t,
1460
- onClose: () => n(!1),
1461
- onSuccess: c,
1462
- onError: l,
1463
- maxContainerNameLength: o
1464
- }),
1465
- /* @__PURE__ */ j(W, {
1466
- isOpen: H !== null,
1467
- container: H,
1468
- onClose: () => K(null),
1469
- onSuccess: u,
1470
- onError: p
1471
- }),
1472
- /* @__PURE__ */ j(G, {
1473
- isOpen: q !== null,
1474
- container: q,
1475
- onClose: () => ne(null),
1476
- onSuccess: m,
1477
- onError: h
1478
- }),
1479
- /* @__PURE__ */ j(re, {
1480
- isOpen: ie !== null,
1481
- container: ie,
1482
- onClose: () => ae(null),
1483
- onSuccess: _,
1484
- onError: v
1485
- }),
1486
- /* @__PURE__ */ j(le, {
1487
- isOpen: J !== null,
1488
- container: J,
1489
- onClose: () => oe(null),
1490
- onSuccess: y,
1491
- onError: b
1492
- })
1493
- ] });
1494
- };
1495
- //#endregion
1496
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerToastNotifications.tsx
1497
- function X({ title: e, description: t }) {
1498
- return /* @__PURE__ */ M(b, {
1499
- direction: "vertical",
1500
- gap: "1.5",
1501
- children: [/* @__PURE__ */ j("span", { children: e }), /* @__PURE__ */ j("span", {
1502
- className: "text-theme-light",
1503
- children: t
1504
- })]
1505
- });
1506
- }
1507
- var pe = (e, t) => ({
1508
- variant: "success",
1509
- children: /* @__PURE__ */ j(X, {
1510
- title: /* @__PURE__ */ j(z, { id: "6w+VnM" }),
1511
- description: /* @__PURE__ */ j(z, {
1512
- id: "XwxJJB",
1513
- values: { containerName: e }
1514
- })
1515
- }),
1516
- autoDismiss: !0,
1517
- autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
1518
- onDismiss: t.onDismiss
1519
- }), me = (e, t, n) => ({
1520
- variant: "error",
1521
- children: /* @__PURE__ */ j(X, {
1522
- title: /* @__PURE__ */ j(z, { id: "Vj8XFg" }),
1523
- description: /* @__PURE__ */ j(z, {
1524
- id: "Vz+7ZA",
1525
- values: {
1526
- containerName: e,
1527
- errorMessage: t
1528
- }
1529
- })
1530
- }),
1531
- autoDismiss: !0,
1532
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1533
- onDismiss: n.onDismiss
1534
- }), he = (e, t, n) => ({
1535
- variant: "success",
1536
- children: /* @__PURE__ */ j(X, {
1537
- title: /* @__PURE__ */ j(z, { id: "6OopEX" }),
1538
- description: t === 0 ? /* @__PURE__ */ j(z, {
1539
- id: "nkpZyk",
1540
- values: { containerName: e }
1541
- }) : t === 1 ? /* @__PURE__ */ j(z, {
1542
- id: "TZJiVf",
1543
- values: {
1544
- containerName: e,
1545
- deletedCount: t
1546
- }
1547
- }) : /* @__PURE__ */ j(z, {
1548
- id: "Sb/VT5",
1549
- values: {
1550
- containerName: e,
1551
- deletedCount: t
1552
- }
1553
- })
1554
- }),
1555
- autoDismiss: !0,
1556
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1557
- onDismiss: n.onDismiss
1558
- }), ge = (e, t, n) => ({
1559
- variant: "error",
1560
- children: /* @__PURE__ */ j(X, {
1561
- title: /* @__PURE__ */ j(z, { id: "S8/j2h" }),
1562
- description: /* @__PURE__ */ j(z, {
1563
- id: "1rLu3+",
1564
- values: {
1565
- containerName: e,
1566
- errorMessage: t
1567
- }
1568
- })
1569
- }),
1570
- autoDismiss: !0,
1571
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1572
- onDismiss: n.onDismiss
1573
- }), _e = (e, t) => ({
1574
- variant: "success",
1575
- children: /* @__PURE__ */ j(X, {
1576
- title: /* @__PURE__ */ j(z, { id: "odVI9Y" }),
1577
- description: /* @__PURE__ */ j(z, {
1578
- id: "V1TzeS",
1579
- values: { containerName: e }
1580
- })
1581
- }),
1582
- autoDismiss: !0,
1583
- autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
1584
- onDismiss: t.onDismiss
1585
- }), ve = (e, t, n) => ({
1586
- variant: "error",
1587
- children: /* @__PURE__ */ j(X, {
1588
- title: /* @__PURE__ */ j(z, { id: "BJt+PJ" }),
1589
- description: /* @__PURE__ */ j(z, {
1590
- id: "RGrgxg",
1591
- values: {
1592
- containerName: e,
1593
- errorMessage: t
1594
- }
1595
- })
1596
- }),
1597
- autoDismiss: !0,
1598
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1599
- onDismiss: n.onDismiss
1600
- }), Z = (e, t) => ({
1601
- variant: "success",
1602
- children: /* @__PURE__ */ j(X, {
1603
- title: /* @__PURE__ */ j(z, { id: "a7C4YS" }),
1604
- description: /* @__PURE__ */ j(z, {
1605
- id: "/NeNjH",
1606
- values: { containerName: e }
1607
- })
1608
- }),
1609
- autoDismiss: !0,
1610
- autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
1611
- onDismiss: t.onDismiss
1612
- }), ye = (e, t, n) => ({
1613
- variant: "error",
1614
- children: /* @__PURE__ */ j(X, {
1615
- title: /* @__PURE__ */ j(z, { id: "5MF8U2" }),
1616
- description: /* @__PURE__ */ j(z, {
1617
- id: "uLtFAr",
1618
- values: {
1619
- containerName: e,
1620
- errorMessage: t
1621
- }
1622
- })
1623
- }),
1624
- autoDismiss: !0,
1625
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1626
- onDismiss: n.onDismiss
1627
- }), be = (e, t) => ({
1628
- variant: "success",
1629
- children: /* @__PURE__ */ j(X, {
1630
- title: /* @__PURE__ */ j(z, { id: "olfSYj" }),
1631
- description: /* @__PURE__ */ j(z, {
1632
- id: "tM5SEI",
1633
- values: { containerName: e }
1634
- })
1635
- }),
1636
- autoDismiss: !0,
1637
- autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
1638
- onDismiss: t.onDismiss
1639
- }), xe = (e, t, n) => ({
1640
- variant: "error",
1641
- children: /* @__PURE__ */ j(X, {
1642
- title: /* @__PURE__ */ j(z, { id: "p7DzCB" }),
1643
- description: /* @__PURE__ */ j(z, {
1644
- id: "DcMIiu",
1645
- values: {
1646
- containerName: e,
1647
- errorMessage: t
1648
- }
1649
- })
1650
- }),
1651
- autoDismiss: !0,
1652
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1653
- onDismiss: n.onDismiss
1654
- }), Se = (e, t, n, r) => {
1655
- let i = n.length > 0, a = e > 0, o = i && a;
1656
- return {
1657
- variant: o ? "warning" : i ? "error" : "success",
1658
- children: /* @__PURE__ */ j(X, {
1659
- title: o ? /* @__PURE__ */ j(z, { id: "q44uUq" }) : i ? /* @__PURE__ */ j(z, { id: "wFaT8w" }) : /* @__PURE__ */ j(z, { id: "0WsqO0" }),
1660
- description: /* @__PURE__ */ M(b, {
1661
- direction: "vertical",
1662
- gap: "1",
1663
- children: [a && /* @__PURE__ */ j("span", { children: /* @__PURE__ */ j(z, {
1664
- id: "1NS3nd",
1665
- values: {
1666
- emptiedCount: e,
1667
- totalDeleted: t
1668
- }
1669
- }) }), i && /* @__PURE__ */ j("span", {
1670
- className: "whitespace-pre-line",
1671
- children: /* @__PURE__ */ j(z, {
1672
- id: "JrmKyf",
1673
- values: { errorDetails: n.join("\n") }
1674
- })
1675
- })]
1676
- })
1677
- }),
1678
- autoDismiss: !0,
1679
- autoDismissTimeout: r.autoDismissTimeout ?? 5e3,
1680
- onDismiss: r.onDismiss
1681
- };
1682
- }, Q = ({ label: e, value: t }) => t == null ? null : /* @__PURE__ */ M("span", {
1683
- className: "flex items-start gap-1.5",
1684
- children: [/* @__PURE__ */ j(v, {
1685
- icon: "check",
1686
- size: "16px",
1687
- className: "text-theme-success mt-0.5 shrink-0"
1688
- }), /* @__PURE__ */ M("span", { children: [
1689
- /* @__PURE__ */ M("span", {
1690
- className: "font-medium",
1691
- children: [e, ":"]
1692
- }),
1693
- " ",
1694
- t
1695
- ] })]
1696
- }), Ce = ({ label: e }) => /* @__PURE__ */ M("span", {
1697
- className: "flex items-start gap-1.5",
1698
- children: [/* @__PURE__ */ j(v, {
1699
- icon: "check",
1700
- size: "16px",
1701
- className: "text-theme-success mt-0.5 shrink-0"
1702
- }), /* @__PURE__ */ j("span", { children: e })]
1703
- }), we = ({ title: e, children: t }) => /* @__PURE__ */ M("span", {
1704
- className: "flex flex-col gap-1.5",
1705
- children: [/* @__PURE__ */ j("span", {
1706
- className: "text-theme-default block font-semibold",
1707
- children: e
1708
- }), t]
1709
- }), Te = ({ serviceInfo: e, accountInfo: n }) => {
1710
- let { i18n: r, _: i } = B(), a = e?.swift, o = {
1711
- account_quotas: r._({ id: "DJT9tB" }),
1712
- container_quotas: r._({ id: "USiuNX" }),
1713
- bulk_delete: r._({ id: "F6YIQe" }),
1714
- bulk_upload: r._({ id: "2Inn83" }),
1715
- slo: r._({ id: "cpw++p" }),
1716
- container_sync: r._({ id: "ezT9KW" }),
1717
- tempurl: r._({ id: "UO3hJ2" }),
1718
- symlink: r._({ id: "Q2xmVl" }),
1719
- versioned_writes: r._({ id: "8jLXs3" })
1720
- }, s = Object.entries(o).filter(([e]) => a?.[e]).map(([, e]) => e);
1721
- return /* @__PURE__ */ M(p, {
1722
- triggerEvent: "hover",
1723
- placement: "bottom-end",
1724
- children: [/* @__PURE__ */ j(c, {
1725
- asChild: !0,
1726
- children: /* @__PURE__ */ j(v, {
1727
- icon: "info",
1728
- size: "20px",
1729
- className: "text-theme-light hover:text-theme-default cursor-pointer"
1730
- })
1731
- }), /* @__PURE__ */ j(t, {
1732
- className: "z-10 w-72 text-sm",
1733
- children: /* @__PURE__ */ M("span", {
1734
- className: "flex flex-col gap-3 p-1",
1735
- children: [
1736
- n && /* @__PURE__ */ M(we, {
1737
- title: /* @__PURE__ */ j(z, { id: "AeXO77" }),
1738
- children: [
1739
- /* @__PURE__ */ j(Q, {
1740
- label: r._({ id: "ClGcRq" }),
1741
- value: n.containerCount.toLocaleString()
1742
- }),
1743
- /* @__PURE__ */ j(Q, {
1744
- label: r._({ id: "B3toQF" }),
1745
- value: n.objectCount.toLocaleString()
1746
- }),
1747
- /* @__PURE__ */ j(Q, {
1748
- label: r._({ id: "aL1w5Z" }),
1749
- value: D(n.bytesUsed)
1750
- }),
1751
- n.quotaBytes !== void 0 && /* @__PURE__ */ j(Q, {
1752
- label: r._({ id: "vEkTR9" }),
1753
- value: D(n.quotaBytes)
1754
- })
1755
- ]
1756
- }),
1757
- a && /* @__PURE__ */ M(we, {
1758
- title: /* @__PURE__ */ j(z, { id: "6BDqha" }),
1759
- children: [
1760
- /* @__PURE__ */ j(Q, {
1761
- label: r._({ id: "wTg+FY" }),
1762
- value: a.max_file_size === void 0 ? void 0 : D(a.max_file_size)
1763
- }),
1764
- /* @__PURE__ */ j(Q, {
1765
- label: r._({ id: "Rih53k" }),
1766
- value: a.max_container_name_length
1767
- }),
1768
- /* @__PURE__ */ j(Q, {
1769
- label: r._({ id: "qAkkjP" }),
1770
- value: a.max_object_name_length
1771
- }),
1772
- /* @__PURE__ */ j(Q, {
1773
- label: r._({ id: "OZImTR" }),
1774
- value: a.container_listing_limit?.toLocaleString()
1775
- }),
1776
- /* @__PURE__ */ j(Q, {
1777
- label: r._({ id: "a4A2uB" }),
1778
- value: a.account_listing_limit?.toLocaleString()
1779
- }),
1780
- /* @__PURE__ */ j(Q, {
1781
- label: r._({ id: "zWb/Nn" }),
1782
- value: a.max_header_size
1783
- }),
1784
- /* @__PURE__ */ j(Q, {
1785
- label: r._({ id: "RGwfoL" }),
1786
- value: a.max_meta_count
1787
- }),
1788
- /* @__PURE__ */ j(Q, {
1789
- label: r._({ id: "8c3/77" }),
1790
- value: a.max_meta_name_length
1791
- }),
1792
- /* @__PURE__ */ j(Q, {
1793
- label: r._({ id: "5JDSvn" }),
1794
- value: a.max_meta_value_length
1795
- }),
1796
- /* @__PURE__ */ j(Q, {
1797
- label: r._({ id: "ZAx+d1" }),
1798
- value: a.max_meta_overall_size
1799
- }),
1800
- a.bulk_delete && /* @__PURE__ */ j(Q, {
1801
- label: r._({ id: "lQ3EIe" }),
1802
- value: a.bulk_delete.max_deletes_per_request.toLocaleString()
1803
- }),
1804
- a.bulk_upload && /* @__PURE__ */ j(Q, {
1805
- label: r._({ id: "STc+7E" }),
1806
- value: a.bulk_upload.max_containers_per_extraction.toLocaleString()
1807
- }),
1808
- a.slo && /* @__PURE__ */ j(Q, {
1809
- label: r._({ id: "RNBvdl" }),
1810
- value: a.slo.max_manifest_segments.toLocaleString()
1811
- })
1812
- ]
1813
- }),
1814
- s.length > 0 && /* @__PURE__ */ j(we, {
1815
- title: /* @__PURE__ */ j(z, { id: "Qx7DM7" }),
1816
- children: s.map((e) => /* @__PURE__ */ j(Ce, { label: e }, e))
1817
- })
1818
- ]
1819
- })
1820
- })]
1821
- });
1822
- }, Ee = 20, De = ({ isOpen: e, containers: t, onClose: n, onComplete: r }) => {
1823
- let { i18n: i, _: a } = B(), o = O(), [s, c] = I(null), u = w.useUtils(), d = w.storage.swift.emptyContainer.useMutation(), f = () => {
1824
- d.reset(), c(null), n();
1825
- }, p = async () => {
1826
- let e = 0, n = 0, i = [], a = t.length;
1827
- for (let r = 0; r < t.length; r++) {
1828
- c({
1829
- current: r + 1,
1830
- total: a
1831
- });
1832
- let s = t[r];
1833
- try {
1834
- let t = await d.mutateAsync({
1835
- project_id: o,
1836
- container: s.name
1837
- });
1838
- n += t, e++;
1839
- } catch (e) {
1840
- let t = e instanceof Error ? e.message : String(e);
1841
- i.push(`${s.name}: ${t}`);
1842
- }
1843
- }
1844
- e > 0 && await u.storage.swift.listContainers.invalidate(), r?.({
1845
- emptiedCount: e,
1846
- totalDeleted: n,
1847
- errors: i
1848
- }), f();
1849
- };
1850
- if (!e || t.length === 0) return null;
1851
- let m = t.length, h = t.slice(0, Ee), g = m - h.length, _ = d.isPending || s !== null, v = s?.current, y = s?.total;
1852
- return /* @__PURE__ */ j(x, {
1853
- title: i._({ id: "aOeFR+" }),
1854
- open: e,
1855
- onCancel: f,
1856
- confirmButtonLabel: _ ? i._({ id: "s4Vnq2" }) : i._({ id: "N2S1rs" }),
1857
- confirmButtonVariant: "primary-danger",
1858
- cancelButtonLabel: i._({ id: "dEgA5A" }),
1859
- onConfirm: p,
1860
- disableConfirmButton: _,
1861
- disableCancelButton: _,
1862
- disableCloseButton: _,
1863
- size: "small",
1864
- children: _ ? /* @__PURE__ */ M(b, {
1865
- direction: "vertical",
1866
- distribution: "center",
1867
- alignment: "center",
1868
- gap: "2",
1869
- className: "py-4",
1870
- children: [/* @__PURE__ */ j(l, { variant: "primary" }), s && /* @__PURE__ */ j("p", {
1871
- className: "text-theme-light text-sm",
1872
- children: /* @__PURE__ */ j(z, {
1873
- id: "7NSdfG",
1874
- values: {
1875
- progressCurrent: v,
1876
- progressTotal: y
1877
- }
1878
- })
1879
- })]
1880
- }) : /* @__PURE__ */ M("div", {
1881
- className: "my-6",
1882
- children: [/* @__PURE__ */ M("p", {
1883
- className: "text-theme-default mb-6",
1884
- children: [
1885
- /* @__PURE__ */ j(z, { id: "JuOpPY" }),
1886
- /* @__PURE__ */ j("br", {}),
1887
- /* @__PURE__ */ j(z, {
1888
- id: "sheDTJ",
1889
- components: {
1890
- 0: /* @__PURE__ */ j("strong", {}),
1891
- 1: /* @__PURE__ */ j("strong", {})
1892
- }
1893
- })
1894
- ]
1895
- }), /* @__PURE__ */ M("div", {
1896
- className: "mb-6",
1897
- children: [/* @__PURE__ */ j("h3", {
1898
- className: "jn:text-theme-high mb-3 font-semibold",
1899
- children: /* @__PURE__ */ j(z, {
1900
- id: "VKmlZ+",
1901
- values: { totalCount: m }
1902
- })
1903
- }), /* @__PURE__ */ M("div", {
1904
- className: "jn:bg-theme-background-lvl-1 max-h-48 overflow-y-auto rounded p-4",
1905
- children: [/* @__PURE__ */ j("ul", {
1906
- className: "space-y-1",
1907
- children: h.map((e) => /* @__PURE__ */ j("li", {
1908
- className: "jn:text-theme-default font-mono text-sm",
1909
- children: e.name
1910
- }, e.name))
1911
- }), g > 0 && /* @__PURE__ */ j("p", {
1912
- className: "text-theme-light mt-2 text-xs",
1913
- children: /* @__PURE__ */ j(z, {
1914
- id: "yqPflB",
1915
- values: { hiddenCount: g }
1916
- })
1917
- })]
1918
- })]
1919
- })]
1920
- })
1921
- });
1922
- }, Oe = () => {
1923
- let { i18n: e, _: t } = B(), n = O(), r = L({ from: T.fullPath }), { sortBy: i, sortDirection: a, search: s = "" } = T.useSearch(), [c, u] = I(!1), [d, f] = I(!1), [p, m] = I([]), [g, _] = I(null), v = () => _(null), y = (e) => {
1924
- _(pe(e, { onDismiss: v }));
1925
- }, x = (e, t) => {
1926
- _(me(e, t, { onDismiss: v }));
1927
- }, S = (e, t) => {
1928
- _(he(e, t, { onDismiss: v }));
1929
- }, C = (e, t) => {
1930
- _(ge(e, t, { onDismiss: v }));
1931
- }, E = (e) => {
1932
- _(_e(e, { onDismiss: v }));
1933
- }, P = (e, t) => {
1934
- _(ve(e, t, { onDismiss: v }));
1935
- }, F = (e) => {
1936
- _(Z(e, { onDismiss: v }));
1937
- }, ee = (e, t) => {
1938
- _(ye(e, t, { onDismiss: v }));
1939
- }, R = (e) => {
1940
- _(be(e, { onDismiss: v }));
1941
- }, V = (e, t) => {
1942
- _(xe(e, t, { onDismiss: v }));
1943
- }, H = ({ emptiedCount: e, totalDeleted: t, errors: n }) => {
1944
- if (n.length === 0) m([]);
1945
- else {
1946
- let e = new Set(n.map((e) => e.split(": ")[0]));
1947
- m((t) => t.filter((t) => e.has(t)));
1948
- }
1949
- _(Se(e, t, n, { onDismiss: v }));
1950
- }, te = {
1951
- options: [
1952
- {
1953
- label: e._({ id: "6YtxFj" }),
1954
- value: "name"
1955
- },
1956
- {
1957
- label: e._({ id: "sxbP3b" }),
1958
- value: "count"
1959
- },
1960
- {
1961
- label: e._({ id: "hgpMHD" }),
1962
- value: "bytes"
1963
- },
1964
- {
1965
- label: e._({ id: "sjMCOP" }),
1966
- value: "last_modified"
1967
- }
1968
- ],
1969
- sortBy: i ?? "name",
1970
- sortDirection: a ?? "asc"
1971
- }, { data: U, isLoading: W, error: G } = w.storage.swift.listContainers.useQuery({
1972
- project_id: n,
1973
- format: "json"
1974
- }), { data: K } = w.storage.swift.getAccountMetadata.useQuery({ project_id: n }), { data: q } = w.storage.swift.getServiceInfo.useQuery(), ne = (e) => [...e].sort((e, t) => {
1975
- let n;
1976
- switch (i ?? "name") {
1977
- case "name":
1978
- n = e.name.localeCompare(t.name);
1979
- break;
1980
- case "count":
1981
- n = e.count - t.count;
1982
- break;
1983
- case "bytes":
1984
- n = e.bytes - t.bytes;
1985
- break;
1986
- case "last_modified":
1987
- if (!e.last_modified || !t.last_modified) return e.last_modified ? -1 : 1;
1988
- n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
1989
- break;
1990
- default: n = e.name.localeCompare(t.name);
1991
- }
1992
- return (a ?? "asc") === "desc" ? -n : n;
1993
- }), re = (U || []).filter((e) => e.name.toLowerCase().includes(s.toLowerCase())), ie = ne(re), ae = (e) => {
1994
- let t = typeof e == "string" ? e : "";
1995
- N(() => {
1996
- r({ search: (e) => ({
1997
- ...e,
1998
- search: t || void 0
1999
- }) });
2000
- });
2001
- }, J = (e) => {
2002
- let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
2003
- N(() => {
2004
- r({ search: (e) => ({
2005
- ...e,
2006
- sortBy: t,
2007
- sortDirection: n
2008
- }) });
2009
- });
2010
- };
2011
- if (W) return /* @__PURE__ */ M(b, {
2012
- className: "absolute inset-0",
2013
- distribution: "center",
2014
- alignment: "center",
2015
- direction: "vertical",
2016
- children: [/* @__PURE__ */ j(l, {
2017
- variant: "primary",
2018
- size: "large",
2019
- className: "mb-2"
2020
- }), /* @__PURE__ */ j(z, { id: "WYiUDa" })]
2021
- });
2022
- if (G) {
2023
- let e = G.message;
2024
- return /* @__PURE__ */ j(b, {
2025
- className: "absolute inset-0",
2026
- distribution: "center",
2027
- alignment: "center",
2028
- direction: "vertical",
2029
- children: /* @__PURE__ */ j(z, {
2030
- id: "dLFiER",
2031
- values: { errorMessage: e }
2032
- })
2033
- });
2034
- }
2035
- let oe = K?.bytesUsed || 0, se = K?.quotaBytes || 0, ce = se > 0 ? se - oe : 0, Y = (U || []).filter((e) => p.includes(e.name)), le = Y.length > 0, ue = Y.length, de = (U || []).length, X = re.length;
2036
- return /* @__PURE__ */ M("div", {
2037
- className: "relative",
2038
- children: [
2039
- /* @__PURE__ */ j(k, {
2040
- sortSettings: te,
2041
- searchTerm: s,
2042
- onSort: J,
2043
- onSearch: ae,
2044
- actions: /* @__PURE__ */ M(b, {
2045
- direction: "horizontal",
2046
- gap: "4",
2047
- alignment: "center",
2048
- children: [/* @__PURE__ */ j(h, {
2049
- variant: "primary",
2050
- onClick: () => u(!0),
2051
- children: /* @__PURE__ */ j(z, { id: "vTh35P" })
2052
- }), /* @__PURE__ */ j(h, {
2053
- variant: "primary-danger",
2054
- onClick: () => f(!0),
2055
- disabled: !le,
2056
- children: le ? /* @__PURE__ */ j(z, {
2057
- id: "dPBJAJ",
2058
- values: { selectedCount: ue }
2059
- }) : /* @__PURE__ */ j(z, { id: "kCLnJG" })
2060
- })]
2061
- })
2062
- }),
2063
- /* @__PURE__ */ M("div", {
2064
- className: "text-theme-light bg-theme-background-lvl-1 flex items-center gap-1 px-4 py-2 text-sm",
2065
- "data-testid": "containers-info-block",
2066
- children: [
2067
- X === de ? /* @__PURE__ */ j(z, {
2068
- id: "ywe1H/",
2069
- values: { totalCount: de }
2070
- }) : /* @__PURE__ */ j(z, {
2071
- id: "8uPTwT",
2072
- values: {
2073
- filteredCount: X,
2074
- totalCount: de
2075
- }
2076
- }),
2077
- se > 0 && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("span", { children: "," }), /* @__PURE__ */ M("span", { children: [
2078
- /* @__PURE__ */ j(z, { id: "kKK8AH" }),
2079
- " ",
2080
- /* @__PURE__ */ j("span", {
2081
- className: "text-theme-default font-semibold",
2082
- children: D(ce)
2083
- })
2084
- ] })] }),
2085
- /* @__PURE__ */ j(Te, {
2086
- serviceInfo: q,
2087
- accountInfo: K
2088
- })
2089
- ]
2090
- }),
2091
- /* @__PURE__ */ j(fe, {
2092
- containers: ie,
2093
- createModalOpen: c,
2094
- setCreateModalOpen: u,
2095
- maxContainerNameLength: q?.swift?.max_container_name_length,
2096
- onCreateSuccess: y,
2097
- onCreateError: x,
2098
- onEmptySuccess: S,
2099
- onEmptyError: C,
2100
- onDeleteSuccess: E,
2101
- onDeleteError: P,
2102
- onPropertiesSuccess: F,
2103
- onPropertiesError: ee,
2104
- onAclSuccess: R,
2105
- onAclError: V,
2106
- selectedContainers: p,
2107
- setSelectedContainers: m
2108
- }),
2109
- /* @__PURE__ */ j(De, {
2110
- isOpen: d,
2111
- containers: Y,
2112
- onClose: () => f(!1),
2113
- onComplete: H
2114
- }),
2115
- g && /* @__PURE__ */ j(o, {
2116
- ...g,
2117
- className: "border-theme-light fixed top-5 right-5 z-50 rounded-lg border shadow-lg"
2118
- })
2119
- ]
2120
- });
2121
- }, ke = /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/, Ae = /^(\d{1,3}\.){3}\d{1,3}$/, je = [
2122
- "xn--",
2123
- "sthree-",
2124
- "amzn-s3-demo-"
2125
- ], Me = [
2126
- "-s3alias",
2127
- "--ol-s3",
2128
- ".mrap",
2129
- "--x-s3",
2130
- "--table-s3"
2131
- ], Ne = ({ isOpen: e, onClose: t, onSuccess: n, onError: r }) => {
2132
- let { i18n: i, _: a } = B(), o = O(), [s, c] = I(""), [l, d] = I(null), [f, p] = I(!1), m = w.useUtils(), h = w.storage.ceph.containers.create.useMutation({
2133
- onSuccess: () => {
2134
- m.storage.ceph.containers.list.invalidate();
2135
- let e = s.trim();
2136
- n?.(e);
2137
- },
2138
- onError: (e) => {
2139
- r?.(s.trim(), e.message);
2140
- },
2141
- onSettled: () => {
2142
- g();
2143
- }
2144
- }), g = () => {
2145
- c(""), d(null), p(!1), h.reset(), t();
2146
- }, _ = (e) => {
2147
- let t = e.trim();
2148
- if (!t) return d(i._({ id: "48bMai" })), !1;
2149
- if (t.length < 3) return d(i._({ id: "gjop1H" })), !1;
2150
- if (t.length > 63) return d(i._({ id: "is0Bhk" })), !1;
2151
- if (!ke.test(t)) return d(i._({ id: "IQldU4" })), !1;
2152
- if (!/^[a-z0-9]/.test(t) || !/[a-z0-9]$/.test(t)) return d(i._({ id: "VG2a+x" })), !1;
2153
- if (t.includes("..")) return d(i._({ id: "V8/eES" })), !1;
2154
- if (Ae.test(t)) return d(i._({ id: "W8Rb/w" })), !1;
2155
- for (let e of je) if (t.startsWith(e)) return d(i._({
2156
- id: "B2SpR8",
2157
- values: { prefix: e }
2158
- })), !1;
2159
- for (let e of Me) if (t.endsWith(e)) return d(i._({
2160
- id: "QRlXaL",
2161
- values: { suffix: e }
2162
- })), !1;
2163
- return d(null), !0;
2164
- }, v = (e) => {
2165
- let t = e.target.value;
2166
- c(t), l && _(t);
2167
- }, y = () => {
2168
- _(s) && h.mutate({
2169
- project_id: o,
2170
- bucketName: s.trim(),
2171
- enableVersioning: f
2172
- });
2173
- };
2174
- return e ? /* @__PURE__ */ j(x, {
2175
- title: i._({ id: "HiDAFk" }),
2176
- open: e,
2177
- onCancel: g,
2178
- confirmButtonLabel: i._({ id: "hYgDIe" }),
2179
- onConfirm: y,
2180
- cancelButtonLabel: i._({ id: "dEgA5A" }),
2181
- size: "small",
2182
- disableConfirmButton: h.isPending || !s.trim(),
2183
- children: /* @__PURE__ */ M(b, {
2184
- direction: "vertical",
2185
- gap: "6",
2186
- children: [
2187
- /* @__PURE__ */ j("p", {
2188
- className: "text-theme-default",
2189
- children: /* @__PURE__ */ j(z, { id: "ASJMIw" })
2190
- }),
2191
- /* @__PURE__ */ j(u, {
2192
- label: i._({ id: "NNpgo3" }),
2193
- required: !0,
2194
- value: s,
2195
- onChange: v,
2196
- onKeyDown: (e) => {
2197
- e.key === "Enter" && y();
2198
- },
2199
- invalid: !!l,
2200
- errortext: l || void 0,
2201
- disabled: h.isPending,
2202
- autoFocus: !0,
2203
- placeholder: i._({ id: "yDHGP+" })
2204
- }),
2205
- /* @__PURE__ */ j(C, {
2206
- label: i._({ id: "ifQSTI" }),
2207
- helptext: i._({ id: "WM+Nm7" }),
2208
- checked: f,
2209
- onChange: (e) => p(e.target.checked),
2210
- disabled: h.isPending
2211
- })
2212
- ]
2213
- })
2214
- }) : null;
2215
- }, Pe = ({ isOpen: e, bucket: t, onClose: r, onSuccess: i, onError: a }) => {
2216
- let { i18n: o, _: s } = B(), c = O(), [l, d] = I(""), [f, p] = I(null), [m, g] = I(!1), v = w.useUtils(), y = () => {
2217
- t && navigator.clipboard.writeText(t.name).then(() => {
2218
- g(!0), setTimeout(() => g(!1), 2e3);
2219
- });
2220
- }, S = w.storage.ceph.objects.deleteAll.useMutation({ onSettled: () => {
2221
- v.storage.ceph.containers.list.invalidate(), C();
2222
- } }), C = () => {
2223
- d(""), p(null), g(!1), S.reset(), r();
2224
- }, T = (e) => {
2225
- let t = e.target.value;
2226
- d(t), f && p(null);
2227
- }, E = () => {
2228
- if (!t) return;
2229
- if (l.trim() !== t.name) {
2230
- p(o._({ id: "wxVsr5" }));
2231
- return;
2232
- }
2233
- let e = t.name;
2234
- S.mutate({
2235
- project_id: c,
2236
- containerName: e
2237
- }, {
2238
- onSuccess: (t) => {
2239
- i?.(e, t);
2240
- },
2241
- onError: (t) => {
2242
- a?.(e, t.message);
2243
- }
2244
- });
2245
- }, D = (e) => {
2246
- e.key === "Enter" && E();
2247
- };
2248
- if (!e || !t) return null;
2249
- let k = t.count === 0, A = t.count, N = t.name;
2250
- return /* @__PURE__ */ j(x, {
2251
- title: o._({ id: "CfKRC1" }),
2252
- open: e,
2253
- onCancel: C,
2254
- confirmButtonLabel: k ? void 0 : o._({ id: "N2S1rs" }),
2255
- confirmButtonVariant: "primary-danger",
2256
- onConfirm: k ? void 0 : E,
2257
- cancelButtonLabel: k ? void 0 : o._({ id: "dEgA5A" }),
2258
- modalFooter: k ? /* @__PURE__ */ j(n, {
2259
- className: "flex justify-end",
2260
- children: /* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(h, {
2261
- variant: "primary",
2262
- onClick: C,
2263
- "data-testid": "empty-info-close-button",
2264
- children: /* @__PURE__ */ j(z, { id: "yz7wBu" })
2265
- }) })
2266
- }) : void 0,
2267
- size: "small",
2268
- disableConfirmButton: S.isPending || !k && l.trim() !== t.name,
2269
- children: k ? /* @__PURE__ */ j("p", {
2270
- className: "text-theme-default py-2",
2271
- children: /* @__PURE__ */ j(z, { id: "tL9it8" })
2272
- }) : /* @__PURE__ */ M(b, {
2273
- direction: "vertical",
2274
- gap: "6",
2275
- children: [
2276
- /* @__PURE__ */ j("p", {
2277
- className: "text-theme-default",
2278
- children: /* @__PURE__ */ j(z, {
2279
- id: "8HrqL8",
2280
- values: {
2281
- bucketCount: A,
2282
- bucketName: N
2283
- },
2284
- components: { 0: /* @__PURE__ */ j("strong", {}) }
2285
- })
2286
- }),
2287
- /* @__PURE__ */ M(b, {
2288
- direction: "vertical",
2289
- gap: "2",
2290
- children: [/* @__PURE__ */ M("div", {
2291
- className: "flex items-center justify-between",
2292
- children: [/* @__PURE__ */ j("span", {
2293
- className: "text-juno-grey-light-1 text-sm",
2294
- children: /* @__PURE__ */ j(z, { id: "FrLdVI" })
2295
- }), /* @__PURE__ */ j(h, {
2296
- size: "small",
2297
- variant: "subdued",
2298
- onClick: y,
2299
- icon: m ? "check" : "contentCopy",
2300
- label: m ? o._({ id: "6V3Ea3" }) : o._({ id: "he3ygx" })
2301
- })]
2302
- }), /* @__PURE__ */ j("div", {
2303
- className: "bg-juno-grey-blue-10 rounded p-2 font-mono text-sm",
2304
- children: t.name
2305
- })]
2306
- }),
2307
- /* @__PURE__ */ j(u, {
2308
- label: o._({ id: "dEHa3L" }),
2309
- required: !0,
2310
- value: l,
2311
- onChange: T,
2312
- onKeyDown: D,
2313
- invalid: !!f,
2314
- errortext: f || void 0,
2315
- disabled: S.isPending,
2316
- placeholder: t.name,
2317
- autoFocus: !0
2318
- })
2319
- ]
2320
- })
2321
- });
2322
- }, Fe = ({ isOpen: e, bucket: t, onClose: r, onSuccess: i, onError: a }) => {
2323
- let { i18n: o, _: s } = B(), c = O(), [d, f] = I(""), [p, m] = I(null), [g, v] = I(!1), y = () => {
2324
- t && navigator.clipboard.writeText(t.name).then(() => {
2325
- v(!0), setTimeout(() => v(!1), 2e3);
2326
- });
2327
- }, S = w.useUtils(), { data: C, isLoading: T, error: E } = w.storage.ceph.objects.list.useQuery({
2328
- project_id: c ?? "",
2329
- containerName: t?.name ?? "",
2330
- maxKeys: 1
2331
- }, { enabled: e && t !== null }), D = w.storage.ceph.containers.delete.useMutation({ onSettled: () => {
2332
- S.storage.ceph.containers.list.invalidate(), k();
2333
- } });
2334
- F(() => {
2335
- e || (f(""), m(null), D.reset());
2336
- }, [e, t?.name]);
2337
- let k = () => {
2338
- f(""), m(null), D.reset(), r();
2339
- }, N = (e) => {
2340
- let t = e.target.value;
2341
- f(t), p && m(null);
2342
- }, P = () => {
2343
- if (!t || E) return;
2344
- if (d.trim() !== t.name) {
2345
- m(o._({ id: "wxVsr5" }));
2346
- return;
2347
- }
2348
- let e = t.name;
2349
- D.mutate({
2350
- project_id: c,
2351
- bucketName: e
2352
- }, {
2353
- onSuccess: () => {
2354
- i?.(e);
2355
- },
2356
- onError: (t) => {
2357
- a?.(e, t.message);
2358
- }
2359
- });
2360
- }, ee = (e) => {
2361
- e.key === "Enter" && P();
2362
- };
2363
- if (!e || !t) return null;
2364
- let L = C?.objects?.length ?? 0, R = L > 0, V = E?.message;
2365
- return /* @__PURE__ */ j(x, {
2366
- title: o._({ id: "IwlPLb" }),
2367
- open: e,
2368
- onCancel: k,
2369
- confirmButtonLabel: R ? void 0 : o._({ id: "IwlPLb" }),
2370
- confirmButtonVariant: R ? void 0 : "primary-danger",
2371
- onConfirm: R ? void 0 : P,
2372
- cancelButtonLabel: R ? void 0 : o._({ id: "dEgA5A" }),
2373
- modalFooter: R ? /* @__PURE__ */ j(n, {
2374
- className: "flex justify-end",
2375
- children: /* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(h, {
2376
- variant: "primary",
2377
- onClick: k,
2378
- "data-testid": "delete-has-objects-close-button",
2379
- children: /* @__PURE__ */ j(z, { id: "yz7wBu" })
2380
- }) })
2381
- }) : void 0,
2382
- size: "small",
2383
- disableConfirmButton: D.isPending || T || !!E || d.trim() !== t.name,
2384
- children: /* @__PURE__ */ M(b, {
2385
- direction: "vertical",
2386
- gap: "6",
2387
- children: [E && /* @__PURE__ */ j("p", {
2388
- className: "text-theme-error",
2389
- role: "alert",
2390
- "aria-live": "assertive",
2391
- children: /* @__PURE__ */ j(z, {
2392
- id: "MJLqeY",
2393
- values: { errorMessage: V }
2394
- })
2395
- }), T ? /* @__PURE__ */ M(b, {
2396
- direction: "horizontal",
2397
- gap: "2",
2398
- alignment: "center",
2399
- children: [/* @__PURE__ */ j(l, {}), /* @__PURE__ */ j("span", {
2400
- className: "text-juno-grey-light-1 text-sm",
2401
- children: /* @__PURE__ */ j(z, { id: "rPuPb+" })
2402
- })]
2403
- }) : R ? /* @__PURE__ */ j("p", {
2404
- className: "text-theme-default",
2405
- children: /* @__PURE__ */ j(z, {
2406
- id: "50Piuj",
2407
- values: { actualObjectCount: L }
2408
- })
2409
- }) : /* @__PURE__ */ M(A, { children: [
2410
- /* @__PURE__ */ j("p", {
2411
- className: "text-theme-default",
2412
- children: /* @__PURE__ */ j(z, { id: "/pOQrn" })
2413
- }),
2414
- /* @__PURE__ */ M(b, {
2415
- direction: "vertical",
2416
- gap: "2",
2417
- children: [/* @__PURE__ */ M("div", {
2418
- className: "flex items-center justify-between",
2419
- children: [/* @__PURE__ */ j("span", {
2420
- className: "text-juno-grey-light-1 text-sm",
2421
- children: /* @__PURE__ */ j(z, { id: "No++00" })
2422
- }), /* @__PURE__ */ j(h, {
2423
- size: "small",
2424
- variant: "subdued",
2425
- onClick: y,
2426
- icon: g ? "check" : "contentCopy",
2427
- label: g ? o._({ id: "6V3Ea3" }) : o._({ id: "he3ygx" })
2428
- })]
2429
- }), /* @__PURE__ */ j("div", {
2430
- className: "bg-juno-grey-blue-10 rounded p-2 font-mono text-sm",
2431
- children: t.name
2432
- })]
2433
- }),
2434
- /* @__PURE__ */ j(u, {
2435
- label: o._({ id: "dEHa3L" }),
2436
- required: !0,
2437
- value: d,
2438
- onChange: N,
2439
- onKeyDown: ee,
2440
- invalid: !!p,
2441
- errortext: p || void 0,
2442
- disabled: D.isPending,
2443
- placeholder: t.name
2444
- })
2445
- ] })]
2446
- })
2447
- });
2448
- }, Ie = ({ containers: e, createModalOpen: t, setCreateModalOpen: n, onCreateSuccess: o, onCreateError: c, onEmptySuccess: l, onEmptyError: u, onDeleteSuccess: p, onDeleteError: m, selectedContainers: h, setSelectedContainers: _ }) => {
2449
- let { projectId: v, provider: y } = R({ strict: !1 }), { i18n: b, _: x } = B(), S = L(), w = ee(null), [T, E] = I(0), [O, k] = I(null), [N, P] = I(null);
2450
- F(() => {
2451
- w.current && E(w.current.offsetWidth - w.current.clientWidth);
2452
- }, [e.length]);
2453
- let V = (e) => {
2454
- try {
2455
- return new Date(e).toLocaleString();
2456
- } catch {
2457
- return b._({ id: "fj5byd" });
2458
- }
2459
- }, H = te({
2460
- count: e.length,
2461
- getScrollElement: () => w.current,
2462
- estimateSize: () => 48,
2463
- overscan: 10
2464
- }), U = new Set(h), W = e.length > 0 && e.every((e) => U.has(e.name)), G = () => {
2465
- _(W ? [] : e.map((e) => e.name));
2466
- }, K = (e) => {
2467
- h.includes(e) ? _(h.filter((t) => t !== e)) : _([...h, e]);
2468
- };
2469
- if (!e || e.length === 0) return /* @__PURE__ */ j(d, {
2470
- columns: 4,
2471
- className: "containers",
2472
- "data-testid": "no-containers",
2473
- children: /* @__PURE__ */ j(a, { children: /* @__PURE__ */ j(s, {
2474
- colSpan: 4,
2475
- children: /* @__PURE__ */ M("div", {
2476
- className: "py-8 text-center",
2477
- children: [/* @__PURE__ */ j("h3", {
2478
- className: "text-lg font-semibold",
2479
- children: /* @__PURE__ */ j(z, { id: "ih2lfP" })
2480
- }), /* @__PURE__ */ j("p", {
2481
- className: "text-theme-light mt-2",
2482
- children: /* @__PURE__ */ j(z, { id: "emkxJa" })
2483
- })]
2484
- })
2485
- }) })
2486
- });
2487
- let q = "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
2488
- return /* @__PURE__ */ M(A, { children: [
2489
- /* @__PURE__ */ M("div", {
2490
- className: "relative",
2491
- children: [/* @__PURE__ */ j("div", {
2492
- style: { paddingRight: `${T}px` },
2493
- children: /* @__PURE__ */ j(d, {
2494
- columns: 6,
2495
- gridColumnTemplate: q,
2496
- className: "containers",
2497
- "data-testid": "containers-table-header",
2498
- children: /* @__PURE__ */ M(a, { children: [
2499
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(C, {
2500
- checked: W,
2501
- onChange: G,
2502
- "data-testid": "select-all-containers"
2503
- }) }),
2504
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "BTsbBe" }) }),
2505
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "sxbP3b" }) }),
2506
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "sjMCOP" }) }),
2507
- /* @__PURE__ */ j(i, { children: /* @__PURE__ */ j(z, { id: "hgpMHD" }) }),
2508
- /* @__PURE__ */ j(i, { style: { marginRight: `-${T}px` } })
2509
- ] })
2510
- })
2511
- }), /* @__PURE__ */ j("div", {
2512
- ref: w,
2513
- className: "overflow-auto",
2514
- style: { height: "calc(100vh - 510px)" },
2515
- "data-testid": "containers-table-body",
2516
- children: /* @__PURE__ */ j("div", {
2517
- style: {
2518
- height: `${H.getTotalSize()}px`,
2519
- width: "100%",
2520
- position: "relative"
2521
- },
2522
- children: H.getVirtualItems().map((t) => {
2523
- let n = e[t.index], i = h.includes(n.name), a = () => S({
2524
- to: "/projects/$projectId/storage/$provider/containers/$containerName/objects",
2525
- params: {
2526
- projectId: v ?? "",
2527
- provider: y ?? "ceph",
2528
- containerName: n.name
2529
- }
2530
- });
2531
- return /* @__PURE__ */ M("div", {
2532
- "data-index": t.index,
2533
- ref: H.measureElement,
2534
- className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
2535
- style: {
2536
- position: "absolute",
2537
- top: 0,
2538
- left: 0,
2539
- width: "100%",
2540
- transform: `translateY(${t.start}px)`,
2541
- display: "grid",
2542
- gridTemplateColumns: q,
2543
- alignItems: "stretch"
2544
- },
2545
- "data-testid": `container-row-${n.name}`,
2546
- role: "link",
2547
- tabIndex: 0,
2548
- onClick: a,
2549
- onKeyDown: (e) => {
2550
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
2551
- },
2552
- children: [
2553
- /* @__PURE__ */ j(s, {
2554
- onClick: (e) => e.stopPropagation(),
2555
- onKeyDown: (e) => {
2556
- (e.key === "Enter" || e.key === " ") && e.stopPropagation();
2557
- },
2558
- children: /* @__PURE__ */ j(C, {
2559
- checked: i,
2560
- onChange: () => K(n.name),
2561
- "data-testid": `select-container-${n.name}`
2562
- })
2563
- }),
2564
- /* @__PURE__ */ j(s, {
2565
- className: "min-w-0 overflow-hidden",
2566
- children: /* @__PURE__ */ j("span", {
2567
- className: "block truncate",
2568
- title: n.name,
2569
- children: n.name
2570
- })
2571
- }),
2572
- /* @__PURE__ */ j(s, { children: n.count.toLocaleString() }),
2573
- /* @__PURE__ */ j(s, { children: V(n.last_modified || n.creationDate || "") }),
2574
- /* @__PURE__ */ j(s, { children: D(n.bytes) }),
2575
- /* @__PURE__ */ j(s, {
2576
- onClick: (e) => e.stopPropagation(),
2577
- children: /* @__PURE__ */ j(g, { children: /* @__PURE__ */ M(r, { children: [/* @__PURE__ */ j(f, {
2578
- label: b._({ id: "N2S1rs" }),
2579
- onClick: () => k(n),
2580
- "data-testid": `empty-action-${n.name}`
2581
- }), /* @__PURE__ */ j(f, {
2582
- label: b._({ id: "cnGeoo" }),
2583
- onClick: () => P(n),
2584
- "data-testid": `delete-action-${n.name}`
2585
- })] }) })
2586
- })
2587
- ]
2588
- }, n.name);
2589
- })
2590
- })
2591
- })]
2592
- }),
2593
- /* @__PURE__ */ j(Ne, {
2594
- isOpen: t,
2595
- onClose: () => n(!1),
2596
- onSuccess: o,
2597
- onError: c
2598
- }),
2599
- /* @__PURE__ */ j(Pe, {
2600
- isOpen: O !== null,
2601
- bucket: O,
2602
- onClose: () => k(null),
2603
- onSuccess: l,
2604
- onError: u
2605
- }),
2606
- /* @__PURE__ */ j(Fe, {
2607
- isOpen: N !== null,
2608
- bucket: N,
2609
- onClose: () => P(null),
2610
- onSuccess: p,
2611
- onError: m
2612
- })
2613
- ] });
2614
- };
2615
- //#endregion
2616
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Containers/ContainerToastNotifications.tsx
2617
- function Le({ title: e, description: t }) {
2618
- return /* @__PURE__ */ M(b, {
2619
- direction: "vertical",
2620
- gap: "1.5",
2621
- children: [/* @__PURE__ */ j("span", { children: e }), /* @__PURE__ */ j("span", {
2622
- className: "text-theme-light",
2623
- children: t
2624
- })]
2625
- });
2626
- }
2627
- var Re = (e, t) => ({
2628
- variant: "success",
2629
- children: /* @__PURE__ */ j(Le, {
2630
- title: /* @__PURE__ */ j(z, { id: "M3bysB" }),
2631
- description: /* @__PURE__ */ j(z, {
2632
- id: "VKCkZH",
2633
- values: { bucketName: e }
2634
- })
2635
- }),
2636
- autoDismiss: !0,
2637
- autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
2638
- onDismiss: t.onDismiss
2639
- }), ze = (e, t, n) => ({
2640
- variant: "error",
2641
- children: /* @__PURE__ */ j(Le, {
2642
- title: /* @__PURE__ */ j(z, { id: "UaP7Th" }),
2643
- description: /* @__PURE__ */ j(z, {
2644
- id: "boefwq",
2645
- values: {
2646
- bucketName: e,
2647
- errorMessage: t
2648
- }
2649
- })
2650
- }),
2651
- autoDismiss: !0,
2652
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
2653
- onDismiss: n.onDismiss
2654
- }), Be = (e, t, n) => ({
2655
- variant: "success",
2656
- children: /* @__PURE__ */ j(Le, {
2657
- title: /* @__PURE__ */ j(z, { id: "b95YH9" }),
2658
- description: t === 0 ? /* @__PURE__ */ j(z, {
2659
- id: "8erw15",
2660
- values: { bucketName: e }
2661
- }) : t === 1 ? /* @__PURE__ */ j(z, {
2662
- id: "QpbWpf",
2663
- values: {
2664
- bucketName: e,
2665
- deletedCount: t
2666
- }
2667
- }) : /* @__PURE__ */ j(z, {
2668
- id: "JPWqr2",
2669
- values: {
2670
- bucketName: e,
2671
- deletedCount: t
2672
- }
2673
- })
2674
- }),
2675
- autoDismiss: !0,
2676
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
2677
- onDismiss: n.onDismiss
2678
- }), Ve = (e, t, n) => ({
2679
- variant: "error",
2680
- children: /* @__PURE__ */ j(Le, {
2681
- title: /* @__PURE__ */ j(z, { id: "66YUKF" }),
2682
- description: /* @__PURE__ */ j(z, {
2683
- id: "t7ewhH",
2684
- values: {
2685
- bucketName: e,
2686
- errorMessage: t
2687
- }
2688
- })
2689
- }),
2690
- autoDismiss: !0,
2691
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
2692
- onDismiss: n.onDismiss
2693
- }), He = (e, t) => ({
2694
- variant: "success",
2695
- children: /* @__PURE__ */ j(Le, {
2696
- title: /* @__PURE__ */ j(z, { id: "bHUarC" }),
2697
- description: /* @__PURE__ */ j(z, {
2698
- id: "hQdfmR",
2699
- values: { bucketName: e }
2700
- })
2701
- }),
2702
- autoDismiss: !0,
2703
- autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
2704
- onDismiss: t.onDismiss
2705
- }), Ue = (e, t, n) => ({
2706
- variant: "error",
2707
- children: /* @__PURE__ */ j(Le, {
2708
- title: /* @__PURE__ */ j(z, { id: "1NFtQz" }),
2709
- description: /* @__PURE__ */ j(z, {
2710
- id: "CongmL",
2711
- values: {
2712
- bucketName: e,
2713
- errorMessage: t
2714
- }
2715
- })
2716
- }),
2717
- autoDismiss: !0,
2718
- autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
2719
- onDismiss: n.onDismiss
2720
- }), We = (e, t, n, r) => {
2721
- let i = n.length > 0, a = e + n.length, o = n.length;
2722
- return {
2723
- variant: i ? "warning" : "success",
2724
- children: /* @__PURE__ */ j(Le, {
2725
- title: i ? /* @__PURE__ */ j(z, { id: "6fuDFZ" }) : /* @__PURE__ */ j(z, { id: "BOoOLQ" }),
2726
- description: i ? /* @__PURE__ */ j(z, {
2727
- id: "pD/2BQ",
2728
- values: {
2729
- emptiedCount: e,
2730
- totalBuckets: a,
2731
- totalDeleted: t,
2732
- errorsLength: o
2733
- }
2734
- }) : /* @__PURE__ */ j(z, {
2735
- id: "YVLcyI",
2736
- values: {
2737
- emptiedCount: e,
2738
- totalDeleted: t
2739
- }
2740
- })
2741
- }),
2742
- autoDismiss: !i,
2743
- autoDismissTimeout: r.autoDismissTimeout ?? 5e3,
2744
- onDismiss: r.onDismiss
2745
- };
2746
- }, $ = 20, Ge = ({ isOpen: e, buckets: t, onClose: n, onComplete: r }) => {
2747
- let { i18n: i, _: a } = B(), o = O(), [s, c] = I(null), u = w.useUtils(), d = w.storage.ceph.objects.deleteAll.useMutation(), f = () => {
2748
- d.reset(), c(null), n();
2749
- }, p = async () => {
2750
- let e = 0, n = 0, i = [], a = t.length;
2751
- for (let r = 0; r < t.length; r++) {
2752
- c({
2753
- current: r + 1,
2754
- total: a
2755
- });
2756
- let s = t[r];
2757
- try {
2758
- let t = await d.mutateAsync({
2759
- project_id: o,
2760
- containerName: s.name
2761
- });
2762
- n += t, e++;
2763
- } catch (e) {
2764
- let t = e instanceof Error ? e.message : String(e);
2765
- i.push(`${s.name}: ${t}`);
2766
- }
2767
- }
2768
- e > 0 && await u.storage.ceph.containers.list.invalidate(), r?.({
2769
- emptiedCount: e,
2770
- totalDeleted: n,
2771
- errors: i
2772
- }), f();
2773
- };
2774
- if (!e || t.length === 0) return null;
2775
- let m = t.length, h = t.slice(0, $), g = m - h.length, _ = d.isPending || s !== null, v = s?.current, y = s?.total;
2776
- return /* @__PURE__ */ j(x, {
2777
- title: i._({ id: "7RBR/D" }),
2778
- open: e,
2779
- onCancel: f,
2780
- confirmButtonLabel: _ ? i._({ id: "s4Vnq2" }) : i._({ id: "N2S1rs" }),
2781
- confirmButtonVariant: "primary-danger",
2782
- cancelButtonLabel: i._({ id: "dEgA5A" }),
2783
- onConfirm: p,
2784
- disableConfirmButton: _,
2785
- disableCancelButton: _,
2786
- disableCloseButton: _,
2787
- size: "small",
2788
- children: _ ? /* @__PURE__ */ M(b, {
2789
- direction: "vertical",
2790
- distribution: "center",
2791
- alignment: "center",
2792
- gap: "2",
2793
- className: "py-4",
2794
- children: [/* @__PURE__ */ j(l, { variant: "primary" }), s && /* @__PURE__ */ j("p", {
2795
- className: "text-theme-light text-sm",
2796
- children: /* @__PURE__ */ j(z, {
2797
- id: "NW1XEL",
2798
- values: {
2799
- progressCurrent: v,
2800
- progressTotal: y
2801
- }
2802
- })
2803
- })]
2804
- }) : /* @__PURE__ */ M(b, {
2805
- direction: "vertical",
2806
- gap: "4",
2807
- children: [/* @__PURE__ */ j("p", {
2808
- className: "text-theme-default",
2809
- children: /* @__PURE__ */ j(z, {
2810
- id: "CtiFDz",
2811
- values: { totalCount: m }
2812
- })
2813
- }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
2814
- className: "text-theme-light mb-2 text-sm",
2815
- children: /* @__PURE__ */ j(z, { id: "Zshv0H" })
2816
- }), /* @__PURE__ */ M("ul", {
2817
- className: "list-inside list-disc space-y-1 text-sm",
2818
- children: [h.map((e) => {
2819
- let t = e.name, n = e.count;
2820
- return /* @__PURE__ */ M("li", {
2821
- className: "font-mono",
2822
- children: [t, n > 0 && /* @__PURE__ */ M("span", {
2823
- className: "text-theme-light ml-2",
2824
- children: [
2825
- "(",
2826
- n,
2827
- " ",
2828
- /* @__PURE__ */ j(z, {
2829
- id: "gFsjJK",
2830
- values: { bucketCount: n }
2831
- }),
2832
- ")"
2833
- ]
2834
- })]
2835
- }, t);
2836
- }), g > 0 && /* @__PURE__ */ j("li", {
2837
- className: "text-theme-light",
2838
- children: /* @__PURE__ */ j(z, {
2839
- id: "yqPflB",
2840
- values: { hiddenCount: g }
2841
- })
2842
- })]
2843
- })] })]
2844
- })
2845
- });
2846
- };
2847
- //#endregion
2848
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Containers/CredentialPrompt.tsx
2849
- function Ke({ onSuccess: e }) {
2850
- let t = O(), [n, r] = I(null), i = w.useUtils(), a = w.storage.ceph.ec2Credentials.create.useMutation({
2851
- onSuccess: () => {
2852
- i.storage.ceph.ec2Credentials.list.invalidate(), e();
2853
- },
2854
- onError: (e) => {
2855
- let t = e.message;
2856
- r({
2857
- variant: "error",
2858
- children: /* @__PURE__ */ j(z, {
2859
- id: "rcBt6T",
2860
- values: { errorMessage: t }
2861
- }),
2862
- autoDismiss: !0,
2863
- autoDismissTimeout: 5e3,
2864
- onDismiss: () => r(null)
2865
- });
2866
- }
2867
- });
2868
- return /* @__PURE__ */ M(b, {
2869
- direction: "vertical",
2870
- gap: "4",
2871
- className: "mx-auto mt-16 max-w-lg",
2872
- children: [
2873
- n && /* @__PURE__ */ j(o, { ...n }),
2874
- /* @__PURE__ */ j("h2", {
2875
- className: "text-lg font-semibold",
2876
- children: /* @__PURE__ */ j(z, { id: "wXxPjv" })
2877
- }),
2878
- /* @__PURE__ */ j("p", {
2879
- className: "text-theme-default",
2880
- children: /* @__PURE__ */ j(z, { id: "+8m5QE" })
2881
- }),
2882
- /* @__PURE__ */ j("p", {
2883
- className: "text-theme-default text-sm",
2884
- children: /* @__PURE__ */ j(z, { id: "+1xG4p" })
2885
- }),
2886
- /* @__PURE__ */ j("div", { children: /* @__PURE__ */ j(h, {
2887
- onClick: () => t && a.mutate({ project_id: t }),
2888
- disabled: a.isPending || !t,
2889
- children: a.isPending ? /* @__PURE__ */ j(z, { id: "k/zHK7" }) : /* @__PURE__ */ j(z, { id: "FJO48W" })
2890
- }) })
2891
- ]
2892
- });
2893
- }
2894
- //#endregion
2895
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Containers/index.tsx
2896
- var qe = () => {
2897
- let { i18n: e, _: t } = B(), n = O(), r = L({ from: T.fullPath }), { sortBy: i, sortDirection: a, search: s = "" } = T.useSearch(), [c, u] = I(!1), [d, f] = I(!1), [p, m] = I([]), [g, _] = I(null), v = () => _(null), y = (e) => {
2898
- _(Re(e, { onDismiss: v }));
2899
- }, x = (e, t) => {
2900
- _(ze(e, t, { onDismiss: v }));
2901
- }, S = (e, t) => {
2902
- _(Be(e, t, { onDismiss: v }));
2903
- }, C = (e, t) => {
2904
- _(Ve(e, t, { onDismiss: v }));
2905
- }, E = (e) => {
2906
- _(He(e, { onDismiss: v }));
2907
- }, D = (e, t) => {
2908
- _(Ue(e, t, { onDismiss: v }));
2909
- }, A = ({ emptiedCount: e, totalDeleted: t, errors: n }) => {
2910
- if (n.length === 0) m([]);
2911
- else {
2912
- let e = new Set(n.map((e) => e.split(": ")[0]));
2913
- m((t) => t.filter((t) => e.has(t)));
2914
- }
2915
- _(We(e, t, n, { onDismiss: v }));
2916
- }, P = {
2917
- options: [
2918
- {
2919
- label: e._({ id: "6YtxFj" }),
2920
- value: "name"
2921
- },
2922
- {
2923
- label: e._({ id: "sxbP3b" }),
2924
- value: "count"
2925
- },
2926
- {
2927
- label: e._({ id: "hgpMHD" }),
2928
- value: "bytes"
2929
- },
2930
- {
2931
- label: e._({ id: "sjMCOP" }),
2932
- value: "last_modified"
2933
- }
2934
- ],
2935
- sortBy: i ?? "name",
2936
- sortDirection: a ?? "asc"
2937
- }, { data: F, isLoading: ee, error: R } = w.storage.ceph.containers.list.useQuery({
2938
- project_id: n,
2939
- includeMetadata: !0
2940
- }, {
2941
- enabled: !!n,
2942
- retry: !1
2943
- }), V = (e) => [...e].sort((e, t) => {
2944
- let n;
2945
- switch (i ?? "name") {
2946
- case "name":
2947
- n = e.name.localeCompare(t.name);
2948
- break;
2949
- case "count":
2950
- n = e.count - t.count;
2951
- break;
2952
- case "bytes":
2953
- n = e.bytes - t.bytes;
2954
- break;
2955
- case "last_modified":
2956
- if (!e.last_modified && !t.last_modified) return 0;
2957
- if (!e.last_modified) return 1;
2958
- if (!t.last_modified) return -1;
2959
- n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
2960
- break;
2961
- default: n = e.name.localeCompare(t.name);
2962
- }
2963
- return (a ?? "asc") === "desc" ? -n : n;
2964
- }), H = (F || []).filter((e) => e.name.toLowerCase().includes(s.toLowerCase())), te = V(H), U = (e) => {
2965
- let t = typeof e == "string" ? e : "";
2966
- N(() => {
2967
- r({ search: (e) => ({
2968
- ...e,
2969
- search: t || void 0
2970
- }) });
2971
- });
2972
- }, W = (e) => {
2973
- let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
2974
- N(() => {
2975
- r({ search: (e) => ({
2976
- ...e,
2977
- sortBy: t,
2978
- sortDirection: n
2979
- }) });
2980
- });
2981
- };
2982
- if (ee) return /* @__PURE__ */ M(b, {
2983
- className: "p-8",
2984
- distribution: "center",
2985
- alignment: "center",
2986
- direction: "vertical",
2987
- children: [/* @__PURE__ */ j(l, {
2988
- variant: "primary",
2989
- size: "large",
2990
- className: "mb-2"
2991
- }), /* @__PURE__ */ j(z, { id: "c5i+X0" })]
2992
- });
2993
- if (R) {
2994
- let e = R.message;
2995
- if (e === "NO_CEPH_CREDENTIALS") return /* @__PURE__ */ j(Ke, { onSuccess: () => window.location.reload() });
2996
- let t = e.includes("Access denied") || e.includes("AccessDenied"), n = e.includes("Invalid access key") || e.includes("InvalidAccessKeyId");
2997
- return /* @__PURE__ */ j("div", {
2998
- className: "p-8",
2999
- children: /* @__PURE__ */ j("p", {
3000
- className: "text-theme-default text-sm",
3001
- children: t ? /* @__PURE__ */ j(z, { id: "HAcOOW" }) : n ? /* @__PURE__ */ j(z, { id: "xIXYTK" }) : /* @__PURE__ */ j(z, {
3002
- id: "BZpsYm",
3003
- values: { errorMessage: e }
3004
- })
3005
- })
3006
- });
3007
- }
3008
- let G = (F || []).filter((e) => p.includes(e.name)), K = G.length > 0, q = G.length, ne = (F || []).length, re = H.length;
3009
- return /* @__PURE__ */ M("div", {
3010
- className: "relative",
3011
- children: [
3012
- /* @__PURE__ */ j(k, {
3013
- sortSettings: P,
3014
- searchTerm: s,
3015
- onSort: W,
3016
- onSearch: U,
3017
- actions: /* @__PURE__ */ M(b, {
3018
- direction: "horizontal",
3019
- gap: "4",
3020
- alignment: "center",
3021
- children: [/* @__PURE__ */ j(h, {
3022
- variant: "primary",
3023
- onClick: () => u(!0),
3024
- children: /* @__PURE__ */ j(z, { id: "HiDAFk" })
3025
- }), /* @__PURE__ */ j(h, {
3026
- variant: "primary-danger",
3027
- onClick: () => f(!0),
3028
- disabled: !K,
3029
- children: K ? /* @__PURE__ */ j(z, {
3030
- id: "dPBJAJ",
3031
- values: { selectedCount: q }
3032
- }) : /* @__PURE__ */ j(z, { id: "kCLnJG" })
3033
- })]
3034
- })
3035
- }),
3036
- /* @__PURE__ */ j("div", {
3037
- className: "text-theme-light bg-theme-background-lvl-1 flex items-center gap-1 px-4 py-2 text-sm",
3038
- "data-testid": "containers-info-block",
3039
- children: s.trim() ? /* @__PURE__ */ j(z, {
3040
- id: "xOvKAE",
3041
- values: {
3042
- totalCount: ne,
3043
- filteredCount: re
3044
- }
3045
- }) : /* @__PURE__ */ j(z, {
3046
- id: "Ux/pNd",
3047
- values: { totalCount: ne }
3048
- })
3049
- }),
3050
- /* @__PURE__ */ j(Ie, {
3051
- containers: te,
3052
- createModalOpen: c,
3053
- setCreateModalOpen: u,
3054
- onCreateSuccess: y,
3055
- onCreateError: x,
3056
- onEmptySuccess: S,
3057
- onEmptyError: C,
3058
- onDeleteSuccess: E,
3059
- onDeleteError: D,
3060
- selectedContainers: p,
3061
- setSelectedContainers: m
3062
- }),
3063
- /* @__PURE__ */ j(Ge, {
3064
- isOpen: d,
3065
- buckets: G,
3066
- onClose: () => f(!1),
3067
- onComplete: A
3068
- }),
3069
- g && /* @__PURE__ */ j(o, {
3070
- ...g,
3071
- className: "border-theme-light fixed top-5 right-5 z-50 rounded-lg border shadow-lg"
3072
- })
3073
- ]
3074
- });
3075
- };
3076
- //#endregion
3077
- //#region src/client/routes/_auth/projects/$projectId/storage/$provider/containers/index.tsx?tsr-split=component
3078
- function Je() {
3079
- let { project: e, provider: t } = R({
3080
- from: "/_auth/projects/$projectId/storage/$provider/containers/",
3081
- select: (e) => ({
3082
- project: e.projectId,
3083
- provider: e.provider
3084
- })
3085
- }), { i18n: n, _: r } = B(), i;
3086
- switch (t) {
3087
- case "swift":
3088
- i = n._({ id: "+OEi73" });
3089
- break;
3090
- case "ceph":
3091
- i = n._({ id: "KhNDX4" });
3092
- break;
3093
- default: i = n._({ id: "IWF68U" });
3094
- }
3095
- return /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j(E, {
3096
- title: i,
3097
- projectId: e
3098
- }), e ? /* @__PURE__ */ j(H, {
3099
- resetKeys: [e, t],
3100
- fallback: /* @__PURE__ */ j("div", {
3101
- className: "p-4 text-center",
3102
- children: /* @__PURE__ */ j(z, { id: "diFNkW" })
3103
- }),
3104
- children: (() => {
3105
- switch (t) {
3106
- case "swift": return /* @__PURE__ */ j(Oe, {});
3107
- case "ceph": return /* @__PURE__ */ j(qe, {});
3108
- default: return /* @__PURE__ */ j("div", { children: "Storage Overview Page" });
3109
- }
3110
- })()
3111
- }) : /* @__PURE__ */ j("div", {
3112
- className: "p-4 text-center",
3113
- children: /* @__PURE__ */ j(z, { id: "Z2fZGD" })
3114
- })] });
3115
- }
3116
- var Ye = () => /* @__PURE__ */ j(Je, {});
3117
- //#endregion
3118
- export { Ye as component };
3119
-
3120
- //# sourceMappingURL=containers-J7WFA18U.mjs.map