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