diff --git a/src/Components/Inputs/Select/index.jsx b/src/Components/Inputs/Select/index.jsx index f0a1d11c0..2aa979434 100644 --- a/src/Components/Inputs/Select/index.jsx +++ b/src/Components/Inputs/Select/index.jsx @@ -18,6 +18,7 @@ import "./index.css"; * @param {string} props.items.name - The display name of each item. * @param {function} props.onChange - The function to handle onChange event. * @param {object} props.sx - The custom styles object for MUI Select component. + * @param {number} props.maxWidth - Maximum width in pixels for the select component. Enables responsive text truncation. * @returns {JSX.Element} * * @example @@ -50,6 +51,7 @@ const Select = ({ sx, name = "", labelControlSpacing = 2, + maxWidth, }) => { const theme = useTheme(); const itemStyles = { @@ -59,6 +61,13 @@ const Select = ({ margin: theme.spacing(2), }; + const responsiveMaxWidth = { + xs: `${maxWidth * 0.5}px`, + sm: `${maxWidth * 0.75}px`, + md: `${maxWidth * 0.9}px`, + lg: `${maxWidth}px`, + }; + return ( { + const selectedItem = items.find((item) => item._id === selected); + const displayName = selectedItem ? selectedItem.name : placeholder; + return ( + + {displayName} + + ); + }} > {placeholder && ( { } minTickGap={0} axisLine={false} diff --git a/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Bar/index.jsx b/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Bar/index.jsx index 6b013c29f..a6d3d455b 100644 --- a/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Bar/index.jsx +++ b/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Bar/index.jsx @@ -67,7 +67,7 @@ const DistributedUptimeResponseBarChart = ({ checks }) => { /> } minTickGap={0} axisLine={false} diff --git a/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Helpers/ToolTip.jsx b/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Helpers/ToolTip.jsx index db8cb3890..064678897 100644 --- a/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Helpers/ToolTip.jsx +++ b/src/Pages/DistributedUptime/Details/Components/DistributedUptimeResponseChart/Helpers/ToolTip.jsx @@ -75,7 +75,7 @@ CustomToolTip.propTypes = { PropTypes.shape({ value: PropTypes.number, payload: PropTypes.shape({ - _id: PropTypes.string, + _id: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), avgResponseTime: PropTypes.number, originalAvgResponseTime: PropTypes.number, }), diff --git a/src/Pages/DistributedUptime/Details/Components/StatBoxes/index.jsx b/src/Pages/DistributedUptime/Details/Components/StatBoxes/index.jsx index ffc8dbac8..0cdd3f01d 100644 --- a/src/Pages/DistributedUptime/Details/Components/StatBoxes/index.jsx +++ b/src/Pages/DistributedUptime/Details/Components/StatBoxes/index.jsx @@ -9,6 +9,11 @@ import PropTypes from "prop-types"; const StatBoxes = ({ monitor, lastUpdateTrigger }) => { const theme = useTheme(); + let timeSinceLastCheck = 0; + + if (monitor?.lastCheckTimestamp) { + timeSinceLastCheck = Date.now() - monitor?.lastCheckTimestamp; + } return ( { heading={"Last check"} subHeading={ } diff --git a/src/Pages/DistributedUptime/Details/index.jsx b/src/Pages/DistributedUptime/Details/index.jsx index 24c625c24..6e84240aa 100644 --- a/src/Pages/DistributedUptime/Details/index.jsx +++ b/src/Pages/DistributedUptime/Details/index.jsx @@ -75,7 +75,6 @@ const DistributedUptimeDetails = () => { ); } - return ( { const initialDataRes = await networkService.getDistributedUptimeMonitors({ teamId: user.teamId, limit: 25, - types: [ - typeof import.meta.env.VITE_DEPIN_TESTING === "undefined" - ? "distributed_http" - : "distributed_test", - ], + types: ["distributed_http"], page, rowsPerPage, }); diff --git a/src/Pages/DistributedUptimeStatus/Status/index.jsx b/src/Pages/DistributedUptimeStatus/Status/index.jsx index b2fb0780f..515bd9be5 100644 --- a/src/Pages/DistributedUptimeStatus/Status/index.jsx +++ b/src/Pages/DistributedUptimeStatus/Status/index.jsx @@ -254,7 +254,7 @@ const DistributedUptimeStatus = () => { />