diff --git a/pkg/auth/token.go b/pkg/auth/token.go index ae075c358..1a9baf58c 100644 --- a/pkg/auth/token.go +++ b/pkg/auth/token.go @@ -54,7 +54,7 @@ var derivedKey = func() []byte { return pbkdf2.Key([]byte(token.GetPBKDFPassphrase()), []byte(token.GetPBKDFSalt()), 4096, 32, sha1.New) } -// IsSessionTokenValid returns true or false depending if the provided session token is valid or not +// IsSessionTokenValid returns true or false depending upon the provided session if the token is valid or not func IsSessionTokenValid(token string) bool { _, err := SessionTokenAuthenticate(token) return err == nil diff --git a/portal-ui/src/icons/MultipleBucketsIcon.tsx b/portal-ui/src/icons/MultipleBucketsIcon.tsx new file mode 100644 index 000000000..e148fe8ef --- /dev/null +++ b/portal-ui/src/icons/MultipleBucketsIcon.tsx @@ -0,0 +1,49 @@ +// This file is part of MinIO Console Server +// Copyright (c) 2021 MinIO, Inc. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +import * as React from "react"; +import { SvgIcon, SvgIconProps } from "@mui/material"; + +const MultipleBucketsIcon = (props: SvgIconProps) => { + return ( + + + + + + + + + + + ); +}; + +export default MultipleBucketsIcon; diff --git a/portal-ui/src/icons/SelectMultipleIcon.tsx b/portal-ui/src/icons/SelectMultipleIcon.tsx new file mode 100644 index 000000000..b1c75eacc --- /dev/null +++ b/portal-ui/src/icons/SelectMultipleIcon.tsx @@ -0,0 +1,33 @@ +// This file is part of MinIO Console Server +// Copyright (c) 2021 MinIO, Inc. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +import * as React from "react"; +import { SvgIcon, SvgIconProps } from "@mui/material"; + +const SelectMultipleIcon = (props: SvgIconProps) => { + return ( + + + + + + ); +}; + +export default SelectMultipleIcon; diff --git a/portal-ui/src/icons/index.ts b/portal-ui/src/icons/index.ts index afd76bf18..a41c034c9 100644 --- a/portal-ui/src/icons/index.ts +++ b/portal-ui/src/icons/index.ts @@ -55,6 +55,7 @@ export { default as DocumentationIcon } from "./DocumentationIcon"; export { default as TrashIcon } from "./TrashIcon"; export { default as DownloadIcon } from "./DownloadIcon"; export { default as AllBucketsIcon } from "./AllBucketsIcon"; +export { default as SelectMultipleIcon } from "./SelectMultipleIcon"; export { default as GroupsIcon } from "./GroupsIcon"; export { default as TenantsIcon } from "./TenantsIcon"; export { default as UploadFile } from "./UploadFile"; diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketDetails.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketDetails.tsx index 54d76083e..38465f2e9 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketDetails.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketDetails.tsx @@ -356,32 +356,30 @@ const BucketDetails = ({ S3_DELETE_BUCKET, S3_FORCE_DELETE_BUCKET, ]) && ( - - { - setDeleteOpen(true); - }} - size="large" - > - - - - )} - { - setBucketDetailsLoad(true); + setDeleteOpen(true); }} size="large" - variant={"contained"} > - + - + )} + { + setBucketDetailsLoad(true); + }} + size="large" + variant={"contained"} + > + + } /> diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/BucketListItem.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/BucketListItem.tsx index b54362bac..5ad1fe3cb 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/BucketListItem.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/BucketListItem.tsx @@ -14,42 +14,37 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import React from "react"; -import { Link } from "react-router-dom"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; import { ArrowRightIcon, BucketsIcon, - CalendarIcon, - LockIcon, ReportedUsageIcon, SettingsIcon, TotalObjectsIcon, } from "../../../../icons"; import { Bucket } from "../types"; -import { - Box, - Button, - Card, - CardContent, - CardHeader, - Grid, - Typography, -} from "@mui/material"; +import { Box, Button, Grid, Typography } from "@mui/material"; import { niceBytes, prettyNumber } from "../../../../common/utils"; import CheckboxWrapper from "../../Common/FormComponents/CheckboxWrapper/CheckboxWrapper"; +import { Link } from "react-router-dom"; const styles = (theme: Theme) => createStyles({ root: { marginBottom: 30, - border: 0, - borderRadius: 10, + padding: 20, color: theme.palette.primary.main, - boxShadow: "0px 0px 15px #00000029", + border: "#E5E5E5 1px solid", + borderRadius: 2, "& .MuiSvgIcon-root": { - height: 13, + height: 14, + width: 14, + marginRight: 4, + }, + "& .MuiTypography-body2": { + fontSize: 14, }, "& .MuiCardHeader-content": { wordWrap: "break-word", @@ -90,7 +85,7 @@ const styles = (theme: Theme) => viewButton: { width: 111, color: "white", - backgroundColor: "#C83B51", + marginLeft: 8, fontSize: 12, fontWeight: "normal", boxShadow: "unset", @@ -115,18 +110,29 @@ const styles = (theme: Theme) => marginBottom: 4, }, metricLabel: { - fontSize: 16, + fontSize: 14, fontWeight: "bold", }, metricText: { - fontSize: 50, + fontSize: 24, fontWeight: "bold", - marginBottom: 10, }, unit: { fontSize: 12, fontWeight: "normal", }, + bucketName: { + padding: 0, + margin: 0, + fontSize: 22, + }, + bucketIcon: { + "& .MuiSvgIcon-root": { + height: 48, + width: 48, + fontSize: 48, + }, + }, }); interface IBucketListItem { @@ -165,105 +171,106 @@ const BucketListItem = ({ }; return ( - - - {bulkSelect && ( -
{ - e.stopPropagation(); - }} - > - -
- )} - - - {bucket.name} - - } - /> - - - + + + + - - - Created: {bucket.creation_date} - - - Access: {accessToStr(bucket)} - + + {bulkSelect && ( +
{ + e.stopPropagation(); + }} + > + +
+ )} +

