Feat: Frontend - Add websocket to client types and validations

This commit is contained in:
Br0wnHammer committed 2026-03-03 21:27:50 +05:30
1 parent 52b838a9eb
commit df77ed1fc7
3 files changed
+11

No files matched your search

+1
View File
@@ -12,6 +12,7 @@ export const MonitorTypes = [
"port",
"game",
"grpc",
"websocket",
"unknown",
] as const;
export type MonitorType = (typeof MonitorTypes)[number];
+1
View File
@@ -9,6 +9,7 @@ export const getMonitorPath = (type: MonitorType): string => {
ping: "uptime",
game: "uptime",
grpc: "uptime",
websocket: "uptime",
unknown: "uptime",
docker: "uptime",
hardware: "infrastructure",
+9
View File
@@ -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,
};