diff --git a/client/src/Types/Monitor.ts b/client/src/Types/Monitor.ts index 01cae62e9..f8a033d23 100644 --- a/client/src/Types/Monitor.ts +++ b/client/src/Types/Monitor.ts @@ -12,6 +12,7 @@ export const MonitorTypes = [ "port", "game", "grpc", + "websocket", "unknown", ] as const; export type MonitorType = (typeof MonitorTypes)[number]; diff --git a/client/src/Utils/MonitorUtils.ts b/client/src/Utils/MonitorUtils.ts index ad744ba6d..d0ede67e1 100644 --- a/client/src/Utils/MonitorUtils.ts +++ b/client/src/Utils/MonitorUtils.ts @@ -9,6 +9,7 @@ export const getMonitorPath = (type: MonitorType): string => { ping: "uptime", game: "uptime", grpc: "uptime", + websocket: "uptime", unknown: "uptime", docker: "uptime", hardware: "infrastructure", diff --git a/client/src/Validation/monitor.ts b/client/src/Validation/monitor.ts index 439af977f..cfd042494 100644 --- a/client/src/Validation/monitor.ts +++ b/client/src/Validation/monitor.ts @@ -85,6 +85,13 @@ const grpcSchema = baseSchema.extend({ ignoreTlsErrors: z.boolean(), }); +// WebSocket monitor schema +const websocketSchema = baseSchema.extend({ + type: z.literal("websocket"), + url: z.string().min(1, "WebSocket URL is required"), + ignoreTlsErrors: z.boolean(), +}); + // PageSpeed monitor schema const pagespeedSchema = baseSchema.extend({ type: z.literal("pagespeed"), @@ -123,6 +130,7 @@ export const monitorSchema = z.discriminatedUnion("type", [ dockerSchema, gameSchema, grpcSchema, + websocketSchema, pagespeedSchema, hardwareSchema, ]); @@ -137,6 +145,7 @@ export { dockerSchema, gameSchema, grpcSchema, + websocketSchema, pagespeedSchema, hardwareSchema, };