diff --git a/portal-ui/src/screens/Console/Common/TestWrapper/TestWrapper.tsx b/portal-ui/src/screens/Console/Common/TestWrapper/TestWrapper.tsx index e82ed1b87..4620b7d3e 100644 --- a/portal-ui/src/screens/Console/Common/TestWrapper/TestWrapper.tsx +++ b/portal-ui/src/screens/Console/Common/TestWrapper/TestWrapper.tsx @@ -15,120 +15,20 @@ // along with this program. If not, see . import React, { Fragment, useEffect, useState } from "react"; -import { Theme } from "@mui/material/styles"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; -import { Grid } from "@mui/material"; -import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; -import { DrivesIcon, Loader, VersionIcon } from "mds"; +import { DrivesIcon, Loader, SectionTitle, VersionIcon, Grid } from "mds"; import { api } from "api"; import { ServerProperties } from "api/consoleApi"; interface ITestWrapper { title: any; children: any; - classes: any; - advancedVisible: boolean; - advancedContent?: any; } -const styles = (theme: Theme) => - createStyles({ - titleBar: { - borderBottom: "#E5E5E5 1px solid", - padding: "30px 25px", - fontSize: 20, - color: "#07193E", - fontWeight: "bold", - borderRadius: "10px 10px 0px 0px", - paddingTop: 0, - }, - divisorContainer: { - padding: 25, - }, - serversData: { - color: "#07193E", - fontSize: 18, - display: "flex", - alignItems: "center", - "& svg": { - marginRight: 10, - }, - }, - minioVersionContainer: { - fontSize: 12, - color: "#07193E", - justifyContent: "center", - alignSelf: "center", - alignItems: "center", - display: "flex", - }, - versionIcon: { - color: "#07193E", - marginRight: 20, - }, - loaderAlign: { - textAlign: "center", - }, - advancedContainer: { - justifyContent: "flex-end", - display: "flex", - }, - optionsContainer: { - padding: 0, - marginBottom: 25, - }, - advancedConfiguration: { - color: "#2781B0", - fontSize: 10, - textDecoration: "underline", - border: "none", - backgroundColor: "transparent", - cursor: "pointer", - alignItems: "center", - display: "flex", - - "&:hover": { - color: "#07193E", - }, - - "& svg": { - width: 10, - alignSelf: "center", - marginLeft: 5, - }, - }, - advancedOpen: { - transform: "rotateZ(-90deg) translateX(-4px) translateY(2px)", - }, - advancedClosed: { - transform: "rotateZ(90deg)", - }, - advancedContent: { - backgroundColor: "#F5F7F9", - maxHeight: 0, - transitionDuration: "0.3s", - overflow: "hidden", - padding: "0 15px", - "&.open": { - maxHeight: 400, - padding: 15, - }, - }, - }); - -const TestWrapper = ({ - title, - children, - classes, - advancedVisible, - advancedContent, -}: ITestWrapper) => { +const TestWrapper = ({ title, children }: ITestWrapper) => { const [version, setVersion] = useState("N/A"); const [totalNodes, setTotalNodes] = useState(0); const [totalDrives, setTotalDrives] = useState(0); const [loading, setLoading] = useState(true); - const [advancedOpen, setAdvancedOpen] = useState(false); useEffect(() => { if (loading) { @@ -165,15 +65,37 @@ const TestWrapper = ({ return ( - - {title} - + {title} - - + + {!loading ? ( - + {totalNodes}  nodes,  {totalDrives}  drives @@ -182,53 +104,32 @@ const TestWrapper = ({ item xs={12} md={4} - className={classes.minioVersionContainer} + sx={{ + fontSize: 12, + justifyContent: "center", + alignSelf: "center", + alignItems: "center", + display: "flex", + }} > - + {" "} MinIO VERSION {version} - - {advancedVisible && ( - - )} - ) : ( - + )} - {advancedContent && ( - - {advancedContent} - - )} {children} @@ -236,4 +137,4 @@ const TestWrapper = ({ ); }; -export default withStyles(styles)(TestWrapper); +export default TestWrapper; diff --git a/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx b/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx index 8e2dea103..679217b2a 100644 --- a/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx +++ b/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx @@ -14,13 +14,11 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import React, { Fragment, useEffect, useState } from "react"; - import { ICloseEvent, IMessageEvent, w3cwebsocket as W3CWebSocket, } from "websocket"; -import { AppState, useAppDispatch } from "../../../store"; import { useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; import { Box, Button, Grid, HelpBox, InfoIcon, Loader, PageLayout } from "mds"; @@ -31,71 +29,25 @@ import { HealthInfoMessage, ReportMessage, } from "./types"; -import { Theme } from "@mui/material/styles"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; +import { AppState, useAppDispatch } from "../../../store"; import { WSCloseAbnormalClosure, WSCloseInternalServerErr, WSClosePolicyViolation, wsProtocol, } from "../../../utils/wsUtils"; -import { - actionsTray, - containerForHeader, -} from "../Common/FormComponents/common/styleLibrary"; - -import TestWrapper from "../Common/TestWrapper/TestWrapper"; import { setHelpName, setServerDiagStat } from "../../../systemSlice"; import { healthInfoMessageReceived, healthInfoResetMessage, } from "./healthInfoSlice"; +import { registeredCluster } from "../../../config"; +import TestWrapper from "../Common/TestWrapper/TestWrapper"; import RegisterCluster from "../Support/RegisterCluster"; import PageHeaderWrapper from "../Common/PageHeaderWrapper/PageHeaderWrapper"; -import { registeredCluster } from "../../../config"; import HelpMenu from "../HelpMenu"; -const styles = (theme: Theme) => - createStyles({ - loading: { - paddingTop: 8, - paddingLeft: 40, - }, - buttons: { - justifyContent: "flex-start", - gap: 20, - }, - localMessage: { - fontSize: 24, - color: "#07193E", - fontWeight: "bold", - textAlign: "center", - marginBottom: 20, - }, - progressResult: { - textAlign: "center", - marginBottom: 25, - }, - startDiagnostic: { - display: "flex", - justifyContent: "flex-end", - margin: 25, - marginBottom: 0, - }, - startDiagnosticCenter: { - textAlign: "center", - marginTop: 0, - }, - ...actionsTray, - ...containerForHeader, - }); - -interface IHealthInfo { - classes: any; -} - -const HealthInfo = ({ classes }: IHealthInfo) => { +const HealthInfo = () => { const dispatch = useAppDispatch(); const navigate = useNavigate(); @@ -266,21 +218,35 @@ const HealthInfo = ({ classes }: IHealthInfo) => { {!clusterRegistered && } - - - + + + -
{localMessage}
-
+

