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

+32 -22
View File
@@ -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)} />;
},