This commit is contained in:
Alex Holliday committed 2025-12-11 12:50:30 -08:00
1 parent b94e6052c3
commit 64d1ba08f9
23 files changed
+1657 -170

No files matched your search

@@ -4,6 +4,7 @@ import Typography from "@mui/material/Typography";
import { Gauge } from "lucide-react";
import { Cell, RadialBarChart, RadialBar, ResponsiveContainer } from "recharts";
import { useTranslation } from "react-i18next";
import { getResponseTimeColor } from "@/utils/MonitorUtils";
import { useTheme } from "@mui/material/styles";
@@ -14,6 +15,7 @@ export const ChartAvgResponse = ({
avg: number;
max: number;
}) => {
const { t } = useTranslation();
const theme = useTheme();
const chartData = [
{ name: "max", value: max - avg, color: "transparent" },
@@ -28,7 +30,10 @@ export const ChartAvgResponse = ({
};
return (
<BaseChart icon={<Gauge size={20} strokeWidth={1.5} />} title={"Average response time"}>
<BaseChart
icon={<Gauge size={20} strokeWidth={1.5} />}
title={t("common.charts.avgResponseTime.title")}
>
<Stack height="100%" position={"relative"} justifyContent={"flex-end"}>
<ResponsiveContainer width="100%" height={155}>
<RadialBarChart
@@ -49,8 +54,12 @@ export const ChartAvgResponse = ({
</RadialBarChart>
</ResponsiveContainer>
<Stack direction={"row"} justifyContent={"space-between"}>
<Typography variant="body2">Low</Typography>
<Typography variant="body2">High</Typography>
<Typography variant="body2">
{t("common.charts.avgResponseTime.lowLabel")}
</Typography>
<Typography variant="body2">
{t("common.charts.avgResponseTime.highLabel")}
</Typography>
</Stack>
<Stack
position="absolute"
@@ -51,7 +51,7 @@ export const HeaderControls = ({
await post(`/monitors/${monitor._id}/notifications/test`, {});
}}
>
{t("sendTestNotifications")}
{t("common.buttons.testNotification")}
</Button>
)}
<Button
@@ -60,7 +60,7 @@ export const HeaderControls = ({
navigate(`/incidents?monitorId=${monitor._id}`);
}}
>
{t("menu.incidents")}
{t("common.buttons.incidents")}
</Button>
<Button
loading={isPatching || isPosting}
@@ -76,7 +76,9 @@ export const HeaderControls = ({
)
}
>
{monitor?.status === "paused" ? t("resume") : t("pause")}
{monitor?.status === "paused"
? t("common.buttons.resume")
: t("common.buttons.pause")}
</Button>
<Button
startIcon={<Settings size={20} strokeWidth={1.5} />}
@@ -84,7 +86,7 @@ export const HeaderControls = ({
navigate(`${path}/${monitor._id}/configure`);
}}
>
{t("configure")}
{t("common.buttons.configure")}
</Button>
</ButtonGroup>
</Stack>
@@ -5,6 +5,7 @@ import Typography from "@mui/material/Typography";
import { Select, Checkbox, TextInput } from "@/components/inputs";
import { LoadingSpinner } from "@/components/design-elements";
import { useTranslation } from "react-i18next";
import { useEffect, useState } from "react";
import { useTheme } from "@mui/material/styles";
import type { SelectChangeEvent } from "@mui/material/Select";
@@ -42,6 +43,7 @@ export const HeaderFilter = ({
loading = false,
}: HeaderFilterProps) => {
const theme = useTheme();
const { t } = useTranslation();
const [localSearch, setLocalSearch] = useState<string>(searchString);
useEffect(() => {
@@ -68,7 +70,7 @@ export const HeaderFilter = ({
return (
<Stack spacing={theme.spacing(4)} direction={{ xs: "column", sm: "row" }}>
<Select
placeholder="Monitor type"
placeholder={t("monitors.uptime.filters.type.placeholder")}
multiple
value={selectedTypes}
onChange={handleTypeChange}
@@ -83,7 +85,7 @@ export const HeaderFilter = ({
))}
</Select>
<Select
placeholder="Monitor status"
placeholder={t("monitors.uptime.filters.status.placeholder")}
multiple
value={selectedStatuses}
onChange={handleStatusChange}
@@ -100,7 +102,7 @@ export const HeaderFilter = ({
<LoadingSpinner show={loading} sx={{ alignSelf: "center" }} />
<Box flex={1} display={{ xs: "none", md: "inherit" }} />
<TextInput
placeholder="Search monitors"
placeholder={t("monitors.uptime.filters.search.placeholder")}
value={localSearch}
onChange={(event) => {
setLocalSearch(event.target.value);
@@ -7,6 +7,7 @@ import { TrendingUp, AlertTriangle } from "lucide-react";
import type { GroupedCheck } from "@/types/check";
import type { MonitorStatus } from "@/types/monitor";
import { useTranslation } from "react-i18next";
import { normalizeResponseTimes } from "@/utils/DataUtils";
import { useState } from "react";
import { formatDateWithTz } from "@/utils/TimeUtils";
@@ -63,9 +64,15 @@ export const HistogramStatus = ({
range: string;
title: string;
}) => {
const { t } = useTranslation();
const uiTimezone = useAppSelector((state: any) => state.ui.timezone);
const icon = status === "up" ? <TrendingUp size={20} strokeWidth={1.5} /> : <AlertTriangle size={20} strokeWidth={1.5} />;
const icon =
status === "up" ? (
<TrendingUp size={20} strokeWidth={1.5} />
) : (
<AlertTriangle size={20} strokeWidth={1.5} />
);
const theme = useTheme();
const [idx, setIdx] = useState<number | null>(null);
const dateFormat = range === "1d" || range === "2h" ? "MMM D, h A" : "MMM D";
@@ -76,7 +83,9 @@ export const HistogramStatus = ({
<BaseChart icon={icon} title={title}>
<Stack height={"100%"} alignItems={"center"} justifyContent={"center"}>
<Typography variant="h2">
{status === "up" ? "No checks yet" : "Great, no downtime yet!"}
{status === "up"
? t("common.charts.uptime.emptyUp")
: t("common.charts.uptime.emptyDown")}
</Typography>
</Stack>
</BaseChart>