@cobaltcore-dev/aurora 1.1.0 → 1.3.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 (184) hide show
  1. package/README.md +59 -9
  2. package/dist/client/App.d.ts +2 -2
  3. package/dist/client/AuroraApp.d.ts +33 -13
  4. package/dist/client/{AuthProvider-BS5OVv8n.mjs → AuthProvider-CVSAwW9f.mjs} +22 -8
  5. package/dist/client/AuthProvider-CVSAwW9f.mjs.map +1 -0
  6. package/dist/client/{ContentHeader-BHMUzd9H.mjs → ContentHeader-CPJbgYWn.mjs} +18 -18
  7. package/dist/client/{ContentHeader-BHMUzd9H.mjs.map → ContentHeader-CPJbgYWn.mjs.map} +1 -1
  8. package/dist/client/DeleteFlavorModal-V44QCJBd.mjs +773 -0
  9. package/dist/client/DeleteFlavorModal-V44QCJBd.mjs.map +1 -0
  10. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs +26 -0
  11. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs.map +1 -0
  12. package/dist/client/{FiltersInput-B8CNBg1L.mjs → FiltersInput-CKI6zWnm.mjs} +18 -18
  13. package/dist/client/{FiltersInput-B8CNBg1L.mjs.map → FiltersInput-CKI6zWnm.mjs.map} +1 -1
  14. package/dist/client/FloatingIpActionModals-Ch8uozH9.mjs +466 -0
  15. package/dist/client/FloatingIpActionModals-Ch8uozH9.mjs.map +1 -0
  16. package/dist/client/ImageToastNotifications-m6c3tVPb.mjs +1152 -0
  17. package/dist/client/ImageToastNotifications-m6c3tVPb.mjs.map +1 -0
  18. package/dist/client/SortInput-4g7nSTHW.mjs +34 -0
  19. package/dist/client/SortInput-4g7nSTHW.mjs.map +1 -0
  20. package/dist/client/{TwoColumnDescriptionList-DiDx3PnH.mjs → TwoColumnDescriptionList-DKS42RKa.mjs} +10 -4
  21. package/dist/client/TwoColumnDescriptionList-DKS42RKa.mjs.map +1 -0
  22. package/dist/client/_-CAsCx-Ay.mjs +6 -0
  23. package/dist/client/_-CAsCx-Ay.mjs.map +1 -0
  24. package/dist/client/_auth-SrDjHL6j.mjs +12 -0
  25. package/dist/client/_auth-SrDjHL6j.mjs.map +1 -0
  26. package/dist/client/{_flavorId-BN_qessZ.mjs → _flavorId-Dg7MS0Af.mjs} +3 -9
  27. package/dist/client/_flavorId-Dg7MS0Af.mjs.map +1 -0
  28. package/dist/client/_flavorId-kHl-b8rI.mjs +232 -0
  29. package/dist/client/_flavorId-kHl-b8rI.mjs.map +1 -0
  30. package/dist/client/{_floatingIpId-CwDGHkWm.mjs → _floatingIpId-C9xfRWot.mjs} +3 -9
  31. package/dist/client/_floatingIpId-C9xfRWot.mjs.map +1 -0
  32. package/dist/client/_floatingIpId-DNn6ABCB.mjs +196 -0
  33. package/dist/client/_floatingIpId-DNn6ABCB.mjs.map +1 -0
  34. package/dist/client/_imageId-8JIbFmGB.mjs +39 -0
  35. package/dist/client/_imageId-8JIbFmGB.mjs.map +1 -0
  36. package/dist/client/{_imageId-BtJ7GmYB.mjs → _imageId-BBAlRioC.mjs} +217 -201
  37. package/dist/client/_imageId-BBAlRioC.mjs.map +1 -0
  38. package/dist/client/{_projectId-Byt3GQDW.mjs → _projectId-7Nl1MQTJ.mjs} +5 -5
  39. package/dist/client/_projectId-7Nl1MQTJ.mjs.map +1 -0
  40. package/dist/client/_projectId-B3wmSala.mjs +281 -0
  41. package/dist/client/_projectId-B3wmSala.mjs.map +1 -0
  42. package/dist/client/_projectId-DPzv0CCp.mjs +77 -0
  43. package/dist/client/_projectId-DPzv0CCp.mjs.map +1 -0
  44. package/dist/client/_projectId-DfeVJy0G.mjs +30 -0
  45. package/dist/client/_projectId-DfeVJy0G.mjs.map +1 -0
  46. package/dist/client/{_securityGroupId-BcbkRhsN.mjs → _securityGroupId-C6eHmrx_.mjs} +3 -9
  47. package/dist/client/_securityGroupId-C6eHmrx_.mjs.map +1 -0
  48. package/dist/client/_securityGroupId-DmplhDgt.mjs +1810 -0
  49. package/dist/client/_securityGroupId-DmplhDgt.mjs.map +1 -0
  50. package/dist/client/_serviceType-DS8DxsrP.mjs +20 -0
  51. package/dist/client/_serviceType-DS8DxsrP.mjs.map +1 -0
  52. package/dist/client/_serviceType-M8d9rOT6.mjs +6 -0
  53. package/dist/client/_serviceType-M8d9rOT6.mjs.map +1 -0
  54. package/dist/client/_storageType-BRWWJtow.mjs +14 -0
  55. package/dist/client/_storageType-BRWWJtow.mjs.map +1 -0
  56. package/dist/client/_storageType-C5gS9eut.mjs +845 -0
  57. package/dist/client/_storageType-C5gS9eut.mjs.map +1 -0
  58. package/dist/client/_storageType-CzZ4u9x_.mjs +12 -0
  59. package/dist/client/_storageType-CzZ4u9x_.mjs.map +1 -0
  60. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
  61. package/dist/client/{about-_73VmpTB.mjs → about-BmQTyLWc.mjs} +2 -2
  62. package/dist/client/{about-_73VmpTB.mjs.map → about-BmQTyLWc.mjs.map} +1 -1
  63. package/dist/client/{aurora-EbwGRLLf.mjs → aurora-CIml-f2f.mjs} +2 -2
  64. package/dist/client/{aurora-EbwGRLLf.mjs.map → aurora-CIml-f2f.mjs.map} +1 -1
  65. package/dist/client/{build-C_4vRMCq.mjs → build-WuxXRAqf.mjs} +121 -24
  66. package/dist/client/{build-C_4vRMCq.mjs.map → build-WuxXRAqf.mjs.map} +1 -1
  67. package/dist/client/components/Breadcrumbs.d.ts +1 -0
  68. package/dist/client/components/ListToolbar/SortInput.d.ts +3 -0
  69. package/dist/client/context/BreadcrumbExtensionContext.d.ts +9 -0
  70. package/dist/client/context/DynamicBreadcrumbContext.d.ts +9 -0
  71. package/dist/client/{flavors-CiHCYrtZ.mjs → flavors-B1SDOPDu.mjs} +3 -5
  72. package/dist/client/flavors-B1SDOPDu.mjs.map +1 -0
  73. package/dist/client/flavors-D8_PzQUB.mjs +628 -0
  74. package/dist/client/flavors-D8_PzQUB.mjs.map +1 -0
  75. package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
  76. package/dist/client/floatingips-Cz9k80cc.mjs +8 -0
  77. package/dist/client/floatingips-Cz9k80cc.mjs.map +1 -0
  78. package/dist/client/floatingips-DrCvtXtT.mjs +551 -0
  79. package/dist/client/floatingips-DrCvtXtT.mjs.map +1 -0
  80. package/dist/client/hooks/useBreadcrumbs.d.ts +16 -0
  81. package/dist/client/hooks/usePushBreadcrumbs.d.ts +10 -0
  82. package/dist/client/hooks/useSetBreadcrumb.d.ts +11 -0
  83. package/dist/client/{hooks-LutR2Yg3.mjs → hooks-D0yKIumu.mjs} +2 -2
  84. package/dist/client/{hooks-LutR2Yg3.mjs.map → hooks-D0yKIumu.mjs.map} +1 -1
  85. package/dist/client/images-BGQv9kKT.mjs +1983 -0
  86. package/dist/client/images-BGQv9kKT.mjs.map +1 -0
  87. package/dist/client/{images-CS4kZQyu.mjs → images-CPmMa4SQ.mjs} +3 -5
  88. package/dist/client/images-CPmMa4SQ.mjs.map +1 -0
  89. package/dist/client/images-NBf2bV43.mjs.map +1 -1
  90. package/dist/client/index.d.ts +7 -3
  91. package/dist/client/index.js +549 -535
  92. package/dist/client/index.js.map +1 -1
  93. package/dist/client/objects-AERkhfiM.mjs +66 -0
  94. package/dist/client/objects-AERkhfiM.mjs.map +1 -0
  95. package/dist/client/{objects-C3azvW8m.mjs → objects-BR3eeSNH.mjs} +7087 -4211
  96. package/dist/client/objects-BR3eeSNH.mjs.map +1 -0
  97. package/dist/client/objects-DVccbrL1.mjs +66 -0
  98. package/dist/client/objects-DVccbrL1.mjs.map +1 -0
  99. package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
  100. package/dist/client/routeInfo-DP3v74Wg.mjs +19 -0
  101. package/dist/client/routeInfo-DP3v74Wg.mjs.map +1 -0
  102. package/dist/client/router.d.ts +2 -2
  103. package/dist/client/{routes-CdDm-hhO.mjs → routes-CJj7SR_K.mjs} +2 -2
  104. package/dist/client/routes-CJj7SR_K.mjs.map +1 -0
  105. package/dist/client/routes-xofA3ksU.mjs +110 -0
  106. package/dist/client/routes-xofA3ksU.mjs.map +1 -0
  107. package/dist/client/securitygroups-BjhgLBHm.mjs +620 -0
  108. package/dist/client/securitygroups-BjhgLBHm.mjs.map +1 -0
  109. package/dist/client/securitygroups-CtKne8UQ.mjs +8 -0
  110. package/dist/client/securitygroups-CtKne8UQ.mjs.map +1 -0
  111. package/dist/client/{securitygroups-Byte-iSp.mjs → securitygroups-DEJQBcxm.mjs} +3 -5
  112. package/dist/client/securitygroups-DEJQBcxm.mjs.map +1 -0
  113. package/dist/client/trpcClient.d.ts +135 -3
  114. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs +54 -0
  115. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs.map +1 -0
  116. package/dist/client/useModalTracking-BcOKTYRN.mjs +33 -0
  117. package/dist/client/useModalTracking-BcOKTYRN.mjs.map +1 -0
  118. package/dist/client/{useSecurityGroupPermissions-C29mzb3b.mjs → useSecurityGroupPermissions-BOyLQLdC.mjs} +85 -19
  119. package/dist/client/useSecurityGroupPermissions-BOyLQLdC.mjs.map +1 -0
  120. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs +19 -0
  121. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs.map +1 -0
  122. package/dist/client/utils/formatSwiftDate.d.ts +30 -0
  123. package/dist/server/index.d.ts +136 -4
  124. package/dist/server/index.js +845 -260
  125. package/package.json +37 -36
  126. package/dist/client/AuthProvider-BS5OVv8n.mjs.map +0 -1
  127. package/dist/client/DeleteFlavorModal-BP83t9zX.mjs +0 -721
  128. package/dist/client/DeleteFlavorModal-BP83t9zX.mjs.map +0 -1
  129. package/dist/client/FloatingIpActionModals-BraiJWBi.mjs +0 -417
  130. package/dist/client/FloatingIpActionModals-BraiJWBi.mjs.map +0 -1
  131. package/dist/client/ImageToastNotifications-BXMHJaIH.mjs +0 -1131
  132. package/dist/client/ImageToastNotifications-BXMHJaIH.mjs.map +0 -1
  133. package/dist/client/RouteError-hAF8_jbe.mjs +0 -25
  134. package/dist/client/RouteError-hAF8_jbe.mjs.map +0 -1
  135. package/dist/client/SortInput-Cqs2poV3.mjs +0 -34
  136. package/dist/client/SortInput-Cqs2poV3.mjs.map +0 -1
  137. package/dist/client/StatusError-C5KodQOq.mjs +0 -39
  138. package/dist/client/StatusError-C5KodQOq.mjs.map +0 -1
  139. package/dist/client/TwoColumnDescriptionList-DiDx3PnH.mjs.map +0 -1
  140. package/dist/client/_auth-DJ9wHZaj.mjs +0 -11
  141. package/dist/client/_auth-DJ9wHZaj.mjs.map +0 -1
  142. package/dist/client/_flavorId-BN_qessZ.mjs.map +0 -1
  143. package/dist/client/_flavorId-CJjEB_Ao.mjs +0 -210
  144. package/dist/client/_flavorId-CJjEB_Ao.mjs.map +0 -1
  145. package/dist/client/_floatingIpId-CwDGHkWm.mjs.map +0 -1
  146. package/dist/client/_floatingIpId-foMIwbE4.mjs +0 -215
  147. package/dist/client/_floatingIpId-foMIwbE4.mjs.map +0 -1
  148. package/dist/client/_imageId-BtJ7GmYB.mjs.map +0 -1
  149. package/dist/client/_projectId-BmtCuzJu.mjs +0 -29
  150. package/dist/client/_projectId-BmtCuzJu.mjs.map +0 -1
  151. package/dist/client/_projectId-Byt3GQDW.mjs.map +0 -1
  152. package/dist/client/_projectId-NYk1IN_a.mjs +0 -291
  153. package/dist/client/_projectId-NYk1IN_a.mjs.map +0 -1
  154. package/dist/client/_projectId-QueiFczy.mjs +0 -46
  155. package/dist/client/_projectId-QueiFczy.mjs.map +0 -1
  156. package/dist/client/_securityGroupId-BcbkRhsN.mjs.map +0 -1
  157. package/dist/client/_securityGroupId-pPtJsCoe.mjs +0 -1797
  158. package/dist/client/_securityGroupId-pPtJsCoe.mjs.map +0 -1
  159. package/dist/client/_storageType-BmqrU06i.mjs +0 -2202
  160. package/dist/client/_storageType-BmqrU06i.mjs.map +0 -1
  161. package/dist/client/components/Error/StatusError.d.ts +0 -11
  162. package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +0 -12
  163. package/dist/client/flavors-CiHCYrtZ.mjs.map +0 -1
  164. package/dist/client/flavors-DY-bDc8l.mjs +0 -650
  165. package/dist/client/flavors-DY-bDc8l.mjs.map +0 -1
  166. package/dist/client/floatingips-Ci4jHkaG.mjs +0 -591
  167. package/dist/client/floatingips-Ci4jHkaG.mjs.map +0 -1
  168. package/dist/client/images-91U7tr9Y2.mjs +0 -1976
  169. package/dist/client/images-91U7tr9Y2.mjs.map +0 -1
  170. package/dist/client/images-CS4kZQyu.mjs.map +0 -1
  171. package/dist/client/objects-C3azvW8m.mjs.map +0 -1
  172. package/dist/client/objects-CM265S6b.mjs +0 -56
  173. package/dist/client/objects-CM265S6b.mjs.map +0 -1
  174. package/dist/client/objects-EE9Cd1wI.mjs +0 -56
  175. package/dist/client/objects-EE9Cd1wI.mjs.map +0 -1
  176. package/dist/client/routeInfo-DXqB2HCf.mjs +0 -32
  177. package/dist/client/routeInfo-DXqB2HCf.mjs.map +0 -1
  178. package/dist/client/routes-CBd8CCuM.mjs +0 -115
  179. package/dist/client/routes-CBd8CCuM.mjs.map +0 -1
  180. package/dist/client/routes-CdDm-hhO.mjs.map +0 -1
  181. package/dist/client/securitygroups-Bd_uV4S9.mjs +0 -595
  182. package/dist/client/securitygroups-Bd_uV4S9.mjs.map +0 -1
  183. package/dist/client/securitygroups-Byte-iSp.mjs.map +0 -1
  184. package/dist/client/useSecurityGroupPermissions-C29mzb3b.mjs.map +0 -1
