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