Remove unused components (#2641)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -1,139 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { Fragment } from "react";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import makeStyles from "@mui/styles/makeStyles";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Pagination from "@mui/material/Pagination";
|
||||
|
||||
interface IGeneralUsePaginator {
|
||||
classes: any;
|
||||
page: number;
|
||||
itemsPerPage?: number;
|
||||
entity: string;
|
||||
totalItems: number;
|
||||
onChange: (newPage: number) => void;
|
||||
}
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
paginatorContainer: {
|
||||
margin: "10px 0 18px",
|
||||
flexWrap: "wrap",
|
||||
},
|
||||
paginatorInformation: {
|
||||
color: "#848484",
|
||||
fontSize: 12,
|
||||
fontStyle: "italic",
|
||||
whiteSpace: "nowrap",
|
||||
},
|
||||
paginatorEntity: {
|
||||
color: "#767676",
|
||||
fontSize: 12,
|
||||
fontWeight: "bold",
|
||||
},
|
||||
paginationElement: {
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
color: "#848484",
|
||||
fontSize: 12,
|
||||
},
|
||||
});
|
||||
|
||||
const paginatorStyling = makeStyles({
|
||||
ul: {
|
||||
"& .MuiPaginationItem-root": {
|
||||
color: "#07193E",
|
||||
fontSize: 14,
|
||||
"&.Mui-selected": {
|
||||
backgroundColor: "transparent",
|
||||
fontWeight: "bold",
|
||||
"&::after": {
|
||||
backgroundColor: "#07193E",
|
||||
width: "100%",
|
||||
height: 3,
|
||||
content: '" "',
|
||||
position: "absolute",
|
||||
bottom: -3,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const GeneralUsePaginator = ({
|
||||
classes,
|
||||
page = 1,
|
||||
itemsPerPage = 5,
|
||||
entity,
|
||||
totalItems,
|
||||
onChange,
|
||||
}: IGeneralUsePaginator) => {
|
||||
const paginatorStyles = paginatorStyling();
|
||||
|
||||
const currentInitialItem = page * itemsPerPage - itemsPerPage + 1;
|
||||
const currentEndItem = currentInitialItem + itemsPerPage - 1;
|
||||
const displayCurrentEndItem =
|
||||
currentEndItem > totalItems ? totalItems : currentEndItem;
|
||||
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Grid container className={classes.paginatorContainer}>
|
||||
<Grid item xs={6}>
|
||||
<span className={classes.paginatorEntity}>{entity}</span>
|
||||
<br />
|
||||
<span className={classes.paginatorInformation}>
|
||||
Showing{" "}
|
||||
{totalPages > 1 ? (
|
||||
<Fragment>
|
||||
{currentInitialItem} - {displayCurrentEndItem} out of{" "}
|
||||
</Fragment>
|
||||
) : null}
|
||||
{totalItems} Total {entity}
|
||||
</span>
|
||||
</Grid>
|
||||
<Grid item xs={6} className={classes.paginationElement}>
|
||||
{totalPages > 1 && (
|
||||
<Fragment>
|
||||
Go to:{" "}
|
||||
<Pagination
|
||||
count={totalPages}
|
||||
variant={"text"}
|
||||
siblingCount={3}
|
||||
page={page}
|
||||
size="small"
|
||||
hideNextButton
|
||||
hidePrevButton
|
||||
onChange={(_, newPage: number) => {
|
||||
onChange(newPage);
|
||||
}}
|
||||
classes={{ ul: paginatorStyles.ul }}
|
||||
/>
|
||||
</Fragment>
|
||||
)}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default withStyles(styles)(GeneralUsePaginator);
|
||||
@@ -1,84 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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 { IElement } from "../../Configurations/types";
|
||||
|
||||
interface ISettingsCard {
|
||||
classes: any;
|
||||
configuration: IElement;
|
||||
prefix?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
configurationLink: {
|
||||
border: "#E5E5E5 1px solid",
|
||||
borderRadius: 2,
|
||||
padding: 20,
|
||||
width: 190,
|
||||
maxWidth: 190,
|
||||
height: 80,
|
||||
margin: 14,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
color: "#072C4F",
|
||||
fontSize: 14,
|
||||
fontWeight: 700,
|
||||
textDecoration: "none",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
lineClamp: 2,
|
||||
"& svg": {
|
||||
fontSize: 35,
|
||||
marginRight: 15,
|
||||
},
|
||||
"&:hover": {
|
||||
backgroundColor: "#FBFAFA",
|
||||
},
|
||||
"&.disabled": {
|
||||
backgroundColor: "#F9F9F9",
|
||||
color: "#ababab",
|
||||
cursor: "not-allowed",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const SettingsCard = ({
|
||||
classes,
|
||||
configuration,
|
||||
prefix = "settings",
|
||||
disabled = false,
|
||||
}: ISettingsCard) => {
|
||||
return (
|
||||
<Link
|
||||
to={
|
||||
disabled ? `/${prefix}` : `/${prefix}/${configuration.configuration_id}`
|
||||
}
|
||||
className={`${classes.configurationLink} ${disabled ? "disabled" : ""}`}
|
||||
>
|
||||
{configuration.icon}
|
||||
{configuration.configuration_label}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default withStyles(styles)(SettingsCard);
|
||||
@@ -1,114 +0,0 @@
|
||||
import React, { Fragment } from "react";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import { LinearProgress } from "@mui/material";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import ErrorBlock from "../../../shared/ErrorBlock";
|
||||
import { Loader } from "mds";
|
||||
|
||||
interface IProgressBar {
|
||||
maxValue: number;
|
||||
currValue: number;
|
||||
label: string;
|
||||
renderFunction?: (element: string) => any;
|
||||
error: string;
|
||||
loading: boolean;
|
||||
classes: any;
|
||||
labels?: boolean;
|
||||
}
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
allValue: {
|
||||
fontSize: 16,
|
||||
fontWeight: 700,
|
||||
marginBottom: 8,
|
||||
},
|
||||
currentUsage: {
|
||||
fontSize: 12,
|
||||
marginTop: 8,
|
||||
},
|
||||
centerItem: {
|
||||
textAlign: "center",
|
||||
},
|
||||
});
|
||||
|
||||
export const BorderLinearProgress = withStyles((theme) => ({
|
||||
root: {
|
||||
height: 10,
|
||||
borderRadius: 5,
|
||||
},
|
||||
colorPrimary: {
|
||||
backgroundColor: "#F4F4F4",
|
||||
},
|
||||
bar: {
|
||||
borderRadius: 5,
|
||||
backgroundColor: "#081C42",
|
||||
},
|
||||
padChart: {
|
||||
padding: "5px",
|
||||
},
|
||||
}))(LinearProgress);
|
||||
|
||||
const UsageBarWrapper = ({
|
||||
classes,
|
||||
maxValue,
|
||||
currValue,
|
||||
label,
|
||||
renderFunction,
|
||||
loading,
|
||||
error,
|
||||
labels = true,
|
||||
}: IProgressBar) => {
|
||||
const porcentualValue = (currValue * 100) / maxValue;
|
||||
|
||||
const renderComponent = () => {
|
||||
if (!loading) {
|
||||
return error !== "" ? (
|
||||
<ErrorBlock errorMessage={error} withBreak={false} />
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<Grid item xs={12} className={classes.allValue}>
|
||||
{labels && (
|
||||
<Fragment>
|
||||
{label}{" "}
|
||||
{renderFunction
|
||||
? renderFunction(maxValue.toString())
|
||||
: maxValue}
|
||||
</Fragment>
|
||||
)}
|
||||
</Grid>
|
||||
<BorderLinearProgress variant="determinate" value={porcentualValue} />
|
||||
<Grid item xs={12} className={classes.currentUsage}>
|
||||
{labels && (
|
||||
<Fragment>
|
||||
Used:{" "}
|
||||
{renderFunction
|
||||
? renderFunction(currValue.toString())
|
||||
: currValue}
|
||||
</Fragment>
|
||||
)}
|
||||
</Grid>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{loading && (
|
||||
<div className={classes.padChart}>
|
||||
<Grid item xs={12} className={classes.centerItem}>
|
||||
<Loader />
|
||||
</Grid>
|
||||
</div>
|
||||
)}
|
||||
{renderComponent()}
|
||||
</React.Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default withStyles(styles)(UsageBarWrapper);
|
||||
@@ -1,31 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { Route, Routes } from "react-router-dom";
|
||||
import ConfigurationOptions from "./ConfigurationPanels/ConfigurationOptions";
|
||||
import NotFoundPage from "../../NotFoundPage";
|
||||
|
||||
const ConfigurationMain = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route path="/settings" element={<ConfigurationOptions />} />
|
||||
<Route element={<NotFoundPage />} />
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
||||
export default ConfigurationMain;
|
||||
@@ -1,29 +0,0 @@
|
||||
import React from "react";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
const EntityNotFound = ({
|
||||
entityType,
|
||||
entityValue,
|
||||
}: {
|
||||
entityType: string;
|
||||
entityValue: string;
|
||||
}) => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
marginTop: "45px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{entityType}:{" "}
|
||||
<Box sx={{ marginLeft: "5px", marginRight: "5px", fontWeight: 600 }}>
|
||||
{entityValue}
|
||||
</Box>{" "}
|
||||
not found.
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default EntityNotFound;
|
||||
@@ -1,100 +0,0 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import { Box, Grid } from "@mui/material";
|
||||
import { VerifiedIcon } from "mds";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import RegisterHelpBox from "./RegisterHelpBox";
|
||||
import Link from "@mui/material/Link";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
registeredStatus: {
|
||||
border: "1px solid #E2E2E2",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
padding: "24px",
|
||||
borderRadius: 2,
|
||||
backgroundColor: "#FBFAFA",
|
||||
"& .min-icon": {
|
||||
width: 20,
|
||||
height: 20,
|
||||
marginRight: 13,
|
||||
verticalAlign: "middle",
|
||||
},
|
||||
"& span": {
|
||||
fontWeight: "bold",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
interface IRegisterStatus {
|
||||
classes: any;
|
||||
showHelp?: boolean;
|
||||
}
|
||||
|
||||
function RegisterStatus({ classes, showHelp }: IRegisterStatus) {
|
||||
return (
|
||||
<Grid container>
|
||||
<Grid
|
||||
item
|
||||
xs={12}
|
||||
className={classes.registeredStatus}
|
||||
marginBottom={"25px"}
|
||||
>
|
||||
<VerifiedIcon />
|
||||
<span>Registered with MinIO SUBNET</span>
|
||||
</Grid>
|
||||
{showHelp ? (
|
||||
<React.Fragment>
|
||||
<Grid item xs={12} marginTop={"25px"}>
|
||||
<Box
|
||||
sx={{
|
||||
padding: "20px",
|
||||
border: "1px solid #eaeaea",
|
||||
"& a": {
|
||||
color: "#2781B0",
|
||||
cursor: "pointer",
|
||||
},
|
||||
}}
|
||||
>
|
||||
Login to{" "}
|
||||
<Link
|
||||
href="https://subnet.min.io"
|
||||
target="_blank"
|
||||
style={{
|
||||
color: "#2781B0",
|
||||
cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
SUBNET
|
||||
</Link>{" "}
|
||||
to avail technical product support for this MinIO cluster
|
||||
</Box>
|
||||
</Grid>
|
||||
<Grid item xs={12} marginTop={"25px"} marginBottom={"25px"}>
|
||||
<RegisterHelpBox hasMargin={false} />
|
||||
</Grid>
|
||||
</React.Fragment>
|
||||
) : null}
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
||||
export default withStyles(styles)(RegisterStatus);
|
||||
@@ -1,90 +0,0 @@
|
||||
import React, { useState } from "react";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import { Button } from "mds";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import {
|
||||
containerForHeader,
|
||||
tenantDetailsStyles,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import {
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogTitle,
|
||||
LinearProgress,
|
||||
} from "@mui/material";
|
||||
|
||||
interface IConfirmationDialog {
|
||||
classes: any;
|
||||
open: boolean;
|
||||
cancelLabel: string;
|
||||
okLabel: string;
|
||||
onClose: any;
|
||||
cancelOnClick: any;
|
||||
okOnClick: any;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
...tenantDetailsStyles,
|
||||
...containerForHeader,
|
||||
});
|
||||
|
||||
const ConfirmationDialog = ({
|
||||
classes,
|
||||
open,
|
||||
cancelLabel,
|
||||
okLabel,
|
||||
onClose,
|
||||
cancelOnClick,
|
||||
okOnClick,
|
||||
title,
|
||||
description,
|
||||
}: IConfirmationDialog) => {
|
||||
const [isSending, setIsSending] = useState<boolean>(false);
|
||||
const onClick = () => {
|
||||
setIsSending(true);
|
||||
if (okOnClick !== null) {
|
||||
okOnClick();
|
||||
}
|
||||
setIsSending(false);
|
||||
};
|
||||
if (!open) return null;
|
||||
return (
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
aria-labelledby="alert-dialog-title"
|
||||
aria-describedby="alert-dialog-description"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-title">{title}</DialogTitle>
|
||||
<DialogContent>
|
||||
{isSending && <LinearProgress />}
|
||||
<DialogContentText id="alert-dialog-description">
|
||||
{description}
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
id="cancel-dialog"
|
||||
variant={"callAction"}
|
||||
onClick={cancelOnClick}
|
||||
disabled={isSending}
|
||||
label={cancelLabel || "Cancel"}
|
||||
/>
|
||||
<Button
|
||||
id="accept-dialog"
|
||||
variant={"secondary"}
|
||||
onClick={onClick}
|
||||
label={okLabel || "Ok"}
|
||||
/>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default withStyles(styles)(ConfirmationDialog);
|
||||
@@ -1,81 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { Fragment } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import get from "lodash/get";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import {
|
||||
containerForHeader,
|
||||
tenantDetailsStyles,
|
||||
} from "../../Common/FormComponents/common/styleLibrary";
|
||||
import { AppState } from "../../../../store";
|
||||
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
|
||||
import { IKeyValue } from "../ListTenants/types";
|
||||
|
||||
interface IKeyPairView {
|
||||
classes: any;
|
||||
records: IKeyValue[];
|
||||
recordName: string;
|
||||
}
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
...tenantDetailsStyles,
|
||||
listHeight: {
|
||||
height: "50",
|
||||
},
|
||||
...containerForHeader,
|
||||
});
|
||||
|
||||
const KeyPairView = ({ classes, records, recordName }: IKeyPairView) => {
|
||||
return (
|
||||
<Fragment>
|
||||
<TableWrapper
|
||||
columns={[
|
||||
{ label: "Key", elementKey: "key" },
|
||||
{ label: "Value", elementKey: "value" },
|
||||
]}
|
||||
isLoading={false}
|
||||
records={records}
|
||||
itemActions={[]}
|
||||
entityName={recordName}
|
||||
idField="name"
|
||||
customPaperHeight={classes.listHeight}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
const mapState = (state: AppState) => ({
|
||||
loadingTenant: state.tenants.loadingTenant,
|
||||
selectedTenant: state.tenants.currentTenant,
|
||||
tenant: state.tenants.tenantInfo,
|
||||
logEnabled: get(state.tenants.tenantInfo, "logEnabled", false),
|
||||
monitoringEnabled: get(state.tenants.tenantInfo, "monitoringEnabled", false),
|
||||
encryptionEnabled: get(state.tenants.tenantInfo, "encryptionEnabled", false),
|
||||
minioTLS: get(state.tenants.tenantInfo, "minioTLS", false),
|
||||
consoleTLS: get(state.tenants.tenantInfo, "consoleTLS", false),
|
||||
consoleEnabled: get(state.tenants.tenantInfo, "consoleEnabled", false),
|
||||
adEnabled: get(state.tenants.tenantInfo, "idpAdEnabled", false),
|
||||
oidcEnabled: get(state.tenants.tenantInfo, "idpOidcEnabled", false),
|
||||
});
|
||||
|
||||
const connector = connect(mapState, null);
|
||||
|
||||
export default withStyles(styles)(connector(KeyPairView));
|
||||
@@ -1,57 +0,0 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2022 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 <http://www.gnu.org/licenses/>.
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { IEditMonitoringSecurityContext } from "./types";
|
||||
|
||||
const initialState: IEditMonitoringSecurityContext = {
|
||||
securityContextEnabled: false,
|
||||
runAsUser: "1000",
|
||||
runAsGroup: "1000",
|
||||
fsGroup: "1000",
|
||||
runAsNonRoot: true,
|
||||
};
|
||||
|
||||
export const editMonitoringSecurityContextSlice = createSlice({
|
||||
name: "editMonitoringSecurityContext",
|
||||
initialState,
|
||||
reducers: {
|
||||
setSecurityContextEnabled: (state, action: PayloadAction<boolean>) => {
|
||||
state.securityContextEnabled = action.payload;
|
||||
},
|
||||
setRunAsUser: (state, action: PayloadAction<string>) => {
|
||||
state.runAsUser = action.payload;
|
||||
},
|
||||
setRunAsGroup: (state, action: PayloadAction<string>) => {
|
||||
state.runAsGroup = action.payload;
|
||||
},
|
||||
setFSGroup: (state, action: PayloadAction<string>) => {
|
||||
state.fsGroup = action.payload;
|
||||
},
|
||||
setRunAsNonRoot: (state, action: PayloadAction<boolean>) => {
|
||||
state.runAsNonRoot = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
setSecurityContextEnabled,
|
||||
setRunAsUser,
|
||||
setRunAsGroup,
|
||||
setFSGroup,
|
||||
setRunAsNonRoot,
|
||||
} = editMonitoringSecurityContextSlice.actions;
|
||||
|
||||
export default editMonitoringSecurityContextSlice.reducer;
|
||||
@@ -1,62 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
import { SelectorTypes } from "../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
|
||||
|
||||
export type KVFieldType =
|
||||
| "string"
|
||||
| "number"
|
||||
| "on|off"
|
||||
| "enum"
|
||||
| "path"
|
||||
| "url"
|
||||
| "address"
|
||||
| "duration"
|
||||
| "uri"
|
||||
| "sentence"
|
||||
| "csv"
|
||||
| "comment"
|
||||
| "switch";
|
||||
|
||||
export interface KVField {
|
||||
name: string;
|
||||
label: string;
|
||||
tooltip: string;
|
||||
required?: boolean;
|
||||
type: KVFieldType;
|
||||
options?: SelectorTypes[];
|
||||
multiline?: boolean;
|
||||
placeholder?: string;
|
||||
withBorder?: boolean;
|
||||
}
|
||||
|
||||
export interface IConfigurationElement {
|
||||
configuration_id: string;
|
||||
configuration_label: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface IElementValue {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface IElement {
|
||||
configuration_id: string;
|
||||
configuration_label: string;
|
||||
icon?: any;
|
||||
disabled?: boolean;
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { DialogContentText } from "@mui/material";
|
||||
import { ErrorResponseHandler } from "../../../common/types";
|
||||
import useApi from "../Common/Hooks/useApi";
|
||||
import ConfirmDialog from "../Common/ModalWrapper/ConfirmDialog";
|
||||
import { ConfirmDeleteIcon } from "mds";
|
||||
import { IAM_PAGES } from "../../../common/SecureComponent/permissions";
|
||||
import { encodeURLString } from "../../../common/utils";
|
||||
import { setErrorSnackMessage } from "../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../store";
|
||||
|
||||
interface IDeleteUserStringProps {
|
||||
closeDeleteModalAndRefresh: (refresh: boolean) => void;
|
||||
deleteOpen: boolean;
|
||||
userName: string;
|
||||
}
|
||||
|
||||
const DeleteUserModal = ({
|
||||
closeDeleteModalAndRefresh,
|
||||
deleteOpen,
|
||||
userName,
|
||||
}: IDeleteUserStringProps) => {
|
||||
const dispatch = useAppDispatch();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const onDelSuccess = () => {
|
||||
navigate(IAM_PAGES.USERS);
|
||||
};
|
||||
const onDelError = (err: ErrorResponseHandler) =>
|
||||
dispatch(setErrorSnackMessage(err));
|
||||
const onClose = () => closeDeleteModalAndRefresh(false);
|
||||
|
||||
const [deleteLoading, invokeDeleteApi] = useApi(onDelSuccess, onDelError);
|
||||
|
||||
if (!userName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const onConfirmDelete = () => {
|
||||
invokeDeleteApi(
|
||||
"DELETE",
|
||||
`/api/v1/user/${encodeURLString(userName)}`,
|
||||
null
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<ConfirmDialog
|
||||
title={`Delete User`}
|
||||
confirmText={"Delete"}
|
||||
isOpen={deleteOpen}
|
||||
isLoading={deleteLoading}
|
||||
onConfirm={onConfirmDelete}
|
||||
onClose={onClose}
|
||||
titleIcon={<ConfirmDeleteIcon />}
|
||||
confirmationContent={
|
||||
<DialogContentText>
|
||||
Are you sure you want to delete user <br />
|
||||
<b>{userName}</b>?
|
||||
</DialogContentText>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeleteUserModal;
|
||||
@@ -1,130 +0,0 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2022 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 <http://www.gnu.org/licenses/>.
|
||||
import React from "react";
|
||||
import { Box } from "@mui/material";
|
||||
import {
|
||||
ChangeAccessPolicyIcon,
|
||||
GroupsIcon,
|
||||
HelpIconFilled,
|
||||
UsersIcon,
|
||||
} from "mds";
|
||||
|
||||
const FeatureItem = ({
|
||||
icon,
|
||||
description,
|
||||
}: {
|
||||
icon: any;
|
||||
description: string;
|
||||
}) => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
"& .min-icon": {
|
||||
marginRight: "10px",
|
||||
height: "23px",
|
||||
width: "23px",
|
||||
marginBottom: "10px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{icon}{" "}
|
||||
<div style={{ fontSize: "14px", fontStyle: "italic", color: "#5E5E5E" }}>
|
||||
{description}
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
const UsersHelpBox = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
flex: 1,
|
||||
border: "1px solid #eaeaea",
|
||||
borderRadius: "2px",
|
||||
display: "flex",
|
||||
flexFlow: "column",
|
||||
padding: "20px",
|
||||
marginTop: {
|
||||
xs: "0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
fontSize: "16px",
|
||||
fontWeight: 600,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
marginBottom: "16px",
|
||||
|
||||
"& .min-icon": {
|
||||
height: "21px",
|
||||
width: "21px",
|
||||
marginRight: "15px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<HelpIconFilled />
|
||||
<div>Learn more about the Users feature</div>
|
||||
</Box>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexFlow: "column",
|
||||
}}
|
||||
>
|
||||
<FeatureItem icon={<UsersIcon />} description={`Create Users`} />
|
||||
<Box sx={{ fontSize: "14px", marginBottom: "15px" }}>
|
||||
A MinIO user consists of a unique access key (username) and
|
||||
corresponding secret key (password). Clients must authenticate their
|
||||
identity by specifying both a valid access key (username) and the
|
||||
corresponding secret key (password) of an existing MinIO user.
|
||||
<br />
|
||||
</Box>
|
||||
<FeatureItem icon={<GroupsIcon />} description={`Manage Groups`} />
|
||||
<Box sx={{ fontSize: "14px", marginBottom: "15px" }}>
|
||||
Groups provide a simplified method for managing shared permissions
|
||||
among users with common access patterns and workloads.
|
||||
<br />
|
||||
<br />
|
||||
Users inherit access permissions to data and resources through the
|
||||
groups they belong to.
|
||||
<br />
|
||||
</Box>
|
||||
<FeatureItem
|
||||
icon={<ChangeAccessPolicyIcon />}
|
||||
description={`Assign Policies`}
|
||||
/>
|
||||
<Box sx={{ fontSize: "14px", marginBottom: "15px" }}>
|
||||
MinIO uses Policy-Based Access Control (PBAC) to define the authorized
|
||||
actions and resources to which an authenticated user has access. Each
|
||||
policy describes one or more actions and conditions that outline the
|
||||
permissions of a user or group of users.
|
||||
<br />
|
||||
<br />
|
||||
Each user can access only those resources and operations which are
|
||||
explicitly granted by the built-in role. MinIO denies access to any
|
||||
other resource or action by default.
|
||||
<br />
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default UsersHelpBox;
|
||||
Reference in New Issue
Block a user