From 248482a406abbaba16d10dab5fa13d627026dd6c Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Feb 2026 19:59:03 +0000 Subject: [PATCH 01/21] initial commit --- client/src/Pages/Settings/index.tsx | 136 ++++++++++++++++++ .../src/Pages/Settings/{index.jsx => old.jsx} | 0 client/src/Routes/index.tsx | 13 +- client/src/locales/en.json | 33 ++++- 4 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 client/src/Pages/Settings/index.tsx rename client/src/Pages/Settings/{index.jsx => old.jsx} (100%) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx new file mode 100644 index 000000000..c1b3ecdfa --- /dev/null +++ b/client/src/Pages/Settings/index.tsx @@ -0,0 +1,136 @@ +import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; +import { Autocomplete, Select } from "@/Components/v2/inputs"; +import { Stack, useTheme, MenuItem, type SelectChangeEvent } from "@mui/material"; +import { useTranslation } from "react-i18next"; +import { useSelector, useDispatch } from "react-redux"; +import DummyChart from "@/Pages/Settings/DummyChart"; + +import { + setTimezone, + setMode, + setLanguage, + setChartType, + type ThemeMode, + type ChartType, +} from "@/Features/UI/uiSlice.js"; +import timezones from "@/Utils/timezones.json"; +import type { RootState } from "@/Types/state"; + +interface Timezone { + id: string; + name: string; +} + +export const SettingsPage = () => { + const theme = useTheme(); + const { t, i18n } = useTranslation(); + const dispatch = useDispatch(); + const { + timezone: selectedTimezoneId, + mode, + language = "en", + chartType = "histogram", + } = useSelector((state: RootState) => state.ui); + + // Convert timezones to match AutoComplete format (id instead of _id) + const timezoneOptions: Timezone[] = timezones.map((tz) => ({ + id: tz._id, + name: tz.name, + })); + + const selectedTimezone = + timezoneOptions.find((tz) => tz.id === selectedTimezoneId) ?? null; + + const handleTimezoneChange = (newValue: Timezone | null) => { + const newId = newValue?.id ?? ""; + dispatch(setTimezone({ timezone: newId })); + }; + + const handleModeChange = (e: SelectChangeEvent) => { + dispatch(setMode(e.target.value)); + }; + + const handleLanguageChange = (e: SelectChangeEvent) => { + dispatch(setLanguage(e.target.value)); + }; + + const handleChartTypeChange = (e: SelectChangeEvent) => { + dispatch(setChartType(e.target.value)); + }; + + const languages = Object.keys(i18n.options.resources || {}); + + return ( + + + option.name} + isOptionEqualToValue={(option: Timezone, value: Timezone) => + option.id === value.id + } + onChange={(_, newValue) => { + handleTimezoneChange(newValue as Timezone | null); + }} + fieldLabel={t("pages.settings.form.timezone.option.timezone.label")} + /> + } + /> + + + + + + + } + /> + + + ); +}; + +export default SettingsPage; diff --git a/client/src/Pages/Settings/index.jsx b/client/src/Pages/Settings/old.jsx similarity index 100% rename from client/src/Pages/Settings/index.jsx rename to client/src/Pages/Settings/old.jsx diff --git a/client/src/Routes/index.tsx b/client/src/Routes/index.tsx index e3c0b0667..582461d81 100644 --- a/client/src/Routes/index.tsx +++ b/client/src/Routes/index.tsx @@ -44,6 +44,7 @@ import CreateNotifications from "@/Pages/Notifications/create"; import Account from "@/Pages/Account"; import EditUser from "@/Pages/Account/EditUser"; import Settings from "@/Pages/Settings"; +import OldSettings from "@/Pages/Settings/old.jsx"; import Maintenance from "@/Pages/Maintenance"; import CreateNewMaintenanceWindow from "@/Pages/Maintenance/create"; @@ -319,7 +320,17 @@ const Routes = () => { /> } + element={ + <> + + + + + } + /> + } /> Date: Wed, 18 Feb 2026 20:04:53 +0000 Subject: [PATCH 02/21] fix state type --- client/src/Types/state.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/Types/state.ts b/client/src/Types/state.ts index b5bfcfdb8..d8d291fc7 100644 --- a/client/src/Types/state.ts +++ b/client/src/Types/state.ts @@ -1,3 +1,4 @@ +import type { ChartType } from "@/Features/UI/uiSlice"; import type { User } from "./User"; export interface AuthState { @@ -37,7 +38,7 @@ export interface UIState { distributedUptimeEnabled: boolean; language: string; starPromptOpen: boolean; - chartType: string; + chartType: ChartType; } export interface RootState { From cdbf5fd0c0b24b62cefdddeb5c4345a0df3a52e1 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Feb 2026 20:14:35 +0000 Subject: [PATCH 03/21] simplify form --- client/src/Pages/Settings/index.tsx | 25 +++++++- client/src/Validation/settings.ts | 92 ++++++++++++----------------- 2 files changed, 61 insertions(+), 56 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index c1b3ecdfa..c389c6159 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -1,9 +1,15 @@ import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; import { Autocomplete, Select } from "@/Components/v2/inputs"; import { Stack, useTheme, MenuItem, type SelectChangeEvent } from "@mui/material"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; import { useTranslation } from "react-i18next"; import { useSelector, useDispatch } from "react-redux"; import DummyChart from "@/Pages/Settings/DummyChart"; +import { useGet } from "@/Hooks/UseApi"; +import { useSettingsForm } from "@/Hooks/useSettingsForm"; +import type { SettingsFormData } from "@/Validation/settings"; import { setTimezone, @@ -25,6 +31,23 @@ export const SettingsPage = () => { const theme = useTheme(); const { t, i18n } = useTranslation(); const dispatch = useDispatch(); + + // Fetch settings data from API + const { data: fetchedSettings } = useGet("/settings"); + + // Initialize form with schema and defaults + const { schema, defaults } = useSettingsForm({ data: fetchedSettings?.settings }); + + const form = useForm({ + resolver: zodResolver(schema), + defaultValues: defaults, + }); + + // Reset form when defaults change + useEffect(() => { + form.reset(defaults); + }, [defaults, form]); + const { timezone: selectedTimezoneId, mode, @@ -61,7 +84,7 @@ export const SettingsPage = () => { const languages = Object.keys(i18n.options.resources || {}); return ( - + - z.preprocess( - (val) => - val === "" || val === null || val === undefined ? undefined : String(val).trim(), - z.string().optional() - ); - -// Helper for threshold fields -const thresholdField = (min: number, max: number, unit: string) => - z.preprocess( - (val) => (val === "" || val === null || val === undefined ? undefined : val), - z.coerce - .number() - .int() - .min(min, `Min ${min}${unit}`) - .max(max, `Max ${max}${unit}`) - .optional() - ); - export const settingsSchema = z.object({ systemEmailIgnoreTLS: z.boolean(), systemEmailRequireTLS: z.boolean(), systemEmailRejectUnauthorized: z.boolean(), - systemEmailConnectionHost: optionalString(), + systemEmailConnectionHost: z + .string() + .transform((val) => (val.trim() === "" ? undefined : val.trim())) + .optional(), systemEmailSecure: z.boolean().optional(), systemEmailPool: z.boolean().optional(), showURL: z.boolean().optional(), - checkTTL: z.coerce - .number() - .int() - .min(1, "Please enter a value") - .max(365, "Maximum 365 days"), - pagespeedApiKey: optionalString(), - systemEmailHost: z.preprocess( - (val) => - val === "" || val === null || val === undefined ? undefined : String(val).trim(), - z - .string() - .regex(/^[a-zA-Z0-9.-]+$/, "Invalid hostname or IP address") - .optional() - ), - systemEmailPort: z.preprocess( - (val) => (val === "" || val === null || val === undefined ? undefined : val), - z.coerce - .number() - .int() - .min(1, "Port must be at least 1") - .max(65535, "Port must be at most 65535") - .optional() - ), - systemEmailAddress: z.preprocess((val) => { - if (val === "" || val === null || val === undefined) return undefined; - return String(val).toLowerCase().trim(); - }, z.string().email("Please enter a valid email address").optional()), - systemEmailUser: optionalString(), - systemEmailPassword: optionalString(), - systemEmailTLSServername: optionalString(), + checkTTL: z.number().int().min(1, "Please enter a value").max(365, "Maximum 365 days"), + pagespeedApiKey: z + .string() + .transform((val) => (val.trim() === "" ? undefined : val.trim())) + .optional(), + systemEmailHost: z + .string() + .regex(/^[a-zA-Z0-9.-]*$/, "Invalid hostname or IP address") + .transform((val) => (val.trim() === "" ? undefined : val.trim())) + .optional(), + systemEmailPort: z.number().int().min(1).max(65535).optional(), + systemEmailAddress: z + .string() + .email("Please enter a valid email address") + .or(z.literal("")) + .transform((val) => (val === "" ? undefined : val.toLowerCase().trim())) + .optional(), + systemEmailUser: z + .string() + .transform((val) => (val.trim() === "" ? undefined : val.trim())) + .optional(), + systemEmailPassword: z + .string() + .transform((val) => (val.trim() === "" ? undefined : val.trim())) + .optional(), + systemEmailTLSServername: z + .string() + .transform((val) => (val.trim() === "" ? undefined : val.trim())) + .optional(), globalThresholds: z .object({ - cpu: thresholdField(0, 100, "%"), - memory: thresholdField(0, 100, "%"), - disk: thresholdField(0, 100, "%"), - temperature: thresholdField(0, 150, "°C"), + cpu: z.number().int().min(0).max(100).optional(), + memory: z.number().int().min(0).max(100).optional(), + disk: z.number().int().min(0).max(100).optional(), + temperature: z.number().int().min(0).max(150).optional(), }) .optional(), }); From d8e7f9fc0f6d31d25f756f466fda804dedd318ab Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Feb 2026 20:20:45 +0000 Subject: [PATCH 04/21] add pagespeed config --- client/src/Pages/Settings/index.tsx | 91 ++++++++++++++++++++++++++++- client/src/locales/en.json | 13 ++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index c389c6159..979c013ff 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -9,7 +9,12 @@ import { useSelector, useDispatch } from "react-redux"; import DummyChart from "@/Pages/Settings/DummyChart"; import { useGet } from "@/Hooks/UseApi"; import { useSettingsForm } from "@/Hooks/useSettingsForm"; +import { useIsAdmin } from "@/Hooks/useIsAdmin.js"; import type { SettingsFormData } from "@/Validation/settings"; +import { useState } from "react"; +import { Controller } from "react-hook-form"; +import { TextField, Button } from "@/Components/v2/inputs"; +import { Typography, Box } from "@mui/material"; import { setTimezone, @@ -27,13 +32,26 @@ interface Timezone { name: string; } +interface SettingsResponse { + settings: any; + pagespeedKeySet: boolean; + emailPasswordSet: boolean; +} + export const SettingsPage = () => { const theme = useTheme(); const { t, i18n } = useTranslation(); const dispatch = useDispatch(); + const isAdmin = useIsAdmin(); // Fetch settings data from API - const { data: fetchedSettings } = useGet("/settings"); + const { data: fetchedSettings } = useGet("/settings"); + + // Local state for API key reset + const [isApiKeySet, setIsApiKeySet] = useState( + fetchedSettings?.pagespeedKeySet ?? false + ); + const [apiKeyHasBeenReset, setApiKeyHasBeenReset] = useState(false); // Initialize form with schema and defaults const { schema, defaults } = useSettingsForm({ data: fetchedSettings?.settings }); @@ -48,6 +66,13 @@ export const SettingsPage = () => { form.reset(defaults); }, [defaults, form]); + // Update isApiKeySet when fetchedSettings changes + useEffect(() => { + if (fetchedSettings) { + setIsApiKeySet(fetchedSettings.pagespeedKeySet); + } + }, [fetchedSettings]); + const { timezone: selectedTimezoneId, mode, @@ -81,6 +106,11 @@ export const SettingsPage = () => { dispatch(setChartType(e.target.value)); }; + const handleResetApiKey = () => { + form.setValue("pagespeedApiKey", ""); + setApiKeyHasBeenReset(true); + }; + const languages = Object.keys(i18n.options.resources || {}); return ( @@ -151,6 +181,65 @@ export const SettingsPage = () => { } /> + {isAdmin && ( + + {(isApiKeySet === false || apiKeyHasBeenReset === true) && ( + ( + + )} + /> + )} + + {isApiKeySet === true && apiKeyHasBeenReset === false && ( + + + {t("pages.settings.pageSpeedSettings.labelApiKeySet")} + + + + )} + + } + /> + )} + + + ); diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 8d4e62a57..8bae5dcd0 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -38,7 +38,8 @@ "toggleTheme": "Toggles light & dark", "flushQueue": "Flush queue", "notFound": "Go to the main dashboard", - "resetPassword": "Reset password" + "resetPassword": "Reset password", + "reset": "Reset" }, "charts": { "labels": { @@ -936,6 +937,16 @@ "heatmap": "Heatmap" } } + }, + "pagespeed": { + "title": "Google PageSpeed API key", + "description": "Enter your Google PageSpeed API key to enable Google PageSpeed monitoring. Click Reset to update the key.", + "option": { + "apiKey": { + "label": "PageSpeed API key", + "placeholder": "Enter your Google PageSpeed API key" + } + } } } }, From a59f7fd830bbfc7e0dde5a6f06fcbcc1a400e895 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Feb 2026 20:35:46 +0000 Subject: [PATCH 05/21] pagespeed --- client/src/Pages/Settings/index.tsx | 91 +++++++++++++++++++++++------ client/src/locales/en.json | 1 + 2 files changed, 74 insertions(+), 18 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index 979c013ff..d0ad5a6e0 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -7,13 +7,13 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useTranslation } from "react-i18next"; import { useSelector, useDispatch } from "react-redux"; import DummyChart from "@/Pages/Settings/DummyChart"; -import { useGet } from "@/Hooks/UseApi"; +import { useGet, usePatch } from "@/Hooks/UseApi"; import { useSettingsForm } from "@/Hooks/useSettingsForm"; import { useIsAdmin } from "@/Hooks/useIsAdmin.js"; import type { SettingsFormData } from "@/Validation/settings"; import { useState } from "react"; import { Controller } from "react-hook-form"; -import { TextField, Button } from "@/Components/v2/inputs"; +import { TextField, FieldLabel, Button } from "@/Components/v2/inputs"; import { Typography, Box } from "@mui/material"; import { @@ -46,6 +46,8 @@ export const SettingsPage = () => { // Fetch settings data from API const { data: fetchedSettings } = useGet("/settings"); + // Form submission + const { patch, loading: isSaving } = usePatch(); // Local state for API key reset const [isApiKeySet, setIsApiKeySet] = useState( @@ -111,10 +113,49 @@ export const SettingsPage = () => { setApiKeyHasBeenReset(true); }; + const onSubmit = async (data: SettingsFormData) => { + // Convert undefined to empty string for backend unsetting + const processedData = Object.entries(data).reduce((acc, [key, value]) => { + const typedKey = key as keyof SettingsFormData; + if (value === undefined) { + (acc as any)[typedKey] = ""; + } else if (typeof value === "object" && value !== null) { + // Handle nested objects like globalThresholds + (acc as any)[typedKey] = Object.entries(value).reduce( + (nested, [nestedKey, nestedValue]) => ({ + ...nested, + [nestedKey]: nestedValue === undefined ? "" : nestedValue, + }), + {} + ); + } else { + (acc as any)[typedKey] = value; + } + return acc; + }, {} as Partial); + + const result = await patch("/settings", processedData as SettingsFormData); + + if (result?.success) { + // Update API key state from response + if (result.data) { + setIsApiKeySet(result.data.pagespeedKeySet); + setApiKeyHasBeenReset(false); + } + } + }; + + const onError = (errors: unknown) => { + console.log("Form validation errors:", errors); + }; + const languages = Object.keys(i18n.options.resources || {}); return ( - + { {isApiKeySet === true && apiKeyHasBeenReset === false && ( - - {t("pages.settings.pageSpeedSettings.labelApiKeySet")} - + + {t("pages.settings.form.pagespeed.option.apiKey.labelSet")} + - + {t("common.buttons.save")} + ); diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 8bae5dcd0..75b4eafc3 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -944,6 +944,7 @@ "option": { "apiKey": { "label": "PageSpeed API key", + "labelSet": "API key is set. Click Reset to change it.", "placeholder": "Enter your Google PageSpeed API key" } } From d4e72ee8a6938031f92b7b2e9a39e5ba4ce038d0 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Feb 2026 21:02:08 +0000 Subject: [PATCH 06/21] url settigns --- client/src/Pages/Settings/index.tsx | 36 +++++++++++++++++++++++++++-- client/src/locales/en.json | 22 ++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index d0ad5a6e0..b71f353d1 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -13,8 +13,8 @@ import { useIsAdmin } from "@/Hooks/useIsAdmin.js"; import type { SettingsFormData } from "@/Validation/settings"; import { useState } from "react"; import { Controller } from "react-hook-form"; -import { TextField, FieldLabel, Button } from "@/Components/v2/inputs"; -import { Typography, Box } from "@mui/material"; +import { TextField, Button, FieldLabel } from "@/Components/v2/inputs"; +import { Box } from "@mui/material"; import { setTimezone, @@ -268,6 +268,38 @@ export const SettingsPage = () => { } /> )} + + {/* URL Settings */} + ( + + )} + /> + } + /> {/* Sticky Save Button */} diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 75b4eafc3..c33d3dbfd 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -544,6 +544,17 @@ "label": "Temperature alert threshold (°C)" } } + }, + "url": { + "title": "Monitor IP/URL on Status Page", + "description": "Display the IP address or URL of monitor on the public Status page. If it's disabled, only the monitor name will be shown to protect sensitive information.", + "option": { + "showURL": { + "label": "Display IP/URL on status page", + "enabled": "Enabled", + "disabled": "Disabled" + } + } } } }, @@ -948,6 +959,17 @@ "placeholder": "Enter your Google PageSpeed API key" } } + }, + "url": { + "title": "Monitor IP/URL on Status Page", + "description": "Display the IP address or URL of monitor on the public Status page. If it's disabled, only the monitor name will be shown to protect sensitive information.", + "option": { + "showURL": { + "label": "Display IP/URL on status page", + "enabled": "Enabled", + "disabled": "Disabled" + } + } } } }, From b5f2a7b26cb1674cb56f5df514e1e37592eaa99a Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Feb 2026 21:06:29 +0000 Subject: [PATCH 07/21] Fix pagespeed key issue --- client/src/Pages/Settings/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index b71f353d1..da3142cfb 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -114,8 +114,14 @@ export const SettingsPage = () => { }; const onSubmit = async (data: SettingsFormData) => { + // Don't send pagespeedApiKey if it's already set and user hasn't clicked reset + const dataToSend = { ...data }; + if (isApiKeySet && !apiKeyHasBeenReset) { + delete (dataToSend as any).pagespeedApiKey; + } + // Convert undefined to empty string for backend unsetting - const processedData = Object.entries(data).reduce((acc, [key, value]) => { + const processedData = Object.entries(dataToSend).reduce((acc, [key, value]) => { const typedKey = key as keyof SettingsFormData; if (value === undefined) { (acc as any)[typedKey] = ""; From a3a25b2adddda0e8c18585634a2cb3f1849114a4 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 19 Feb 2026 17:28:00 +0000 Subject: [PATCH 08/21] clear-stats --- client/src/Pages/Settings/index.tsx | 38 ++++++++++++++++++++++++++++- client/src/locales/en.json | 26 +++++++++++++++++++- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index da3142cfb..270e0a26f 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -1,5 +1,5 @@ import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; -import { Autocomplete, Select } from "@/Components/v2/inputs"; +import { Autocomplete, Select, Dialog } from "@/Components/v2/inputs"; import { Stack, useTheme, MenuItem, type SelectChangeEvent } from "@mui/material"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; @@ -15,6 +15,7 @@ import { useState } from "react"; import { Controller } from "react-hook-form"; import { TextField, Button, FieldLabel } from "@/Components/v2/inputs"; import { Box } from "@mui/material"; +import { useDelete } from "@/Hooks/UseApi"; import { setTimezone, @@ -54,6 +55,9 @@ export const SettingsPage = () => { fetchedSettings?.pagespeedKeySet ?? false ); const [apiKeyHasBeenReset, setApiKeyHasBeenReset] = useState(false); + // Local state for clear stats dialog + const [isStatsDialogOpen, setIsStatsDialogOpen] = useState(false); + const { deleteFn: deleteStats, loading: isDeletingStats } = useDelete(); // Initialize form with schema and defaults const { schema, defaults } = useSettingsForm({ data: fetchedSettings?.settings }); @@ -113,6 +117,11 @@ export const SettingsPage = () => { setApiKeyHasBeenReset(true); }; + const handleClearStats = async () => { + await deleteStats("/checks/team"); + setIsStatsDialogOpen(false); + }; + const onSubmit = async (data: SettingsFormData) => { // Don't send pagespeedApiKey if it's already set and user hasn't clicked reset const dataToSend = { ...data }; @@ -306,8 +315,35 @@ export const SettingsPage = () => { /> } /> + + {/* Clear All Stats */} + {isAdmin && ( + setIsStatsDialogOpen(true)} + > + {t("common.buttons.clear")} + + } + /> + )} + {/* Clear Stats Confirmation Dialog */} + setIsStatsDialogOpen(false)} + onConfirm={handleClearStats} + loading={isDeletingStats} + /> + {/* Sticky Save Button */} Date: Thu, 19 Feb 2026 17:33:28 +0000 Subject: [PATCH 09/21] add global thresholds configbox --- client/src/Pages/Settings/index.tsx | 85 ++++++++++++++++++++++++++++- client/src/locales/en.json | 22 ++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index 270e0a26f..b5d93b12e 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -327,11 +327,93 @@ export const SettingsPage = () => { color="error" onClick={() => setIsStatsDialogOpen(true)} > - {t("common.buttons.clear")} + {t("pages.settings.form.stats.buttonText")} } /> )} + + {/* Global Thresholds */} + {isAdmin && ( + + ( + + )} + /> + ( + + )} + /> + ( + + )} + /> + ( + + )} + /> + + } + /> + )} {/* Clear Stats Confirmation Dialog */} @@ -370,6 +452,7 @@ export const SettingsPage = () => { {t("common.buttons.save")} +
{JSON.stringify(form.formState.isValid, null, 2)}
); }; diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 2af79c1f7..ef7ea8591 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -994,6 +994,28 @@ "title": "Clear all monitoring history?", "description": "This cannot be undone" } + }, + "thresholds": { + "title": "Global Thresholds", + "description": "Set global CPU, Memory, Disk, and Temperature thresholds for infrastructure monitoring. These apply to all hardware monitors unless overridden.", + "option": { + "cpu": { + "label": "CPU Threshold (%)", + "placeholder": "0 - 100" + }, + "memory": { + "label": "Memory Threshold (%)", + "placeholder": "0 - 100" + }, + "disk": { + "label": "Disk Threshold (%)", + "placeholder": "0 - 100" + }, + "temperature": { + "label": "Temperature Threshold (°C)", + "placeholder": "0 - 150" + } + } } } }, From f2779160a1c1a0ad7397b59ecf313f17029c6b93 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 19 Feb 2026 17:55:55 +0000 Subject: [PATCH 10/21] port --- client/src/Hooks/useSettingsForm.ts | 8 +++---- client/src/Pages/Settings/index.tsx | 36 ++++++++++++++++++++++++++--- client/src/Validation/settings.ts | 8 +++---- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/client/src/Hooks/useSettingsForm.ts b/client/src/Hooks/useSettingsForm.ts index ee4227970..ce04a81e2 100644 --- a/client/src/Hooks/useSettingsForm.ts +++ b/client/src/Hooks/useSettingsForm.ts @@ -22,10 +22,10 @@ export const useSettingsForm = ({ data = null }: UseSettingsFormOptions = {}) => systemEmailTLSServername: data?.systemEmailTLSServername || "", systemEmailPort: data?.systemEmailPort, globalThresholds: { - cpu: data?.globalThresholds?.cpu, - memory: data?.globalThresholds?.memory, - disk: data?.globalThresholds?.disk, - temperature: data?.globalThresholds?.temperature, + cpu: data?.globalThresholds?.cpu ?? 0, + memory: data?.globalThresholds?.memory ?? 0, + disk: data?.globalThresholds?.disk ?? 0, + temperature: data?.globalThresholds?.temperature ?? 0, }, checkTTL: data?.checkTTL ?? 30, pagespeedApiKey: "", diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index b5d93b12e..66fb65f8d 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -65,6 +65,7 @@ export const SettingsPage = () => { const form = useForm({ resolver: zodResolver(schema), defaultValues: defaults, + mode: "onChange", }); // Reset form when defaults change @@ -136,10 +137,12 @@ export const SettingsPage = () => { (acc as any)[typedKey] = ""; } else if (typeof value === "object" && value !== null) { // Handle nested objects like globalThresholds + // Convert 0 to "" for unsetting thresholds (acc as any)[typedKey] = Object.entries(value).reduce( (nested, [nestedKey, nestedValue]) => ({ ...nested, - [nestedKey]: nestedValue === undefined ? "" : nestedValue, + [nestedKey]: + nestedValue === undefined || nestedValue === 0 ? "" : nestedValue, }), {} ); @@ -327,7 +330,7 @@ export const SettingsPage = () => { color="error" onClick={() => setIsStatsDialogOpen(true)} > - {t("pages.settings.form.stats.buttonText")} + {t("common.buttons.clear")} } /> @@ -347,6 +350,13 @@ export const SettingsPage = () => { render={({ field, fieldState }) => ( { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} fieldLabel={t("pages.settings.form.thresholds.option.cpu.label")} type="number" placeholder={t( @@ -364,6 +374,13 @@ export const SettingsPage = () => { render={({ field, fieldState }) => ( { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} fieldLabel={t("pages.settings.form.thresholds.option.memory.label")} type="number" placeholder={t( @@ -381,6 +398,13 @@ export const SettingsPage = () => { render={({ field, fieldState }) => ( { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} fieldLabel={t("pages.settings.form.thresholds.option.disk.label")} type="number" placeholder={t( @@ -398,6 +422,13 @@ export const SettingsPage = () => { render={({ field, fieldState }) => ( { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} fieldLabel={t( "pages.settings.form.thresholds.option.temperature.label" )} @@ -452,7 +483,6 @@ export const SettingsPage = () => { {t("common.buttons.save")} -
{JSON.stringify(form.formState.isValid, null, 2)}
); }; diff --git a/client/src/Validation/settings.ts b/client/src/Validation/settings.ts index 25390b241..5f6a06fd1 100644 --- a/client/src/Validation/settings.ts +++ b/client/src/Validation/settings.ts @@ -42,10 +42,10 @@ export const settingsSchema = z.object({ .optional(), globalThresholds: z .object({ - cpu: z.number().int().min(0).max(100).optional(), - memory: z.number().int().min(0).max(100).optional(), - disk: z.number().int().min(0).max(100).optional(), - temperature: z.number().int().min(0).max(150).optional(), + cpu: z.number().int().min(0).max(100), + memory: z.number().int().min(0).max(100), + disk: z.number().int().min(0).max(100), + temperature: z.number().int().min(0).max(150), }) .optional(), }); From 9283890b5fc5aa89b544e286430abe5e728dccce Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 19 Feb 2026 18:01:15 +0000 Subject: [PATCH 11/21] 0 handling --- client/src/Validation/settings.ts | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/client/src/Validation/settings.ts b/client/src/Validation/settings.ts index 5f6a06fd1..f292222d0 100644 --- a/client/src/Validation/settings.ts +++ b/client/src/Validation/settings.ts @@ -42,10 +42,30 @@ export const settingsSchema = z.object({ .optional(), globalThresholds: z .object({ - cpu: z.number().int().min(0).max(100), - memory: z.number().int().min(0).max(100), - disk: z.number().int().min(0).max(100), - temperature: z.number().int().min(0).max(150), + cpu: z + .number() + .int() + .min(1, "Please enter a value") + .max(100, "Maximum value is 100") + .optional(), + memory: z + .number() + .int() + .min(1, "Please enter a value") + .max(100, "Maximum value is 100") + .optional(), + disk: z + .number() + .int() + .min(1, "Please enter a value") + .max(100, "Maximum value is 100") + .optional(), + temperature: z + .number() + .int() + .min(1, "Please enter a value") + .max(150, "Maximum value is 150") + .optional(), }) .optional(), }); From 889bb0794691a2934a7fdbdb7d14b9516dcbdbee Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 19 Feb 2026 18:04:34 +0000 Subject: [PATCH 12/21] min values --- client/src/Pages/Settings/index.tsx | 4 ++++ client/src/Validation/settings.ts | 8 ++++---- client/src/locales/en.json | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index 66fb65f8d..077755bf1 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -359,6 +359,7 @@ export const SettingsPage = () => { }} fieldLabel={t("pages.settings.form.thresholds.option.cpu.label")} type="number" + inputProps={{ min: 0 }} placeholder={t( "pages.settings.form.thresholds.option.cpu.placeholder" )} @@ -383,6 +384,7 @@ export const SettingsPage = () => { }} fieldLabel={t("pages.settings.form.thresholds.option.memory.label")} type="number" + inputProps={{ min: 0 }} placeholder={t( "pages.settings.form.thresholds.option.memory.placeholder" )} @@ -407,6 +409,7 @@ export const SettingsPage = () => { }} fieldLabel={t("pages.settings.form.thresholds.option.disk.label")} type="number" + inputProps={{ min: 0 }} placeholder={t( "pages.settings.form.thresholds.option.disk.placeholder" )} @@ -433,6 +436,7 @@ export const SettingsPage = () => { "pages.settings.form.thresholds.option.temperature.label" )} type="number" + inputProps={{ min: 0 }} placeholder={t( "pages.settings.form.thresholds.option.temperature.placeholder" )} diff --git a/client/src/Validation/settings.ts b/client/src/Validation/settings.ts index f292222d0..4c89a4c2c 100644 --- a/client/src/Validation/settings.ts +++ b/client/src/Validation/settings.ts @@ -45,25 +45,25 @@ export const settingsSchema = z.object({ cpu: z .number() .int() - .min(1, "Please enter a value") + .min(1, "Please enter a valid value") .max(100, "Maximum value is 100") .optional(), memory: z .number() .int() - .min(1, "Please enter a value") + .min(1, "Please enter a valid value") .max(100, "Maximum value is 100") .optional(), disk: z .number() .int() - .min(1, "Please enter a value") + .min(1, "Please enter a valid value") .max(100, "Maximum value is 100") .optional(), temperature: z .number() .int() - .min(1, "Please enter a value") + .min(1, "Please enter a valid value") .max(150, "Maximum value is 150") .optional(), }) diff --git a/client/src/locales/en.json b/client/src/locales/en.json index ef7ea8591..9ce42a067 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -1001,19 +1001,19 @@ "option": { "cpu": { "label": "CPU Threshold (%)", - "placeholder": "0 - 100" + "placeholder": "1 - 100" }, "memory": { "label": "Memory Threshold (%)", - "placeholder": "0 - 100" + "placeholder": "1 - 100" }, "disk": { "label": "Disk Threshold (%)", - "placeholder": "0 - 100" + "placeholder": "1 - 100" }, "temperature": { "label": "Temperature Threshold (°C)", - "placeholder": "0 - 150" + "placeholder": "1 - 150" } } } From 6a04ce5eeea50f4a49575d78c1b38e41603db1e6 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 19 Feb 2026 18:26:40 +0000 Subject: [PATCH 13/21] demo monitors, remove monitors --- client/src/Pages/Settings/index.tsx | 60 ++++++++++++++++++++++++++++- client/src/locales/en.json | 16 +++++++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index 077755bf1..d956fbe82 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -7,7 +7,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useTranslation } from "react-i18next"; import { useSelector, useDispatch } from "react-redux"; import DummyChart from "@/Pages/Settings/DummyChart"; -import { useGet, usePatch } from "@/Hooks/UseApi"; +import { useGet, usePatch, usePost } from "@/Hooks/UseApi"; import { useSettingsForm } from "@/Hooks/useSettingsForm"; import { useIsAdmin } from "@/Hooks/useIsAdmin.js"; import type { SettingsFormData } from "@/Validation/settings"; @@ -44,6 +44,10 @@ export const SettingsPage = () => { const { t, i18n } = useTranslation(); const dispatch = useDispatch(); const isAdmin = useIsAdmin(); + // Local state for demo monitors dialog + const [isDemoMonitorsDialogOpen, setIsDemoMonitorsDialogOpen] = useState(false); + const { post: postDemoMonitors, loading: isPostingDemoMonitors } = usePost(); + const { deleteFn: deleteAllMonitors, loading: isDeletingAllMonitors } = useDelete(); // Fetch settings data from API const { data: fetchedSettings } = useGet("/settings"); @@ -451,6 +455,47 @@ export const SettingsPage = () => { )} + {/* Demo Monitors - Admin Only */} + {isAdmin && ( + + + + } + /> + )} + + {/* Remove All Monitors - Admin Only */} + {isAdmin && ( + + + + } + /> + )} + {/* Clear Stats Confirmation Dialog */} { loading={isDeletingStats} /> + {/* Delete All Monitors Confirmation Dialog */} + setIsDemoMonitorsDialogOpen(false)} + onConfirm={async () => { + await deleteAllMonitors("/monitors/"); + setIsDemoMonitorsDialogOpen(false); + }} + loading={isDeletingAllMonitors} + /> + {/* Sticky Save Button */} Date: Thu, 19 Feb 2026 19:23:40 +0000 Subject: [PATCH 14/21] email --- client/src/Pages/Settings/index.tsx | 340 +++++++++++++++++++++++++++- client/src/locales/en.json | 53 ++++- 2 files changed, 390 insertions(+), 3 deletions(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index d956fbe82..d1b6df976 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -1,5 +1,5 @@ import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; -import { Autocomplete, Select, Dialog } from "@/Components/v2/inputs"; +import { Autocomplete, Select, Dialog, SwitchComponent } from "@/Components/v2/inputs"; import { Stack, useTheme, MenuItem, type SelectChangeEvent } from "@mui/material"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; @@ -14,7 +14,7 @@ import type { SettingsFormData } from "@/Validation/settings"; import { useState } from "react"; import { Controller } from "react-hook-form"; import { TextField, Button, FieldLabel } from "@/Components/v2/inputs"; -import { Box } from "@mui/material"; +import { Box, Typography } from "@mui/material"; import { useDelete } from "@/Hooks/UseApi"; import { @@ -59,6 +59,13 @@ export const SettingsPage = () => { fetchedSettings?.pagespeedKeySet ?? false ); const [apiKeyHasBeenReset, setApiKeyHasBeenReset] = useState(false); + // Local state for email password reset + const [isEmailPasswordSet, setIsEmailPasswordSet] = useState( + fetchedSettings?.emailPasswordSet ?? false + ); + const [emailPasswordHasBeenReset, setEmailPasswordHasBeenReset] = useState(false); + // Test email functionality + const { post: sendTestEmail, loading: isSendingTestEmail } = usePost(); // Local state for clear stats dialog const [isStatsDialogOpen, setIsStatsDialogOpen] = useState(false); const { deleteFn: deleteStats, loading: isDeletingStats } = useDelete(); @@ -81,6 +88,7 @@ export const SettingsPage = () => { useEffect(() => { if (fetchedSettings) { setIsApiKeySet(fetchedSettings.pagespeedKeySet); + setIsEmailPasswordSet(fetchedSettings.emailPasswordSet); } }, [fetchedSettings]); @@ -91,6 +99,8 @@ export const SettingsPage = () => { chartType = "histogram", } = useSelector((state: RootState) => state.ui); + const user = useSelector((state: RootState) => state.auth.user); + // Convert timezones to match AutoComplete format (id instead of _id) const timezoneOptions: Timezone[] = timezones.map((tz) => ({ id: tz._id, @@ -122,6 +132,48 @@ export const SettingsPage = () => { setApiKeyHasBeenReset(true); }; + const handleResetEmailPassword = () => { + form.setValue("systemEmailPassword", ""); + setEmailPasswordHasBeenReset(true); + }; + + const handleSendTestEmail = async () => { + const formValues = form.getValues(); + if (!user) { + alert("User not authenticated"); + return; + } + if ( + !formValues.systemEmailHost || + !formValues.systemEmailPort || + !formValues.systemEmailAddress || + !formValues.systemEmailPassword + ) { + alert("Please fill in all required email fields before testing."); + return; + } + + await sendTestEmail("/settings/test-email", { + to: user.email, + systemEmailHost: formValues.systemEmailHost, + systemEmailPort: formValues.systemEmailPort, + systemEmailAddress: formValues.systemEmailAddress, + systemEmailPassword: formValues.systemEmailPassword, + systemEmailSecure: formValues.systemEmailSecure, + systemEmailPool: formValues.systemEmailPool, + systemEmailIgnoreTLS: formValues.systemEmailIgnoreTLS, + systemEmailRequireTLS: formValues.systemEmailRequireTLS, + systemEmailRejectUnauthorized: formValues.systemEmailRejectUnauthorized, + ...(formValues.systemEmailUser && { systemEmailUser: formValues.systemEmailUser }), + ...(formValues.systemEmailTLSServername && { + systemEmailTLSServername: formValues.systemEmailTLSServername, + }), + ...(formValues.systemEmailConnectionHost && { + systemEmailConnectionHost: formValues.systemEmailConnectionHost, + }), + }); + }; + const handleClearStats = async () => { await deleteStats("/checks/team"); setIsStatsDialogOpen(false); @@ -133,6 +185,9 @@ export const SettingsPage = () => { if (isApiKeySet && !apiKeyHasBeenReset) { delete (dataToSend as any).pagespeedApiKey; } + if (isEmailPasswordSet && !emailPasswordHasBeenReset) { + delete (dataToSend as any).systemEmailPassword; + } // Convert undefined to empty string for backend unsetting const processedData = Object.entries(dataToSend).reduce((acc, [key, value]) => { @@ -163,6 +218,8 @@ export const SettingsPage = () => { if (result.data) { setIsApiKeySet(result.data.pagespeedKeySet); setApiKeyHasBeenReset(false); + setIsEmailPasswordSet(result.data.emailPasswordSet); + setEmailPasswordHasBeenReset(false); } } }; @@ -455,6 +512,285 @@ export const SettingsPage = () => { )} + {/* Email Settings - Admin Only */} + {isAdmin && ( + + + {JSON.stringify( + { + host: form.watch("systemEmailHost") || "", + port: form.watch("systemEmailPort") || "", + secure: form.watch("systemEmailSecure") ?? false, + auth: { + user: + form.watch("systemEmailUser") || + form.watch("systemEmailAddress") || + "", + pass: "", + }, + name: form.watch("systemEmailConnectionHost") || "localhost", + pool: form.watch("systemEmailPool") ?? false, + tls: { + rejectUnauthorized: + form.watch("systemEmailRejectUnauthorized") ?? true, + ignoreTLS: form.watch("systemEmailIgnoreTLS") ?? false, + requireTLS: form.watch("systemEmailRequireTLS") ?? false, + servername: form.watch("systemEmailTLSServername") || "", + }, + }, + null, + 2 + )} + + + } + rightContent={ + + {/* Email Host */} + ( + + )} + /> + + {/* Email Port */} + ( + { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} + fieldLabel={t("pages.settings.form.email.option.port.label")} + type="number" + inputProps={{ min: 0 }} + placeholder={t("pages.settings.form.email.option.port.placeholder")} + error={!!fieldState.error} + helperText={fieldState.error?.message} + /> + )} + /> + + {/* Email Address */} + ( + + )} + /> + + {/* Email User (Optional) */} + ( + + )} + /> + + {/* Email Password with Reset Pattern */} + {isEmailPasswordSet && !emailPasswordHasBeenReset ? ( + + + {t("pages.settings.form.email.option.password.labelSet")} + + + + + + ) : ( + ( + + )} + /> + )} + + {/* TLS Servername (Optional) */} + ( + + )} + /> + + {/* Connection Host (Optional) */} + ( + + )} + /> + + {/* Boolean Switches */} + + {[ + { + name: "systemEmailSecure", + label: t("pages.settings.form.email.option.secure.label"), + }, + { + name: "systemEmailPool", + label: t("pages.settings.form.email.option.pool.label"), + }, + { + name: "systemEmailIgnoreTLS", + label: t("pages.settings.form.email.option.ignoreTLS.label"), + }, + { + name: "systemEmailRequireTLS", + label: t("pages.settings.form.email.option.requireTLS.label"), + }, + { + name: "systemEmailRejectUnauthorized", + label: t("pages.settings.form.email.option.rejectUnauthorized.label"), + }, + ].map(({ name, label }) => ( + ( + + {label} + ) => + field.onChange(e.target.checked) + } + /> + + )} + /> + ))} + + + {/* Test Email Button */} + + + + + } + /> + )} + {/* Demo Monitors - Admin Only */} {isAdmin && ( Date: Fri, 20 Feb 2026 17:20:43 +0000 Subject: [PATCH 15/21] add link text --- .../v2/design-elements/TextLink.tsx | 3 +- client/src/Pages/Settings/index.tsx | 84 ++++++++++--------- client/src/locales/en.json | 2 + 3 files changed, 50 insertions(+), 39 deletions(-) diff --git a/client/src/Components/v2/design-elements/TextLink.tsx b/client/src/Components/v2/design-elements/TextLink.tsx index 704b4b841..2f79b1beb 100644 --- a/client/src/Components/v2/design-elements/TextLink.tsx +++ b/client/src/Components/v2/design-elements/TextLink.tsx @@ -10,7 +10,7 @@ interface TextLinkProps extends StackProps { text: string; linkText: string; href: string; - target?: string; + target?: "_self" | "_blank" | "_parent" | "_top"; } export const TextLink = ({ @@ -34,6 +34,7 @@ export const TextLink = ({ to={href} component={RouterLink} target={target} + {...(target === "_blank" && { rel: "noopener noreferrer" })} > {linkText} diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index d1b6df976..a8549dcc4 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -1,4 +1,4 @@ -import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; +import { BasePage, ConfigBox, TextLink } from "@/Components/v2/design-elements"; import { Autocomplete, Select, Dialog, SwitchComponent } from "@/Components/v2/inputs"; import { Stack, useTheme, MenuItem, type SelectChangeEvent } from "@mui/material"; import { useEffect } from "react"; @@ -518,44 +518,52 @@ export const SettingsPage = () => { title={t("pages.settings.form.email.title")} subtitle={t("pages.settings.form.email.description")} leftContent={ - - - {JSON.stringify( - { - host: form.watch("systemEmailHost") || "", - port: form.watch("systemEmailPort") || "", - secure: form.watch("systemEmailSecure") ?? false, - auth: { - user: - form.watch("systemEmailUser") || - form.watch("systemEmailAddress") || - "", - pass: "", + + + + + {JSON.stringify( + { + host: form.watch("systemEmailHost") || "", + port: form.watch("systemEmailPort") || "", + secure: form.watch("systemEmailSecure") ?? false, + auth: { + user: + form.watch("systemEmailUser") || + form.watch("systemEmailAddress") || + "", + pass: "", + }, + name: form.watch("systemEmailConnectionHost") || "localhost", + pool: form.watch("systemEmailPool") ?? false, + tls: { + rejectUnauthorized: + form.watch("systemEmailRejectUnauthorized") ?? true, + ignoreTLS: form.watch("systemEmailIgnoreTLS") ?? false, + requireTLS: form.watch("systemEmailRequireTLS") ?? false, + servername: form.watch("systemEmailTLSServername") || "", + }, }, - name: form.watch("systemEmailConnectionHost") || "localhost", - pool: form.watch("systemEmailPool") ?? false, - tls: { - rejectUnauthorized: - form.watch("systemEmailRejectUnauthorized") ?? true, - ignoreTLS: form.watch("systemEmailIgnoreTLS") ?? false, - requireTLS: form.watch("systemEmailRequireTLS") ?? false, - servername: form.watch("systemEmailTLSServername") || "", - }, - }, - null, - 2 - )} - - + null, + 2 + )} + + + } rightContent={ diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 4dfddb23f..b3d2d6bba 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -1023,6 +1023,8 @@ "email": { "title": "Email settings", "description": "Configure the email settings for your system. This is used to send notifications and alerts.", + "descriptionTransport": "This builds an SMTP transport for NodeMailer", + "descriptionTransportLink": "See specifications here", "option": { "host": { "label": "Email host - Hostname or IP address to connect to", From 42fe6ade3efc747906838c1d177dd328451e0a2c Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 20 Feb 2026 17:22:20 +0000 Subject: [PATCH 16/21] target blank --- client/src/Pages/Settings/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index a8549dcc4..427eb3f73 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -523,7 +523,7 @@ export const SettingsPage = () => { text={t("pages.settings.form.email.descriptionTransport")} linkText={t("pages.settings.form.email.descriptionTransportLink")} href="https://nodemailer.com/smtp/" - target="_top" + target="_blank" /> Date: Fri, 20 Feb 2026 17:22:43 +0000 Subject: [PATCH 17/21] remove old settings strings --- client/src/locales/en.json | 86 -------------------------------------- 1 file changed, 86 deletions(-) diff --git a/client/src/locales/en.json b/client/src/locales/en.json index b3d2d6bba..407c47545 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -1086,92 +1086,6 @@ } } }, - "oldSettings": { - "aboutSettings": { - "labelDevelopedBy": "Developed by Bluewave Labs", - "labelVersion": "Version", - "title": "About" - }, - "demoMonitorsSettings": { - "buttonAddMonitors": "Add demo monitors", - "description": "Add sample monitors for demonstration purposes.", - "title": "Demo monitors" - }, - "emailSettings": { - "buttonSendTestEmail": "Send test e-mail", - "description": "Configure the email settings for your system. This is used to send notifications and alerts.", - "descriptionTransport": "This builds an SMTP transport for NodeMailer", - "labelAddress": "Email address - Used for authentication", - "labelConnectionHost": "Email connection host - Hostname to use in the HELO/EHLO greeting", - "labelHost": "Email host - Hostname or IP address to connect to", - "labelIgnoreTLS": "Disable STARTTLS: Don't use TLS even if the server supports it", - "labelPassword": "Email password - Password for authentication", - "labelPasswordSet": "Password is set. Click Reset to change it.", - "labelPool": "Enable connection pooling: Reuse existing connections to improve performance", - "labelPort": "Email port - Port to connect to", - "labelRejectUnauthorized": "Reject invalid certificates: Reject connections with self-signed or untrusted certificates", - "labelRequireTLS": "Force STARTTLS: Require TLS upgrade, fail if not supported", - "labelSecure": "Use SSL (recommended): Encrypt the connection using SSL/TLS", - "labelTLSServername": "TLS Servername - Optional Hostname for TLS Validation when host is an IP", - "labelUser": "Email user - Username for authentication, overrides email address if specified", - "linkTransport": "See specifications here", - "placeholderUser": "Leave empty if not required", - "title": "Email", - "toastEmailRequiredFieldsError": "Email address, host, port and password are required" - }, - "globalThresholds": { - "title": "Global Thresholds", - "description": "Configure global CPU, Memory, Disk, and Temperature thresholds. If a value is provided, it will automatically be enabled for monitoring." - }, - "pageSpeedSettings": { - "description": "Enter your Google PageSpeed API key to enable Google PageSpeed monitoring. Click Reset to update the key.", - "labelApiKeySet": "API key is set. Click Reset to change it.", - "labelApiKey": "PageSpeed API key", - "title": "Google PageSpeed API key" - }, - "saveButtonLabel": "Save", - "statsSettings": { - "clearAllStatsButton": "Clear all stats", - "clearAllStatsDescription": "Clear all stats. This is irreversible.", - "clearAllStatsDialogConfirm": "Yes, clear all stats", - "clearAllStatsDialogDescription": "Once removed, the monitoring history and stats cannot be retrieved.", - "clearAllStatsDialogTitle": "Do you want to clear all stats?", - "description": "Define how long you want to retain historical data. You can also clear all existing data.", - "labelTTL": "The days you want to keep monitoring history.", - "labelTTLOptional": "0 for infinite", - "title": "Monitor history" - }, - "systemResetSettings": { - "buttonRemoveAllMonitors": "Remove all monitors", - "description": "Remove all monitors from your system.", - "dialogConfirm": "Yes, remove all monitors", - "dialogDescription": "Once removed, the monitors cannot be retrieved.", - "dialogTitle": "Do you want to remove all monitors?", - "title": "System reset" - }, - "timezoneSettings": { - "description": "Select the timezone used to display dates and times throughout the application.", - "label": "Display timezone", - "title": "Display timezone" - }, - "title": "Settings", - "uiSettings": { - "description": "Switch between light and dark mode, or change user interface language.", - "labelLanguage": "Language", - "labelTheme": "Theme mode", - "labelChartType": "Chart type", - "chartTypeHistogram": "Histogram", - "chartTypeHeatmap": "Heatmap", - "title": "Appearance" - }, - "urlSettings": { - "description": "Display the IP address or URL of monitor on the public Status page. If it's disabled, only the monitor name will be shown to protect sensitive information.", - "label": "Display IP/URL on status page", - "selectDisabled": "Disabled", - "selectEnabled": "Enabled", - "title": "Monitor IP/URL on Status Page" - } - }, "statusPages": { "deleteSuccess": "Status page deleted successfully", "fallback": { From fc6300d0571ea92434b6d04d7d87be6d83e09020 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 20 Feb 2026 17:36:04 +0000 Subject: [PATCH 18/21] remove old, add about and export --- client/src/Pages/Settings/SettingsAbout.jsx | 39 -- .../Pages/Settings/SettingsDemoMonitors.jsx | 97 ----- client/src/Pages/Settings/SettingsEmail.jsx | 369 ------------------ client/src/Pages/Settings/SettingsExport.jsx | 81 ---- .../Settings/SettingsGlobalThresholds.jsx | 79 ---- .../src/Pages/Settings/SettingsPagespeed.jsx | 100 ----- client/src/Pages/Settings/SettingsStats.jsx | 80 ---- .../src/Pages/Settings/SettingsTimeZone.jsx | 70 ---- client/src/Pages/Settings/SettingsUI.jsx | 81 ---- client/src/Pages/Settings/SettingsURL.jsx | 56 --- client/src/Pages/Settings/index.tsx | 71 +++- client/src/Pages/Settings/old.jsx | 217 ---------- client/src/Routes/index.tsx | 6 +- client/src/Types/env.d.ts | 2 + client/src/locales/en.json | 11 +- client/vite.config.ts | 2 +- 16 files changed, 83 insertions(+), 1278 deletions(-) delete mode 100644 client/src/Pages/Settings/SettingsAbout.jsx delete mode 100644 client/src/Pages/Settings/SettingsDemoMonitors.jsx delete mode 100644 client/src/Pages/Settings/SettingsEmail.jsx delete mode 100644 client/src/Pages/Settings/SettingsExport.jsx delete mode 100644 client/src/Pages/Settings/SettingsGlobalThresholds.jsx delete mode 100644 client/src/Pages/Settings/SettingsPagespeed.jsx delete mode 100644 client/src/Pages/Settings/SettingsStats.jsx delete mode 100644 client/src/Pages/Settings/SettingsTimeZone.jsx delete mode 100644 client/src/Pages/Settings/SettingsUI.jsx delete mode 100644 client/src/Pages/Settings/SettingsURL.jsx delete mode 100644 client/src/Pages/Settings/old.jsx diff --git a/client/src/Pages/Settings/SettingsAbout.jsx b/client/src/Pages/Settings/SettingsAbout.jsx deleted file mode 100644 index 7b0a4ad2c..000000000 --- a/client/src/Pages/Settings/SettingsAbout.jsx +++ /dev/null @@ -1,39 +0,0 @@ -import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -// Utils -import { useTheme } from "@emotion/react"; -import { useTranslation } from "react-i18next"; -import Link from "@/Components/v1/Link/index.jsx"; - -const SettingsAbout = () => { - const theme = useTheme(); - const { t } = useTranslation(); - return ( - - - - {t("pages.settings.aboutSettings.title")} - - - - - {t("common.appName")} {__APP_VERSION__} - - - {t("pages.settings.aboutSettings.labelDevelopedBy")} - - - - - ); -}; - -export default SettingsAbout; diff --git a/client/src/Pages/Settings/SettingsDemoMonitors.jsx b/client/src/Pages/Settings/SettingsDemoMonitors.jsx deleted file mode 100644 index d2e7baea0..000000000 --- a/client/src/Pages/Settings/SettingsDemoMonitors.jsx +++ /dev/null @@ -1,97 +0,0 @@ -import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; -import Button from "@mui/material/Button"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; -import Dialog from "@/Components/v1/Dialog/index.jsx"; -import { useState } from "react"; -import { useDelete, usePost } from "@/Hooks/UseApi"; - -const SettingsDemoMonitors = ({ isAdmin, HEADER_SX, isLoading }) => { - const { t } = useTranslation(); - const theme = useTheme(); - // Local state - const [isOpen, setIsOpen] = useState(false); - - if (!isAdmin) { - return null; - } - const { post: postDemoMonitors } = usePost(); - const { deleteFn: deleteAllMonitorsFn } = useDelete(); - return ( - <> - - - - {t("pages.settings.demoMonitorsSettings.title")} - - - {t("pages.settings.demoMonitorsSettings.description")} - - - - - - - - - - {t("pages.settings.systemResetSettings.title")} - - - {t("pages.settings.systemResetSettings.description")} - - - - - - setIsOpen(false)} - confirmationButtonLabel={t("pages.settings.systemResetSettings.dialogConfirm")} - onConfirm={async () => { - await deleteAllMonitorsFn("/monitors/"); - setIsOpen(false); - }} - isLoading={isLoading} - /> - - - ); -}; - -SettingsDemoMonitors.propTypes = { - isAdmin: PropTypes.bool, - HEADER_SX: PropTypes.object, -}; - -export default SettingsDemoMonitors; diff --git a/client/src/Pages/Settings/SettingsEmail.jsx b/client/src/Pages/Settings/SettingsEmail.jsx deleted file mode 100644 index 180b7f2d9..000000000 --- a/client/src/Pages/Settings/SettingsEmail.jsx +++ /dev/null @@ -1,369 +0,0 @@ -import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx"; -import Button from "@mui/material/Button"; -import Stack from "@mui/material/Stack"; -import { Switch } from "@mui/material"; -import TextLink from "@/Components/v1/TextLink/index.jsx"; -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useState } from "react"; -import { useTranslation } from "react-i18next"; -import { PasswordEndAdornment } from "@/Components/v1/Inputs/TextInput/Adornments/index.jsx"; -import { usePost } from "@/Hooks/UseApi"; -import { useSelector } from "react-redux"; -import { createToast } from "@/Utils/toastUtils.jsx"; -import { Controller } from "react-hook-form"; - -const SettingsEmail = ({ - isAdmin, - HEADER_SX, - isEmailPasswordSet, - emailPasswordHasBeenReset, - setEmailPasswordHasBeenReset, - control, - defaults, - formValues, - setValue, -}) => { - // Setup - const { t } = useTranslation(); - const theme = useTheme(); - - // Destructure settings with default values - const { - systemEmailHost = "", - systemEmailPort = "", - systemEmailSecure = false, - systemEmailPool = false, - systemEmailUser = "", - systemEmailAddress = "", - systemEmailPassword = "", - systemEmailTLSServername = "", - systemEmailConnectionHost = "localhost", - systemEmailIgnoreTLS = false, - systemEmailRequireTLS = false, - systemEmailRejectUnauthorized = true, - } = formValues || {}; - - // Network - const { post: sendTestEmailFn, loading: isSending } = usePost(); - const user = useSelector((state) => state.auth.user); - - // Handlers - - /** - * Handle sending test email with current form values - */ - const handleSendTestEmail = () => { - // Basic validation - if ( - !systemEmailHost || - !systemEmailPort || - !systemEmailAddress || - !systemEmailPassword - ) { - createToast({ - body: t("pages.settings.emailSettings.toastEmailRequiredFieldsError"), - variant: "error", - }); - return; - } - - // Send test email - only include optional fields if they have values - sendTestEmailFn("/settings/test-email", { - to: user.email, - systemEmailHost, - systemEmailPort, - systemEmailAddress, - systemEmailPassword, - systemEmailSecure, - systemEmailPool, - systemEmailIgnoreTLS, - systemEmailRequireTLS, - systemEmailRejectUnauthorized, - ...(systemEmailUser && { systemEmailUser }), - ...(systemEmailTLSServername && { systemEmailTLSServername }), - ...(systemEmailConnectionHost && { systemEmailConnectionHost }), - }); - }; - - if (!isAdmin) { - return null; - } - - return ( - - - - {t("pages.settings.emailSettings.title")} - - - {t("pages.settings.emailSettings.description")} - - - - - - ( - - )} - /> - - - ( - - )} - /> - - - ( - - )} - /> - - - ( - - )} - /> - - {(isEmailPasswordSet === false || emailPasswordHasBeenReset === true) && ( - - ( - } - error={!!fieldState.error} - helperText={fieldState.error?.message} - /> - )} - /> - - )} - - {isEmailPasswordSet === true && emailPasswordHasBeenReset === false && ( - - {t("pages.settings.emailSettings.labelPasswordSet")} - - - )} - - ( - - )} - /> - - - ( - - )} - /> - - - {[ - [ - "pages.settings.emailSettings.labelSecure", - "systemEmailSecure", - systemEmailSecure, - ], - [ - "pages.settings.emailSettings.labelPool", - "systemEmailPool", - systemEmailPool, - ], - [ - "pages.settings.emailSettings.labelIgnoreTLS", - "systemEmailIgnoreTLS", - systemEmailIgnoreTLS, - ], - [ - "pages.settings.emailSettings.labelRequireTLS", - "systemEmailRequireTLS", - systemEmailRequireTLS, - ], - [ - "pages.settings.emailSettings.labelRejectUnauthorized", - "systemEmailRejectUnauthorized", - systemEmailRejectUnauthorized, - ], - ].map(([labelKey, name, value]) => ( - ( - - {t(labelKey)} - - - - )} - /> - ))} - - - - - {JSON.stringify( - { - host: systemEmailHost, - port: systemEmailPort, - secure: systemEmailSecure, - auth: { - user: systemEmailUser || systemEmailAddress, - pass: "", - }, - name: systemEmailConnectionHost || "localhost", - pool: systemEmailPool, - tls: { - rejectUnauthorized: systemEmailRejectUnauthorized, - ignoreTLS: systemEmailIgnoreTLS, - requireTLS: systemEmailRequireTLS, - servername: systemEmailTLSServername, - }, - }, - null, - 2 - )} - - - - - - {systemEmailHost && - systemEmailPort && - systemEmailAddress && - systemEmailPassword && ( - - )} - - - - ); -}; - -SettingsEmail.propTypes = { - isAdmin: PropTypes.bool, - HEADER_SX: PropTypes.object, - isPasswordSet: PropTypes.bool, -}; - -export default SettingsEmail; diff --git a/client/src/Pages/Settings/SettingsExport.jsx b/client/src/Pages/Settings/SettingsExport.jsx deleted file mode 100644 index b289592d1..000000000 --- a/client/src/Pages/Settings/SettingsExport.jsx +++ /dev/null @@ -1,81 +0,0 @@ -import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; -import Button from "@mui/material/Button"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; -import Dialog from "@/Components/v1/Dialog/index.jsx"; -import { useState } from "react"; -import { useLazyGet } from "@/Hooks/UseApi"; - -const SettingsDemoMonitors = ({ isAdmin, HEADER_SX, isLoading }) => { - const { t } = useTranslation(); - const theme = useTheme(); - // Local state - const [isOpen, setIsOpen] = useState(false); - - if (!isAdmin) { - return null; - } - const { get: fetchJson } = useLazyGet(); - - const handleExport = async () => { - const res = await fetchJson("/monitors/export/json"); - const json = res?.data ?? []; - if (!json || json.length === 0) { - return; - } - - const blob = new Blob([JSON.stringify(json, null, 2)], { - type: "application/json", - }); - const url = URL.createObjectURL(blob); - - const link = document.createElement("a"); - link.href = url; - link.download = "monitors.json"; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - URL.revokeObjectURL(url); - return; - }; - - return ( - <> - - - - Export monitors to JSON - - - Export your monitors data as a JSON file for backup or transfer. - - - - - - - - ); -}; - -SettingsDemoMonitors.propTypes = { - isAdmin: PropTypes.bool, - HEADER_SX: PropTypes.object, -}; - -export default SettingsDemoMonitors; diff --git a/client/src/Pages/Settings/SettingsGlobalThresholds.jsx b/client/src/Pages/Settings/SettingsGlobalThresholds.jsx deleted file mode 100644 index c2bc671f1..000000000 --- a/client/src/Pages/Settings/SettingsGlobalThresholds.jsx +++ /dev/null @@ -1,79 +0,0 @@ -import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx"; - -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; -import { Controller } from "react-hook-form"; - -const SettingsGlobalThresholds = ({ - isAdmin, - HEADING_SX, - - control, - defaults, -}) => { - const { t } = useTranslation(); // For language translation - const theme = useTheme(); // MUI theme access - - // Only render this section for admins - if (!isAdmin) return null; - - return ( - - {/* Header and description */} - - - {t("pages.settings.globalThresholds.title", "Global Thresholds")} - - - {t( - "pages.settings.globalThresholds.description", - "Configure global CPU, Memory, Disk, and Temperature thresholds." - )} - - - - {/* Threshold inputs */} - - {[ - ["CPU Threshold (%)", "cpu", 1, 100], - ["Memory Threshold (%)", "memory", 1, 100], - ["Disk Threshold (%)", "disk", 1, 100], - ["Temperature Threshold (°C)", "temperature", 1, 150], - ].map(([label, name, min, max]) => ( - ( - - )} - /> - ))} - - - ); -}; - -// Prop types -SettingsGlobalThresholds.propTypes = { - isAdmin: PropTypes.bool, - HEADING_SX: PropTypes.object, -}; - -export default SettingsGlobalThresholds; diff --git a/client/src/Pages/Settings/SettingsPagespeed.jsx b/client/src/Pages/Settings/SettingsPagespeed.jsx deleted file mode 100644 index a479ff660..000000000 --- a/client/src/Pages/Settings/SettingsPagespeed.jsx +++ /dev/null @@ -1,100 +0,0 @@ -import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import Button from "@mui/material/Button"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx"; -import { PasswordEndAdornment } from "@/Components/v1/Inputs/TextInput/Adornments/index.jsx"; -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useState } from "react"; -import { useTranslation } from "react-i18next"; -import { Controller } from "react-hook-form"; - -const SettingsPagespeed = ({ - isAdmin, - HEADING_SX, - isApiKeySet, - apiKeyHasBeenReset, - setApiKeyHasBeenReset, - defaults, - control, - setValue, -}) => { - const { t } = useTranslation(); - const theme = useTheme(); - - // Local state - const [apiKey, setApiKey] = useState(""); - - if (!isAdmin) { - return null; - } - - return ( - - - - {t("pages.settings.pageSpeedSettings.title")} - - - {t("pages.settings.pageSpeedSettings.description")} - - - - {(isApiKeySet === false || apiKeyHasBeenReset === true) && ( - ( - } - error={!!fieldState.error} - helperText={fieldState.error?.message} - /> - )} - /> - )} - - {isApiKeySet === true && apiKeyHasBeenReset === false && ( - - - {t("pages.settings.pageSpeedSettings.labelApiKeySet")} - - - - )} - - - ); -}; - -SettingsPagespeed.propTypes = { - isAdmin: PropTypes.bool, - HEADING_SX: PropTypes.object, - isApiKeySet: PropTypes.bool, - setIsApiKeySet: PropTypes.func, - apiKeyHasBeenReset: PropTypes.bool, - setApiKeyHasBeenReset: PropTypes.func, -}; - -export default SettingsPagespeed; diff --git a/client/src/Pages/Settings/SettingsStats.jsx b/client/src/Pages/Settings/SettingsStats.jsx deleted file mode 100644 index 45735ee4d..000000000 --- a/client/src/Pages/Settings/SettingsStats.jsx +++ /dev/null @@ -1,80 +0,0 @@ -import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; -import Button from "@mui/material/Button"; -import Stack from "@mui/material/Stack"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx"; -import Dialog from "@/Components/v1/Dialog/index.jsx"; - -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; -import { useState } from "react"; -import { useDelete } from "@/Hooks/UseApi"; - -const SettingsStats = ({ isAdmin, HEADING_SX, errors }) => { - const theme = useTheme(); - const { t } = useTranslation(); - const [isOpen, setIsOpen] = useState(false); - - if (!isAdmin) { - return null; - } - const { deleteFn: deleteMonitorStatsFn } = useDelete(); - - return ( - - - - {t("pages.settings.statsSettings.title")} - - - {t("pages.settings.statsSettings.description")} - - - - - - {t("pages.settings.statsSettings.clearAllStatsDescription")} - - - - - setIsOpen(false)} - confirmationButtonLabel={t( - "pages.settings.statsSettings.clearAllStatsDialogConfirm" - )} - onConfirm={async () => { - await deleteMonitorStatsFn("/checks/team"); - - setIsOpen(false); - }} - isLoading={false} - /> - - ); -}; - -SettingsStats.propTypes = { - isAdmin: PropTypes.bool, - HEADING_SX: PropTypes.object, -}; - -export default SettingsStats; diff --git a/client/src/Pages/Settings/SettingsTimeZone.jsx b/client/src/Pages/Settings/SettingsTimeZone.jsx deleted file mode 100644 index 444088c8a..000000000 --- a/client/src/Pages/Settings/SettingsTimeZone.jsx +++ /dev/null @@ -1,70 +0,0 @@ -import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import Search from "@/Components/v1/Inputs/Search/index.jsx"; -import timezones from "@/Utils/timezones.json"; - -// Utils -import { useTheme } from "@emotion/react"; -import { useSelector, useDispatch } from "react-redux"; -import { setTimezone } from "@/Features/UI/uiSlice.js"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; -import { useCallback, useMemo, useState } from "react"; -const SettingsTimeZone = ({ HEADING_SX }) => { - const theme = useTheme(); - const { t } = useTranslation(); - const [rawInput, setRawInput] = useState(""); - const dispatch = useDispatch(); - const { timezone } = useSelector((state) => state.ui); - - const selectedTimezone = useMemo( - () => timezones.find((tz) => tz._id === timezone) ?? null, - [timezone] - ); - - const handleTimezoneChange = (newValue) => { - setRawInput(""); - const newId = newValue?._id ?? ""; - dispatch(setTimezone({ timezone: newId })); - }; - - return ( - - - - {t("pages.settings.timezoneSettings.title")} - - - - {t("pages.settings.timezoneSettings.description")} - - - - - setRawInput(val)} - handleChange={handleTimezoneChange} - isAdorned={true} - unit="timezone" - /> - - - ); -}; - -SettingsTimeZone.propTypes = { - HEADING_SX: PropTypes.object, -}; - -export default SettingsTimeZone; diff --git a/client/src/Pages/Settings/SettingsUI.jsx b/client/src/Pages/Settings/SettingsUI.jsx deleted file mode 100644 index aa58a67d9..000000000 --- a/client/src/Pages/Settings/SettingsUI.jsx +++ /dev/null @@ -1,81 +0,0 @@ -import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import Select from "@/Components/v1/Inputs/Select/index.jsx"; -import DummyChart from "./DummyChart"; -import { ThemeProvider } from "@mui/material/styles"; -import { lightTheme, darkTheme } from "@/Utils/Theme/v2Theme"; - -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; -import { useSelector, useDispatch } from "react-redux"; -import { setMode, setLanguage, setChartType } from "@/Features/UI/uiSlice.js"; - -const SettingsUI = ({ HEADING_SX }) => { - const { - mode, - language = "en", - chartType = "histogram", - } = useSelector((state) => state.ui); - const { t, i18n } = useTranslation(); - const theme = useTheme(); - const languages = Object.keys(i18n.options.resources || {}); - const dispatch = useDispatch(); - const v2Theme = mode === "dark" ? darkTheme : lightTheme; - return ( - - - - {t("pages.settings.uiSettings.title")} - - - {t("pages.settings.uiSettings.description")} - - - - - - - - - - - - ); -}; - -SettingsUI.propTypes = { - HEADING_SX: PropTypes.object, -}; - -export default SettingsUI; diff --git a/client/src/Pages/Settings/SettingsURL.jsx b/client/src/Pages/Settings/SettingsURL.jsx deleted file mode 100644 index 11e7ea821..000000000 --- a/client/src/Pages/Settings/SettingsURL.jsx +++ /dev/null @@ -1,56 +0,0 @@ -import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import ConfigBox from "@/Components/v1/ConfigBox/index.jsx"; -import Select from "@/Components/v1/Inputs/Select/index.jsx"; -import { Controller } from "react-hook-form"; - -// Utils -import { useTheme } from "@emotion/react"; -import { PropTypes } from "prop-types"; -import { useTranslation } from "react-i18next"; - -const SettingsURL = ({ HEADING_SX, control, defaults }) => { - const { t } = useTranslation(); - const theme = useTheme(); - return ( - - - - {t("pages.settings.urlSettings.title")} - - - {t("pages.settings.urlSettings.description")} - - - - ( - - */ - -const Select = ({ - id, - label, - placeholder, - isHidden, - value, - items, - onChange, - onBlur, - sx, - error = false, - name = "", - labelControlSpacing = 6, - maxWidth, - //FieldWrapper's props - labelMb, - labelFontWeight, - labelVariant, - labelSx = {}, - fieldWrapperSx = {}, -}) => { - const theme = useTheme(); - const getItemValue = (item) => item?._id ?? item?.id; - const itemStyles = { - color: theme.palette.primary.contrastTextTertiary, - borderRadius: theme.shape.borderRadius, - margin: theme.spacing(2), - }; - - const responsiveMaxWidth = { - xs: `${maxWidth * 0.5}px`, - sm: `${maxWidth * 0.75}px`, - md: `${maxWidth * 0.9}px`, - lg: `${maxWidth}px`, - }; - - return ( - - ( - - )} - MenuProps={{ disableScrollLock: true }} - sx={{ - fontSize: 13, - minWidth: "125px", - ...(maxWidth && { maxWidth: responsiveMaxWidth }), - "& fieldset": { - borderRadius: theme.shape.borderRadius, - borderColor: theme.palette.primary.lowContrast, - }, - "&:not(.Mui-focused):hover fieldset": { - borderColor: theme.palette.primary.lowContrast, - }, - "& svg path": { - fill: theme.palette.primary.contrastTextTertiary, - }, - "& .MuiSelect-select": { - padding: "0", - minHeight: "34px", - display: "flex", - alignItems: "center", - lineHeight: 1, - }, - ...sx, - }} - renderValue={(selected) => { - const selectedItem = items.find((item) => getItemValue(item) === selected); - const displayName = selectedItem ? selectedItem.name : placeholder; - return ( - - {displayName} - - ); - }} - > - {placeholder && ( - - {placeholder} - - )} - {items - .map((item) => { - const itemValue = getItemValue(item); - if (itemValue === undefined || itemValue === null) { - return null; - } - return ( - - {item.name} - - ); - }) - .filter(Boolean)} - - - ); -}; - -Select.propTypes = { - id: PropTypes.string, - name: PropTypes.string, - label: PropTypes.string, - placeholder: PropTypes.string, - isHidden: PropTypes.bool, - error: PropTypes.bool, - value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]) - .isRequired, - items: PropTypes.arrayOf( - PropTypes.shape({ - _id: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]), - id: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]), - - name: PropTypes.string.isRequired, - }) - ).isRequired, - onChange: PropTypes.func.isRequired, - onBlur: PropTypes.func, - sx: PropTypes.object, - labelControlSpacing: PropTypes.number, - /** - * Maximum width in pixels. Used to control text truncation and element width. - * Responsive breakpoints will be calculated as percentages of this value. - */ - maxWidth: PropTypes.number, -}; - -export default Select; diff --git a/client/src/Components/v1/Inputs/TextInput/Adornments/index.jsx b/client/src/Components/v1/Inputs/TextInput/Adornments/index.jsx deleted file mode 100644 index 2b3abab0f..000000000 --- a/client/src/Components/v1/Inputs/TextInput/Adornments/index.jsx +++ /dev/null @@ -1,74 +0,0 @@ -import { Stack, Typography, InputAdornment, IconButton } from "@mui/material"; -import { useTheme } from "@mui/material/styles"; -import PropTypes from "prop-types"; -import Icon from "../../../Icon"; - -export const HttpAdornment = ({ https }) => { - const theme = useTheme(); - return ( - - - {https ? "https" : "http"} - - - ); -}; - -HttpAdornment.propTypes = { - https: PropTypes.bool.isRequired, - prefix: PropTypes.string, -}; - -export const PasswordEndAdornment = ({ fieldType, setFieldType }) => { - const theme = useTheme(); - return ( - - setFieldType(fieldType === "password" ? "text" : "password")} - sx={{ - color: theme.palette.primary.lowContrast, - padding: theme.spacing(1), - "&:focus-visible": { - outline: `2px solid ${theme.palette.primary.main}`, - outlineOffset: `2px`, - }, - "& .MuiTouchRipple-root": { - pointerEvents: "none", - display: "none", - }, - }} - > - {fieldType === "password" ? ( - - ) : ( - - )} - - - ); -}; - -PasswordEndAdornment.propTypes = { - fieldType: PropTypes.string, - setFieldType: PropTypes.func, -}; diff --git a/client/src/Components/v1/Inputs/TextInput/index.jsx b/client/src/Components/v1/Inputs/TextInput/index.jsx deleted file mode 100644 index 7203e5f50..000000000 --- a/client/src/Components/v1/Inputs/TextInput/index.jsx +++ /dev/null @@ -1,181 +0,0 @@ -import { Stack, TextField, Typography } from "@mui/material"; -import { useTheme } from "@emotion/react"; -import { forwardRef, useState, cloneElement } from "react"; -import PropTypes from "prop-types"; -import FieldWrapper from "../FieldWrapper/index.jsx"; - -const getSx = (theme, type, maxWidth) => { - const sx = { - maxWidth: maxWidth, - - "& .MuiFormHelperText-root": { - position: "absolute", - bottom: `-${theme.spacing(24)}`, - minHeight: theme.spacing(24), - }, - }; - - if (type === "url") { - return { - ...sx, - "& .MuiInputBase-root": { padding: 0 }, - "& .MuiStack-root": { - borderTopLeftRadius: theme.shape.borderRadius, - borderBottomLeftRadius: theme.shape.borderRadius, - }, - }; - } - return sx; -}; - -const Required = () => { - const theme = useTheme(); - return ( - - * - - ); -}; - -const Optional = ({ optionalLabel }) => { - const theme = useTheme(); - return ( - - {optionalLabel || "(optional)"} - - ); -}; - -Optional.propTypes = { - optionalLabel: PropTypes.string, -}; - -const TextInput = forwardRef( - ( - { - id, - name, - type, - value, - placeholder, - isRequired, - isOptional, - optionalLabel, - onChange, - onBlur, - error = false, - helperText = null, - startAdornment = null, - endAdornment = null, - label = null, - maxWidth = "100%", - flex, - marginTop, - marginRight, - marginBottom, - marginLeft, - disabled = false, - hidden = false, - //FieldWrapper's props - gap, - labelMb, - labelFontWeight, - labelVariant, - labelSx = {}, - sx = {}, - }, - ref - ) => { - const [fieldType, setFieldType] = useState(type); - const theme = useTheme(); - const labelContent = label && ( - <> - {label} - {isRequired && } - {isOptional && } - - ); - return ( - - ); - } -); - -TextInput.displayName = "TextInput"; - -TextInput.propTypes = { - type: PropTypes.string, - id: PropTypes.string, - name: PropTypes.string, - value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - placeholder: PropTypes.string, - isRequired: PropTypes.bool, - isOptional: PropTypes.bool, - optionalLabel: PropTypes.string, - onChange: PropTypes.func, - onBlur: PropTypes.func, - error: PropTypes.bool, - helperText: PropTypes.string, - startAdornment: PropTypes.node, - endAdornment: PropTypes.node, - label: PropTypes.string, - maxWidth: PropTypes.string, - flex: PropTypes.number, - marginTop: PropTypes.string, - marginRight: PropTypes.string, - marginBottom: PropTypes.string, - marginLeft: PropTypes.string, - disabled: PropTypes.bool, - hidden: PropTypes.bool, -}; - -export default TextInput; diff --git a/client/src/Components/v1/Link/index.jsx b/client/src/Components/v1/Link/index.jsx deleted file mode 100644 index 987c56f37..000000000 --- a/client/src/Components/v1/Link/index.jsx +++ /dev/null @@ -1,73 +0,0 @@ -import { Link as MuiLink, useTheme } from "@mui/material"; -import { Link as RouterLink } from "react-router-dom"; - -import PropTypes from "prop-types"; - -/** - * @component - * @param {Object} props - * @param {'primary' | 'secondary' | 'tertiary' | 'error'} props.level - The level of the link - * @param {string} props.label - The label of the link - * @param {string} props.url - The URL of the link - * @returns {JSX.Element} - */ - -const Link = ({ level, label, url, external = true }) => { - const theme = useTheme(); - - const levelConfig = { - primary: { - color: theme.palette.primary.contrastTextTertiary, - sx: { - ":hover": { - color: theme.palette.primary.contrastTextSecondary, - }, - }, - }, - secondary: { - color: theme.palette.primary.contrastTextSecondary, - sx: { - ":hover": { - color: theme.palette.primary.contrastTextSecondary, - }, - }, - }, - tertiary: { - color: theme.palette.primary.contrastTextTertiary, - sx: { - textDecoration: "underline", - textDecorationStyle: "dashed", - textDecorationColor: theme.palette.primary.main, - textUnderlineOffset: "1px", - ":hover": { - color: theme.palette.primary.contrastTextTertiary, - textDecorationColor: theme.palette.primary.main, - backgroundColor: theme.palette.primary.lowContrast, - }, - }, - }, - error: {}, - }; - const { sx, color } = levelConfig[level]; - return ( - - {label} - - ); -}; - -Link.propTypes = { - url: PropTypes.string.isRequired, - level: PropTypes.oneOf(["primary", "secondary", "tertiary", "error"]), - label: PropTypes.string.isRequired, - external: PropTypes.bool, -}; - -export default Link; diff --git a/client/src/Components/v1/Link/link.css b/client/src/Components/v1/Link/link.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/client/src/Components/v1/TextLink/index.jsx b/client/src/Components/v1/TextLink/index.jsx deleted file mode 100644 index e226250a6..000000000 --- a/client/src/Components/v1/TextLink/index.jsx +++ /dev/null @@ -1,38 +0,0 @@ -import Typography from "@mui/material/Typography"; -import Stack from "@mui/material/Stack"; -import Link from "@mui/material/Link"; -import PropTypes from "prop-types"; -import { useTheme } from "@emotion/react"; -import { Link as RouterLink } from "react-router-dom"; - -const TextLink = ({ text, linkText, href, state, target = "_self" }) => { - const theme = useTheme(); - - return ( - - {text} - - {linkText} - - - ); -}; - -TextLink.propTypes = { - text: PropTypes.string, - linkText: PropTypes.string, - href: PropTypes.string, - state: PropTypes.object, - target: PropTypes.string, -}; - -export default TextLink; diff --git a/client/src/Components/v1/Toast/body.jsx b/client/src/Components/v1/Toast/body.jsx deleted file mode 100644 index 04d5aee99..000000000 --- a/client/src/Components/v1/Toast/body.jsx +++ /dev/null @@ -1,34 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; - -import { useTheme } from "@emotion/react"; -import PropTypes from "prop-types"; - -const ToastBody = ({ body }) => { - const theme = useTheme(); - - if (Array.isArray(body)) { - return ( - - {body.map((item, idx) => ( - - {item} - - ))} - - ); - } else if (typeof body === "string") { - return {body}; - } - - return null; -}; - -ToastBody.propTypes = { - body: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), -}; - -export default ToastBody; diff --git a/client/src/Components/v1/Toast/index.jsx b/client/src/Components/v1/Toast/index.jsx deleted file mode 100644 index d409cec81..000000000 --- a/client/src/Components/v1/Toast/index.jsx +++ /dev/null @@ -1,114 +0,0 @@ -import Stack from "@mui/material/Stack"; -import IconButton from "@mui/material/IconButton"; -import Typography from "@mui/material/Typography"; -import Button from "@mui/material/Button"; -import ToastBody from "./body.jsx"; -import Icon from "../Icon"; - -// Utils -import { useTheme } from "@emotion/react"; -import PropTypes from "prop-types"; - -const icons = { - info: ( - - ), - error: ( - - ), - warning: ( - - ), -}; - -const Toast = ({ variant, title, body, onClick, hasDismiss, hasIcon }) => { - const theme = useTheme(); - const icon = icons[variant]; - - return ( - - - {hasIcon && icon} - {title && ( - - {title} - - )} - {title && ( - - - - )} - - - - - {!title && ( - - - - )} - - {hasDismiss && ( - - )} - - ); -}; - -export default Toast; - -Toast.propTypes = { - variant: PropTypes.string.isRequired, - title: PropTypes.string, - body: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - hasDismiss: PropTypes.bool, - hasIcon: PropTypes.bool, - onClick: PropTypes.func, -}; diff --git a/client/src/Components/v2/design-elements/Fallback.tsx b/client/src/Components/v2/design-elements/Fallback.tsx index 16eece25a..593829ab5 100644 --- a/client/src/Components/v2/design-elements/Fallback.tsx +++ b/client/src/Components/v2/design-elements/Fallback.tsx @@ -85,12 +85,7 @@ export const EmptyFallback = ({ zIndex={1} alignItems="center" > - - {title} - + {title} { const theme = useTheme(); @@ -19,7 +19,6 @@ export const MonitorStatus = ({ monitor }: { monitor: Monitor }) => { { backgroundSize: "100% 100%", backgroundPosition: "center", backgroundRepeat: "no-repeat", - color: theme.palette.primary.contrastText, }} > diff --git a/client/src/Utils/MonitorUtils.ts b/client/src/Utils/MonitorUtils.ts index b73fc5bc4..3be1b30a1 100644 --- a/client/src/Utils/MonitorUtils.ts +++ b/client/src/Utils/MonitorUtils.ts @@ -1,5 +1,5 @@ import type { MonitorStatus, MonitorType } from "@/Types/Monitor"; -import type { PaletteKey } from "@/Utils/Theme/v2Theme"; +import type { PaletteKey } from "@/Utils/Theme/Theme"; import type { ValueType } from "@/Components/v2/design-elements/StatusLabel"; export const getMonitorPath = (type: MonitorType): string => { diff --git a/client/src/Utils/Theme/v2Palette.ts b/client/src/Utils/Theme/Palette.ts similarity index 100% rename from client/src/Utils/Theme/v2Palette.ts rename to client/src/Utils/Theme/Palette.ts diff --git a/client/src/Utils/Theme/v2Theme.ts b/client/src/Utils/Theme/Theme.ts similarity index 99% rename from client/src/Utils/Theme/v2Theme.ts rename to client/src/Utils/Theme/Theme.ts index 39ede6c7e..49c1636ec 100644 --- a/client/src/Utils/Theme/v2Theme.ts +++ b/client/src/Utils/Theme/Theme.ts @@ -1,5 +1,5 @@ import { createTheme } from "@mui/material"; -import { lightPalette, darkPalette, typographyLevels } from "@/Utils/Theme/v2Palette"; +import { lightPalette, darkPalette, typographyLevels } from "@/Utils/Theme/Palette"; import type { Theme } from "@mui/material/styles"; diff --git a/client/src/Utils/Theme/constants.js b/client/src/Utils/Theme/constants.js deleted file mode 100644 index 2664c6126..000000000 --- a/client/src/Utils/Theme/constants.js +++ /dev/null @@ -1,291 +0,0 @@ -import { lighten } from "@mui/material/styles"; // CAIO_REVIEW - -const typographyBase = 13; - -/* TODO -Check for px in codebase. All font sizes should be in REM and should live here. -Rest should be checked on each case -*/ -const typographyLevels = { - base: typographyBase, - xs: `${(typographyBase - 4) / 16}rem`, - s: `${(typographyBase - 2) / 16}rem`, - m: `${typographyBase / 16}rem`, - l: `${(typographyBase + 2) / 16}rem`, - xl: `${(typographyBase + 10) / 16}rem`, -}; - -/* TODO Review color palette and semantic colors */ -const paletteColors = { - white: "#FFFFFF", - gray50: "#FEFEFE", - gray60: "#FEFDFE", - gray70: "#FDFDFD", - gray80: "#FDFCFD", - gray90: "#FCFCFD", - gray100: "#F4F4F4", - gray150: "#EFEFEF", - gray200: "#E3E3E3", - gray300: "#A2A3A3", - gray500: "#838C99", - gray600: "#454546", - gray750: "#36363E", - gray800: "#2D2D33", - gray850: "#131315", - gray860: "#111113", - gray870: "#0F0F11", - gray880: "#0C0C0E", - gray890: "#09090B", - blueGray20: "#E8F0FE", - blueGray150: "#667085", - blueGray200: "#475467", - blueGray400: "#344054", - blueBlueWave: "#1570EF", - blue700: "#4E5BA6", - purple300: "#664EFF", - purple400: "#3A1BFF", - green50: "#D4F4E1", - green150: "#45BB7A", - green400: "#079455", - green500: "#07B467", - green800: "#1C4428", - green900: "#12261E", - red50: "#F9ECED", - red100: "#FBD1D1", - red200: "#F04438", - red300: "#D32F2F", - red700: "#542426", - red800: "#912018", - orange50: "#FEF8EA", - orange100: "#FFECBC", - orange300: "#FDB022", - orange400: "#FF9F00", - orange500: "#E88C30", - orange600: "#DC6803", - orange800: "#624711", -}; - -const semanticColors = { - unresolved: { - main: { - light: paletteColors.blue700, - dark: paletteColors.purple300, - }, - light: { - light: paletteColors.blueGray20, - dark: paletteColors.purple400, - }, - bg: { - light: paletteColors.gray100, - dark: paletteColors.gray100, - }, - }, -}; - -const newColors = { - offWhite: "#FEFEFE", - offBlack: "#131315", - gray0: "#FDFDFD", - gray10: "#F4F4FF", - gray50: "#F9F9F9", - gray100: "#F3F3F3", - gray200: "#EFEFEF", - gray250: "#DADADA", - gray500: "#A2A3A3", - gray900: "#1c1c1c", - blueGray50: "#E8F0FE", - blueGray500: "#475467", - blueGray600: "#344054", - blueGray800: "#1C2130", - blueGray900: "#515151", - blueBlueWave: "#1570EF", - lightBlueWave: "#CDE2FF", - green100: "#67cd78", - green200: "#4B9B77", - green400: "#079455", - green700: "#026513", - orange100: "#FD8F22", - orange200: "#D69A5D", - orange600: "#9B734B", - orange700: "#884605", - red100: "#F27C7C", - red400: "#D92020", - red600: "#9B4B4B", - red700: "#980303", -}; - -/* -Structure: -main: background color -contrastText: color for main contrast text -contrastTextSecondary: if needed -contrastTextTertiary: if needed -lowContrast: if we need some low contrast for that color (for borders, and decorative elements). This should never be usend in text - -*/ -const newSemanticColors = { - accent: { - main: { - light: newColors.blueBlueWave, - dark: newColors.blueBlueWave, - }, - light: { - light: lighten(newColors.blueBlueWave, 0.2), //CAIO_REVIEW - dark: lighten(newColors.blueBlueWave, 0.2), //CAIO_REVIEW - }, - contrastText: { - light: newColors.offWhite, - dark: newColors.offWhite, - }, - }, - primary: { - main: { - light: newColors.offWhite, - dark: newColors.offBlack, - }, - contrastText: { - light: newColors.blueGray800, - dark: newColors.blueGray50, - }, - contrastTextSecondary: { - light: newColors.blueGray600, - dark: newColors.gray200, - }, - contrastTextSecondaryDarkBg: { - light: newColors.gray200, - dark: newColors.gray200, - }, - contrastTextTertiary: { - light: newColors.blueGray500, - dark: newColors.gray500, - }, - lowContrast: { - light: newColors.gray250, - dark: newColors.blueGray600, - }, - }, - primaryBackground: { - main: { - light: newColors.gray0, - dark: "#000000", - }, - }, - secondary: { - main: { - light: newColors.gray200, - dark: "#313131" /* newColors.blueGray600 */, - }, - light: { - light: newColors.lightBlueWave, - dark: newColors.lightBlueWave, - }, - contrastText: { - light: newColors.blueGray600, - dark: newColors.gray200, - }, - }, - tertiary: { - main: { - light: newColors.gray100, - dark: newColors.blueGray800, - }, - contrastText: { - light: newColors.blueGray800, - dark: newColors.gray100, - }, - }, - success: { - main: { - light: newColors.green700, - dark: newColors.green100, - }, - contrastText: { - light: newColors.offWhite, - dark: newColors.offBlack, - }, - lowContrast: { - light: newColors.green400, - dark: newColors.green200, - }, - }, - warning: { - main: { - light: newColors.orange700, - dark: newColors.orange200, - }, - contrastText: { - light: newColors.offWhite, - dark: newColors.offBlack, - }, - lowContrast: { - light: newColors.orange100, - dark: newColors.orange600, - }, - }, - /* Custom palette for PageSpeed warning box */ - warningSecondary: { - main: { - light: paletteColors.orange50, - dark: paletteColors.orange800, - }, - contrastText: { - light: paletteColors.orange600, - dark: paletteColors.orange100, - }, - lowContrast: { - light: paletteColors.orange300, - dark: paletteColors.orange400, - }, - }, - error: { - main: { - light: newColors.red700, - dark: newColors.red100, - }, - contrastText: { - light: newColors.offWhite, - dark: newColors.offBlack, - }, - lowContrast: { - light: newColors.red400, - dark: newColors.red600, - }, - }, - - /* These are temporary, just for everything not to break */ - gradient: { - color1: { - light: paletteColors.gray90, - dark: paletteColors.gray890, - }, - color2: { - light: paletteColors.gray80, - dark: paletteColors.gray880, - }, - color3: { - light: paletteColors.gray70, - dark: paletteColors.gray870, - }, - color4: { - light: paletteColors.gray60, - dark: paletteColors.gray860, - }, - color5: { - light: paletteColors.gray50, - dark: paletteColors.gray850, - }, - }, - - alert: { - main: { - light: newColors.gray200, - dark: newColors.gray900, - }, - contrastText: { - light: newColors.blueGray600, - dark: newColors.blueGray900, - }, - }, -}; - -export { typographyLevels, semanticColors as colors, newSemanticColors }; diff --git a/client/src/Utils/Theme/darkTheme.js b/client/src/Utils/Theme/darkTheme.js deleted file mode 100644 index 1ec5a2c3a..000000000 --- a/client/src/Utils/Theme/darkTheme.js +++ /dev/null @@ -1,13 +0,0 @@ -import { createTheme } from "@mui/material"; -import { baseTheme } from "./globalTheme"; -import { /* colors, */ newSemanticColors } from "./constants"; -import { extractThemeColors } from "./extractColorObject"; - -const palette = extractThemeColors("dark", newSemanticColors); - -const darkTheme = createTheme({ - palette, - ...baseTheme(palette), -}); - -export default darkTheme; diff --git a/client/src/Utils/Theme/extractColorObject.js b/client/src/Utils/Theme/extractColorObject.js deleted file mode 100644 index bfd1a5aff..000000000 --- a/client/src/Utils/Theme/extractColorObject.js +++ /dev/null @@ -1,25 +0,0 @@ -function extractThemeColors(themeType, colorObject) { - if (!["light", "dark"].includes(themeType)) { - throw new Error('Invalid theme type. Use "light" or "dark".'); - } - - const extract = (obj) => { - if (typeof obj !== "object" || obj === null) { - return obj; - } - - if ("light" in obj && "dark" in obj) { - // CAIO_REVIEW: This will break if the root object has light and dark properties - return obj[themeType]; // Return the value for the specified theme - } - - // Reduce the object, keeping only the extracted themeType values - return Object.keys(obj).reduce((acc, key) => { - acc[key] = extract(obj[key]); - return acc; - }, {}); - }; - return extract(colorObject); -} - -export { extractThemeColors }; diff --git a/client/src/Utils/Theme/globalTheme.js b/client/src/Utils/Theme/globalTheme.js deleted file mode 100644 index 98f3479be..000000000 --- a/client/src/Utils/Theme/globalTheme.js +++ /dev/null @@ -1,793 +0,0 @@ -import { typographyLevels } from "./constants"; -const fontFamilyPrimary = '"Inter" , sans-serif'; -import { darken } from "@mui/material/styles"; -// const fontFamilySecondary = '"Avenir", sans-serif'; - -/* TODO take the color out from here */ -const shadow = - "0px 4px 24px -4px rgba(16, 24, 40, 0.08), 0px 3px 3px -3px rgba(16, 24, 40, 0.03)"; - -const baseTheme = (palette) => ({ - typography: { - fontFamily: fontFamilyPrimary, - fontSize: typographyLevels.base, - h1: { - fontSize: typographyLevels.xl, - color: palette.primary.contrastText, - fontWeight: 500, - }, - h2: { - fontSize: typographyLevels.l, - color: palette.primary.contrastTextSecondary, - fontWeight: 400, - }, - // CAIO_REVIEW, need a brighter color for dark bg - h2DarkBg: { - fontSize: typographyLevels.l, - color: palette.primary.contrastTextSecondaryDarkBg, - fontWeight: 400, - }, - body1: { - fontSize: typographyLevels.m, - color: palette.primary.contrastTextTertiary, - fontWeight: 400, - }, - body2: { - fontSize: typographyLevels.s, - color: palette.primary.contrastTextTertiary, - fontWeight: 400, - }, - label: { - color: palette.primary.contrastTextSecondary, - fontWeight: 500, - }, - }, - /* TODO change to 4 */ - spacing: 2, - /* TODO we can skip using the callback functions on the next lines since we are already accessing it on line 10. That was the last thing I managed to do, so we are sort of doing it twice*/ - /* TODO All these should live inside of a component*/ - components: { - MuiButton: { - defaultProps: { - disableRipple: true, - }, - - styleOverrides: { - root: ({ theme }) => ({ - variants: [ - { - props: (props) => props.variant === "contained" && props.color === "accent", - backgroundColor: theme.palette.accent.main, - style: { - color: theme.palette.primary.contrastTextSecondaryDarkBg, - letterSpacing: "0.5px", - textShadow: "0 0 1px rgba(0, 0, 0, 0.15)", - "&:hover": { - backgroundColor: darken(theme.palette.accent.main, 0.25), - boxShadow: `0 2px 6px rgba(0, 0, 0, 0.1)`, - transition: "all 0.2s ease-in-out", - }, - }, - }, - { - props: (props) => props.color === "accent", - style: { - "&:hover": { - backgroundColor: darken(theme.palette.accent.main, 0.2), - }, - }, - }, - { - props: (props) => props.color === "error", - style: { - "&.Mui-disabled": { - backgroundColor: theme.palette.error.lowContrast, - }, - "& .MuiButton-loadingIndicator": { - // styles for error variant loading indicator - color: theme.palette.error.contrastText, - }, - }, - }, - { - props: (props) => props.variant === "group", - style: { - /* color: theme.palette.secondary.contrastText, */ - color: theme.palette.primary.contrastText, - backgroundColor: theme.palette.primary.main, - border: 1, - borderStyle: "solid", - borderColor: theme.palette.primary.lowContrast, - }, - }, - { - props: (props) => props.variant === "group" && props.filled === "true", - style: { - backgroundColor: theme.palette.secondary.main, - }, - }, - /* { - props: (props) => props.variant === "contained", - style: { - backgroundColor: `${theme.palette.accent.main} !important`, - }, - }, */ - - { - props: (props) => - props.variant === "contained" && props.color === "secondary", - style: { - border: 1, - borderStyle: "solid", - borderColor: theme.palette.primary.lowContrast, - }, - }, - { - props: (props) => { - return ( - props.variant === "contained" && - props.disabled && - props?.classes?.loadingIndicator === undefined // Do not apply to loading button - ); - }, - style: { - backgroundColor: `${theme.palette.secondary.main} !important`, - color: `${theme.palette.secondary.contrastText} !important`, - }, - }, - - { - props: { variant: "text", color: "info" }, - style: { - textDecoration: "underline", - color: theme.palette.primary.contrastText, - padding: 0, - margin: 0, - fontSize: typographyLevels.m, - fontWeight: theme.typography.body2.fontWeight, - backgroundColor: "transparent", - "&:hover": { - backgroundColor: "transparent", - textDecoration: "underline", - }, - "&.Mui-disabled": { - backgroundColor: "transparent", - color: theme.palette.text.primary, - opacity: 0.5, - "&.MuiButton-text": { - backgroundColor: "transparent", - }, - }, - minWidth: 0, - boxShadow: "none", - border: "none", - }, - }, - ], - height: 34, - fontWeight: 400, - borderRadius: 4, - boxShadow: "none", - textTransform: "none", - "&:focus": { - outline: "none", - }, - "&:hover": { - boxShadow: "none", - }, - "&.Mui-disabled": { - backgroundColor: theme.palette.secondary.main, - color: theme.palette.primary.contrastText, - }, - "&.MuiButton-root": { - "&:disabled": { - backgroundColor: theme.palette.secondary.main, - color: theme.palette.primary.contrastText, - }, - "&.MuiButton-colorAccent:hover": { - boxShadow: `0 0 0 1px ${theme.palette.accent.main}`, // CAIO_REVIEW, this should really have a solid BG color - }, - }, - "&.MuiButton-loading": { - "&:disabled": { - color: "transparent", - }, - - "& .MuiButton-loadingIndicator": { - color: theme.palette.primary.contrastText, - }, - }, - }), - }, - }, - - MuiIconButton: { - styleOverrides: { - root: ({ theme }) => ({ - padding: 4, - transition: "none", - "&:hover": { - backgroundColor: theme.palette.primary.lowContrast, - }, - }), - }, - }, - MuiPaper: { - styleOverrides: { - root: ({ theme }) => { - return { - marginTop: 4, - padding: 0, - border: 1, - borderStyle: "solid", - borderColor: theme.palette.primary.lowContrast, - borderRadius: 4, - boxShadow: shadow, - backgroundColor: theme.palette.primary.main, - backgroundImage: "none", - }; - }, - }, - }, - MuiList: { - styleOverrides: { - root: ({ theme }) => ({ - padding: 0, - }), - }, - }, - MuiListItemButton: { - styleOverrides: { - root: ({ theme }) => ({ - transition: "background-color .3s", - }), - }, - }, - MuiListItemText: { - styleOverrides: { - root: ({ theme }) => ({ - "& .MuiTypography-root": { - color: theme.palette.primary.contrastText, - }, - }), - }, - }, - MuiMenuItem: { - styleOverrides: { - root: ({ theme }) => ({ - borderRadius: 4, - backgroundColor: "inherit", - padding: "4px 6px", - color: theme.palette.primary.contrastTextSecondary, - fontSize: 13, - margin: 2, - minWidth: 100, - "&:hover, &.Mui-selected, &.Mui-selected:hover, &.Mui-selected.Mui-focusVisible": - { - backgroundColor: theme.palette.primary.lowContrast, - }, - }), - }, - }, - MuiTableCell: { - styleOverrides: { - root: ({ theme }) => ({ - fontSize: typographyLevels.base, - borderBottomColor: theme.palette.primary.lowContrast, - }), - }, - }, - - MuiTableHead: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.tertiary.main, - }), - }, - }, - MuiPagination: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.primary.main, - border: 1, - borderStyle: "solid", - borderColor: theme.palette.primary.lowContrast, - "& button": { - color: theme.palette.primary.contrastTextTertiary, - borderRadius: 4, - }, - "& li:first-of-type button, & li:last-of-type button": { - border: 1, - borderStyle: "solid", - borderColor: theme.palette.primary.lowContrast, - }, - }), - }, - }, - MuiPaginationItem: { - styleOverrides: { - root: ({ theme }) => ({ - "&:not(.MuiPaginationItem-ellipsis):hover, &.Mui-selected": { - backgroundColor: theme.palette.primary.lowContrast, - }, - }), - }, - }, - MuiSkeleton: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.primary.lowContrast, - }), - }, - }, - - MuiTextField: { - styleOverrides: { - root: ({ theme }) => ({ - "& fieldset": { - borderColor: theme.palette.primary.lowContrast, - borderRadius: theme.shape.borderRadius, - }, - - "& .MuiInputBase-input": { - padding: ".75em", - fontWeight: 400, - color: palette.primary.contrastTextSecondary, - "&.Mui-disabled": { - opacity: 0.3, - WebkitTextFillColor: "unset", - }, - "& .Mui-focused": { - /* color: "#ff0000", */ - /* borderColor: theme.palette.primary.contrastText, */ - }, - }, - - "& .MuiInputBase-input:-webkit-autofill": { - transition: "background-color 5000s ease-in-out 0s", - WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.primary.main} inset`, - WebkitTextFillColor: theme.palette.primary.contrastText, - }, - - "& .MuiInputBase-input.MuiOutlinedInput-input": { - padding: `0 ${theme.spacing(5)}`, - }, - - "& .MuiOutlinedInput-root": { - color: theme.palette.primary.contrastTextSecondary, - borderRadius: 4, - }, - - "& .MuiOutlinedInput-notchedOutline": { - borderRadius: 4, - }, - - "& .MuiFormHelperText-root": { - color: palette.error.main, - opacity: 0.8, - fontSize: "var()", - marginLeft: 0, - }, - - "& .MuiFormHelperText-root.Mui-error": { - opacity: 0.8, - color: palette.error.main, - whiteSpace: "nowrap", - }, - }), - }, - }, - - MuiOutlinedInput: { - styleOverrides: { - root: { - "&.Mui-disabled .MuiOutlinedInput-notchedOutline": { - borderColor: palette.primary.contrastBorderDisabled, - }, - "&.Mui-disabled:hover .MuiOutlinedInput-notchedOutline": { - borderColor: palette.primary.contrastBorderDisabled, - }, - "&:hover .MuiOutlinedInput-notchedOutline": { - borderColor: palette.primary.lowContrast, // Adjust hover border color - }, - "&.Mui-focused .MuiOutlinedInput-notchedOutline": { - borderColor: palette.accent.main, // Adjust focus border color - }, - color: palette.primary.contrastText, - }, - }, - }, - - MuiAutocomplete: { - styleOverrides: { - root: ({ theme }) => ({ - "& .MuiOutlinedInput-root": { - paddingTop: 0, - paddingBottom: 0, - paddingRight: theme.spacing(5), - }, - "& fieldset": { - borderColor: theme.palette.primary.lowContrast, - borderRadius: theme.shape.borderRadius, - }, - "& .MuiOutlinedInput-root:hover:not(:has(input:focus)):not(:has(textarea:focus)) fieldset": - { - borderColor: theme.palette.primary.lowContrast, - }, - - "& .MuiAutocomplete-tag": { - color: theme.palette.primary.contrastText, - backgroundColor: theme.palette.primary.lowContrast, - }, - "& .MuiChip-deleteIcon": { - color: theme.palette.primary.contrastText, // CAIO_REVIEW - }, - }), - }, - }, - - MuiTab: { - styleOverrides: { - root: ({ theme }) => ({ - color: theme.palette.tertiary.contrastText, - height: "34px", - minHeight: "34px", - borderRadius: 0, - textTransform: "none", - minWidth: "fit-content", - padding: `${theme.spacing(6)}px ${theme.spacing(4)}px`, - fontWeight: 400, - "&:focus-visible": { - color: theme.palette.primary.contrastText, - borderColor: theme.palette.tertiary.contrastText, - borderRightColor: theme.palette.primary.lowContrast, - }, - "&.Mui-selected": { - color: theme.palette.secondary.contrastText, - }, - "&:hover": { - borderColor: theme.palette.primary.lowContrast, - }, - }), - }, - variants: [ - { - props: { orientation: "vertical" }, - style: ({ theme }) => ({ - alignItems: "flex-start", - padding: `${theme.spacing(1)}px ${theme.spacing(2)}px ${theme.spacing(1)}px ${theme.spacing(6)}px`, - minHeight: theme.spacing(12), - color: theme.palette.primary.contrastText, - backgroundColor: theme.palette.primary.main, - border: "none", - borderBottom: "none", - borderRight: "none", - borderRadius: theme.shape.borderRadius * 3, - margin: `${theme.spacing(1)}px ${theme.spacing(2)}px`, - "&.Mui-selected": { - color: theme.palette.primary.contrastText, - backgroundColor: theme.palette.tertiary.main, - opacity: 1, - border: "none", - borderBottom: "none", - borderRight: "none", - borderRadius: theme.shape.borderRadius * 3, - minHeight: theme.spacing(14), - }, - "&:hover": { - backgroundColor: theme.palette.tertiary.main, - border: "none", - borderRadius: theme.shape.borderRadius * 3, - minHeight: theme.spacing(14), - }, - }), - }, - ], - }, - MuiSvgIcon: { - styleOverrides: { - root: ({ theme }) => ({ - color: theme.palette.primary.contrastTextTertiary, - }), - }, - }, - MuiTabs: { - styleOverrides: { - root: ({ theme }) => ({ - height: "34px", - minHeight: "34px", - display: "inline-flex", - borderRadius: 0, - "& .MuiTabs-indicator": { - backgroundColor: theme.palette.tertiary.contrastText, - }, - }), - }, - variants: [ - { - props: { orientation: "vertical" }, - style: { - "& .MuiTabs-indicator": { - display: "none", - }, - }, - }, - ], - }, - MuiSwitch: { - styleOverrides: { - root: ({ theme }) => ({ - width: 42, - height: 26, - padding: 0, - "& .MuiSwitch-switchBase": { - padding: 0, - margin: 2, - transitionDuration: "300ms", - "&.Mui-checked": { - transform: "translateX(16px)", - color: "#fff", - "& + .MuiSwitch-track": { - backgroundColor: theme.palette.accent.main, - opacity: 1, - border: 0, - }, - }, - }, - "& .MuiSwitch-thumb": { - boxSizing: "border-box", - width: 22, - height: 22, - }, - "& .MuiSwitch-track": { - borderRadius: 13, - backgroundColor: theme.palette.secondary.light, - opacity: 1, - }, - }), - }, - }, - MuiSelect: { - styleOverrides: { - root: ({ theme }) => ({ - "& .MuiOutlinedInput-input": { - color: theme.palette.primary.contrastText, - }, - "& .MuiOutlinedInput-notchedOutline": { - borderColor: theme.palette.primary.lowContrast, - borderRadius: theme.shape.borderRadius, - }, - "& .MuiSelect-icon": { - color: theme.palette.primary.contrastTextSecondary, // Dropdown + color - }, - "& .MuiSelect-select": { - display: "flex", - alignItems: "center", - }, - "&:hover": { - backgroundColor: theme.palette.primary.main, // Background on hover - }, - "&:hover .MuiOutlinedInput-notchedOutline": { - borderColor: theme.palette.primary.lowContrast, - }, - padding: `0 ${theme.spacing(5)}`, - minHeight: "34px", - display: "flex", - alignItems: "center", - lineHeight: 1, - }), - }, - }, - MuiButtonGroup: { - styleOverrides: { - root: ({ theme }) => ({ - ml: "auto", - "& .MuiButtonBase-root, & .MuiButtonBase-root:hover": { - borderColor: theme.palette.primary.lowContrast, - width: "auto", - whiteSpace: "nowrap", - }, - }), - }, - }, - - // This code is added for clock in maintenance page - // code starts from here. - MuiClock: { - // Directly target the clock component - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.primary.main, // Alternative target - "& .MuiClock-clock": { - // Inner clock face - backgroundColor: theme.palette.secondary.main, - }, - }), - }, - }, - MuiClockPicker: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.secondary.main, // Outer container background - "& .MuiClock-root": { - color: theme.palette.primary.lowContrast, - }, - "& .MuiClock-clock": { - backgroundColor: theme.palette.background.default, // Clock face background - borderColor: theme.palette.secondary.lowContrast, - }, - }), - }, - }, - // The clock pointer ( pointer to number like hour/minute hand) - MuiClockPointer: { - styleOverrides: { - root: ({ theme }) => ({ - // Main pointer line color - backgroundColor: theme.palette.accent.main, - "& .MuiClockPointer-thumb": { - backgroundColor: theme.palette.grey[500], // Use your desired grey - }, - }), - }, - }, - // This is for numbers in the clock (circular one's) - MuiClockNumber: { - styleOverrides: { - root: ({ theme }) => ({ - color: theme.palette.primary.contrastText, - "&.Mui-selected": { - color: theme.palette.accent.contrastText, - backgroundColor: theme.palette.accent.main, - }, - }), - }, - }, - // This is for 00:00 am and pm (top bar) - MuiTimePickerToolbar: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.secondary.lowContrast, - // General text color - "& .MuiTypography-root": { - color: theme.palette.primary.contrastTextTertiary, - }, - // Selected time (hour/minute) color - "& .Mui-selected": { - color: `${theme.palette.accent.main} !important`, - }, - // AM/PM buttons color - "& .MuiButtonBase-root": { - "&.Mui-selected": { - backgroundColor: theme.palette.accent.main, - }, - }, - }), - }, - }, - // left and right direction style - MuiPickersArrowSwitcher: { - styleOverrides: { - root: ({ theme }) => ({ - "& .MuiIconButton-root": { - color: theme.palette.primary.contrastText, - }, - }), - }, - }, - // cancel and okay actions style - MuiDialogActions: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.primary.main, - }), - }, - }, - // DatePicker calendar popup styling - MuiPickersPopper: { - styleOverrides: { - paper: ({ theme }) => ({ - backgroundColor: theme.palette.primary.main, - }), - }, - }, - MuiDateCalendar: { - styleOverrides: { - root: ({ theme }) => ({ - backgroundColor: theme.palette.primary.main, - }), - }, - }, - MuiPickersCalendarHeader: { - styleOverrides: { - root: ({ theme }) => ({ - "& .MuiPickersCalendarHeader-label": { - color: theme.palette.primary.contrastText, - }, - }), - }, - }, - MuiDayCalendar: { - styleOverrides: { - weekDayLabel: ({ theme }) => ({ - color: theme.palette.primary.contrastTextTertiary, - }), - }, - }, - MuiPickersDay: { - styleOverrides: { - root: ({ theme }) => ({ - color: theme.palette.primary.contrastText, - "&:hover": { - backgroundColor: theme.palette.tertiary.main, - }, - "&.Mui-selected": { - backgroundColor: theme.palette.accent.main, - color: theme.palette.accent.contrastText, - "&:hover": { - backgroundColor: theme.palette.accent.main, - }, - }, - "&.Mui-disabled": { - color: theme.palette.primary.contrastTextTertiary, - opacity: 0.5, - }, - }), - }, - }, - // code ends here. - - // For labels of input fields - MuiInputLabel: { - styleOverrides: { - root: ({ theme }) => ({ - "&.Mui-focused": { - color: theme.palette.accent.main, - }, - }), - }, - }, - MuiTypography: { - variants: [ - { - props: { variant: "monitorName" }, - style: { - fontSize: typographyLevels.xl, - color: palette.primary.contrastText, - fontWeight: 500, - overflow: "hidden", - textOverflow: "ellipsis", - whiteSpace: "nowrap", - }, - }, - { - props: { variant: "monitorUrl" }, - style: { - fontSize: typographyLevels.l, - color: palette.primary.contrastTextSecondary, - fontWeight: "bolder", - fontFamily: "monospace", - overflow: "hidden", - textOverflow: "ellipsis", - whiteSpace: "nowrap", - }, - }, - ], - }, - - MuiTooltip: { - styleOverrides: { - tooltip: () => ({ - fontSize: typographyLevels.m, - }), - }, - }, - }, - shape: { - borderRadius: 2, - borderThick: 2, - boxShadow: shadow, - }, -}); - -export { baseTheme }; diff --git a/client/src/Utils/Theme/lightTheme.js b/client/src/Utils/Theme/lightTheme.js deleted file mode 100644 index 94e8d3d4a..000000000 --- a/client/src/Utils/Theme/lightTheme.js +++ /dev/null @@ -1,12 +0,0 @@ -import { createTheme } from "@mui/material"; -import { baseTheme } from "./globalTheme"; -import { /* colors, */ newSemanticColors } from "./constants"; -import { extractThemeColors } from "./extractColorObject"; - -const palette = extractThemeColors("light", newSemanticColors); -const lightTheme = createTheme({ - palette, - ...baseTheme(palette), -}); - -export default lightTheme; From d45e6ec97c64a9b8c59c64500126769917c2c2af Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 20 Feb 2026 18:13:39 +0000 Subject: [PATCH 21/21] remove v2 dir --- client/src/App.tsx | 2 +- .../src/Components/{v2 => }/actions-menu/index.tsx | 0 .../{v2 => }/common/charts/HeatmapResponseTime.tsx | 2 +- .../common/charts/HeatmapResponseTimeTooltip.tsx | 0 .../common/charts/HistogramResponseTime.tsx | 0 .../{v2 => }/common/controls/HeaderCreate.tsx | 0 .../{v2 => }/common/controls/HeaderTimeRange.tsx | 2 +- client/src/Components/common/index.ts | 5 +++++ .../Components/{v2 => }/design-elements/Avatar.tsx | 0 .../{v2 => }/design-elements/BaseBox.tsx | 0 .../{v2 => }/design-elements/BaseChart.tsx | 2 +- .../{v2 => }/design-elements/BasePage.tsx | 4 ++-- .../{v2 => }/design-elements/Breadcrumb.tsx | 0 .../{v2 => }/design-elements/BulletPointCheck.tsx | 0 .../Components/{v2 => }/design-elements/Dot.tsx | 0 .../{v2 => }/design-elements/Fallback.tsx | 4 ++-- .../Components/{v2 => }/design-elements/Gauge.tsx | 2 +- .../Components/{v2 => }/design-elements/Icon.tsx | 0 .../{v2 => }/design-elements/MonitorStatus.tsx | 2 +- .../{v2 => }/design-elements/OfflineBanner.tsx | 0 .../{v2 => }/design-elements/PulseDot.tsx | 0 .../{v2 => }/design-elements/SkeletonCard.tsx | 0 .../{v2 => }/design-elements/SplitBox.tsx | 0 .../{v2 => }/design-elements/StatBox.tsx | 2 +- .../{v2 => }/design-elements/StatusBox.tsx | 2 +- .../{v2 => }/design-elements/StatusLabel.tsx | 2 +- .../Components/{v2 => }/design-elements/Table.tsx | 0 .../Components/{v2 => }/design-elements/Tabs.tsx | 0 .../{v2 => }/design-elements/TextLink.tsx | 0 .../{v2 => }/design-elements/Tooltip.tsx | 0 .../Components/{v2 => }/design-elements/index.tsx | 0 .../src/Components/{v2 => }/i18nLoader/index.tsx | 0 .../Components/{v2 => }/inputs/AutoComplete.tsx | 2 +- client/src/Components/{v2 => }/inputs/Button.tsx | 0 client/src/Components/{v2 => }/inputs/Checkbox.tsx | 0 .../src/Components/{v2 => }/inputs/ColorPicker.tsx | 2 +- .../src/Components/{v2 => }/inputs/DatePicker.tsx | 0 client/src/Components/{v2 => }/inputs/Dialog.tsx | 2 +- .../src/Components/{v2 => }/inputs/FieldLabel.tsx | 0 .../src/Components/{v2 => }/inputs/ImageUpload.tsx | 0 .../{v2 => }/inputs/LanguageSelector.tsx | 2 +- client/src/Components/{v2 => }/inputs/Radio.tsx | 0 client/src/Components/{v2 => }/inputs/Select.tsx | 0 client/src/Components/{v2 => }/inputs/Slider.tsx | 0 client/src/Components/{v2 => }/inputs/Switch.tsx | 0 .../src/Components/{v2 => }/inputs/SwitchTheme.tsx | 0 .../src/Components/{v2 => }/inputs/TextInput.tsx | 0 .../src/Components/{v2 => }/inputs/TimePicker.tsx | 0 .../Components/{v2 => }/inputs/ToggleButton.tsx | 0 client/src/Components/{v2 => }/inputs/index.tsx | 0 .../src/Components/{v2 => }/layout/AppLayout.tsx | 2 +- .../src/Components/{v2 => }/layout/RootLayout.tsx | 2 +- .../{v2 => }/monitors/ControlsFilter.tsx | 2 +- .../{v2 => }/monitors/HeaderMonitorControls.tsx | 4 ++-- .../{v2 => }/monitors/HeaderMonitorsSummary.tsx | 2 +- .../{v2 => }/monitors/MonitorStatBoxes.tsx | 2 +- .../{v2 => }/monitors/charts/HistogramDetails.tsx | 2 +- .../monitors/charts/HistogramInfrastructure.tsx | 4 ++-- .../monitors/charts/HistogramPageSpeed.tsx | 2 +- .../monitors/charts/HistogramPageSpeedDetails.tsx | 6 +++--- .../charts/HistogramPageSpeedDetailsTooltip.tsx | 2 +- .../monitors/charts/HistogramPageSpeedTooltip.tsx | 0 .../{v2 => }/monitors/charts/HistogramStatus.tsx | 2 +- .../{v2 => }/monitors/charts/PiePageSpeed.tsx | 2 +- .../monitors/charts/PiePageSpeedLegend.tsx | 2 +- .../{v2 => }/monitors/charts/RadialAvgResponse.tsx | 2 +- client/src/Components/{v2 => }/monitors/index.tsx | 0 .../Components/{v2 => }/routing/RouteProtected.tsx | 0 .../src/Components/{v2 => }/sidebar/Authfooter.tsx | 2 +- client/src/Components/{v2 => }/sidebar/Logo.tsx | 0 client/src/Components/{v2 => }/sidebar/Menu.tsx | 2 +- client/src/Components/{v2 => }/sidebar/NavItem.tsx | 0 .../src/Components/{v2 => }/sidebar/StarPrompt.tsx | 2 +- client/src/Components/{v2 => }/sidebar/index.tsx | 10 +++++----- client/src/Components/v2/common/index.ts | 5 ----- client/src/Pages/Account/EditUser/index.tsx | 4 ++-- client/src/Pages/Account/TabPassword.tsx | 4 ++-- client/src/Pages/Account/TabProfile.tsx | 6 +++--- .../Account/components/AddTeamMemberDialog.tsx | 2 +- .../Account/components/HeaderTeamControls.tsx | 4 ++-- .../Account/components/InviteTeamMemberDialog.tsx | 2 +- client/src/Pages/Account/components/TeamTable.tsx | 4 ++-- client/src/Pages/Account/index.tsx | 2 +- client/src/Pages/Auth/Login/index.tsx | 4 ++-- client/src/Pages/Auth/Recovery/index.tsx | 4 ++-- client/src/Pages/Auth/Register/index.tsx | 4 ++-- client/src/Pages/Auth/SetNewPassword/index.tsx | 8 ++------ .../Pages/Auth/components/HeaderAuthControls.tsx | 2 +- client/src/Pages/Checks/Components/ChecksTable.tsx | 9 ++------- client/src/Pages/Checks/index.tsx | 6 +++--- client/src/Pages/CreateMonitor/index.tsx | 8 ++++---- .../src/Pages/Incidents/Components/CardDetails.tsx | 2 +- .../src/Pages/Incidents/Components/CardSummary.tsx | 2 +- .../Components/ControlsIncidentFilter.tsx | 2 +- .../Incidents/Components/DialogIncidentDetails.tsx | 2 +- .../Incidents/Components/DialogResolution.tsx | 2 +- .../Pages/Incidents/Components/IncidentTable.tsx | 14 +++++++------- client/src/Pages/Incidents/index.tsx | 4 ++-- .../Infrastructure/Details/Components/Charts.tsx | 2 +- .../Details/Components/ChartsNetwork.tsx | 2 +- .../Infrastructure/Details/Components/Gauges.tsx | 2 +- .../Details/Components/StatusBoxes.tsx | 2 +- client/src/Pages/Infrastructure/Details/index.tsx | 6 +++--- .../Monitors/Components/MonitorsTable.tsx | 6 +++--- client/src/Pages/Infrastructure/Monitors/index.tsx | 8 ++++---- client/src/Pages/Logs/TabLogs.tsx | 2 +- client/src/Pages/Logs/TabQueue.tsx | 2 +- client/src/Pages/Logs/components/Metrics.tsx | 2 +- client/src/Pages/Logs/components/StatGauges.tsx | 2 +- client/src/Pages/Logs/components/Stats.tsx | 2 +- client/src/Pages/Logs/components/TableJobs.tsx | 4 ++-- client/src/Pages/Logs/components/TableLogs.tsx | 6 +++--- client/src/Pages/Logs/index.tsx | 2 +- .../Pages/Maintenance/MaintenanceWindowTable.tsx | 12 ++++++------ client/src/Pages/Maintenance/create/index.tsx | 4 ++-- client/src/Pages/Maintenance/index.tsx | 4 ++-- client/src/Pages/NotFound/index.tsx | 2 +- .../components/NotificationsTable.tsx | 6 +++--- client/src/Pages/Notifications/create/index.tsx | 4 ++-- client/src/Pages/Notifications/index.tsx | 6 +++--- client/src/Pages/PageSpeed/Details/index.tsx | 4 ++-- .../Monitors/Components/PageSpeedMonitorsTable.tsx | 10 +++++----- client/src/Pages/PageSpeed/Monitors/index.tsx | 8 ++++---- client/src/Pages/Settings/DummyChart.tsx | 2 +- client/src/Pages/Settings/index.tsx | 6 +++--- .../Components/HeaderConfigStatusControls.tsx | 4 ++-- client/src/Pages/StatusPage/Create/index.tsx | 4 ++-- .../Status/Components/HeaderStatusPageControls.tsx | 4 ++-- .../StatusPage/Status/Components/MonitorsList.tsx | 6 +++--- client/src/Pages/StatusPage/Status/index.tsx | 2 +- .../StatusPages/Components/StatusPagesTable.tsx | 4 ++-- client/src/Pages/StatusPage/StatusPages/index.tsx | 6 +++--- .../Uptime/Details/Components/ChecksTable.tsx | 4 ++-- client/src/Pages/Uptime/Details/index.tsx | 8 ++++---- .../Monitors/Components/UptimeMonitorsTable.tsx | 8 ++++---- client/src/Pages/Uptime/Monitors/index.tsx | 8 ++++---- client/src/Routes/index.tsx | 7 ++----- client/src/Utils/MonitorUtils.ts | 2 +- client/src/main.tsx | 2 +- 139 files changed, 187 insertions(+), 199 deletions(-) rename client/src/Components/{v2 => }/actions-menu/index.tsx (100%) rename client/src/Components/{v2 => }/common/charts/HeatmapResponseTime.tsx (97%) rename client/src/Components/{v2 => }/common/charts/HeatmapResponseTimeTooltip.tsx (100%) rename client/src/Components/{v2 => }/common/charts/HistogramResponseTime.tsx (100%) rename client/src/Components/{v2 => }/common/controls/HeaderCreate.tsx (100%) rename client/src/Components/{v2 => }/common/controls/HeaderTimeRange.tsx (96%) create mode 100644 client/src/Components/common/index.ts rename client/src/Components/{v2 => }/design-elements/Avatar.tsx (100%) rename client/src/Components/{v2 => }/design-elements/BaseBox.tsx (100%) rename client/src/Components/{v2 => }/design-elements/BaseChart.tsx (96%) rename client/src/Components/{v2 => }/design-elements/BasePage.tsx (97%) rename client/src/Components/{v2 => }/design-elements/Breadcrumb.tsx (100%) rename client/src/Components/{v2 => }/design-elements/BulletPointCheck.tsx (100%) rename client/src/Components/{v2 => }/design-elements/Dot.tsx (100%) rename client/src/Components/{v2 => }/design-elements/Fallback.tsx (96%) rename client/src/Components/{v2 => }/design-elements/Gauge.tsx (98%) rename client/src/Components/{v2 => }/design-elements/Icon.tsx (100%) rename client/src/Components/{v2 => }/design-elements/MonitorStatus.tsx (95%) rename client/src/Components/{v2 => }/design-elements/OfflineBanner.tsx (100%) rename client/src/Components/{v2 => }/design-elements/PulseDot.tsx (100%) rename client/src/Components/{v2 => }/design-elements/SkeletonCard.tsx (100%) rename client/src/Components/{v2 => }/design-elements/SplitBox.tsx (100%) rename client/src/Components/{v2 => }/design-elements/StatBox.tsx (96%) rename client/src/Components/{v2 => }/design-elements/StatusBox.tsx (98%) rename client/src/Components/{v2 => }/design-elements/StatusLabel.tsx (97%) rename client/src/Components/{v2 => }/design-elements/Table.tsx (100%) rename client/src/Components/{v2 => }/design-elements/Tabs.tsx (100%) rename client/src/Components/{v2 => }/design-elements/TextLink.tsx (100%) rename client/src/Components/{v2 => }/design-elements/Tooltip.tsx (100%) rename client/src/Components/{v2 => }/design-elements/index.tsx (100%) rename client/src/Components/{v2 => }/i18nLoader/index.tsx (100%) rename client/src/Components/{v2 => }/inputs/AutoComplete.tsx (97%) rename client/src/Components/{v2 => }/inputs/Button.tsx (100%) rename client/src/Components/{v2 => }/inputs/Checkbox.tsx (100%) rename client/src/Components/{v2 => }/inputs/ColorPicker.tsx (94%) rename client/src/Components/{v2 => }/inputs/DatePicker.tsx (100%) rename client/src/Components/{v2 => }/inputs/Dialog.tsx (97%) rename client/src/Components/{v2 => }/inputs/FieldLabel.tsx (100%) rename client/src/Components/{v2 => }/inputs/ImageUpload.tsx (100%) rename client/src/Components/{v2 => }/inputs/LanguageSelector.tsx (97%) rename client/src/Components/{v2 => }/inputs/Radio.tsx (100%) rename client/src/Components/{v2 => }/inputs/Select.tsx (100%) rename client/src/Components/{v2 => }/inputs/Slider.tsx (100%) rename client/src/Components/{v2 => }/inputs/Switch.tsx (100%) rename client/src/Components/{v2 => }/inputs/SwitchTheme.tsx (100%) rename client/src/Components/{v2 => }/inputs/TextInput.tsx (100%) rename client/src/Components/{v2 => }/inputs/TimePicker.tsx (100%) rename client/src/Components/{v2 => }/inputs/ToggleButton.tsx (100%) rename client/src/Components/{v2 => }/inputs/index.tsx (100%) rename client/src/Components/{v2 => }/layout/AppLayout.tsx (96%) rename client/src/Components/{v2 => }/layout/RootLayout.tsx (94%) rename client/src/Components/{v2 => }/monitors/ControlsFilter.tsx (97%) rename client/src/Components/{v2 => }/monitors/HeaderMonitorControls.tsx (97%) rename client/src/Components/{v2 => }/monitors/HeaderMonitorsSummary.tsx (95%) rename client/src/Components/{v2 => }/monitors/MonitorStatBoxes.tsx (97%) rename client/src/Components/{v2 => }/monitors/charts/HistogramDetails.tsx (97%) rename client/src/Components/{v2 => }/monitors/charts/HistogramInfrastructure.tsx (97%) rename client/src/Components/{v2 => }/monitors/charts/HistogramPageSpeed.tsx (96%) rename client/src/Components/{v2 => }/monitors/charts/HistogramPageSpeedDetails.tsx (93%) rename client/src/Components/{v2 => }/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx (97%) rename client/src/Components/{v2 => }/monitors/charts/HistogramPageSpeedTooltip.tsx (100%) rename client/src/Components/{v2 => }/monitors/charts/HistogramStatus.tsx (98%) rename client/src/Components/{v2 => }/monitors/charts/PiePageSpeed.tsx (98%) rename client/src/Components/{v2 => }/monitors/charts/PiePageSpeedLegend.tsx (97%) rename client/src/Components/{v2 => }/monitors/charts/RadialAvgResponse.tsx (97%) rename client/src/Components/{v2 => }/monitors/index.tsx (100%) rename client/src/Components/{v2 => }/routing/RouteProtected.tsx (100%) rename client/src/Components/{v2 => }/sidebar/Authfooter.tsx (98%) rename client/src/Components/{v2 => }/sidebar/Logo.tsx (100%) rename client/src/Components/{v2 => }/sidebar/Menu.tsx (97%) rename client/src/Components/{v2 => }/sidebar/NavItem.tsx (100%) rename client/src/Components/{v2 => }/sidebar/StarPrompt.tsx (97%) rename client/src/Components/{v2 => }/sidebar/index.tsx (92%) delete mode 100644 client/src/Components/v2/common/index.ts diff --git a/client/src/App.tsx b/client/src/App.tsx index 148978521..127426c85 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -5,7 +5,7 @@ import { ToastContainer } from "react-toastify"; import { ThemeProvider } from "@emotion/react"; import { CssBaseline, GlobalStyles } from "@mui/material"; import { Routes } from "./Routes"; -import AppLayout from "@/Components/v2/layout/AppLayout"; +import AppLayout from "@/Components/layout/AppLayout"; import type { RootState } from "@/Types/state"; import { lightTheme, darkTheme } from "@/Utils/Theme/Theme"; diff --git a/client/src/Components/v2/actions-menu/index.tsx b/client/src/Components/actions-menu/index.tsx similarity index 100% rename from client/src/Components/v2/actions-menu/index.tsx rename to client/src/Components/actions-menu/index.tsx diff --git a/client/src/Components/v2/common/charts/HeatmapResponseTime.tsx b/client/src/Components/common/charts/HeatmapResponseTime.tsx similarity index 97% rename from client/src/Components/v2/common/charts/HeatmapResponseTime.tsx rename to client/src/Components/common/charts/HeatmapResponseTime.tsx index 972291f57..8178ffb92 100644 --- a/client/src/Components/v2/common/charts/HeatmapResponseTime.tsx +++ b/client/src/Components/common/charts/HeatmapResponseTime.tsx @@ -2,7 +2,7 @@ import Box from "@mui/material/Box"; import { useTheme } from "@mui/material/styles"; import type { CheckSnapshot } from "@/Types/Check"; import { getResponseColor } from "@/Utils/DataUtils"; -import { HeatmapResponseTimeTooltip } from "@/Components/v2/common/charts/HeatmapResponseTimeTooltip"; +import { HeatmapResponseTimeTooltip } from "@/Components/common/charts/HeatmapResponseTimeTooltip"; import type { SxProps } from "@mui/material/styles"; import type { ResponsiveStyleValue } from "@mui/system"; diff --git a/client/src/Components/v2/common/charts/HeatmapResponseTimeTooltip.tsx b/client/src/Components/common/charts/HeatmapResponseTimeTooltip.tsx similarity index 100% rename from client/src/Components/v2/common/charts/HeatmapResponseTimeTooltip.tsx rename to client/src/Components/common/charts/HeatmapResponseTimeTooltip.tsx diff --git a/client/src/Components/v2/common/charts/HistogramResponseTime.tsx b/client/src/Components/common/charts/HistogramResponseTime.tsx similarity index 100% rename from client/src/Components/v2/common/charts/HistogramResponseTime.tsx rename to client/src/Components/common/charts/HistogramResponseTime.tsx diff --git a/client/src/Components/v2/common/controls/HeaderCreate.tsx b/client/src/Components/common/controls/HeaderCreate.tsx similarity index 100% rename from client/src/Components/v2/common/controls/HeaderCreate.tsx rename to client/src/Components/common/controls/HeaderCreate.tsx diff --git a/client/src/Components/v2/common/controls/HeaderTimeRange.tsx b/client/src/Components/common/controls/HeaderTimeRange.tsx similarity index 96% rename from client/src/Components/v2/common/controls/HeaderTimeRange.tsx rename to client/src/Components/common/controls/HeaderTimeRange.tsx index c66ee9ff6..d7c7102bc 100644 --- a/client/src/Components/v2/common/controls/HeaderTimeRange.tsx +++ b/client/src/Components/common/controls/HeaderTimeRange.tsx @@ -1,7 +1,7 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import { ToggleButtonGroup, ToggleButton } from "@/Components/v2/inputs"; +import { ToggleButtonGroup, ToggleButton } from "@/Components/inputs"; import { useTheme } from "@mui/material/styles"; import CircularProgress from "@mui/material/CircularProgress"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Components/common/index.ts b/client/src/Components/common/index.ts new file mode 100644 index 000000000..4db9cac34 --- /dev/null +++ b/client/src/Components/common/index.ts @@ -0,0 +1,5 @@ +export * from "./charts/HistogramResponseTime"; +export * from "./charts/HeatmapResponseTime"; +export * from "./charts/HeatmapResponseTimeTooltip"; +export * from "./controls/HeaderCreate"; +export * from "./controls/HeaderTimeRange"; diff --git a/client/src/Components/v2/design-elements/Avatar.tsx b/client/src/Components/design-elements/Avatar.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Avatar.tsx rename to client/src/Components/design-elements/Avatar.tsx diff --git a/client/src/Components/v2/design-elements/BaseBox.tsx b/client/src/Components/design-elements/BaseBox.tsx similarity index 100% rename from client/src/Components/v2/design-elements/BaseBox.tsx rename to client/src/Components/design-elements/BaseBox.tsx diff --git a/client/src/Components/v2/design-elements/BaseChart.tsx b/client/src/Components/design-elements/BaseChart.tsx similarity index 96% rename from client/src/Components/v2/design-elements/BaseChart.tsx rename to client/src/Components/design-elements/BaseChart.tsx index fd9251915..569652b20 100644 --- a/client/src/Components/v2/design-elements/BaseChart.tsx +++ b/client/src/Components/design-elements/BaseChart.tsx @@ -1,4 +1,4 @@ -import { BaseBox } from "../design-elements"; +import { BaseBox } from "."; import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; diff --git a/client/src/Components/v2/design-elements/BasePage.tsx b/client/src/Components/design-elements/BasePage.tsx similarity index 97% rename from client/src/Components/v2/design-elements/BasePage.tsx rename to client/src/Components/design-elements/BasePage.tsx index 48c836e54..cf28da40f 100644 --- a/client/src/Components/v2/design-elements/BasePage.tsx +++ b/client/src/Components/design-elements/BasePage.tsx @@ -8,8 +8,8 @@ import { EmptyFallback, EmptyMonitorFallback, BaseFallback, -} from "@/Components/v2/design-elements/Fallback"; -import { Breadcrumb } from "@/Components/v2/design-elements/Breadcrumb"; +} from "@/Components/design-elements/Fallback"; +import { Breadcrumb } from "@/Components/design-elements/Breadcrumb"; import CircularProgress from "@mui/material/CircularProgress"; import { HeaderAuthControls } from "@/Pages/Auth/components/HeaderAuthControls"; diff --git a/client/src/Components/v2/design-elements/Breadcrumb.tsx b/client/src/Components/design-elements/Breadcrumb.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Breadcrumb.tsx rename to client/src/Components/design-elements/Breadcrumb.tsx diff --git a/client/src/Components/v2/design-elements/BulletPointCheck.tsx b/client/src/Components/design-elements/BulletPointCheck.tsx similarity index 100% rename from client/src/Components/v2/design-elements/BulletPointCheck.tsx rename to client/src/Components/design-elements/BulletPointCheck.tsx diff --git a/client/src/Components/v2/design-elements/Dot.tsx b/client/src/Components/design-elements/Dot.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Dot.tsx rename to client/src/Components/design-elements/Dot.tsx diff --git a/client/src/Components/v2/design-elements/Fallback.tsx b/client/src/Components/design-elements/Fallback.tsx similarity index 96% rename from client/src/Components/v2/design-elements/Fallback.tsx rename to client/src/Components/design-elements/Fallback.tsx index 593829ab5..93cdac410 100644 --- a/client/src/Components/v2/design-elements/Fallback.tsx +++ b/client/src/Components/design-elements/Fallback.tsx @@ -1,7 +1,7 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import { BulletPointCheck, SkeletonCard } from "@/Components/v2/design-elements"; -import { Button } from "@/Components/v2/inputs"; +import { BulletPointCheck, SkeletonCard } from "@/Components/design-elements"; +import { Button } from "@/Components/inputs"; import { useNavigate } from "react-router"; import useMediaQuery from "@mui/material/useMediaQuery"; diff --git a/client/src/Components/v2/design-elements/Gauge.tsx b/client/src/Components/design-elements/Gauge.tsx similarity index 98% rename from client/src/Components/v2/design-elements/Gauge.tsx rename to client/src/Components/design-elements/Gauge.tsx index 4fee5386c..fda42df3c 100644 --- a/client/src/Components/v2/design-elements/Gauge.tsx +++ b/client/src/Components/design-elements/Gauge.tsx @@ -1,4 +1,4 @@ -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; diff --git a/client/src/Components/v2/design-elements/Icon.tsx b/client/src/Components/design-elements/Icon.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Icon.tsx rename to client/src/Components/design-elements/Icon.tsx diff --git a/client/src/Components/v2/design-elements/MonitorStatus.tsx b/client/src/Components/design-elements/MonitorStatus.tsx similarity index 95% rename from client/src/Components/v2/design-elements/MonitorStatus.tsx rename to client/src/Components/design-elements/MonitorStatus.tsx index a9720e293..04c62de47 100644 --- a/client/src/Components/v2/design-elements/MonitorStatus.tsx +++ b/client/src/Components/design-elements/MonitorStatus.tsx @@ -1,7 +1,7 @@ import type { Monitor } from "@/Types/Monitor"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import { PulseDot, Dot } from "@/Components/v2/design-elements"; +import { PulseDot, Dot } from "@/Components/design-elements"; import { getStatusColor, formatUrl } from "@/Utils/MonitorUtils"; import { useTheme } from "@mui/material/styles"; import prettyMilliseconds from "pretty-ms"; diff --git a/client/src/Components/v2/design-elements/OfflineBanner.tsx b/client/src/Components/design-elements/OfflineBanner.tsx similarity index 100% rename from client/src/Components/v2/design-elements/OfflineBanner.tsx rename to client/src/Components/design-elements/OfflineBanner.tsx diff --git a/client/src/Components/v2/design-elements/PulseDot.tsx b/client/src/Components/design-elements/PulseDot.tsx similarity index 100% rename from client/src/Components/v2/design-elements/PulseDot.tsx rename to client/src/Components/design-elements/PulseDot.tsx diff --git a/client/src/Components/v2/design-elements/SkeletonCard.tsx b/client/src/Components/design-elements/SkeletonCard.tsx similarity index 100% rename from client/src/Components/v2/design-elements/SkeletonCard.tsx rename to client/src/Components/design-elements/SkeletonCard.tsx diff --git a/client/src/Components/v2/design-elements/SplitBox.tsx b/client/src/Components/design-elements/SplitBox.tsx similarity index 100% rename from client/src/Components/v2/design-elements/SplitBox.tsx rename to client/src/Components/design-elements/SplitBox.tsx diff --git a/client/src/Components/v2/design-elements/StatBox.tsx b/client/src/Components/design-elements/StatBox.tsx similarity index 96% rename from client/src/Components/v2/design-elements/StatBox.tsx rename to client/src/Components/design-elements/StatBox.tsx index 901468f23..01a8e9835 100644 --- a/client/src/Components/v2/design-elements/StatBox.tsx +++ b/client/src/Components/design-elements/StatBox.tsx @@ -5,7 +5,7 @@ import { useTheme } from "@mui/material/styles"; import { lighten } from "@mui/material/styles"; import useMediaQuery from "@mui/material/useMediaQuery"; import type { PaletteKey } from "@/Utils/Theme/Theme"; -import { BaseBox, TooltipWithInfo } from "@/Components/v2/design-elements"; +import { BaseBox, TooltipWithInfo } from "@/Components/design-elements"; import type { SxProps } from "@mui/material"; type GradientBox = React.PropsWithChildren<{ diff --git a/client/src/Components/v2/design-elements/StatusBox.tsx b/client/src/Components/design-elements/StatusBox.tsx similarity index 98% rename from client/src/Components/v2/design-elements/StatusBox.tsx rename to client/src/Components/design-elements/StatusBox.tsx index 73a881736..96a9d9fbf 100644 --- a/client/src/Components/v2/design-elements/StatusBox.tsx +++ b/client/src/Components/design-elements/StatusBox.tsx @@ -1,7 +1,7 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import Box from "@mui/material/Box"; -import { BaseBox } from "@/Components/v2/design-elements"; +import { BaseBox } from "@/Components/design-elements"; import { useTranslation } from "react-i18next"; import type { SxProps } from "@mui/material"; diff --git a/client/src/Components/v2/design-elements/StatusLabel.tsx b/client/src/Components/design-elements/StatusLabel.tsx similarity index 97% rename from client/src/Components/v2/design-elements/StatusLabel.tsx rename to client/src/Components/design-elements/StatusLabel.tsx index 19bb8d157..d50058378 100644 --- a/client/src/Components/v2/design-elements/StatusLabel.tsx +++ b/client/src/Components/design-elements/StatusLabel.tsx @@ -1,5 +1,5 @@ import Box from "@mui/material/Box"; -import { BaseBox } from "@/Components/v2/design-elements"; +import { BaseBox } from "@/Components/design-elements"; import Typography from "@mui/material/Typography"; import type { MonitorStatus } from "@/Types/Monitor"; diff --git a/client/src/Components/v2/design-elements/Table.tsx b/client/src/Components/design-elements/Table.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Table.tsx rename to client/src/Components/design-elements/Table.tsx diff --git a/client/src/Components/v2/design-elements/Tabs.tsx b/client/src/Components/design-elements/Tabs.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Tabs.tsx rename to client/src/Components/design-elements/Tabs.tsx diff --git a/client/src/Components/v2/design-elements/TextLink.tsx b/client/src/Components/design-elements/TextLink.tsx similarity index 100% rename from client/src/Components/v2/design-elements/TextLink.tsx rename to client/src/Components/design-elements/TextLink.tsx diff --git a/client/src/Components/v2/design-elements/Tooltip.tsx b/client/src/Components/design-elements/Tooltip.tsx similarity index 100% rename from client/src/Components/v2/design-elements/Tooltip.tsx rename to client/src/Components/design-elements/Tooltip.tsx diff --git a/client/src/Components/v2/design-elements/index.tsx b/client/src/Components/design-elements/index.tsx similarity index 100% rename from client/src/Components/v2/design-elements/index.tsx rename to client/src/Components/design-elements/index.tsx diff --git a/client/src/Components/v2/i18nLoader/index.tsx b/client/src/Components/i18nLoader/index.tsx similarity index 100% rename from client/src/Components/v2/i18nLoader/index.tsx rename to client/src/Components/i18nLoader/index.tsx diff --git a/client/src/Components/v2/inputs/AutoComplete.tsx b/client/src/Components/inputs/AutoComplete.tsx similarity index 97% rename from client/src/Components/v2/inputs/AutoComplete.tsx rename to client/src/Components/inputs/AutoComplete.tsx index af0e8cbfd..c98e8ff32 100644 --- a/client/src/Components/v2/inputs/AutoComplete.tsx +++ b/client/src/Components/inputs/AutoComplete.tsx @@ -1,6 +1,6 @@ import Autocomplete from "@mui/material/Autocomplete"; import type { AutocompleteProps } from "@mui/material/Autocomplete"; -import { TextField, Checkbox } from "@/Components/v2/inputs"; +import { TextField, Checkbox } from "@/Components/inputs"; import ListItem from "@mui/material/ListItem"; import Stack from "@mui/material/Stack"; import { useTheme } from "@mui/material/styles"; diff --git a/client/src/Components/v2/inputs/Button.tsx b/client/src/Components/inputs/Button.tsx similarity index 100% rename from client/src/Components/v2/inputs/Button.tsx rename to client/src/Components/inputs/Button.tsx diff --git a/client/src/Components/v2/inputs/Checkbox.tsx b/client/src/Components/inputs/Checkbox.tsx similarity index 100% rename from client/src/Components/v2/inputs/Checkbox.tsx rename to client/src/Components/inputs/Checkbox.tsx diff --git a/client/src/Components/v2/inputs/ColorPicker.tsx b/client/src/Components/inputs/ColorPicker.tsx similarity index 94% rename from client/src/Components/v2/inputs/ColorPicker.tsx rename to client/src/Components/inputs/ColorPicker.tsx index d2899c203..de736c85d 100644 --- a/client/src/Components/v2/inputs/ColorPicker.tsx +++ b/client/src/Components/inputs/ColorPicker.tsx @@ -3,7 +3,7 @@ import type { MuiColorInputProps } from "mui-color-input"; import { typographyLevels } from "@/Utils/Theme/Palette"; import { useTheme } from "@mui/material"; import Stack from "@mui/material/Stack"; -import { FieldLabel } from "@/Components/v2/inputs/FieldLabel"; +import { FieldLabel } from "@/Components/inputs/FieldLabel"; interface ColorPickerProps extends MuiColorInputProps { fieldLabel?: string; diff --git a/client/src/Components/v2/inputs/DatePicker.tsx b/client/src/Components/inputs/DatePicker.tsx similarity index 100% rename from client/src/Components/v2/inputs/DatePicker.tsx rename to client/src/Components/inputs/DatePicker.tsx diff --git a/client/src/Components/v2/inputs/Dialog.tsx b/client/src/Components/inputs/Dialog.tsx similarity index 97% rename from client/src/Components/v2/inputs/Dialog.tsx rename to client/src/Components/inputs/Dialog.tsx index 9dd546dea..b0c924f55 100644 --- a/client/src/Components/v2/inputs/Dialog.tsx +++ b/client/src/Components/inputs/Dialog.tsx @@ -4,7 +4,7 @@ import DialogActions from "@mui/material/DialogActions"; import DialogContent from "@mui/material/DialogContent"; import DialogContentText from "@mui/material/DialogContentText"; import DialogTitle from "@mui/material/DialogTitle"; -import { Button } from "@/Components/v2/inputs"; +import { Button } from "@/Components/inputs"; import { typographyLevels } from "@/Utils/Theme/Palette"; import { useTranslation } from "react-i18next"; import type { ReactNode } from "react"; diff --git a/client/src/Components/v2/inputs/FieldLabel.tsx b/client/src/Components/inputs/FieldLabel.tsx similarity index 100% rename from client/src/Components/v2/inputs/FieldLabel.tsx rename to client/src/Components/inputs/FieldLabel.tsx diff --git a/client/src/Components/v2/inputs/ImageUpload.tsx b/client/src/Components/inputs/ImageUpload.tsx similarity index 100% rename from client/src/Components/v2/inputs/ImageUpload.tsx rename to client/src/Components/inputs/ImageUpload.tsx diff --git a/client/src/Components/v2/inputs/LanguageSelector.tsx b/client/src/Components/inputs/LanguageSelector.tsx similarity index 97% rename from client/src/Components/v2/inputs/LanguageSelector.tsx rename to client/src/Components/inputs/LanguageSelector.tsx index 2a1274ef2..a6d52a555 100644 --- a/client/src/Components/v2/inputs/LanguageSelector.tsx +++ b/client/src/Components/inputs/LanguageSelector.tsx @@ -1,7 +1,7 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import MenuItem from "@mui/material/MenuItem"; -import { Select } from "@/Components/v2/inputs"; +import { Select } from "@/Components/inputs"; import "flag-icons/css/flag-icons.min.css"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Components/v2/inputs/Radio.tsx b/client/src/Components/inputs/Radio.tsx similarity index 100% rename from client/src/Components/v2/inputs/Radio.tsx rename to client/src/Components/inputs/Radio.tsx diff --git a/client/src/Components/v2/inputs/Select.tsx b/client/src/Components/inputs/Select.tsx similarity index 100% rename from client/src/Components/v2/inputs/Select.tsx rename to client/src/Components/inputs/Select.tsx diff --git a/client/src/Components/v2/inputs/Slider.tsx b/client/src/Components/inputs/Slider.tsx similarity index 100% rename from client/src/Components/v2/inputs/Slider.tsx rename to client/src/Components/inputs/Slider.tsx diff --git a/client/src/Components/v2/inputs/Switch.tsx b/client/src/Components/inputs/Switch.tsx similarity index 100% rename from client/src/Components/v2/inputs/Switch.tsx rename to client/src/Components/inputs/Switch.tsx diff --git a/client/src/Components/v2/inputs/SwitchTheme.tsx b/client/src/Components/inputs/SwitchTheme.tsx similarity index 100% rename from client/src/Components/v2/inputs/SwitchTheme.tsx rename to client/src/Components/inputs/SwitchTheme.tsx diff --git a/client/src/Components/v2/inputs/TextInput.tsx b/client/src/Components/inputs/TextInput.tsx similarity index 100% rename from client/src/Components/v2/inputs/TextInput.tsx rename to client/src/Components/inputs/TextInput.tsx diff --git a/client/src/Components/v2/inputs/TimePicker.tsx b/client/src/Components/inputs/TimePicker.tsx similarity index 100% rename from client/src/Components/v2/inputs/TimePicker.tsx rename to client/src/Components/inputs/TimePicker.tsx diff --git a/client/src/Components/v2/inputs/ToggleButton.tsx b/client/src/Components/inputs/ToggleButton.tsx similarity index 100% rename from client/src/Components/v2/inputs/ToggleButton.tsx rename to client/src/Components/inputs/ToggleButton.tsx diff --git a/client/src/Components/v2/inputs/index.tsx b/client/src/Components/inputs/index.tsx similarity index 100% rename from client/src/Components/v2/inputs/index.tsx rename to client/src/Components/inputs/index.tsx diff --git a/client/src/Components/v2/layout/AppLayout.tsx b/client/src/Components/layout/AppLayout.tsx similarity index 96% rename from client/src/Components/v2/layout/AppLayout.tsx rename to client/src/Components/layout/AppLayout.tsx index 24d18bfee..baadd85ca 100644 --- a/client/src/Components/v2/layout/AppLayout.tsx +++ b/client/src/Components/layout/AppLayout.tsx @@ -4,7 +4,7 @@ import { useTheme } from "@mui/material/styles"; import { useSelector } from "react-redux"; import BackgroundSVG from "@/assets/Images/background.svg"; import type { RootState } from "@/Types/state"; -import { OfflineBanner } from "@/Components/v2/design-elements"; +import { OfflineBanner } from "@/Components/design-elements"; import { setServerUnreachableCallback, get } from "@/Utils/ApiClient"; interface AppLayoutProps { diff --git a/client/src/Components/v2/layout/RootLayout.tsx b/client/src/Components/layout/RootLayout.tsx similarity index 94% rename from client/src/Components/v2/layout/RootLayout.tsx rename to client/src/Components/layout/RootLayout.tsx index 117c08255..c22bd7455 100644 --- a/client/src/Components/v2/layout/RootLayout.tsx +++ b/client/src/Components/layout/RootLayout.tsx @@ -1,4 +1,4 @@ -import { Sidebar } from "@/Components/v2/sidebar"; +import { Sidebar } from "@/Components/sidebar"; import { Outlet } from "react-router"; import Stack from "@mui/material/Stack"; import { useMediaQuery } from "@mui/material"; diff --git a/client/src/Components/v2/monitors/ControlsFilter.tsx b/client/src/Components/monitors/ControlsFilter.tsx similarity index 97% rename from client/src/Components/v2/monitors/ControlsFilter.tsx rename to client/src/Components/monitors/ControlsFilter.tsx index 01802ee3f..e37408819 100644 --- a/client/src/Components/v2/monitors/ControlsFilter.tsx +++ b/client/src/Components/monitors/ControlsFilter.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { Select, Button } from "@/Components/v2/inputs"; +import { Select, Button } from "@/Components/inputs"; import MenuItem from "@mui/material/MenuItem"; import useMediaQuery from "@mui/material/useMediaQuery"; diff --git a/client/src/Components/v2/monitors/HeaderMonitorControls.tsx b/client/src/Components/monitors/HeaderMonitorControls.tsx similarity index 97% rename from client/src/Components/v2/monitors/HeaderMonitorControls.tsx rename to client/src/Components/monitors/HeaderMonitorControls.tsx index 6d321cbb8..7f6968f0b 100644 --- a/client/src/Components/v2/monitors/HeaderMonitorControls.tsx +++ b/client/src/Components/monitors/HeaderMonitorControls.tsx @@ -1,6 +1,6 @@ import Stack from "@mui/material/Stack"; -import { Icon, MonitorStatus } from "@/Components/v2/design-elements"; -import { Button } from "@/Components/v2/inputs"; +import { Icon, MonitorStatus } from "@/Components/design-elements"; +import { Button } from "@/Components/inputs"; import { Settings, Pause, Play, Mail, Bug, Trash } from "lucide-react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Components/v2/monitors/HeaderMonitorsSummary.tsx b/client/src/Components/monitors/HeaderMonitorsSummary.tsx similarity index 95% rename from client/src/Components/v2/monitors/HeaderMonitorsSummary.tsx rename to client/src/Components/monitors/HeaderMonitorsSummary.tsx index 38a6adfde..1d130209d 100644 --- a/client/src/Components/v2/monitors/HeaderMonitorsSummary.tsx +++ b/client/src/Components/monitors/HeaderMonitorsSummary.tsx @@ -4,7 +4,7 @@ import { PausedStatusBox, InitializingStatusBox, BreachedStatusBox, -} from "@/Components/v2/design-elements"; +} from "@/Components/design-elements"; import Stack from "@mui/material/Stack"; import type { MonitorsSummary } from "@/Types/Monitor"; diff --git a/client/src/Components/v2/monitors/MonitorStatBoxes.tsx b/client/src/Components/monitors/MonitorStatBoxes.tsx similarity index 97% rename from client/src/Components/v2/monitors/MonitorStatBoxes.tsx rename to client/src/Components/monitors/MonitorStatBoxes.tsx index 867f85516..044bb71ab 100644 --- a/client/src/Components/v2/monitors/MonitorStatBoxes.tsx +++ b/client/src/Components/monitors/MonitorStatBoxes.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { StatBox } from "@/Components/v2/design-elements"; +import { StatBox } from "@/Components/design-elements"; import prettyMilliseconds from "pretty-ms"; import { useTheme } from "@mui/material/styles"; diff --git a/client/src/Components/v2/monitors/charts/HistogramDetails.tsx b/client/src/Components/monitors/charts/HistogramDetails.tsx similarity index 97% rename from client/src/Components/v2/monitors/charts/HistogramDetails.tsx rename to client/src/Components/monitors/charts/HistogramDetails.tsx index 8858a9784..c2f75aa7b 100644 --- a/client/src/Components/v2/monitors/charts/HistogramDetails.tsx +++ b/client/src/Components/monitors/charts/HistogramDetails.tsx @@ -1,4 +1,4 @@ -import { BaseChart, BaseBox } from "@/Components/v2/design-elements"; +import { BaseChart, BaseBox } from "@/Components/design-elements"; import { Clock } from "lucide-react"; import { AreaChart, diff --git a/client/src/Components/v2/monitors/charts/HistogramInfrastructure.tsx b/client/src/Components/monitors/charts/HistogramInfrastructure.tsx similarity index 97% rename from client/src/Components/v2/monitors/charts/HistogramInfrastructure.tsx rename to client/src/Components/monitors/charts/HistogramInfrastructure.tsx index e65a58bd9..8dd15ae03 100644 --- a/client/src/Components/v2/monitors/charts/HistogramInfrastructure.tsx +++ b/client/src/Components/monitors/charts/HistogramInfrastructure.tsx @@ -1,4 +1,4 @@ -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import { AreaChart, Area, @@ -8,7 +8,7 @@ import { ResponsiveContainer, } from "recharts"; import { Fragment, useId } from "react"; -import { XTick } from "@/Components/v2/monitors"; +import { XTick } from "@/Components/monitors"; import { useTheme } from "@mui/material/styles"; import type { HardwareCheckStats } from "@/Types/Monitor"; diff --git a/client/src/Components/v2/monitors/charts/HistogramPageSpeed.tsx b/client/src/Components/monitors/charts/HistogramPageSpeed.tsx similarity index 96% rename from client/src/Components/v2/monitors/charts/HistogramPageSpeed.tsx rename to client/src/Components/monitors/charts/HistogramPageSpeed.tsx index f19e0323c..79c826851 100644 --- a/client/src/Components/v2/monitors/charts/HistogramPageSpeed.tsx +++ b/client/src/Components/monitors/charts/HistogramPageSpeed.tsx @@ -1,6 +1,6 @@ import Stack from "@mui/material/Stack"; import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip } from "recharts"; -import { HistogramPageSpeedTooltip } from "@/Components/v2/monitors/charts/HistogramPageSpeedTooltip"; +import { HistogramPageSpeedTooltip } from "@/Components/monitors/charts/HistogramPageSpeedTooltip"; import { useTheme } from "@mui/material/styles"; import type { CheckSnapshot } from "@/Types/Check"; import type { MonitorStatus } from "@/Types/Monitor"; diff --git a/client/src/Components/v2/monitors/charts/HistogramPageSpeedDetails.tsx b/client/src/Components/monitors/charts/HistogramPageSpeedDetails.tsx similarity index 93% rename from client/src/Components/v2/monitors/charts/HistogramPageSpeedDetails.tsx rename to client/src/Components/monitors/charts/HistogramPageSpeedDetails.tsx index 05bee8bc8..8df491197 100644 --- a/client/src/Components/v2/monitors/charts/HistogramPageSpeedDetails.tsx +++ b/client/src/Components/monitors/charts/HistogramPageSpeedDetails.tsx @@ -1,6 +1,6 @@ -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import { TrendingUp } from "lucide-react"; -import { XTick } from "@/Components/v2/monitors/"; +import { XTick } from "@/Components/monitors"; import { XAxis, AreaChart, @@ -9,7 +9,7 @@ import { CartesianGrid, ResponsiveContainer, } from "recharts"; -import { HistogramPageSpeedScoresTooltip } from "@/Components/v2/monitors"; +import { HistogramPageSpeedScoresTooltip } from "@/Components/monitors"; import { useTheme } from "@mui/material/styles"; import type { CheckSnapshot } from "@/Types/Check"; diff --git a/client/src/Components/v2/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx b/client/src/Components/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx similarity index 97% rename from client/src/Components/v2/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx rename to client/src/Components/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx index 1663ab3b5..37c172b4d 100644 --- a/client/src/Components/v2/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx +++ b/client/src/Components/monitors/charts/HistogramPageSpeedDetailsTooltip.tsx @@ -3,7 +3,7 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { useTheme } from "@mui/material/styles"; import { formatDateWithTz } from "@/Utils/TimeUtils"; -import type { ConfigItem } from "@/Components/v2/monitors"; +import type { ConfigItem } from "@/Components/monitors"; import type { TooltipProps } from "recharts"; import { useSelector } from "react-redux"; import type { RootState } from "@/Types/state"; diff --git a/client/src/Components/v2/monitors/charts/HistogramPageSpeedTooltip.tsx b/client/src/Components/monitors/charts/HistogramPageSpeedTooltip.tsx similarity index 100% rename from client/src/Components/v2/monitors/charts/HistogramPageSpeedTooltip.tsx rename to client/src/Components/monitors/charts/HistogramPageSpeedTooltip.tsx diff --git a/client/src/Components/v2/monitors/charts/HistogramStatus.tsx b/client/src/Components/monitors/charts/HistogramStatus.tsx similarity index 98% rename from client/src/Components/v2/monitors/charts/HistogramStatus.tsx rename to client/src/Components/monitors/charts/HistogramStatus.tsx index d3aa62a69..44f6bea97 100644 --- a/client/src/Components/v2/monitors/charts/HistogramStatus.tsx +++ b/client/src/Components/monitors/charts/HistogramStatus.tsx @@ -1,6 +1,6 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import { useTheme } from "@mui/material/styles"; import { useSelector } from "react-redux"; import { formatDateWithTz } from "@/Utils/TimeUtils"; diff --git a/client/src/Components/v2/monitors/charts/PiePageSpeed.tsx b/client/src/Components/monitors/charts/PiePageSpeed.tsx similarity index 98% rename from client/src/Components/v2/monitors/charts/PiePageSpeed.tsx rename to client/src/Components/monitors/charts/PiePageSpeed.tsx index 205ec9a96..397262cd9 100644 --- a/client/src/Components/v2/monitors/charts/PiePageSpeed.tsx +++ b/client/src/Components/monitors/charts/PiePageSpeed.tsx @@ -1,4 +1,4 @@ -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import { FileText } from "lucide-react"; import type { CheckAudits, CheckSnapshot } from "@/Types/Check"; import { Pie, PieChart, ResponsiveContainer, Label } from "recharts"; diff --git a/client/src/Components/v2/monitors/charts/PiePageSpeedLegend.tsx b/client/src/Components/monitors/charts/PiePageSpeedLegend.tsx similarity index 97% rename from client/src/Components/v2/monitors/charts/PiePageSpeedLegend.tsx rename to client/src/Components/monitors/charts/PiePageSpeedLegend.tsx index b98b09b33..a3977e284 100644 --- a/client/src/Components/v2/monitors/charts/PiePageSpeedLegend.tsx +++ b/client/src/Components/monitors/charts/PiePageSpeedLegend.tsx @@ -1,7 +1,7 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import { BarChart3 } from "lucide-react"; -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import Typography from "@mui/material/Typography"; import type { CheckSnapshot } from "@/Types/Check"; diff --git a/client/src/Components/v2/monitors/charts/RadialAvgResponse.tsx b/client/src/Components/monitors/charts/RadialAvgResponse.tsx similarity index 97% rename from client/src/Components/v2/monitors/charts/RadialAvgResponse.tsx rename to client/src/Components/monitors/charts/RadialAvgResponse.tsx index b54bfc764..fcfaa426b 100644 --- a/client/src/Components/v2/monitors/charts/RadialAvgResponse.tsx +++ b/client/src/Components/monitors/charts/RadialAvgResponse.tsx @@ -1,4 +1,4 @@ -import { BaseChart } from "@/Components/v2/design-elements"; +import { BaseChart } from "@/Components/design-elements"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { Gauge } from "lucide-react"; diff --git a/client/src/Components/v2/monitors/index.tsx b/client/src/Components/monitors/index.tsx similarity index 100% rename from client/src/Components/v2/monitors/index.tsx rename to client/src/Components/monitors/index.tsx diff --git a/client/src/Components/v2/routing/RouteProtected.tsx b/client/src/Components/routing/RouteProtected.tsx similarity index 100% rename from client/src/Components/v2/routing/RouteProtected.tsx rename to client/src/Components/routing/RouteProtected.tsx diff --git a/client/src/Components/v2/sidebar/Authfooter.tsx b/client/src/Components/sidebar/Authfooter.tsx similarity index 98% rename from client/src/Components/v2/sidebar/Authfooter.tsx rename to client/src/Components/sidebar/Authfooter.tsx index 4724ed97d..3edac75dd 100644 --- a/client/src/Components/v2/sidebar/Authfooter.tsx +++ b/client/src/Components/sidebar/Authfooter.tsx @@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next"; import { useState } from "react"; import { useNavigate } from "react-router"; import { MoreVertical, LogOut } from "lucide-react"; -import { Avatar, Icon } from "@/Components/v2/design-elements"; +import { Avatar, Icon } from "@/Components/design-elements"; import { clearAuthState } from "@/Features/Auth/authSlice.js"; import type { RootState } from "@/Types/state.js"; diff --git a/client/src/Components/v2/sidebar/Logo.tsx b/client/src/Components/sidebar/Logo.tsx similarity index 100% rename from client/src/Components/v2/sidebar/Logo.tsx rename to client/src/Components/sidebar/Logo.tsx diff --git a/client/src/Components/v2/sidebar/Menu.tsx b/client/src/Components/sidebar/Menu.tsx similarity index 97% rename from client/src/Components/v2/sidebar/Menu.tsx rename to client/src/Components/sidebar/Menu.tsx index 918a82858..9d005e547 100644 --- a/client/src/Components/v2/sidebar/Menu.tsx +++ b/client/src/Components/sidebar/Menu.tsx @@ -1,4 +1,4 @@ -import { Icon } from "@/Components/v2/design-elements"; +import { Icon } from "@/Components/design-elements"; import { Globe, diff --git a/client/src/Components/v2/sidebar/NavItem.tsx b/client/src/Components/sidebar/NavItem.tsx similarity index 100% rename from client/src/Components/v2/sidebar/NavItem.tsx rename to client/src/Components/sidebar/NavItem.tsx diff --git a/client/src/Components/v2/sidebar/StarPrompt.tsx b/client/src/Components/sidebar/StarPrompt.tsx similarity index 97% rename from client/src/Components/v2/sidebar/StarPrompt.tsx rename to client/src/Components/sidebar/StarPrompt.tsx index 5319f6bcc..9897ca91e 100644 --- a/client/src/Components/v2/sidebar/StarPrompt.tsx +++ b/client/src/Components/sidebar/StarPrompt.tsx @@ -1,5 +1,5 @@ import { Typography, IconButton, Stack, Box } from "@mui/material"; -import { Icon } from "@/Components/v2/design-elements"; +import { Icon } from "@/Components/design-elements"; import { X } from "lucide-react"; import { useTheme } from "@mui/material"; diff --git a/client/src/Components/v2/sidebar/index.tsx b/client/src/Components/sidebar/index.tsx similarity index 92% rename from client/src/Components/v2/sidebar/index.tsx rename to client/src/Components/sidebar/index.tsx index 6469e56f0..dcf02e45f 100644 --- a/client/src/Components/v2/sidebar/index.tsx +++ b/client/src/Components/sidebar/index.tsx @@ -4,11 +4,11 @@ import Stack from "@mui/material/Stack"; import List from "@mui/material/List"; import Divider from "@mui/material/Divider"; import { useSidebar } from "@/Hooks/useSidebar.js"; -import { Logo } from "@/Components/v2/sidebar/Logo"; -import { getMenu, getBottomMenu, getAccountMenu } from "@/Components/v2/sidebar/Menu"; -import { NavItem } from "@/Components/v2/sidebar/NavItem"; -import { StarPrompt } from "@/Components/v2/sidebar/StarPrompt"; -import { AuthFooter } from "@/Components/v2/sidebar/Authfooter"; +import { Logo } from "@/Components/sidebar/Logo"; +import { getMenu, getBottomMenu, getAccountMenu } from "@/Components/sidebar/Menu"; +import { NavItem } from "@/Components/sidebar/NavItem"; +import { StarPrompt } from "@/Components/sidebar/StarPrompt"; +import { AuthFooter } from "@/Components/sidebar/Authfooter"; import { useNavigate, useLocation } from "react-router"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Components/v2/common/index.ts b/client/src/Components/v2/common/index.ts deleted file mode 100644 index 2ea3bf3f7..000000000 --- a/client/src/Components/v2/common/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "../common/charts/HistogramResponseTime"; -export * from "../common/charts/HeatmapResponseTime"; -export * from "../common/charts/HeatmapResponseTimeTooltip"; -export * from "../common/controls/HeaderCreate"; -export * from "../common/controls/HeaderTimeRange"; diff --git a/client/src/Pages/Account/EditUser/index.tsx b/client/src/Pages/Account/EditUser/index.tsx index 483181c35..a3ddebaba 100644 --- a/client/src/Pages/Account/EditUser/index.tsx +++ b/client/src/Pages/Account/EditUser/index.tsx @@ -1,12 +1,12 @@ import { Trash2 } from "lucide-react"; -import { TextField, Button, Autocomplete } from "@/Components/v2/inputs"; +import { TextField, Button, Autocomplete } from "@/Components/inputs"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import IconButton from "@mui/material/IconButton"; import Divider from "@mui/material/Divider"; import FormHelperText from "@mui/material/FormHelperText"; import { useForm, Controller } from "react-hook-form"; -import { ConfigBox, BasePage } from "@/Components/v2/design-elements"; +import { ConfigBox, BasePage } from "@/Components/design-elements"; import { UserRoles } from "@/Types/User"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Account/TabPassword.tsx b/client/src/Pages/Account/TabPassword.tsx index 85e13fb7e..d09a9eeea 100644 --- a/client/src/Pages/Account/TabPassword.tsx +++ b/client/src/Pages/Account/TabPassword.tsx @@ -1,6 +1,6 @@ import { Stack } from "@mui/material"; -import { ConfigBox } from "@/Components/v2/design-elements"; -import { TextField, Button } from "@/Components/v2/inputs"; +import { ConfigBox } from "@/Components/design-elements"; +import { TextField, Button } from "@/Components/inputs"; import { useTranslation } from "react-i18next"; import { useTheme } from "@mui/material"; diff --git a/client/src/Pages/Account/TabProfile.tsx b/client/src/Pages/Account/TabProfile.tsx index dd1960e6f..01e4f14b1 100644 --- a/client/src/Pages/Account/TabProfile.tsx +++ b/client/src/Pages/Account/TabProfile.tsx @@ -1,7 +1,7 @@ import { Stack } from "@mui/material"; -import { ConfigBox } from "@/Components/v2/design-elements"; -import { TextField, Button } from "@/Components/v2/inputs"; -import { ImageUpload } from "@/Components/v2/inputs"; +import { ConfigBox } from "@/Components/design-elements"; +import { TextField, Button } from "@/Components/inputs"; +import { ImageUpload } from "@/Components/inputs"; import { useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Account/components/AddTeamMemberDialog.tsx b/client/src/Pages/Account/components/AddTeamMemberDialog.tsx index 7a108680d..14765eb79 100644 --- a/client/src/Pages/Account/components/AddTeamMemberDialog.tsx +++ b/client/src/Pages/Account/components/AddTeamMemberDialog.tsx @@ -4,7 +4,7 @@ import { useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useForm, Controller } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod/dist/zod.js"; -import { Dialog, TextField, Select } from "@/Components/v2/inputs"; +import { Dialog, TextField, Select } from "@/Components/inputs"; import { useAddTeamMemberForm } from "@/Hooks/useAddTeamMemberForm"; import type { AddTeamMemberFormData } from "@/Validation/addTeamMember"; import type { UserRole, User } from "@/Types/User"; diff --git a/client/src/Pages/Account/components/HeaderTeamControls.tsx b/client/src/Pages/Account/components/HeaderTeamControls.tsx index 57f000170..51fea25b6 100644 --- a/client/src/Pages/Account/components/HeaderTeamControls.tsx +++ b/client/src/Pages/Account/components/HeaderTeamControls.tsx @@ -1,7 +1,7 @@ import Stack from "@mui/material/Stack"; import MenuItem from "@mui/material/MenuItem"; -import { Button, Select } from "@/Components/v2/inputs"; -import { Icon } from "@/Components/v2/design-elements"; +import { Button, Select } from "@/Components/inputs"; +import { Icon } from "@/Components/design-elements"; import { UserPlus, Mail } from "lucide-react"; import { UserRoles } from "@/Types/User"; diff --git a/client/src/Pages/Account/components/InviteTeamMemberDialog.tsx b/client/src/Pages/Account/components/InviteTeamMemberDialog.tsx index 02e5ba29c..e7c42a1ac 100644 --- a/client/src/Pages/Account/components/InviteTeamMemberDialog.tsx +++ b/client/src/Pages/Account/components/InviteTeamMemberDialog.tsx @@ -4,7 +4,7 @@ import { useTheme, FormHelperText, Typography } from "@mui/material"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useForm, Controller } from "react-hook-form"; -import { Dialog, TextField, Select, Button } from "@/Components/v2/inputs"; +import { Dialog, TextField, Select, Button } from "@/Components/inputs"; import type { UserRole } from "@/Types/User"; import { useInviteForm } from "@/Hooks/useInviteForm"; import type { InviteFormData } from "@/Validation/invite"; diff --git a/client/src/Pages/Account/components/TeamTable.tsx b/client/src/Pages/Account/components/TeamTable.tsx index 2583d1c39..ab8dcc3b4 100644 --- a/client/src/Pages/Account/components/TeamTable.tsx +++ b/client/src/Pages/Account/components/TeamTable.tsx @@ -1,8 +1,8 @@ import Typography from "@mui/material/Typography"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { Table } from "@/Components/v2/design-elements"; -import type { Header } from "@/Components/v2/design-elements/Table"; +import { Table } from "@/Components/design-elements"; +import type { Header } from "@/Components/design-elements/Table"; import { useIsSuperAdmin } from "@/Hooks/useIsAdmin"; import type { User } from "@/Types/User"; diff --git a/client/src/Pages/Account/index.tsx b/client/src/Pages/Account/index.tsx index 4a57b539a..fbe8db64b 100644 --- a/client/src/Pages/Account/index.tsx +++ b/client/src/Pages/Account/index.tsx @@ -1,4 +1,4 @@ -import { BasePage, Tabs, Tab } from "@/Components/v2/design-elements"; +import { BasePage, Tabs, Tab } from "@/Components/design-elements"; import { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { TabProfile } from "./TabProfile"; diff --git a/client/src/Pages/Auth/Login/index.tsx b/client/src/Pages/Auth/Login/index.tsx index 8611499d9..ec95a0ce3 100644 --- a/client/src/Pages/Auth/Login/index.tsx +++ b/client/src/Pages/Auth/Login/index.tsx @@ -1,5 +1,5 @@ -import { BaseAuthPage, TextLink } from "@/Components/v2/design-elements"; -import { Button, TextField } from "@/Components/v2/inputs"; +import { BaseAuthPage, TextLink } from "@/Components/design-elements"; +import { Button, TextField } from "@/Components/inputs"; import { useTranslation } from "react-i18next"; import { useForm, Controller } from "react-hook-form"; diff --git a/client/src/Pages/Auth/Recovery/index.tsx b/client/src/Pages/Auth/Recovery/index.tsx index 5add53077..d0eeaef06 100644 --- a/client/src/Pages/Auth/Recovery/index.tsx +++ b/client/src/Pages/Auth/Recovery/index.tsx @@ -1,5 +1,5 @@ -import { Button, TextField } from "@/Components/v2/inputs"; -import { BaseAuthPage, TextLink } from "@/Components/v2/design-elements"; +import { Button, TextField } from "@/Components/inputs"; +import { BaseAuthPage, TextLink } from "@/Components/design-elements"; import { useForm, Controller } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod/dist/zod.js"; diff --git a/client/src/Pages/Auth/Register/index.tsx b/client/src/Pages/Auth/Register/index.tsx index 3c8a4e4bc..a2a439023 100644 --- a/client/src/Pages/Auth/Register/index.tsx +++ b/client/src/Pages/Auth/Register/index.tsx @@ -1,5 +1,5 @@ -import { BaseAuthPage } from "@/Components/v2/design-elements"; -import { Button, TextField } from "@/Components/v2/inputs"; +import { BaseAuthPage } from "@/Components/design-elements"; +import { Button, TextField } from "@/Components/inputs"; import { useForm, Controller } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod/dist/zod.js"; import { useRegisterForm } from "@/Hooks/useRegisterForm"; diff --git a/client/src/Pages/Auth/SetNewPassword/index.tsx b/client/src/Pages/Auth/SetNewPassword/index.tsx index 2e99be254..5d70b4811 100644 --- a/client/src/Pages/Auth/SetNewPassword/index.tsx +++ b/client/src/Pages/Auth/SetNewPassword/index.tsx @@ -1,9 +1,5 @@ -import { - BaseAuthPage, - BulletPointCheck, - TextLink, -} from "@/Components/v2/design-elements"; -import { Button, TextField } from "@/Components/v2/inputs"; +import { BaseAuthPage, BulletPointCheck, TextLink } from "@/Components/design-elements"; +import { Button, TextField } from "@/Components/inputs"; import Stack from "@mui/material/Stack"; import { useTheme } from "@mui/material/styles"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Auth/components/HeaderAuthControls.tsx b/client/src/Pages/Auth/components/HeaderAuthControls.tsx index a62048372..c986362f8 100644 --- a/client/src/Pages/Auth/components/HeaderAuthControls.tsx +++ b/client/src/Pages/Auth/components/HeaderAuthControls.tsx @@ -1,7 +1,7 @@ import Stack, { type StackProps } from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import Logo from "@/assets/icons/checkmate-icon.svg?react"; -import { LanguageSelector, SwitchTheme } from "@/Components/v2/inputs"; +import { LanguageSelector, SwitchTheme } from "@/Components/inputs"; import { useTheme } from "@mui/material/styles"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Checks/Components/ChecksTable.tsx b/client/src/Pages/Checks/Components/ChecksTable.tsx index bb1920ab2..4a40d993b 100644 --- a/client/src/Pages/Checks/Components/ChecksTable.tsx +++ b/client/src/Pages/Checks/Components/ChecksTable.tsx @@ -1,11 +1,6 @@ -import { - Table, - Pagination, - ValueLabel, - StatusLabel, -} from "@/Components/v2/design-elements"; +import { Table, Pagination, ValueLabel, StatusLabel } from "@/Components/design-elements"; import Box from "@mui/material/Box"; -import type { Header } from "@/Components/v2/design-elements/Table"; +import type { Header } from "@/Components/design-elements/Table"; import type { Monitor } from "@/Types/Monitor"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Checks/index.tsx b/client/src/Pages/Checks/index.tsx index fa2adfae9..108547f3e 100644 --- a/client/src/Pages/Checks/index.tsx +++ b/client/src/Pages/Checks/index.tsx @@ -4,9 +4,9 @@ import { TotalChecksBox, UpChecksBox, DownChecksBox, -} from "@/Components/v2/design-elements"; -import { HeaderTimeRange } from "@/Components/v2/common"; -import { Select } from "@/Components/v2/inputs"; +} from "@/Components/design-elements"; +import { HeaderTimeRange } from "@/Components/common"; +import { Select } from "@/Components/inputs"; import { ChecksTable } from "./Components/ChecksTable"; import { MenuItem } from "@mui/material"; diff --git a/client/src/Pages/CreateMonitor/index.tsx b/client/src/Pages/CreateMonitor/index.tsx index 1c111e23d..5012c1154 100644 --- a/client/src/Pages/CreateMonitor/index.tsx +++ b/client/src/Pages/CreateMonitor/index.tsx @@ -14,9 +14,9 @@ import Link from "@mui/material/Link"; import Divider from "@mui/material/Divider"; import IconButton from "@mui/material/IconButton"; import { Trash2 } from "lucide-react"; -import { HeaderDeleteControls } from "@/Components/v2/monitors"; +import { HeaderDeleteControls } from "@/Components/monitors"; -import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; +import { BasePage, ConfigBox } from "@/Components/design-elements"; import { RadioWithDescription, Button, @@ -26,7 +26,7 @@ import { SwitchComponent as Switch, SliderWithLabel, Dialog, -} from "@/Components/v2/inputs"; +} from "@/Components/inputs"; import { useGet, usePost, usePatch, useDelete } from "@/Hooks/UseApi"; import { useMonitorForm } from "@/Hooks/useMonitorForm"; import type { Monitor, MonitorType, GamesMap } from "@/Types/Monitor"; @@ -620,7 +620,7 @@ const CreateMonitorPage = () => { name="notifications" control={control} render={({ field }) => { - // Map notifications to have 'name' property for v2 Autocomplete + // Map notifications to have 'name' property for Autocomplete const notificationOptions = (notifications ?? []).map((n) => ({ ...n, name: n.notificationName, diff --git a/client/src/Pages/Incidents/Components/CardDetails.tsx b/client/src/Pages/Incidents/Components/CardDetails.tsx index 577c777de..70f3bc6e3 100644 --- a/client/src/Pages/Incidents/Components/CardDetails.tsx +++ b/client/src/Pages/Incidents/Components/CardDetails.tsx @@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack"; import Grid from "@mui/material/Grid"; import Divider from "@mui/material/Divider"; import Typography from "@mui/material/Typography"; -import { BaseBox, ValueLabel } from "@/Components/v2/design-elements"; +import { BaseBox, ValueLabel } from "@/Components/design-elements"; import { useTranslation } from "react-i18next"; import type { Incident } from "@/Types/Incident"; diff --git a/client/src/Pages/Incidents/Components/CardSummary.tsx b/client/src/Pages/Incidents/Components/CardSummary.tsx index c0e129dde..938455808 100644 --- a/client/src/Pages/Incidents/Components/CardSummary.tsx +++ b/client/src/Pages/Incidents/Components/CardSummary.tsx @@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import Divider from "@mui/material/Divider"; import Grid from "@mui/material/Grid"; -import { BaseBox, ValueLabel } from "@/Components/v2/design-elements"; +import { BaseBox, ValueLabel } from "@/Components/design-elements"; import { CircleCheck, TriangleAlert, Bell, Wrench, Globe } from "lucide-react"; import Box from "@mui/material/Box"; diff --git a/client/src/Pages/Incidents/Components/ControlsIncidentFilter.tsx b/client/src/Pages/Incidents/Components/ControlsIncidentFilter.tsx index 186942cf0..a0f4eb15a 100644 --- a/client/src/Pages/Incidents/Components/ControlsIncidentFilter.tsx +++ b/client/src/Pages/Incidents/Components/ControlsIncidentFilter.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { Select, Button } from "@/Components/v2/inputs"; +import { Select, Button } from "@/Components/inputs"; import MenuItem from "@mui/material/MenuItem"; import useMediaQuery from "@mui/material/useMediaQuery"; import { Typography, useTheme } from "@mui/material"; diff --git a/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx b/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx index daef58f68..628f6cb29 100644 --- a/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx +++ b/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx @@ -1,4 +1,4 @@ -import { Dialog } from "@/Components/v2/inputs"; +import { Dialog } from "@/Components/inputs"; import { CardDetails } from "@/Pages/Incidents/Components/CardDetails"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Incidents/Components/DialogResolution.tsx b/client/src/Pages/Incidents/Components/DialogResolution.tsx index a102b1de3..99dd898dd 100644 --- a/client/src/Pages/Incidents/Components/DialogResolution.tsx +++ b/client/src/Pages/Incidents/Components/DialogResolution.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; import Box from "@mui/material/Box"; -import { Dialog, TextField } from "@/Components/v2/inputs"; +import { Dialog, TextField } from "@/Components/inputs"; import { usePut } from "@/Hooks/UseApi"; import { useTranslation } from "react-i18next"; import { useTheme } from "@mui/material"; diff --git a/client/src/Pages/Incidents/Components/IncidentTable.tsx b/client/src/Pages/Incidents/Components/IncidentTable.tsx index a9b4bc104..bb1759dcd 100644 --- a/client/src/Pages/Incidents/Components/IncidentTable.tsx +++ b/client/src/Pages/Incidents/Components/IncidentTable.tsx @@ -1,12 +1,12 @@ -import { Table } from "@/Components/v2/design-elements"; -import { Pagination } from "@/Components/v2/design-elements/Table"; -import type { Header } from "@/Components/v2/design-elements/Table"; -import { ValueLabel } from "@/Components/v2/design-elements"; -import type { ValueType } from "@/Components/v2/design-elements/StatusLabel"; -import { ActionsMenu } from "@/Components/v2/actions-menu"; +import { Table } from "@/Components/design-elements"; +import { Pagination } from "@/Components/design-elements/Table"; +import type { Header } from "@/Components/design-elements/Table"; +import { ValueLabel } from "@/Components/design-elements"; +import type { ValueType } from "@/Components/design-elements/StatusLabel"; +import { ActionsMenu } from "@/Components/actions-menu"; import type { Incident } from "@/Types/Incident"; import type { Monitor } from "@/Types/Monitor"; -import type { ActionMenuItem } from "@/Components/v2/actions-menu"; +import type { ActionMenuItem } from "@/Components/actions-menu"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { formatDateWithTz } from "@/Utils/TimeUtils"; diff --git a/client/src/Pages/Incidents/index.tsx b/client/src/Pages/Incidents/index.tsx index 1f332224b..9003f6956 100644 --- a/client/src/Pages/Incidents/index.tsx +++ b/client/src/Pages/Incidents/index.tsx @@ -1,4 +1,4 @@ -import { BasePage } from "@/Components/v2/design-elements"; +import { BasePage } from "@/Components/design-elements"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import Divider from "@mui/material/Divider"; @@ -11,7 +11,7 @@ import { import { IncidentsTable } from "@/Pages/Incidents/Components/IncidentTable"; import { DialogResolution } from "@/Pages/Incidents/Components/DialogResolution"; import { DialogIncidentDetails } from "@/Pages/Incidents/Components/DialogIncidentDetails"; -import { HeaderTimeRange } from "@/Components/v2/common"; +import { HeaderTimeRange } from "@/Components/common"; import { ControlsIncidentFilter } from "@/Pages/Incidents/Components/ControlsIncidentFilter"; import { useGet } from "@/Hooks/UseApi"; diff --git a/client/src/Pages/Infrastructure/Details/Components/Charts.tsx b/client/src/Pages/Infrastructure/Details/Components/Charts.tsx index e3752de95..4309feca7 100644 --- a/client/src/Pages/Infrastructure/Details/Components/Charts.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/Charts.tsx @@ -1,5 +1,5 @@ import Grid from "@mui/material/Grid"; -import { HistogramInfrastructure } from "@/Components/v2/monitors"; +import { HistogramInfrastructure } from "@/Components/monitors"; import { useTranslation } from "react-i18next"; import type { HardwareCheckStats } from "@/Types/Monitor"; diff --git a/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx b/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx index 535bdc0fd..54e3cc1ed 100644 --- a/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx @@ -1,5 +1,5 @@ import Grid from "@mui/material/Grid"; -import { HistogramInfrastructure } from "@/Components/v2/monitors"; +import { HistogramInfrastructure } from "@/Components/monitors"; import { useTranslation } from "react-i18next"; import type { HardwareCheckStats } from "@/Types/Monitor"; diff --git a/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx b/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx index dded8ecf5..04c87ca95 100644 --- a/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { DetailGauge } from "@/Components/v2/design-elements"; +import { DetailGauge } from "@/Components/design-elements"; import prettyBytes from "pretty-bytes"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Infrastructure/Details/Components/StatusBoxes.tsx b/client/src/Pages/Infrastructure/Details/Components/StatusBoxes.tsx index dffa6a175..ebfdad569 100644 --- a/client/src/Pages/Infrastructure/Details/Components/StatusBoxes.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/StatusBoxes.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { StatBox } from "@/Components/v2/design-elements"; +import { StatBox } from "@/Components/design-elements"; import prettyBytes from "pretty-bytes"; import { useTheme } from "@mui/material"; diff --git a/client/src/Pages/Infrastructure/Details/index.tsx b/client/src/Pages/Infrastructure/Details/index.tsx index f27979a4f..202887ad5 100644 --- a/client/src/Pages/Infrastructure/Details/index.tsx +++ b/client/src/Pages/Infrastructure/Details/index.tsx @@ -1,6 +1,6 @@ -import { BasePage, Tab, Tabs } from "@/Components/v2/design-elements"; -import { HeaderTimeRange } from "@/Components/v2/common"; -import { MonitorStatBoxes, HeaderMonitorControls } from "@/Components/v2/monitors"; +import { BasePage, Tab, Tabs } from "@/Components/design-elements"; +import { HeaderTimeRange } from "@/Components/common"; +import { MonitorStatBoxes, HeaderMonitorControls } from "@/Components/monitors"; import { TabNetwork } from "@/Pages/Infrastructure/Details/Components/TabNetwork"; import { TabOverview } from "@/Pages/Infrastructure/Details/Components/TabOverview"; diff --git a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable.tsx b/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable.tsx index b2bcadc1a..994ddcea1 100644 --- a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable.tsx +++ b/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable.tsx @@ -1,8 +1,8 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import { Table, Pagination, StatusLabel, Gauge } from "@/Components/v2/design-elements"; -import type { Header } from "@/Components/v2/design-elements/Table"; -import { ActionsMenu, type ActionMenuItem } from "@/Components/v2/actions-menu"; +import { Table, Pagination, StatusLabel, Gauge } from "@/Components/design-elements"; +import type { Header } from "@/Components/design-elements/Table"; +import { ActionsMenu, type ActionMenuItem } from "@/Components/actions-menu"; import { ArrowUp, ArrowDown } from "lucide-react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Infrastructure/Monitors/index.tsx b/client/src/Pages/Infrastructure/Monitors/index.tsx index 8d1ef1a3a..bdf477613 100644 --- a/client/src/Pages/Infrastructure/Monitors/index.tsx +++ b/client/src/Pages/Infrastructure/Monitors/index.tsx @@ -1,9 +1,9 @@ import Stack from "@mui/material/Stack"; import useMediaQuery from "@mui/material/useMediaQuery"; -import { MonitorBasePageWithStates } from "@/Components/v2/design-elements"; -import { HeaderCreate } from "@/Components/v2/common"; -import { ControlsFilter, HeaderMonitorsSummary } from "@/Components/v2/monitors"; -import { TextField, Dialog } from "@/Components/v2/inputs"; +import { MonitorBasePageWithStates } from "@/Components/design-elements"; +import { HeaderCreate } from "@/Components/common"; +import { ControlsFilter, HeaderMonitorsSummary } from "@/Components/monitors"; +import { TextField, Dialog } from "@/Components/inputs"; import { useGet, useDelete } from "@/Hooks/UseApi"; import { useIsAdmin } from "@/Hooks/useIsAdmin"; diff --git a/client/src/Pages/Logs/TabLogs.tsx b/client/src/Pages/Logs/TabLogs.tsx index a44de73a4..a05726b42 100644 --- a/client/src/Pages/Logs/TabLogs.tsx +++ b/client/src/Pages/Logs/TabLogs.tsx @@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack"; import MenuItem from "@mui/material/MenuItem"; import Typography from "@mui/material/Typography"; import { useSelector } from "react-redux"; -import { Select } from "@/Components/v2/inputs"; +import { Select } from "@/Components/inputs"; import { TableLogs } from "@/Pages/Logs/components/TableLogs"; import { useTheme } from "@mui/material"; diff --git a/client/src/Pages/Logs/TabQueue.tsx b/client/src/Pages/Logs/TabQueue.tsx index be0013368..06ce8ed0c 100644 --- a/client/src/Pages/Logs/TabQueue.tsx +++ b/client/src/Pages/Logs/TabQueue.tsx @@ -7,7 +7,7 @@ import { useTranslation } from "react-i18next"; import { useGet, usePost } from "@/Hooks/UseApi"; import type { QueueData } from "@/Types/Queue"; import { Metrics } from "@/Pages/Logs/components/Metrics"; -import { Button } from "@/Components/v2/inputs"; +import { Button } from "@/Components/inputs"; export const TabQueue = () => { const theme = useTheme(); diff --git a/client/src/Pages/Logs/components/Metrics.tsx b/client/src/Pages/Logs/components/Metrics.tsx index 8f96ec5ac..9705b9ecd 100644 --- a/client/src/Pages/Logs/components/Metrics.tsx +++ b/client/src/Pages/Logs/components/Metrics.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { StatBox } from "@/Components/v2/design-elements"; +import { StatBox } from "@/Components/design-elements"; import { useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Logs/components/StatGauges.tsx b/client/src/Pages/Logs/components/StatGauges.tsx index 34a148948..65c443831 100644 --- a/client/src/Pages/Logs/components/StatGauges.tsx +++ b/client/src/Pages/Logs/components/StatGauges.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { DetailGauge } from "@/Components/v2/design-elements"; +import { DetailGauge } from "@/Components/design-elements"; import { getPercentage, formatPercentageFromWhole } from "@/Utils/FormatUtils"; import prettyBytes from "pretty-bytes"; diff --git a/client/src/Pages/Logs/components/Stats.tsx b/client/src/Pages/Logs/components/Stats.tsx index 429330873..7bf343de3 100644 --- a/client/src/Pages/Logs/components/Stats.tsx +++ b/client/src/Pages/Logs/components/Stats.tsx @@ -1,5 +1,5 @@ import Stack from "@mui/material/Stack"; -import { StatBox } from "@/Components/v2/design-elements"; +import { StatBox } from "@/Components/design-elements"; import prettyBytes from "pretty-bytes"; import prettyMilliseconds from "pretty-ms"; diff --git a/client/src/Pages/Logs/components/TableJobs.tsx b/client/src/Pages/Logs/components/TableJobs.tsx index e9608df9a..660a5df4f 100644 --- a/client/src/Pages/Logs/components/TableJobs.tsx +++ b/client/src/Pages/Logs/components/TableJobs.tsx @@ -1,11 +1,11 @@ -import { Table } from "@/Components/v2/design-elements"; +import { Table } from "@/Components/design-elements"; import { Typography, useTheme } from "@mui/material"; import prettyMilliseconds from "pretty-ms"; import { formatTimestamp } from "@/Utils/TimeUtils"; import { useTranslation } from "react-i18next"; import type { QueueJobFailure, QueueJobSummary, QueueMetrics } from "@/Types/Queue"; -import type { Header } from "@/Components/v2/design-elements"; +import type { Header } from "@/Components/design-elements"; type QueueJobWithId = QueueJobSummary & { id: string | number }; diff --git a/client/src/Pages/Logs/components/TableLogs.tsx b/client/src/Pages/Logs/components/TableLogs.tsx index dace0db43..144d6056c 100644 --- a/client/src/Pages/Logs/components/TableLogs.tsx +++ b/client/src/Pages/Logs/components/TableLogs.tsx @@ -1,9 +1,9 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import { Table } from "@/Components/v2/design-elements"; -import { Pagination } from "@/Components/v2/design-elements/Table"; +import { Table } from "@/Components/design-elements"; +import { Pagination } from "@/Components/design-elements/Table"; import { useTheme } from "@mui/material"; -import type { Header } from "@/Components/v2/design-elements/Table"; +import type { Header } from "@/Components/design-elements/Table"; import type { Log, LogLevel } from "@/Types/Log"; import { useTranslation } from "react-i18next"; import { useSelector, useDispatch } from "react-redux"; diff --git a/client/src/Pages/Logs/index.tsx b/client/src/Pages/Logs/index.tsx index ab30b84eb..101ac11af 100644 --- a/client/src/Pages/Logs/index.tsx +++ b/client/src/Pages/Logs/index.tsx @@ -1,4 +1,4 @@ -import { BasePage, Tabs, Tab } from "@/Components/v2/design-elements"; +import { BasePage, Tabs, Tab } from "@/Components/design-elements"; import { TabLogs } from "@/Pages/Logs/TabLogs"; import { TabQueue } from "@/Pages/Logs/TabQueue"; import { TabDiagnostics } from "@/Pages/Logs/TabDiagnostics"; diff --git a/client/src/Pages/Maintenance/MaintenanceWindowTable.tsx b/client/src/Pages/Maintenance/MaintenanceWindowTable.tsx index 876969d3d..6dadb5a9c 100644 --- a/client/src/Pages/Maintenance/MaintenanceWindowTable.tsx +++ b/client/src/Pages/Maintenance/MaintenanceWindowTable.tsx @@ -1,13 +1,13 @@ import Typography from "@mui/material/Typography"; -import { Table, ValueLabel } from "@/Components/v2/design-elements"; -import { Pagination } from "@/Components/v2/design-elements/Table"; -import { ActionsMenu } from "@/Components/v2/actions-menu"; -import { DialogInput } from "@/Components/v2/inputs/Dialog"; +import { Table, ValueLabel } from "@/Components/design-elements"; +import { Pagination } from "@/Components/design-elements/Table"; +import { ActionsMenu } from "@/Components/actions-menu"; +import { DialogInput } from "@/Components/inputs/Dialog"; import prettyMilliseconds from "pretty-ms"; import { useTheme } from "@mui/material"; -import type { Header } from "@/Components/v2/design-elements/Table"; -import type { ActionMenuItem } from "@/Components/v2/actions-menu"; +import type { Header } from "@/Components/design-elements/Table"; +import type { ActionMenuItem } from "@/Components/actions-menu"; import type { MaintenanceWindow } from "@/Types/MaintenanceWindow"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; diff --git a/client/src/Pages/Maintenance/create/index.tsx b/client/src/Pages/Maintenance/create/index.tsx index 370694a94..b6666d4e2 100644 --- a/client/src/Pages/Maintenance/create/index.tsx +++ b/client/src/Pages/Maintenance/create/index.tsx @@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack"; import MenuItem from "@mui/material/MenuItem"; import Typography from "@mui/material/Typography"; import IconButton from "@mui/material/IconButton"; -import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; +import { BasePage, ConfigBox } from "@/Components/design-elements"; import { TextField, Select, @@ -10,7 +10,7 @@ import { TimePicker, Button, Autocomplete, -} from "@/Components/v2/inputs"; +} from "@/Components/inputs"; import { useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Maintenance/index.tsx b/client/src/Pages/Maintenance/index.tsx index ad8b8dac7..6a9c6f12b 100644 --- a/client/src/Pages/Maintenance/index.tsx +++ b/client/src/Pages/Maintenance/index.tsx @@ -1,5 +1,5 @@ -import { BasePageWithStates } from "@/Components/v2/design-elements"; -import { HeaderCreate } from "@/Components/v2/common"; +import { BasePageWithStates } from "@/Components/design-elements"; +import { HeaderCreate } from "@/Components/common"; import { useTranslation } from "react-i18next"; import { useGet } from "@/Hooks/UseApi"; import { MaintenanceWindowTable } from "./MaintenanceWindowTable"; diff --git a/client/src/Pages/NotFound/index.tsx b/client/src/Pages/NotFound/index.tsx index 868a1573a..ce974a2e1 100644 --- a/client/src/Pages/NotFound/index.tsx +++ b/client/src/Pages/NotFound/index.tsx @@ -1,5 +1,5 @@ import NotFoundSvg from "@/assets/Images/sushi_404.svg"; -import { Button } from "@/Components/v2/inputs"; +import { Button } from "@/Components/inputs"; import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; diff --git a/client/src/Pages/Notifications/components/NotificationsTable.tsx b/client/src/Pages/Notifications/components/NotificationsTable.tsx index 2885a34bb..d103458c3 100644 --- a/client/src/Pages/Notifications/components/NotificationsTable.tsx +++ b/client/src/Pages/Notifications/components/NotificationsTable.tsx @@ -1,7 +1,7 @@ -import { ActionsMenu, type ActionMenuItem } from "@/Components/v2/actions-menu"; +import { ActionsMenu, type ActionMenuItem } from "@/Components/actions-menu"; import Typography from "@mui/material/Typography"; -import type { Header } from "@/Components/v2/design-elements/Table"; -import { Table } from "@/Components/v2/design-elements"; +import type { Header } from "@/Components/design-elements/Table"; +import { Table } from "@/Components/design-elements"; import type { Notification } from "@/Types/Notification"; import { useNavigate } from "react-router"; diff --git a/client/src/Pages/Notifications/create/index.tsx b/client/src/Pages/Notifications/create/index.tsx index 30cfd4c80..7aa7bc831 100644 --- a/client/src/Pages/Notifications/create/index.tsx +++ b/client/src/Pages/Notifications/create/index.tsx @@ -1,5 +1,5 @@ -import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; -import { TextField, Select, Button } from "@/Components/v2/inputs"; +import { BasePage, ConfigBox } from "@/Components/design-elements"; +import { TextField, Select, Button } from "@/Components/inputs"; import MenuItem from "@mui/material/MenuItem"; import Typography from "@mui/material/Typography"; import Stack from "@mui/material/Stack"; diff --git a/client/src/Pages/Notifications/index.tsx b/client/src/Pages/Notifications/index.tsx index 37c8cbbed..1e4091461 100644 --- a/client/src/Pages/Notifications/index.tsx +++ b/client/src/Pages/Notifications/index.tsx @@ -1,7 +1,7 @@ -import { BasePageWithStates } from "@/Components/v2/design-elements"; +import { BasePageWithStates } from "@/Components/design-elements"; import { NotificationsTable } from "@/Pages/Notifications/components/NotificationsTable"; -import { Dialog } from "@/Components/v2/inputs"; -import { HeaderCreate } from "@/Components/v2/common"; +import { Dialog } from "@/Components/inputs"; +import { HeaderCreate } from "@/Components/common"; import { useState } from "react"; import { useGet, useDelete } from "@/Hooks/UseApi"; diff --git a/client/src/Pages/PageSpeed/Details/index.tsx b/client/src/Pages/PageSpeed/Details/index.tsx index 3be3a245b..f67ce6730 100644 --- a/client/src/Pages/PageSpeed/Details/index.tsx +++ b/client/src/Pages/PageSpeed/Details/index.tsx @@ -1,4 +1,4 @@ -import { BasePage } from "@/Components/v2/design-elements"; +import { BasePage } from "@/Components/design-elements"; import type { PageSpeedDetailsResponse } from "@/Types/Monitor"; import Stack from "@mui/material/Stack"; import { @@ -7,7 +7,7 @@ import { PiePageSpeedLegend, MonitorStatBoxes, HeaderMonitorControls, -} from "@/Components/v2/monitors"; +} from "@/Components/monitors"; import { useIsAdmin } from "@/Hooks/useIsAdmin"; import { useGet } from "@/Hooks/UseApi"; diff --git a/client/src/Pages/PageSpeed/Monitors/Components/PageSpeedMonitorsTable.tsx b/client/src/Pages/PageSpeed/Monitors/Components/PageSpeedMonitorsTable.tsx index 1dc9ce9df..a812883e0 100644 --- a/client/src/Pages/PageSpeed/Monitors/Components/PageSpeedMonitorsTable.tsx +++ b/client/src/Pages/PageSpeed/Monitors/Components/PageSpeedMonitorsTable.tsx @@ -1,11 +1,11 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import { Table, Pagination, StatusLabel } from "@/Components/v2/design-elements"; -import { HistogramPageSpeed } from "@/Components/v2/monitors"; +import { Table, Pagination, StatusLabel } from "@/Components/design-elements"; +import { HistogramPageSpeed } from "@/Components/monitors"; import { ArrowDown, ArrowUp } from "lucide-react"; -import type { Header } from "@/Components/v2/design-elements/Table"; -import { ActionsMenu } from "@/Components/v2/actions-menu"; +import type { Header } from "@/Components/design-elements/Table"; +import { ActionsMenu } from "@/Components/actions-menu"; import { useTranslation } from "react-i18next"; import useMediaQuery from "@mui/material/useMediaQuery"; @@ -14,7 +14,7 @@ import { useNavigate } from "react-router-dom"; import { usePatch } from "@/Hooks/UseApi"; import type { Monitor, MonitorWithChecks } from "@/Types/Monitor"; -import type { ActionMenuItem } from "@/Components/v2/actions-menu"; +import type { ActionMenuItem } from "@/Components/actions-menu"; export const PageSpeedMonitorsTable = ({ monitors, diff --git a/client/src/Pages/PageSpeed/Monitors/index.tsx b/client/src/Pages/PageSpeed/Monitors/index.tsx index f958b5619..cfdbe6c4e 100644 --- a/client/src/Pages/PageSpeed/Monitors/index.tsx +++ b/client/src/Pages/PageSpeed/Monitors/index.tsx @@ -1,9 +1,9 @@ import { MonitorBasePageWithStates, PageSpeedKeyPriorityFallback, -} from "@/Components/v2/design-elements"; -import { Dialog } from "@/Components/v2/inputs"; -import { HeaderCreate } from "@/Components/v2/common"; +} from "@/Components/design-elements"; +import { Dialog } from "@/Components/inputs"; +import { HeaderCreate } from "@/Components/common"; import { PageSpeedMonitorsTable } from "@/Pages/PageSpeed/Monitors/Components/PageSpeedMonitorsTable"; import type { Monitor } from "@/Types/Monitor"; @@ -13,7 +13,7 @@ import { useIsAdmin } from "@/Hooks/useIsAdmin"; import { useGet, useDelete } from "@/Hooks/UseApi"; import type { MonitorsWithChecksResponse } from "@/Types/Monitor"; import type { AppSettingsResponse } from "@/Types/Settings"; -import { HeaderMonitorsSummary } from "@/Components/v2/monitors"; +import { HeaderMonitorsSummary } from "@/Components/monitors"; const PageSpeedMonitorsPage = () => { const { t } = useTranslation(); diff --git a/client/src/Pages/Settings/DummyChart.tsx b/client/src/Pages/Settings/DummyChart.tsx index df7cd5603..b354ee9bb 100644 --- a/client/src/Pages/Settings/DummyChart.tsx +++ b/client/src/Pages/Settings/DummyChart.tsx @@ -1,7 +1,7 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import { useTheme } from "@mui/material/styles"; -import { HeatmapResponseTime, HistogramResponseTime } from "@/Components/v2/common"; +import { HeatmapResponseTime, HistogramResponseTime } from "@/Components/common"; import type { CheckSnapshot } from "@/Types/Check"; interface DummyChartProps { diff --git a/client/src/Pages/Settings/index.tsx b/client/src/Pages/Settings/index.tsx index 5e01e02f1..b9d3e1f3c 100644 --- a/client/src/Pages/Settings/index.tsx +++ b/client/src/Pages/Settings/index.tsx @@ -1,5 +1,5 @@ -import { BasePage, ConfigBox, TextLink } from "@/Components/v2/design-elements"; -import { Autocomplete, Select, Dialog, SwitchComponent } from "@/Components/v2/inputs"; +import { BasePage, ConfigBox, TextLink } from "@/Components/design-elements"; +import { Autocomplete, Select, Dialog, SwitchComponent } from "@/Components/inputs"; import { Stack, useTheme, MenuItem, Link, type SelectChangeEvent } from "@mui/material"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; @@ -13,7 +13,7 @@ import { useIsAdmin } from "@/Hooks/useIsAdmin.js"; import type { SettingsFormData } from "@/Validation/settings"; import { useState } from "react"; import { Controller } from "react-hook-form"; -import { TextField, Button, FieldLabel } from "@/Components/v2/inputs"; +import { TextField, Button, FieldLabel } from "@/Components/inputs"; import { Box, Typography } from "@mui/material"; import { useDelete } from "@/Hooks/UseApi"; diff --git a/client/src/Pages/StatusPage/Create/Components/HeaderConfigStatusControls.tsx b/client/src/Pages/StatusPage/Create/Components/HeaderConfigStatusControls.tsx index 99ae46cdd..407306f1b 100644 --- a/client/src/Pages/StatusPage/Create/Components/HeaderConfigStatusControls.tsx +++ b/client/src/Pages/StatusPage/Create/Components/HeaderConfigStatusControls.tsx @@ -1,6 +1,6 @@ import Stack from "@mui/material/Stack"; -import { Icon } from "@/Components/v2/design-elements"; -import { Button } from "@/Components/v2/inputs"; +import { Icon } from "@/Components/design-elements"; +import { Button } from "@/Components/inputs"; import { Trash } from "lucide-react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/StatusPage/Create/index.tsx b/client/src/Pages/StatusPage/Create/index.tsx index 8b4394f14..b1b43d8bb 100644 --- a/client/src/Pages/StatusPage/Create/index.tsx +++ b/client/src/Pages/StatusPage/Create/index.tsx @@ -1,4 +1,4 @@ -import { BasePage, ConfigBox } from "@/Components/v2/design-elements"; +import { BasePage, ConfigBox } from "@/Components/design-elements"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import IconButton from "@mui/material/IconButton"; @@ -15,7 +15,7 @@ import { Checkbox, Dialog, ColorInput, -} from "@/Components/v2/inputs"; +} from "@/Components/inputs"; import { useTheme } from "@mui/material/styles"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/StatusPage/Status/Components/HeaderStatusPageControls.tsx b/client/src/Pages/StatusPage/Status/Components/HeaderStatusPageControls.tsx index 0e8f444c9..2cc2395bb 100644 --- a/client/src/Pages/StatusPage/Status/Components/HeaderStatusPageControls.tsx +++ b/client/src/Pages/StatusPage/Status/Components/HeaderStatusPageControls.tsx @@ -1,8 +1,8 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import { Icon } from "@/Components/v2/design-elements"; -import { Button } from "@/Components/v2/inputs"; +import { Icon } from "@/Components/design-elements"; +import { Button } from "@/Components/inputs"; import { Settings, ExternalLink } from "lucide-react"; import { useTheme } from "@mui/material"; diff --git a/client/src/Pages/StatusPage/Status/Components/MonitorsList.tsx b/client/src/Pages/StatusPage/Status/Components/MonitorsList.tsx index 35aad7a26..b94b20a80 100644 --- a/client/src/Pages/StatusPage/Status/Components/MonitorsList.tsx +++ b/client/src/Pages/StatusPage/Status/Components/MonitorsList.tsx @@ -2,9 +2,9 @@ import Stack from "@mui/material/Stack"; import { useTranslation } from "react-i18next"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import { HistogramResponseTime, HeatmapResponseTime } from "@/Components/v2/common"; -import { StatusLabel, BaseBox } from "@/Components/v2/design-elements"; -import { SwitchComponent } from "@/Components/v2/inputs"; +import { HistogramResponseTime, HeatmapResponseTime } from "@/Components/common"; +import { StatusLabel, BaseBox } from "@/Components/design-elements"; +import { SwitchComponent } from "@/Components/inputs"; import { useTheme } from "@mui/material/styles"; import { useSelector } from "react-redux"; diff --git a/client/src/Pages/StatusPage/Status/index.tsx b/client/src/Pages/StatusPage/Status/index.tsx index b1826b867..0ca629581 100644 --- a/client/src/Pages/StatusPage/Status/index.tsx +++ b/client/src/Pages/StatusPage/Status/index.tsx @@ -1,4 +1,4 @@ -import { BasePage, BaseFallback } from "@/Components/v2/design-elements"; +import { BasePage, BaseFallback } from "@/Components/design-elements"; import { StatusBar } from "@/Pages/StatusPage/Status/Components/StatusBar"; import { MonitorsList } from "@/Pages/StatusPage/Status/Components/MonitorsList"; import Typography from "@mui/material/Typography"; diff --git a/client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable.tsx b/client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable.tsx index 192f9c101..978466bb4 100644 --- a/client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable.tsx +++ b/client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable.tsx @@ -1,8 +1,8 @@ import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import { Table, type Header, ValueLabel } from "@/Components/v2/design-elements"; -import { ActionsMenu, type ActionMenuItem } from "@/Components/v2/actions-menu"; +import { Table, type Header, ValueLabel } from "@/Components/design-elements"; +import { ActionsMenu, type ActionMenuItem } from "@/Components/actions-menu"; import { ExternalLink } from "lucide-react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/StatusPage/StatusPages/index.tsx b/client/src/Pages/StatusPage/StatusPages/index.tsx index 85b84e638..9468b7e12 100644 --- a/client/src/Pages/StatusPage/StatusPages/index.tsx +++ b/client/src/Pages/StatusPage/StatusPages/index.tsx @@ -1,11 +1,11 @@ import { useState } from "react"; -import { BasePageWithStates } from "@/Components/v2/design-elements"; -import { Dialog } from "@/Components/v2/inputs"; +import { BasePageWithStates } from "@/Components/design-elements"; +import { Dialog } from "@/Components/inputs"; import { StatusPagesTable } from "./Components/StatusPagesTable"; import { useGet, useDelete } from "@/Hooks/UseApi"; import type { StatusPage } from "@/Types/StatusPage"; import { useTranslation } from "react-i18next"; -import { HeaderCreate } from "@/Components/v2/common"; +import { HeaderCreate } from "@/Components/common"; import { useIsAdmin } from "@/Hooks/useIsAdmin"; const StatusPages = () => { diff --git a/client/src/Pages/Uptime/Details/Components/ChecksTable.tsx b/client/src/Pages/Uptime/Details/Components/ChecksTable.tsx index ceb8e1a28..26905e7cc 100644 --- a/client/src/Pages/Uptime/Details/Components/ChecksTable.tsx +++ b/client/src/Pages/Uptime/Details/Components/ChecksTable.tsx @@ -1,6 +1,6 @@ -import { Table, Pagination, StatusLabel } from "@/Components/v2/design-elements"; +import { Table, Pagination, StatusLabel } from "@/Components/design-elements"; import Box from "@mui/material/Box"; -import type { Header } from "@/Components/v2/design-elements/"; +import type { Header } from "@/Components/design-elements"; import type { Check } from "@/Types/Check"; import { useNavigate } from "react-router"; diff --git a/client/src/Pages/Uptime/Details/index.tsx b/client/src/Pages/Uptime/Details/index.tsx index b7910a17c..23f9a2196 100644 --- a/client/src/Pages/Uptime/Details/index.tsx +++ b/client/src/Pages/Uptime/Details/index.tsx @@ -1,15 +1,15 @@ -import { BasePage } from "@/Components/v2/design-elements"; -import { HeaderTimeRange } from "@/Components/v2/common"; +import { BasePage } from "@/Components/design-elements"; +import { HeaderTimeRange } from "@/Components/common"; import Stack from "@mui/material/Stack"; import { HistogramStatus, RadialAvgResponse, HistogramDetails, HeaderMonitorControls, -} from "@/Components/v2/monitors"; +} from "@/Components/monitors"; import { TrendingUp, AlertTriangle } from "lucide-react"; import { ChecksTable } from "@/Pages/Uptime/Details/Components/ChecksTable"; -import { MonitorStatBoxes } from "@/Components/v2/monitors"; +import { MonitorStatBoxes } from "@/Components/monitors"; import { useTheme } from "@mui/material/styles"; import { useIsAdmin } from "@/Hooks/useIsAdmin"; diff --git a/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx b/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx index 75738e6ad..87db4246d 100644 --- a/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx +++ b/client/src/Pages/Uptime/Monitors/Components/UptimeMonitorsTable.tsx @@ -6,9 +6,9 @@ import { type Header, Pagination, StatusLabel, -} from "@/Components/v2/design-elements"; -import { HeatmapResponseTime, HistogramResponseTime } from "@/Components/v2/common"; -import { ActionsMenu } from "@/Components/v2/actions-menu"; +} from "@/Components/design-elements"; +import { HeatmapResponseTime, HistogramResponseTime } from "@/Components/common"; +import { ActionsMenu } from "@/Components/actions-menu"; import { ArrowDown, ArrowUp } from "lucide-react"; import { useTranslation } from "react-i18next"; @@ -18,7 +18,7 @@ import { usePost } from "@/Hooks/UseApi"; import { useSelector } from "react-redux"; import type { Monitor } from "@/Types/Monitor"; -import type { ActionMenuItem } from "@/Components/v2/actions-menu"; +import type { ActionMenuItem } from "@/Components/actions-menu"; import type { RootState } from "@/Types/state"; export const MonitorTable = ({ diff --git a/client/src/Pages/Uptime/Monitors/index.tsx b/client/src/Pages/Uptime/Monitors/index.tsx index 9e36ccc86..5c419738b 100644 --- a/client/src/Pages/Uptime/Monitors/index.tsx +++ b/client/src/Pages/Uptime/Monitors/index.tsx @@ -1,9 +1,9 @@ -import { ControlsFilter, HeaderMonitorsSummary } from "@/Components/v2/monitors"; -import { MonitorBasePageWithStates } from "@/Components/v2/design-elements"; -import { TextField, Dialog } from "@/Components/v2/inputs"; +import { ControlsFilter, HeaderMonitorsSummary } from "@/Components/monitors"; +import { MonitorBasePageWithStates } from "@/Components/design-elements"; +import { TextField, Dialog } from "@/Components/inputs"; import Stack from "@mui/material/Stack"; import { MonitorTable } from "@/Pages/Uptime/Monitors/Components/UptimeMonitorsTable"; -import { HeaderCreate } from "@/Components/v2/common"; +import { HeaderCreate } from "@/Components/common"; import { useTranslation } from "react-i18next"; import useMediaQuery from "@mui/material/useMediaQuery"; diff --git a/client/src/Routes/index.tsx b/client/src/Routes/index.tsx index a1b5d907a..20869c47c 100644 --- a/client/src/Routes/index.tsx +++ b/client/src/Routes/index.tsx @@ -1,5 +1,5 @@ import { Navigate, Route, Routes as LibRoutes } from "react-router"; -import RootLayout from "@/Components/v2/layout/RootLayout"; +import RootLayout from "@/Components/layout/RootLayout"; import NotFound from "@/Pages/NotFound"; // Auth @@ -46,10 +46,7 @@ import CreateNewMaintenanceWindow from "@/Pages/Maintenance/create"; import Logs from "@/Pages/Logs"; // Routing -import { - ProtectedRoute, - RoleProtectedRoute, -} from "@/Components/v2/routing/RouteProtected"; +import { ProtectedRoute, RoleProtectedRoute } from "@/Components/routing/RouteProtected"; import CreateMonitor from "@/Pages/CreateMonitor"; diff --git a/client/src/Utils/MonitorUtils.ts b/client/src/Utils/MonitorUtils.ts index 3be1b30a1..a19316c62 100644 --- a/client/src/Utils/MonitorUtils.ts +++ b/client/src/Utils/MonitorUtils.ts @@ -1,6 +1,6 @@ import type { MonitorStatus, MonitorType } from "@/Types/Monitor"; import type { PaletteKey } from "@/Utils/Theme/Theme"; -import type { ValueType } from "@/Components/v2/design-elements/StatusLabel"; +import type { ValueType } from "@/Components/design-elements/StatusLabel"; export const getMonitorPath = (type: MonitorType): string => { const pathMap: Record = { diff --git a/client/src/main.tsx b/client/src/main.tsx index f075886d3..1f5d4d2ef 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -5,7 +5,7 @@ import { BrowserRouter as Router } from "react-router-dom"; import { Provider } from "react-redux"; import { persistor, store } from "@/store.js"; import { PersistGate } from "redux-persist/integration/react"; -import I18nLoader from "./Components/v2/i18nLoader"; +import I18nLoader from "./Components/i18nLoader/index.js"; import { initApiClient } from "./Utils/ApiClient.js"; initApiClient(store);