{localMessage}

+ {" "} {subnetResponse !== "" && !subnetResponse.toLowerCase().includes("error") && ( - + Health report uploaded to Subnet successfully! @@ -294,7 +260,7 @@ const HealthInfo = ({ classes }: IHealthInfo) => { {(subnetResponse === "" || subnetResponse.toLowerCase().includes("error")) && serverDiagnosticStatus === DiagStatSuccess && ( - + Something went wrong uploading your Health report to Subnet. @@ -307,11 +273,16 @@ const HealthInfo = ({ classes }: IHealthInfo) => { )} -
+
{serverDiagnosticStatus === DiagStatInProgress ? ( -
+ -
+ ) : ( {
-
+ {!startDiagnostic && clusterRegistered && (
@@ -373,4 +344,4 @@ const HealthInfo = ({ classes }: IHealthInfo) => { ); }; -export default withStyles(styles)(HealthInfo); +export default HealthInfo; diff --git a/portal-ui/src/screens/Console/Support/CallHome.tsx b/portal-ui/src/screens/Console/Support/CallHome.tsx index f8f499eb7..740a36066 100644 --- a/portal-ui/src/screens/Console/Support/CallHome.tsx +++ b/portal-ui/src/screens/Console/Support/CallHome.tsx @@ -15,8 +15,16 @@ // along with this program. If not, see . import React, { Fragment, useEffect, useState } from "react"; -import { Box } from "@mui/material"; -import { Button, CallHomeMenuIcon, HelpBox, Loader, PageLayout } from "mds"; +import { + Box, + Button, + CallHomeMenuIcon, + FormLayout, + HelpBox, + Loader, + PageLayout, + Switch, +} from "mds"; import { Link, useNavigate } from "react-router-dom"; import api from "../../../common/api"; import { ErrorResponseHandler } from "../../../common/types"; @@ -26,21 +34,9 @@ import { ICallHomeResponse } from "./types"; import { registeredCluster } from "../../../config"; import CallHomeConfirmation from "./CallHomeConfirmation"; import RegisterCluster from "./RegisterCluster"; -import FormSwitchWrapper from "../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper"; import PageHeaderWrapper from "../Common/PageHeaderWrapper/PageHeaderWrapper"; import HelpMenu from "../HelpMenu"; -const PromoLabels = ({ title, text }: { title: string; text: string }) => { - return ( -
-
{title}
-
- {text} -
-
- ); -}; - const CallHome = () => { const dispatch = useAppDispatch(); const navigate = useNavigate(); @@ -124,175 +120,13 @@ const CallHome = () => { } /> {!clusterRegistered && } - - - {loading ? ( - - - - ) : ( - -
- ) => { - setDiagEnabled(event.target.checked); - }} - label={"Daily Health Report"} - disabled={!clusterRegistered} - /> - -
-
- ) => { - setLogsEnabled(event.target.checked); - }} - label={"Live Error Logs"} - disabled={!clusterRegistered} - /> - -
- - {(oDiagEnabled || oLogsEnabled) && ( - - )} - - -
- )} -
- + } help={ - - - - - Learn more about Call Home - - { } /> - -
+ } + > + {loading ? ( + + + + ) : ( + + ) => { + setDiagEnabled(event.target.checked); + }} + label={"Daily Health Report"} + disabled={!clusterRegistered} + description={ + "Daily Health Report enables you to proactively identify potential issues in your deployment before they escalate." + } + /> + ) => { + setLogsEnabled(event.target.checked); + }} + label={"Live Error Logs"} + disabled={!clusterRegistered} + description={ + "Live Error Logs will enable MinIO's support team and automatic diagnostics system to catch failures early." + } + /> + + {(oDiagEnabled || oLogsEnabled) && ( + + )} + + + + )} +
); diff --git a/portal-ui/src/screens/Console/Support/Profile.tsx b/portal-ui/src/screens/Console/Support/Profile.tsx index 0246144a4..d719766bd 100644 --- a/portal-ui/src/screens/Console/Support/Profile.tsx +++ b/portal-ui/src/screens/Console/Support/Profile.tsx @@ -1,67 +1,34 @@ +// 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 . + import React, { Fragment, useEffect, useState } from "react"; import { IMessageEvent, w3cwebsocket as W3CWebSocket } from "websocket"; -import { Theme } from "@mui/material/styles"; -import { Button, PageLayout } from "mds"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; -import { Grid } from "@mui/material"; -import CheckboxWrapper from "../Common/FormComponents/CheckboxWrapper/CheckboxWrapper"; +import { Button, PageLayout, FormLayout, Box, Checkbox, InputLabel } from "mds"; import { wsProtocol } from "../../../utils/wsUtils"; -import { - actionsTray, - containerForHeader, - inlineCheckboxes, -} from "../Common/FormComponents/common/styleLibrary"; import { useNavigate } from "react-router-dom"; -import RegisterCluster from "./RegisterCluster"; import { registeredCluster } from "../../../config"; -import PageHeaderWrapper from "../Common/PageHeaderWrapper/PageHeaderWrapper"; -import HelpMenu from "../HelpMenu"; import { useAppDispatch } from "../../../store"; import { setHelpName } from "../../../systemSlice"; - -const styles = (theme: Theme) => - createStyles({ - buttonContainer: { - display: "flex", - justifyContent: "flex-end", - marginTop: 24, - "& button": { - marginLeft: 8, - }, - }, - dropdown: { - marginBottom: 24, - }, - checkboxLabel: { - marginTop: 12, - marginRight: 4, - fontSize: 16, - fontWeight: 500, - }, - checkboxDisabled: { - opacity: 0.5, - }, - inlineCheckboxes: { - ...inlineCheckboxes.inlineCheckboxes, - alignItems: "center", - - "@media (max-width: 900px)": { - flexFlow: "column", - alignItems: "flex-start", - }, - }, - ...actionsTray, - ...containerForHeader, - }); - -interface IProfileProps { - classes: any; -} +import RegisterCluster from "./RegisterCluster"; +import PageHeaderWrapper from "../Common/PageHeaderWrapper/PageHeaderWrapper"; +import HelpMenu from "../HelpMenu"; var c: any = null; -const Profile = ({ classes }: IProfileProps) => { +const Profile = () => { const navigate = useNavigate(); const [profilingStarted, setProfilingStarted] = useState(false); @@ -150,34 +117,39 @@ const Profile = ({ classes }: IProfileProps) => { return ( } /> - {!clusterRegistered && } - - - -
Types to profile:
- {typesList.map((t) => ( - -1} - disabled={profilingStarted} - key={`checkbox-${t.label}`} - id={`checkbox-${t.label}`} - label={t.label} - name={`checkbox-${t.label}`} - onChange={onCheckboxClick} - value={t.value} - /> - ))} -
-
- + + + Types to profile: + {typesList.map((t) => ( + -1} + disabled={profilingStarted} + key={`checkbox-${t.label}`} + id={`checkbox-${t.label}`} + label={t.label} + name={`checkbox-${t.label}`} + onChange={onCheckboxClick} + value={t.value} + /> + ))} + +