diff --git a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts index 798af2808..019a53b54 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts +++ b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts @@ -825,42 +825,6 @@ export const deleteDialogStyles: any = { }, }; -export const advancedFilterToggleStyles: any = { - advancedButton: { - flexGrow: 1, - alignItems: "flex-end", - display: "flex", - justifyContent: "flex-end", - }, - advancedConfiguration: { - color: "#2781B0", - fontSize: 10, - textDecoration: "underline", - border: "none", - backgroundColor: "transparent", - cursor: "pointer", - alignItems: "center", - display: "flex", - float: "right", - - "&:hover": { - color: "#07193E", - }, - - "& svg": { - width: 10, - alignSelf: "center", - marginLeft: 5, - }, - }, - advancedOpen: { - transform: "rotateZ(-90deg) translateX(-4px) translateY(2px)", - }, - advancedClosed: { - transform: "rotateZ(90deg)", - }, -}; - export const createTenantCommon: any = { fieldGroup: { border: "1px solid #EAEAEA", diff --git a/portal-ui/src/screens/Console/Common/ObjectManager/ObjectHandled.tsx b/portal-ui/src/screens/Console/Common/ObjectManager/ObjectHandled.tsx index 2b8597f96..100336e7e 100644 --- a/portal-ui/src/screens/Console/Common/ObjectManager/ObjectHandled.tsx +++ b/portal-ui/src/screens/Console/Common/ObjectManager/ObjectHandled.tsx @@ -249,15 +249,14 @@ const ObjectHandled = ({ error={objectToDisplay.failed} cancelled={objectToDisplay.cancelled} withLabel + notificationLabel={ + objectToDisplay.errorMessage !== "" + ? objectToDisplay.errorMessage + : "" + } /> )} - {objectToDisplay.errorMessage !== "" && ( -
- Error: - {objectToDisplay.errorMessage} -
- )} ); diff --git a/portal-ui/src/screens/Console/Common/ProgressBarWrapper/ProgressBarWrapper.tsx b/portal-ui/src/screens/Console/Common/ProgressBarWrapper/ProgressBarWrapper.tsx index 10da6dd5c..879a9f4d2 100644 --- a/portal-ui/src/screens/Console/Common/ProgressBarWrapper/ProgressBarWrapper.tsx +++ b/portal-ui/src/screens/Console/Common/ProgressBarWrapper/ProgressBarWrapper.tsx @@ -14,13 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React, { Fragment } from "react"; -import { styled } from "@mui/material/styles"; -import LinearProgress, { - linearProgressClasses, - LinearProgressProps, -} from "@mui/material/LinearProgress"; -import Box from "@mui/material/Box"; +import React from "react"; +import { ProgressBar, ProgressBarProps } from "mds"; interface IProgressBarWrapper { value: number; @@ -30,62 +25,28 @@ interface IProgressBarWrapper { size?: string; error?: boolean; cancelled?: boolean; + notificationLabel?: string; } -const BorderLinearProgress = styled(LinearProgress)(() => ({ - height: 10, - borderRadius: 5, - [`&.${linearProgressClasses.colorPrimary}`]: { - backgroundColor: "#f1f1f1", - }, - [`& .${linearProgressClasses.bar}`]: { - borderRadius: 5, - }, -})); -const SmallBorderLinearProgress = styled(BorderLinearProgress)(() => ({ - height: 6, - borderRadius: 3, - [`& .${linearProgressClasses.bar}`]: { - borderRadius: 3, - }, -})); - function LinearProgressWithLabel( - props: { error: boolean; cancelled: boolean } & LinearProgressProps, + props: { error: boolean; cancelled: boolean } & ProgressBarProps, ) { - let color = "#000"; - let size = 18; + let label = ""; if (props.error) { - color = "#C83B51"; - size = 14; + label = `Error: ${props.notificationLabel || ""}`; } else if (props.cancelled) { - color = "#FFBD62"; - size = 14; + label = `Cancelled`; } return ( - - - - - - {props.cancelled ? ( - "Cancelled" - ) : ( - - {props.error ? "Failed" : `${Math.round(props.value || 0)}%`} - - )} - - + ); } @@ -97,22 +58,24 @@ const ProgressBarWrapper = ({ size = "regular", error, cancelled, + notificationLabel, }: IProgressBarWrapper) => { let color: any; if (error) { - color = "error"; + color = "red"; } else if (cancelled) { - color = "warning"; + color = "orange"; } else if (value === 100 && ready) { - color = "success"; + color = "green"; } else { - color = "primary"; + color = "blue"; } - const propsComponent: LinearProgressProps = { + const propsComponent: ProgressBarProps = { variant: indeterminate && !ready && !cancelled ? "indeterminate" : "determinate", value: ready ? 100 : value, color: color, + notificationLabel: notificationLabel || "", }; if (withLabel) { return ( @@ -124,10 +87,12 @@ const ProgressBarWrapper = ({ ); } if (size === "small") { - return ; + return ( + + ); } - return ; + return ; }; export default ProgressBarWrapper; diff --git a/portal-ui/src/screens/Console/Speedtest/STResults.tsx b/portal-ui/src/screens/Console/Speedtest/STResults.tsx index f218b652a..a38f076df 100644 --- a/portal-ui/src/screens/Console/Speedtest/STResults.tsx +++ b/portal-ui/src/screens/Console/Speedtest/STResults.tsx @@ -16,7 +16,6 @@ import React, { Fragment, useState } from "react"; import get from "lodash/get"; -import { Theme } from "@mui/material/styles"; import { Button, ComputerLineIcon, @@ -26,116 +25,114 @@ import { StorageIcon, UploadStatIcon, VersionIcon, + Grid, + Box, } from "mds"; -import createStyles from "@mui/styles/createStyles"; -import { Grid } from "@mui/material"; import { IndvServerMetric, SpeedTestResponse, STServer } from "./types"; import { calculateBytes, prettyNumber } from "../../../common/utils"; -import CodeMirrorWrapper from "../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper"; import { Area, AreaChart, CartesianGrid, ResponsiveContainer } from "recharts"; import { cleanMetrics } from "./utils"; +import CodeMirrorWrapper from "../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper"; import SpeedTestUnit from "./SpeedTestUnit"; -import makeStyles from "@mui/styles/makeStyles"; +import styled from "styled-components"; -const useStyles = makeStyles((theme: Theme) => - createStyles({ - actionButtons: { - textAlign: "right", +const STResultsContainer = styled.div(({ theme }) => ({ + "& .actionButtons": { + textAlign: "right", + }, + "& .descriptorLabel": { + fontWeight: "bold", + fontSize: 14, + }, + "& .resultsContainer": { + backgroundColor: get(theme, "boxBackground", "#FBFAFA"), + borderTop: `${get(theme, "borderColor", "#E2E2E2")} 1px solid`, + marginTop: 30, + padding: 25, + }, + "& .resultsIcon": { + display: "flex", + alignItems: "center", + "& svg": { + fill: get(theme, `screenTitle.iconColor`, "#07193E"), }, - descriptorLabel: { - fontWeight: "bold", + }, + "& .detailedItem": { + display: "flex", + alignItems: "center", + justifyContent: "flex-start", + }, + "& .detailedVersion": { + display: "flex", + alignItems: "center", + justifyContent: "flex-end", + }, + "& .serversTable": { + width: "100%", + marginTop: 15, + "& thead > tr > th": { + textAlign: "left", + padding: 15, fontSize: 14, + fontWeight: "bold", }, - resultsContainer: { - backgroundColor: "#FBFAFA", - borderTop: "#F1F1F1 1px solid", - marginTop: 30, - padding: 25, - }, - resultsIcon: { - display: "flex", - alignItems: "center", - "& svg": { - fill: "#07193E", + "& tbody > tr": { + "&:last-of-type": { + "& > td": { + borderBottom: `${get(theme, "borderColor", "#E2E2E2")} 1px solid`, + }, }, - }, - detailedItem: { - display: "flex", - alignItems: "center", - justifyContent: "flex-start", - }, - detailedVersion: { - display: "flex", - alignItems: "center", - justifyContent: "flex-end", - }, - serversTable: { - width: "100%", - marginTop: 15, - "& thead > tr > th": { - textAlign: "left", + "& > td": { + borderTop: `${get(theme, "borderColor", "#E2E2E2")} 1px solid`, padding: 15, fontSize: 14, - fontWeight: "bold", - }, - "& tbody > tr": { + "&:first-of-type": { + borderLeft: `${get(theme, "borderColor", "#E2E2E2")} 1px solid`, + }, "&:last-of-type": { - "& > td": { - borderBottom: "#E2E2E2 1px solid", - }, - }, - "& > td": { - borderTop: "#E2E2E2 1px solid", - padding: 15, - fontSize: 14, - "&:first-of-type": { - borderLeft: "#E2E2E2 1px solid", - }, - "&:last-of-type": { - borderRight: "#E2E2E2 1px solid", - }, + borderRight: `${get(theme, "borderColor", "#E2E2E2")} 1px solid`, }, }, }, - serverIcon: { - width: 55, + }, + "& .serverIcon": { + width: 55, + }, + "& .serverValue": { + width: 140, + }, + "& .serverHost": { + maxWidth: 540, + overflow: "hidden", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + "& .tableOverflow": { + overflowX: "auto", + paddingBottom: 15, + }, + "& .objectGeneral": { + marginTop: 15, + }, + "& .download": { + "& .min-icon": { + width: 35, + height: 35, + color: get(theme, "signalColors.good", "#4CCB92"), }, - serverValue: { - width: 140, + }, + "& .upload": { + "& .min-icon": { + width: 35, + height: 35, + color: get(theme, "signalColors.info", "#2781B0"), }, - serverHost: { - maxWidth: 540, - overflow: "hidden", - textOverflow: "ellipsis", - whiteSpace: "nowrap", - }, - tableOverflow: { - overflowX: "auto", - paddingBottom: 15, - }, - objectGeneral: { - marginTop: 15, - }, - download: { - "& .min-icon": { - width: 35, - height: 35, - color: "rgb(113,200,150)", - }, - }, - upload: { - "& .min-icon": { - width: 35, - height: 35, - color: "rgb(66,127,172)", - }, - }, - versionIcon: { - color: "#07193E", - marginRight: 20, - }, - }), -); + }, + "& .versionIcon": { + color: get(theme, `screenTitle.iconColor`, "#07193E"), + marginRight: 20, + }, +})); interface ISTResults { results: SpeedTestResponse[]; @@ -143,8 +140,6 @@ interface ISTResults { } const STResults = ({ results, start }: ISTResults) => { - const classes = useStyles(); - const [jsonView, setJsonView] = useState(false); const finalRes = results[results.length - 1] || []; @@ -227,14 +222,14 @@ const STResults = ({ results, start }: ISTResults) => { const clnMetrics = cleanMetrics(results); return ( - - + + - + +
} @@ -246,7 +241,7 @@ const STResults = ({ results, start }: ISTResults) => { +
} @@ -305,7 +300,7 @@ const STResults = ({ results, start }: ISTResults) => { {clnMetrics.length > 1 && ( - + {start ? ( Preliminar Results: ) : ( @@ -314,7 +309,12 @@ const STResults = ({ results, start }: ISTResults) => { )}
- + {!start && (