add retention hint
This commit is contained in:
1 parent
840c936501
commit
248dad01d4
4 files changed
+38
-4
No files matched your search
@@ -5,13 +5,15 @@ interface IconProps {
|
|||||||
size?: number;
|
size?: number;
|
||||||
strokeWidth?: number;
|
strokeWidth?: number;
|
||||||
stroke?: string;
|
stroke?: string;
|
||||||
|
color?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Icon = ({ icon: Icon, size = 20, strokeWidth = 1.5 }: IconProps) => {
|
const Icon = ({ icon: Icon, size = 20, strokeWidth = 1.5, color }: IconProps) => {
|
||||||
return (
|
return (
|
||||||
<Icon
|
<Icon
|
||||||
size={size}
|
size={size}
|
||||||
strokeWidth={strokeWidth}
|
strokeWidth={strokeWidth}
|
||||||
|
color={color}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ const StatusPageView = () => {
|
|||||||
range={range}
|
range={range}
|
||||||
onRangeChange={onRangeChange}
|
onRangeChange={onRangeChange}
|
||||||
bucketTimezone={data.bucketTimezone ?? "Etc/UTC"}
|
bucketTimezone={data.bucketTimezone ?? "Etc/UTC"}
|
||||||
|
checkTTLDays={data.checkTTLDays}
|
||||||
/>
|
/>
|
||||||
</StatusPageThemeProvider>
|
</StatusPageThemeProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { useMemo, useState } from "react";
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import { useTranslation } from "react-i18next";
|
import Typography from "@mui/material/Typography";
|
||||||
|
import { TriangleAlert } from "lucide-react";
|
||||||
|
|
||||||
import type { SxProps, Theme } from "@mui/material/styles";
|
import type { SxProps, Theme } from "@mui/material/styles";
|
||||||
import type { Monitor } from "@/Types/Monitor";
|
import type { Monitor } from "@/Types/Monitor";
|
||||||
import type { StatusPage, StatusPageRange } from "@/Types/StatusPage";
|
import type { StatusPage, StatusPageRange } from "@/Types/StatusPage";
|
||||||
@@ -24,7 +25,6 @@ import {
|
|||||||
resolveOverallStatus,
|
resolveOverallStatus,
|
||||||
statusBadgeKey,
|
statusBadgeKey,
|
||||||
} from "@/Pages/StatusPage/Status/themes/shared/overallStatus";
|
} from "@/Pages/StatusPage/Status/themes/shared/overallStatus";
|
||||||
import { useStatusPageTheme } from "@/Pages/StatusPage/Status/themes/StatusPageThemeProvider";
|
|
||||||
import { formatPercentage } from "@/Utils/FormatUtils";
|
import { formatPercentage } from "@/Utils/FormatUtils";
|
||||||
import {
|
import {
|
||||||
checksToCells,
|
checksToCells,
|
||||||
@@ -32,6 +32,13 @@ import {
|
|||||||
type BarKind,
|
type BarKind,
|
||||||
type HeatCellKind,
|
type HeatCellKind,
|
||||||
} from "@/Pages/StatusPage/Status/themes/shared/ChartCells";
|
} from "@/Pages/StatusPage/Status/themes/shared/ChartCells";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
import { Icon } from "@/Components/design-elements";
|
||||||
|
|
||||||
|
import { useStatusPageTheme } from "@/Pages/StatusPage/Status/themes/StatusPageThemeProvider";
|
||||||
|
import { useMemo, useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useTheme } from "@mui/material";
|
||||||
|
|
||||||
type StatusPageMonitor = Monitor;
|
type StatusPageMonitor = Monitor;
|
||||||
|
|
||||||
@@ -89,6 +96,7 @@ interface Props {
|
|||||||
range: StatusPageRange;
|
range: StatusPageRange;
|
||||||
onRangeChange: (range: StatusPageRange) => void;
|
onRangeChange: (range: StatusPageRange) => void;
|
||||||
bucketTimezone: string;
|
bucketTimezone: string;
|
||||||
|
checkTTLDays?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BaseStatusPage = ({
|
export const BaseStatusPage = ({
|
||||||
@@ -98,7 +106,9 @@ export const BaseStatusPage = ({
|
|||||||
range,
|
range,
|
||||||
onRangeChange,
|
onRangeChange,
|
||||||
bucketTimezone,
|
bucketTimezone,
|
||||||
|
checkTTLDays,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { tokens, mode } = useStatusPageTheme();
|
const { tokens, mode } = useStatusPageTheme();
|
||||||
const styles = useMemo(
|
const styles = useMemo(
|
||||||
@@ -189,6 +199,25 @@ export const BaseStatusPage = ({
|
|||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
{range !== "latest" &&
|
||||||
|
checkTTLDays &&
|
||||||
|
STATUS_PAGE_RANGE_DAYS[range] > checkTTLDays && (
|
||||||
|
<Stack
|
||||||
|
mb={LAYOUT.XS}
|
||||||
|
alignSelf="flex-end"
|
||||||
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
|
gap={LAYOUT.XXS}
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
icon={TriangleAlert}
|
||||||
|
color={theme.palette.warning.main}
|
||||||
|
/>
|
||||||
|
<Typography>
|
||||||
|
{t("pages.statusPages.rangeExceedsRetention", { days: checkTTLDays })}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -1443,6 +1443,7 @@
|
|||||||
"statusPages": {
|
"statusPages": {
|
||||||
"deleteSuccess": "Status page deleted successfully",
|
"deleteSuccess": "Status page deleted successfully",
|
||||||
"rangeSelectorAria": "History range",
|
"rangeSelectorAria": "History range",
|
||||||
|
"rangeExceedsRetention": "Check history retention is set to {{days}} days. Increase retention for more data.",
|
||||||
"range": {
|
"range": {
|
||||||
"latest": "Latest",
|
"latest": "Latest",
|
||||||
"30d": "30 days",
|
"30d": "30 days",
|
||||||
@@ -1471,6 +1472,7 @@
|
|||||||
"max": "max {{value}}",
|
"max": "max {{value}}",
|
||||||
"downTooltip": "Down",
|
"downTooltip": "Down",
|
||||||
"heatmapAria": "Response time heatmap",
|
"heatmapAria": "Response time heatmap",
|
||||||
|
"dayAria": "{{date}}, {{uptime}} uptime",
|
||||||
"dayUptime": "Uptime: {{uptime}} ({{upChecks}}/{{totalChecks}} checks)",
|
"dayUptime": "Uptime: {{uptime}} ({{upChecks}}/{{totalChecks}} checks)",
|
||||||
"dayAvgResponse": "Avg response: {{value}}"
|
"dayAvgResponse": "Avg response: {{value}}"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user