Refactor to swagger TS API (#2888)
Co-authored-by: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com> Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,9 @@ test-warnings:
|
||||
test-prettier:
|
||||
./check-prettier.sh
|
||||
|
||||
find-deadcode:
|
||||
./check-deadcode.sh
|
||||
|
||||
prettify:
|
||||
yarn prettier --write . --loglevel warn
|
||||
|
||||
|
||||
@@ -23,14 +23,11 @@ import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import get from "lodash/get";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import { BucketEvent, BucketEventList } from "../types";
|
||||
import {
|
||||
actionsTray,
|
||||
searchField,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
|
||||
import api from "../../../../common/api";
|
||||
|
||||
import PanelTitle from "../../Common/PanelTitle/PanelTitle";
|
||||
import {
|
||||
@@ -44,6 +41,9 @@ import { setErrorSnackMessage, setHelpName } from "../../../../systemSlice";
|
||||
import { selBucketDetailsLoading } from "./bucketDetailsSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import TooltipWrapper from "../../Common/TooltipWrapper/TooltipWrapper";
|
||||
import { api } from "api";
|
||||
import { NotificationConfig } from "api/consoleApi";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
const DeleteEvent = withSuspense(React.lazy(() => import("./DeleteEvent")));
|
||||
const AddEvent = withSuspense(React.lazy(() => import("./AddEvent")));
|
||||
@@ -69,9 +69,11 @@ const BucketEventsPanel = ({ classes }: IBucketEventsProps) => {
|
||||
|
||||
const [addEventScreenOpen, setAddEventScreenOpen] = useState<boolean>(false);
|
||||
const [loadingEvents, setLoadingEvents] = useState<boolean>(true);
|
||||
const [records, setRecords] = useState<BucketEvent[]>([]);
|
||||
const [records, setRecords] = useState<NotificationConfig[]>([]);
|
||||
const [deleteOpen, setDeleteOpen] = useState<boolean>(false);
|
||||
const [selectedEvent, setSelectedEvent] = useState<BucketEvent | null>(null);
|
||||
const [selectedEvent, setSelectedEvent] = useState<NotificationConfig | null>(
|
||||
null
|
||||
);
|
||||
|
||||
const bucketName = params.bucketName || "";
|
||||
|
||||
@@ -94,16 +96,16 @@ const BucketEventsPanel = ({ classes }: IBucketEventsProps) => {
|
||||
useEffect(() => {
|
||||
if (loadingEvents) {
|
||||
if (displayEvents) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/events`)
|
||||
.then((res: BucketEventList) => {
|
||||
const events = get(res, "events", []);
|
||||
api.buckets
|
||||
.listBucketEvents(bucketName)
|
||||
.then((res) => {
|
||||
const events = get(res.data, "events", []);
|
||||
setLoadingEvents(false);
|
||||
setRecords(events || []);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setLoadingEvents(false);
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
} else {
|
||||
setLoadingEvents(false);
|
||||
@@ -115,7 +117,7 @@ const BucketEventsPanel = ({ classes }: IBucketEventsProps) => {
|
||||
return <Fragment>{events.join(", ")}</Fragment>;
|
||||
};
|
||||
|
||||
const confirmDeleteEvent = (evnt: BucketEvent) => {
|
||||
const confirmDeleteEvent = (evnt: NotificationConfig) => {
|
||||
setDeleteOpen(true);
|
||||
setSelectedEvent(evnt);
|
||||
};
|
||||
|
||||
@@ -27,8 +27,6 @@ import {
|
||||
actionsTray,
|
||||
searchField,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import api from "../../../../common/api";
|
||||
import EditLifecycleConfiguration from "./EditLifecycleConfiguration";
|
||||
import AddLifecycleModal from "./AddLifecycleModal";
|
||||
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
|
||||
@@ -44,6 +42,8 @@ import { useParams } from "react-router-dom";
|
||||
import TooltipWrapper from "../../Common/TooltipWrapper/TooltipWrapper";
|
||||
import { setHelpName } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { api } from "api";
|
||||
import { ObjectBucketLifecycle } from "api/consoleApi";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
@@ -63,7 +63,9 @@ const BucketLifecyclePanel = ({ classes }: IBucketLifecyclePanelProps) => {
|
||||
const params = useParams();
|
||||
|
||||
const [loadingLifecycle, setLoadingLifecycle] = useState<boolean>(true);
|
||||
const [lifecycleRecords, setLifecycleRecords] = useState<LifeCycleItem[]>([]);
|
||||
const [lifecycleRecords, setLifecycleRecords] = useState<
|
||||
ObjectBucketLifecycle[]
|
||||
>([]);
|
||||
const [addLifecycleOpen, setAddLifecycleOpen] = useState<boolean>(false);
|
||||
const [editLifecycleOpen, setEditLifecycleOpen] = useState<boolean>(false);
|
||||
const [selectedLifecycleRule, setSelectedLifecycleRule] =
|
||||
@@ -94,16 +96,16 @@ const BucketLifecyclePanel = ({ classes }: IBucketLifecyclePanelProps) => {
|
||||
useEffect(() => {
|
||||
if (loadingLifecycle) {
|
||||
if (displayLifeCycleRules) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/lifecycle`)
|
||||
.then((res: any) => {
|
||||
const records = get(res, "lifecycle", []);
|
||||
api.buckets
|
||||
.getBucketLifecycle(bucketName)
|
||||
.then((res) => {
|
||||
const records = get(res.data, "lifecycle", []);
|
||||
|
||||
setLifecycleRecords(records || []);
|
||||
setLoadingLifecycle(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
console.error(err);
|
||||
.catch((err) => {
|
||||
console.error(err.error);
|
||||
setLifecycleRecords([]);
|
||||
setLoadingLifecycle(false);
|
||||
});
|
||||
|
||||
@@ -22,23 +22,10 @@ import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import { Box, Grid } from "@mui/material";
|
||||
import get from "lodash/get";
|
||||
import {
|
||||
BucketEncryptionInfo,
|
||||
BucketObjectLocking,
|
||||
BucketQuota,
|
||||
BucketReplication,
|
||||
BucketVersioningInfo,
|
||||
} from "../types";
|
||||
import { BucketList } from "../../Watch/types";
|
||||
import {
|
||||
spacingUtils,
|
||||
textStyleUtils,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import {
|
||||
ErrorResponseHandler,
|
||||
IRetentionConfig,
|
||||
} from "../../../../common/types";
|
||||
import api from "../../../../common/api";
|
||||
|
||||
import { IAM_SCOPES } from "../../../../common/SecureComponent/permissions";
|
||||
import {
|
||||
@@ -66,6 +53,14 @@ import {
|
||||
} from "./bucketDetailsSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import VersioningInfo from "../VersioningInfo";
|
||||
import { api } from "api";
|
||||
import {
|
||||
BucketEncryptionInfo,
|
||||
BucketQuota,
|
||||
BucketVersioningResponse,
|
||||
GetBucketRetentionConfig,
|
||||
} from "api/consoleApi";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
const SetAccessPolicy = withSuspense(
|
||||
React.lazy(() => import("./SetAccessPolicy"))
|
||||
@@ -113,8 +108,10 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
|
||||
const [encryptionCfg, setEncryptionCfg] =
|
||||
useState<BucketEncryptionInfo | null>(null);
|
||||
const [bucketSize, setBucketSize] = useState<string>("0");
|
||||
const [hasObjectLocking, setHasObjectLocking] = useState<boolean>(false);
|
||||
const [bucketSize, setBucketSize] = useState<number | "0">("0");
|
||||
const [hasObjectLocking, setHasObjectLocking] = useState<boolean | undefined>(
|
||||
false
|
||||
);
|
||||
const [accessPolicyScreenOpen, setAccessPolicyScreenOpen] =
|
||||
useState<boolean>(false);
|
||||
const [replicationRules, setReplicationRules] = useState<boolean>(false);
|
||||
@@ -126,13 +123,14 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
const [loadingQuota, setLoadingQuota] = useState<boolean>(true);
|
||||
const [loadingReplication, setLoadingReplication] = useState<boolean>(true);
|
||||
const [loadingRetention, setLoadingRetention] = useState<boolean>(true);
|
||||
const [versioningInfo, setVersioningInfo] = useState<BucketVersioningInfo>();
|
||||
const [versioningInfo, setVersioningInfo] =
|
||||
useState<BucketVersioningResponse>();
|
||||
const [quotaEnabled, setQuotaEnabled] = useState<boolean>(false);
|
||||
const [quota, setQuota] = useState<BucketQuota | null>(null);
|
||||
const [encryptionEnabled, setEncryptionEnabled] = useState<boolean>(false);
|
||||
const [retentionEnabled, setRetentionEnabled] = useState<boolean>(false);
|
||||
const [retentionConfig, setRetentionConfig] =
|
||||
useState<IRetentionConfig | null>(null);
|
||||
useState<GetBucketRetentionConfig | null>(null);
|
||||
const [retentionConfigOpen, setRetentionConfigOpen] =
|
||||
useState<boolean>(false);
|
||||
const [enableEncryptionScreenOpen, setEnableEncryptionScreenOpen] =
|
||||
@@ -182,16 +180,17 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
useEffect(() => {
|
||||
if (loadingEncryption) {
|
||||
if (displayGetBucketEncryptionConfiguration) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/encryption/info`)
|
||||
.then((res: BucketEncryptionInfo) => {
|
||||
if (res.algorithm) {
|
||||
api.buckets
|
||||
.getBucketEncryptionInfo(bucketName)
|
||||
.then((res) => {
|
||||
if (res.data.algorithm) {
|
||||
setEncryptionEnabled(true);
|
||||
setEncryptionCfg(res);
|
||||
setEncryptionCfg(res.data);
|
||||
}
|
||||
setLoadingEncryption(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
err = errorToHandler(err.error);
|
||||
if (
|
||||
err.errorMessage ===
|
||||
"The server side encryption configuration was not found"
|
||||
@@ -211,14 +210,14 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingVersioning && distributedSetup) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/versioning`)
|
||||
.then((res: BucketVersioningInfo) => {
|
||||
setVersioningInfo(res);
|
||||
api.buckets
|
||||
.getBucketVersioning(bucketName)
|
||||
.then((res) => {
|
||||
setVersioningInfo(res.data);
|
||||
setLoadingVersioning(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
setLoadingVersioning(false);
|
||||
});
|
||||
}
|
||||
@@ -227,19 +226,19 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
useEffect(() => {
|
||||
if (loadingQuota && distributedSetup) {
|
||||
if (displayGetBucketQuota) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/quota`)
|
||||
.then((res: BucketQuota) => {
|
||||
setQuota(res);
|
||||
if (res.quota) {
|
||||
api.buckets
|
||||
.getBucketQuota(bucketName)
|
||||
.then((res) => {
|
||||
setQuota(res.data);
|
||||
if (res.data.quota) {
|
||||
setQuotaEnabled(true);
|
||||
} else {
|
||||
setQuotaEnabled(false);
|
||||
}
|
||||
setLoadingQuota(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
setQuotaEnabled(false);
|
||||
setLoadingQuota(false);
|
||||
});
|
||||
@@ -260,14 +259,14 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
useEffect(() => {
|
||||
if (loadingVersioning && distributedSetup) {
|
||||
if (displayGetBucketObjectLockConfiguration) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/object-locking`)
|
||||
.then((res: BucketObjectLocking) => {
|
||||
setHasObjectLocking(res.object_locking_enabled);
|
||||
api.buckets
|
||||
.getBucketObjectLockingStatus(bucketName)
|
||||
.then((res) => {
|
||||
setHasObjectLocking(res.data.object_locking_enabled);
|
||||
setLoadingLocking(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
setLoadingLocking(false);
|
||||
});
|
||||
} else {
|
||||
@@ -285,10 +284,10 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingSize) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets`)
|
||||
.then((res: BucketList) => {
|
||||
const resBuckets = get(res, "buckets", []);
|
||||
api.buckets
|
||||
.listBuckets()
|
||||
.then((res) => {
|
||||
const resBuckets = get(res.data, "buckets", []);
|
||||
|
||||
const bucketInfo = resBuckets.find(
|
||||
(bucket) => bucket.name === bucketName
|
||||
@@ -299,24 +298,24 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
setLoadingSize(false);
|
||||
setBucketSize(size);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setLoadingSize(false);
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
}
|
||||
}, [loadingSize, dispatch, bucketName]);
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingReplication && distributedSetup) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/replication`)
|
||||
.then((res: BucketReplication) => {
|
||||
const r = res.rules ? res.rules : [];
|
||||
api.buckets
|
||||
.getBucketReplication(bucketName)
|
||||
.then((res) => {
|
||||
const r = res.data.rules ? res.data.rules : [];
|
||||
setReplicationRules(r.length > 0);
|
||||
setLoadingReplication(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
setLoadingReplication(false);
|
||||
});
|
||||
}
|
||||
@@ -324,14 +323,14 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingRetention && hasObjectLocking) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/retention`)
|
||||
.then((res: IRetentionConfig) => {
|
||||
api.buckets
|
||||
.getBucketRetentionConfig(bucketName)
|
||||
.then((res) => {
|
||||
setLoadingRetention(false);
|
||||
setRetentionEnabled(true);
|
||||
setRetentionConfig(res);
|
||||
setRetentionConfig(res.data);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setRetentionEnabled(false);
|
||||
setLoadingRetention(false);
|
||||
setRetentionConfig(null);
|
||||
@@ -558,7 +557,7 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
alignItems: "flex-start",
|
||||
}}
|
||||
>
|
||||
<ReportedUsage bucketSize={bucketSize} />
|
||||
<ReportedUsage bucketSize={`${bucketSize}`} />
|
||||
{quotaEnabled && quota ? (
|
||||
<BucketQuotaSize quota={quota} />
|
||||
) : null}
|
||||
@@ -683,7 +682,7 @@ const BucketSummary = ({ classes }: IBucketSummaryProps) => {
|
||||
{retentionConfig && retentionConfig.validity}{" "}
|
||||
{retentionConfig &&
|
||||
(retentionConfig.validity === 1
|
||||
? retentionConfig.unit.slice(0, -1)
|
||||
? retentionConfig.unit?.slice(0, -1)
|
||||
: retentionConfig.unit)}
|
||||
</label>
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ import { Theme } from "@mui/material/styles";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
|
||||
import { ConfirmDeleteIcon } from "mds";
|
||||
import ConfirmDialog from "../../Common/ModalWrapper/ConfirmDialog";
|
||||
import api from "../../../../common/api";
|
||||
|
||||
import { setErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { api } from "api";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
interface IDeleteLifecycleRule {
|
||||
deleteOpen: boolean;
|
||||
@@ -52,15 +52,15 @@ const DeleteBucketLifecycleRule = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (deletingRule) {
|
||||
api
|
||||
.invoke("DELETE", `/api/v1/buckets/${bucket}/lifecycle/${id}`)
|
||||
.then((res) => {
|
||||
api.buckets
|
||||
.deleteBucketLifecycleRule(bucket, id)
|
||||
.then(() => {
|
||||
setDeletingRule(false);
|
||||
onCloseAndRefresh(true);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setDeletingRule(false);
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
}
|
||||
}, [deletingRule, bucket, id, onCloseAndRefresh, dispatch]);
|
||||
|
||||
@@ -18,7 +18,6 @@ import React from "react";
|
||||
import get from "lodash/get";
|
||||
|
||||
import { DialogContentText } from "@mui/material";
|
||||
import { BucketEvent } from "../types";
|
||||
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import useApi from "../../Common/Hooks/useApi";
|
||||
@@ -26,12 +25,13 @@ import ConfirmDialog from "../../Common/ModalWrapper/ConfirmDialog";
|
||||
import { ConfirmDeleteIcon } from "mds";
|
||||
import { setErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { NotificationConfig } from "api/consoleApi";
|
||||
|
||||
interface IDeleteEventProps {
|
||||
closeDeleteModalAndRefresh: (refresh: boolean) => void;
|
||||
deleteOpen: boolean;
|
||||
selectedBucket: string;
|
||||
bucketEvent: BucketEvent | null;
|
||||
bucketEvent: NotificationConfig | null;
|
||||
}
|
||||
|
||||
const DeleteEvent = ({
|
||||
|
||||
@@ -26,11 +26,11 @@ import {
|
||||
spacingUtils,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
|
||||
import api from "../../../../common/api";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
|
||||
import { setErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { api } from "api";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
interface IEditAccessRule {
|
||||
classes: any;
|
||||
@@ -69,16 +69,16 @@ const EditAccessRule = ({
|
||||
};
|
||||
|
||||
const createProcess = () => {
|
||||
api
|
||||
.invoke("PUT", `/api/v1/bucket/${bucket}/access-rules`, {
|
||||
api.bucket
|
||||
.setAccessRuleWithBucket(bucket, {
|
||||
prefix: toEdit,
|
||||
access: selectedAccess,
|
||||
})
|
||||
.then((res: any) => {
|
||||
.then(() => {
|
||||
onClose();
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
onClose();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -38,11 +38,6 @@ import {
|
||||
|
||||
import { ITiersDropDown, LifeCycleItem } from "../types";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import {
|
||||
ITierElement,
|
||||
ITierResponse,
|
||||
} from "../../Configurations/TiersConfiguration/types";
|
||||
import api from "../../../../common/api";
|
||||
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
|
||||
@@ -52,6 +47,8 @@ import RadioGroupSelector from "../../Common/FormComponents/RadioGroupSelector/R
|
||||
|
||||
import { setModalErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { api } from "api";
|
||||
import { Tier } from "api/consoleApi";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
@@ -91,20 +88,20 @@ const EditLifecycleConfiguration = ({
|
||||
const [expiredObjectDM, setExpiredObjectDM] = useState<boolean>(false);
|
||||
const [NCExpirationDays, setNCExpirationDays] = useState<string>("0");
|
||||
const [NCTransitionDays, setNCTransitionDays] = useState<string>("0");
|
||||
const [ilmType, setIlmType] = useState<string>("expiry");
|
||||
const [ilmType, setIlmType] = useState<"transition" | "expiry">("expiry");
|
||||
const [expiryDays, setExpiryDays] = useState<string>("0");
|
||||
const [transitionDays, setTransitionDays] = useState<string>("0");
|
||||
const [isFormValid, setIsFormValid] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingTiers) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/admin/tiers`)
|
||||
.then((res: ITierResponse) => {
|
||||
const tiersList: ITierElement[] | null = get(res, "items", []);
|
||||
api.admin
|
||||
.tiersList()
|
||||
.then((res) => {
|
||||
const tiersList: Tier[] | null = get(res.data, "items", []);
|
||||
|
||||
if (tiersList !== null && tiersList.length >= 1) {
|
||||
const objList = tiersList.map((tier: ITierElement) => {
|
||||
const objList = tiersList.map((tier: Tier) => {
|
||||
const tierType = tier.type;
|
||||
const value = get(tier, `${tierType}.name`, "");
|
||||
|
||||
@@ -118,7 +115,7 @@ const EditLifecycleConfiguration = ({
|
||||
}
|
||||
setLoadingTiers(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch(() => {
|
||||
setLoadingTiers(false);
|
||||
});
|
||||
}
|
||||
@@ -293,10 +290,10 @@ const EditLifecycleConfiguration = ({
|
||||
...rules,
|
||||
};
|
||||
|
||||
api
|
||||
.invoke(
|
||||
"PUT",
|
||||
`/api/v1/buckets/${selectedBucket}/lifecycle/${lifecycleRule.id}`,
|
||||
api.buckets
|
||||
.updateBucketLifecycle(
|
||||
selectedBucket,
|
||||
lifecycleRule.id,
|
||||
lifecycleUpdate
|
||||
)
|
||||
.then((res) => {
|
||||
|
||||
@@ -29,14 +29,13 @@ import {
|
||||
modalStyleUtils,
|
||||
spacingUtils,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import { BucketReplicationRule } from "../types";
|
||||
|
||||
import api from "../../../../common/api";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import PredefinedList from "../../Common/FormComponents/PredefinedList/PredefinedList";
|
||||
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
|
||||
import { setModalErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { api } from "api";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
interface IEditReplicationModal {
|
||||
closeModalAndRefresh: (refresh: boolean) => void;
|
||||
@@ -82,27 +81,27 @@ const EditReplicationModal = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (editLoading) {
|
||||
api
|
||||
.invoke("GET", `/api/v1/buckets/${bucketName}/replication/${ruleID}`)
|
||||
.then((res: BucketReplicationRule) => {
|
||||
setPriority(res.priority.toString());
|
||||
const pref = res.prefix || "";
|
||||
const tag = res.tags || "";
|
||||
api.buckets
|
||||
.getBucketReplicationRule(bucketName, ruleID)
|
||||
.then((res) => {
|
||||
setPriority(res.data.priority ? res.data.priority.toString() : "");
|
||||
const pref = res.data.prefix || "";
|
||||
const tag = res.data.tags || "";
|
||||
setPrefix(pref);
|
||||
setInitialTags(tag);
|
||||
setTags(tag);
|
||||
setDestination(res.destination.bucket);
|
||||
setRepDeleteMarker(res.delete_marker_replication);
|
||||
setTargetStorageClass(res.storageClass || "");
|
||||
setRepExisting(!!res.existingObjects);
|
||||
setRepDelete(!!res.deletes_replication);
|
||||
setRuleState(res.status === "Enabled");
|
||||
setMetadataSync(!!res.metadata_replication);
|
||||
setDestination(res.data.destination?.bucket || "");
|
||||
setRepDeleteMarker(res.data.delete_marker_replication || false);
|
||||
setTargetStorageClass(res.data.storageClass || "");
|
||||
setRepExisting(!!res.data.existingObjects);
|
||||
setRepDelete(!!res.data.deletes_replication);
|
||||
setRuleState(res.data.status === "Enabled");
|
||||
setMetadataSync(!!res.data.metadata_replication);
|
||||
|
||||
setEditLoading(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
setEditLoading(false);
|
||||
});
|
||||
}
|
||||
@@ -123,18 +122,14 @@ const EditReplicationModal = ({
|
||||
storageClass: targetStorageClass,
|
||||
};
|
||||
|
||||
api
|
||||
.invoke(
|
||||
"PUT",
|
||||
`/api/v1/buckets/${bucketName}/replication/${ruleID}`,
|
||||
remoteBucketsInfo
|
||||
)
|
||||
api.buckets
|
||||
.updateMultiBucketReplication(bucketName, ruleID, remoteBucketsInfo)
|
||||
.then(() => {
|
||||
setSaveEdit(false);
|
||||
closeModalAndRefresh(true);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
.catch((err) => {
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
setSaveEdit(false);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,9 +25,6 @@ import {
|
||||
formFieldStyles,
|
||||
modalStyleUtils,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import { BucketEncryptionInfo } from "../types";
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import api from "../../../../common/api";
|
||||
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
|
||||
|
||||
@@ -40,6 +37,13 @@ import {
|
||||
import { SecureComponent } from "../../../../common/SecureComponent";
|
||||
import TooltipWrapper from "../../Common/TooltipWrapper/TooltipWrapper";
|
||||
import AddKeyModal from "./AddKeyModal";
|
||||
import {
|
||||
BucketEncryptionInfo,
|
||||
BucketEncryptionType,
|
||||
KmsKeyInfo,
|
||||
} from "api/consoleApi";
|
||||
import { api } from "api";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
@@ -66,33 +70,35 @@ const EnableBucketEncryption = ({
|
||||
const dispatch = useAppDispatch();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [kmsKeyID, setKmsKeyID] = useState<string>("");
|
||||
const [encryptionType, setEncryptionType] = useState<string>("disabled");
|
||||
const [keys, setKeys] = useState<[]>([]);
|
||||
const [encryptionType, setEncryptionType] = useState<
|
||||
BucketEncryptionType | "disabled"
|
||||
>("disabled");
|
||||
const [keys, setKeys] = useState<KmsKeyInfo[] | undefined>([]);
|
||||
const [loadingKeys, setLoadingKeys] = useState<boolean>(false);
|
||||
const [addOpen, setAddOpen] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (encryptionCfg) {
|
||||
if (encryptionCfg.algorithm === "AES256") {
|
||||
setEncryptionType("sse-s3");
|
||||
setEncryptionType(BucketEncryptionType.SseS3);
|
||||
} else {
|
||||
setEncryptionType("sse-kms");
|
||||
setKmsKeyID(encryptionCfg.kmsMasterKeyID);
|
||||
setEncryptionType(BucketEncryptionType.SseKms);
|
||||
setKmsKeyID(encryptionCfg.kmsMasterKeyID || "");
|
||||
}
|
||||
}
|
||||
}, [encryptionCfg]);
|
||||
|
||||
useEffect(() => {
|
||||
if (encryptionType === "sse-kms") {
|
||||
api
|
||||
.invoke("GET", `/api/v1/kms/keys`)
|
||||
.then((res: any) => {
|
||||
setKeys(res.results);
|
||||
api.kms
|
||||
.kmsListKeys()
|
||||
.then((res) => {
|
||||
setKeys(res.data.results);
|
||||
setLoadingKeys(false);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setLoadingKeys(false);
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
}
|
||||
}, [encryptionType, loadingKeys, dispatch]);
|
||||
@@ -103,19 +109,19 @@ const EnableBucketEncryption = ({
|
||||
return;
|
||||
}
|
||||
if (encryptionType === "disabled") {
|
||||
api
|
||||
.invoke("POST", `/api/v1/buckets/${selectedBucket}/encryption/disable`)
|
||||
api.buckets
|
||||
.disableBucketEncryption(selectedBucket)
|
||||
.then(() => {
|
||||
setLoading(false);
|
||||
closeModalAndRefresh();
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setLoading(false);
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
} else {
|
||||
api
|
||||
.invoke("POST", `/api/v1/buckets/${selectedBucket}/encryption/enable`, {
|
||||
api.buckets
|
||||
.enableBucketEncryption(selectedBucket, {
|
||||
encType: encryptionType,
|
||||
kmsKeyID: kmsKeyID,
|
||||
})
|
||||
@@ -123,9 +129,9 @@ const EnableBucketEncryption = ({
|
||||
setLoading(false);
|
||||
closeModalAndRefresh();
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setLoading(false);
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -161,8 +167,10 @@ const EnableBucketEncryption = ({
|
||||
<Grid item xs={12} className={classes.modalFormScrollable}>
|
||||
<Grid item xs={12} className={classes.formFieldRow}>
|
||||
<SelectWrapper
|
||||
onChange={(e: SelectChangeEvent<string>) => {
|
||||
setEncryptionType(e.target.value as string);
|
||||
onChange={(e) => {
|
||||
setEncryptionType(
|
||||
e.target.value as BucketEncryptionType | "disabled"
|
||||
);
|
||||
}}
|
||||
id="select-encryption-type"
|
||||
name="select-encryption-type"
|
||||
@@ -175,11 +183,11 @@ const EnableBucketEncryption = ({
|
||||
},
|
||||
{
|
||||
label: "SSE-S3",
|
||||
value: "sse-s3",
|
||||
value: BucketEncryptionType.SseS3,
|
||||
},
|
||||
{
|
||||
label: "SSE-KMS",
|
||||
value: "sse-kms",
|
||||
value: BucketEncryptionType.SseKms,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
@@ -192,21 +200,23 @@ const EnableBucketEncryption = ({
|
||||
className={classes.formFieldRow}
|
||||
display={"flex"}
|
||||
>
|
||||
<SelectWrapper
|
||||
onChange={(e: SelectChangeEvent<string>) => {
|
||||
setKmsKeyID(e.target.value);
|
||||
}}
|
||||
id="select-kms-key-id"
|
||||
name="select-kms-key-id"
|
||||
label={"KMS Key ID"}
|
||||
value={kmsKeyID}
|
||||
options={keys.map((key: any) => {
|
||||
return {
|
||||
label: key.name,
|
||||
value: key.name,
|
||||
};
|
||||
})}
|
||||
/>
|
||||
{keys && (
|
||||
<SelectWrapper
|
||||
onChange={(e: SelectChangeEvent<string>) => {
|
||||
setKmsKeyID(e.target.value);
|
||||
}}
|
||||
id="select-kms-key-id"
|
||||
name="select-kms-key-id"
|
||||
label={"KMS Key ID"}
|
||||
value={kmsKeyID}
|
||||
options={keys.map((key: KmsKeyInfo) => {
|
||||
return {
|
||||
label: key.name || "",
|
||||
value: key.name || "",
|
||||
};
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
<Grid marginLeft={1}>
|
||||
<SecureComponent
|
||||
scopes={[IAM_SCOPES.KMS_IMPORT_KEY]}
|
||||
|
||||
@@ -26,9 +26,7 @@ import {
|
||||
getBytes,
|
||||
k8sScalarUnitsExcluding,
|
||||
} from "../../../../common/utils";
|
||||
import { BucketQuota } from "../types";
|
||||
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import {
|
||||
formFieldStyles,
|
||||
modalStyleUtils,
|
||||
@@ -36,11 +34,13 @@ import {
|
||||
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
|
||||
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||
import api from "../../../../common/api";
|
||||
import InputUnitMenu from "../../Common/FormComponents/InputUnitMenu/InputUnitMenu";
|
||||
|
||||
import { setModalErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { BucketQuota } from "api/consoleApi";
|
||||
import { api } from "api";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
@@ -76,7 +76,7 @@ const EnableQuota = ({
|
||||
if (enabled) {
|
||||
setQuotaEnabled(true);
|
||||
if (cfg) {
|
||||
const unitCalc = calculateBytes(cfg.quota, true, false, true);
|
||||
const unitCalc = calculateBytes(cfg.quota || 0, true, false, true);
|
||||
|
||||
setQuotaSize(unitCalc.total.toString());
|
||||
setQuotaUnit(unitCalc.unit);
|
||||
@@ -100,21 +100,20 @@ const EnableQuota = ({
|
||||
if (loading || !validInput) {
|
||||
return;
|
||||
}
|
||||
let req = {
|
||||
enabled: quotaEnabled,
|
||||
amount: parseInt(getBytes(quotaSize, quotaUnit, true)),
|
||||
quota_type: "hard",
|
||||
};
|
||||
|
||||
api
|
||||
.invoke("PUT", `/api/v1/buckets/${selectedBucket}/quota`, req)
|
||||
api.buckets
|
||||
.setBucketQuota(selectedBucket, {
|
||||
enabled: quotaEnabled,
|
||||
amount: parseInt(getBytes(quotaSize, quotaUnit, true)),
|
||||
quota_type: "hard",
|
||||
})
|
||||
.then(() => {
|
||||
setLoading(false);
|
||||
closeModalAndRefresh();
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setLoading(false);
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -16,22 +16,22 @@
|
||||
|
||||
import React, { Fragment, useState } from "react";
|
||||
import { DialogContentText } from "@mui/material";
|
||||
import api from "../../../../common/api";
|
||||
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import ConfirmDialog from "../../Common/ModalWrapper/ConfirmDialog";
|
||||
import { ConfirmModalIcon } from "mds";
|
||||
|
||||
import { setErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { BucketVersioningInfo } from "../types";
|
||||
import VersioningInfo from "../VersioningInfo";
|
||||
import { BucketVersioningResponse } from "api/consoleApi";
|
||||
import { api } from "api";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
interface IVersioningEventProps {
|
||||
closeVersioningModalAndRefresh: (refresh: boolean) => void;
|
||||
modalOpen: boolean;
|
||||
selectedBucket: string;
|
||||
versioningInfo: BucketVersioningInfo | undefined;
|
||||
versioningInfo: BucketVersioningResponse | undefined;
|
||||
}
|
||||
|
||||
const EnableVersioningModal = ({
|
||||
@@ -51,17 +51,17 @@ const EnableVersioningModal = ({
|
||||
}
|
||||
setVersioningLoading(true);
|
||||
|
||||
api
|
||||
.invoke("PUT", `/api/v1/buckets/${selectedBucket}/versioning`, {
|
||||
api.buckets
|
||||
.setBucketVersioning(selectedBucket, {
|
||||
versioning: !isVersioningEnabled,
|
||||
})
|
||||
.then(() => {
|
||||
setVersioningLoading(false);
|
||||
closeVersioningModalAndRefresh(true);
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setVersioningLoading(false);
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
dispatch(setErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { SelectChangeEvent } from "@mui/material";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import { Button, ChangeAccessPolicyIcon } from "mds";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
@@ -27,8 +26,6 @@ import {
|
||||
spacingUtils,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
|
||||
import { ErrorResponseHandler } from "../../../../common/types";
|
||||
import api from "../../../../common/api";
|
||||
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
|
||||
import CodeMirrorWrapper from "../../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper";
|
||||
@@ -36,6 +33,9 @@ import CodeMirrorWrapper from "../../Common/FormComponents/CodeMirrorWrapper/Cod
|
||||
import { setModalErrorSnackMessage } from "../../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../../store";
|
||||
import { emptyPolicy } from "../../Policies/utils";
|
||||
import { api } from "api";
|
||||
import { BucketAccess } from "api/consoleApi";
|
||||
import { errorToHandler } from "api/errors";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
@@ -61,7 +61,7 @@ interface ISetAccessPolicyProps {
|
||||
classes: any;
|
||||
open: boolean;
|
||||
bucketName: string;
|
||||
actualPolicy: string;
|
||||
actualPolicy: BucketAccess | string;
|
||||
actualDefinition: string;
|
||||
closeModalAndRefresh: () => void;
|
||||
}
|
||||
@@ -76,26 +76,26 @@ const SetAccessPolicy = ({
|
||||
}: ISetAccessPolicyProps) => {
|
||||
const dispatch = useAppDispatch();
|
||||
const [addLoading, setAddLoading] = useState<boolean>(false);
|
||||
const [accessPolicy, setAccessPolicy] = useState<string>("");
|
||||
const [accessPolicy, setAccessPolicy] = useState<BucketAccess | string>("");
|
||||
const [policyDefinition, setPolicyDefinition] = useState<string>(emptyPolicy);
|
||||
const addRecord = (event: React.FormEvent) => {
|
||||
event.preventDefault();
|
||||
if (addLoading) {
|
||||
if (addLoading || !accessPolicy) {
|
||||
return;
|
||||
}
|
||||
setAddLoading(true);
|
||||
api
|
||||
.invoke("PUT", `/api/v1/buckets/${bucketName}/set-policy`, {
|
||||
access: accessPolicy,
|
||||
api.buckets
|
||||
.bucketSetPolicy(bucketName, {
|
||||
access: accessPolicy as BucketAccess,
|
||||
definition: policyDefinition,
|
||||
})
|
||||
.then((res) => {
|
||||
setAddLoading(false);
|
||||
closeModalAndRefresh();
|
||||
})
|
||||
.catch((err: ErrorResponseHandler) => {
|
||||
.catch((err) => {
|
||||
setAddLoading(false);
|
||||
dispatch(setModalErrorSnackMessage(err));
|
||||
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -132,13 +132,13 @@ const SetAccessPolicy = ({
|
||||
label="Access Policy"
|
||||
id="select-access-policy"
|
||||
name="select-access-policy"
|
||||
onChange={(e: SelectChangeEvent<string>) => {
|
||||
setAccessPolicy(e.target.value as string);
|
||||
onChange={(e) => {
|
||||
setAccessPolicy(e.target.value as BucketAccess);
|
||||
}}
|
||||
options={[
|
||||
{ value: "PRIVATE", label: "Private" },
|
||||
{ value: "PUBLIC", label: "Public" },
|
||||
{ value: "CUSTOM", label: "Custom" },
|
||||
{ value: BucketAccess.PRIVATE, label: "Private" },
|
||||
{ value: BucketAccess.PUBLIC, label: "Public" },
|
||||
{ value: BucketAccess.CUSTOM, label: "Custom" },
|
||||
]}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import { Box } from "@mui/material";
|
||||
import { BucketVersioningInfo } from "./types";
|
||||
import LabelWithIcon from "./BucketDetails/SummaryItems/LabelWithIcon";
|
||||
import { DisabledIcon, EnabledIcon } from "mds";
|
||||
import { BucketVersioningResponse } from "api/consoleApi";
|
||||
|
||||
const VersioningInfo = ({
|
||||
versioningState = {},
|
||||
}: {
|
||||
versioningState?: BucketVersioningInfo;
|
||||
versioningState?: BucketVersioningResponse;
|
||||
}) => {
|
||||
return (
|
||||
<Box
|
||||
@@ -59,7 +59,7 @@ const VersioningInfo = ({
|
||||
>
|
||||
{versioningState.excludedPrefixes?.map((it) => (
|
||||
<div>
|
||||
<strong>{it.Prefix}</strong>
|
||||
<strong>{it.prefix}</strong>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -14,34 +14,6 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
export interface BucketEncryptionInfo {
|
||||
algorithm: string;
|
||||
kmsMasterKeyID: string;
|
||||
}
|
||||
|
||||
export interface BucketEvent {
|
||||
id: string;
|
||||
arn: string;
|
||||
events: string[];
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
}
|
||||
|
||||
export interface BucketEventList {
|
||||
events: BucketEvent[];
|
||||
total: number;
|
||||
}
|
||||
export interface BucketVersioningInfo {
|
||||
excludeFolders?: boolean;
|
||||
excludedPrefixes?: Record<"Prefix", string>[];
|
||||
MFADelete?: string;
|
||||
status?: "Enabled" | "Suspended" | "";
|
||||
}
|
||||
|
||||
export interface BucketObjectLocking {
|
||||
object_locking_enabled: boolean;
|
||||
}
|
||||
|
||||
export interface BucketReplicationDestination {
|
||||
bucket: string;
|
||||
}
|
||||
@@ -65,11 +37,6 @@ export interface BucketReplication {
|
||||
rules: BucketReplicationRule[];
|
||||
}
|
||||
|
||||
export interface BucketQuota {
|
||||
quota: number;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface BulkReplicationResponse {
|
||||
replicationState: BulkReplicationItem[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user