diff --git a/client/src/components/monitors/BarDockerCount.tsx b/client/src/components/monitors/BarDockerCount.tsx index b967661e0..91785698c 100644 --- a/client/src/components/monitors/BarDockerCount.tsx +++ b/client/src/components/monitors/BarDockerCount.tsx @@ -12,9 +12,11 @@ import { } from "recharts"; import { XTick } from "@/components/monitors/ChartResponseTime"; import { useTheme } from "@mui/material/styles"; +import useMediaQuery from "@mui/material/useMediaQuery"; import { BaseBox } from "@/components/design-elements"; import { useAppSelector } from "@/hooks/AppHooks"; import { formatDateWithTz, tooltipDateFormatLookup } from "@/utils/TimeUtils"; +import { useTranslation } from "react-i18next"; type Datum = Record & { _id: string | number }; @@ -33,11 +35,12 @@ export const BarDockerCount = ({ }) => { const theme = useTheme(); const hasData = Array.isArray(data) && data.length > 0; + const isSmall = useMediaQuery(theme.breakpoints.down("sm")); const uiTimezone = useAppSelector((state: any) => state.ui.timezone); + const { t } = useTranslation(); const CountTooltip = ({ active, payload, label }: any) => { if (!active || !payload || !label) return null; - console.log(JSON.stringify(payload, null, 2)); const fmt = tooltipDateFormatLookup(range); const value = payload?.[0]?.payload?.[dataKey] ?? 0; return ( @@ -45,20 +48,29 @@ export const BarDockerCount = ({ {formatDateWithTz(String(label), fmt, uiTimezone)} - Containers: {value} + + {t("monitors.docker.details.tooltips.containers", { value })} + ); }; return ( - + {!hasData ? ( {emptyText || "No data"} ) : ( - + } /> - + } cursor={false} /> diff --git a/client/src/components/monitors/Chart.tsx b/client/src/components/monitors/Chart.tsx index 33e3691da..a622ae0c2 100644 --- a/client/src/components/monitors/Chart.tsx +++ b/client/src/components/monitors/Chart.tsx @@ -2,6 +2,7 @@ import { BaseBox } from "../design-elements"; import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; +import type { ResponsiveStyleValue } from "@mui/system"; import { useTheme } from "@mui/material/styles"; @@ -10,6 +11,7 @@ type BaseChartProps = React.PropsWithChildren<{ title: string; width?: number | string; maxWidth?: number | string; + padding?: number | string | ResponsiveStyleValue; }>; export const BaseChart = ({ @@ -18,13 +20,13 @@ export const BaseChart = ({ title, width = "100%", maxWidth = "100%", + padding, }: BaseChartProps) => { const theme = useTheme(); - return ( { const theme = useTheme(); + const isSmall = useMediaQuery(theme.breakpoints.down("sm")); const hasData = Array.isArray(data) && data.length > 0; return ( - + {!hasData ? ( {emptyText || "No data"} ) : ( - - + + } /> - + { ))} - - - - + + + + + + + + + ); };