add missing braces, fix type error
This commit is contained in:
1 parent
5fb26367ed
commit
cfe7d2a359
4 files changed
+61
-3
No files matched your search
@@ -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(),
|
||||
|
||||
@@ -150,7 +150,7 @@ export class DockerProvider implements IStatusProvider<DockerStatusPayload> {
|
||||
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 {
|
||||
|
||||
@@ -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 };
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user