{bucket.name}

- - - USAGE - -
- {usageScalar} - {usageUnit} -
-
- - - OBJECTS - -
- {bucket.objects ? prettyNumber(bucket.objects) : 0} -
+ + + + + Created: {bucket.creation_date} + + + + + Access: {accessToStr(bucket)} + + +
- - - - + {bucket.manage && ( + + - - -
- - - {bucket.manage && ( - - - - - - )} - + Manage + + + )} + + + + +
+ - - + + +
+
+ + + + + + + + Usage +
+ {usageScalar} + {usageUnit} +
+
+ + + Objects +
+ {bucket.objects ? prettyNumber(bucket.objects) : 0} +
+
+
+
+ ); }; diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/BulkReplicationModal.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/BulkReplicationModal.tsx index b73ef647c..7bef13dcd 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/BulkReplicationModal.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/BulkReplicationModal.tsx @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React, { useState, useEffect, Fragment } from "react"; +import React, { Fragment, useEffect, useState } from "react"; import { connect } from "react-redux"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; @@ -29,7 +29,7 @@ import { wizardCommon, } from "../../Common/FormComponents/common/styleLibrary"; import { setModalErrorSnackMessage } from "../../../../actions"; -import { BulkReplicationResponse, BulkReplicationItem } from "../types"; +import { BulkReplicationItem, BulkReplicationResponse } from "../types"; import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper"; import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper"; import PredefinedList from "../../Common/FormComponents/PredefinedList/PredefinedList"; diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/ListBuckets.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/ListBuckets.tsx index 03fed008e..ecc3fa8e2 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/ListBuckets.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/ListBuckets.tsx @@ -21,9 +21,8 @@ import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; import { Button, LinearProgress } from "@mui/material"; import Grid from "@mui/material/Grid"; -import FileCopyIcon from "@mui/icons-material/FileCopy"; import { Bucket, BucketList, HasPermissionResponse } from "../types"; -import { AddIcon, BucketsIcon, WatchIcon } from "../../../../icons"; +import { AddIcon, BucketsIcon } from "../../../../icons"; import { AppState } from "../../../../store"; import { setErrorSnackMessage } from "../../../../actions"; import { @@ -44,6 +43,8 @@ import SearchIcon from "../../../../icons/SearchIcon"; import BoxIconButton from "../../Common/BoxIconButton/BoxIconButton"; import RefreshIcon from "../../../../icons/RefreshIcon"; import AButton from "../../Common/AButton/AButton"; +import MultipleBucketsIcon from "../../../../icons/MultipleBucketsIcon"; +import SelectMultipleIcon from "../../../../icons/SelectMultipleIcon"; const styles = (theme: Theme) => createStyles({ @@ -306,32 +307,32 @@ const ListBuckets = ({ /> - - - + + { setLoading(true); }} diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx index aa26250dd..467baf222 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx @@ -45,7 +45,7 @@ import { objectBrowserCommon, searchField, } from "../../../../Common/FormComponents/common/styleLibrary"; -import { Badge, Button, Tooltip, Typography } from "@mui/material"; +import { Badge, Button, Typography } from "@mui/material"; import * as reactMoment from "react-moment"; import BrowserBreadcrumbs from "../../../../ObjectBrowser/BrowserBreadcrumbs"; import { @@ -1087,35 +1087,32 @@ const ListObjects = ({ {displayPutObject && ( - - { - setCreateFolderOpen(true); - }} - disabled={rewindEnabled} - size="large" - > - - - - - - { - if (fileUpload && fileUpload.current) { - fileUpload.current.click(); - } - }} - disabled={rewindEnabled} - size="large" - > - - - + { + setCreateFolderOpen(true); + }} + disabled={rewindEnabled} + size="large" + > + + + { + if (fileUpload && fileUpload.current) { + fileUpload.current.click(); + } + }} + disabled={rewindEnabled} + size="large" + > + + )} - - - - { - setRewindSelect(true); - }} - disabled={!isVersioned} - size="large" - > - - - - - + { - setLoading(true); + setRewindSelect(true); }} - disabled={rewindEnabled} + disabled={!isVersioned} size="large" - variant={"contained"} > - + - + + { + setLoading(true); + }} + disabled={rewindEnabled} + size="large" + variant={"contained"} + > + + } /> diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ObjectDetails.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ObjectDetails.tsx index 01213e0e5..bbd0bcfc6 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ObjectDetails.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ObjectDetails.tsx @@ -30,7 +30,6 @@ import { TableBody, TableCell, TableRow, - Tooltip, } from "@mui/material"; import Grid from "@mui/material/Grid"; import Chip from "@mui/material/Chip"; @@ -646,19 +645,18 @@ const ObjectDetails = ({ } actions={ - - { - shareObject(); - }} - disabled={actualInfo.is_delete_marker} - size="large" - > - - - + { + shareObject(); + }} + disabled={actualInfo.is_delete_marker} + size="large" + > + + {downloadingFiles.includes( `${bucketName}/${actualInfo.name}` @@ -671,35 +669,32 @@ const ObjectDetails = ({ />
) : ( - - { - downloadObject(actualInfo); - }} - disabled={actualInfo.is_delete_marker} - size="large" - > - - - + { + downloadObject(actualInfo); + }} + disabled={actualInfo.is_delete_marker} + size="large" + > + + )} - {displayDeleteObject && ( - - { - setDeleteOpen(true); - }} - disabled={actualInfo.is_delete_marker} - size="large" - > - - - + { + setDeleteOpen(true); + }} + disabled={actualInfo.is_delete_marker} + size="large" + > + + )} } diff --git a/portal-ui/src/screens/Console/Common/BoxIconButton/BoxIconButton.tsx b/portal-ui/src/screens/Console/Common/BoxIconButton/BoxIconButton.tsx index 63e7f6317..47f7aa0d3 100644 --- a/portal-ui/src/screens/Console/Common/BoxIconButton/BoxIconButton.tsx +++ b/portal-ui/src/screens/Console/Common/BoxIconButton/BoxIconButton.tsx @@ -18,7 +18,7 @@ import React from "react"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; -import { IconButton, IconButtonProps } from "@mui/material"; +import { IconButton, IconButtonProps, Tooltip } from "@mui/material"; import clsx from "clsx"; const styles = (theme: Theme) => @@ -64,15 +64,17 @@ interface IBoxIconButton extends IconButtonProps { classes: any; children: any; variant?: "outlined" | "contained"; + tooltip?: string; } const BoxIconButton = ({ classes, children, variant = "outlined", + tooltip, ...rest }: IBoxIconButton) => { - return ( + const button = ( ); + + if (tooltip && tooltip !== "") { + return ( + + {button} + + ); + } + + return button; }; export default withStyles(styles)(BoxIconButton); diff --git a/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx b/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx index 482a296c3..ebda2d73b 100644 --- a/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx +++ b/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx @@ -27,7 +27,7 @@ import { } from "../Common/FormComponents/common/styleLibrary"; import Paper from "@mui/material/Paper"; import Grid from "@mui/material/Grid"; -import { Button, LinearProgress, Tooltip } from "@mui/material"; +import { Button, LinearProgress } from "@mui/material"; import TableWrapper from "../Common/TableWrapper/TableWrapper"; import api from "../../../common/api"; import PageHeader from "../Common/PageHeader/PageHeader"; @@ -373,30 +373,27 @@ const PolicyDetails = ({ subTitle={IAM Policy} actions={ - - - - - - - - { - setLoadingUsers(true); - setLoadingGroups(true); - setLoadingPolicy(true); - }} - size="large" - > - - - + + + + { + setLoadingUsers(true); + setLoadingGroups(true); + setLoadingPolicy(true); + }} + size="large" + > + + } /> diff --git a/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantDetails.tsx b/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantDetails.tsx index 8bc5ab587..49a8c339a 100644 --- a/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantDetails.tsx +++ b/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantDetails.tsx @@ -20,7 +20,6 @@ import { Link, Redirect, Route, Router, Switch } from "react-router-dom"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; -import { Tooltip } from "@mui/material"; import get from "lodash/get"; import Grid from "@mui/material/Grid"; import { setErrorSnackMessage, setSnackBarMessage } from "../../../../actions"; @@ -325,41 +324,38 @@ const TenantDetails = ({ } actions={
- - { - confirmDeleteTenant(); - }} - size="large" - > - - - - - { - editYaml(); - }} - size="large" - > - - - - - { - setTenantDetailsLoad(true); - }} - > - - - + { + confirmDeleteTenant(); + }} + size="large" + > + + + { + editYaml(); + }} + size="large" + > + + + { + setTenantDetailsLoad(true); + }} + > + +
} /> diff --git a/portal-ui/src/screens/Console/Users/UserDetails.tsx b/portal-ui/src/screens/Console/Users/UserDetails.tsx index 57331438a..fe1019c20 100644 --- a/portal-ui/src/screens/Console/Users/UserDetails.tsx +++ b/portal-ui/src/screens/Console/Users/UserDetails.tsx @@ -21,7 +21,7 @@ import { Link } from "react-router-dom"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; -import { Button, Grid, Tooltip } from "@mui/material"; +import { Button, Grid } from "@mui/material"; import { AddIcon, DeleteIcon, @@ -319,27 +319,24 @@ const UserDetails = ({ classes, match }: IUserDetailsProps) => { }} switchOnly /> - - - - - - - - - - - + + + + + + } />