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