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