@@ -1,2202 +0,0 @@
1
- import { $ as e, B as t, C as n, E as r, F as i, H as a, J as o, K as s, N as c, O as l, S as u, T as d, W as f, X as p, Y as m, a as h, at as g, c as _, d as v, g as y, it as b, j as x, l as S, m as C, n as w, o as T, s as E, st as D, t as O, x as k, y as A } from "./build-C_4vRMCq.mjs";
2
- import { a as j } from "./trpcClient-D7gpR7YG.mjs";
3
- import { c as M, r as N, s as P } from "./objects-C3azvW8m.mjs";
4
- import { t as ee } from "./useProjectId-DBc5lpoU.mjs";
5
- import { t as F } from "./SortInput-Cqs2poV3.mjs";
6
- import { t as te } from "./formatBytes-CZv_XyCY.mjs";
7
- import { t as ne } from "./ContentHeader-BHMUzd9H.mjs";
8
- import { Fragment as re, jsx as I, jsxs as L } from "react/jsx-runtime";
9
- import { Fragment as R, startTransition as z, useCallback as ie, useEffect as B, useRef as ae, useState as V } from "react";
10
- import { useNavigate as H, useParams as oe } from "@tanstack/react-router";
11
- import { Trans as U, useLingui as se } from "@lingui/react";
12
- import { ErrorBoundary as ce } from "react-error-boundary";
13
- import { i18n as W } from "@lingui/core";
14
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/CreateContainerModal.tsx
15
- var G = ({ isOpen: e, onClose: t, onSuccess: n, onError: r, maxContainerNameLength: i = 256 }) => {
16
- let { i18n: a, _: s } = se(), c = ee(), [l, u] = V(""), [d, f] = V(null), m = j.useUtils(), h = j.storage.swift.createContainer.useMutation({
17
- onSuccess: () => {
18
- m.storage.swift.listContainers.invalidate();
19
- let e = l.trim();
20
- n?.(e);
21
- },
22
- onError: (e) => {
23
- r?.(l.trim(), e.message);
24
- },
25
- onSettled: () => {
26
- g();
27
- }
28
- }), g = () => {
29
- u(""), f(null), h.reset(), t();
30
- }, _ = (e) => e.trim() ? e.length > i ? (f(a._({
31
- id: "r5SQFW",
32
- values: { maxContainerNameLength: i }
33
- })), !1) : e.includes("/") ? (f(a._({ id: "9J93Xr" })), !1) : (f(null), !0) : (f(a._({ id: "JNGYAW" })), !1), v = (e) => {
34
- let t = e.target.value;
35
- u(t), d && _(t);
36
- }, y = () => {
37
- _(l) && h.mutate({
38
- project_id: c,
39
- container: l.trim()
40
- });
41
- };
42
- return e ? /*#__PURE__*/ I(o, {
43
- title: a._({ id: "vTh35P" }),
44
- open: e,
45
- onCancel: g,
46
- confirmButtonLabel: a._({ id: "hYgDIe" }),
47
- onConfirm: y,
48
- cancelButtonLabel: a._({ id: "dEgA5A" }),
49
- size: "small",
50
- disableConfirmButton: h.isPending || !l.trim(),
51
- children: /*#__PURE__*/ L(p, {
52
- direction: "vertical",
53
- gap: "6",
54
- children: [/*#__PURE__*/ I("p", {
55
- className: "text-theme-default",
56
- children: /*#__PURE__*/ I(U, { id: "ne/GWZ" })
57
- }), /*#__PURE__*/ I(C, {
58
- label: a._({ id: "SUSS9i" }),
59
- required: !0,
60
- value: l,
61
- onChange: v,
62
- onKeyDown: (e) => {
63
- e.key === "Enter" && y();
64
- },
65
- invalid: !!d,
66
- errortext: d || void 0,
67
- disabled: h.isPending,
68
- autoFocus: !0,
69
- placeholder: a._({ id: "W5FkH9" })
70
- })]
71
- })
72
- }) : null;
73
- }, le = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: i }) => {
74
- let { i18n: a, _: s } = se(), l = ee(), [m, g] = V(""), [_, y] = V(null), [b, S] = V(!1), w = ae(""), E = () => {
75
- t && navigator.clipboard.writeText(t.name).then(() => {
76
- S(!0), setTimeout(() => S(!1), 2e3);
77
- });
78
- }, D = j.useUtils(), { data: k, isLoading: A, error: M } = j.storage.swift.listObjects.useQuery({
79
- project_id: l,
80
- container: t?.name ?? "",
81
- format: "json",
82
- limit: 100
83
- }, { enabled: e && t !== null }), N = j.storage.swift.emptyContainer.useMutation({
84
- onSuccess: (e) => {
85
- D.storage.swift.listContainers.invalidate(), D.storage.swift.listObjects.invalidate({
86
- project_id: l,
87
- container: w.current
88
- }), r?.(w.current, e);
89
- },
90
- onError: (e) => {
91
- i?.(w.current, e.message);
92
- },
93
- onSettled: () => {
94
- P();
95
- }
96
- }), P = () => {
97
- g(""), y(null), N.reset(), n();
98
- }, F = (e) => {
99
- let t = e.target.value;
100
- g(t), _ && y(null);
101
- }, ne = () => {
102
- if (t) {
103
- if (m.trim() !== t.name) {
104
- y(a._({ id: "jS4B2+" }));
105
- return;
106
- }
107
- w.current = t.name, N.mutate({
108
- project_id: l,
109
- container: t.name
110
- });
111
- }
112
- }, re = (e) => {
113
- e.key === "Enter" && ne();
114
- };
115
- if (!e || !t) return null;
116
- let R = k?.length ?? 0, z = !A && t.count === 0 && R === 0, ie = !A && t.count > 0 && R === 0, B = z || ie, H = /*#__PURE__*/ L("span", {
117
- className: "flex max-w-100 items-center gap-2",
118
- children: [
119
- /*#__PURE__*/ I("span", {
120
- className: "shrink-0",
121
- children: /*#__PURE__*/ I(U, { id: "5Okch2" })
122
- }),
123
- /*#__PURE__*/ I("span", {
124
- className: "truncate",
125
- title: t.name,
126
- children: t.name
127
- }),
128
- !A && !B && /*#__PURE__*/ I("button", {
129
- type: "button",
130
- onClick: E,
131
- title: b ? a._({ id: "PiH3UR" }) : a._({ id: "NQU1Nn" }),
132
- className: "text-theme-light hover:text-theme-default inline-flex items-center transition-colors",
133
- children: /*#__PURE__*/ I(v, {
134
- icon: b ? "checkCircle" : "contentCopy",
135
- size: "16"
136
- })
137
- })
138
- ]
139
- });
140
- return /*#__PURE__*/ L(o, {
141
- title: H,
142
- open: e,
143
- onCancel: P,
144
- confirmButtonLabel: B ? void 0 : a._({ id: "N2S1rs" }),
145
- confirmButtonVariant: "primary-danger",
146
- onConfirm: B ? void 0 : ne,
147
- cancelButtonLabel: B ? void 0 : a._({ id: "dEgA5A" }),
148
- modalFooter: B ? /*#__PURE__*/ I(c, {
149
- className: "flex justify-end",
150
- children: /*#__PURE__*/ I(x, { children: /*#__PURE__*/ I(h, {
151
- variant: "primary",
152
- onClick: P,
153
- "data-testid": "empty-info-close-button",
154
- children: /*#__PURE__*/ I(U, { id: "yz7wBu" })
155
- }) })
156
- }) : void 0,
157
- size: "small",
158
- disableConfirmButton: A || N.isPending || !B && !m.trim() || !B && m.trim() !== t.name,
159
- children: [M && /*#__PURE__*/ I("p", {
160
- className: "text-theme-error mb-4",
161
- children: (() => {
162
- let e = M.message;
163
- return /*#__PURE__*/ I(U, {
164
- id: "56IxdF",
165
- values: { errorMessage: e }
166
- });
167
- })()
168
- }), A ? /*#__PURE__*/ L(p, {
169
- direction: "horizontal",
170
- alignment: "center",
171
- gap: "2",
172
- className: "py-4",
173
- children: [/*#__PURE__*/ I(f, { size: "small" }), /*#__PURE__*/ I(U, { id: "ujK/QN" })]
174
- }) : B && !M ? /*#__PURE__*/ I("p", {
175
- className: "text-theme-default py-2",
176
- children: z ? /*#__PURE__*/ I(U, { id: "jNm/qL" }) : /*#__PURE__*/ I(U, { id: "WefafP" })
177
- }) : M ? null : /*#__PURE__*/ L(p, {
178
- direction: "vertical",
179
- gap: "6",
180
- children: [
181
- /*#__PURE__*/ L("p", {
182
- className: "text-theme-default",
183
- children: [
184
- /*#__PURE__*/ I(U, { id: "Ioblgz" }),
185
- /*#__PURE__*/ I("br", {}),
186
- /*#__PURE__*/ I(U, {
187
- id: "kiRrtv",
188
- components: {
189
- 0: /*#__PURE__*/ I("strong", {}),
190
- 1: /*#__PURE__*/ I("strong", {}),
191
- 2: /*#__PURE__*/ I("strong", {})
192
- }
193
- })
194
- ]
195
- }),
196
- /*#__PURE__*/ L("div", {
197
- className: "border-theme-background-lvl-3 overflow-hidden rounded border",
198
- children: [
199
- t.count > R && /*#__PURE__*/ I("p", {
200
- className: "text-theme-light px-3 py-2 text-xs",
201
- children: (() => {
202
- let e = t.count;
203
- return /*#__PURE__*/ I(U, {
204
- id: "1iQtS2",
205
- values: {
206
- actualObjectCount: R,
207
- total: e
208
- }
209
- });
210
- })()
211
- }),
212
- /*#__PURE__*/ I(T, {
213
- columns: 3,
214
- className: "text-sm",
215
- children: /*#__PURE__*/ L(d, { children: [
216
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "6YtxFj" }) }),
217
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "Cj2Gtd" }) }),
218
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "sjMCOP" }) })
219
- ] })
220
- }),
221
- /*#__PURE__*/ I("div", {
222
- className: "max-h-48 overflow-y-auto",
223
- children: /*#__PURE__*/ I(T, {
224
- columns: 3,
225
- className: "text-sm",
226
- children: k.map((e) => /*#__PURE__*/ L(d, { children: [
227
- /*#__PURE__*/ I(O, {
228
- className: "max-w-50 truncate",
229
- title: e.name,
230
- children: e.name
231
- }),
232
- /*#__PURE__*/ I(O, { children: te(e.bytes) }),
233
- /*#__PURE__*/ I(O, { children: e.last_modified ? new Date(e.last_modified).toLocaleString() : a._({ id: "fj5byd" }) })
234
- ] }, e.name))
235
- })
236
- })
237
- ]
238
- }),
239
- /*#__PURE__*/ I(C, {
240
- label: a._({ id: "33F2A+" }),
241
- required: !0,
242
- value: m,
243
- onChange: F,
244
- onKeyDown: re,
245
- invalid: !!_,
246
- errortext: _ || void 0,
247
- disabled: N.isPending,
248
- autoFocus: !0,
249
- placeholder: t.name
250
- })
251
- ]
252
- })]
253
- });
254
- }, ue = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: i }) => {
255
- let { i18n: a, _: s } = se(), c = ee(), [l, u] = V(""), [d, m] = V(null), [h, _] = V(!1), v = j.useUtils(), { data: y, isLoading: b, error: x } = j.storage.swift.listObjects.useQuery({
256
- project_id: c,
257
- container: t?.name ?? "",
258
- format: "json",
259
- limit: 1
260
- }, { enabled: e && t !== null }), { data: S, error: w } = j.storage.swift.getContainerMetadata.useQuery({
261
- project_id: c,
262
- container: t?.name ?? ""
263
- }, { enabled: e && t !== null }), T = !!(S?.versionsEnabled || S?.versionsLocation || S?.historyLocation), E = j.storage.swift.deleteContainer.useMutation({
264
- onSuccess: () => {
265
- v.storage.swift.listContainers.invalidate(), r?.(t.name);
266
- },
267
- onError: (e) => {
268
- i?.(t.name, e.message);
269
- },
270
- onSettled: () => {
271
- D();
272
- }
273
- });
274
- B(() => {
275
- e || (u(""), m(null), _(!1), E.reset());
276
- }, [e, t?.name]);
277
- let D = () => {
278
- u(""), m(null), _(!1), E.reset(), n();
279
- }, O = (e) => {
280
- let t = e.target.value;
281
- u(t), d && m(null);
282
- }, k = () => {
283
- if (t && !(x || w)) {
284
- if (l.trim() !== "delete") {
285
- m(a._({ id: "b5aNMO" }));
286
- return;
287
- }
288
- T && !h || E.mutate({
289
- project_id: c,
290
- container: t.name
291
- });
292
- }
293
- }, A = (e) => {
294
- e.key === "Enter" && k();
295
- };
296
- if (!e || !t) return null;
297
- let M = y?.length ?? 0, N = !b && (M > 0 || t.count > 0), P = !b && t.count > 0 && M === 0, F = !!(x || w), te = /*#__PURE__*/ L("span", {
298
- className: "flex max-w-[400px] items-center gap-2",
299
- children: [/*#__PURE__*/ I("span", {
300
- className: "shrink-0",
301
- children: /*#__PURE__*/ I(U, { id: "Vzlopx" })
302
- }), /*#__PURE__*/ I("span", {
303
- className: "truncate",
304
- title: t.name,
305
- children: t.name
306
- })]
307
- });
308
- return /*#__PURE__*/ L(o, {
309
- title: te,
310
- open: e,
311
- onCancel: D,
312
- confirmButtonLabel: N ? a._({ id: "yz7wBu" }) : a._({ id: "cnGeoo" }),
313
- confirmButtonVariant: N ? "primary" : "primary-danger",
314
- onConfirm: N ? D : k,
315
- cancelButtonLabel: N ? void 0 : a._({ id: "dEgA5A" }),
316
- size: "small",
317
- disableConfirmButton: b || F || E.isPending || !N && l.trim() !== "delete" || !N && T && !h,
318
- children: [(x || w) && /*#__PURE__*/ L(p, {
319
- direction: "vertical",
320
- gap: "2",
321
- className: "mb-4",
322
- role: "alert",
323
- "aria-live": "assertive",
324
- children: [x && /*#__PURE__*/ I("p", {
325
- className: "text-theme-error",
326
- children: (() => {
327
- let e = x.message;
328
- return /*#__PURE__*/ I(U, {
329
- id: "56IxdF",
330
- values: { errorMessage: e }
331
- });
332
- })()
333
- }), w && /*#__PURE__*/ I("p", {
334
- className: "text-theme-error",
335
- children: (() => {
336
- let e = w.message;
337
- return /*#__PURE__*/ I(U, {
338
- id: "BCXapL",
339
- values: { errorMessage: e }
340
- });
341
- })()
342
- })]
343
- }), b ? /*#__PURE__*/ L(p, {
344
- direction: "horizontal",
345
- alignment: "center",
346
- gap: "2",
347
- className: "py-4",
348
- children: [/*#__PURE__*/ I(f, { size: "small" }), /*#__PURE__*/ I(U, { id: "Z3FXyt" })]
349
- }) : N ? /*#__PURE__*/ L(p, {
350
- direction: "vertical",
351
- gap: "3",
352
- children: [/*#__PURE__*/ I("p", {
353
- className: "text-theme-default",
354
- children: /*#__PURE__*/ I(U, { id: "3dBmvU" })
355
- }), P && /*#__PURE__*/ I("p", {
356
- className: "text-theme-default",
357
- children: /*#__PURE__*/ I(U, { id: "x3T4pq" })
358
- })]
359
- }) : /*#__PURE__*/ L(p, {
360
- direction: "vertical",
361
- gap: "6",
362
- children: [
363
- /*#__PURE__*/ L("p", {
364
- className: "text-theme-default",
365
- children: [
366
- /*#__PURE__*/ I(U, { id: "Y8M9Uc" }),
367
- /*#__PURE__*/ I("br", {}),
368
- /*#__PURE__*/ I(U, {
369
- id: "YzUoh9",
370
- components: { 0: /*#__PURE__*/ I("strong", {}) }
371
- })
372
- ]
373
- }),
374
- T && /*#__PURE__*/ I(g, {
375
- label: a._({ id: "V/8B9A" }),
376
- checked: h,
377
- onChange: (e) => _(e.target.checked)
378
- }),
379
- /*#__PURE__*/ I(C, {
380
- label: a._({ id: "QytzQr" }),
381
- required: !0,
382
- value: l,
383
- onChange: O,
384
- onKeyDown: A,
385
- invalid: !!d,
386
- errortext: d || void 0,
387
- disabled: E.isPending,
388
- autoFocus: !0,
389
- placeholder: a._({ id: "HNlEFZ" })
390
- })
391
- ]
392
- })]
393
- });
394
- }, de = /* @__PURE__ */ new Set([
395
- "quota-bytes",
396
- "quota-count",
397
- "web-index",
398
- "web-listings",
399
- "web-listings-css",
400
- "web-error"
401
- ]), fe = 50, pe = /^[a-zA-Z0-9!#$%&'*+\-.^_`|~]+$/, me = ({ isOpen: n, container: r, onClose: i, onSuccess: c }) => {
402
- let { i18n: l, _ } = se(), y = ee(), { data: b, isLoading: x, isError: S, error: w } = j.storage.swift.getContainerMetadata.useQuery({
403
- project_id: y,
404
- container: r?.name ?? ""
405
- }, { enabled: n && r !== null }), E = b?.read === ".r:*,.rlistings", { data: D } = j.storage.swift.getContainerPublicUrl.useQuery({
406
- project_id: y,
407
- container: r?.name ?? ""
408
- }, { enabled: n && r !== null && E }), { data: k } = j.storage.swift.listContainers.useQuery({ project_id: y }, { enabled: n }), [A, M] = V(""), [N, P] = V(""), F = ae(null), te = ie((e) => {
409
- let t = e.target.value;
410
- M(t), F.current && clearTimeout(F.current), F.current = setTimeout(() => P(t), 300);
411
- }, []), ne = N.trim().length > 0 ? (k ?? []).filter((e) => e.name !== r?.name && e.name.toLowerCase().includes(N.toLowerCase())) : [], re = ne.slice(0, fe), R = ne.length - re.length, z = j.useUtils(), [H, oe] = V(""), [ce, W] = V(null), [G, le] = V(""), [ue, me] = V(null), [K, q] = V(""), [he, ge] = V(!1), [J, _e] = V(!1), [Y, ve] = V(""), [X, Z] = V([]), [ye, be] = V({}), [xe, Se] = V(!1), [Ce, we] = V(""), [Te, Ee] = V(""), [De, Oe] = V(null), [ke, Ae] = V(null);
412
- B(() => {
413
- if (!b) return;
414
- oe(b.quotaBytes == null ? "" : String(b.quotaBytes)), le(b.quotaCount == null ? "" : String(b.quotaCount)), _e(!!(b.versionsEnabled || b.versionsLocation || b.historyLocation)), ve(b.versionsLocation || b.historyLocation || "");
415
- let e = b.metadata ?? {};
416
- q(e["web-index"] ?? ""), ge(e["web-listings"] === "1" || e["web-listings"] === "true");
417
- let t = b.metadata ?? {}, n = Object.entries(t).filter(([e]) => !de.has(e)).map(([e, t]) => ({
418
- key: e,
419
- value: t,
420
- isNew: !1,
421
- isEditing: !1,
422
- originalKey: e,
423
- originalValue: t
424
- }));
425
- Z(n);
426
- }, [b]), B(() => {
427
- n || Q();
428
- }, [n]);
429
- let Q = () => {
430
- oe(""), W(null), le(""), me(null), q(""), ge(!1), _e(!1), ve(""), M(""), P(""), F.current && clearTimeout(F.current), Z([]), be({}), Se(!1), we(""), Ee(""), Oe(null), Ae(null), je.reset();
431
- }, je = j.storage.swift.updateContainerMetadata.useMutation({
432
- onSuccess: () => {
433
- z.storage.swift.getContainerMetadata.invalidate({ container: r.name }), z.storage.swift.listContainers.invalidate(), c?.(r.name), Ue();
434
- },
435
- onError: () => {}
436
- }), Me = () => {
437
- let e = !0;
438
- return H !== "" && (isNaN(Number(H)) || !Number.isInteger(Number(H)) || Number(H) < 0) ? (W(l._({ id: "HG5AI8" })), e = !1) : W(null), G !== "" && (isNaN(Number(G)) || !Number.isInteger(Number(G)) || Number(G) < 0) ? (me(l._({ id: "HG5AI8" })), e = !1) : me(null), e;
439
- }, Ne = (e, t) => e.trim() ? pe.test(e) ? /[a-zA-Z0-9]/.test(e) ? de.has(e.toLowerCase()) ? l._({ id: "JeRXll" }) : X.some((n) => n.key.toLowerCase() === e.toLowerCase() && n.originalKey !== t) ? l._({ id: "i6/ygf" }) : null : l._({ id: "dTNzBI" }) : l._({ id: "XYZLy9" }) : l._({ id: "QV1ZPO" }), Pe = () => {
440
- let e = Ne(Ce);
441
- if (e) {
442
- Oe(e);
443
- return;
444
- }
445
- if (!Te.trim()) {
446
- Ae(l._({ id: "hXUWyd" }));
447
- return;
448
- }
449
- Z([...X, {
450
- key: Ce.trim(),
451
- value: Te.trim(),
452
- isNew: !0,
453
- isEditing: !1
454
- }]), we(""), Ee(""), Se(!1), Oe(null), Ae(null);
455
- }, Fe = () => {
456
- we(""), Ee(""), Se(!1), Oe(null), Ae(null);
457
- }, Ie = (e) => {
458
- Z(X.map((t, n) => n === e ? {
459
- ...t,
460
- isEditing: !0
461
- } : {
462
- ...t,
463
- isEditing: !1
464
- })), Se(!1);
465
- }, Le = (e) => {
466
- let t = X[e], n = Ne(t.key, t.originalKey);
467
- if (n) {
468
- be({ [`edit-${e}`]: n });
469
- return;
470
- }
471
- if (!t.value.trim()) {
472
- be({ [`edit-${e}`]: l._({ id: "hXUWyd" }) });
473
- return;
474
- }
475
- Z(X.map((t, n) => n === e ? {
476
- ...t,
477
- isEditing: !1,
478
- key: t.key.trim(),
479
- value: t.value.trim()
480
- } : t)), be({});
481
- }, Re = (e) => {
482
- Z(X.map((t, n) => n === e ? {
483
- ...t,
484
- isEditing: !1,
485
- key: t.originalKey ?? t.key,
486
- value: t.originalValue ?? t.value
487
- } : t)), be({});
488
- }, ze = (e) => {
489
- Z(X.filter((t, n) => n !== e)), be({});
490
- }, Be = (e, t) => {
491
- Z(X.map((n, r) => r === e ? {
492
- ...n,
493
- key: t
494
- } : n)), be((t) => {
495
- let n = { ...t };
496
- return delete n[`edit-${e}`], n;
497
- });
498
- }, Ve = (e, t) => {
499
- Z(X.map((n, r) => r === e ? {
500
- ...n,
501
- value: t
502
- } : n)), be((t) => {
503
- let n = { ...t };
504
- return delete n[`edit-${e}`], n;
505
- });
506
- }, He = () => {
507
- if (!r || !Me()) return;
508
- let e = b?.metadata ?? {}, t = {}, n = [];
509
- X.forEach((e) => {
510
- (e.isNew || e.value !== e.originalValue || e.key !== e.originalKey) && (t[e.key] = e.value, !e.isNew && e.originalKey && e.key !== e.originalKey && n.push(e.originalKey));
511
- });
512
- let i = Object.keys(e).filter((e) => !de.has(e)), a = X.map((e) => e.originalKey).filter(Boolean);
513
- i.forEach((e) => {
514
- !a.includes(e) && !n.includes(e) && n.push(e);
515
- }), E && (K ? t["web-index"] = K : b?.metadata?.["web-index"] && n.push("web-index"), he ? t["web-listings"] = "1" : b?.metadata?.["web-listings"] && n.push("web-listings"));
516
- let o = !!(b?.versionsEnabled || b?.versionsLocation || b?.historyLocation), s = b?.versionsLocation || b?.historyLocation || "";
517
- je.mutate({
518
- project_id: y,
519
- container: r.name,
520
- metadata: t,
521
- removeMetadata: n.length ? n : void 0,
522
- quotaBytes: H === "" ? void 0 : Number(H),
523
- quotaCount: G === "" ? void 0 : Number(G),
524
- versionsLocation: J && (!o || Y !== s) && Y ? Y : void 0,
525
- removeVersionsLocation: !J && o ? !0 : void 0
526
- });
527
- }, Ue = () => {
528
- Q(), i();
529
- };
530
- if (!n || !r) return null;
531
- let $ = x || je.isPending, We = S && !x, Ge = X.some((e) => e.isEditing), Ke = b?.quotaBytes == null ? "" : String(b.quotaBytes), qe = b?.quotaCount == null ? "" : String(b.quotaCount), Je = !!b?.versionsEnabled, Ye = b?.versionsLocation || b?.historyLocation || "", Xe = b?.metadata?.["web-index"] ?? "", Ze = b?.metadata?.["web-listings"] === "1" || b?.metadata?.["web-listings"] === "true", Qe = Object.keys(b?.metadata ?? {}).filter((e) => !de.has(e)), $e = X.length === Qe.length && X.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue), et = H === Ke && G === qe && J === Je && Y === Ye && K === Xe && he === Ze && $e, tt = b?.quotaBytes == null ? null : `${b.quotaBytes} B`;
532
- return /*#__PURE__*/ L(o, {
533
- title: /*#__PURE__*/ L("span", {
534
- className: "flex max-w-[500px] items-center gap-2",
535
- children: [/*#__PURE__*/ I("span", {
536
- className: "shrink-0",
537
- children: /*#__PURE__*/ I(U, { id: "y02Bu1" })
538
- }), /*#__PURE__*/ I("span", {
539
- className: "truncate",
540
- title: r.name,
541
- children: r.name
542
- })]
543
- }),
544
- open: n,
545
- onCancel: Ue,
546
- confirmButtonLabel: l._({ id: "tfDRzk" }),
547
- onConfirm: He,
548
- cancelButtonLabel: l._({ id: "dEgA5A" }),
549
- size: "large",
550
- disableConfirmButton: $ || xe || Ge || et || We,
551
- children: [je.isError && /*#__PURE__*/ I("p", {
552
- className: "text-theme-error mb-4",
553
- children: (() => {
554
- let e = je.error.message;
555
- return /*#__PURE__*/ I(U, {
556
- id: "nUuaq8",
557
- values: { errorMessage: e }
558
- });
559
- })()
560
- }), x ? /*#__PURE__*/ L(p, {
561
- direction: "horizontal",
562
- alignment: "center",
563
- gap: "2",
564
- className: "py-8",
565
- children: [/*#__PURE__*/ I(f, { size: "small" }), /*#__PURE__*/ I(U, { id: "WRZ3Mt" })]
566
- }) : We ? /*#__PURE__*/ I("p", {
567
- className: "text-theme-error py-8 text-center",
568
- children: (() => {
569
- let e = w?.message ?? "Unknown error";
570
- return /*#__PURE__*/ I(U, {
571
- id: "BCXapL",
572
- values: { errorMessage: e }
573
- });
574
- })()
575
- }) : /*#__PURE__*/ I("div", {
576
- className: "max-h-[65vh] overflow-y-auto pr-1 pl-1",
577
- children: /*#__PURE__*/ L(p, {
578
- direction: "vertical",
579
- gap: "6",
580
- children: [
581
- /*#__PURE__*/ L("div", {
582
- className: "grid grid-cols-2 gap-4",
583
- children: [/*#__PURE__*/ I(C, {
584
- label: l._({ id: "z45o5B" }),
585
- value: String(r.count),
586
- disabled: !0,
587
- readOnly: !0
588
- }), /*#__PURE__*/ I(C, {
589
- label: l._({ id: "/InK0O" }),
590
- value: b?.bytesUsed == null ? `${r.bytes.toLocaleString()} B` : `${b.bytesUsed.toLocaleString()} B`,
591
- disabled: !0,
592
- readOnly: !0
593
- })]
594
- }),
595
- /*#__PURE__*/ L("div", {
596
- className: "grid grid-cols-2 gap-4",
597
- children: [/*#__PURE__*/ I("div", { children: /*#__PURE__*/ I(C, {
598
- label: l._({ id: "k0vAWv" }),
599
- value: G,
600
- onChange: (e) => {
601
- le(e.target.value), ue && me(null);
602
- },
603
- placeholder: l._({ id: "qtoOYG" }),
604
- invalid: !!ue,
605
- errortext: ue ?? void 0,
606
- disabled: $
607
- }) }), /*#__PURE__*/ I("div", { children: /*#__PURE__*/ I(C, {
608
- label: l._({ id: "KOpPMt" }),
609
- value: H,
610
- onChange: (e) => {
611
- oe(e.target.value), ce && W(null);
612
- },
613
- placeholder: l._({ id: "qtoOYG" }),
614
- invalid: !!ce,
615
- errortext: ce ?? void 0,
616
- disabled: $,
617
- helptext: H && tt ? tt : void 0
618
- }) })]
619
- }),
620
- E && D && /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ L("p", {
621
- className: "text-theme-default mb-1 text-sm font-semibold",
622
- children: [
623
- /*#__PURE__*/ I(U, { id: "mvz5Eo" }),
624
- " ",
625
- /*#__PURE__*/ I("a", {
626
- href: D,
627
- target: "_blank",
628
- rel: "noopener noreferrer",
629
- className: "text-theme-info text-xs font-normal underline",
630
- children: /*#__PURE__*/ I(U, { id: "Alx2/L" })
631
- })
632
- ]
633
- }), /*#__PURE__*/ I(C, {
634
- value: D,
635
- disabled: !0,
636
- readOnly: !0
637
- })] }),
638
- /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I("p", {
639
- className: "text-theme-default mb-3 text-sm font-semibold",
640
- children: /*#__PURE__*/ I(U, { id: "6CDYXS" })
641
- }), E ? /*#__PURE__*/ L(p, {
642
- direction: "vertical",
643
- gap: "4",
644
- children: [/*#__PURE__*/ L(p, {
645
- direction: "vertical",
646
- gap: "1",
647
- children: [/*#__PURE__*/ I(g, {
648
- label: l._({ id: "6+7EwD" }),
649
- checked: !!K,
650
- onChange: (e) => {
651
- e.target.checked ? K || q("index.html") : q("");
652
- },
653
- disabled: $
654
- }), /*#__PURE__*/ I("div", {
655
- className: "pl-6",
656
- children: /*#__PURE__*/ I(C, {
657
- value: K,
658
- onChange: (e) => q(e.target.value),
659
- placeholder: "index.html",
660
- disabled: $ || !K,
661
- className: "flex-1"
662
- })
663
- })]
664
- }), /*#__PURE__*/ L(p, {
665
- direction: "horizontal",
666
- alignment: "start",
667
- gap: "2",
668
- children: [/*#__PURE__*/ I(g, {
669
- label: l._({ id: "NeUjqc" }),
670
- checked: he,
671
- onChange: (e) => ge(e.target.checked),
672
- disabled: $
673
- }), /*#__PURE__*/ L(m, {
674
- triggerEvent: "hover",
675
- children: [/*#__PURE__*/ I(e, { children: /*#__PURE__*/ I(v, {
676
- icon: "help",
677
- size: "16",
678
- className: "text-theme-light cursor-help"
679
- }) }), /*#__PURE__*/ I(t, {
680
- className: "z-10 max-w-[220px]",
681
- children: /*#__PURE__*/ I(U, { id: "Oxl1UN" })
682
- })]
683
- })]
684
- })]
685
- }) : /*#__PURE__*/ I("p", {
686
- className: "text-theme-default text-sm",
687
- children: /*#__PURE__*/ I(U, {
688
- id: "aSsVD3",
689
- components: { 0: /*#__PURE__*/ I("strong", {}) }
690
- })
691
- })] }),
692
- /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I("p", {
693
- className: "text-theme-default mb-2 text-sm font-semibold",
694
- children: /*#__PURE__*/ I(U, { id: "jNzyQo" })
695
- }), Je && !Y ? /*#__PURE__*/ I(g, {
696
- label: l._({ id: "Nvfd2b" }),
697
- checked: !0,
698
- onChange: (e) => {
699
- e.target.checked || (_e(!1), ve(""), M(""), P(""));
700
- },
701
- disabled: !0
702
- }) : !J && !Y ? /*#__PURE__*/ I(g, {
703
- label: l._({ id: "WyKwnD" }),
704
- checked: !1,
705
- onChange: (e) => _e(e.target.checked),
706
- disabled: $
707
- }) : /*#__PURE__*/ L(p, {
708
- direction: "vertical",
709
- gap: "1",
710
- children: [/*#__PURE__*/ I(g, {
711
- label: l._({ id: "b0uU1G" }),
712
- checked: J,
713
- onChange: (e) => {
714
- _e(e.target.checked), e.target.checked || (ve(""), M(""), P(""));
715
- },
716
- disabled: $
717
- }), J && /*#__PURE__*/ I("div", {
718
- className: "pl-6",
719
- children: /*#__PURE__*/ I(s, {
720
- value: Y,
721
- onChange: (e) => ve(e),
722
- onInputChange: te,
723
- placeholder: l._({ id: "a13wDR" }),
724
- helptext: (() => {
725
- if (A.trim().length === 0) return l._({ id: "c+fUtV" });
726
- if (R > 0) {
727
- let e = fe, t = ne.length;
728
- return l._({
729
- id: "qzhUb9",
730
- values: {
731
- maxOptions: e,
732
- totalCount: t
733
- }
734
- });
735
- }
736
- })(),
737
- disabled: $,
738
- children: re.map((e) => /*#__PURE__*/ I(a, {
739
- value: e.name,
740
- children: e.name
741
- }, e.name))
742
- })
743
- })]
744
- })] }),
745
- /*#__PURE__*/ L("div", { children: [
746
- /*#__PURE__*/ L(p, {
747
- direction: "horizontal",
748
- alignment: "center",
749
- distribution: "between",
750
- className: "mb-3",
751
- children: [/*#__PURE__*/ I("p", {
752
- className: "text-theme-default text-sm font-semibold",
753
- children: /*#__PURE__*/ I(U, { id: "6GBt0m" })
754
- }), /*#__PURE__*/ I("p", {
755
- className: "text-theme-light text-xs",
756
- children: /*#__PURE__*/ I(U, { id: "kuYWaD" })
757
- })]
758
- }),
759
- /*#__PURE__*/ I(p, {
760
- direction: "horizontal",
761
- className: "jn:bg-theme-background-lvl-1 justify-end p-2",
762
- children: /*#__PURE__*/ I(h, {
763
- label: l._({ id: "sWBLli" }),
764
- onClick: () => Se(!0),
765
- variant: "primary",
766
- icon: "addCircle",
767
- size: "small",
768
- disabled: xe || Ge || $
769
- })
770
- }),
771
- /*#__PURE__*/ L(T, {
772
- columns: 3,
773
- children: [
774
- /*#__PURE__*/ L(d, { children: [
775
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "7sMeHQ" }) }),
776
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "wMHvYH" }) }),
777
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "7L01XJ" }) })
778
- ] }),
779
- xe && /*#__PURE__*/ L(d, { children: [
780
- /*#__PURE__*/ I(O, { children: /*#__PURE__*/ I(C, {
781
- value: Ce,
782
- onChange: (e) => {
783
- we(e.target.value), De && Oe(null);
784
- },
785
- placeholder: l._({ id: "x9AdZ8" }),
786
- errortext: De ?? void 0,
787
- invalid: !!De,
788
- autoFocus: !0
789
- }) }),
790
- /*#__PURE__*/ I(O, { children: /*#__PURE__*/ I(C, {
791
- value: Te,
792
- onChange: (e) => {
793
- Ee(e.target.value), ke && Ae(null);
794
- },
795
- placeholder: l._({ id: "wMHvYH" }),
796
- errortext: ke ?? void 0,
797
- invalid: !!ke
798
- }) }),
799
- /*#__PURE__*/ I(O, { children: /*#__PURE__*/ L(p, {
800
- direction: "horizontal",
801
- gap: "2",
802
- children: [/*#__PURE__*/ I(h, {
803
- size: "small",
804
- variant: "primary",
805
- onClick: Pe,
806
- icon: "check",
807
- title: l._({ id: "tfDRzk" })
808
- }), /*#__PURE__*/ I(h, {
809
- size: "small",
810
- variant: "subdued",
811
- onClick: Fe,
812
- icon: "close",
813
- title: l._({ id: "bzSI52" })
814
- })]
815
- }) })
816
- ] }),
817
- X.map((e, t) => /*#__PURE__*/ L(d, { children: [
818
- /*#__PURE__*/ I(O, { children: e.isEditing ? /*#__PURE__*/ I(C, {
819
- value: e.key,
820
- onChange: (e) => Be(t, e.target.value),
821
- errortext: ye[`edit-${t}`],
822
- invalid: !!ye[`edit-${t}`]
823
- }) : /*#__PURE__*/ I("span", {
824
- className: "block max-w-xs truncate text-sm",
825
- title: e.key,
826
- children: e.key
827
- }) }),
828
- /*#__PURE__*/ I(O, { children: e.isEditing ? /*#__PURE__*/ I(C, {
829
- value: e.value,
830
- onChange: (e) => Ve(t, e.target.value)
831
- }) : /*#__PURE__*/ I("span", {
832
- className: "block max-w-md truncate text-sm",
833
- title: e.value,
834
- children: e.value
835
- }) }),
836
- /*#__PURE__*/ I(O, { children: e.isEditing ? /*#__PURE__*/ L(p, {
837
- direction: "horizontal",
838
- gap: "2",
839
- children: [/*#__PURE__*/ I(h, {
840
- size: "small",
841
- variant: "primary",
842
- onClick: () => Le(t),
843
- icon: "check",
844
- title: l._({ id: "tfDRzk" })
845
- }), /*#__PURE__*/ I(h, {
846
- size: "small",
847
- variant: "subdued",
848
- onClick: () => Re(t),
849
- icon: "close",
850
- title: l._({ id: "bzSI52" })
851
- })]
852
- }) : /*#__PURE__*/ L(p, {
853
- direction: "horizontal",
854
- gap: "2",
855
- children: [/*#__PURE__*/ I(h, {
856
- size: "small",
857
- variant: "subdued",
858
- onClick: () => Ie(t),
859
- icon: "edit",
860
- title: l._({ id: "ePK91l" }),
861
- disabled: xe || Ge || $
862
- }), /*#__PURE__*/ I(h, {
863
- size: "small",
864
- variant: "primary-danger",
865
- onClick: () => ze(t),
866
- icon: "deleteForever",
867
- title: l._({ id: "cnGeoo" }),
868
- disabled: xe || Ge || $
869
- })]
870
- }) })
871
- ] }, t)),
872
- X.length === 0 && !xe && /*#__PURE__*/ I(d, { children: /*#__PURE__*/ I(O, {
873
- colSpan: 3,
874
- className: "py-6 text-center",
875
- children: /*#__PURE__*/ I(p, {
876
- alignment: "center",
877
- children: /*#__PURE__*/ I("span", {
878
- className: "text-theme-light text-sm",
879
- children: /*#__PURE__*/ I(U, { id: "F02e8I" })
880
- })
881
- })
882
- }) })
883
- ]
884
- })
885
- ] })
886
- ]
887
- })
888
- })]
889
- });
890
- };
891
- //#endregion
892
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ManageContainerAccessModal.tsx
893
- function K(e) {
894
- let t = e.trim();
895
- if (t === ".r:*") return {
896
- raw: t,
897
- type: "any-referrer",
898
- description: "",
899
- requiresToken: !1
900
- };
901
- if (t.startsWith(".r:")) {
902
- let e = t.slice(3), n = e.startsWith("-"), r = n ? e.slice(1) : e;
903
- return {
904
- raw: t,
905
- type: n ? "denied-referrer" : "specific-referrer",
906
- host: r,
907
- description: "",
908
- requiresToken: !1
909
- };
910
- }
911
- if (t === ".rlistings") return {
912
- raw: t,
913
- type: "listing-access",
914
- description: "",
915
- requiresToken: !1
916
- };
917
- if (/^[^:]+:\*$/.test(t) && !t.startsWith("*")) {
918
- let [e] = t.split(":");
919
- return {
920
- raw: t,
921
- type: "all-project-users",
922
- projectId: e,
923
- description: "",
924
- requiresToken: !0
925
- };
926
- }
927
- if (t.startsWith("*:")) return {
928
- raw: t,
929
- type: "specific-user-any-project",
930
- userId: t.slice(2),
931
- description: "",
932
- requiresToken: !0
933
- };
934
- if (t.includes(":")) {
935
- let [e, n] = t.split(":");
936
- return {
937
- raw: t,
938
- type: "specific-user",
939
- projectId: e,
940
- userId: n,
941
- description: "",
942
- requiresToken: !0
943
- };
944
- }
945
- return {
946
- raw: t,
947
- type: "unknown",
948
- description: "",
949
- requiresToken: !0
950
- };
951
- }
952
- function q(e) {
953
- return e.trim() ? e.split(",").map((e) => e.trim()).filter(Boolean).map(K) : [];
954
- }
955
- var he = [".r:*", ".rlistings"];
956
- function ge(e) {
957
- let t = e.split(",").map((e) => e.trim()).filter(Boolean);
958
- return he.every((e) => t.includes(e));
959
- }
960
- function J(e) {
961
- let t = e.split(",").map((e) => e.trim()).filter(Boolean);
962
- return [.../* @__PURE__ */ new Set([...he, ...t])].join(",");
963
- }
964
- function _e(e) {
965
- return e.split(",").map((e) => e.trim()).filter((e) => !he.includes(e)).join(",");
966
- }
967
- function Y(e) {
968
- switch (e.type) {
969
- case "any-referrer": return W._({ id: "HVdrr1" });
970
- case "denied-referrer": {
971
- let t = e.host || "";
972
- return W._({
973
- id: "7XQ3QJ",
974
- values: { host: t }
975
- });
976
- }
977
- case "specific-referrer": {
978
- let t = e.host || "";
979
- return W._({
980
- id: "Dqnh7K",
981
- values: { host: t }
982
- });
983
- }
984
- case "listing-access": return W._({ id: "ntNlXu" });
985
- case "all-project-users": {
986
- let t = e.projectId || "";
987
- return W._({
988
- id: "sa4CV6",
989
- values: { projectId: t }
990
- });
991
- }
992
- case "specific-user-any-project": {
993
- let t = e.userId || "";
994
- return W._({
995
- id: "izMhIO",
996
- values: { userId: t }
997
- });
998
- }
999
- case "specific-user": {
1000
- let t = e.projectId || "", n = e.userId || "";
1001
- return W._({
1002
- id: "cXuXkb",
1003
- values: {
1004
- userId: n,
1005
- projectId: t
1006
- }
1007
- });
1008
- }
1009
- default: return e.raw;
1010
- }
1011
- }
1012
- var ve = ({ isOpen: e, container: t, onClose: n, onSuccess: a, onError: s }) => {
1013
- let { i18n: c, _: l } = se(), u = ee(), [d, m] = V(""), [_, v] = V(""), [y, b] = V(!1), [x, S] = V(!1);
1014
- B(() => {
1015
- !d.trim() && !_.trim() && S(!1);
1016
- }, [d, _]);
1017
- let { data: C, isLoading: T, isError: O, error: k } = j.storage.swift.getContainerMetadata.useQuery({
1018
- project_id: u,
1019
- container: t?.name ?? ""
1020
- }, { enabled: e && t !== null });
1021
- B(() => {
1022
- if (!C) return;
1023
- let e = C.read ?? "", t = C.write ?? "";
1024
- m(e), v(t), b(ge(e));
1025
- }, [C]);
1026
- let A = j.useUtils(), M = j.storage.swift.updateContainerMetadata.useMutation({
1027
- onSuccess: () => {
1028
- A.storage.swift.getContainerMetadata.invalidate({
1029
- project_id: u,
1030
- container: t.name
1031
- }), A.storage.swift.listContainers.invalidate(), a?.(t.name), P();
1032
- },
1033
- onError: (e) => {
1034
- s?.(t.name, e.message);
1035
- }
1036
- }), N = ae(M.reset);
1037
- N.current = M.reset;
1038
- let P = () => {
1039
- m(""), v(""), b(!1), S(!1), M.reset(), n();
1040
- };
1041
- B(() => {
1042
- e || (m(""), v(""), b(!1), N.current());
1043
- }, [e]);
1044
- let F = (e) => {
1045
- let t = e.target.checked;
1046
- b(t), m((e) => t ? J(e) : _e(e));
1047
- }, te = (e) => {
1048
- let t = e.target.value;
1049
- m(t), b(ge(t));
1050
- }, ne = () => {
1051
- t && M.mutate({
1052
- project_id: u,
1053
- container: t.name,
1054
- read: d.trim(),
1055
- write: _.trim()
1056
- });
1057
- };
1058
- if (!e || !t) return null;
1059
- let z = T || M.isPending, ie = d.trim().length > 0 || _.trim().length > 0, H = q(d), oe = q(_), ce = /*#__PURE__*/ L("span", {
1060
- className: "flex items-center gap-2",
1061
- children: [/*#__PURE__*/ I(U, { id: "EdxcAN" }), /*#__PURE__*/ I("span", {
1062
- className: "max-w-[250px] truncate",
1063
- title: t.name,
1064
- children: t.name
1065
- })]
1066
- });
1067
- return /*#__PURE__*/ L(o, {
1068
- title: ce,
1069
- open: e,
1070
- onCancel: P,
1071
- confirmButtonLabel: c._({ id: "tfDRzk" }),
1072
- onConfirm: ne,
1073
- cancelButtonLabel: c._({ id: "dEgA5A" }),
1074
- size: "xl",
1075
- disableConfirmButton: z || O,
1076
- children: [M.isError && /*#__PURE__*/ I("p", {
1077
- className: "text-theme-error mb-4",
1078
- children: (() => {
1079
- let e = M.error.message;
1080
- return /*#__PURE__*/ I(U, {
1081
- id: "u2xIeO",
1082
- values: { errorMessage: e }
1083
- });
1084
- })()
1085
- }), /*#__PURE__*/ L("div", {
1086
- className: "max-h-[70vh] overflow-y-auto pr-1 pl-1",
1087
- children: [
1088
- /*#__PURE__*/ I("div", {
1089
- className: "mb-4",
1090
- children: /*#__PURE__*/ I(i, {
1091
- variant: "warning",
1092
- className: "mb-4",
1093
- children: /*#__PURE__*/ I(U, { id: "wH0MtN" })
1094
- })
1095
- }),
1096
- T ? /*#__PURE__*/ L(p, {
1097
- direction: "horizontal",
1098
- alignment: "center",
1099
- gap: "2",
1100
- className: "py-6",
1101
- children: [/*#__PURE__*/ I(f, { size: "small" }), /*#__PURE__*/ I(U, { id: "poCbZw" })]
1102
- }) : O ? /*#__PURE__*/ I("p", {
1103
- className: "text-theme-error py-2",
1104
- children: (() => {
1105
- let e = k?.message ?? "";
1106
- return /*#__PURE__*/ I(U, {
1107
- id: "QNHur0",
1108
- values: { errorMessage: e }
1109
- });
1110
- })()
1111
- }) : /*#__PURE__*/ I(re, { children: /*#__PURE__*/ L("div", {
1112
- className: "flex gap-6",
1113
- children: [/*#__PURE__*/ I("div", {
1114
- className: "min-w-0 flex-1",
1115
- children: /*#__PURE__*/ L(p, {
1116
- direction: "vertical",
1117
- gap: "6",
1118
- children: [
1119
- /*#__PURE__*/ L("div", { children: [
1120
- /*#__PURE__*/ I(Z, { label: c._({ id: "SBGiGm" }) }),
1121
- /*#__PURE__*/ I(D, {
1122
- value: d,
1123
- onChange: te,
1124
- disabled: z || y,
1125
- placeholder: c._({ id: "FKL6Jv" }),
1126
- className: "text-sm",
1127
- rows: 3
1128
- }),
1129
- /*#__PURE__*/ I(g, {
1130
- label: c._({ id: "23wBCX" }),
1131
- checked: y,
1132
- onChange: F,
1133
- disabled: z,
1134
- className: "mt-2"
1135
- })
1136
- ] }),
1137
- /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I(Z, { label: c._({ id: "6qzsuS" }) }), /*#__PURE__*/ I(D, {
1138
- value: _,
1139
- onChange: (e) => {
1140
- let t = e.target.value;
1141
- v(t);
1142
- },
1143
- disabled: z,
1144
- placeholder: c._({ id: "UVFHGY" }),
1145
- className: "text-sm",
1146
- rows: 3
1147
- })] }),
1148
- ie && /*#__PURE__*/ I(h, {
1149
- label: x ? c._({ id: "we28Pq" }) : c._({ id: "YiMCKk" }),
1150
- onClick: () => S((e) => !e),
1151
- variant: "subdued",
1152
- disabled: z,
1153
- className: "self-start"
1154
- }),
1155
- x && (H.length > 0 || oe.length > 0) && /*#__PURE__*/ L(p, {
1156
- direction: "vertical",
1157
- gap: "4",
1158
- children: [H.length > 0 && /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I("p", {
1159
- className: "text-theme-default mb-2 text-sm font-semibold",
1160
- children: /*#__PURE__*/ I(U, { id: "x7SF89" })
1161
- }), /*#__PURE__*/ I("div", {
1162
- className: "border-theme-background-lvl-3 rounded border p-3",
1163
- children: /*#__PURE__*/ I(E, {
1164
- className: "grid-cols-2",
1165
- alignTerms: "left",
1166
- children: H.map((e, t) => /*#__PURE__*/ L(R, { children: [/*#__PURE__*/ I(w, {
1167
- className: "col-span-1",
1168
- children: /*#__PURE__*/ I("span", {
1169
- className: "block truncate text-xs",
1170
- title: e.raw,
1171
- children: e.raw
1172
- })
1173
- }), /*#__PURE__*/ L(r, {
1174
- className: "col-span-1",
1175
- children: [/*#__PURE__*/ I("span", {
1176
- className: "block truncate text-sm",
1177
- title: Y(e),
1178
- children: Y(e)
1179
- }), /*#__PURE__*/ I("span", {
1180
- className: "text-theme-light block text-xs",
1181
- children: e.requiresToken ? /*#__PURE__*/ I(U, { id: "z+zpLP" }) : /*#__PURE__*/ I(U, { id: "t7ff15" })
1182
- })]
1183
- })] }, t))
1184
- })
1185
- })] }), oe.length > 0 && /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I("p", {
1186
- className: "text-theme-default mb-2 text-sm font-semibold",
1187
- children: /*#__PURE__*/ I(U, { id: "lRRkwQ" })
1188
- }), /*#__PURE__*/ I("div", {
1189
- className: "border-theme-background-lvl-3 rounded border p-3",
1190
- children: /*#__PURE__*/ I(E, {
1191
- className: "grid-cols-2",
1192
- alignTerms: "left",
1193
- children: oe.map((e, t) => /*#__PURE__*/ L(R, { children: [/*#__PURE__*/ I(w, {
1194
- className: "col-span-1",
1195
- children: /*#__PURE__*/ I("span", {
1196
- className: "block truncate text-xs",
1197
- title: e.raw,
1198
- children: e.raw
1199
- })
1200
- }), /*#__PURE__*/ L(r, {
1201
- className: "col-span-1",
1202
- children: [/*#__PURE__*/ I("span", {
1203
- className: "block truncate text-sm",
1204
- title: Y(e),
1205
- children: Y(e)
1206
- }), /*#__PURE__*/ I("span", {
1207
- className: "text-theme-light block text-xs",
1208
- children: e.requiresToken ? /*#__PURE__*/ I(U, { id: "z+zpLP" }) : /*#__PURE__*/ I(U, { id: "t7ff15" })
1209
- })]
1210
- })] }, t))
1211
- })
1212
- })] })]
1213
- })
1214
- ]
1215
- })
1216
- }), /*#__PURE__*/ L("div", {
1217
- className: "border-theme-background-lvl-3 w-72 shrink-0 border-l pl-6",
1218
- children: [
1219
- /*#__PURE__*/ I("p", {
1220
- className: "text-theme-light mb-3 text-xs",
1221
- children: /*#__PURE__*/ I(U, { id: "dd2ndz" })
1222
- }),
1223
- /*#__PURE__*/ L(p, {
1224
- direction: "vertical",
1225
- gap: "4",
1226
- children: [
1227
- /*#__PURE__*/ I(X, {
1228
- code: ".r:*",
1229
- description: c._({ id: "VV1fdg" })
1230
- }),
1231
- /*#__PURE__*/ I(X, {
1232
- code: ".rlistings",
1233
- description: c._({ id: "s/s1lz" })
1234
- }),
1235
- /*#__PURE__*/ I(X, {
1236
- code: "PROJECT_ID:USER_ID",
1237
- description: c._({ id: "zhM8FP" })
1238
- }),
1239
- /*#__PURE__*/ I(X, {
1240
- code: "PROJECT_ID:*",
1241
- description: c._({ id: "BCJPTn" })
1242
- }),
1243
- /*#__PURE__*/ I(X, {
1244
- code: "*:USER_ID",
1245
- description: c._({ id: "/xnbdQ" })
1246
- })
1247
- ]
1248
- }),
1249
- /*#__PURE__*/ I("p", {
1250
- className: "text-theme-light mt-4 text-xs",
1251
- children: /*#__PURE__*/ I(U, {
1252
- id: "rrjuul",
1253
- components: { 0: /*#__PURE__*/ I("a", {
1254
- href: "https://docs.openstack.org/swift/latest/overview_acl.html",
1255
- target: "_blank",
1256
- rel: "noopener noreferrer",
1257
- className: "text-theme-link underline"
1258
- }) }
1259
- })
1260
- })
1261
- ]
1262
- })]
1263
- }) }),
1264
- !T && !O && /*#__PURE__*/ I("p", {
1265
- className: "text-theme-light mt-4 text-xs",
1266
- children: /*#__PURE__*/ I(U, { id: "j9lCXl" })
1267
- })
1268
- ]
1269
- })]
1270
- });
1271
- };
1272
- function X({ code: e, description: t }) {
1273
- return /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I(A, {
1274
- variant: "info",
1275
- className: "mb-1 text-xs",
1276
- children: e
1277
- }), /*#__PURE__*/ I("p", {
1278
- className: "text-theme-light text-xs leading-relaxed",
1279
- children: t
1280
- })] });
1281
- }
1282
- function Z({ label: n }) {
1283
- return /*#__PURE__*/ L("div", {
1284
- className: "mb-1 flex items-center gap-1",
1285
- children: [/*#__PURE__*/ I("label", {
1286
- className: "text-theme-default text-sm font-semibold",
1287
- children: n
1288
- }), /*#__PURE__*/ L(m, {
1289
- triggerEvent: "hover",
1290
- children: [/*#__PURE__*/ I(e, { children: /*#__PURE__*/ I(v, {
1291
- icon: "info",
1292
- size: "14",
1293
- className: "text-theme-light cursor-help"
1294
- }) }), /*#__PURE__*/ I(t, {
1295
- className: "z-10 max-w-[350px]",
1296
- children: /*#__PURE__*/ I(U, { id: "AdtLNV" })
1297
- })]
1298
- })]
1299
- });
1300
- }
1301
- //#endregion
1302
- //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerTableView.tsx
1303
- var ye = ({ containers: e, createModalOpen: t, setCreateModalOpen: n, maxContainerNameLength: r, onCreateSuccess: i, onCreateError: a, onEmptySuccess: o, onEmptyError: s, onDeleteSuccess: c, onDeleteError: f, onPropertiesSuccess: p, onPropertiesError: m, onAclSuccess: h, onAclError: _, selectedContainers: v, setSelectedContainers: b, hasAnyBulkAction: x = !0 }) => {
1304
- let { projectId: S, provider: C, storageType: w } = oe({ from: "/_auth/projects/$projectId/storage/$provider/$storageType/" }), { i18n: E, _: D } = se(), A = H(), [j, M] = V(0), [N, ee] = V(null), [F, ne] = V(null), [R, z] = V(null), [ie, ae] = V(null), { ref: ce, elementRef: W, height: de, virtualItems: fe, totalSize: pe, measureElement: K } = P({ count: e.length });
1305
- B(() => {
1306
- if (W.current) {
1307
- let e = W.current.offsetWidth - W.current.clientWidth;
1308
- M(e);
1309
- }
1310
- }, [e.length, de]);
1311
- let q = (e) => {
1312
- try {
1313
- return new Date(e).toLocaleString();
1314
- } catch {
1315
- return E._({ id: "fj5byd" });
1316
- }
1317
- }, he = (e) => {
1318
- v.includes(e) ? b(v.filter((t) => t !== e)) : b([...v, e]);
1319
- };
1320
- if (!e || e.length === 0) return /*#__PURE__*/ L(re, { children: [/*#__PURE__*/ I(T, {
1321
- columns: 4,
1322
- className: "containers",
1323
- "data-testid": "no-containers",
1324
- children: /*#__PURE__*/ I(d, { children: /*#__PURE__*/ I(O, {
1325
- colSpan: 4,
1326
- children: /*#__PURE__*/ L("div", {
1327
- className: "py-8 text-center",
1328
- children: [/*#__PURE__*/ I("h3", {
1329
- className: "text-lg font-semibold",
1330
- children: /*#__PURE__*/ I(U, { id: "Hiw1Ha" })
1331
- }), /*#__PURE__*/ I("p", {
1332
- className: "text-theme-light mt-2",
1333
- children: /*#__PURE__*/ I(U, { id: "x1bK0h" })
1334
- })]
1335
- })
1336
- }) })
1337
- }), /*#__PURE__*/ I(G, {
1338
- isOpen: t,
1339
- onClose: () => n(!1),
1340
- onSuccess: i,
1341
- onError: a,
1342
- maxContainerNameLength: r
1343
- })] });
1344
- let ge = x ? 6 : 5, J = x ? "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px" : "minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
1345
- return /*#__PURE__*/ L(re, { children: [
1346
- /*#__PURE__*/ L("div", {
1347
- className: "relative",
1348
- children: [/*#__PURE__*/ I("div", {
1349
- style: { paddingRight: `${j}px` },
1350
- children: /*#__PURE__*/ I(T, {
1351
- columns: ge,
1352
- gridColumnTemplate: J,
1353
- className: "containers",
1354
- "data-testid": "containers-table-header",
1355
- children: /*#__PURE__*/ L(d, { children: [
1356
- x && /*#__PURE__*/ I(u, {}),
1357
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "t0X9+8" }) }),
1358
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "sxbP3b" }) }),
1359
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "sjMCOP" }) }),
1360
- /*#__PURE__*/ I(u, { children: /*#__PURE__*/ I(U, { id: "hgpMHD" }) }),
1361
- /*#__PURE__*/ I(u, { style: { marginRight: `-${j}px` } })
1362
- ] })
1363
- })
1364
- }), /*#__PURE__*/ I("div", {
1365
- ref: ce,
1366
- className: "overflow-auto",
1367
- style: { height: `${de ?? 0}px` },
1368
- "data-testid": "containers-table-body",
1369
- children: /*#__PURE__*/ I("div", {
1370
- style: {
1371
- height: `${pe}px`,
1372
- width: "100%",
1373
- position: "relative"
1374
- },
1375
- children: fe.map((t) => {
1376
- let n = e[t.index], r = v.includes(n.name), i = () => A({
1377
- to: "/projects/$projectId/storage/$provider/$storageType/$containerName/objects",
1378
- params: {
1379
- projectId: S,
1380
- provider: C,
1381
- storageType: w,
1382
- containerName: n.name
1383
- }
1384
- });
1385
- return /*#__PURE__*/ L("div", {
1386
- "data-index": t.index,
1387
- ref: K,
1388
- className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
1389
- style: {
1390
- position: "absolute",
1391
- top: 0,
1392
- left: 0,
1393
- width: "100%",
1394
- transform: `translateY(${t.start}px)`,
1395
- display: "grid",
1396
- gridTemplateColumns: J,
1397
- alignItems: "stretch"
1398
- },
1399
- "data-testid": `container-row-${n.name}`,
1400
- role: "link",
1401
- tabIndex: 0,
1402
- onClick: i,
1403
- onKeyDown: (e) => {
1404
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
1405
- },
1406
- children: [
1407
- x && /*#__PURE__*/ I(O, {
1408
- onClick: (e) => e.stopPropagation(),
1409
- onKeyDown: (e) => {
1410
- (e.key === "Enter" || e.key === " ") && e.stopPropagation();
1411
- },
1412
- children: /*#__PURE__*/ I(g, {
1413
- checked: r,
1414
- onChange: () => he(n.name),
1415
- "data-testid": `select-container-${n.name}`
1416
- })
1417
- }),
1418
- /*#__PURE__*/ I(O, {
1419
- className: "min-w-0 overflow-hidden",
1420
- children: /*#__PURE__*/ I("span", {
1421
- className: "block truncate",
1422
- title: n.name,
1423
- children: n.name
1424
- })
1425
- }),
1426
- /*#__PURE__*/ I(O, { children: n.count.toLocaleString() }),
1427
- /*#__PURE__*/ I(O, { children: n.last_modified ? q(n.last_modified) : E._({ id: "fj5byd" }) }),
1428
- /*#__PURE__*/ I(O, { children: te(n.bytes) }),
1429
- /*#__PURE__*/ I(O, {
1430
- onClick: (e) => e.stopPropagation(),
1431
- children: /*#__PURE__*/ I(l, { children: /*#__PURE__*/ L(y, { children: [
1432
- /*#__PURE__*/ I(k, {
1433
- label: E._({ id: "cWbW6w" }),
1434
- onClick: () => ae(n),
1435
- "data-testid": `access-control-action-${n.name}`
1436
- }),
1437
- /*#__PURE__*/ I(k, {
1438
- label: E._({ id: "Oc8Aqv" }),
1439
- onClick: () => z(n),
1440
- "data-testid": `properties-action-${n.name}`
1441
- }),
1442
- /*#__PURE__*/ I(k, {
1443
- label: E._({ id: "N2S1rs" }),
1444
- onClick: () => ee(n),
1445
- "data-testid": `empty-action-${n.name}`
1446
- }),
1447
- /*#__PURE__*/ I(k, {
1448
- label: E._({ id: "cnGeoo" }),
1449
- onClick: () => ne(n),
1450
- "data-testid": `delete-action-${n.name}`
1451
- })
1452
- ] }) })
1453
- })
1454
- ]
1455
- }, n.name);
1456
- })
1457
- })
1458
- })]
1459
- }),
1460
- /*#__PURE__*/ I(G, {
1461
- isOpen: t,
1462
- onClose: () => n(!1),
1463
- onSuccess: i,
1464
- onError: a,
1465
- maxContainerNameLength: r
1466
- }),
1467
- /*#__PURE__*/ I(le, {
1468
- isOpen: N !== null,
1469
- container: N,
1470
- onClose: () => ee(null),
1471
- onSuccess: o,
1472
- onError: s
1473
- }),
1474
- /*#__PURE__*/ I(ue, {
1475
- isOpen: F !== null,
1476
- container: F,
1477
- onClose: () => ne(null),
1478
- onSuccess: c,
1479
- onError: f
1480
- }),
1481
- /*#__PURE__*/ I(me, {
1482
- isOpen: R !== null,
1483
- container: R,
1484
- onClose: () => z(null),
1485
- onSuccess: p,
1486
- onError: m
1487
- }),
1488
- /*#__PURE__*/ I(ve, {
1489
- isOpen: ie !== null,
1490
- container: ie,
1491
- onClose: () => ae(null),
1492
- onSuccess: h,
1493
- onError: _
1494
- })
1495
- ] });
1496
- }, be = (e) => ({
1497
- message: /*#__PURE__*/ I(U, { id: "6w+VnM" }),
1498
- description: /*#__PURE__*/ I(U, {
1499
- id: "XwxJJB",
1500
- values: { containerName: e }
1501
- })
1502
- }), xe = (e, t) => ({
1503
- message: /*#__PURE__*/ I(U, { id: "Vj8XFg" }),
1504
- description: /*#__PURE__*/ I(U, {
1505
- id: "Vz+7ZA",
1506
- values: {
1507
- containerName: e,
1508
- errorMessage: t
1509
- }
1510
- })
1511
- }), Se = (e, t) => ({
1512
- message: /*#__PURE__*/ I(U, { id: "6OopEX" }),
1513
- description: t === 0 ? /*#__PURE__*/ I(U, {
1514
- id: "nkpZyk",
1515
- values: { containerName: e }
1516
- }) : t === 1 ? /*#__PURE__*/ I(U, {
1517
- id: "TZJiVf",
1518
- values: {
1519
- containerName: e,
1520
- deletedCount: t
1521
- }
1522
- }) : /*#__PURE__*/ I(U, {
1523
- id: "Sb/VT5",
1524
- values: {
1525
- containerName: e,
1526
- deletedCount: t
1527
- }
1528
- })
1529
- }), Ce = (e, t) => ({
1530
- message: /*#__PURE__*/ I(U, { id: "S8/j2h" }),
1531
- description: /*#__PURE__*/ I(U, {
1532
- id: "1rLu3+",
1533
- values: {
1534
- containerName: e,
1535
- errorMessage: t
1536
- }
1537
- })
1538
- }), we = (e) => ({
1539
- message: /*#__PURE__*/ I(U, { id: "odVI9Y" }),
1540
- description: /*#__PURE__*/ I(U, {
1541
- id: "V1TzeS",
1542
- values: { containerName: e }
1543
- })
1544
- }), Te = (e, t) => ({
1545
- message: /*#__PURE__*/ I(U, { id: "BJt+PJ" }),
1546
- description: /*#__PURE__*/ I(U, {
1547
- id: "RGrgxg",
1548
- values: {
1549
- containerName: e,
1550
- errorMessage: t
1551
- }
1552
- })
1553
- }), Ee = (e) => ({
1554
- message: /*#__PURE__*/ I(U, { id: "a7C4YS" }),
1555
- description: /*#__PURE__*/ I(U, {
1556
- id: "/NeNjH",
1557
- values: { containerName: e }
1558
- })
1559
- }), De = (e, t) => ({
1560
- message: /*#__PURE__*/ I(U, { id: "5MF8U2" }),
1561
- description: /*#__PURE__*/ I(U, {
1562
- id: "uLtFAr",
1563
- values: {
1564
- containerName: e,
1565
- errorMessage: t
1566
- }
1567
- })
1568
- }), Oe = (e) => ({
1569
- message: /*#__PURE__*/ I(U, { id: "olfSYj" }),
1570
- description: /*#__PURE__*/ I(U, {
1571
- id: "tM5SEI",
1572
- values: { containerName: e }
1573
- })
1574
- }), ke = (e, t) => ({
1575
- message: /*#__PURE__*/ I(U, { id: "p7DzCB" }),
1576
- description: /*#__PURE__*/ I(U, {
1577
- id: "DcMIiu",
1578
- values: {
1579
- containerName: e,
1580
- errorMessage: t
1581
- }
1582
- })
1583
- }), Ae = (e, t, n) => {
1584
- let r = n.length > 0, i = e > 0, a = r && i;
1585
- return {
1586
- severity: a ? "warning" : r ? "error" : "success",
1587
- message: a ? /*#__PURE__*/ I(U, { id: "q44uUq" }) : r ? /*#__PURE__*/ I(U, { id: "wFaT8w" }) : /*#__PURE__*/ I(U, { id: "0WsqO0" }),
1588
- description: /*#__PURE__*/ L(p, {
1589
- direction: "vertical",
1590
- gap: "1",
1591
- children: [i && /*#__PURE__*/ I("span", { children: /*#__PURE__*/ I(U, {
1592
- id: "1NS3nd",
1593
- values: {
1594
- emptiedCount: e,
1595
- totalDeleted: t
1596
- }
1597
- }) }), r && /*#__PURE__*/ I("span", {
1598
- className: "whitespace-pre-line",
1599
- children: (() => {
1600
- let e = n.join("\n");
1601
- return /*#__PURE__*/ I(U, {
1602
- id: "JrmKyf",
1603
- values: { errorDetails: e }
1604
- });
1605
- })()
1606
- })]
1607
- })
1608
- };
1609
- }, Q = ({ label: e, value: t }) => t == null ? null : /*#__PURE__*/ L("span", {
1610
- className: "flex items-start gap-1.5",
1611
- children: [/*#__PURE__*/ I(v, {
1612
- icon: "check",
1613
- size: "16px",
1614
- className: "text-theme-success mt-0.5 shrink-0"
1615
- }), /*#__PURE__*/ L("span", { children: [
1616
- /*#__PURE__*/ L("span", {
1617
- className: "font-medium",
1618
- children: [e, ":"]
1619
- }),
1620
- " ",
1621
- t
1622
- ] })]
1623
- }), je = ({ label: e }) => /*#__PURE__*/ L("span", {
1624
- className: "flex items-start gap-1.5",
1625
- children: [/*#__PURE__*/ I(v, {
1626
- icon: "check",
1627
- size: "16px",
1628
- className: "text-theme-success mt-0.5 shrink-0"
1629
- }), /*#__PURE__*/ I("span", { children: e })]
1630
- }), Me = ({ title: e, children: t }) => /*#__PURE__*/ L("span", {
1631
- className: "flex flex-col gap-1.5",
1632
- children: [/*#__PURE__*/ I("span", {
1633
- className: "text-theme-default block font-semibold",
1634
- children: e
1635
- }), t]
1636
- }), Ne = ({ serviceInfo: n, accountInfo: r, open: i }) => {
1637
- let { i18n: a, _: o } = se(), s = n?.swift, c = {
1638
- account_quotas: a._({ id: "DJT9tB" }),
1639
- container_quotas: a._({ id: "USiuNX" }),
1640
- bulk_delete: a._({ id: "F6YIQe" }),
1641
- bulk_upload: a._({ id: "2Inn83" }),
1642
- slo: a._({ id: "cpw++p" }),
1643
- container_sync: a._({ id: "ezT9KW" }),
1644
- tempurl: a._({ id: "UO3hJ2" }),
1645
- symlink: a._({ id: "Q2xmVl" }),
1646
- versioned_writes: a._({ id: "8jLXs3" })
1647
- }, l = Object.entries(c).filter(([e]) => s?.[e]).map(([, e]) => e);
1648
- return /*#__PURE__*/ L(m, {
1649
- triggerEvent: "hover",
1650
- placement: "bottom-end",
1651
- open: i,
1652
- children: [/*#__PURE__*/ I(e, { children: /*#__PURE__*/ I("span", { children: /*#__PURE__*/ I(v, {
1653
- icon: "info",
1654
- size: "20px",
1655
- className: "text-theme-light hover:text-theme-default cursor-pointer"
1656
- }) }) }), /*#__PURE__*/ I(t, {
1657
- className: "z-10 w-72 text-sm",
1658
- children: /*#__PURE__*/ L("span", {
1659
- className: "flex flex-col gap-3 p-1",
1660
- children: [
1661
- r && /*#__PURE__*/ L(Me, {
1662
- title: /*#__PURE__*/ I(U, { id: "AeXO77" }),
1663
- children: [
1664
- /*#__PURE__*/ I(Q, {
1665
- label: a._({ id: "ClGcRq" }),
1666
- value: r.containerCount.toLocaleString()
1667
- }),
1668
- /*#__PURE__*/ I(Q, {
1669
- label: a._({ id: "B3toQF" }),
1670
- value: r.objectCount.toLocaleString()
1671
- }),
1672
- /*#__PURE__*/ I(Q, {
1673
- label: a._({ id: "aL1w5Z" }),
1674
- value: te(r.bytesUsed)
1675
- }),
1676
- r.quotaBytes !== void 0 && /*#__PURE__*/ I(Q, {
1677
- label: a._({ id: "vEkTR9" }),
1678
- value: te(r.quotaBytes)
1679
- })
1680
- ]
1681
- }),
1682
- s && /*#__PURE__*/ L(Me, {
1683
- title: /*#__PURE__*/ I(U, { id: "6BDqha" }),
1684
- children: [
1685
- /*#__PURE__*/ I(Q, {
1686
- label: a._({ id: "wTg+FY" }),
1687
- value: s.max_file_size === void 0 ? void 0 : te(s.max_file_size)
1688
- }),
1689
- /*#__PURE__*/ I(Q, {
1690
- label: a._({ id: "Rih53k" }),
1691
- value: s.max_container_name_length
1692
- }),
1693
- /*#__PURE__*/ I(Q, {
1694
- label: a._({ id: "qAkkjP" }),
1695
- value: s.max_object_name_length
1696
- }),
1697
- /*#__PURE__*/ I(Q, {
1698
- label: a._({ id: "OZImTR" }),
1699
- value: s.container_listing_limit?.toLocaleString()
1700
- }),
1701
- /*#__PURE__*/ I(Q, {
1702
- label: a._({ id: "a4A2uB" }),
1703
- value: s.account_listing_limit?.toLocaleString()
1704
- }),
1705
- /*#__PURE__*/ I(Q, {
1706
- label: a._({ id: "zWb/Nn" }),
1707
- value: s.max_header_size
1708
- }),
1709
- /*#__PURE__*/ I(Q, {
1710
- label: a._({ id: "RGwfoL" }),
1711
- value: s.max_meta_count
1712
- }),
1713
- /*#__PURE__*/ I(Q, {
1714
- label: a._({ id: "8c3/77" }),
1715
- value: s.max_meta_name_length
1716
- }),
1717
- /*#__PURE__*/ I(Q, {
1718
- label: a._({ id: "5JDSvn" }),
1719
- value: s.max_meta_value_length
1720
- }),
1721
- /*#__PURE__*/ I(Q, {
1722
- label: a._({ id: "ZAx+d1" }),
1723
- value: s.max_meta_overall_size
1724
- }),
1725
- s.bulk_delete && /*#__PURE__*/ I(Q, {
1726
- label: a._({ id: "lQ3EIe" }),
1727
- value: s.bulk_delete.max_deletes_per_request.toLocaleString()
1728
- }),
1729
- s.bulk_upload && /*#__PURE__*/ I(Q, {
1730
- label: a._({ id: "STc+7E" }),
1731
- value: s.bulk_upload.max_containers_per_extraction.toLocaleString()
1732
- }),
1733
- s.slo && /*#__PURE__*/ I(Q, {
1734
- label: a._({ id: "RNBvdl" }),
1735
- value: s.slo.max_manifest_segments.toLocaleString()
1736
- })
1737
- ]
1738
- }),
1739
- l.length > 0 && /*#__PURE__*/ I(Me, {
1740
- title: /*#__PURE__*/ I(U, { id: "Qx7DM7" }),
1741
- children: l.map((e) => /*#__PURE__*/ I(je, { label: e }, e))
1742
- })
1743
- ]
1744
- })
1745
- })]
1746
- });
1747
- }, Pe = 20, Fe = "empty", Ie = ({ isOpen: e, containers: t, onClose: n, onComplete: a }) => {
1748
- let { i18n: s, i18n: c, _: l } = se(), u = ee(), [d, m] = V(null), [h, g] = V(""), _ = h.trim() === Fe, v = j.useUtils(), y = j.storage.swift.emptyContainer.useMutation(), b = () => {
1749
- y.reset(), m(null), g(""), n();
1750
- }, x = async () => {
1751
- let e = 0, n = 0, r = [], i = t.length;
1752
- for (let a = 0; a < t.length; a++) {
1753
- m({
1754
- current: a + 1,
1755
- total: i
1756
- });
1757
- let o = t[a];
1758
- try {
1759
- let t = await y.mutateAsync({
1760
- project_id: u,
1761
- container: o.name
1762
- });
1763
- n += t, e++;
1764
- } catch (e) {
1765
- let t = e instanceof Error ? e.message : String(e);
1766
- r.push(`${o.name}: ${t}`);
1767
- }
1768
- }
1769
- e > 0 && await v.storage.swift.listContainers.invalidate(), a?.({
1770
- emptiedCount: e,
1771
- totalDeleted: n,
1772
- errors: r
1773
- }), b();
1774
- };
1775
- if (!e || t.length === 0) return null;
1776
- let S = t.length, T = t.slice(0, Pe), D = S - T.length, O = y.isPending || d !== null, k = d?.current, A = d?.total;
1777
- return /*#__PURE__*/ I(o, {
1778
- title: /*#__PURE__*/ I(U, {
1779
- id: "0efWir",
1780
- values: { totalCount: S }
1781
- }),
1782
- open: e,
1783
- onCancel: b,
1784
- confirmButtonLabel: O ? s._({ id: "s4Vnq2" }) : s._({ id: "N2S1rs" }),
1785
- confirmButtonVariant: "primary-danger",
1786
- cancelButtonLabel: s._({ id: "dEgA5A" }),
1787
- onConfirm: x,
1788
- disableConfirmButton: O || !_,
1789
- disableCancelButton: O,
1790
- disableCloseButton: O,
1791
- size: "small",
1792
- children: O ? /*#__PURE__*/ L(p, {
1793
- direction: "vertical",
1794
- distribution: "center",
1795
- alignment: "center",
1796
- gap: "2",
1797
- className: "py-4",
1798
- children: [/*#__PURE__*/ I(f, { variant: "primary" }), d && /*#__PURE__*/ I("p", {
1799
- className: "text-theme-light text-sm",
1800
- children: /*#__PURE__*/ I(U, {
1801
- id: "7NSdfG",
1802
- values: {
1803
- progressCurrent: k,
1804
- progressTotal: A
1805
- }
1806
- })
1807
- })]
1808
- }) : /*#__PURE__*/ L("div", {
1809
- className: "my-6",
1810
- children: [
1811
- /*#__PURE__*/ I(i, {
1812
- variant: "danger",
1813
- className: "mb-6",
1814
- children: /*#__PURE__*/ I(U, { id: "JuOpPY" })
1815
- }),
1816
- /*#__PURE__*/ I("p", {
1817
- className: "text-theme-default mb-6 text-sm",
1818
- children: /*#__PURE__*/ I(U, {
1819
- id: "XXjbEV",
1820
- components: {
1821
- 0: /*#__PURE__*/ I("strong", {}),
1822
- 1: /*#__PURE__*/ I("strong", {})
1823
- }
1824
- })
1825
- }),
1826
- /*#__PURE__*/ L("div", {
1827
- className: "mb-6",
1828
- children: [/*#__PURE__*/ I("h3", {
1829
- className: "jn:text-theme-high mb-3 font-semibold",
1830
- children: /*#__PURE__*/ I(U, {
1831
- id: "VKmlZ+",
1832
- values: { totalCount: S }
1833
- })
1834
- }), /*#__PURE__*/ L("div", {
1835
- className: "jn:bg-theme-background-lvl-1 max-h-48 overflow-y-auto rounded p-4",
1836
- children: [/*#__PURE__*/ I(E, {
1837
- className: "grid-cols-2",
1838
- alignTerms: "left",
1839
- children: T.map((e) => {
1840
- let t = e.count;
1841
- return /*#__PURE__*/ L(R, { children: [/*#__PURE__*/ I(w, {
1842
- className: "col-span-1",
1843
- children: /*#__PURE__*/ I("span", {
1844
- className: "block truncate",
1845
- title: e.name,
1846
- children: e.name
1847
- })
1848
- }), /*#__PURE__*/ I(r, {
1849
- className: "col-span-1",
1850
- children: /*#__PURE__*/ I("span", {
1851
- className: "whitespace-nowrap",
1852
- children: t == null ? "" : c._(s._({
1853
- id: "7Ocn0b",
1854
- values: { count: t }
1855
- }))
1856
- })
1857
- })] }, e.name);
1858
- })
1859
- }), D > 0 && /*#__PURE__*/ I("p", {
1860
- className: "text-theme-light mt-2 text-xs",
1861
- children: /*#__PURE__*/ I(U, {
1862
- id: "yqPflB",
1863
- values: { hiddenCount: D }
1864
- })
1865
- })]
1866
- })]
1867
- }),
1868
- /*#__PURE__*/ I(C, {
1869
- label: s._({ id: "Ghp863" }),
1870
- placeholder: Fe,
1871
- value: h,
1872
- onChange: (e) => g(e.target.value)
1873
- })
1874
- ]
1875
- })
1876
- });
1877
- }, Le = () => {
1878
- let { i18n: e, i18n: t, _: r } = se(), i = ee(), a = H({ from: M.fullPath }), { sortBy: o, sortDirection: s, search: c = "" } = M.useSearch(), [u, d] = V(!1), [m, v] = V(!1), [x, C] = V([]), [w, T] = V(c), E = ae(void 0);
1879
- B(() => () => clearTimeout(E.current), []), B(() => {
1880
- T(c);
1881
- }, [c]);
1882
- let D = (e) => {
1883
- let { message: t, ...n } = be(e);
1884
- b.success(t, n);
1885
- }, O = (e, t) => {
1886
- let { message: n, ...r } = xe(e, t);
1887
- b.error(n, r);
1888
- }, A = (e, t) => {
1889
- let { message: n, ...r } = Se(e, t);
1890
- b.success(n, r);
1891
- }, N = (e, t) => {
1892
- let { message: n, ...r } = Ce(e, t);
1893
- b.error(n, r);
1894
- }, P = (e) => {
1895
- let { message: t, ...n } = we(e);
1896
- b.success(t, n);
1897
- }, ne = (e, t) => {
1898
- let { message: n, ...r } = Te(e, t);
1899
- b.error(n, r);
1900
- }, R = (e) => {
1901
- let { message: t, ...n } = Ee(e);
1902
- b.success(t, n);
1903
- }, ie = (e, t) => {
1904
- let { message: n, ...r } = De(e, t);
1905
- b.error(n, r);
1906
- }, oe = (e) => {
1907
- let { message: t, ...n } = Oe(e);
1908
- b.success(t, n);
1909
- }, ce = (e, t) => {
1910
- let { message: n, ...r } = ke(e, t);
1911
- b.error(n, r);
1912
- }, W = ({ emptiedCount: e, totalDeleted: t, errors: n }) => {
1913
- if (n.length === 0) C([]);
1914
- else {
1915
- let e = new Set(n.map((e) => e.split(": ")[0]));
1916
- C((t) => t.filter((t) => e.has(t)));
1917
- }
1918
- let { message: r, severity: i, ...a } = Ae(e, t, n);
1919
- b[i](r, a);
1920
- }, G = {
1921
- options: [
1922
- {
1923
- label: e._({ id: "6YtxFj" }),
1924
- value: "name"
1925
- },
1926
- {
1927
- label: e._({ id: "sxbP3b" }),
1928
- value: "count"
1929
- },
1930
- {
1931
- label: e._({ id: "hgpMHD" }),
1932
- value: "bytes"
1933
- },
1934
- {
1935
- label: e._({ id: "sjMCOP" }),
1936
- value: "last_modified"
1937
- }
1938
- ],
1939
- sortBy: o ?? "name",
1940
- sortDirection: s ?? "asc"
1941
- }, { data: le, isLoading: ue, error: de } = j.storage.swift.listContainers.useQuery({
1942
- project_id: i,
1943
- format: "json"
1944
- }), { data: fe } = j.storage.swift.getAccountMetadata.useQuery({ project_id: i }), { data: pe } = j.storage.swift.getServiceInfo.useQuery(), me = (e) => [...e].sort((e, t) => {
1945
- let n;
1946
- switch (o ?? "name") {
1947
- case "name":
1948
- n = e.name.localeCompare(t.name);
1949
- break;
1950
- case "count":
1951
- n = e.count - t.count;
1952
- break;
1953
- case "bytes":
1954
- n = e.bytes - t.bytes;
1955
- break;
1956
- case "last_modified":
1957
- if (!e.last_modified || !t.last_modified) return e.last_modified ? -1 : 1;
1958
- n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
1959
- break;
1960
- default: n = e.name.localeCompare(t.name);
1961
- }
1962
- return (s ?? "asc") === "desc" ? -n : n;
1963
- }), K = (le || []).filter((e) => e.name.toLowerCase().includes(c.toLowerCase())), q = me(K), he = (e) => {
1964
- let t = typeof e == "string" ? e : "";
1965
- z(() => {
1966
- a({ search: (e) => ({
1967
- ...e,
1968
- search: t || void 0
1969
- }) });
1970
- });
1971
- }, ge = (e) => {
1972
- let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
1973
- z(() => {
1974
- a({ search: (e) => ({
1975
- ...e,
1976
- sortBy: t,
1977
- sortDirection: n
1978
- }) });
1979
- });
1980
- };
1981
- if (ue) return /*#__PURE__*/ L(p, {
1982
- className: "absolute inset-0",
1983
- distribution: "center",
1984
- alignment: "center",
1985
- direction: "vertical",
1986
- children: [/*#__PURE__*/ I(f, {
1987
- variant: "primary",
1988
- size: "large",
1989
- className: "mb-2"
1990
- }), /*#__PURE__*/ I(U, { id: "WYiUDa" })]
1991
- });
1992
- if (de) {
1993
- let e = de.message;
1994
- return /*#__PURE__*/ I(p, {
1995
- className: "absolute inset-0",
1996
- distribution: "center",
1997
- alignment: "center",
1998
- direction: "vertical",
1999
- children: /*#__PURE__*/ I(U, {
2000
- id: "dLFiER",
2001
- values: { errorMessage: e }
2002
- })
2003
- });
2004
- }
2005
- let J = fe?.bytesUsed || 0, _e = fe?.quotaBytes || 0, Y = _e > 0 ? _e - J : 0, ve = (le || []).filter((e) => x.includes(e.name)), X = ve.length > 0, Z = ve.length, Q = (le || []).length, je = K.length, Me = je !== Q, Pe = q.map((e) => e.name), Fe = Pe.length > 0 && Pe.every((e) => x.includes(e)), Le = Pe.some((e) => x.includes(e));
2006
- return /*#__PURE__*/ L("div", {
2007
- className: "relative",
2008
- children: [
2009
- /*#__PURE__*/ L(p, {
2010
- direction: "vertical",
2011
- children: [
2012
- /*#__PURE__*/ L(p, {
2013
- distribution: "end",
2014
- alignment: "center",
2015
- gap: "2",
2016
- className: "pb-2",
2017
- children: [/*#__PURE__*/ I(p, {
2018
- gap: "0.5",
2019
- alignment: "center",
2020
- children: /*#__PURE__*/ I(F, {
2021
- options: G.options,
2022
- sortBy: G.sortBy,
2023
- sortDirection: G.sortDirection ?? "asc",
2024
- selectClassName: "min-w-40",
2025
- onSortByChange: (e) => ge({
2026
- ...G,
2027
- sortBy: e,
2028
- sortDirection: G.sortDirection
2029
- }),
2030
- onSortDirectionChange: (e) => ge({
2031
- ...G,
2032
- sortDirection: e
2033
- })
2034
- })
2035
- }), /*#__PURE__*/ I(h, {
2036
- variant: "primary",
2037
- className: "whitespace-nowrap",
2038
- onClick: () => d(!0),
2039
- children: /*#__PURE__*/ I(U, { id: "vTh35P" })
2040
- })]
2041
- }),
2042
- /*#__PURE__*/ I(S, { children: /*#__PURE__*/ I(p, {
2043
- direction: "vertical",
2044
- gap: "2",
2045
- children: /*#__PURE__*/ I(p, {
2046
- distribution: "end",
2047
- alignment: "center",
2048
- children: /*#__PURE__*/ I(n, {
2049
- placeholder: e._({ id: "TipzDp" }),
2050
- "data-testid": "searchbar",
2051
- value: w,
2052
- onInput: (e) => {
2053
- let t = e.currentTarget.value;
2054
- T(t), clearTimeout(E.current), E.current = window.setTimeout(() => he(t), 500);
2055
- },
2056
- onSearch: (e) => {
2057
- clearTimeout(E.current), he(typeof e == "string" ? e : "");
2058
- },
2059
- onClear: () => {
2060
- clearTimeout(E.current), T(""), he("");
2061
- }
2062
- })
2063
- })
2064
- }) }),
2065
- /*#__PURE__*/ I(S, { children: /*#__PURE__*/ L(p, {
2066
- distribution: "start",
2067
- gap: "2",
2068
- alignment: "center",
2069
- className: "text-sm",
2070
- children: [/*#__PURE__*/ L(p, {
2071
- gap: "2",
2072
- alignment: "center",
2073
- children: [/*#__PURE__*/ I(g, {
2074
- checked: Fe,
2075
- indeterminate: Le && !Fe,
2076
- onChange: () => {
2077
- C(Fe ? (e) => e.filter((e) => !Pe.includes(e)) : (e) => [.../* @__PURE__ */ new Set([...e, ...Pe])]);
2078
- }
2079
- }), /*#__PURE__*/ L(l, {
2080
- className: "flex items-center",
2081
- children: [/*#__PURE__*/ I(_, {
2082
- as: "div",
2083
- children: /*#__PURE__*/ I(h, {
2084
- disabled: !X,
2085
- size: "small",
2086
- icon: "moreVert",
2087
- label: e._({ id: "7L01XJ" })
2088
- })
2089
- }), X && /*#__PURE__*/ I(y, { children: /*#__PURE__*/ I(k, {
2090
- disabled: !X,
2091
- label: t._(e._({
2092
- id: "0Th0CH",
2093
- values: { selectedCount: Z }
2094
- })),
2095
- onClick: () => v(!0)
2096
- }) })]
2097
- })]
2098
- }), /*#__PURE__*/ L("div", {
2099
- className: "text-theme-light ml-auto flex items-center gap-1",
2100
- "data-testid": "containers-info-block",
2101
- children: [
2102
- Me ? /*#__PURE__*/ I(U, {
2103
- id: "8uPTwT",
2104
- values: {
2105
- filteredCount: je,
2106
- totalCount: Q
2107
- }
2108
- }) : /*#__PURE__*/ I(U, {
2109
- id: "ywe1H/",
2110
- values: { totalCount: Q }
2111
- }),
2112
- _e > 0 && /*#__PURE__*/ L(re, { children: [/*#__PURE__*/ I("span", { children: "," }), /*#__PURE__*/ L("span", { children: [
2113
- /*#__PURE__*/ I(U, { id: "kKK8AH" }),
2114
- " ",
2115
- /*#__PURE__*/ I("span", {
2116
- className: "text-theme-default font-semibold",
2117
- children: te(Y)
2118
- })
2119
- ] })] }),
2120
- /*#__PURE__*/ I(Ne, {
2121
- serviceInfo: pe,
2122
- accountInfo: fe
2123
- })
2124
- ]
2125
- })]
2126
- }) })
2127
- ]
2128
- }),
2129
- /*#__PURE__*/ I(ye, {
2130
- containers: q,
2131
- createModalOpen: u,
2132
- setCreateModalOpen: d,
2133
- maxContainerNameLength: pe?.swift?.max_container_name_length,
2134
- onCreateSuccess: D,
2135
- onCreateError: O,
2136
- onEmptySuccess: A,
2137
- onEmptyError: N,
2138
- onDeleteSuccess: P,
2139
- onDeleteError: ne,
2140
- onPropertiesSuccess: R,
2141
- onPropertiesError: ie,
2142
- onAclSuccess: oe,
2143
- onAclError: ce,
2144
- selectedContainers: x,
2145
- setSelectedContainers: C,
2146
- hasAnyBulkAction: !0
2147
- }),
2148
- /*#__PURE__*/ I(Ie, {
2149
- isOpen: m,
2150
- containers: ve,
2151
- onClose: () => v(!1),
2152
- onComplete: W
2153
- })
2154
- ]
2155
- });
2156
- };
2157
- //#endregion
2158
- //#region src/client/routes/_auth/projects/$projectId/storage/$provider/$storageType/index.tsx?tsr-split=component
2159
- function Re() {
2160
- let { project: e, provider: t } = oe({
2161
- from: "/_auth/projects/$projectId/storage/$provider/$storageType/",
2162
- select: (e) => ({
2163
- project: e.projectId,
2164
- provider: e.provider,
2165
- storageType: e.storageType
2166
- })
2167
- }), { i18n: n, _: r } = se(), i;
2168
- switch (t) {
2169
- case "swift":
2170
- i = n._({ id: "+OEi73" });
2171
- break;
2172
- case "ceph":
2173
- i = n._({ id: "KhNDX4" });
2174
- break;
2175
- default: i = n._({ id: "IWF68U" });
2176
- }
2177
- return /*#__PURE__*/ L("div", { children: [/*#__PURE__*/ I(ne, {
2178
- title: i,
2179
- projectId: e
2180
- }), e ? /*#__PURE__*/ I(ce, {
2181
- resetKeys: [e, t],
2182
- fallback: /*#__PURE__*/ I("div", {
2183
- className: "p-4 text-center",
2184
- children: /*#__PURE__*/ I(U, { id: "diFNkW" })
2185
- }),
2186
- children: (() => {
2187
- switch (t) {
2188
- case "swift": return /*#__PURE__*/ I(Le, {});
2189
- case "ceph": return /*#__PURE__*/ I(N, {});
2190
- default: return /*#__PURE__*/ I("div", { children: "Storage Overview Page" });
2191
- }
2192
- })()
2193
- }) : /*#__PURE__*/ I("div", {
2194
- className: "p-4 text-center",
2195
- children: /*#__PURE__*/ I(U, { id: "Z2fZGD" })
2196
- })] });
2197
- }
2198
- var ze = () => /*#__PURE__*/ I(Re, {});
2199
- //#endregion
2200
- export { ze as component };
2201
-
2202
- //# sourceMappingURL=_storageType-BmqrU06i.mjs.map