From 58e7ef2527a18fa603b97ae82218bc735da5b673 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 21 Nov 2025 10:43:29 -0800 Subject: [PATCH 01/11] implement JSON export --- client/src/Hooks/v1/monitorHooks.js | 18 +++++ .../src/Pages/v1/Settings/SettingsExport.jsx | 65 +++++++++++++++++++ client/src/Pages/v1/Settings/index.jsx | 30 +++++++++ client/src/Utils/NetworkService.js | 4 ++ .../src/controllers/v1/monitorController.js | 18 +++++ server/src/routes/v1/monitorRoute.js | 1 + .../src/service/v1/business/monitorService.js | 40 ++++++++++++ 7 files changed, 176 insertions(+) create mode 100644 client/src/Pages/v1/Settings/SettingsExport.jsx diff --git a/client/src/Hooks/v1/monitorHooks.js b/client/src/Hooks/v1/monitorHooks.js index e6b4b5261..9ee98cc55 100644 --- a/client/src/Hooks/v1/monitorHooks.js +++ b/client/src/Hooks/v1/monitorHooks.js @@ -538,6 +538,23 @@ const useExportMonitors = () => { return [exportMonitors, isLoading]; }; +const useFetchJson = () => { + const [isLoading, setIsLoading] = useState(false); + const fetchJson = async () => { + try { + setIsLoading(true); + const res = await networkService.fetchJson(); + createToast({ body: "JSON fetched successfully" }); + return res?.data?.data ?? []; + } catch (error) { + createToast({ body: "Failed to create monitor." }); + } finally { + setIsLoading(false); + } + }; + return [fetchJson, isLoading]; +}; + export { useFetchMonitorsWithSummary, useFetchMonitorsWithChecks, @@ -557,4 +574,5 @@ export { useCreateBulkMonitors, useExportMonitors, useFetchMonitorGames, + useFetchJson, }; diff --git a/client/src/Pages/v1/Settings/SettingsExport.jsx b/client/src/Pages/v1/Settings/SettingsExport.jsx new file mode 100644 index 000000000..fe04697f4 --- /dev/null +++ b/client/src/Pages/v1/Settings/SettingsExport.jsx @@ -0,0 +1,65 @@ +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"; + +const SettingsDemoMonitors = ({ isAdmin, HEADER_SX, handleChange, isLoading }) => { + const { t } = useTranslation(); + const theme = useTheme(); + // Local state + const [isOpen, setIsOpen] = useState(false); + + if (!isAdmin) { + return null; + } + + return ( + <> + + + + Export monitors to JSON + + + Export your monitors data as a JSON file for backup or transfer. + + + + + + + + ); +}; + +SettingsDemoMonitors.propTypes = { + isAdmin: PropTypes.bool, + handleChange: PropTypes.func, + HEADER_SX: PropTypes.object, +}; + +export default SettingsDemoMonitors; diff --git a/client/src/Pages/v1/Settings/index.jsx b/client/src/Pages/v1/Settings/index.jsx index 2732e331a..b6137121b 100644 --- a/client/src/Pages/v1/Settings/index.jsx +++ b/client/src/Pages/v1/Settings/index.jsx @@ -9,6 +9,7 @@ import SettingsDemoMonitors from "./SettingsDemoMonitors.jsx"; import SettingsAbout from "./SettingsAbout.jsx"; import SettingsEmail from "./SettingsEmail.jsx"; import SettingsGlobalThresholds from "./SettingsGlobalThresholds.jsx"; +import SettingsExport from "./SettingsExport.jsx"; import Button from "@mui/material/Button"; // Utils import { settingsValidation } from "../../../Validation/validation.js"; @@ -30,6 +31,7 @@ import { useAddDemoMonitors, useDeleteAllMonitors, useDeleteMonitorStats, + useFetchJson, } from "../../../Hooks/v1/monitorHooks.js"; // Constants const BREADCRUMBS = [{ name: `Settings`, path: "/settings" }]; @@ -66,6 +68,7 @@ const Settings = () => { }); const [deleteAllMonitors, isDeletingMonitors] = useDeleteAllMonitors(); const [deleteMonitorStats, isDeletingMonitorStats] = useDeleteMonitorStats(); + const [fetchJson, isFetchingJson] = useFetchJson(); // Setup const isAdmin = useIsAdmin(); @@ -128,6 +131,27 @@ const Settings = () => { return; } + if (name === "export") { + const json = await fetchJson(); + 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; + } + // Validate const { error } = settingsValidation.validate(newSettingsData.settings, { abortEarly: false, @@ -224,6 +248,12 @@ const Settings = () => { setEmailPasswordHasBeenReset={setEmailPasswordHasBeenReset} /> + { + const teamId = req?.user?.teamId; + if (!teamId) { + throw this.errorService.createBadRequestError("Team ID is required"); + } + + const json = await this.monitorService.exportMonitorsToJSON({ teamId }); + + return res.success({ + msg: "OK", + data: json, + }); + }, + SERVICE_NAME, + "exportMonitorsToJSON" + ); + getAllGames = this.asyncHandler( async (req, res) => { return res.success({ diff --git a/server/src/routes/v1/monitorRoute.js b/server/src/routes/v1/monitorRoute.js index dc0dd694b..fe430d46f 100755 --- a/server/src/routes/v1/monitorRoute.js +++ b/server/src/routes/v1/monitorRoute.js @@ -43,6 +43,7 @@ class MonitorRoutes { // Other static routes this.router.post("/demo", isAllowed(["admin", "superadmin"]), this.monitorController.addDemoMonitors); this.router.get("/export", isAllowed(["admin", "superadmin"]), this.monitorController.exportMonitorsToCSV); + this.router.get("/export/json", isAllowed(["admin", "superadmin"]), this.monitorController.exportMonitorsToJSON); this.router.post("/bulk", isAllowed(["admin", "superadmin"]), upload.single("csvFile"), this.monitorController.createBulkMonitors); this.router.post("/test-email", isAllowed(["admin", "superadmin"]), this.monitorController.sendTestEmail); this.router.get("/games", this.monitorController.getAllGames); diff --git a/server/src/service/v1/business/monitorService.js b/server/src/service/v1/business/monitorService.js index 2b643ee64..2118e6281 100644 --- a/server/src/service/v1/business/monitorService.js +++ b/server/src/service/v1/business/monitorService.js @@ -263,6 +263,46 @@ class MonitorService { const csv = this.papaparse.unparse(csvData); return csv; }; + exportMonitorsToJSON = async ({ teamId }) => { + const monitors = await this.db.monitorModule.getMonitorsByTeamId({ teamId }); + + if (!monitors || monitors.length === 0) { + throw this.errorService.createNotFoundError("No monitors to export"); + } + + const json = monitors?.filteredMonitors + ?.map((monitor) => { + const initialType = monitor.type; + let parsedType; + + if (initialType === "hardware") { + parsedType = "infrastructure"; + } else if (initialType === "http") { + if (monitor.url.startsWith("https://")) { + parsedType = "https"; + } else { + parsedType = "http"; + } + } else if (initialType === "pagespeed") { + parsedType = initialType; + } else { + // Skip unsupported types + return; + } + + return { + name: monitor.name, + url: monitor.url, + type: parsedType, + interval: monitor.interval, + n: monitor.statusWindowSize, + secret: monitor.secret, + }; + }) + .filter(Boolean); + + return json; + }; getAllGames = () => { return this.games; From 8fb958e772f1277c334bdae743110e8713eb5549 Mon Sep 17 00:00:00 2001 From: mospell Date: Sun, 23 Nov 2025 16:39:09 +0100 Subject: [PATCH 02/11] Feat: Add link to infrastructure details for Notifications --- server/src/config/services.js | 1 + .../service/v1/infrastructure/notificationUtils.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/src/config/services.js b/server/src/config/services.js index c1679868d..498e37ade 100644 --- a/server/src/config/services.js +++ b/server/src/config/services.js @@ -158,6 +158,7 @@ export const initializeServices = async ({ logger, envSettings, settingsService const notificationUtils = new NotificationUtils({ stringService, emailService, + settingsService, }); const notificationService = new NotificationService({ diff --git a/server/src/service/v1/infrastructure/notificationUtils.js b/server/src/service/v1/infrastructure/notificationUtils.js index d6b92cc0e..2051fb6a4 100644 --- a/server/src/service/v1/infrastructure/notificationUtils.js +++ b/server/src/service/v1/infrastructure/notificationUtils.js @@ -3,9 +3,10 @@ const SERVICE_NAME = "NotificationUtils"; class NotificationUtils { static SERVICE_NAME = SERVICE_NAME; - constructor({ stringService, emailService }) { + constructor({ stringService, emailService, settingsService }) { this.stringService = stringService; this.emailService = emailService; + this.settingsService = settingsService; } get serviceName() { @@ -99,6 +100,8 @@ class NotificationUtils { const metrics = networkResponse?.payload?.data; const { cpu: { usage_percent: cpuUsage = -1 } = {}, memory: { usage_percent: memoryUsage = -1 } = {}, disk = [] } = metrics; + const { clientHost } = this.settingsService.getSettings(); + const alerts = { cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false, memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false, @@ -140,6 +143,10 @@ class NotificationUtils { value: `${(d?.usage_percent * 100).toFixed(0)}%`, inline: true, })), + { + name: `Go to incident`, + value: `${clientHost}/infrastructure/${monitor._id}`, + }, ], }), }; @@ -182,8 +189,10 @@ class NotificationUtils { }; buildHardwareNotificationMessage = (alerts, monitor) => { + const { clientHost } = this.settingsService.getSettings(); const alertsHeader = [`Monitor: ${monitor.name}`, `URL: ${monitor.url}`]; - const alertText = alerts.length > 0 ? [...alertsHeader, ...alerts] : []; + const alertFooter = [`Go to incident: ${clientHost}/infrastructure/${monitor._id}`]; + const alertText = alerts.length > 0 ? [...alertsHeader, ...alerts, ...alertFooter] : []; return alertText.map((alert) => alert).join("\n"); }; buildHardwareWebhookBody = (alerts, monitor) => { From 90593c0d7cf0122cb76b1d7f5f117f1cdc469231 Mon Sep 17 00:00:00 2001 From: mospell Date: Sun, 23 Nov 2025 17:18:09 +0100 Subject: [PATCH 03/11] added 'go-to' links to the remaining Discord notifications --- .../src/service/v1/infrastructure/notificationUtils.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/src/service/v1/infrastructure/notificationUtils.js b/server/src/service/v1/infrastructure/notificationUtils.js index 2051fb6a4..90251800c 100644 --- a/server/src/service/v1/infrastructure/notificationUtils.js +++ b/server/src/service/v1/infrastructure/notificationUtils.js @@ -114,12 +114,13 @@ class NotificationUtils { { name: "Monitor", value: monitor.name, inline: true }, { name: "URL", value: monitor.url, inline: false }, ]; + const goToIncidentField = { name: `Go to incident`, value: `${clientHost}/infrastructure/${monitor._id}` }; const formatDiscordAlert = { cpu: () => ({ title: "CPU alert", description: `Your current CPU usage (${(cpuUsage * 100).toFixed(0)}%) is above your threshold (${(cpuThreshold * 100).toFixed(0)}%)`, color: 15548997, - fields: monitorInfoFields, + fields: [...monitorInfoFields, goToIncidentField], footer: { text: "Checkmate" }, }), @@ -127,7 +128,7 @@ class NotificationUtils { title: "Memory alert", description: `Your current memory usage (${(memoryUsage * 100).toFixed(0)}%) is above your threshold (${(memoryThreshold * 100).toFixed(0)}%)`, color: 15548997, - fields: monitorInfoFields, + fields: [...monitorInfoFields, goToIncidentField], footer: { text: "Checkmate" }, }), @@ -143,10 +144,7 @@ class NotificationUtils { value: `${(d?.usage_percent * 100).toFixed(0)}%`, inline: true, })), - { - name: `Go to incident`, - value: `${clientHost}/infrastructure/${monitor._id}`, - }, + goToIncidentField, ], }), }; From 6c2908681a8729d8e1070db53745db6b992ac470 Mon Sep 17 00:00:00 2001 From: SuryaGanesh284 Date: Tue, 25 Nov 2025 22:12:16 +0530 Subject: [PATCH 04/11] Add quick setup checklist to CONTRIBUTING.md Added a quick setup checklist for contributors. --- CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5565d3797..656523f88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,31 @@ PS: **We work closely with contributors on our [Discord channel](https://discord --- + +## 🚀 Quick Setup Checklist + +Before you dive in, make sure you have these installed: + +```bash +# Check Node.js (v16+ required) +node --version + +# Check npm +npm --version + +# Check Docker +docker --version + +# Check Git +git --version +``` + +**New to contributing?** Start here: +1. Pick a [`good-first-issue`](https://github.com/bluewave-labs/checkmate/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) +2. Comment that you'd like to work on it +3. Follow the [setup guide](#set-up-checkmate-locally) below +4. Join our [Discord](https://discord.com/invite/NAb6H3UTjK) if you get stuck + ## Table of contents - [How do I...?](#how-do-i) From dd98757b2aef83756f8344381e07b9e7d2f62b57 Mon Sep 17 00:00:00 2001 From: Craig Lawson Date: Sat, 29 Nov 2025 17:46:29 +0000 Subject: [PATCH 05/11] feat(helm): add TLS/HTTPS support with cert-manager integration - Add TLS configuration to ingress templates (client & server) - Add tls.enabled and tls.secretName to values.yaml - Include comprehensive cert-manager documentation in INSTALLATION.md - Add example annotations for Let's Encrypt cluster issuer - Support both values.yaml and --set flag configuration methods - Backward compatible (TLS disabled by default) Enables automatic HTTPS certificate provisioning when cert-manager is installed in the cluster with appropriate ClusterIssuer configured. --- charts/helm/checkmate/INSTALLATION.md | 69 +++++++++++++++++++ .../checkmate/templates/client-ingress.yaml | 6 ++ .../checkmate/templates/server-ingress.yaml | 6 ++ charts/helm/checkmate/values.yaml | 14 ++++ 4 files changed, 95 insertions(+) diff --git a/charts/helm/checkmate/INSTALLATION.md b/charts/helm/checkmate/INSTALLATION.md index 4a2a120b5..c4586cd85 100644 --- a/charts/helm/checkmate/INSTALLATION.md +++ b/charts/helm/checkmate/INSTALLATION.md @@ -26,6 +26,7 @@ Edit `values.yaml` to update: - Old: `persistence.redisSize` → New: `persistence.redis.size` - Add: `persistence.mongo.storageClass` and `persistence.redis.storageClass` (leave empty for default) - Secrets under the `secrets` section (`JWT_SECRET`, email credentials, API keys, etc.) — replace all change_me values +- **For TLS/HTTPS**: Configure ingress TLS settings (see section below) ### 3. Deploy the Helm chart ```bash @@ -41,3 +42,71 @@ kubectl get svc ``` Once all pods are `Running` and `Ready`, you can access Checkmate via the configured ingress hosts. + +## Enabling TLS/HTTPS with cert-manager + +If you have [cert-manager](https://cert-manager.io/) installed in your cluster, you can enable automatic TLS certificate provisioning using Let's Encrypt or other certificate issuers. + +### Prerequisites +- cert-manager installed in your cluster +- A ClusterIssuer or Issuer configured (e.g., `letsencrypt-prod`) + +### Configuration + +Edit `values.yaml` to enable TLS: + +```yaml +client: + ingress: + enabled: true + host: checkmate.example.com + className: nginx + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" + tls: + enabled: true + secretName: checkmate-client-tls + +server: + ingress: + enabled: true + host: checkmate.example.com + className: nginx + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" + tls: + enabled: true + secretName: checkmate-server-tls +``` + +### Alternative: Using --set flags + +You can also enable TLS during installation using Helm's `--set` flags: + +```bash +helm install checkmate ./charts/helm/checkmate \ + --set client.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \ + --set client.ingress.tls.enabled=true \ + --set client.ingress.tls.secretName=checkmate-client-tls \ + --set server.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \ + --set server.ingress.tls.enabled=true \ + --set server.ingress.tls.secretName=checkmate-server-tls +``` + +### Verification + +After deployment, cert-manager will automatically create the TLS secrets. You can verify the certificate status: + +```bash +# Check certificates +kubectl get certificates + +# Check certificate details +kubectl describe certificate checkmate-client-tls +kubectl describe certificate checkmate-server-tls + +# Verify the secrets were created +kubectl get secrets | grep checkmate-tls +``` + +The ingress will automatically use these secrets to enable HTTPS access to your Checkmate instance. diff --git a/charts/helm/checkmate/templates/client-ingress.yaml b/charts/helm/checkmate/templates/client-ingress.yaml index 89e001e15..5965edfed 100644 --- a/charts/helm/checkmate/templates/client-ingress.yaml +++ b/charts/helm/checkmate/templates/client-ingress.yaml @@ -11,6 +11,12 @@ metadata: {{- end }} spec: ingressClassName: {{ .Values.client.ingress.className }} + {{- if .Values.client.ingress.tls.enabled }} + tls: + - hosts: + - {{ .Values.client.ingress.host }} + secretName: {{ .Values.client.ingress.tls.secretName }} + {{- end }} rules: - host: {{ .Values.client.ingress.host }} http: diff --git a/charts/helm/checkmate/templates/server-ingress.yaml b/charts/helm/checkmate/templates/server-ingress.yaml index 6e2d0d4d6..92201714a 100644 --- a/charts/helm/checkmate/templates/server-ingress.yaml +++ b/charts/helm/checkmate/templates/server-ingress.yaml @@ -18,6 +18,12 @@ metadata: #nginx.ingress.kubernetes.io/cors-allow-credentials: "true"*/}} spec: ingressClassName: {{ .Values.server.ingress.className }} + {{- if .Values.server.ingress.tls.enabled }} + tls: + - hosts: + - {{ .Values.server.ingress.host }} + secretName: {{ .Values.server.ingress.tls.secretName }} + {{- end }} rules: - host: {{ .Values.server.ingress.host }} http: diff --git a/charts/helm/checkmate/values.yaml b/charts/helm/checkmate/values.yaml index a1a1527de..dee532327 100644 --- a/charts/helm/checkmate/values.yaml +++ b/charts/helm/checkmate/values.yaml @@ -7,6 +7,13 @@ client: host: change_me className: nginx annotations: {} + # Example annotations for cert-manager: + # annotations: + # cert-manager.io/cluster-issuer: "letsencrypt-prod" + tls: + enabled: false + secretName: checkmate-client-tls + # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation server: image: ghcr.io/bluewave-labs/checkmate-backend:v3.2.0 @@ -17,6 +24,13 @@ server: host: change_me className: nginx annotations: {} + # Example annotations for cert-manager: + # annotations: + # cert-manager.io/cluster-issuer: "letsencrypt-prod" + tls: + enabled: false + secretName: checkmate-server-tls + # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation redis: enabled: false From 7cad2fec2749b1a2a1d471347eaa7f5e773d13b1 Mon Sep 17 00:00:00 2001 From: Craig Lawson Date: Sun, 30 Nov 2025 16:46:06 +0000 Subject: [PATCH 06/11] chore(helm): comment out secretName in TLS config, add usage note for cert-manager --- charts/helm/checkmate/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/helm/checkmate/values.yaml b/charts/helm/checkmate/values.yaml index dee532327..48e312da8 100644 --- a/charts/helm/checkmate/values.yaml +++ b/charts/helm/checkmate/values.yaml @@ -12,7 +12,7 @@ client: # cert-manager.io/cluster-issuer: "letsencrypt-prod" tls: enabled: false - secretName: checkmate-client-tls + # secretName: checkmate-client-tls # Uncomment and set if using TLS with cert-manager # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation server: @@ -29,7 +29,7 @@ server: # cert-manager.io/cluster-issuer: "letsencrypt-prod" tls: enabled: false - secretName: checkmate-server-tls + # secretName: checkmate-server-tls # Uncomment and set if using TLS with cert-manager # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation redis: From c1b3d325f6f167c0d31b49bc8e5bd489a2e521fe Mon Sep 17 00:00:00 2001 From: Craig Lawson Date: Wed, 3 Dec 2025 21:30:35 +0000 Subject: [PATCH 07/11] feat(helm): enforce TLS + protocol validation and improve docs\n\n- Add prechecks.yaml to validate TLS issuer annotations and secretName\n- Require https when TLS enabled; prevent client https + server http mixed content\n- Validate client.protocol in addition to server.protocol\n- Update INSTALLATION.md to set protocol: https when enabling TLS\n- Clarify values.yaml comments for TLS usage --- charts/helm/checkmate/INSTALLATION.md | 4 +- .../helm/checkmate/templates/_prechecks.yaml | 33 ++++++++++- .../helm/checkmate/templates/prechecks.yaml | 55 +++++++++++++++++++ charts/helm/checkmate/values.yaml | 4 ++ 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 charts/helm/checkmate/templates/prechecks.yaml diff --git a/charts/helm/checkmate/INSTALLATION.md b/charts/helm/checkmate/INSTALLATION.md index c4586cd85..74e58c097 100644 --- a/charts/helm/checkmate/INSTALLATION.md +++ b/charts/helm/checkmate/INSTALLATION.md @@ -53,10 +53,11 @@ If you have [cert-manager](https://cert-manager.io/) installed in your cluster, ### Configuration -Edit `values.yaml` to enable TLS: +Edit `values.yaml` to enable TLS (and update protocols to https): ```yaml client: + protocol: https ingress: enabled: true host: checkmate.example.com @@ -68,6 +69,7 @@ client: secretName: checkmate-client-tls server: + protocol: https ingress: enabled: true host: checkmate.example.com diff --git a/charts/helm/checkmate/templates/_prechecks.yaml b/charts/helm/checkmate/templates/_prechecks.yaml index 870ab5c77..235bc0b8f 100644 --- a/charts/helm/checkmate/templates/_prechecks.yaml +++ b/charts/helm/checkmate/templates/_prechecks.yaml @@ -6,7 +6,36 @@ {{- fail "server.ingress.host must be overridden and not set to 'change_me'" }} {{- end }} -{{- $protocol := .Values.server.protocol }} -{{- if not (or (eq $protocol "http") (eq $protocol "https")) }} +{{- $serverProtocol := .Values.server.protocol }} +{{- if not (or (eq $serverProtocol "http") (eq $serverProtocol "https")) }} {{- fail "server.protocol must be either 'http' or 'https'" }} {{- end }} + +{{- $clientProtocol := .Values.client.protocol }} +{{- if not (or (eq $clientProtocol "http") (eq $clientProtocol "https")) }} + {{- fail "client.protocol must be either 'http' or 'https'" }} +{{- end }} + +{{/* Enforce protocol when TLS is enabled to avoid mixed-content */}} +{{- if and .Values.client.ingress.tls.enabled (ne $clientProtocol "https") }} + {{- fail "client.ingress.tls.enabled is true but client.protocol is not 'https'. Set client.protocol: https to avoid mixed content." }} +{{- end }} + +{{- if and .Values.server.ingress.tls.enabled (ne $serverProtocol "https") }} + {{- fail "server.ingress.tls.enabled is true but server.protocol is not 'https'. Set server.protocol: https to ensure correct API base URL." }} +{{- end }} + +{{/* Fail early if TLS enabled without cert-manager annotations (cluster-issuer or issuer) */}} +{{- $cAnn := .Values.client.ingress.annotations | default dict }} +{{- $sAnn := .Values.server.ingress.annotations | default dict }} + +{{- $clientHasIssuer := or (hasKey $cAnn "cert-manager.io/cluster-issuer") (hasKey $cAnn "cert-manager.io/issuer") }} +{{- $serverHasIssuer := or (hasKey $sAnn "cert-manager.io/cluster-issuer") (hasKey $sAnn "cert-manager.io/issuer") }} + +{{- if and .Values.client.ingress.tls.enabled (not $clientHasIssuer) }} + {{- fail "client.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} +{{- end }} + +{{- if and .Values.server.ingress.tls.enabled (not $serverHasIssuer) }} + {{- fail "server.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} +{{- end }} diff --git a/charts/helm/checkmate/templates/prechecks.yaml b/charts/helm/checkmate/templates/prechecks.yaml new file mode 100644 index 000000000..d9264d60c --- /dev/null +++ b/charts/helm/checkmate/templates/prechecks.yaml @@ -0,0 +1,55 @@ +{{- if eq .Values.client.ingress.host "change_me" }} + {{- fail "client.ingress.host must be overridden and not set to 'change_me'" }} +{{- end }} + +{{- if eq .Values.server.ingress.host "change_me" }} + {{- fail "server.ingress.host must be overridden and not set to 'change_me'" }} +{{- end }} + +{{- $serverProtocol := .Values.server.protocol }} +{{- if not (or (eq $serverProtocol "http") (eq $serverProtocol "https")) }} + {{- fail "server.protocol must be either 'http' or 'https'" }} +{{- end }} + +{{- $clientProtocol := .Values.client.protocol }} +{{- if not (or (eq $clientProtocol "http") (eq $clientProtocol "https")) }} + {{- fail "client.protocol must be either 'http' or 'https'" }} +{{- end }} + +{{/* Enforce protocol when TLS is enabled to avoid mixed-content */}} +{{- if and .Values.client.ingress.tls.enabled (ne $clientProtocol "https") }} + {{- fail "client.ingress.tls.enabled is true but client.protocol is not 'https'. Set client.protocol: https to avoid mixed content." }} +{{- end }} + +{{- if and .Values.server.ingress.tls.enabled (ne $serverProtocol "https") }} + {{- fail "server.ingress.tls.enabled is true but server.protocol is not 'https'. Set server.protocol: https to ensure correct API base URL." }} +{{- end }} + +{{/* If client runs on https, API must also be https to avoid mixed content */}} +{{- if and (eq $clientProtocol "https") (ne $serverProtocol "https") }} + {{- fail "client.protocol is 'https' but server.protocol is not. Set server.protocol: https to prevent browser mixed-content issues." }} +{{- end }} + +{{/* Fail early if TLS enabled without cert-manager annotations (cluster-issuer or issuer) */}} +{{- $cAnn := .Values.client.ingress.annotations | default dict }} +{{- $sAnn := .Values.server.ingress.annotations | default dict }} + +{{- $clientHasIssuer := or (hasKey $cAnn "cert-manager.io/cluster-issuer") (hasKey $cAnn "cert-manager.io/issuer") }} +{{- $serverHasIssuer := or (hasKey $sAnn "cert-manager.io/cluster-issuer") (hasKey $sAnn "cert-manager.io/issuer") }} + +{{- if and .Values.client.ingress.tls.enabled (not $clientHasIssuer) }} + {{- fail "client.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} +{{- end }} + +{{- if and .Values.server.ingress.tls.enabled (not $serverHasIssuer) }} + {{- fail "server.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} +{{- end }} + +{{/* Secret name must be set when TLS is enabled (Ingress requires it) */}} +{{- if and .Values.client.ingress.tls.enabled (not .Values.client.ingress.tls.secretName) }} + {{- fail "client.ingress.tls.enabled is true but client.ingress.tls.secretName is empty. Set a secretName for cert-manager to manage." }} +{{- end }} + +{{- if and .Values.server.ingress.tls.enabled (not .Values.server.ingress.tls.secretName) }} + {{- fail "server.ingress.tls.enabled is true but server.ingress.tls.secretName is empty. Set a secretName for cert-manager to manage." }} +{{- end }} diff --git a/charts/helm/checkmate/values.yaml b/charts/helm/checkmate/values.yaml index 48e312da8..5ca09a007 100644 --- a/charts/helm/checkmate/values.yaml +++ b/charts/helm/checkmate/values.yaml @@ -13,6 +13,8 @@ client: tls: enabled: false # secretName: checkmate-client-tls # Uncomment and set if using TLS with cert-manager + # Note: when enabling TLS, also set client.protocol: https and add + # a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod"). # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation server: @@ -30,6 +32,8 @@ server: tls: enabled: false # secretName: checkmate-server-tls # Uncomment and set if using TLS with cert-manager + # Note: when enabling TLS, also set server.protocol: https and add + # a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod"). # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation redis: From ac901b46c37d5c0a6697c9befa36f0cb0d491b5e Mon Sep 17 00:00:00 2001 From: Craig Lawson Date: Wed, 3 Dec 2025 21:43:21 +0000 Subject: [PATCH 08/11] chore(helm): default TLS secretName to -* and remove duplicate prechecks file; update docs with protocol flags --- charts/helm/checkmate/INSTALLATION.md | 2 + .../helm/checkmate/templates/_prechecks.yaml | 41 ------------------- .../checkmate/templates/client-ingress.yaml | 2 +- .../helm/checkmate/templates/prechecks.yaml | 9 +--- .../checkmate/templates/server-ingress.yaml | 2 +- charts/helm/checkmate/values.yaml | 4 +- 6 files changed, 7 insertions(+), 53 deletions(-) delete mode 100644 charts/helm/checkmate/templates/_prechecks.yaml diff --git a/charts/helm/checkmate/INSTALLATION.md b/charts/helm/checkmate/INSTALLATION.md index 74e58c097..06cf9f7b9 100644 --- a/charts/helm/checkmate/INSTALLATION.md +++ b/charts/helm/checkmate/INSTALLATION.md @@ -87,6 +87,8 @@ You can also enable TLS during installation using Helm's `--set` flags: ```bash helm install checkmate ./charts/helm/checkmate \ + --set client.protocol=https \ + --set server.protocol=https \ --set client.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \ --set client.ingress.tls.enabled=true \ --set client.ingress.tls.secretName=checkmate-client-tls \ diff --git a/charts/helm/checkmate/templates/_prechecks.yaml b/charts/helm/checkmate/templates/_prechecks.yaml deleted file mode 100644 index 235bc0b8f..000000000 --- a/charts/helm/checkmate/templates/_prechecks.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if eq .Values.client.ingress.host "change_me" }} - {{- fail "client.ingress.host must be overridden and not set to 'change_me'" }} -{{- end }} - -{{- if eq .Values.server.ingress.host "change_me" }} - {{- fail "server.ingress.host must be overridden and not set to 'change_me'" }} -{{- end }} - -{{- $serverProtocol := .Values.server.protocol }} -{{- if not (or (eq $serverProtocol "http") (eq $serverProtocol "https")) }} - {{- fail "server.protocol must be either 'http' or 'https'" }} -{{- end }} - -{{- $clientProtocol := .Values.client.protocol }} -{{- if not (or (eq $clientProtocol "http") (eq $clientProtocol "https")) }} - {{- fail "client.protocol must be either 'http' or 'https'" }} -{{- end }} - -{{/* Enforce protocol when TLS is enabled to avoid mixed-content */}} -{{- if and .Values.client.ingress.tls.enabled (ne $clientProtocol "https") }} - {{- fail "client.ingress.tls.enabled is true but client.protocol is not 'https'. Set client.protocol: https to avoid mixed content." }} -{{- end }} - -{{- if and .Values.server.ingress.tls.enabled (ne $serverProtocol "https") }} - {{- fail "server.ingress.tls.enabled is true but server.protocol is not 'https'. Set server.protocol: https to ensure correct API base URL." }} -{{- end }} - -{{/* Fail early if TLS enabled without cert-manager annotations (cluster-issuer or issuer) */}} -{{- $cAnn := .Values.client.ingress.annotations | default dict }} -{{- $sAnn := .Values.server.ingress.annotations | default dict }} - -{{- $clientHasIssuer := or (hasKey $cAnn "cert-manager.io/cluster-issuer") (hasKey $cAnn "cert-manager.io/issuer") }} -{{- $serverHasIssuer := or (hasKey $sAnn "cert-manager.io/cluster-issuer") (hasKey $sAnn "cert-manager.io/issuer") }} - -{{- if and .Values.client.ingress.tls.enabled (not $clientHasIssuer) }} - {{- fail "client.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} -{{- end }} - -{{- if and .Values.server.ingress.tls.enabled (not $serverHasIssuer) }} - {{- fail "server.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} -{{- end }} diff --git a/charts/helm/checkmate/templates/client-ingress.yaml b/charts/helm/checkmate/templates/client-ingress.yaml index 5965edfed..4fe126ea6 100644 --- a/charts/helm/checkmate/templates/client-ingress.yaml +++ b/charts/helm/checkmate/templates/client-ingress.yaml @@ -15,7 +15,7 @@ spec: tls: - hosts: - {{ .Values.client.ingress.host }} - secretName: {{ .Values.client.ingress.tls.secretName }} + secretName: {{ default (printf "%s-client-tls" .Release.Name) .Values.client.ingress.tls.secretName }} {{- end }} rules: - host: {{ .Values.client.ingress.host }} diff --git a/charts/helm/checkmate/templates/prechecks.yaml b/charts/helm/checkmate/templates/prechecks.yaml index d9264d60c..e2b9ec5c2 100644 --- a/charts/helm/checkmate/templates/prechecks.yaml +++ b/charts/helm/checkmate/templates/prechecks.yaml @@ -45,11 +45,4 @@ {{- fail "server.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }} {{- end }} -{{/* Secret name must be set when TLS is enabled (Ingress requires it) */}} -{{- if and .Values.client.ingress.tls.enabled (not .Values.client.ingress.tls.secretName) }} - {{- fail "client.ingress.tls.enabled is true but client.ingress.tls.secretName is empty. Set a secretName for cert-manager to manage." }} -{{- end }} - -{{- if and .Values.server.ingress.tls.enabled (not .Values.server.ingress.tls.secretName) }} - {{- fail "server.ingress.tls.enabled is true but server.ingress.tls.secretName is empty. Set a secretName for cert-manager to manage." }} -{{- end }} +{{/* Secret name can be omitted; we default to -client|server-tls in templates */}} diff --git a/charts/helm/checkmate/templates/server-ingress.yaml b/charts/helm/checkmate/templates/server-ingress.yaml index 92201714a..34c9ac0dc 100644 --- a/charts/helm/checkmate/templates/server-ingress.yaml +++ b/charts/helm/checkmate/templates/server-ingress.yaml @@ -22,7 +22,7 @@ spec: tls: - hosts: - {{ .Values.server.ingress.host }} - secretName: {{ .Values.server.ingress.tls.secretName }} + secretName: {{ default (printf "%s-server-tls" .Release.Name) .Values.server.ingress.tls.secretName }} {{- end }} rules: - host: {{ .Values.server.ingress.host }} diff --git a/charts/helm/checkmate/values.yaml b/charts/helm/checkmate/values.yaml index 5ca09a007..9a586dd54 100644 --- a/charts/helm/checkmate/values.yaml +++ b/charts/helm/checkmate/values.yaml @@ -12,7 +12,7 @@ client: # cert-manager.io/cluster-issuer: "letsencrypt-prod" tls: enabled: false - # secretName: checkmate-client-tls # Uncomment and set if using TLS with cert-manager + # secretName: {{ .Release.Name }}-client-tls # Optional; defaults to -client-tls if omitted # Note: when enabling TLS, also set client.protocol: https and add # a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod"). # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation @@ -31,7 +31,7 @@ server: # cert-manager.io/cluster-issuer: "letsencrypt-prod" tls: enabled: false - # secretName: checkmate-server-tls # Uncomment and set if using TLS with cert-manager + # secretName: {{ .Release.Name }}-server-tls # Optional; defaults to -server-tls if omitted # Note: when enabling TLS, also set server.protocol: https and add # a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod"). # The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation From 72bcc0d0200b4f2b1e83b4c27e2c5a585cb7fa93 Mon Sep 17 00:00:00 2001 From: Sajanpreet Singh Date: Thu, 4 Dec 2025 10:31:45 -0600 Subject: [PATCH 09/11] Remove business V2 logic --- .../src/Components/v2/ActionsMenu/index.tsx | 53 -- client/src/Components/v2/Arrows/ArrowLeft.tsx | 36 -- .../src/Components/v2/Arrows/ArrowRight.tsx | 28 -- .../src/Components/v2/Auth/AuthBasePage.tsx | 48 -- client/src/Components/v2/Auth/HeaderAuth.jsx | 26 - client/src/Components/v2/Auth/index.jsx | 2 - .../Components/v2/DesignElements/BaseBox.tsx | 23 - .../Components/v2/DesignElements/BasePage.tsx | 80 --- .../v2/DesignElements/BulletPointCheck.tsx | 45 -- .../src/Components/v2/DesignElements/Dot.tsx | 23 - .../Components/v2/DesignElements/Fallback.tsx | 158 ------ .../Components/v2/DesignElements/PulseDot.tsx | 44 -- .../Components/v2/DesignElements/SplitBox.tsx | 68 --- .../Components/v2/DesignElements/StatBox.tsx | 57 --- .../v2/DesignElements/StatusBox.tsx | 100 ---- .../v2/DesignElements/StatusLabel.tsx | 41 -- .../Components/v2/DesignElements/Table.tsx | 215 -------- .../Components/v2/DesignElements/index.tsx | 9 - .../src/Components/v2/Inputs/AutoComplete.tsx | 48 -- client/src/Components/v2/Inputs/Button.tsx | 11 - .../src/Components/v2/Inputs/ButtonGroup.tsx | 13 - client/src/Components/v2/Inputs/Checkbox.tsx | 23 - .../Components/v2/Inputs/LanguageSelector.tsx | 64 --- .../src/Components/v2/Inputs/RadioInput.tsx | 66 --- client/src/Components/v2/Inputs/Select.tsx | 88 ---- client/src/Components/v2/Inputs/TextInput.tsx | 22 - client/src/Components/v2/Inputs/TextLink.tsx | 37 -- .../src/Components/v2/Inputs/ThemeSwitch.tsx | 135 ----- client/src/Components/v2/Inputs/index.tsx | 7 - .../src/Components/v2/Layouts/RootLayout.tsx | 23 - .../v2/Layouts/Sidebar/BottomControls.tsx | 16 - .../v2/Layouts/Sidebar/CollapseButton.tsx | 50 -- .../Components/v2/Layouts/Sidebar/Logo.tsx | 59 --- .../Components/v2/Layouts/Sidebar/Menu.tsx | 58 --- .../Components/v2/Layouts/Sidebar/NavItem.tsx | 103 ---- .../Components/v2/Layouts/Sidebar/index.tsx | 106 ---- .../v2/Monitors/ChartAvgResponse.tsx | 84 ---- .../v2/Monitors/ChartResponseTime.tsx | 163 ------ .../Components/v2/Monitors/HeaderControls.tsx | 67 --- .../Components/v2/Monitors/HeaderCreate.tsx | 35 -- .../Components/v2/Monitors/HeaderRange.tsx | 62 --- .../v2/Monitors/HistogramResponseTime.tsx | 87 ---- .../Monitors/HistogramResponseTimeTooltip.tsx | 29 -- .../v2/Monitors/HistogramStatus.tsx | 218 -------- .../Components/v2/Monitors/MonitorStatus.tsx | 60 --- client/src/Components/v2/Monitors/index.tsx | 1 - client/src/Features/Auth/v2AuthSlice.ts | 19 - client/src/Hooks/v2/UseApi.tsx | 90 ---- client/src/Hooks/v2/useInitMonitorForm.tsx | 17 - client/src/Pages/v2/Auth/Login.tsx | 136 ----- client/src/Pages/v2/Auth/Register.tsx | 177 ------- client/src/Pages/v2/Uptime/CheckTable.tsx | 93 ---- client/src/Pages/v2/Uptime/Configure.tsx | 43 -- client/src/Pages/v2/Uptime/Create.tsx | 262 ---------- client/src/Pages/v2/Uptime/Details.tsx | 157 ------ client/src/Pages/v2/Uptime/MonitorTable.tsx | 158 ------ client/src/Pages/v2/Uptime/UptimeForm.tsx | 247 --------- client/src/Pages/v2/Uptime/UptimeMonitors.tsx | 74 --- client/src/Routes/index.jsx | 8 - client/src/Routes/v2router.tsx | 52 -- client/src/Utils/Theme/v2/palette.ts | 124 ----- client/src/Utils/Theme/v2/theme.ts | 103 ---- client/src/Utils/v2/ApiClient.ts | 26 - client/src/Utils/v2/DataUtils.ts | 37 -- client/src/Utils/v2/MonitorUtils.ts | 38 -- client/src/Utils/v2/TimeUtils.ts | 53 -- client/src/Validation/v2/zod.ts | 36 -- client/src/store.js | 4 +- server/src/config/controllers.js | 15 - server/src/config/routes.js | 23 - server/src/config/services.js | 68 --- server/src/controllers/v2/AuthController.ts | 150 ------ server/src/controllers/v2/InviteController.ts | 62 --- .../controllers/v2/MaintenanceController.ts | 96 ---- .../src/controllers/v2/MonitorController.ts | 191 ------- .../v2/NotificationChannelController.ts | 96 ---- server/src/controllers/v2/QueueController.ts | 29 -- server/src/db/v2/index.ts | 25 - server/src/db/v2/models/auth/Role.ts | 50 -- server/src/db/v2/models/auth/User.ts | 102 ---- server/src/db/v2/models/checks/Check.ts | 297 ----------- server/src/db/v2/models/index.ts | 33 -- server/src/db/v2/models/invite/Invite.ts | 43 -- .../db/v2/models/maintenance/Maintenance.ts | 39 -- server/src/db/v2/models/monitors/Monitor.ts | 96 ---- .../src/db/v2/models/monitors/MonitorStats.ts | 77 --- .../NotificationChannel.ts | 50 -- server/src/middleware/v2/VerifyPermissions.ts | 77 --- server/src/middleware/v2/VerifyToken.ts | 21 - server/src/routes/v2/auth.ts | 33 -- server/src/routes/v2/invite.ts | 30 -- server/src/routes/v2/maintenance.ts | 34 -- server/src/routes/v2/monitors.ts | 36 -- server/src/routes/v2/notificationChannels.ts | 34 -- server/src/routes/v2/queue.ts | 24 - server/src/service/v2/business/AuthService.ts | 210 -------- .../src/service/v2/business/CheckService.ts | 147 ------ .../src/service/v2/business/InviteService.ts | 63 --- .../service/v2/business/MaintenanceService.ts | 144 ------ .../src/service/v2/business/MonitorService.ts | 468 ------------------ .../v2/business/MonitorStatsService.ts | 28 -- .../v2/business/NotificationChannelService.ts | 104 ---- .../src/service/v2/business/QueueService.ts | 26 - server/src/service/v2/business/UserService.ts | 15 - .../service/v2/infrastructure/JobGenerator.ts | 82 --- .../src/service/v2/infrastructure/JobQueue.ts | 231 --------- .../v2/infrastructure/NetworkService.ts | 197 -------- .../v2/infrastructure/NotificationService.ts | 61 --- .../NotificationServices/Discord.ts | 76 --- .../NotificationServices/Email.ts | 68 --- .../NotificationServices/IMessageService.ts | 15 - .../NotificationServices/Slack.ts | 118 ----- .../NotificationServices/Webhook.ts | 47 -- .../NotificationServices/index.ts | 5 - .../v2/infrastructure/StatusService.ts | 102 ---- server/src/types/index.ts | 1 - .../src/types/monitor-response-with-checks.ts | 11 - 117 files changed, 1 insertion(+), 8794 deletions(-) delete mode 100644 client/src/Components/v2/ActionsMenu/index.tsx delete mode 100644 client/src/Components/v2/Arrows/ArrowLeft.tsx delete mode 100644 client/src/Components/v2/Arrows/ArrowRight.tsx delete mode 100644 client/src/Components/v2/Auth/AuthBasePage.tsx delete mode 100644 client/src/Components/v2/Auth/HeaderAuth.jsx delete mode 100644 client/src/Components/v2/Auth/index.jsx delete mode 100644 client/src/Components/v2/DesignElements/BaseBox.tsx delete mode 100644 client/src/Components/v2/DesignElements/BasePage.tsx delete mode 100644 client/src/Components/v2/DesignElements/BulletPointCheck.tsx delete mode 100644 client/src/Components/v2/DesignElements/Dot.tsx delete mode 100644 client/src/Components/v2/DesignElements/Fallback.tsx delete mode 100644 client/src/Components/v2/DesignElements/PulseDot.tsx delete mode 100644 client/src/Components/v2/DesignElements/SplitBox.tsx delete mode 100644 client/src/Components/v2/DesignElements/StatBox.tsx delete mode 100644 client/src/Components/v2/DesignElements/StatusBox.tsx delete mode 100644 client/src/Components/v2/DesignElements/StatusLabel.tsx delete mode 100644 client/src/Components/v2/DesignElements/Table.tsx delete mode 100644 client/src/Components/v2/DesignElements/index.tsx delete mode 100644 client/src/Components/v2/Inputs/AutoComplete.tsx delete mode 100644 client/src/Components/v2/Inputs/Button.tsx delete mode 100644 client/src/Components/v2/Inputs/ButtonGroup.tsx delete mode 100644 client/src/Components/v2/Inputs/Checkbox.tsx delete mode 100644 client/src/Components/v2/Inputs/LanguageSelector.tsx delete mode 100644 client/src/Components/v2/Inputs/RadioInput.tsx delete mode 100644 client/src/Components/v2/Inputs/Select.tsx delete mode 100644 client/src/Components/v2/Inputs/TextInput.tsx delete mode 100644 client/src/Components/v2/Inputs/TextLink.tsx delete mode 100644 client/src/Components/v2/Inputs/ThemeSwitch.tsx delete mode 100644 client/src/Components/v2/Inputs/index.tsx delete mode 100644 client/src/Components/v2/Layouts/RootLayout.tsx delete mode 100644 client/src/Components/v2/Layouts/Sidebar/BottomControls.tsx delete mode 100644 client/src/Components/v2/Layouts/Sidebar/CollapseButton.tsx delete mode 100644 client/src/Components/v2/Layouts/Sidebar/Logo.tsx delete mode 100644 client/src/Components/v2/Layouts/Sidebar/Menu.tsx delete mode 100644 client/src/Components/v2/Layouts/Sidebar/NavItem.tsx delete mode 100644 client/src/Components/v2/Layouts/Sidebar/index.tsx delete mode 100644 client/src/Components/v2/Monitors/ChartAvgResponse.tsx delete mode 100644 client/src/Components/v2/Monitors/ChartResponseTime.tsx delete mode 100644 client/src/Components/v2/Monitors/HeaderControls.tsx delete mode 100644 client/src/Components/v2/Monitors/HeaderCreate.tsx delete mode 100644 client/src/Components/v2/Monitors/HeaderRange.tsx delete mode 100644 client/src/Components/v2/Monitors/HistogramResponseTime.tsx delete mode 100644 client/src/Components/v2/Monitors/HistogramResponseTimeTooltip.tsx delete mode 100644 client/src/Components/v2/Monitors/HistogramStatus.tsx delete mode 100644 client/src/Components/v2/Monitors/MonitorStatus.tsx delete mode 100644 client/src/Components/v2/Monitors/index.tsx delete mode 100644 client/src/Features/Auth/v2AuthSlice.ts delete mode 100644 client/src/Hooks/v2/UseApi.tsx delete mode 100644 client/src/Hooks/v2/useInitMonitorForm.tsx delete mode 100644 client/src/Pages/v2/Auth/Login.tsx delete mode 100644 client/src/Pages/v2/Auth/Register.tsx delete mode 100644 client/src/Pages/v2/Uptime/CheckTable.tsx delete mode 100644 client/src/Pages/v2/Uptime/Configure.tsx delete mode 100644 client/src/Pages/v2/Uptime/Create.tsx delete mode 100644 client/src/Pages/v2/Uptime/Details.tsx delete mode 100644 client/src/Pages/v2/Uptime/MonitorTable.tsx delete mode 100644 client/src/Pages/v2/Uptime/UptimeForm.tsx delete mode 100644 client/src/Pages/v2/Uptime/UptimeMonitors.tsx delete mode 100644 client/src/Routes/v2router.tsx delete mode 100644 client/src/Utils/Theme/v2/palette.ts delete mode 100644 client/src/Utils/Theme/v2/theme.ts delete mode 100644 client/src/Utils/v2/ApiClient.ts delete mode 100644 client/src/Utils/v2/DataUtils.ts delete mode 100644 client/src/Utils/v2/MonitorUtils.ts delete mode 100644 client/src/Utils/v2/TimeUtils.ts delete mode 100644 client/src/Validation/v2/zod.ts delete mode 100644 server/src/controllers/v2/AuthController.ts delete mode 100644 server/src/controllers/v2/InviteController.ts delete mode 100644 server/src/controllers/v2/MaintenanceController.ts delete mode 100644 server/src/controllers/v2/MonitorController.ts delete mode 100644 server/src/controllers/v2/NotificationChannelController.ts delete mode 100644 server/src/controllers/v2/QueueController.ts delete mode 100644 server/src/db/v2/index.ts delete mode 100644 server/src/db/v2/models/auth/Role.ts delete mode 100644 server/src/db/v2/models/auth/User.ts delete mode 100644 server/src/db/v2/models/checks/Check.ts delete mode 100644 server/src/db/v2/models/index.ts delete mode 100644 server/src/db/v2/models/invite/Invite.ts delete mode 100644 server/src/db/v2/models/maintenance/Maintenance.ts delete mode 100644 server/src/db/v2/models/monitors/Monitor.ts delete mode 100644 server/src/db/v2/models/monitors/MonitorStats.ts delete mode 100644 server/src/db/v2/models/notification-channel/NotificationChannel.ts delete mode 100644 server/src/middleware/v2/VerifyPermissions.ts delete mode 100644 server/src/middleware/v2/VerifyToken.ts delete mode 100644 server/src/routes/v2/auth.ts delete mode 100644 server/src/routes/v2/invite.ts delete mode 100644 server/src/routes/v2/maintenance.ts delete mode 100644 server/src/routes/v2/monitors.ts delete mode 100644 server/src/routes/v2/notificationChannels.ts delete mode 100644 server/src/routes/v2/queue.ts delete mode 100644 server/src/service/v2/business/AuthService.ts delete mode 100644 server/src/service/v2/business/CheckService.ts delete mode 100644 server/src/service/v2/business/InviteService.ts delete mode 100644 server/src/service/v2/business/MaintenanceService.ts delete mode 100644 server/src/service/v2/business/MonitorService.ts delete mode 100644 server/src/service/v2/business/MonitorStatsService.ts delete mode 100644 server/src/service/v2/business/NotificationChannelService.ts delete mode 100644 server/src/service/v2/business/QueueService.ts delete mode 100644 server/src/service/v2/business/UserService.ts delete mode 100644 server/src/service/v2/infrastructure/JobGenerator.ts delete mode 100644 server/src/service/v2/infrastructure/JobQueue.ts delete mode 100644 server/src/service/v2/infrastructure/NetworkService.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationService.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationServices/Discord.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationServices/Email.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationServices/IMessageService.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationServices/Slack.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationServices/Webhook.ts delete mode 100644 server/src/service/v2/infrastructure/NotificationServices/index.ts delete mode 100644 server/src/service/v2/infrastructure/StatusService.ts delete mode 100644 server/src/types/index.ts delete mode 100644 server/src/types/monitor-response-with-checks.ts diff --git a/client/src/Components/v2/ActionsMenu/index.tsx b/client/src/Components/v2/ActionsMenu/index.tsx deleted file mode 100644 index a143be3f5..000000000 --- a/client/src/Components/v2/ActionsMenu/index.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useState } from "react"; -import Menu from "@mui/material/Menu"; -import MenuItem from "@mui/material/MenuItem"; -import IconButton from "@mui/material/IconButton"; -import Settings from "@/assets/icons/settings-bold.svg?react"; - -export type ActionMenuItem = { - id: number | string; - label: React.ReactNode; - action: Function; - closeMenu?: boolean; -}; - -export const ActionsMenu = ({ items }: { items: ActionMenuItem[] }) => { - const [anchorEl, setAnchorEl] = useState(null); - const open = Boolean(anchorEl); - - const handleClick = (e: React.MouseEvent) => { - e.stopPropagation(); - setAnchorEl(e.currentTarget); - }; - - const handleClose = (e: React.MouseEvent) => { - e.stopPropagation(); - setAnchorEl(null); - }; - - return ( -
- - - - - {items.map((item) => ( - ) => { - e.stopPropagation(); - if (item.closeMenu) handleClose(e); - item.action(); - }} - > - {item.label} - - ))} - -
- ); -}; diff --git a/client/src/Components/v2/Arrows/ArrowLeft.tsx b/client/src/Components/v2/Arrows/ArrowLeft.tsx deleted file mode 100644 index 01d1342c8..000000000 --- a/client/src/Components/v2/Arrows/ArrowLeft.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import LeftArrow from "@/assets/icons/left-arrow.svg?react"; -import LeftArrowDouble from "@/assets/icons/left-arrow-double.svg?react"; -import LeftArrowLong from "@/assets/icons/left-arrow-long.svg?react"; - -export const ArrowLeft = ({ - type, - color = "#667085", - ...props -}: { - type?: string; - color?: string | undefined; - [key: string]: any; -}) => { - if (type === "double") { - return ( - - ); - } else if (type === "long") { - return ( - - ); - } else { - return ( - - ); - } -}; diff --git a/client/src/Components/v2/Arrows/ArrowRight.tsx b/client/src/Components/v2/Arrows/ArrowRight.tsx deleted file mode 100644 index c73165f16..000000000 --- a/client/src/Components/v2/Arrows/ArrowRight.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import RightArrow from "@/assets/icons/right-arrow.svg?react"; -import RightArrowDouble from "@/assets/icons/right-arrow-double.svg?react"; - -export const ArrowRight = ({ - type, - color = "#667085", - ...props -}: { - type?: string; - color?: string | undefined; - [key: string]: any; -}) => { - if (type === "double") { - return ( - - ); - } else { - return ( - - ); - } -}; diff --git a/client/src/Components/v2/Auth/AuthBasePage.tsx b/client/src/Components/v2/Auth/AuthBasePage.tsx deleted file mode 100644 index ba4230a6d..000000000 --- a/client/src/Components/v2/Auth/AuthBasePage.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Box from "@mui/material/Box"; -import { HeaderAuth } from "@/Components/v2/Auth"; -import Logo from "@/assets/icons/checkmate-icon.svg?react"; - -import type { StackProps } from "@mui/material/Stack"; -import { useTheme } from "@mui/material/styles"; -import { Typography } from "@mui/material"; - -interface AuthBasePageProps extends StackProps { - title?: string; - subtitle?: string; - children: React.ReactNode; -} - -export const AuthBasePage: React.FC = ({ - children, - title, - subtitle, - ...props -}) => { - const theme = useTheme(); - return ( - - - - - - - {title} - {subtitle} - {children} - - - ); -}; diff --git a/client/src/Components/v2/Auth/HeaderAuth.jsx b/client/src/Components/v2/Auth/HeaderAuth.jsx deleted file mode 100644 index 4e437cd7e..000000000 --- a/client/src/Components/v2/Auth/HeaderAuth.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import Logo from "@/assets/icons/checkmate-icon.svg?react"; - -import { useTheme } from "@mui/material/styles"; -import { useTranslation } from "react-i18next"; -import { LanguageSelector, ThemeSwitch } from "@/Components/v2/Inputs"; - -export const HeaderAuth = () => { - const theme = useTheme(); - const { t } = useTranslation(); - return ( - - - - - ); -}; diff --git a/client/src/Components/v2/Auth/index.jsx b/client/src/Components/v2/Auth/index.jsx deleted file mode 100644 index 84b742113..000000000 --- a/client/src/Components/v2/Auth/index.jsx +++ /dev/null @@ -1,2 +0,0 @@ -export { HeaderAuth } from "./HeaderAuth"; -export { AuthBasePage } from "./AuthBasePage"; diff --git a/client/src/Components/v2/DesignElements/BaseBox.tsx b/client/src/Components/v2/DesignElements/BaseBox.tsx deleted file mode 100644 index 14c4af1c4..000000000 --- a/client/src/Components/v2/DesignElements/BaseBox.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import Box from "@mui/material/Box"; -import { useTheme } from "@mui/material/styles"; -import type { SxProps } from "@mui/material/styles"; - -type BaseBoxProps = React.PropsWithChildren<{ sx?: SxProps }>; - -export const BaseBox: React.FC = ({ children, sx }) => { - const theme = useTheme(); - return ( - - {children} - - ); -}; diff --git a/client/src/Components/v2/DesignElements/BasePage.tsx b/client/src/Components/v2/DesignElements/BasePage.tsx deleted file mode 100644 index f458cbb0a..000000000 --- a/client/src/Components/v2/DesignElements/BasePage.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import Stack from "@mui/material/Stack"; -import { ErrorFallback, EmptyFallback } from "./Fallback"; - -import type { StackProps } from "@mui/material/Stack"; -import { useTheme } from "@mui/material/styles"; -import { useTranslation } from "react-i18next"; -interface BasePageProps extends StackProps { - children: React.ReactNode; -} - -export const BasePage: React.FC = ({ - children, - ...props -}: { - children: React.ReactNode; -}) => { - const theme = useTheme(); - return ( - - {children} - - ); -}; - -interface BasePageWithStatesProps extends StackProps { - loading: boolean; - error: any; - items: any[]; - page: string; - actionLink?: string; - children: React.ReactNode; -} - -const isEmpty = (items: any[]) => { - if (!items) return true; - if (Array.isArray(items) && items.length === 0) return true; - return false; -}; - -export const BasePageWithStates: React.FC = ({ - loading, - error, - items, - page, - actionLink, - children, - ...props -}: BasePageWithStatesProps) => { - const { t } = useTranslation(); - - if (loading) { - return null; - } - - if (error) { - return ( - - ); - } - - if (isEmpty(items)) { - return ( - - ); - } - - return {children}; -}; diff --git a/client/src/Components/v2/DesignElements/BulletPointCheck.tsx b/client/src/Components/v2/DesignElements/BulletPointCheck.tsx deleted file mode 100644 index 03147e011..000000000 --- a/client/src/Components/v2/DesignElements/BulletPointCheck.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import CheckOutlined from "@/assets/icons/check-outlined.svg?react"; -import { useTheme } from "@mui/material/styles"; - -export const BulletPointCheck = ({ - text, - variant = "info", -}: { - text: string; - noHighlightText?: string; - variant?: "success" | "error" | "info"; -}) => { - const theme = useTheme(); - const colors: Record = { - success: theme.palette.success.main, - error: theme.palette.error.main, - info: theme.palette.primary.contrastTextSecondary, - }; - - return ( - - - - {text} - - - ); -}; diff --git a/client/src/Components/v2/DesignElements/Dot.tsx b/client/src/Components/v2/DesignElements/Dot.tsx deleted file mode 100644 index ca3884cfb..000000000 --- a/client/src/Components/v2/DesignElements/Dot.tsx +++ /dev/null @@ -1,23 +0,0 @@ -export const Dot = ({ - color = "gray", - size = "4px", - style, -}: { - color?: string; - size?: string; - style?: React.CSSProperties; -}) => { - return ( - - ); -}; diff --git a/client/src/Components/v2/DesignElements/Fallback.tsx b/client/src/Components/v2/DesignElements/Fallback.tsx deleted file mode 100644 index f7b48a113..000000000 --- a/client/src/Components/v2/DesignElements/Fallback.tsx +++ /dev/null @@ -1,158 +0,0 @@ -import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import OutputAnimation from "@/assets/Animations/output.gif"; -import DarkmodeOutput from "@/assets/Animations/darkmodeOutput.gif"; -import Typography from "@mui/material/Typography"; -import { BulletPointCheck } from "@/Components/v2/DesignElements"; -import { Button } from "@/Components/v2/Inputs"; - -import { useNavigate } from "react-router"; -import { useMediaQuery } from "@mui/material"; -import { useTheme } from "@mui/material/styles"; -import { useSelector } from "react-redux"; - -import type { BoxProps } from "@mui/material"; - -interface BaseFallbackProps extends BoxProps { - children: React.ReactNode; -} - -export const BaseFallback: React.FC = ({ children, ...props }) => { - const theme = useTheme(); - const mode = useSelector((state: any) => state.ui.mode); - const isSmall = useMediaQuery(theme.breakpoints.down("md")); - - return ( - - - - - - {children} - - - - ); -}; - -export const ErrorFallback = ({ - title, - subtitle, -}: { - title: string; - subtitle: string; -}) => { - const theme = useTheme(); - return ( - - - {title} - - {subtitle} - - ); -}; - -export const EmptyFallback = ({ - page, - title, - bullets, - actionButtonText, - actionLink, -}: { - page: string; - title: string; - bullets: any; - actionButtonText: string; - actionLink: string; -}) => { - const theme = useTheme(); - const navigate = useNavigate(); - return ( - - - - {title} - - - {bullets?.map((bullet: string, index: number) => ( - - ))} - - - - - - - ); -}; diff --git a/client/src/Components/v2/DesignElements/PulseDot.tsx b/client/src/Components/v2/DesignElements/PulseDot.tsx deleted file mode 100644 index a785b5a0d..000000000 --- a/client/src/Components/v2/DesignElements/PulseDot.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Box from "@mui/material/Box"; -import { useTheme } from "@mui/material/styles"; -export const PulseDot = ({ color }: { color: string }) => { - const theme = useTheme(); - return ( - - - - ); -}; diff --git a/client/src/Components/v2/DesignElements/SplitBox.tsx b/client/src/Components/v2/DesignElements/SplitBox.tsx deleted file mode 100644 index f5a09d8f5..000000000 --- a/client/src/Components/v2/DesignElements/SplitBox.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { Fragment } from "react"; -import Stack from "@mui/material/Stack"; -import Box from "@mui/material/Box"; -import Typography from "@mui/material/Typography"; -import { useTheme } from "@mui/material/styles"; -import { useMediaQuery } from "@mui/material"; -export const SplitBox = ({ - left, - right, -}: { - left: React.ReactNode; - right: React.ReactNode; -}) => { - const theme = useTheme(); - const isSmall = useMediaQuery(theme.breakpoints.down("md")); - return ( - - - {left} - - - {right} - - - ); -}; - -export const ConfigBox = ({ - title, - subtitle, - rightContent, -}: { - title: string; - subtitle: string; - rightContent: React.ReactNode; -}) => { - return ( - - - {title} - - {subtitle} - - } - right={rightContent} - /> - ); -}; diff --git a/client/src/Components/v2/DesignElements/StatBox.tsx b/client/src/Components/v2/DesignElements/StatBox.tsx deleted file mode 100644 index 3450444b2..000000000 --- a/client/src/Components/v2/DesignElements/StatBox.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import { useTheme } from "@mui/material/styles"; -import { useMediaQuery } from "@mui/material"; -import type { PaletteKey } from "@/Utils/Theme/v2/theme"; -import { BaseBox } from "@/Components/v2/DesignElements"; - -type GradientBox = React.PropsWithChildren<{ palette?: PaletteKey }>; - -export const GradientBox: React.FC = ({ children, palette }) => { - const theme = useTheme(); - const isSmall = useMediaQuery(theme.breakpoints.down("md")); - const bg = palette - ? `linear-gradient(to bottom right, ${theme.palette[palette].main} 30%, ${theme.palette[palette].lowContrast} 70%)` - : `linear-gradient(340deg, ${theme.palette.tertiary.main} 10%, ${theme.palette.primary.main} 45%)`; - - return ( - - {children} - - ); -}; - -type StatBoxProps = React.PropsWithChildren<{ - title: string; - subtitle: string; - palette?: PaletteKey; -}>; - -export const StatBox: React.FC = ({ - title, - subtitle, - palette, - children, -}) => { - const theme = useTheme(); - const textColor = palette ? theme.palette[palette].contrastText : "inherit"; - - return ( - - - {title} - {subtitle} - {children} - - - ); -}; diff --git a/client/src/Components/v2/DesignElements/StatusBox.tsx b/client/src/Components/v2/DesignElements/StatusBox.tsx deleted file mode 100644 index 8cd5cfbc1..000000000 --- a/client/src/Components/v2/DesignElements/StatusBox.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import Box from "@mui/material/Box"; -import { BaseBox } from "@/Components/v2/DesignElements"; -import Background from "@/assets/Images/background-grid.svg?react"; -import { useTranslation } from "react-i18next"; - -import { useTheme } from "@mui/material/styles"; - -type StatusBoxProps = React.PropsWithChildren<{}>; - -export const BGBox: React.FC = ({ children }) => { - const theme = useTheme(); - return ( - - - - - {children} - - ); -}; - -const StatusBox = ({ - label, - n, - color, -}: { - label: string; - n: number; - color: string | undefined; -}) => { - const theme = useTheme(); - return ( - - - - {label} - - - {n} - - - - ); -}; - -export const UpStatusBox = ({ n }: { n: number }) => { - const theme = useTheme(); - const { t } = useTranslation(); - return ( - - ); -}; - -export const DownStatusBox = ({ n }: { n: number }) => { - const theme = useTheme(); - const { t } = useTranslation(); - return ( - - ); -}; - -export const PausedStatusBox = ({ n }: { n: number }) => { - const theme = useTheme(); - const { t } = useTranslation(); - return ( - - ); -}; diff --git a/client/src/Components/v2/DesignElements/StatusLabel.tsx b/client/src/Components/v2/DesignElements/StatusLabel.tsx deleted file mode 100644 index e4d288e63..000000000 --- a/client/src/Components/v2/DesignElements/StatusLabel.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import Box from "@mui/material/Box"; -import { BaseBox } from "@/Components/v2/DesignElements"; -import type { MonitorStatus } from "@/Types/Monitor"; - -import { getStatusPalette } from "@/Utils/v2/MonitorUtils"; -import { useTheme } from "@mui/material/styles"; - -export const StatusLabel = ({ - status, - isActive, -}: { - status: MonitorStatus; - isActive?: boolean; -}) => { - const theme = useTheme(); - const palette = getStatusPalette(status); - const transformedText = status.charAt(0).toUpperCase() + status.slice(1).toLowerCase(); - - return ( - - - {isActive === false ? "Paused" : transformedText} - - ); -}; diff --git a/client/src/Components/v2/DesignElements/Table.tsx b/client/src/Components/v2/DesignElements/Table.tsx deleted file mode 100644 index bf75fd9bf..000000000 --- a/client/src/Components/v2/DesignElements/Table.tsx +++ /dev/null @@ -1,215 +0,0 @@ -import Paper from "@mui/material/Paper"; -import Table from "@mui/material/Table"; -import TableBody from "@mui/material/TableBody"; -import TableCell from "@mui/material/TableCell"; -import TableContainer from "@mui/material/TableContainer"; -import TableHead from "@mui/material/TableHead"; -import TableRow from "@mui/material/TableRow"; - -import IconButton from "@mui/material/IconButton"; -import LastPageIcon from "@mui/icons-material/LastPage"; -import FirstPageIcon from "@mui/icons-material/FirstPage"; -import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft"; -import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight"; - -import Box from "@mui/material/Box"; -import TablePagination from "@mui/material/TablePagination"; -import type { TablePaginationProps } from "@mui/material/TablePagination"; - -import { useTheme } from "@mui/material/styles"; -import { useMediaQuery } from "@mui/material"; -export type Header = { - id: number | string; - content: React.ReactNode; - onClick?: (event: React.MouseEvent, row: T) => void; - render: (row: T) => React.ReactNode; -}; - -type DataTableProps = { - headers: Header[]; - data: T[]; - onRowClick?: (row: T) => void; -}; - -export function DataTable< - T extends { - id?: string | number; - _id?: string | number; - onRowClick?: (row: T) => void; - }, ->({ headers, data, onRowClick }: DataTableProps) { - const theme = useTheme(); - if (data.length === 0 || headers.length === 0) return
No data
; - return ( - - - - - {headers.map((header, idx) => { - return ( - - {header.content} - - ); - })} - - - - {data.map((row) => { - const key = row.id || row._id || Math.random(); - - return ( - (onRowClick ? onRowClick(row) : null)} - > - {headers.map((header, index) => { - return ( - header.onClick!(e, row) : undefined - } - > - {header.render(row)} - - ); - })} - - ); - })} - -
-
- ); -} - -interface TablePaginationActionsProps { - count: number; - page: number; - rowsPerPage: number; - onPageChange: (event: React.MouseEvent, newPage: number) => void; -} - -function TablePaginationActions(props: TablePaginationActionsProps) { - const theme = useTheme(); - const { count, page, rowsPerPage, onPageChange } = props; - - const handleFirstPageButtonClick = (event: React.MouseEvent) => { - onPageChange(event, 0); - }; - - const handleBackButtonClick = (event: React.MouseEvent) => { - onPageChange(event, page - 1); - }; - - const handleNextButtonClick = (event: React.MouseEvent) => { - onPageChange(event, page + 1); - }; - - const handleLastPageButtonClick = (event: React.MouseEvent) => { - onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1)); - }; - - return ( - - - {theme.direction === "rtl" ? : } - - - {theme.direction === "rtl" ? : } - - = Math.ceil(count / rowsPerPage) - 1} - aria-label="next page" - > - {theme.direction === "rtl" ? : } - - = Math.ceil(count / rowsPerPage) - 1} - aria-label="last page" - > - {theme.direction === "rtl" ? : } - - - ); -} - -export const Pagination: React.FC = ({ ...props }) => { - const isSmall = useMediaQuery((theme: any) => theme.breakpoints.down("sm")); - const theme = useTheme(); - return ( - - ); -}; diff --git a/client/src/Components/v2/DesignElements/index.tsx b/client/src/Components/v2/DesignElements/index.tsx deleted file mode 100644 index 3574daffb..000000000 --- a/client/src/Components/v2/DesignElements/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export { SplitBox as HorizontalSplitBox, ConfigBox } from "./SplitBox"; -export { BasePage, BasePageWithStates } from "./BasePage"; -export { BGBox, UpStatusBox, DownStatusBox, PausedStatusBox } from "./StatusBox"; -export { DataTable as Table, Pagination } from "./Table"; -export { GradientBox, StatBox } from "./StatBox"; -export { BaseBox } from "./BaseBox"; -export { StatusLabel } from "./StatusLabel"; -export { BaseFallback, ErrorFallback, EmptyFallback } from "./Fallback"; -export { BulletPointCheck } from "./BulletPointCheck"; diff --git a/client/src/Components/v2/Inputs/AutoComplete.tsx b/client/src/Components/v2/Inputs/AutoComplete.tsx deleted file mode 100644 index 73afa365a..000000000 --- a/client/src/Components/v2/Inputs/AutoComplete.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import Autocomplete from "@mui/material/Autocomplete"; -import type { AutocompleteProps } from "@mui/material/Autocomplete"; -import { TextInput } from "@/Components/v2/Inputs/TextInput"; -import { CheckboxInput } from "@/Components/v2/Inputs/Checkbox"; -import ListItem from "@mui/material/ListItem"; -import { useTheme } from "@mui/material/styles"; - -type AutoCompleteInputProps = Omit< - AutocompleteProps, - "renderInput" -> & { - renderInput?: AutocompleteProps["renderInput"]; -}; - -export const AutoCompleteInput: React.FC = ({ ...props }) => { - const theme = useTheme(); - return ( - ( - - )} - getOptionKey={(option) => option._id} - renderTags={() => null} - renderOption={(props, option, { selected }) => { - const { key, ...optionProps } = props; - return ( - - - {option.name} - - ); - }} - sx={{ - "&.MuiAutocomplete-root .MuiAutocomplete-input": { - padding: `0 ${theme.spacing(5)}`, - }, - }} - /> - ); -}; diff --git a/client/src/Components/v2/Inputs/Button.tsx b/client/src/Components/v2/Inputs/Button.tsx deleted file mode 100644 index 2f28e8eda..000000000 --- a/client/src/Components/v2/Inputs/Button.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import Button from "@mui/material/Button"; -import type { ButtonProps } from "@mui/material/Button"; - -export const ButtonInput: React.FC = ({ sx, ...props }) => { - return ( -