import { useTheme } from "@emotion/react"; import { Box, Stack, styled, Typography } from "@mui/material"; import Button from "../../Components/Button"; import ButtonSpinner from "../../Components/ButtonSpinner"; import Field from "../../Components/Inputs/Field"; import Link from "../../Components/Link"; import Select from "../../Components/Inputs/Select"; import { logger } from "../../Utils/Logger"; import "./index.css"; import { useDispatch, useSelector } from "react-redux"; import { createToast } from "../../Utils/toastUtils"; import { deleteMonitorChecksByTeamId } from "../../Features/UptimeMonitors/uptimeMonitorsSlice"; import PropTypes from "prop-types"; const Settings = ({ isAdmin }) => { const theme = useTheme(); const { user, authToken } = useSelector((state) => state.auth); const { isLoading } = useSelector((state) => state.uptimeMonitors); const dispatch = useDispatch(); const handleClearStats = async () => { try { const action = await dispatch( deleteMonitorChecksByTeamId({ teamId: user.teamId, authToken }) ); if (deleteMonitorChecksByTeamId.fulfilled.match(action)) { createToast({ body: "Stats cleared successfully" }); } else { createToast({ body: "Failed to clear stats" }); } } catch (error) { logger.error(error); createToast({ body: "Failed to clear stats" }); } }; const ConfigBox = styled("div")({ display: "flex", flexDirection: "row", justifyContent: "space-between", gap: theme.spacing(20), paddingTop: theme.spacing(12), paddingInline: theme.spacing(15), paddingBottom: theme.spacing(25), backgroundColor: theme.palette.background.main, border: 1, borderStyle: "solid", borderColor: theme.palette.border.light, borderRadius: theme.spacing(2), "& > div:first-of-type": { flex: 0.7, }, "& > div:last-of-type": { flex: 1, }, "& h1, & h2": { color: theme.palette.text.secondary, }, "& p": { color: theme.palette.text.tertiary, }, }); return ( General Settings Display timezone- The timezone of the dashboard you publicly display. Server timezone- The timezone of your server. logger.warn("disabled")} items={[{ _id: "est", name: "America / Toronto" }]} /> {isAdmin && ( History and monitoring Define here for how long you want to keep the data. You can also remove all past data. logger.warn("Disabled")} /> Clear all stats. This is irreversible. )} About BlueWave Uptime v1.0.0 Developed by Bluewave Labs.