From 4aabc1609689440d49d06ee586963e65e0a90ed7 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Sat, 28 Feb 2026 16:16:14 +0000 Subject: [PATCH 1/9] theme constants --- .gitignore | 3 ++- .../Components/design-elements/BaseChart.tsx | 7 ++++--- .../src/Components/design-elements/BasePage.tsx | 11 ++++++----- .../design-elements/BulletPointCheck.tsx | 3 ++- .../src/Components/design-elements/SplitBox.tsx | 9 +++++---- client/src/Utils/Theme/constants.ts | 17 +++++++++++++++++ 6 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 client/src/Utils/Theme/constants.ts diff --git a/.gitignore b/.gitignore index 81e5668b6..ff828c1ec 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ mongo node_modules/ docs/architecture docs/reviews -docs/todo \ No newline at end of file +docs/todo +docs/frontend \ No newline at end of file diff --git a/client/src/Components/design-elements/BaseChart.tsx b/client/src/Components/design-elements/BaseChart.tsx index 569652b20..de87395eb 100644 --- a/client/src/Components/design-elements/BaseChart.tsx +++ b/client/src/Components/design-elements/BaseChart.tsx @@ -2,6 +2,7 @@ import { BaseBox } from "."; import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; +import { LAYOUT } from "@/Utils/Theme/constants"; import type { ResponsiveStyleValue } from "@mui/system"; import { useTheme } from "@mui/material/styles"; @@ -26,7 +27,7 @@ export const BaseChart = ({ return ( {icon && ( @@ -220,7 +221,7 @@ export const BaseAuthPage = ({ return ( {title} {subtitle} {right} @@ -60,7 +61,7 @@ export const ConfigBox = ({ return ( + Date: Sat, 28 Feb 2026 16:30:04 +0000 Subject: [PATCH 2/9] table and createMonitor --- .../src/Components/design-elements/Table.tsx | 21 ++++++++------- client/src/Pages/CreateMonitor/index.tsx | 27 ++++++++++--------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/client/src/Components/design-elements/Table.tsx b/client/src/Components/design-elements/Table.tsx index 35cd4512f..505f79fea 100644 --- a/client/src/Components/design-elements/Table.tsx +++ b/client/src/Components/design-elements/Table.tsx @@ -29,6 +29,7 @@ import type { TablePaginationOwnProps } from "@mui/material/TablePagination"; import { useTranslation } from "react-i18next"; import { useState, Fragment, useEffect } from "react"; import { useTheme } from "@mui/material/styles"; +import { SPACING, LAYOUT } from "@/Utils/Theme/constants"; import type { SxProps, Theme } from "@mui/material/styles"; import useMediaQuery from "@mui/material/useMediaQuery"; @@ -90,20 +91,20 @@ export function DataTable< // Return stack of cards for small screens if (isSmall && cardsOnSmallScreens) { return ( - + {data.map((row) => { const key = row.id || row._id || Math.random(); keys.push(key); return ( (onRowClick ? onRowClick(row) : null)} - spacing={theme.spacing(4)} + spacing={theme.spacing(LAYOUT.XS)} sx={{ borderStyle: "solid", borderWidth: 1, borderColor: theme.palette.divider, borderRadius: theme.shape.borderRadius, - padding: theme.spacing(4), + padding: theme.spacing(LAYOUT.XS), cursor: onRowClick ? "pointer" : "default", }} key={key} @@ -155,7 +156,7 @@ export function DataTable< { display: "grid", gridTemplateColumns: "1fr 1fr", gridAutoRows: "auto", - rowGap: theme.spacing(1), + rowGap: theme.spacing(SPACING.SM), alignItems: "center", justifyItems: "center", paddingLeft: 0, @@ -556,8 +557,8 @@ const EmptyView = ({ text, positive }: { text?: string; positive?: boolean }) => alignItems={"center"} justifyContent={"center"} sx={{ - py: theme.spacing(12), - px: theme.spacing(4), + py: theme.spacing(LAYOUT.XL), + px: theme.spacing(LAYOUT.XS), borderWidth: 1, borderStyle: "solid", borderColor: theme.palette.divider, @@ -574,7 +575,7 @@ const EmptyView = ({ text, positive }: { text?: string; positive?: boolean }) => display: "flex", alignItems: "center", justifyContent: "center", - mb: theme.spacing(2), + mb: theme.spacing(SPACING.LG), }} > { { title={t("pages.createMonitor.form.general.title")} subtitle={t(`pages.createMonitor.form.general.description.${watchedType}`)} rightContent={ - + {/* URL/Host/Container field - not shown for hardware */} {generalSettingsConfig.showUrl && ( { title={t("pages.createMonitor.form.thresholds.title")} subtitle={t("pages.createMonitor.form.thresholds.description")} rightContent={ - + { title={t("pages.createMonitor.form.incidents.title")} subtitle={t("pages.createMonitor.form.incidents.description")} rightContent={ - + { (field.value ?? []).includes(n.id) ); return ( - + { { title={t("pages.createMonitor.form.advanced.title")} subtitle={t("pages.createMonitor.form.advanced.description")} rightContent={ - + { { )} /> {watchedUseAdvancedMatching && ( - + { title={t("pages.createMonitor.form.geoChecks.title")} subtitle={t("pages.createMonitor.form.geoChecks.description")} rightContent={ - + { { )} /> {watchGeoCheckEnabled && ( - + { (field.value ?? []).includes(loc.id) ); return ( - + Date: Sat, 28 Feb 2026 20:25:49 +0000 Subject: [PATCH 3/9] settings page --- client/src/Pages/Settings/index.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index 3e27509e6..44fb4a42f 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -1,6 +1,7 @@ import { BasePage, ConfigBox, TextLink } from "@/Components/design-elements"; import { Autocomplete, Select, Dialog, SwitchComponent } from "@/Components/inputs"; import { logger } from "@/Utils/logger"; +import { LAYOUT } from "@/Utils/Theme/constants"; import { Stack, useTheme, @@ -299,7 +300,7 @@ export const SettingsPage = () => { component="form" onSubmit={form.handleSubmit(onSubmit, onError)} > - + { title={t("pages.settings.form.ui.title")} subtitle={t("pages.settings.form.ui.description")} rightContent={ - + { bottom: 0, backgroundColor: theme.palette.background.paper, borderTop: `1px solid ${theme.palette.divider}`, - padding: theme.spacing(8), - marginLeft: theme.spacing(-8), - marginRight: theme.spacing(-8), - marginBottom: theme.spacing(-8), + padding: theme.spacing(LAYOUT.MD), + marginLeft: theme.spacing(-LAYOUT.MD), + marginRight: theme.spacing(-LAYOUT.MD), + marginBottom: theme.spacing(-LAYOUT.MD), zIndex: 1000, }} > From db8ed2994af0cda25acb873769b434101244cfeb Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Sat, 28 Feb 2026 20:42:10 +0000 Subject: [PATCH 4/9] maintenance create --- client/src/Pages/Maintenance/create/index.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/Pages/Maintenance/create/index.tsx b/client/src/Pages/Maintenance/create/index.tsx index e5293c897..d130ee7c7 100644 --- a/client/src/Pages/Maintenance/create/index.tsx +++ b/client/src/Pages/Maintenance/create/index.tsx @@ -3,6 +3,7 @@ import MenuItem from "@mui/material/MenuItem"; import { logger } from "@/Utils/logger"; import Typography from "@mui/material/Typography"; import IconButton from "@mui/material/IconButton"; +import { SPACING, LAYOUT } from "@/Utils/Theme/constants"; import { BasePage, ConfigBox } from "@/Components/design-elements"; import { TextField, @@ -121,7 +122,7 @@ const CreateMaintenanceWindowPage = () => { title={t("pages.maintenanceWindow.form.general.title")} subtitle={t("pages.maintenanceWindow.form.general.description")} rightContent={ - + { title={t("pages.maintenanceWindow.form.startDate.title")} subtitle={t("pages.maintenanceWindow.form.startDate.description")} rightContent={ - + { title={t("pages.maintenanceWindow.form.startTime.title")} subtitle={t("pages.maintenanceWindow.form.startTime.description")} rightContent={ - + { { .filter((m): m is Monitor => m !== undefined); return ( - + { key={monitor.id} direction="row" alignItems="center" - spacing={theme.spacing(4)} - padding={theme.spacing(4)} - marginTop={theme.spacing(2)} + padding={theme.spacing(LAYOUT.XS)} + marginTop={theme.spacing(SPACING.LG)} borderRadius={1} sx={{ border: `1px solid ${theme.palette.divider}`, @@ -351,7 +351,7 @@ const CreateMaintenanceWindowPage = () => {