feat: Separate host and port for TCP services

This commit is contained in:
Tola Leng
2025-06-18 23:13:14 +07:00
parent 9c78def48d
commit 0758b1d24b
+8 -2
View File
@@ -3,6 +3,8 @@ export interface Service {
id: string; id: string;
name: string; name: string;
url: string; url: string;
host?: string; // Add host field for PING and TCP services
port?: number; // Add port field for TCP services
type: "HTTP" | "HTTPS" | "TCP" | "DNS" | "PING" | "HTTP" | "http" | "https" | "tcp" | "dns" | "ping" | "smtp" | "icmp"; type: "HTTP" | "HTTPS" | "TCP" | "DNS" | "PING" | "HTTP" | "http" | "https" | "tcp" | "dns" | "ping" | "smtp" | "icmp";
status: "up" | "down" | "paused" | "pending" | "warning"; status: "up" | "down" | "paused" | "pending" | "warning";
responseTime: number; responseTime: number;
@@ -15,11 +17,15 @@ export interface Service {
muteAlerts?: boolean; // Keep this to avoid breaking existing code muteAlerts?: boolean; // Keep this to avoid breaking existing code
alerts?: "muted" | "unmuted"; // Make sure alerts is properly typed as union alerts?: "muted" | "unmuted"; // Make sure alerts is properly typed as union
muteChangedAt?: string; muteChangedAt?: string;
domain?: string; // Add domain field for DNS services
} }
export interface CreateServiceParams { export interface CreateServiceParams {
name: string; name: string;
url: string; url?: string;
host?: string; // Add host field for PING and TCP services
port?: number; // Add port field for TCP services
domain?: string; // Add domain field for DNS services
type: string; type: string;
interval: number; interval: number;
retries: number; retries: number;
@@ -35,4 +41,4 @@ export interface UptimeData {
timestamp: string; timestamp: string;
status: "up" | "down" | "paused" | "pending" | "warning"; status: "up" | "down" | "paused" | "pending" | "warning";
responseTime: number; responseTime: number;
} }