strings
This commit is contained in:
1 parent
22f7d002fd
commit
c9dea5c0ae
23 files changed
+315
-131
No files matched your search
@@ -3,7 +3,7 @@ import Typography from "@mui/material/Typography";
|
||||
import { BaseBox } from "@/components/design-elements";
|
||||
import Box from "@mui/material/Box";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
export interface ResolutionCardProps {
|
||||
resolved: boolean;
|
||||
type?: string;
|
||||
@@ -21,6 +21,7 @@ export const ResolutionCard = ({
|
||||
timestampLabel,
|
||||
durationLabel,
|
||||
}: ResolutionCardProps) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const bg = resolved ? theme.palette.success.light : theme.palette.error.light;
|
||||
|
||||
@@ -35,12 +36,12 @@ export const ResolutionCard = ({
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6" color="textPrimary">
|
||||
Resolution
|
||||
{t("incidents.details.resolutionCard.title")}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Stack spacing={3} padding={6}>
|
||||
<Typography variant="body2" color="textPrimary">
|
||||
Status:{" "}
|
||||
{t("incidents.details.resolutionCard.resolutionStatus")}:{" "}
|
||||
<span style={{ color: bg }}>
|
||||
{resolved ? "resolved" : "unresolved"}
|
||||
</span>
|
||||
@@ -48,10 +49,11 @@ export const ResolutionCard = ({
|
||||
{resolved && (
|
||||
<>
|
||||
<Typography variant="body2" color="textPrimary">
|
||||
Resolution type: {type || "N/A"}
|
||||
{t("incidents.details.resolutionCard.resolutionType")}:{" "}
|
||||
{type || "N/A"}
|
||||
</Typography>
|
||||
<Typography variant="body2" color="textPrimary">
|
||||
Resolved by: {by || "N/A"}
|
||||
{t("incidents.details.resolutionCard.resolvedBy")}: {by || "N/A"}
|
||||
</Typography>
|
||||
</>
|
||||
)}
|
||||
@@ -64,7 +66,7 @@ export const ResolutionCard = ({
|
||||
</Typography>
|
||||
)}
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
Note: {note || "N/A"}
|
||||
{t("incidents.details.resolutionCard.note")}: {note || "N/A"}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</BaseBox>
|
||||
|
||||
@@ -375,7 +375,7 @@ const EmptyView = () => {
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
}}
|
||||
>
|
||||
<Typography>{t("monitors.common.table.empty")}</Typography>
|
||||
<Typography>{t("common.table.empty")}</Typography>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
@@ -25,7 +25,6 @@ export const CheckboxInput = forwardRef<HTMLInputElement, CheckboxInputProps>(
|
||||
icon={<Square size={16} strokeWidth={1.5} />}
|
||||
checkedIcon={<SquareCheck size={16} strokeWidth={1.5} />}
|
||||
sx={{
|
||||
padding: 0,
|
||||
color: theme.palette.text.secondary,
|
||||
"&.Mui-checked": {
|
||||
color: theme.palette.primary.main,
|
||||
|
||||
@@ -6,8 +6,10 @@ import { usePost } from "@/hooks/UseApi";
|
||||
import { useNavigate } from "react-router";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { Tooltip } from "@/components/design-elements";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export const LogoutSwitch = () => {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useAppDispatch();
|
||||
const { post } = usePost();
|
||||
const navigate = useNavigate();
|
||||
@@ -20,7 +22,7 @@ export const LogoutSwitch = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip title="Logout" placement="top">
|
||||
<Tooltip title={t("common.tooltips.logout")} placement="top">
|
||||
<IconButton
|
||||
onClick={handleClick}
|
||||
sx={{
|
||||
@@ -29,7 +31,7 @@ export const LogoutSwitch = () => {
|
||||
},
|
||||
"&:hover svg path, &:hover svg line, &:hover svg polyline, &:hover svg rect, &:hover svg circle":
|
||||
{
|
||||
stroke: theme.palette.primary.main,
|
||||
stroke: theme.palette.primary.main,
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useMemo, useState } from "react";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { Tooltip } from "@/components/design-elements";
|
||||
import { config } from "@/config/index";
|
||||
import { useTranslation } from "react-i18next";
|
||||
const DEPLOYMENT_MODE = config.DEPLOYMENT_MODE;
|
||||
const IS_SAAS = DEPLOYMENT_MODE === "saas";
|
||||
|
||||
@@ -18,6 +19,7 @@ export const SettingsSwitch = () => {
|
||||
const theme = useTheme();
|
||||
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
||||
const open = Boolean(anchorEl);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleOpen = (event: React.MouseEvent<HTMLElement>) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
@@ -69,7 +71,7 @@ export const SettingsSwitch = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="Settings" placement="top">
|
||||
<Tooltip title={t("common.tooltips.settings")} placement="top">
|
||||
<IconButton
|
||||
onClick={handleOpen}
|
||||
sx={{
|
||||
|
||||
@@ -13,8 +13,10 @@ import { useNavigate } from "react-router";
|
||||
import { useGet } from "@/hooks/UseApi";
|
||||
import type { ApiResponse } from "@/hooks/UseApi";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export const TeamSwitch = () => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useAppDispatch();
|
||||
const theme = useTheme();
|
||||
@@ -49,7 +51,7 @@ export const TeamSwitch = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="Teams" placement="top">
|
||||
<Tooltip title={t("common.tooltips.teams")} placement="top">
|
||||
<IconButton
|
||||
onClick={handleOpen}
|
||||
sx={{
|
||||
|
||||
@@ -17,7 +17,7 @@ export const ThemeSwitch = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip title={t("common.buttons.toggleTheme")} placement="top">
|
||||
<Tooltip title={t("common.tooltips.toggleTheme")} placement="top">
|
||||
<IconButton
|
||||
id="theme-toggle"
|
||||
onClick={handleChange}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Stack from "@mui/material/Stack";
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import Link from "@mui/material/Link";
|
||||
import { config } from "@/config/index";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import type { IStatusPageWithMonitors } from "@/types/status-page";
|
||||
const HOST = config.HOST;
|
||||
@@ -12,6 +13,7 @@ export const NameHeader = ({
|
||||
}: {
|
||||
statusPage: IStatusPageWithMonitors;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Stack direction={"row"} alignItems={"flex-end"} spacing={4}>
|
||||
<Typography variant="h1">{statusPage?.name}</Typography>
|
||||
@@ -25,7 +27,9 @@ export const NameHeader = ({
|
||||
sx={{ display: "inline-flex" }}
|
||||
>
|
||||
<Stack direction="row" alignItems="center" spacing={1}>
|
||||
<Typography>Public link</Typography>
|
||||
<Typography>
|
||||
{t("statusPage.details.nameHeader.publicLink")}
|
||||
</Typography>
|
||||
<ExternalLink size={16} strokeWidth={1.5} />
|
||||
</Stack>
|
||||
</Link>
|
||||
|
||||
@@ -4,6 +4,7 @@ import Stack from "@mui/material/Stack";
|
||||
import { getStatusPageHeaderConfig } from "@/utils/MonitorUtils";
|
||||
import type { IStatusPageWithMonitors } from "@/types/status-page";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export const StatusHeader = ({
|
||||
statusPage,
|
||||
@@ -11,7 +12,8 @@ export const StatusHeader = ({
|
||||
statusPage: IStatusPageWithMonitors;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
const headerConfig = getStatusPageHeaderConfig(statusPage?.monitors || []);
|
||||
const { t } = useTranslation();
|
||||
const headerConfig = getStatusPageHeaderConfig(statusPage?.monitors || [], t);
|
||||
|
||||
return (
|
||||
<Stack
|
||||
|
||||
+170
-23
@@ -1,6 +1,23 @@
|
||||
{
|
||||
"common": {
|
||||
"appName": "Checkmate",
|
||||
"table": {
|
||||
"headers": {
|
||||
"name": "Name",
|
||||
"status": "Status",
|
||||
"actions": "Actions",
|
||||
"type": "Type",
|
||||
"monitor": "Monitor",
|
||||
"active": "Active"
|
||||
},
|
||||
"empty": "No data"
|
||||
},
|
||||
"tooltips": {
|
||||
"teams": "Teams",
|
||||
"toggleTheme": "Toggle theme",
|
||||
"logout": "Logout",
|
||||
"settings": "Settings"
|
||||
},
|
||||
"buttons": {
|
||||
"incidents": "Incidents",
|
||||
"delete": "Delete",
|
||||
@@ -14,8 +31,8 @@
|
||||
"disable": "Disable",
|
||||
"configure": "Configure",
|
||||
"createNew": "Create new",
|
||||
"toggleTheme": "Toggle theme",
|
||||
"testNotification": "Send test notification",
|
||||
"resolve": "Resolve",
|
||||
"range": {
|
||||
"all": "All",
|
||||
"recent": "Recent",
|
||||
@@ -94,6 +111,9 @@
|
||||
"up": "up"
|
||||
},
|
||||
"stats": {
|
||||
"monitor": "Monitor",
|
||||
"start": "Start",
|
||||
"end": "End",
|
||||
"activeFor": "Active for",
|
||||
"lastCheck": "Last checked",
|
||||
"lastResponseTime": "Last response time",
|
||||
@@ -104,26 +124,10 @@
|
||||
"cpuTemperature": "Avg CPU temp",
|
||||
"memory": "Memory",
|
||||
"disk": "Disk",
|
||||
"os": "OS"
|
||||
},
|
||||
"table": {
|
||||
"headers": {
|
||||
"name": "Name",
|
||||
"active": "Active",
|
||||
"type": "Type",
|
||||
"status": "Status",
|
||||
"statusCode": "Status code",
|
||||
"message": "Message",
|
||||
"dateTime": "Date & Time",
|
||||
"responseTime": "Response time",
|
||||
"pageSpeedScore": "PageSpeed Score",
|
||||
"actions": "Actions",
|
||||
"cpu": "CPU",
|
||||
"memory": "Memory",
|
||||
"disk": "Disk"
|
||||
},
|
||||
"empty": "No data"
|
||||
"os": "OS",
|
||||
"ongoing": "Ongoing"
|
||||
},
|
||||
|
||||
"actions": {
|
||||
"openSite": "Open site",
|
||||
"details": "Details",
|
||||
@@ -160,6 +164,11 @@
|
||||
"title": "Website & API Uptime Monitoring",
|
||||
"description": "Monitor your websites and APIs to ensure they're always accessible. Get instant alerts when your services go down and track uptime history over time."
|
||||
},
|
||||
"table": {
|
||||
"headers": {
|
||||
"responseTime": "Response time"
|
||||
}
|
||||
},
|
||||
"fallback": {
|
||||
"title": "An uptime monitor is used to:",
|
||||
"actionButton": "Create a monitor!",
|
||||
@@ -215,6 +224,11 @@
|
||||
"title": "Website Performance Tracking",
|
||||
"description": "Measure how fast your websites load and identify performance bottlenecks. Track Core Web Vitals and get actionable insights to improve user experience."
|
||||
},
|
||||
"table": {
|
||||
"headers": {
|
||||
"pageSpeedScore": "PageSpeed Score"
|
||||
}
|
||||
},
|
||||
"fallback": {
|
||||
"title": "A PageSpeed monitor is used to:",
|
||||
"actionButton": "Create a monitor!",
|
||||
@@ -235,6 +249,13 @@
|
||||
"title": "Infrastructure Monitoring",
|
||||
"description": "Keep track of your servers' vital statistics including CPU usage, memory, disk space, and network performance. Receive alerts when resources run low."
|
||||
},
|
||||
"table": {
|
||||
"headers": {
|
||||
"cpu": "CPU",
|
||||
"memory": "Memory",
|
||||
"disk": "Disk"
|
||||
}
|
||||
},
|
||||
"fallback": {
|
||||
"actionButton": "Create a monitor!",
|
||||
"checks": [
|
||||
@@ -329,7 +350,133 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"incidents": {},
|
||||
"checks": {},
|
||||
"statusPages": {}
|
||||
"incidents": {
|
||||
"title": "Incident details",
|
||||
"details": {
|
||||
"resolutionCard": {
|
||||
"title": "Resolution",
|
||||
"resolutionStatus": "Resolution status",
|
||||
"resolutionType": "Resolution type",
|
||||
"resolvedBy": "Resolved by",
|
||||
"note": "Note",
|
||||
"resolvedAt": "Resolved at",
|
||||
"ongoingSince": "Ongoing since"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"headers": {
|
||||
"start": "Incident start",
|
||||
"end": "Incident end",
|
||||
"monitorStatus": "Current monitor status",
|
||||
"resolved": "Resolved",
|
||||
"resolutionType": "Resolution type",
|
||||
"resolvedBy": "Resolved by"
|
||||
}
|
||||
}
|
||||
},
|
||||
"checks": {
|
||||
"table": {
|
||||
"headers": {
|
||||
"statusCode": "Status code",
|
||||
"message": "Message",
|
||||
"dateTime": "Date & Time"
|
||||
}
|
||||
}
|
||||
},
|
||||
"statusPage": {
|
||||
"table": {
|
||||
"headers": {
|
||||
"published": "Published",
|
||||
"publicUrl": "Public url"
|
||||
}
|
||||
},
|
||||
"fallback": {
|
||||
"actionButton": "Create a status page!",
|
||||
"checks": [
|
||||
"Monitor and display the health of your services in real time",
|
||||
"Track multiple services and share their status",
|
||||
"Keep users informed about outages and performance"
|
||||
],
|
||||
"title": "A status page is used to:"
|
||||
},
|
||||
"form": {
|
||||
"basic": {
|
||||
"title": "Basic information",
|
||||
"description": "Add a name and description",
|
||||
"optionName": "Name",
|
||||
"optionDescription": "Description"
|
||||
},
|
||||
"url": {
|
||||
"title": "URL",
|
||||
"description": "URL for your status page",
|
||||
"optionUrl": "URL"
|
||||
},
|
||||
"access": {
|
||||
"title": "Access",
|
||||
"description": "Choose whether your status page is published and available to the public",
|
||||
"optionPublished": "Published"
|
||||
},
|
||||
"monitors": {
|
||||
"title": "Monitors",
|
||||
"description": "Select the monitors to include on your status page",
|
||||
"optionMonitors": "Monitors"
|
||||
}
|
||||
},
|
||||
"details": {
|
||||
"nameHeader": {
|
||||
"publicLink": "Public link"
|
||||
},
|
||||
"statusHeader": {
|
||||
"allUp": "All systems operational",
|
||||
"allDown": "All systems down",
|
||||
"anyDown": "Partial system outage"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maintenanceWindow": {
|
||||
"infoBox": {
|
||||
"title": "Scheduled Maintenance Periods",
|
||||
"description": "Plan maintenance windows to temporarily pause monitoring checks. During maintenance, your monitors won't run checks or send notifications, preventing false alerts during planned downtime."
|
||||
},
|
||||
"form": {
|
||||
"infoBox": {
|
||||
"title": "About Maintenance Windows",
|
||||
"description": "During maintenance windows, all monitoring is suspended for selected monitors. No network checks will be performed, preventing any status updates or notifications from being triggered. Your monitors will appear frozen at their last known status, and status pages will display a maintenance indicator. Once the maintenance window ends, monitoring automatically resumes, and alerts will trigger if issues are detected. Maintenance periods do not count against uptime calculations."
|
||||
},
|
||||
"general": {
|
||||
"title": "General",
|
||||
"description": "General maintenance window settings",
|
||||
"optionName": "Name",
|
||||
"optionNamePlaceholder": "My maintenance window",
|
||||
"optionRepeat": "Repeat period"
|
||||
},
|
||||
"time": {
|
||||
"title": "Start & end times",
|
||||
"description": "Set the start time and end time of the maintenance window",
|
||||
"optionStart": "Start time",
|
||||
"optionEnd": "End time"
|
||||
},
|
||||
"monitors": {
|
||||
"title": "Monitors",
|
||||
"description": "Select the monitors to include in the maintenance window",
|
||||
"optionMonitors": "Monitors",
|
||||
"optionMonitorsSelected": "selected",
|
||||
"optionMonitorsPlaceholder": "Type to search"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"headers": {
|
||||
"repeat": "Repeat"
|
||||
}
|
||||
},
|
||||
"fallback": {
|
||||
"actionButton": "Create a window!",
|
||||
"checks": [
|
||||
"Mark your maintenance periods",
|
||||
"Eliminate any misunderstandings",
|
||||
"Stop sending alerts in maintenance windows"
|
||||
],
|
||||
"title": "A maintenance window is used to:"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export const ChecksTable = ({
|
||||
const headers: Header<CheckWithMonitor>[] = [
|
||||
{
|
||||
id: "monitorName",
|
||||
content: t("incidentsTableMonitorName"),
|
||||
content: t("common.table.headers.monitor"),
|
||||
render: (row) => {
|
||||
return row.metadata?.monitorId?.name || "N/A";
|
||||
},
|
||||
@@ -53,7 +53,7 @@ export const ChecksTable = ({
|
||||
},
|
||||
{
|
||||
id: "date",
|
||||
content: "Date and time",
|
||||
content: t("checks.table.headers.dateTime"),
|
||||
render: (row) => {
|
||||
return formatDateWithTz(
|
||||
row.createdAt,
|
||||
@@ -64,7 +64,7 @@ export const ChecksTable = ({
|
||||
},
|
||||
{
|
||||
id: "statusCode",
|
||||
content: "Status code",
|
||||
content: t("checks.table.headers.statusCode"),
|
||||
render: (row) => {
|
||||
const code = row.httpStatusCode;
|
||||
const value =
|
||||
@@ -74,7 +74,7 @@ export const ChecksTable = ({
|
||||
},
|
||||
{
|
||||
id: "message",
|
||||
content: "Message",
|
||||
content: t("checks.table.headers.message"),
|
||||
render: (row) => {
|
||||
return row.message || "N/A";
|
||||
},
|
||||
|
||||
@@ -2,6 +2,7 @@ import { BasePage, StatBox } from "@/components/design-elements";
|
||||
import ResolutionCard from "@/components/design-elements/ResolutionCard";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useNavigate, useParams } from "react-router";
|
||||
import { useGet } from "@/hooks/UseApi";
|
||||
@@ -12,9 +13,11 @@ import { useAppSelector } from "@/hooks/AppHooks";
|
||||
import prettyMilliseconds from "pretty-ms";
|
||||
import { getMonitorPath } from "@/utils/MonitorUtils";
|
||||
import type { MonitorType } from "@/types/monitor";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const IncidentDetailsPage = () => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const uiTimezone = useAppSelector((state: any) => state.ui.timezone);
|
||||
const navigate = useNavigate();
|
||||
@@ -36,12 +39,12 @@ const IncidentDetailsPage = () => {
|
||||
<BasePage>
|
||||
<Stack spacing={theme.spacing(8)}>
|
||||
<Typography variant="h4" color="textPrimary">
|
||||
Incident Details
|
||||
{t("incidents.title")}
|
||||
</Typography>
|
||||
|
||||
<Stack direction={{ xs: "column", md: "row" }} gap={theme.spacing(8)}>
|
||||
<StatBox
|
||||
title="Monitor"
|
||||
title={t("monitors.common.stats.monitor")}
|
||||
subtitle={incident.monitorId?.name || "N/A"}
|
||||
onClick={() => {
|
||||
const type = incident.monitorId.type as MonitorType;
|
||||
@@ -51,7 +54,7 @@ const IncidentDetailsPage = () => {
|
||||
}}
|
||||
/>
|
||||
<StatBox
|
||||
title="Start"
|
||||
title={t("monitors.common.stats.start")}
|
||||
subtitle={formatDateWithTz(
|
||||
incident.startedAt,
|
||||
"ddd, MMMM D, YYYY, HH:mm A",
|
||||
@@ -59,7 +62,7 @@ const IncidentDetailsPage = () => {
|
||||
)}
|
||||
/>
|
||||
<StatBox
|
||||
title="End"
|
||||
title={t("monitors.common.stats.end")}
|
||||
subtitle={
|
||||
incident.endedAt
|
||||
? formatDateWithTz(
|
||||
@@ -67,7 +70,7 @@ const IncidentDetailsPage = () => {
|
||||
"ddd, MMMM D, YYYY, HH:mm A",
|
||||
uiTimezone
|
||||
)
|
||||
: "Ongoing"
|
||||
: t("monitors.common.stats.ongoing")
|
||||
}
|
||||
/>
|
||||
</Stack>
|
||||
@@ -79,12 +82,12 @@ const IncidentDetailsPage = () => {
|
||||
note={incident.resolutionNote}
|
||||
timestampLabel={
|
||||
incident.resolved && incident.endedAt
|
||||
? `Resolved at: ${formatDateWithTz(
|
||||
? `${t("incidents.details.resolutionCard.resolvedAt")}: ${formatDateWithTz(
|
||||
incident.endedAt,
|
||||
"ddd, MMMM D, YYYY, HH:mm A",
|
||||
uiTimezone
|
||||
)}`
|
||||
: `Ongoing since: ${formatDateWithTz(
|
||||
: `${t("incidents.details.resolutionCard.ongoingSince")}: ${formatDateWithTz(
|
||||
incident.startedAt,
|
||||
"ddd, MMMM D, YYYY, HH:mm A",
|
||||
uiTimezone
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { Table, Pagination, ValueLabel, StatusLabel } from "@/components/design-elements";
|
||||
import {
|
||||
Table,
|
||||
Pagination,
|
||||
ValueLabel,
|
||||
StatusLabel,
|
||||
} from "@/components/design-elements";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { Button } from "@/components/inputs";
|
||||
@@ -37,14 +42,14 @@ export const IncidentTable = ({
|
||||
const headers: Header<IIncident>[] = [
|
||||
{
|
||||
id: "name",
|
||||
content: t("incidentsTableMonitorName"),
|
||||
content: t("common.table.headers.monitor"),
|
||||
render: (row) => {
|
||||
return row.monitorId?.name || "N/A";
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "start",
|
||||
content: "Incident start",
|
||||
content: t("incidents.table.headers.start"),
|
||||
render: (row) => {
|
||||
return formatDateWithTz(
|
||||
row.startedAt,
|
||||
@@ -55,7 +60,7 @@ export const IncidentTable = ({
|
||||
},
|
||||
{
|
||||
id: "end",
|
||||
content: "Incident end",
|
||||
content: t("incidents.table.headers.end"),
|
||||
render: (row) => {
|
||||
return row.endedAt
|
||||
? formatDateWithTz(
|
||||
@@ -68,7 +73,7 @@ export const IncidentTable = ({
|
||||
},
|
||||
{
|
||||
id: "status",
|
||||
content: "Current monitor status",
|
||||
content: t("incidents.table.headers.monitorStatus"),
|
||||
render: (row) => {
|
||||
const status = row.monitorId?.status;
|
||||
return status ? (
|
||||
@@ -80,7 +85,7 @@ export const IncidentTable = ({
|
||||
},
|
||||
{
|
||||
id: "resolved",
|
||||
content: "Resolved",
|
||||
content: t("incidents.table.headers.resolved"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<ValueLabel
|
||||
@@ -92,21 +97,21 @@ export const IncidentTable = ({
|
||||
},
|
||||
{
|
||||
id: "resolutionType",
|
||||
content: "Resolution type",
|
||||
content: t("incidents.table.headers.resolutionType"),
|
||||
render: (row) => {
|
||||
return row.resolutionType || "N/A";
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "resolvedBy",
|
||||
content: "Resolved by",
|
||||
content: t("incidents.table.headers.resolvedBy"),
|
||||
render: (row) => {
|
||||
return row.resolvedBy?.email || "N/A";
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
content: "Actions",
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return row.resolved ? null : (
|
||||
<Button
|
||||
@@ -121,7 +126,7 @@ export const IncidentTable = ({
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
Resolve
|
||||
{t("common.buttons.resolve")}
|
||||
</Button>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -168,7 +168,7 @@ export const InfraMonitorsTable = ({
|
||||
onClick={(e) => handleSort(e, "name")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.name")}
|
||||
{t("common.table.headers.name")}
|
||||
{renderSortIcon(sortField === "name")}
|
||||
</Typography>
|
||||
),
|
||||
@@ -186,7 +186,7 @@ export const InfraMonitorsTable = ({
|
||||
onClick={(e) => handleSort(e, "status")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.status")}
|
||||
{t("common.table.headers.status")}
|
||||
{renderSortIcon(sortField === "status")}
|
||||
</Typography>
|
||||
),
|
||||
@@ -196,7 +196,7 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: "cpu",
|
||||
content: t("monitors.common.table.headers.cpu"),
|
||||
content: t("monitors.infrastructure.table.headers.cpu"),
|
||||
render: (row) => {
|
||||
const cpuUsage =
|
||||
(row.latestChecks?.[0]?.system?.cpu?.usage_percent || 0) * 100;
|
||||
@@ -205,7 +205,7 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: "memory",
|
||||
content: t("monitors.common.table.headers.memory"),
|
||||
content: t("monitors.infrastructure.table.headers.memory"),
|
||||
render: (row) => {
|
||||
const memoryUsage =
|
||||
(row.latestChecks?.[0]?.system?.memory?.usage_percent || 0) * 100;
|
||||
@@ -214,7 +214,7 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: "disk",
|
||||
content: t("monitors.common.table.headers.disk"),
|
||||
content: t("monitors.infrastructure.table.headers.disk"),
|
||||
render: (row) => {
|
||||
const totalDiskUsage = row.latestChecks?.[0]?.system?.disk?.reduce(
|
||||
(acc, disk) => acc + disk.usage_percent,
|
||||
@@ -228,7 +228,7 @@ export const InfraMonitorsTable = ({
|
||||
|
||||
{
|
||||
id: "actions",
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -82,14 +82,14 @@ const MaintenancePage = () => {
|
||||
const headers: Header<IMaintenance>[] = [
|
||||
{
|
||||
id: "name",
|
||||
content: "Name",
|
||||
content: t("common.table.headers.name"),
|
||||
render: (row) => {
|
||||
return <Typography>{row?.name}</Typography>;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "active",
|
||||
content: "Active",
|
||||
content: t("common.table.headers.active"),
|
||||
render: (row) => {
|
||||
const active = row.isActive ? "Yes" : "No";
|
||||
return <Typography>{active}</Typography>;
|
||||
@@ -97,7 +97,7 @@ const MaintenancePage = () => {
|
||||
},
|
||||
{
|
||||
id: "repeat",
|
||||
content: "Repeat",
|
||||
content: t("maintenanceWindow.table.headers.repeat"),
|
||||
render: (row) => {
|
||||
const active = row.repeat ? row.repeat : "No";
|
||||
return <Typography textTransform={"capitalize"}>{active}</Typography>;
|
||||
@@ -105,7 +105,7 @@ const MaintenancePage = () => {
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
content: t("actions"),
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
@@ -124,11 +124,11 @@ const MaintenancePage = () => {
|
||||
items={maintenance}
|
||||
bullets={t("maintenanceWindow.fallback.checks", { returnObjects: true })}
|
||||
actionLink="/maintenance/create"
|
||||
actionButtonText={t("createMaintenanceWindow")}
|
||||
actionButtonText={t("maintenanceWindow.fallback.actionButton")}
|
||||
>
|
||||
<InfoBox
|
||||
title="Scheduled Maintenance Periods"
|
||||
description="Plan maintenance windows to temporarily pause monitoring checks. During maintenance, your monitors won't run checks or send notifications, preventing false alerts during planned downtime."
|
||||
title={t("maintenanceWindow.infoBox.title")}
|
||||
description={t("maintenanceWindow.infoBox.description")}
|
||||
/>
|
||||
<HeaderCreate
|
||||
label={"Create a new maintenance window"}
|
||||
@@ -146,8 +146,8 @@ const MaintenancePage = () => {
|
||||
/>
|
||||
|
||||
<Dialog
|
||||
title={t("createNotifications.dialogDeleteTitle")}
|
||||
content={t("createNotifications.dialogDeleteContent")}
|
||||
title={t("common.dialog.delete.title")}
|
||||
content={t("common.dialog.delete.description")}
|
||||
open={open}
|
||||
onConfirm={handleConfirm}
|
||||
onCancel={handleCancel}
|
||||
|
||||
@@ -57,12 +57,12 @@ export const MaintenanceForm = ({
|
||||
return (
|
||||
<BasePage component={"form"} onSubmit={handleSubmit(onSubmit, onError)}>
|
||||
<InfoBox
|
||||
title="About Maintenance Windows"
|
||||
description="During maintenance windows, all monitoring is suspended for selected monitors. No network checks will be performed, preventing any status updates or notifications from being triggered. Your monitors will appear frozen at their last known status, and status pages will display a maintenance indicator. Once the maintenance window ends, monitoring automatically resumes, and alerts will trigger if issues are detected. Maintenance periods do not count against uptime calculations."
|
||||
title={t("maintenanceWindow.infoBox.title")}
|
||||
description={t("maintenanceWindow.infoBox.description")}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMaintenanceWindowPage.generalSettingsTitle")}
|
||||
subtitle={t("createMaintenanceWindowPage.generalSettingsDescription")}
|
||||
title={t("maintenanceWindow.form.general.title")}
|
||||
subtitle={t("maintenanceWindow.form.general.description")}
|
||||
rightContent={
|
||||
<Stack spacing={theme.spacing(8)}>
|
||||
<Controller
|
||||
@@ -71,13 +71,11 @@ export const MaintenanceForm = ({
|
||||
render={({ field }) => (
|
||||
<TextInput
|
||||
{...field}
|
||||
fieldLabel={t(
|
||||
"createMaintenanceWindowPage.generalSettingsName"
|
||||
)}
|
||||
fieldLabel={t("maintenanceWindow.form.general.optionName")}
|
||||
required
|
||||
type="text"
|
||||
placeholder={t(
|
||||
"createMaintenanceWindowPage.generalSettingsNamePlaceholder"
|
||||
"maintenanceWindow.form.general.optionNamePlaceholder"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.name}
|
||||
@@ -91,9 +89,7 @@ export const MaintenanceForm = ({
|
||||
render={({ field }) => (
|
||||
<Select
|
||||
value={field.value || ""}
|
||||
fieldLabel={t(
|
||||
"createMaintenanceWindowPage.generalSettingsRepeat"
|
||||
)}
|
||||
fieldLabel={t("maintenanceWindow.form.general.optionRepeat")}
|
||||
required
|
||||
error={!!errors.repeat}
|
||||
onChange={field.onChange}
|
||||
@@ -115,8 +111,8 @@ export const MaintenanceForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMaintenanceWindowPage.timingSettingsTitle")}
|
||||
subtitle={t("createMaintenanceWindowPage.timingSettingsDescription")}
|
||||
title={t("maintenanceWindow.form.time.title")}
|
||||
subtitle={t("maintenanceWindow.form.time.description")}
|
||||
rightContent={
|
||||
<Stack spacing={theme.spacing(8)}>
|
||||
<Controller
|
||||
@@ -128,7 +124,7 @@ export const MaintenanceForm = ({
|
||||
<>
|
||||
<DateTimePicker
|
||||
{...field}
|
||||
fieldLabel="Start time"
|
||||
fieldLabel={t("maintenanceWindow.form.time.optionStart")}
|
||||
required
|
||||
value={value}
|
||||
onChange={(val: Dayjs | null) =>
|
||||
@@ -153,7 +149,7 @@ export const MaintenanceForm = ({
|
||||
<>
|
||||
<DateTimePicker
|
||||
{...field}
|
||||
fieldLabel="End time"
|
||||
fieldLabel={t("maintenanceWindow.form.time.optionEnd")}
|
||||
required
|
||||
value={value}
|
||||
onChange={(val: Dayjs | null) =>
|
||||
@@ -173,8 +169,8 @@ export const MaintenanceForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMaintenanceWindowPage.monitorsTitle")}
|
||||
subtitle={t("createMaintenanceWindowPage.monitorsDescription")}
|
||||
title={t("maintenanceWindow.form.monitors.title")}
|
||||
subtitle={t("maintenanceWindow.form.monitors.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="monitors"
|
||||
@@ -189,7 +185,9 @@ export const MaintenanceForm = ({
|
||||
return (
|
||||
<AutoComplete
|
||||
multiple
|
||||
fieldLabel="Monitors"
|
||||
fieldLabel={t(
|
||||
"maintenanceWindow.form.monitors.optionMonitors"
|
||||
)}
|
||||
required
|
||||
options={monitorOptions}
|
||||
getOptionLabel={(option) => option.name}
|
||||
@@ -201,7 +199,11 @@ export const MaintenanceForm = ({
|
||||
<TextInput
|
||||
{...params}
|
||||
placeholder={
|
||||
count > 0 ? `${count} selected` : "Type to search"
|
||||
count > 0
|
||||
? `${count} ${t("maintenanceWindow.form.monitors.optionMonitorsSelected")}`
|
||||
: t(
|
||||
"maintenanceWindow.form.monitors.optionMonitorsPlaceholder"
|
||||
)
|
||||
}
|
||||
/>
|
||||
)}
|
||||
@@ -219,7 +221,7 @@ export const MaintenanceForm = ({
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
{t("settingsSave")}
|
||||
{t("common.buttons.save")}
|
||||
</Button>
|
||||
</Stack>
|
||||
</BasePage>
|
||||
|
||||
@@ -91,14 +91,14 @@ const NotificationChannelsPage = () => {
|
||||
const headers: Header<INotificationChannel>[] = [
|
||||
{
|
||||
id: "name",
|
||||
content: t("monitors.common.table.headers.name"),
|
||||
content: t("common.table.headers.name"),
|
||||
render: (row) => {
|
||||
return <Typography>{row?.name}</Typography>;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "active",
|
||||
content: t("monitors.common.table.headers.active"),
|
||||
content: t("common.table.headers.active"),
|
||||
render: (row) => {
|
||||
const active = row.isActive
|
||||
? t("common.buttons.yes")
|
||||
@@ -108,7 +108,7 @@ const NotificationChannelsPage = () => {
|
||||
},
|
||||
{
|
||||
id: "type",
|
||||
content: "Type",
|
||||
content: t("common.table.headers.type"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<Typography textTransform={"capitalize"}>{row?.type}</Typography>
|
||||
@@ -117,7 +117,7 @@ const NotificationChannelsPage = () => {
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -170,7 +170,7 @@ export const PageSpeedMonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "name")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.name")}
|
||||
{t("common.table.headers.name")}
|
||||
{renderSortIcon(sortField === "name")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -189,7 +189,7 @@ export const PageSpeedMonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "status")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.status")}
|
||||
{t("common.table.headers.status")}
|
||||
{renderSortIcon(sortField === "status")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -199,7 +199,7 @@ export const PageSpeedMonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: "histogram",
|
||||
content: t("monitors.common.table.headers.pageSpeedScore"),
|
||||
content: t("monitors.pageSpeed.table.headers.pageSpeedScore"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<Stack alignItems={"center"}>
|
||||
@@ -214,7 +214,7 @@ export const PageSpeedMonitorTable = ({
|
||||
|
||||
{
|
||||
id: "actions",
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -66,8 +66,8 @@ export const StatusPageForm = ({
|
||||
return (
|
||||
<BasePage component={"form"} onSubmit={handleSubmit(onSubmit, onError)}>
|
||||
<ConfigBox
|
||||
title={t("createStatusPage.basicConfigTitle")}
|
||||
subtitle={t("createStatusPage.basicConfigDescription")}
|
||||
title={t("statusPage.form.basic.title")}
|
||||
subtitle={t("statusPage.form.basic.description")}
|
||||
rightContent={
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<Controller
|
||||
@@ -77,7 +77,7 @@ export const StatusPageForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("createStatusPage.nameConfigLabel")}
|
||||
fieldLabel={t("statusPage.form.basic.optionName")}
|
||||
fullWidth
|
||||
error={!!errors.name}
|
||||
helperText={errors.name ? errors.name.message : ""}
|
||||
@@ -91,7 +91,7 @@ export const StatusPageForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("createStatusPage.descriptionConfigLabel")}
|
||||
fieldLabel={t("statusPage.form.basic.optionDescription")}
|
||||
fullWidth
|
||||
error={!!errors.description}
|
||||
helperText={
|
||||
@@ -104,8 +104,8 @@ export const StatusPageForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createStatusPage.urlConfigTitle")}
|
||||
subtitle={t("createStatusPage.urlConfigDescription")}
|
||||
title={t("statusPage.form.url.title")}
|
||||
subtitle={t("statusPage.form.url.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="url"
|
||||
@@ -114,7 +114,7 @@ export const StatusPageForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("createStatusPage.urlConfigTitle")}
|
||||
fieldLabel={t("statusPage.form.url.optionUrl")}
|
||||
fullWidth
|
||||
error={!!errors.url}
|
||||
helperText={errors.url ? errors.url.message : ""}
|
||||
@@ -124,15 +124,15 @@ export const StatusPageForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createStatusPage.accessConfigTitle")}
|
||||
subtitle={t("createStatusPage.accessConfigDescription")}
|
||||
title={t("statusPage.form.access.title")}
|
||||
subtitle={t("statusPage.form.access.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="isPublished"
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<FormControlLabel
|
||||
label={t("createStatusPage.publishedConfigLabel")}
|
||||
label={t("statusPage.form.access.optionPublished")}
|
||||
control={
|
||||
<Checkbox
|
||||
{...field}
|
||||
@@ -146,8 +146,8 @@ export const StatusPageForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMaintenanceWindowPage.monitorsTitle")}
|
||||
subtitle={t("createMaintenanceWindowPage.monitorsDescription")}
|
||||
title={t("statusPage.form.monitors.title")}
|
||||
subtitle={t("statusPage.form.monitors.description")}
|
||||
rightContent={
|
||||
<Stack>
|
||||
<Controller
|
||||
@@ -205,7 +205,7 @@ export const StatusPageForm = ({
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
{t("settingsSave")}
|
||||
{t("common.buttons.save")}
|
||||
</Button>
|
||||
</Stack>
|
||||
</BasePage>
|
||||
|
||||
@@ -72,14 +72,14 @@ export const StatusPageTable = ({
|
||||
const headers: Header<IStatusPage>[] = [
|
||||
{
|
||||
id: "name",
|
||||
content: "Name",
|
||||
content: t("common.table.headers.name"),
|
||||
render: (row) => {
|
||||
return <Typography>{row?.name}</Typography>;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "published",
|
||||
content: "Published",
|
||||
content: t("statusPage.table.headers.published"),
|
||||
render: (row) => {
|
||||
const published = row.isPublished ? "Yes" : "No";
|
||||
return <Typography>{published}</Typography>;
|
||||
@@ -87,7 +87,7 @@ export const StatusPageTable = ({
|
||||
},
|
||||
{
|
||||
id: "url",
|
||||
content: "Public URL",
|
||||
content: t("statusPage.table.headers.publicUrl"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<Typography textTransform={"capitalize"}>{row?.url}</Typography>
|
||||
@@ -96,7 +96,7 @@ export const StatusPageTable = ({
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
content: t("actions"),
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -73,8 +73,8 @@ const StatusPages = () => {
|
||||
/>
|
||||
|
||||
<Dialog
|
||||
title={t("createStatusPage.dialogDeleteTitle")}
|
||||
content={t("createStatusPage.dialogDeleteContent")}
|
||||
title={t("common.dialog.delete.title")}
|
||||
content={t("common.dialog.delete.description")}
|
||||
open={open}
|
||||
onConfirm={handleConfirm}
|
||||
onCancel={handleCancel}
|
||||
|
||||
@@ -173,7 +173,7 @@ export const MonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "name")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.name")}
|
||||
{t("common.table.headers.name")}
|
||||
{renderSortIcon(sortField === "name")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -193,7 +193,7 @@ export const MonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "status")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.status")}
|
||||
{t("common.table.headers.status")}
|
||||
{renderSortIcon(sortField === "status")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -203,7 +203,7 @@ export const MonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: "histogram",
|
||||
content: t("monitors.common.table.headers.responseTime"),
|
||||
content: t("monitors.uptime.table.headers.responseTime"),
|
||||
render: (row) => {
|
||||
if (chartType === "histogram") {
|
||||
return <HistogramResponseTime checks={row.latestChecks} />;
|
||||
@@ -223,7 +223,7 @@ export const MonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "type")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("monitors.common.table.headers.type")}
|
||||
{t("common.table.headers.type")}
|
||||
{renderSortIcon(sortField === "type")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -233,7 +233,7 @@ export const MonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
content: t("common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -84,7 +84,8 @@ export interface IStatusPageHeaderConfig {
|
||||
message: string;
|
||||
}
|
||||
export const getStatusPageHeaderConfig = (
|
||||
monitors: IMonitor[]
|
||||
monitors: IMonitor[],
|
||||
t: any
|
||||
): IStatusPageHeaderConfig => {
|
||||
if (!monitors || monitors.length === 0) {
|
||||
return { paletteKey: "error", message: "No monitors available" };
|
||||
@@ -95,9 +96,22 @@ export const getStatusPageHeaderConfig = (
|
||||
const allDown = monitors.every((monitor) => monitor.status === "down");
|
||||
|
||||
if (allUp)
|
||||
return { paletteKey: "success", message: "All systems operational" };
|
||||
if (allDown) return { paletteKey: "error", message: "All systems down" };
|
||||
return {
|
||||
paletteKey: "success",
|
||||
message: t("statusPage.details.statusHeader.allUp"),
|
||||
};
|
||||
if (allDown)
|
||||
return {
|
||||
paletteKey: "error",
|
||||
message: t("statusPage.details.statusHeader.allDown"),
|
||||
};
|
||||
if (anyDown)
|
||||
return { paletteKey: "warning", message: "Partial system outage" };
|
||||
return { paletteKey: "warning", message: "Partial system outage" };
|
||||
return {
|
||||
paletteKey: "warning",
|
||||
message: t("statusPage.details.statusHeader.anyDown"),
|
||||
};
|
||||
return {
|
||||
paletteKey: "warning",
|
||||
message: t("statusPage.details.statusHeader.anyDown"),
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user