From cfe7d2a3594d7bef05043369266a3033485d36bf Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 23 Sep 2026 11:06:25 -0700 Subject: [PATCH] add missing braces, fix type error --- server/openapi.json | 52 +++++++++++++++++++ .../src/api/validation/monitorValidation.ts | 4 ++ server/src/service/network/DockerProvider.ts | 2 +- server/src/service/statusService.ts | 6 ++- 4 files changed, 61 insertions(+), 3 deletions(-) diff --git a/server/openapi.json b/server/openapi.json index 237bcea29..4cbcdb1f9 100644 --- a/server/openapi.json +++ b/server/openapi.json @@ -466,6 +466,12 @@ "dockerLogsEnabled": { "type": "boolean" }, + "dockerAlertOnStopped": { + "type": "boolean" + }, + "dockerAlertOnUnhealthy": { + "type": "boolean" + }, "dockerTlsCa": { "type": "string" }, @@ -523,6 +529,8 @@ "geoCheckLocations", "geoCheckInterval", "dockerLogsEnabled", + "dockerAlertOnStopped", + "dockerAlertOnUnhealthy", "teamId", "userId", "createdAt", @@ -694,6 +702,12 @@ "dockerLogsEnabled": { "type": "boolean" }, + "dockerAlertOnStopped": { + "type": "boolean" + }, + "dockerAlertOnUnhealthy": { + "type": "boolean" + }, "dockerTlsCa": { "type": "string" }, @@ -753,6 +767,8 @@ "geoCheckLocations", "geoCheckInterval", "dockerLogsEnabled", + "dockerAlertOnStopped", + "dockerAlertOnUnhealthy", "teamId", "userId", "createdAt", @@ -7186,6 +7202,12 @@ "dockerLogsEnabled": { "type": "boolean" }, + "dockerAlertOnStopped": { + "type": "boolean" + }, + "dockerAlertOnUnhealthy": { + "type": "boolean" + }, "dockerTlsCa": { "type": "string" }, @@ -7245,6 +7267,8 @@ "geoCheckLocations", "geoCheckInterval", "dockerLogsEnabled", + "dockerAlertOnStopped", + "dockerAlertOnUnhealthy", "teamId", "userId", "createdAt", @@ -7761,6 +7785,12 @@ "dockerLogsEnabled": { "type": "boolean" }, + "dockerAlertOnStopped": { + "type": "boolean" + }, + "dockerAlertOnUnhealthy": { + "type": "boolean" + }, "dockerTlsCa": { "type": "string" }, @@ -7820,6 +7850,8 @@ "geoCheckLocations", "geoCheckInterval", "dockerLogsEnabled", + "dockerAlertOnStopped", + "dockerAlertOnUnhealthy", "teamId", "userId", "createdAt", @@ -9308,6 +9340,12 @@ "dockerLogsEnabled": { "type": "boolean" }, + "dockerAlertOnStopped": { + "type": "boolean" + }, + "dockerAlertOnUnhealthy": { + "type": "boolean" + }, "dockerTlsCa": { "anyOf": [ { @@ -10033,6 +10071,14 @@ "type": "boolean", "default": false }, + "dockerAlertOnStopped": { + "type": "boolean", + "default": false + }, + "dockerAlertOnUnhealthy": { + "type": "boolean", + "default": false + }, "dnsServer": { "type": "string", "minLength": 1 @@ -10600,6 +10646,12 @@ "dockerLogsEnabled": { "type": "boolean" }, + "dockerAlertOnStopped": { + "type": "boolean" + }, + "dockerAlertOnUnhealthy": { + "type": "boolean" + }, "dockerTlsCa": { "anyOf": [ { diff --git a/server/src/api/validation/monitorValidation.ts b/server/src/api/validation/monitorValidation.ts index 357cb4aaa..359a2fabf 100644 --- a/server/src/api/validation/monitorValidation.ts +++ b/server/src/api/validation/monitorValidation.ts @@ -272,6 +272,8 @@ export const editMonitorBodyValidation = z geoCheckLocations: z.array(z.enum(GeoContinents)).optional(), geoCheckInterval: z.number().min(300000).optional(), dockerLogsEnabled: z.boolean().optional(), + dockerAlertOnStopped: z.boolean().optional(), + dockerAlertOnUnhealthy: z.boolean().optional(), dockerTlsCa: z.union([z.string(), z.literal("")]).optional(), dockerTlsCert: z.union([z.string(), z.literal("")]).optional(), dockerTlsKey: z.union([z.string(), z.literal("")]).optional(), @@ -444,6 +446,8 @@ export const monitorResponseSchema = z geoCheckLocations: z.array(z.enum(GeoContinents)), geoCheckInterval: z.number(), dockerLogsEnabled: z.boolean(), + dockerAlertOnStopped: z.boolean(), + dockerAlertOnUnhealthy: z.boolean(), dockerTlsCa: z.string().optional(), dockerTlsCert: z.string().optional(), dockerTlsKeySet: z.boolean().optional(), diff --git a/server/src/service/network/DockerProvider.ts b/server/src/service/network/DockerProvider.ts index 238bccede..a25e847ca 100644 --- a/server/src/service/network/DockerProvider.ts +++ b/server/src/service/network/DockerProvider.ts @@ -150,7 +150,7 @@ export class DockerProvider implements IStatusProvider { private healthFromStatus = (status: string): DockerHealthStatus => { const match = HEALTH_STATUS.exec(status); if (!match) return "none"; - return match[1] === "health: starting" ? "starting" : match[1]; + return match[1] === "health: starting" ? "starting" : (match[1] as DockerHealthStatus); }; private toContainerSummary(containers: DockerContainerInfo[]): DockerContainerSummary { diff --git a/server/src/service/statusService.ts b/server/src/service/statusService.ts index cb093c479..13ae68109 100755 --- a/server/src/service/statusService.ts +++ b/server/src/service/statusService.ts @@ -172,8 +172,10 @@ export class StatusService implements IStatusService { if (breaching && currentStatus !== "breached") { nextStatus = "breached"; transitioned = true; - } else if (!breaching && currentStatus === "breached") nextStatus = "up"; - transitioned = true; + } else if (!breaching && currentStatus === "breached") { + nextStatus = "up"; + transitioned = true; + } } return { nextStatus, transitioned }; };