diff --git a/Client/package-lock.json b/Client/package-lock.json index bca3d0ed7..89a508703 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -18,7 +18,7 @@ "@mui/x-data-grid": "7.3.2", "@mui/x-date-pickers": "7.3.2", "@reduxjs/toolkit": "2.2.5", - "axios": "^1.3.1", + "axios": "1.7.4", "chart.js": "^4.4.3", "dayjs": "1.11.11", "joi": "17.13.1", @@ -29,7 +29,7 @@ "react-router": "^6.23.0", "react-router-dom": "^6.23.1", "react-toastify": "^10.0.5", - "recharts": "2.12.7", + "recharts": "2.13.0-alpha.4", "redux-persist": "6.0.0", "vite-plugin-svgr": "^4.2.0" }, @@ -2655,9 +2655,9 @@ } }, "node_modules/axios": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.1.tgz", - "integrity": "sha512-78pWJsQTceInlyaeBQeYZ/QgZeWS8hGeKiIJiDKQe3hEyBb7sEMq0K4gjx+Va6WHTYO4zI/RRl8qGRzn0YMadA==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.0", @@ -5509,15 +5509,15 @@ } }, "node_modules/recharts": { - "version": "2.12.7", - "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.12.7.tgz", - "integrity": "sha512-hlLJMhPQfv4/3NBSAyq3gzGg4h2v69RJh6KU7b3pXYNNAELs9kEoXOjbkxdXpALqKBoVmVptGfLpxdaVYqjmXQ==", + "version": "2.13.0-alpha.4", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.13.0-alpha.4.tgz", + "integrity": "sha512-K9naL6F7pEcDYJE6yFQASSCQecSLPP0JagnvQ9hPtA/aHgsxsnIOjouLP5yrFZehxzfCkV5TEORr7/uNtSr7Qw==", "license": "MIT", "dependencies": { "clsx": "^2.0.0", "eventemitter3": "^4.0.1", "lodash": "^4.17.21", - "react-is": "^16.10.2", + "react-is": "^18.3.1", "react-smooth": "^4.0.0", "recharts-scale": "^0.4.4", "tiny-invariant": "^1.3.1", @@ -5540,12 +5540,6 @@ "decimal.js-light": "^2.4.1" } }, - "node_modules/recharts/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/redux": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", diff --git a/Client/package.json b/Client/package.json index 18d202519..42167d0b0 100644 --- a/Client/package.json +++ b/Client/package.json @@ -21,6 +21,7 @@ "@mui/x-date-pickers": "7.3.2", "@reduxjs/toolkit": "2.2.5", "axios": "^1.3.1", + "axios": "1.7.4", "chart.js": "^4.4.3", "dayjs": "1.11.11", "joi": "17.13.1", @@ -31,7 +32,7 @@ "react-router": "^6.23.0", "react-router-dom": "^6.23.1", "react-toastify": "^10.0.5", - "recharts": "2.12.7", + "recharts": "2.13.0-alpha.4", "redux-persist": "6.0.0", "vite-plugin-svgr": "^4.2.0" }, diff --git a/Client/src/Components/BasicTable/index.css b/Client/src/Components/BasicTable/index.css index fd1f75b53..14adc440c 100644 --- a/Client/src/Components/BasicTable/index.css +++ b/Client/src/Components/BasicTable/index.css @@ -72,7 +72,7 @@ } .MuiPaper-root + .MuiPagination-root { - margin-top: 35px; + margin-top: 24px; border: solid 1px var(--env-var-color-16); border-radius: var(--env-var-radius-1); padding: var(--env-var-spacing-1-plus) var(--env-var-spacing-2); diff --git a/Client/src/Components/Charts/MonitorDetails60MinChart/index.jsx b/Client/src/Components/Charts/MonitorDetails60MinChart/index.jsx new file mode 100644 index 000000000..f7fc0d3d8 --- /dev/null +++ b/Client/src/Components/Charts/MonitorDetails60MinChart/index.jsx @@ -0,0 +1,50 @@ +import { BarChart, Bar, Cell, ReferenceLine, Label } from "recharts"; + +import PropTypes from "prop-types"; + +const MonitorDetails60MinChart = ({ data }) => { + const labelStyle = { + fontSize: "10px", + fill: "#475467", + }; + + const color = { + true: "var(--env-var-color-23)", + false: "var(--env-var-color-24)", + undefined: "var(--env-var-color-33)", + }; + return ( + + + {data.map((check, index) => ( + + ))} + + + + + + + + + ); +}; + +MonitorDetails60MinChart.propTypes = { + data: PropTypes.array.isRequired, +}; + +export default MonitorDetails60MinChart; diff --git a/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx b/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx index 91657f542..c37e467f6 100644 --- a/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx +++ b/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx @@ -28,15 +28,6 @@ const CustomToolTip = ({ active, payload, label }) => { }; const MonitorDetailsAreaChart = ({ checks }) => { - // SQUASH ERROR, NOT PERMANENT SOLUTION - const error = console.error; - console.error = (...args) => { - if (/defaultProps/.test(args[0])) return; - error(...args); - }; - - // END SQUASH ERROR, NOT PERMANENT SOLUTION - const formatDate = (timestamp) => { const date = new Date(timestamp); return date.toLocaleTimeString("en-US", { diff --git a/Client/src/Pages/Monitors/Details/index.css b/Client/src/Pages/Monitors/Details/index.css index 359a002bc..127b7377a 100644 --- a/Client/src/Pages/Monitors/Details/index.css +++ b/Client/src/Pages/Monitors/Details/index.css @@ -3,12 +3,10 @@ color: var(--env-var-color-1); font-weight: 600; } -.monitor-details h2.MuiTypography-root, -.monitor-details h6.MuiTypography-root { +.monitor-details h2.MuiTypography-root { font-size: var(--env-var-font-size-large); } -.monitor-details h2.MuiTypography-root, -.monitor-details h4.MuiTypography-root { +.monitor-details h2.MuiTypography-root{ font-weight: 600; } .monitor-details h2.MuiTypography-root, @@ -35,15 +33,21 @@ } .monitor-details .stat-box { - flex: 1; + flex: 1 20%; min-width: 100px; border: solid 1px; border-radius: var(--env-var-radius-1); - padding: var(--env-var-spacing-1) 18px; + padding: var(--env-var-spacing-1) 16px; background-color: var(--env-var-color-8); } -.monitor-details .stat-box h6.MuiTypography-root { - margin-bottom: var(--env-var-spacing-1); +.monitor-details h6.MuiTypography-root { + font-size: var(--env-var-font-size-medium-plus); +} +.monitor-details h6.MuiTypography-root span.MuiTypography-root { + font-style: italic; + font-size: var(--env-var-font-size-medium); + color: var(--env-var-color-5); + opacity: 0.7; } .monitor-details button.MuiButtonBase-root, .monitor-details .stat-box { diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Monitors/Details/index.jsx index 5f3ddf9fc..15cfd2c82 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Monitors/Details/index.jsx @@ -17,20 +17,23 @@ import { formatDurationRounded, } from "../../../Utils/timeUtils"; import "./index.css"; +import MonitorDetails60MinChart from "../../../Components/Charts/MonitorDetails60MinChart"; const StatBox = ({ title, value }) => { return ( - + {title} - {value} + + {value} + ); }; StatBox.propTypes = { - title: PropTypes.string, + title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; @@ -162,12 +165,12 @@ const DetailsPage = () => { <>