From 347c6aba3b473af280f1898104fedc590b420ac7 Mon Sep 17 00:00:00 2001 From: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com> Date: Sun, 28 Nov 2021 07:22:06 +0000 Subject: [PATCH] Ux Tools screens (#1261) Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> --- .../DateTimePickerWrapper.tsx | 3 + .../FormComponents/common/styleLibrary.ts | 36 ++ portal-ui/src/screens/Console/Heal/Heal.tsx | 213 +++---- .../screens/Console/HealthInfo/HealthInfo.tsx | 13 +- .../Console/Logs/ErrorLogs/ErrorLogs.tsx | 51 +- .../Console/Logs/LogSearch/LogsSearchMain.tsx | 454 +++++++-------- .../screens/Console/Speedtest/Speedtest.tsx | 44 +- .../Console/Tools/ToolsPanel/ToolsList.tsx | 5 +- portal-ui/src/screens/Console/Trace/Trace.tsx | 521 ++++++++++-------- portal-ui/src/screens/Console/Watch/Watch.tsx | 92 ++-- 10 files changed, 737 insertions(+), 695 deletions(-) diff --git a/portal-ui/src/screens/Console/Common/FormComponents/DateTimePickerWrapper/DateTimePickerWrapper.tsx b/portal-ui/src/screens/Console/Common/FormComponents/DateTimePickerWrapper/DateTimePickerWrapper.tsx index bddca57cd..0e518d896 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/DateTimePickerWrapper/DateTimePickerWrapper.tsx +++ b/portal-ui/src/screens/Console/Common/FormComponents/DateTimePickerWrapper/DateTimePickerWrapper.tsx @@ -95,6 +95,9 @@ const styles = (theme: Theme) => fontWeight: "bold", color: "#081C42", }, + "@media (max-width: 900px)": { + width: 103, + }, }, dateSelectorFormOverride: { width: "100%", 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 5f0801fb9..cff7c5b7f 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts +++ b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts @@ -1166,3 +1166,39 @@ export const deleteDialogStyles = { }, }, }; + +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)", + }, +}; diff --git a/portal-ui/src/screens/Console/Heal/Heal.tsx b/portal-ui/src/screens/Console/Heal/Heal.tsx index 9e4b3472d..4251e8e1c 100644 --- a/portal-ui/src/screens/Console/Heal/Heal.tsx +++ b/portal-ui/src/screens/Console/Heal/Heal.tsx @@ -46,6 +46,7 @@ import CheckboxWrapper from "../Common/FormComponents/CheckboxWrapper/CheckboxWr import PageHeader from "../Common/PageHeader/PageHeader"; import api from "../../../common/api"; import BackLink from "../../../common/BackLink"; +import PageLayout from "../Common/Layout/PageLayout"; const styles = (theme: Theme) => createStyles({ @@ -69,6 +70,7 @@ const styles = (theme: Theme) => border: "#EAEDEE 1px solid", borderRadius: 3, padding: "19px 38px", + marginTop: 15, }, scanInfo: { marginTop: 20, @@ -79,8 +81,31 @@ const styles = (theme: Theme) => scanData: { fontSize: 13, }, + noMinWidthLabel: { + fontWeight: 400, + }, + formBox: { + padding: 15, + border: "1px solid #EAEAEA", + }, + buttonBar: { + display: "flex", + alignItems: "center", + justifyContent: "flex-end", + }, + bucketField: { + flex: 1, + }, + prefixField: { + ...searchField.searchField, + marginLeft: 10, + flex: 1, + }, + actionsTray: { + ...actionsTray.actionsTray, + marginBottom: 0, + }, ...inlineCheckboxes, - ...actionsTray, ...searchField, ...containerForHeader(theme.spacing(4)), }); @@ -93,7 +118,6 @@ interface IHeal { const SelectStyled = withStyles((theme: Theme) => createStyles({ root: { - width: 450, lineHeight: "50px", marginRight: 15, "label + &": { @@ -107,7 +131,6 @@ const SelectStyled = withStyles((theme: Theme) => height: 50, fontSize: 13, lineHeight: "50px", - width: 450, }, }) )(InputBase); @@ -248,97 +271,99 @@ const Heal = ({ classes, distributedSetup }: IHeal) => { return ( - - - - - - - { + setBucketName(e.target.value as string); + }} + className={classes.searchField} + input={} + displayEmpty + > + + Select Bucket - ))} - - - { - setPrefix(e.target.value); - }} - variant="standard" - /> - - - - { - setRecursive(e.target.checked); - }} - disabled={false} - label="Recursive" - /> - { - setForceStart(e.target.checked); - }} - disabled={false} - label="Force Start" - /> - { - setForceStop(e.target.checked); - }} - disabled={false} - label="Force Stop" - /> - - -
+ {bucketNames.map((option) => ( + + {option.label} + + ))} + + + { + setPrefix(e.target.value); + }} + variant="standard" + /> +
+ + { + setRecursive(e.target.checked); + }} + disabled={false} + label="Recursive" + /> + { + setForceStart(e.target.checked); + }} + disabled={false} + label="Force Start" + /> + { + setForceStop(e.target.checked); + }} + disabled={false} + label="Force Stop" + /> + + + +
{ - +
); }; diff --git a/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx b/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx index 02a1e52a4..1a31b6423 100644 --- a/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx +++ b/portal-ui/src/screens/Console/HealthInfo/HealthInfo.tsx @@ -47,6 +47,7 @@ import { setServerDiagStat, setSnackBarMessage } from "../../../actions"; import CircularProgress from "@mui/material/CircularProgress"; import BackLink from "../../../common/BackLink"; import TestWrapper from "../Common/TestWrapper/TestWrapper"; +import PageLayout from "../Common/Layout/PageLayout"; const styles = (theme: Theme) => createStyles({ @@ -133,7 +134,7 @@ const HealthInfo = ({ const [diagStarted, setDiagStarted] = useState(false); const [downloadDisabled, setDownloadDisabled] = useState(true); const [localMessage, setMessage] = useState(""); - const [title, setTitle] = useState("Start new Diagnostic"); + const [title, setTitle] = useState("New Diagnostic"); useEffect(() => { if (serverDiagnosticStatus === DiagStatInProgress) { @@ -242,11 +243,9 @@ const HealthInfo = ({ return ( + - - - - + @@ -306,7 +305,7 @@ const HealthInfo = ({ disabled={startDiagnostic} onClick={() => setStartDiagnostic(true)} > - Start new Diagnostic + Start New Diagnostic @@ -316,7 +315,7 @@ const HealthInfo = ({ - + ); }; diff --git a/portal-ui/src/screens/Console/Logs/ErrorLogs/ErrorLogs.tsx b/portal-ui/src/screens/Console/Logs/ErrorLogs/ErrorLogs.tsx index 3b6a0fe06..ce60d5fc0 100644 --- a/portal-ui/src/screens/Console/Logs/ErrorLogs/ErrorLogs.tsx +++ b/portal-ui/src/screens/Console/Logs/ErrorLogs/ErrorLogs.tsx @@ -20,8 +20,6 @@ import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; import { connect } from "react-redux"; import { Grid } from "@mui/material"; -import TextField from "@mui/material/TextField"; -import InputAdornment from "@mui/material/InputAdornment"; import moment from "moment/moment"; import { AppState } from "../../../../store"; import { logMessageReceived, logResetMessages } from "../actions"; @@ -34,19 +32,20 @@ import { logsCommon, searchField, } from "../../Common/FormComponents/common/styleLibrary"; -import SearchIcon from "../../../../icons/SearchIcon"; import PageHeader from "../../Common/PageHeader/PageHeader"; import BackLink from "../../../../common/BackLink"; +import PageLayout from "../../Common/Layout/PageLayout"; +import SearchBox from "../../Common/SearchBox"; const styles = (theme: Theme) => createStyles({ logList: { background: "#fff", minHeight: 400, - height: "calc(100vh - 304px)", + height: "calc(100vh - 280px)", overflow: "auto", fontSize: 13, - padding: "25px 45px 0", + padding: "15px 15px 0", border: "1px solid #EAEDEE", borderRadius: 4, }, @@ -330,41 +329,17 @@ const ErrorLogs = ({ return ( - - - - - - - - { - setHighlight(val.target.value); - }} - InputProps={{ - disableUnderline: true, - startAdornment: ( - - - - ), - }} - variant="standard" - /> - - -
-
- -
{renderLines}
-
+ + + + + + + +
{renderLines}
-
+
); }; diff --git a/portal-ui/src/screens/Console/Logs/LogSearch/LogsSearchMain.tsx b/portal-ui/src/screens/Console/Logs/LogSearch/LogsSearchMain.tsx index 42fe92688..ed29cb113 100644 --- a/portal-ui/src/screens/Console/Logs/LogSearch/LogsSearchMain.tsx +++ b/portal-ui/src/screens/Console/Logs/LogSearch/LogsSearchMain.tsx @@ -21,13 +21,11 @@ import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; import { Button, Grid } from "@mui/material"; -import { ArrowDropUp } from "@mui/icons-material"; -import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; import { - actionsTray, + advancedFilterToggleStyles, containerForHeader, logsCommon, - searchField, + tableStyles, } from "../../Common/FormComponents/common/styleLibrary"; import { IReqInfoSearchResults, ISearchResponse } from "./types"; import { niceBytes, nsToSeconds } from "../../../../common/utils"; @@ -42,6 +40,8 @@ import { LogSearchColumnLabels } from "./utils"; import DateRangeSelector from "../../Common/FormComponents/DateRangeSelector/DateRangeSelector"; import PageHeader from "../../Common/PageHeader/PageHeader"; import BackLink from "../../../../common/BackLink"; +import PageLayout from "../../Common/Layout/PageLayout"; +import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; interface ILogSearchProps { classes: any; @@ -51,45 +51,20 @@ interface ILogSearchProps { const styles = (theme: Theme) => createStyles({ - inputBar: { - flexGrow: 1, - marginLeft: 15, - }, - advancedLabel: { - display: "flex", - alignItems: "center", - color: "#091C42", - border: 0, - backgroundColor: "transparent", - cursor: "pointer", - "&:focus, &:active": { - outline: "none", - }, - }, - advancedLabelContainer: { - marginTop: 10, - }, - getInformationContainer: { - textAlign: "right", - }, - orderButton: { - width: 93, - }, - recordsLabel: { - alignSelf: "center", - marginLeft: 15, - }, blockCollapsed: { - height: 0, + display: "none", overflowY: "hidden", - transitionDuration: "0.3s", }, filterOpen: { - height: 200, + display: "block", marginBottom: 12, }, endLineAction: { marginBottom: 15, + padding: "0 15px 0 15px", + display: "flex", + alignItems: "center", + justifyContent: "flex-end", }, filtersContainer: { display: "flex", @@ -98,10 +73,6 @@ const styles = (theme: Theme) => }, innerContainer: { backgroundColor: "#fff", - border: "#EAEDEE 1px solid", - borderRadius: 3, - padding: 10, - marginBottom: 15, }, noticeLabel: { marginLeft: 15, @@ -111,18 +82,56 @@ const styles = (theme: Theme) => }, tableFOpen: { - height: "calc(100vh - 561px)", + height: "calc(100vh - 520px)", }, tableFClosed: { - height: "calc(100vh - 349px)", + height: "calc(100vh - 320px)", }, - "@global": { - ".overrideMargin": { - marginLeft: 0, + ...tableStyles, + ...advancedFilterToggleStyles, + + buttonKit: { + "& div": { + height: 35, + }, + "& .MuiOutlinedInput-notchedOutline": { + border: 0, + height: 28, + color: "#000000", }, }, - ...searchField, - ...actionsTray, + searchOptions: { + display: "flex", + padding: 15, + "@media (max-width: 900px)": { + flexFlow: "column", + }, + }, + selectorLabel: { + "& + div": { + "@media (max-width: 900px)": { + width: 110, + }, + }, + "@media (max-width: 900px)": { + marginLeft: 5, + }, + }, + formBox: { + border: "1px solid #EAEAEA", + marginBottom: 15, + }, + dateRangePicker: { + "& div": { + marginBottom: 0, + }, + }, + advancedButton: { + display: "flex", + alignItems: "center", + justifyContent: "flex-start", + }, + advancedFilterOptions: {}, ...logsCommon, ...containerForHeader(theme.spacing(4)), }); @@ -289,103 +298,107 @@ const LogsSearchMain = ({ )} - - - - - - - - - -
-
-
- Enable your preferred options to get filtered records. -
- You can use '*' to match any character, '.' to signify a - single character or '\' to scape an special character (E.g. - mybucket-*) -
-
- - - -
-
- - - -
-
+ + + + +
+
-
- -
+ + + + + +
+
+ Enable your preferred options to get filtered records. +
+ You can use '*' to match any character, '.' to signify a single + character or '\' to scape an special character (E.g. mybucket-*) +
+
+ + + +
+
+ + + +
+
+ - )} - {traceStarted && ( - - )} + variant="standard" + /> + { + setMethod(e.target.value); + }} + disabled={traceStarted} + variant="standard" + /> + { + setFunc(e.target.value); + }} + variant="standard" + /> + { + setPath(e.target.value); + }} + variant="standard" + /> + { + setThreshold(parseInt(e.target.value)); + }} + variant="standard" + /> + + +
Calls to trace:
+
+ { + setAll(item.target.checked); + }} + value={"all"} + disabled={traceStarted} + /> + { + setS3(item.target.checked); + }} + value={"s3"} + disabled={all || traceStarted} + /> + { + setInternal(item.target.checked); + }} + value={"internal"} + disabled={all || traceStarted} + /> + { + setStorage(item.target.checked); + }} + value={"storage"} + disabled={all || traceStarted} + /> + { + setOS(item.target.checked); + }} + value={"os"} + disabled={all || traceStarted} + /> + +       |       + +
+ { + setErrors(item.target.checked); + }} + value={"only_errors"} + disabled={traceStarted} + /> +
+ + {!traceStarted && ( + + )} + {traceStarted && ( + + )} + - -
-
- - { - const timeParse = new Date(time); - return timeFromDate(timeParse); + + { + const timeParse = new Date(time); + return timeFromDate(timeParse); + }, + globalClass: classes.timeItem, }, - globalClass: classes.timeItem, - }, - { label: "Name", elementKey: "api" }, - { - label: "Status", - elementKey: "", - renderFunction: (fullElement: TraceMessage) => - `${fullElement.statusCode} ${fullElement.statusMsg}`, - renderFullObject: true, - }, - { - label: "Location", - elementKey: "configuration_id", - renderFunction: (fullElement: TraceMessage) => - `${fullElement.host} ${fullElement.client}`, - renderFullObject: true, - }, - { - label: "Load Time", - elementKey: "callStats.duration", - globalClass: classes.timeItem, - }, - { - label: "Upload", - elementKey: "callStats.rx", - renderFunction: niceBytes, - globalClass: classes.sizeItem, - }, - { - label: "Download", - elementKey: "callStats.tx", - renderFunction: niceBytes, - globalClass: classes.sizeItem, - }, - ]} - isLoading={false} - records={messages} - entityName="Traces" - idField="api" - customEmptyMessage={ - traceStarted - ? "No Traced elements received yet" - : "Trace is not started yet" - } - customPaperHeight={classes.tableWrapper} - autoScrollToBottom - /> - + { label: "Name", elementKey: "api" }, + { + label: "Status", + elementKey: "", + renderFunction: (fullElement: TraceMessage) => + `${fullElement.statusCode} ${fullElement.statusMsg}`, + renderFullObject: true, + }, + { + label: "Location", + elementKey: "configuration_id", + renderFunction: (fullElement: TraceMessage) => + `${fullElement.host} ${fullElement.client}`, + renderFullObject: true, + }, + { + label: "Load Time", + elementKey: "callStats.duration", + globalClass: classes.timeItem, + }, + { + label: "Upload", + elementKey: "callStats.rx", + renderFunction: niceBytes, + globalClass: classes.sizeItem, + }, + { + label: "Download", + elementKey: "callStats.tx", + renderFunction: niceBytes, + globalClass: classes.sizeItem, + }, + ]} + isLoading={false} + records={messages} + entityName="Traces" + idField="api" + customEmptyMessage={ + traceStarted + ? "No Traced elements received yet" + : "Trace is not started yet" + } + customPaperHeight={classes.tableWrapper} + autoScrollToBottom + /> + + ); }; diff --git a/portal-ui/src/screens/Console/Watch/Watch.tsx b/portal-ui/src/screens/Console/Watch/Watch.tsx index 7eeda7f78..b6fa65d48 100644 --- a/portal-ui/src/screens/Console/Watch/Watch.tsx +++ b/portal-ui/src/screens/Console/Watch/Watch.tsx @@ -37,34 +37,29 @@ import { actionsTray, containerForHeader, searchField, + tableStyles, } from "../Common/FormComponents/common/styleLibrary"; import { ErrorResponseHandler } from "../../../common/types"; import TableWrapper from "../Common/TableWrapper/TableWrapper"; import PageHeader from "../Common/PageHeader/PageHeader"; import api from "../../../common/api"; import BackLink from "../../../common/BackLink"; +import PageLayout from "../Common/Layout/PageLayout"; const styles = (theme: Theme) => createStyles({ - watchList: { - background: "white", - height: "400px", - overflow: "auto", - "& ul": { - margin: "4px", - padding: "0px", - }, - "& ul li": { - listStyle: "none", - margin: "0px", - padding: "0px", - borderBottom: "1px solid #dedede", - }, - }, searchPrefix: { flexGrow: 1, marginLeft: 15, }, + watchTableHeight: { + height: "calc(100vh - 270px)", + }, + bucketField: { + flexGrow: 2, + minWidth: 200, + }, + ...tableStyles, ...actionsTray, ...searchField, ...containerForHeader(theme.spacing(4)), @@ -73,7 +68,6 @@ const styles = (theme: Theme) => const SelectStyled = withStyles((theme: Theme) => createStyles({ root: { - width: 450, lineHeight: "50px", "label + &": { marginTop: theme.spacing(3), @@ -86,7 +80,6 @@ const SelectStyled = withStyles((theme: Theme) => height: 50, fontSize: 13, lineHeight: "50px", - width: 450, }, }) )(InputBase); @@ -191,13 +184,11 @@ const Watch = ({ return ( - - - - + + - +