Feat: Frontend - Add websocket to client types and validations
This commit is contained in:
1 parent
52b838a9eb
commit
df77ed1fc7
3 files changed
+11
No files matched your search
@@ -12,6 +12,7 @@ export const MonitorTypes = [
|
|||||||
"port",
|
"port",
|
||||||
"game",
|
"game",
|
||||||
"grpc",
|
"grpc",
|
||||||
|
"websocket",
|
||||||
"unknown",
|
"unknown",
|
||||||
] as const;
|
] as const;
|
||||||
export type MonitorType = (typeof MonitorTypes)[number];
|
export type MonitorType = (typeof MonitorTypes)[number];
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export const getMonitorPath = (type: MonitorType): string => {
|
|||||||
ping: "uptime",
|
ping: "uptime",
|
||||||
game: "uptime",
|
game: "uptime",
|
||||||
grpc: "uptime",
|
grpc: "uptime",
|
||||||
|
websocket: "uptime",
|
||||||
unknown: "uptime",
|
unknown: "uptime",
|
||||||
docker: "uptime",
|
docker: "uptime",
|
||||||
hardware: "infrastructure",
|
hardware: "infrastructure",
|
||||||
|
|||||||
@@ -85,6 +85,13 @@ const grpcSchema = baseSchema.extend({
|
|||||||
ignoreTlsErrors: z.boolean(),
|
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
|
// PageSpeed monitor schema
|
||||||
const pagespeedSchema = baseSchema.extend({
|
const pagespeedSchema = baseSchema.extend({
|
||||||
type: z.literal("pagespeed"),
|
type: z.literal("pagespeed"),
|
||||||
@@ -123,6 +130,7 @@ export const monitorSchema = z.discriminatedUnion("type", [
|
|||||||
dockerSchema,
|
dockerSchema,
|
||||||
gameSchema,
|
gameSchema,
|
||||||
grpcSchema,
|
grpcSchema,
|
||||||
|
websocketSchema,
|
||||||
pagespeedSchema,
|
pagespeedSchema,
|
||||||
hardwareSchema,
|
hardwareSchema,
|
||||||
]);
|
]);
|
||||||
@@ -137,6 +145,7 @@ export {
|
|||||||
dockerSchema,
|
dockerSchema,
|
||||||
gameSchema,
|
gameSchema,
|
||||||
grpcSchema,
|
grpcSchema,
|
||||||
|
websocketSchema,
|
||||||
pagespeedSchema,
|
pagespeedSchema,
|
||||||
hardwareSchema,
|
hardwareSchema,
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user