diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx index f7dc896ae..a6f6daaf3 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx @@ -18,7 +18,6 @@ import React, { Fragment } from "react"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import clsx from "clsx"; import Grid from "@material-ui/core/Grid"; -import Paper from "@material-ui/core/Paper"; import Typography from "@material-ui/core/Typography"; import { Usage } from "../types"; import { niceBytes } from "../../../../common/utils"; @@ -31,69 +30,10 @@ import { StorageIcon, TotalObjectsIcon, } from "../../../../icons"; +import { Card, CardHeader } from "@material-ui/core"; const styles = (theme: Theme) => createStyles({ - paper: { - padding: theme.spacing(2), - display: "flex", - overflow: "auto", - flexDirection: "column", - border: "#eaedee 1px solid", - borderRadius: 5, - boxShadow: "none", - marginBottom: 15, - }, - fixedHeight: { - height: 165, - minWidth: 247, - marginRight: 20, - padding: "25px 28px", - "& svg:not(.computerIcon)": { - maxHeight: 18, - }, - }, - serversContainer: { - height: "auto", - overflow: "hidden" as const, - }, - drivesContainer: { - overflow: "flex", - }, - infoHeight: { - height: 180, - minWidth: 247, - marginRight: 20, - padding: "25px 28px", - "& svg": { - maxHeight: 18, - }, - }, - consumptionValue: { - color: "#000000", - fontSize: "60px", - fontWeight: "bold", - }, - endpoint: { - color: "#000000", - fontSize: "20px", - fontWeight: "bold", - }, - infoValue: { - fontWeight: 500, - color: "#777777", - fontSize: 14, - marginTop: 9, - }, - icon: { - marginRight: 10, - color: "#777777", - }, - notationContainer: { - display: "flex", - flexWrap: "wrap", - marginTop: 20, - }, dashboardBG: { width: 390, height: 255, @@ -106,27 +46,11 @@ const styles = (theme: Theme) => bottom: 0, backgroundRepeat: "no-repeat", }, - elementTitle: { - fontWeight: 500, - color: "#777777", - fontSize: 14, - marginTop: -9, - }, - smallUnit: { - fontSize: 20, - }, - serversListContainer: { - overflowY: "auto", - height: 200, - width: "100%", - }, + cardsContainer: { - display: "flex", - flexWrap: "wrap", - justifyContent: "center", - }, - serversAdj: { - maxWidth: 1380, + maxHeight: 440, + overflowY: "auto", + overflowX: "hidden", }, }); @@ -136,12 +60,6 @@ interface IDashboardProps { } const BasicDashboard = ({ classes, usage }: IDashboardProps) => { - const fixedHeightPaper = clsx(classes.paper, classes.fixedHeight); - const expandedServersPaperContainer = clsx( - classes.paper, - classes.serversContainer - ); - const prettyUsage = (usage: string | undefined) => { if (usage === undefined) { return "0"; @@ -190,101 +108,77 @@ const BasicDashboard = ({ classes, usage }: IDashboardProps) => { return (
- - - - - - - - - - - All buckets - - - - - {usage ? prettyNumber(usage.buckets) : 0} - - - - - - - - - - Usage - - - - - {usage ? prettyUsage(usage.usage + "") : 0} - - - - - - - - - - {" "} - Total Objects - - - - - {usage ? prettyNumber(usage.objects) : 0} - - + + + + + + } + title="Number of Buckets" + subheader={usage ? prettyNumber(usage.buckets) : 0} + /> + + + + + } + title="Usage" + subheader={usage ? prettyUsage(usage.usage + "") : 0} + /> + + + + + } + title="Total Objects" + subheader={usage ? prettyNumber(usage.objects) : 0} + /> + + + - - -
- - - - - - - {" "} - Servers - - - -
-
-
- {serverArray.map((server, index) => ( - - ))} -
-
-
- - - + + + + + + + Drives Status + + + + {serverArray.map((server, index) => + server.drives.map((drive) => ( + + - - - {" "} - Drives - - - -
-
- {serverArray.map((server, index) => - server.drives.map((drive) => ) - )} -
-
+ )) + )} +
+
+
+ + + + + + + Servers Status + + + + {serverArray.map((server, index) => ( + + + + ))}
diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/DriveInfoCard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/DriveInfoCard.tsx index 573c8fec0..4fba8cd61 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/DriveInfoCard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/DriveInfoCard.tsx @@ -14,45 +14,21 @@ // 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 React, { Fragment } from "react"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; -import ComputerIcon from "@material-ui/icons/Computer"; -import HealIcon from "../../../../icons/HealIcon"; import Grid from "@material-ui/core/Grid"; -import Paper from "@material-ui/core/Paper"; import { IDriveInfo } from "../types"; import { niceBytes } from "../../../../common/utils"; -import { Tooltip } from "@material-ui/core"; -import HelpIcon from "../../../../icons/HelpIcon"; +import { Card, CardHeader } from "@material-ui/core"; +import { CircleIcon, StorageIcon } from "../../../../icons"; const styles = (theme: Theme) => createStyles({ - serverCard: { - padding: 15, - margin: 8, - width: "100%", - maxWidth: 620, - "& .computerIcon": { - marginRight: 10, - }, - }, - titleContainer: { - display: "flex", - }, cardIconContainer: { display: "flex", position: "relative", alignItems: "center", }, - endpoint: { - color: "#000000", - fontSize: 20, - fontWeight: "bold", - position: "relative" as const, - textOverflow: "ellipsis", - whiteSpace: "nowrap", - overflow: "hidden", - }, stateContainer: { display: "flex", flexWrap: "wrap", @@ -85,7 +61,11 @@ const styles = (theme: Theme) => fontSize: 10, left: 18, height: 10, - bottom: 5, + bottom: 2, + "& .MuiSvgIcon-root": { + width: 10, + height: 10, + }, }, innerState: { fontSize: 10, @@ -94,6 +74,11 @@ const styles = (theme: Theme) => alignItems: "center", marginTop: -3, }, + cardHeader: { + "& .MuiCardHeader-title": { + fontWeight: "bolder", + }, + }, }); interface ICardProps { @@ -115,42 +100,41 @@ const DriveInfoCard = ({ classes, drive }: ICardProps) => { }; return ( - - - -
+ + + - +
{drive.state && ( - + + + )}
-
{" "} - -
{drive.endpoint}
-
- - {drive.healing && } - {drive.rootDisk && } - -
- - - - Total Space:{" "} - {niceBytes(drive.totalSpace.toString())} - - - Used Space: {niceBytes(drive.usedSpace.toString())} - - - Available Space:{" "} - {niceBytes(drive.availableSpace.toString())} - - - - + + } + title={drive.endpoint} + subheader={ + + + Capacity:{" "} + {niceBytes(drive.totalSpace.toString())} + + + Used: {niceBytes(drive.usedSpace.toString())} + + + Available:{" "} + {niceBytes(drive.availableSpace.toString())} + + + } + /> + +
); }; diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx index 5cf53b433..b980d35ba 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx @@ -18,40 +18,18 @@ import React from "react"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import ComputerIcon from "@material-ui/icons/Computer"; import Grid from "@material-ui/core/Grid"; -import Paper from "@material-ui/core/Paper"; import { ServerInfo } from "../types"; import { niceDays } from "../../../../common/utils"; -import { Tooltip } from "@material-ui/core"; +import { Card, CardHeader } from "@material-ui/core"; import { CircleIcon } from "../../../../icons"; const styles = (theme: Theme) => createStyles({ - serverCard: { - padding: 15, - margin: 8, - width: "100%", - maxWidth: 620, - "& .computerIcon": { - marginRight: 10, - }, - }, - titleContainer: { - display: "flex", - }, cardIconContainer: { display: "flex", position: "relative", alignItems: "center", }, - endpoint: { - color: "#000000", - fontSize: 20, - fontWeight: "bold", - position: "relative" as const, - textOverflow: "ellipsis", - whiteSpace: "nowrap", - overflow: "hidden", - }, stateContainer: { display: "flex", flexWrap: "wrap", @@ -101,6 +79,11 @@ const styles = (theme: Theme) => alignItems: "center", marginTop: -3, }, + cardHeader: { + "& .MuiCardHeader-title": { + fontWeight: "bolder", + }, + }, }); interface ICardProps { @@ -139,59 +122,55 @@ const ServerInfoCard = ({ classes, server }: ICardProps) => { ).length; return ( - - - -
-
- -
- {server.state && ( - - - - )} -
-
{" "} - -
{server.endpoint}
-
+ + + +
+ {server.state && ( + + + + )} +
-
- Version: {server.version} -
-
- - - Drives: {activeDisks}/{totalDrives}{" "} - - + } + title={server.endpoint} + subheader={ + + + Drives: {activeDisks}/{totalDrives}{" "} + + + - - - Network: {activeNetwork}/{networkTotal}{" "} - - + + Network: {activeNetwork}/{networkTotal}{" "} + + + - - - Uptime: {niceDays(server.uptime)} - - -
-
+ + Uptime: {niceDays(server.uptime)} + + + } + /> + ); };