diff --git a/Client/src/Components/Animated/PulseDot.jsx b/Client/src/Components/Animated/PulseDot.jsx new file mode 100644 index 000000000..1b196426a --- /dev/null +++ b/Client/src/Components/Animated/PulseDot.jsx @@ -0,0 +1,62 @@ +import PropTypes from "prop-types"; +import { Box, Stack } from "@mui/material"; + +/** + * A component that renders a pulsating dot with a specified color. + * + * @component + * @example + * // Example usage: + * + * + * @param {Object} props + * @param {string} props.color - The color of the dot. + * @returns {JSX.Element} The PulseDot component. + */ + +const PulseDot = ({ color }) => { + return ( + + + + ); +}; + +PulseDot.propTypes = { + color: PropTypes.string.isRequired, +}; + +export default PulseDot; diff --git a/Client/src/Pages/Monitors/Configure/index.jsx b/Client/src/Pages/Monitors/Configure/index.jsx index 6b809433d..bd2a26df0 100644 --- a/Client/src/Pages/Monitors/Configure/index.jsx +++ b/Client/src/Pages/Monitors/Configure/index.jsx @@ -2,24 +2,23 @@ import { useNavigate, useParams } from "react-router"; import { useTheme } from "@emotion/react"; import { useDispatch, useSelector } from "react-redux"; import { useEffect, useState } from "react"; -import Button from "../../../Components/Button"; -import Field from "../../../Components/Inputs/Field"; import { Box, Modal, Skeleton, Stack, Typography } from "@mui/material"; -import GreenCheck from "../../../assets/icons/checkbox-green.svg?react"; -import RedCheck from "../../../assets/icons/checkbox-red.svg?react"; -import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline"; import { monitorValidation } from "../../../Validation/validation"; -import Select from "../../../Components/Inputs/Select"; import { createToast } from "../../../Utils/toastUtils"; +import { logger } from "../../../Utils/Logger"; import { updateUptimeMonitor, getUptimeMonitorsByUserId, deleteUptimeMonitor, } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice"; +import Button from "../../../Components/Button"; +import Field from "../../../Components/Inputs/Field"; +import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline"; +import Select from "../../../Components/Inputs/Select"; import Checkbox from "../../../Components/Inputs/Checkbox"; import Breadcrumbs from "../../../Components/Breadcrumbs"; +import PulseDot from "../../../Components/Animated/PulseDot"; import "./index.css"; -import { logger } from "../../../Utils/Logger"; /** * Parses a URL string and returns a URL object. @@ -229,8 +228,14 @@ const Configure = () => { gap={theme.gap.large} flex={1} > - - {monitor?.status ? : } + + {parsedUrl?.host ? ( diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Monitors/Details/index.jsx index b636444bd..ddc594602 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Monitors/Details/index.jsx @@ -4,20 +4,19 @@ import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material"; import { useSelector } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; import { networkService } from "../../../main"; +import { logger } from "../../../Utils/Logger"; +import { + formatDuration, + formatDurationRounded, +} from "../../../Utils/timeUtils"; import MonitorDetailsAreaChart from "../../../Components/Charts/MonitorDetailsAreaChart"; import ButtonGroup from "@mui/material/ButtonGroup"; import Button from "../../../Components/Button"; -import GreenCheck from "../../../assets/icons/checkbox-green.svg?react"; -import RedCheck from "../../../assets/icons/checkbox-red.svg?react"; import SettingsIcon from "../../../assets/icons/settings-bold.svg?react"; import PaginationTable from "./PaginationTable"; -import { - formatDuration, - formatDurationRounded, -} from "../../../Utils/timeUtils"; -import "./index.css"; import Breadcrumbs from "../../../Components/Breadcrumbs"; -import { logger } from "../../../Utils/Logger"; +import PulseDot from "../../../Components/Animated/PulseDot"; +import "./index.css"; const StatBox = ({ title, value }) => { return ( @@ -171,8 +170,14 @@ const DetailsPage = () => { ]} /> - - {monitor?.status ? : } + + {monitor.url?.replace(/^https?:\/\//, "") || "..."} diff --git a/Client/src/Pages/PageSpeed/Configure/index.jsx b/Client/src/Pages/PageSpeed/Configure/index.jsx index bc759db17..83484de7e 100644 --- a/Client/src/Pages/PageSpeed/Configure/index.jsx +++ b/Client/src/Pages/PageSpeed/Configure/index.jsx @@ -10,15 +10,14 @@ import { } from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice"; import { monitorValidation } from "../../../Validation/validation"; import { createToast } from "../../../Utils/toastUtils"; +import { logger } from "../../../Utils/Logger"; import Button from "../../../Components/Button"; import Field from "../../../Components/Inputs/Field"; import Select from "../../../Components/Inputs/Select"; import Checkbox from "../../../Components/Inputs/Checkbox"; import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline"; -import GreenCheck from "../../../assets/icons/checkbox-green.svg?react"; -import RedCheck from "../../../assets/icons/checkbox-red.svg?react"; import Breadcrumbs from "../../../Components/Breadcrumbs"; -import { logger } from "../../../Utils/Logger"; +import PulseDot from "../../../Components/Animated/PulseDot"; import "./index.css"; @@ -168,8 +167,14 @@ const PageSpeedConfigure = () => { flex={1} gap={theme.gap.large} > - - {monitor?.status ? : } + + { const theme = useTheme(); @@ -325,8 +324,14 @@ const PageSpeedDetails = () => { { name: "details", path: `/pagespeed/${monitorId}` }, ]} /> - - {monitor?.status ? : } + +