locale
This commit is contained in:
1 parent
b94e6052c3
commit
64d1ba08f9
23 files changed
+1657
-170
No files matched your search
@@ -100,8 +100,8 @@ export const InfraForm = ({
|
||||
return (
|
||||
<BasePage component={"form"} onSubmit={handleSubmit(onSubmit)}>
|
||||
<ConfigBox
|
||||
title={t("settingsGeneralSettings")}
|
||||
subtitle={t(`pageSpeedConfigureSettingsDescription`)}
|
||||
title={t("monitors.common.form.general.title")}
|
||||
subtitle={t(`monitors.infrastructure.form.general.description`)}
|
||||
rightContent={
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<RadioGroup
|
||||
@@ -113,12 +113,12 @@ export const InfraForm = ({
|
||||
>
|
||||
<RadioWithDescription
|
||||
value="https"
|
||||
label="HTTPS"
|
||||
label={t("monitors.common.form.optionHttps")}
|
||||
description=""
|
||||
/>
|
||||
<RadioWithDescription
|
||||
value="http"
|
||||
label={"HTTP"}
|
||||
label={t("monitors.common.form.optionHttp")}
|
||||
description={""}
|
||||
/>
|
||||
</RadioGroup>
|
||||
@@ -140,7 +140,7 @@ export const InfraForm = ({
|
||||
}, 0);
|
||||
}}
|
||||
type="text"
|
||||
fieldLabel={t("url")}
|
||||
fieldLabel={t("monitors.common.form.optionUrl")}
|
||||
fullWidth
|
||||
error={!!errors.url}
|
||||
helperText={errors.url ? errors.url.message : ""}
|
||||
@@ -155,7 +155,7 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("displayName")}
|
||||
fieldLabel={t("monitors.common.form.optionDisplayName")}
|
||||
fullWidth
|
||||
error={!!errors.name}
|
||||
helperText={errors.name ? errors.name.message : ""}
|
||||
@@ -169,7 +169,9 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("infrastructureAuthorizationSecretLabel")}
|
||||
fieldLabel={t(
|
||||
"monitors.infrastructure.form.general.optionSecret"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.secret}
|
||||
helperText={errors.secret ? errors.secret.message : ""}
|
||||
@@ -180,8 +182,8 @@ export const InfraForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.incidentConfigTitle")}
|
||||
subtitle={t("createMonitorPage.incidentConfigDescriptionV2")}
|
||||
title={t("monitors.common.form.incidents.title")}
|
||||
subtitle={t("monitors.common.form.incidents.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="n"
|
||||
@@ -191,7 +193,7 @@ export const InfraForm = ({
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t(
|
||||
"createMonitorPage.incidentConfigStatusCheckNumber"
|
||||
"monitors.common.form.incidents.optionIncidentCount"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.n}
|
||||
@@ -206,8 +208,8 @@ export const InfraForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("Threshold Alerts")}
|
||||
subtitle={t("Set percentage thresholds to trigger incidents.")}
|
||||
title={t("monitors.infrastructure.form.thresholds.title")}
|
||||
subtitle={t("monitors.infrastructure.form.thresholds.description")}
|
||||
rightContent={
|
||||
<Stack gap={theme.spacing(4)}>
|
||||
<Controller
|
||||
@@ -217,7 +219,9 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t("CPU %")}
|
||||
fieldLabel={t(
|
||||
"monitors.infrastructure.form.thresholds.optionCpuUsage"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.thresholds?.cpu}
|
||||
helperText={errors.thresholds?.cpu?.message ?? ""}
|
||||
@@ -231,7 +235,9 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t("Memory %")}
|
||||
fieldLabel={t(
|
||||
"monitors.infrastructure.form.thresholds.optionMemoryUsage"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.thresholds?.memory}
|
||||
helperText={errors.thresholds?.memory?.message ?? ""}
|
||||
@@ -245,7 +251,9 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t("Disk %")}
|
||||
fieldLabel={t(
|
||||
"monitors.infrastructure.form.thresholds.optionDiskUsage"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.thresholds?.disk}
|
||||
helperText={errors.thresholds?.disk?.message ?? ""}
|
||||
@@ -259,7 +267,9 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t("Temperature °C")}
|
||||
fieldLabel={t(
|
||||
"monitors.infrastructure.form.thresholds.optionTemperature"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.thresholds?.temperature}
|
||||
helperText={errors.thresholds?.temperature?.message ?? ""}
|
||||
@@ -270,8 +280,8 @@ export const InfraForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("notificationConfig.title")}
|
||||
subtitle={t("notificationConfig.description")}
|
||||
title={t("monitors.common.form.notifications.title")}
|
||||
subtitle={t("monitors.common.form.notifications.description")}
|
||||
rightContent={
|
||||
<Stack>
|
||||
<Controller
|
||||
@@ -325,8 +335,8 @@ export const InfraForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.intervalTitle")}
|
||||
subtitle="How often to check the URL"
|
||||
title={t("monitors.common.form.interval.title")}
|
||||
subtitle={t("monitors.common.form.interval.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="interval"
|
||||
@@ -335,7 +345,7 @@ export const InfraForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("createMonitorPage.intervalDescription")}
|
||||
fieldLabel={t("monitors.common.form.interval.optionInterval")}
|
||||
fullWidth
|
||||
error={!!errors.interval}
|
||||
helperText={errors.interval ? errors.interval.message : ""}
|
||||
@@ -351,7 +361,7 @@ export const InfraForm = ({
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
{t("settingsSave")}
|
||||
{t("common.buttons.save")}
|
||||
</Button>
|
||||
</Stack>
|
||||
</BasePage>
|
||||
|
||||
@@ -90,8 +90,8 @@ const PageSpeedMonitorsPage = () => {
|
||||
actionLink="/infrastructure/create"
|
||||
>
|
||||
<InfoBox
|
||||
title="Server Health Monitoring"
|
||||
description="Keep track of your servers' vital statistics including CPU usage, memory, disk space, and network performance. Receive alerts when resources run low."
|
||||
title={t("monitors.infrastructure.infoBox.title")}
|
||||
description={t("monitors.infrastructure.infoBox.description")}
|
||||
/>
|
||||
<HeaderCreate
|
||||
isLoading={loading}
|
||||
@@ -123,8 +123,8 @@ const PageSpeedMonitorsPage = () => {
|
||||
/>
|
||||
<Dialog
|
||||
open={isDialogOpen}
|
||||
title={t("deleteDialogTitle")}
|
||||
content={t("deleteDialogDescription")}
|
||||
title={t("common.dialog.delete.title")}
|
||||
content={t("common.dialog.delete.description")}
|
||||
onConfirm={handleConfirm}
|
||||
onCancel={handleCancel}
|
||||
loading={isDeleting}
|
||||
|
||||
@@ -84,7 +84,7 @@ export const InfraMonitorsTable = ({
|
||||
return [
|
||||
{
|
||||
id: 1,
|
||||
label: "Open site",
|
||||
label: t("monitors.common.actions.openSite"),
|
||||
action: () => {
|
||||
window.open(monitor.url, "_blank", "noreferrer");
|
||||
},
|
||||
@@ -92,21 +92,21 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Details",
|
||||
label: t("monitors.common.actions.details"),
|
||||
action: () => {
|
||||
navigate(`${monitor._id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: "Incidents",
|
||||
label: t("monitors.common.actions.incidents"),
|
||||
action: () => {
|
||||
navigate(`/incidents?monitorId=${monitor._id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "Configure",
|
||||
label: t("monitors.common.actions.configure"),
|
||||
action: () => {
|
||||
navigate(`/infrastructure/${monitor._id}/configure`);
|
||||
},
|
||||
@@ -115,12 +115,15 @@ export const InfraMonitorsTable = ({
|
||||
// id: 5,
|
||||
// label: "Clone",
|
||||
// action: () => {
|
||||
|
||||
|
||||
// },
|
||||
// },
|
||||
{
|
||||
id: 6,
|
||||
label: monitor.status === "paused" ? "Resume" : "Pause",
|
||||
label:
|
||||
monitor.status === "paused"
|
||||
? t("common.buttons.resume")
|
||||
: t("common.buttons.pause"),
|
||||
action: async () => {
|
||||
await patch(`/monitors/${monitor._id}/active`);
|
||||
refetch();
|
||||
@@ -129,7 +132,11 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: <Typography color={theme.palette.error.main}>Remove</Typography>,
|
||||
label: (
|
||||
<Typography color={theme.palette.error.main}>
|
||||
{t("common.buttons.delete")}
|
||||
</Typography>
|
||||
),
|
||||
action: () => {
|
||||
setSelectedMonitor(monitor);
|
||||
},
|
||||
@@ -161,7 +168,7 @@ export const InfraMonitorsTable = ({
|
||||
onClick={(e) => handleSort(e, "name")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("host")}
|
||||
{t("monitors.common.table.headers.name")}
|
||||
{renderSortIcon(sortField === "name")}
|
||||
</Typography>
|
||||
),
|
||||
@@ -179,7 +186,7 @@ export const InfraMonitorsTable = ({
|
||||
onClick={(e) => handleSort(e, "status")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("status")}
|
||||
{t("monitors.common.table.headers.status")}
|
||||
{renderSortIcon(sortField === "status")}
|
||||
</Typography>
|
||||
),
|
||||
@@ -189,7 +196,7 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: "cpu",
|
||||
content: t("cpu"),
|
||||
content: t("monitors.common.table.headers.cpu"),
|
||||
render: (row) => {
|
||||
const cpuUsage =
|
||||
(row.latestChecks?.[0]?.system?.cpu?.usage_percent || 0) * 100;
|
||||
@@ -198,7 +205,7 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: "memory",
|
||||
content: t("memory"),
|
||||
content: t("monitors.common.table.headers.memory"),
|
||||
render: (row) => {
|
||||
const memoryUsage =
|
||||
(row.latestChecks?.[0]?.system?.memory?.usage_percent || 0) * 100;
|
||||
@@ -207,7 +214,7 @@ export const InfraMonitorsTable = ({
|
||||
},
|
||||
{
|
||||
id: "disk",
|
||||
content: t("disk"),
|
||||
content: t("monitors.common.table.headers.disk"),
|
||||
render: (row) => {
|
||||
const totalDiskUsage = row.latestChecks?.[0]?.system?.disk?.reduce(
|
||||
(acc, disk) => acc + disk.usage_percent,
|
||||
@@ -221,7 +228,7 @@ export const InfraMonitorsTable = ({
|
||||
|
||||
{
|
||||
id: "actions",
|
||||
content: t("actions"),
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -100,8 +100,8 @@ export const PageSpeedForm = ({
|
||||
return (
|
||||
<BasePage component={"form"} onSubmit={handleSubmit(onSubmit)}>
|
||||
<ConfigBox
|
||||
title={t("settingsGeneralSettings")}
|
||||
subtitle={t(`pageSpeedConfigureSettingsDescription`)}
|
||||
title={t("monitors.common.form.general.title")}
|
||||
subtitle={t("monitors.pageSpeed.form.general.description")}
|
||||
rightContent={
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<RadioGroup
|
||||
@@ -113,12 +113,12 @@ export const PageSpeedForm = ({
|
||||
>
|
||||
<RadioWithDescription
|
||||
value="https"
|
||||
label="HTTPS"
|
||||
label={t("monitors.common.form.optionHttps")}
|
||||
description=""
|
||||
/>
|
||||
<RadioWithDescription
|
||||
value="http"
|
||||
label={"HTTP"}
|
||||
label={t("monitors.common.form.optionHttp")}
|
||||
description={""}
|
||||
/>
|
||||
</RadioGroup>
|
||||
@@ -140,7 +140,7 @@ export const PageSpeedForm = ({
|
||||
}, 0);
|
||||
}}
|
||||
type="text"
|
||||
fieldLabel={t("url")}
|
||||
fieldLabel={t("monitors.common.form.optionUrl")}
|
||||
fullWidth
|
||||
error={!!errors.url}
|
||||
helperText={errors.url ? errors.url.message : ""}
|
||||
@@ -155,7 +155,7 @@ export const PageSpeedForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("displayName")}
|
||||
fieldLabel={t("monitors.common.form.optionDisplayName")}
|
||||
fullWidth
|
||||
error={!!errors.name}
|
||||
helperText={errors.name ? errors.name.message : ""}
|
||||
@@ -166,8 +166,8 @@ export const PageSpeedForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.incidentConfigTitle")}
|
||||
subtitle={t("createMonitorPage.incidentConfigDescriptionV2")}
|
||||
title={t("monitors.common.form.incidents.title")}
|
||||
subtitle={t("monitors.common.form.incidents.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="n"
|
||||
@@ -176,7 +176,9 @@ export const PageSpeedForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t("createMonitorPage.incidentConfigStatusCheckNumber")}
|
||||
fieldLabel={t(
|
||||
"monitors.common.form.incidents.optionIncidentCount"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.n}
|
||||
helperText={errors.n ? errors.n.message : ""}
|
||||
@@ -190,8 +192,8 @@ export const PageSpeedForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("notificationConfig.title")}
|
||||
subtitle={t("notificationConfig.description")}
|
||||
title={t("monitors.common.form.notifications.title")}
|
||||
subtitle={t("monitors.common.form.notifications.description")}
|
||||
rightContent={
|
||||
<Stack>
|
||||
<Controller
|
||||
@@ -245,8 +247,8 @@ export const PageSpeedForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.intervalTitle")}
|
||||
subtitle="How often to check the URL"
|
||||
title={t("monitors.common.form.interval.title")}
|
||||
subtitle={t("monitors.common.form.interval.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="interval"
|
||||
@@ -255,7 +257,7 @@ export const PageSpeedForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("createMonitorPage.intervalDescription")}
|
||||
fieldLabel={t("monitors.common.form.interval.optionInterval")}
|
||||
fullWidth
|
||||
error={!!errors.interval}
|
||||
helperText={errors.interval ? errors.interval.message : ""}
|
||||
@@ -271,7 +273,7 @@ export const PageSpeedForm = ({
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
{t("settingsSave")}
|
||||
{t("common.buttons.save")}
|
||||
</Button>
|
||||
</Stack>
|
||||
</BasePage>
|
||||
|
||||
@@ -85,7 +85,7 @@ export const PageSpeedMonitorTable = ({
|
||||
return [
|
||||
{
|
||||
id: 1,
|
||||
label: "Open site",
|
||||
label: t("monitors.common.actions.openSite"),
|
||||
action: () => {
|
||||
window.open(monitor.url, "_blank", "noreferrer");
|
||||
},
|
||||
@@ -93,21 +93,21 @@ export const PageSpeedMonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Details",
|
||||
label: t("monitors.common.actions.details"),
|
||||
action: () => {
|
||||
navigate(`${monitor._id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: "Incidents",
|
||||
label: t("monitors.common.actions.incidents"),
|
||||
action: () => {
|
||||
navigate(`/incidents?monitorId=${monitor._id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "Configure",
|
||||
label: t("monitors.common.actions.configure"),
|
||||
action: () => {
|
||||
navigate(`/pagespeed/${monitor._id}/configure`);
|
||||
},
|
||||
@@ -116,12 +116,15 @@ export const PageSpeedMonitorTable = ({
|
||||
// id: 5,
|
||||
// label: "Clone",
|
||||
// action: () => {
|
||||
|
||||
|
||||
// },
|
||||
// },
|
||||
{
|
||||
id: 6,
|
||||
label: monitor.status === "paused" ? "Resume" : "Pause",
|
||||
label:
|
||||
monitor.status === "paused"
|
||||
? t("common.buttons.resume")
|
||||
: t("common.buttons.pause"),
|
||||
action: async () => {
|
||||
await patch(`/monitors/${monitor._id}/active`);
|
||||
refetch();
|
||||
@@ -130,7 +133,11 @@ export const PageSpeedMonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: <Typography color={theme.palette.error.main}>Remove</Typography>,
|
||||
label: (
|
||||
<Typography color={theme.palette.error.main}>
|
||||
{t("common.buttons.delete")}
|
||||
</Typography>
|
||||
),
|
||||
action: () => {
|
||||
setSelectedMonitor(monitor);
|
||||
},
|
||||
@@ -163,7 +170,7 @@ export const PageSpeedMonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "name")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("host")}
|
||||
{t("monitors.common.table.headers.name")}
|
||||
{renderSortIcon(sortField === "name")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -182,7 +189,7 @@ export const PageSpeedMonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "status")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("status")}
|
||||
{t("monitors.common.table.headers.status")}
|
||||
{renderSortIcon(sortField === "status")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -192,7 +199,7 @@ export const PageSpeedMonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: "histogram",
|
||||
content: "PageSpeed score",
|
||||
content: t("monitors.common.table.headers.pageSpeedScore"),
|
||||
render: (row) => {
|
||||
return (
|
||||
<Stack alignItems={"center"}>
|
||||
@@ -207,7 +214,7 @@ export const PageSpeedMonitorTable = ({
|
||||
|
||||
{
|
||||
id: "actions",
|
||||
content: t("actions"),
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
|
||||
@@ -19,7 +19,6 @@ import useMediaQuery from "@mui/material/useMediaQuery";
|
||||
import { useState } from "react";
|
||||
import { useDelete } from "@/hooks/UseApi";
|
||||
import { InitializingStatusBox } from "@/components/design-elements/StatusBox";
|
||||
import { useAppSelector } from "@/hooks/AppHooks";
|
||||
import { config } from "@/config/index";
|
||||
import { useLimitReached } from "@/hooks/UsePlanEntitlements";
|
||||
|
||||
@@ -27,7 +26,6 @@ const GLOBAL_REFRESH = config.GLOBAL_REFRESH;
|
||||
|
||||
const PageSpeedMonitorsPage = () => {
|
||||
const theme = useTheme();
|
||||
const { user } = useAppSelector((state) => state.auth);
|
||||
|
||||
const { t } = useTranslation();
|
||||
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
|
||||
@@ -91,8 +89,8 @@ const PageSpeedMonitorsPage = () => {
|
||||
monitorLimitReached={monitorLimitReached}
|
||||
>
|
||||
<InfoBox
|
||||
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."
|
||||
title={t("monitors.pageSpeed.infoBox.title")}
|
||||
description={t("monitors.pageSpeed.infoBox.description")}
|
||||
/>
|
||||
<HeaderCreate
|
||||
isLoading={loading}
|
||||
@@ -124,8 +122,8 @@ const PageSpeedMonitorsPage = () => {
|
||||
/>
|
||||
<Dialog
|
||||
open={isDialogOpen}
|
||||
title={t("deleteDialogTitle")}
|
||||
content={t("deleteDialogDescription")}
|
||||
title={t("common.dialog.delete.title")}
|
||||
content={t("common.dialog.delete.description")}
|
||||
onConfirm={handleConfirm}
|
||||
onCancel={handleCancel}
|
||||
loading={isDeleting}
|
||||
|
||||
@@ -16,14 +16,14 @@ const getHeaders = (t: Function, uiTimezone: string) => {
|
||||
const headers: Header<ICheck>[] = [
|
||||
{
|
||||
id: "status",
|
||||
content: t("status"),
|
||||
content: t("monitors.common.table.headers.status"),
|
||||
render: (row) => {
|
||||
return <StatusLabel status={row.status as MonitorStatus} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "date",
|
||||
content: t("date&Time"),
|
||||
content: t("monitors.common.table.headers.dateTime"),
|
||||
render: (row) => {
|
||||
return formatDateWithTz(
|
||||
row.createdAt,
|
||||
@@ -34,14 +34,14 @@ const getHeaders = (t: Function, uiTimezone: string) => {
|
||||
},
|
||||
{
|
||||
id: "message",
|
||||
content: t("message"),
|
||||
content: t("monitors.common.table.headers.message"),
|
||||
render: (row) => {
|
||||
return row.message || "N/A";
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "statusCode",
|
||||
content: t("statusCode"),
|
||||
content: t("monitors.common.table.headers.statusCode"),
|
||||
render: (row) => {
|
||||
return row.httpStatusCode || "N/A";
|
||||
},
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import Stack from "@mui/material/Stack";
|
||||
import { CheckTable } from "@/pages/uptime/CheckTable";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { IMonitor, IMonitorWithMonitorStats } from "@/types/monitor";
|
||||
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
@@ -25,7 +26,7 @@ const UptimeDetailsPage = () => {
|
||||
const { id } = useParams();
|
||||
const theme = useTheme();
|
||||
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
|
||||
|
||||
const { t } = useTranslation();
|
||||
// Local state
|
||||
const [range, setRange] = useState("2h");
|
||||
|
||||
@@ -113,13 +114,13 @@ const UptimeDetailsPage = () => {
|
||||
<Stack direction={isSmall ? "column" : "row"} gap={theme.spacing(8)}>
|
||||
<StatBox
|
||||
palette={palette}
|
||||
title="Active for"
|
||||
title={t("monitors.common.stats.activeFor")}
|
||||
subtitle={prettyMilliseconds(streakDuration, {
|
||||
secondsDecimalDigits: 0,
|
||||
})}
|
||||
/>
|
||||
<StatBox
|
||||
title="Last check"
|
||||
title={t("monitors.common.stats.lastCheck")}
|
||||
subtitle={
|
||||
lastChecked >= 0
|
||||
? `${prettyMilliseconds(lastChecked, {
|
||||
@@ -129,13 +130,13 @@ const UptimeDetailsPage = () => {
|
||||
}
|
||||
/>
|
||||
<StatBox
|
||||
title="Last response time"
|
||||
title={t("monitors.common.stats.lastResponseTime")}
|
||||
subtitle={
|
||||
stats?.lastResponseTime ? `${stats?.lastResponseTime} ms` : "N/A"
|
||||
}
|
||||
/>
|
||||
<StatBox
|
||||
title="Certificate Expiry"
|
||||
title={t("monitors.common.stats.certificate")}
|
||||
subtitle={
|
||||
stats?.certificateExpiry
|
||||
? new Date(stats.certificateExpiry).toLocaleString()
|
||||
@@ -150,13 +151,13 @@ const UptimeDetailsPage = () => {
|
||||
/>
|
||||
<Stack direction={isSmall ? "column" : "row"} gap={theme.spacing(8)}>
|
||||
<HistogramStatus
|
||||
title="Uptime"
|
||||
title={t("common.charts.uptime.upTitle")}
|
||||
status={"up"}
|
||||
checks={upChecks}
|
||||
range={range}
|
||||
/>
|
||||
<HistogramStatus
|
||||
title="Incidents"
|
||||
title={t("common.charts.uptime.downTitle")}
|
||||
checks={downChecks}
|
||||
status={"down"}
|
||||
range={range}
|
||||
|
||||
@@ -111,8 +111,8 @@ export const UptimeForm = ({
|
||||
<BasePage component={"form"} onSubmit={handleSubmit(onSubmit)}>
|
||||
{mode === "create" && (
|
||||
<ConfigBox
|
||||
title={t("distributedUptimeCreateChecks")}
|
||||
subtitle={t("distributedUptimeCreateChecksDescription")}
|
||||
title={t("monitors.uptime.form.type.title")}
|
||||
subtitle={t("monitors.uptime.form.type.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="type"
|
||||
@@ -122,26 +122,31 @@ export const UptimeForm = ({
|
||||
<RadioGroup {...field} sx={{ gap: theme.spacing(6) }}>
|
||||
<RadioWithDescription
|
||||
value="https"
|
||||
label="HTTPS"
|
||||
description="Use HTTPS to monitor your website or API endpoint.
|
||||
"
|
||||
label={t("monitors.common.form.optionHttps")}
|
||||
description={t(
|
||||
"monitors.uptime.form.type.optionHttpsDescription"
|
||||
)}
|
||||
/>
|
||||
<RadioWithDescription
|
||||
value="http"
|
||||
label={"HTTP"}
|
||||
description={
|
||||
"Use HTTP to monitor your website or API endpoint."
|
||||
}
|
||||
label={t("monitors.common.form.optionHttp")}
|
||||
description={t(
|
||||
"monitors.uptime.form.type.optionHttpDescription"
|
||||
)}
|
||||
/>
|
||||
<RadioWithDescription
|
||||
value="port"
|
||||
label={"Port"}
|
||||
description={"Check whether your port is open or not."}
|
||||
label={t("monitors.uptime.form.type.optionPort")}
|
||||
description={t(
|
||||
"monitors.uptime.form.type.optionPortDescription"
|
||||
)}
|
||||
/>
|
||||
<RadioWithDescription
|
||||
value="ping"
|
||||
label={t("pingMonitoring")}
|
||||
description={t("pingMonitoringDescription")}
|
||||
label={t("monitors.uptime.form.type.optionPing")}
|
||||
description={t(
|
||||
"monitors.uptime.form.type.optionPingDescription"
|
||||
)}
|
||||
/>
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
@@ -151,8 +156,8 @@ export const UptimeForm = ({
|
||||
/>
|
||||
)}
|
||||
<ConfigBox
|
||||
title={t("settingsGeneralSettings")}
|
||||
subtitle={t(`uptimeGeneralInstructions.${selectedType}`)}
|
||||
title={t("monitors.common.form.general.title")}
|
||||
subtitle={t(`monitors.uptime.form.general.description.${selectedType}`)}
|
||||
rightContent={
|
||||
<Stack gap={theme.spacing(8)}>
|
||||
<Controller
|
||||
@@ -173,7 +178,7 @@ export const UptimeForm = ({
|
||||
}, 0);
|
||||
}}
|
||||
type="text"
|
||||
fieldLabel={t("url")}
|
||||
fieldLabel={t("monitors.common.form.optionUrl")}
|
||||
fullWidth
|
||||
error={!!errors.url}
|
||||
helperText={errors.url ? errors.url.message : ""}
|
||||
@@ -188,7 +193,7 @@ export const UptimeForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={"Port"}
|
||||
fieldLabel={t("monitors.uptime.form.general.optionPort")}
|
||||
fullWidth
|
||||
error={!!errors.port}
|
||||
helperText={errors.port ? errors.port.message : ""}
|
||||
@@ -203,7 +208,7 @@ export const UptimeForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("displayName")}
|
||||
fieldLabel={t("monitors.common.form.optionDisplayName")}
|
||||
fullWidth
|
||||
error={!!errors.name}
|
||||
helperText={errors.name ? errors.name.message : ""}
|
||||
@@ -214,8 +219,8 @@ export const UptimeForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.incidentConfigTitle")}
|
||||
subtitle={t("createMonitorPage.incidentConfigDescriptionV2")}
|
||||
title={t("monitors.common.form.incidents.title")}
|
||||
subtitle={t("monitors.common.form.incidents.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="n"
|
||||
@@ -225,7 +230,7 @@ export const UptimeForm = ({
|
||||
{...field}
|
||||
type="number"
|
||||
fieldLabel={t(
|
||||
"createMonitorPage.incidentConfigStatusCheckNumber"
|
||||
"monitors.common.form.incidents.optionIncidentCount"
|
||||
)}
|
||||
fullWidth
|
||||
error={!!errors.n}
|
||||
@@ -240,8 +245,8 @@ export const UptimeForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("notificationConfig.title")}
|
||||
subtitle={t("notificationConfig.description")}
|
||||
title={t("monitors.common.form.notifications.title")}
|
||||
subtitle={t("monitors.common.form.notifications.description")}
|
||||
rightContent={
|
||||
<Stack>
|
||||
<Controller
|
||||
@@ -251,7 +256,12 @@ export const UptimeForm = ({
|
||||
render={({ field }) => (
|
||||
<AutoComplete
|
||||
multiple
|
||||
fieldLabel={`You have ${notificationOptions.length} available notification ${notificationOptions.length === 1 ? "channel" : "channels"}`}
|
||||
fieldLabel={t(
|
||||
"monitors.common.form.notifications.optionNotificationChannels",
|
||||
{
|
||||
count: notificationOptions.length,
|
||||
}
|
||||
)}
|
||||
options={notificationOptions}
|
||||
getOptionLabel={(option) => option.name}
|
||||
value={notificationOptions.filter((o: any) =>
|
||||
@@ -296,8 +306,8 @@ export const UptimeForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.intervalTitle")}
|
||||
subtitle="How often to check the URL"
|
||||
title={t("monitors.common.form.interval.title")}
|
||||
subtitle={t("monitors.common.form.interval.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="interval"
|
||||
@@ -306,7 +316,7 @@ export const UptimeForm = ({
|
||||
<TextInput
|
||||
{...field}
|
||||
type="text"
|
||||
fieldLabel={t("createMonitorPage.intervalDescription")}
|
||||
fieldLabel={t("monitors.common.form.interval.optionInterval")}
|
||||
fullWidth
|
||||
error={!!errors.interval}
|
||||
helperText={errors.interval ? errors.interval.message : ""}
|
||||
@@ -316,8 +326,8 @@ export const UptimeForm = ({
|
||||
}
|
||||
/>
|
||||
<ConfigBox
|
||||
title={t("createMonitorPage.rejectUnauthorizedTitle")}
|
||||
subtitle={t("createMonitorPage.rejectUnauthorizedDescription")}
|
||||
title={t("monitors.uptime.form.rejectUnauthorized.title")}
|
||||
subtitle={t("monitors.uptime.form.rejectUnauthorized.description")}
|
||||
rightContent={
|
||||
<Controller
|
||||
name="rejectUnauthorized"
|
||||
@@ -326,7 +336,11 @@ export const UptimeForm = ({
|
||||
<Stack direction="row" alignItems={"center"}>
|
||||
<Switch {...field} checked={field.value} />
|
||||
<Typography>
|
||||
{field.value ? "Enabled (recommended)" : "Disabled"}
|
||||
{field.value
|
||||
? t("monitors.uptime.form.rejectUnauthorized.optionEnabled")
|
||||
: t(
|
||||
"monitors.uptime.form.rejectUnauthorized.optionDisabled"
|
||||
)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
@@ -340,7 +354,7 @@ export const UptimeForm = ({
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
{t("settingsSave")}
|
||||
{t("common.buttons.save")}
|
||||
</Button>
|
||||
</Stack>
|
||||
</BasePage>
|
||||
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||
import { useState } from "react";
|
||||
import { useDelete } from "@/hooks/UseApi";
|
||||
import { useAppSelector } from "@/hooks/AppHooks";
|
||||
import { config } from "@/config/index";
|
||||
import { useLimitReached } from "@/hooks/UsePlanEntitlements";
|
||||
|
||||
@@ -35,7 +34,6 @@ const GLOBAL_REFRESH = config.GLOBAL_REFRESH;
|
||||
|
||||
const UptimeMonitors = () => {
|
||||
const theme = useTheme();
|
||||
const { user } = useAppSelector((state) => state.auth);
|
||||
const { t } = useTranslation();
|
||||
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
|
||||
const [selectedMonitor, setSelectedMonitor] = useState<IMonitor | null>(null);
|
||||
@@ -129,8 +127,8 @@ const UptimeMonitors = () => {
|
||||
monitorLimitReached={monitorLimitReached}
|
||||
>
|
||||
<InfoBox
|
||||
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."
|
||||
title={t("monitors.uptime.infoBox.title")}
|
||||
description={t("monitors.uptime.infoBox.description")}
|
||||
/>
|
||||
<HeaderCreate
|
||||
isLoading={loading}
|
||||
@@ -172,8 +170,8 @@ const UptimeMonitors = () => {
|
||||
/>
|
||||
<Dialog
|
||||
open={isDialogOpen}
|
||||
title={t("deleteDialogTitle")}
|
||||
content={t("deleteDialogDescription")}
|
||||
title={t("common.dialog.delete.title")}
|
||||
content={t("common.dialog.delete.description")}
|
||||
onConfirm={handleConfirm}
|
||||
onCancel={handleCancel}
|
||||
loading={isDeleting}
|
||||
|
||||
@@ -16,6 +16,7 @@ import { usePatch } from "@/hooks/UseApi";
|
||||
|
||||
import type { IMonitor } from "@/types/monitor";
|
||||
import type { ActionMenuItem } from "@/components/actions-menu";
|
||||
import type { ChartType } from "@/features/uiSlice";
|
||||
|
||||
export const MonitorTable = ({
|
||||
monitors,
|
||||
@@ -47,6 +48,9 @@ export const MonitorTable = ({
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const navigate = useNavigate();
|
||||
const chartType = useAppSelector(
|
||||
(state) => state?.ui?.chartType || "heatmap"
|
||||
);
|
||||
const {
|
||||
patch,
|
||||
// loading: isPatching,
|
||||
@@ -85,7 +89,7 @@ export const MonitorTable = ({
|
||||
return [
|
||||
{
|
||||
id: 1,
|
||||
label: "Open site",
|
||||
label: t("monitors.common.actions.openSite"),
|
||||
action: () => {
|
||||
window.open(monitor.url, "_blank", "noreferrer");
|
||||
},
|
||||
@@ -93,21 +97,21 @@ export const MonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Details",
|
||||
label: t("monitors.common.actions.details"),
|
||||
action: () => {
|
||||
navigate(`${monitor._id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: "Incidents",
|
||||
label: t("monitors.common.actions.incidents"),
|
||||
action: () => {
|
||||
navigate(`/incidents?monitorId=${monitor._id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "Configure",
|
||||
label: t("monitors.common.actions.configure"),
|
||||
action: () => {
|
||||
navigate(`/uptime/${monitor._id}/configure`);
|
||||
},
|
||||
@@ -116,12 +120,15 @@ export const MonitorTable = ({
|
||||
// id: 5,
|
||||
// label: "Clone",
|
||||
// action: () => {
|
||||
|
||||
|
||||
// },
|
||||
// },
|
||||
{
|
||||
id: 6,
|
||||
label: monitor.status === "paused" ? "Resume" : "Pause",
|
||||
label:
|
||||
monitor.status === "paused"
|
||||
? t("common.buttons.resume")
|
||||
: t("common.buttons.pause"),
|
||||
action: async () => {
|
||||
await patch(`/monitors/${monitor._id}/active`);
|
||||
refetch();
|
||||
@@ -130,7 +137,11 @@ export const MonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: <Typography color={theme.palette.error.main}>Remove</Typography>,
|
||||
label: (
|
||||
<Typography color={theme.palette.error.main}>
|
||||
{t("common.buttons.delete")}
|
||||
</Typography>
|
||||
),
|
||||
action: () => {
|
||||
setSelectedMonitor(monitor);
|
||||
},
|
||||
@@ -139,10 +150,7 @@ export const MonitorTable = ({
|
||||
];
|
||||
};
|
||||
|
||||
const getHeaders = () => {
|
||||
const chartType = useAppSelector(
|
||||
(state) => state?.ui?.chartType || "heatmap"
|
||||
);
|
||||
const getHeaders = (chartType: ChartType) => {
|
||||
const renderSortIcon = (isActive: boolean) => (
|
||||
<Box width={16} display="inline-flex" justifyContent="center">
|
||||
{isActive ? (
|
||||
@@ -165,7 +173,7 @@ export const MonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "name")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("name")}
|
||||
{t("monitors.common.table.headers.name")}
|
||||
{renderSortIcon(sortField === "name")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -185,7 +193,7 @@ export const MonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "status")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("status")}
|
||||
{t("monitors.common.table.headers.status")}
|
||||
{renderSortIcon(sortField === "status")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -195,7 +203,7 @@ export const MonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: "histogram",
|
||||
content: t("responseTime"),
|
||||
content: t("monitors.common.table.headers.responseTime"),
|
||||
render: (row) => {
|
||||
if (chartType === "histogram") {
|
||||
return <HistogramResponseTime checks={row.latestChecks} />;
|
||||
@@ -215,7 +223,7 @@ export const MonitorTable = ({
|
||||
onClick={(e) => handleSort(e, "type")}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{t("type")}
|
||||
{t("monitors.common.table.headers.type")}
|
||||
{renderSortIcon(sortField === "type")}
|
||||
</Stack>
|
||||
),
|
||||
@@ -225,7 +233,7 @@ export const MonitorTable = ({
|
||||
},
|
||||
{
|
||||
id: "actions",
|
||||
content: t("actions"),
|
||||
content: t("monitors.common.table.headers.actions"),
|
||||
render: (row) => {
|
||||
return <ActionsMenu items={getActions(row)} />;
|
||||
},
|
||||
@@ -234,7 +242,7 @@ export const MonitorTable = ({
|
||||
return headers;
|
||||
};
|
||||
|
||||
const headers = getHeaders();
|
||||
const headers = getHeaders(chartType);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
|
||||
Reference in new issue
Block a user