diff --git a/Client/src/Components/Animated/PulseDot.jsx b/Client/src/Components/Animated/PulseDot.jsx index 1b196426a..38e956b50 100644 --- a/Client/src/Components/Animated/PulseDot.jsx +++ b/Client/src/Components/Animated/PulseDot.jsx @@ -23,8 +23,8 @@ const PulseDot = ({ color }) => { justifyContent="center" > { + const theme = useTheme(); + const [animate, setAnimate] = useState(false); + + useEffect(() => { + setAnimate(true); + }); + + // set responseTime to average if there's only one check + if (checks.length === 1) { + checks[0] = { ...checks[0], responseTime: 50 }; + } + + if (checks.length !== 25) { + const placeholders = Array(25 - checks.length).fill("placeholder"); + checks = [...checks, ...placeholders]; + } + + return ( + event.stopPropagation()} + sx={{ + cursor: "default", + }} + > + {checks.map((check, index) => + check === "placeholder" ? ( + + ) : ( + + + {formatDate(new Date(check.createdAt), { year: undefined })} + + + + + + Response Time + + + {check.originalResponseTime} + + {" "} + ms + + + + + + } + placement="top" + key={`check-${check?._id}`} + slotProps={{ + popper: { + className: "bar-tooltip", + modifiers: [ + { + name: "offset", + options: { + offset: [0, -10], + }, + }, + ], + }, + }} + > + .MuiBox-root": { + filter: "brightness(0.8)", + }, + }} + > + + + + ) + )} + + ); +}; + +export default BarChart; diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 120973d1e..ae6507b69 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -427,7 +427,7 @@ function Sidebar() { onClick={() => item.path === "support" ? window.open( - "https://github.com/bluewave-labs/bluewave-uptime", + "https://github.com/bluewave-labs/bluewave-uptime/issues", "_blank", "noreferrer" ) diff --git a/Client/src/Pages/Monitors/index.jsx b/Client/src/Pages/Monitors/index.jsx index 3b81efa0f..9eef7ec3a 100644 --- a/Client/src/Pages/Monitors/index.jsx +++ b/Client/src/Pages/Monitors/index.jsx @@ -10,11 +10,9 @@ import Button from "../../Components/Button"; import ServerStatus from "../../Components/Charts/Servers/ServerStatus"; import { useTheme } from "@emotion/react"; import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded"; -import OpenInNewPage from "../../assets/icons/open-in-new-page.svg?react"; import BasicTable from "../../Components/BasicTable"; import { StatusLabel } from "../../Components/Label"; import { createToast } from "../../Utils/toastUtils"; -import ResponseTimeChart from "../../Components/Charts/ResponseTimeChart"; import { Box, IconButton, @@ -28,6 +26,7 @@ import { import Settings from "../../assets/icons/settings-bold.svg?react"; import PropTypes from "prop-types"; +import BarChart from "../../Components/Charts/BarChart"; const ActionsMenu = ({ monitor }) => { const [anchorEl, setAnchorEl] = useState(null); @@ -206,7 +205,6 @@ ActionsMenu.propTypes = { * * @component * @param {Object} params - An object containing the following properties: - * @param {string} params.url - The URL of the host. * @param {string} params.title - The name of the host. * @param {string} params.percentageColor - The color of the percentage text. * @param {number} params.percentage - The percentage to display. @@ -214,40 +212,17 @@ ActionsMenu.propTypes = { */ const Host = ({ params }) => { return ( - - { - event.stopPropagation(); - window.open(params.url, "_blank", "noreferrer"); - }} - sx={{ - "&:focus": { - outline: "none", - }, - mr: "5px", - }} - > - - - - {params.title} - - {params.percentage}% - - + + {params.title} + + {params.percentage}% + ); }; Host.propTypes = { params: PropTypes.shape({ - url: PropTypes.string, title: PropTypes.string, percentageColor: PropTypes.string, percentage: PropTypes.number, @@ -326,7 +301,6 @@ const Monitors = () => { data.rows = monitorState.monitors.map((monitor, idx) => { const params = { - url: monitor.url, title: monitor.name, percentage: 100, percentageColor: @@ -357,7 +331,7 @@ const Monitors = () => { /> ), }, - { id: idx + 2, data: }, + { id: idx + 2, data: }, { id: idx + 3, data: ( diff --git a/Client/src/Utils/timeUtils.js b/Client/src/Utils/timeUtils.js index f7742dbaf..2d1a2f180 100644 --- a/Client/src/Utils/timeUtils.js +++ b/Client/src/Utils/timeUtils.js @@ -43,7 +43,7 @@ export const formatDurationRounded = (ms) => { return time; }; -export const formatDate = (date) => { +export const formatDate = (date, customOptions) => { const options = { year: "numeric", month: "long", @@ -51,6 +51,7 @@ export const formatDate = (date) => { hour: "numeric", minute: "numeric", hour12: true, + ...customOptions }; // Return the date using the specified options diff --git a/Client/src/index.css b/Client/src/index.css index d62f4b48f..887d7da07 100644 --- a/Client/src/index.css +++ b/Client/src/index.css @@ -67,7 +67,7 @@ --env-var-width-2: 360px; --env-var-height-1: 100vh; - --env-var-height-2: 36px; + --env-var-height-2: 34px; --env-var-nav-bar-height: 70px; --env-var-side-bar-width: 250px;