export interface HostConfig {
  id: string;
  name: string;
  ip: string;
  type: "local" | "ssh";
  user?: string;
}

export interface HostStatus {
  id: string;
  name: string;
  ip: string;
  status: "online" | "offline" | "degraded";
  cpu_percent: number;
  memory_used_bytes: number;
  memory_total_bytes: number;
  disk_used_bytes: number;
  disk_total_bytes: number;
  uptime_seconds: number;
  os_version: string;
  pending_updates: number;
  pending_security_updates: number;
  last_checked: string;
}

export interface ServiceStatus {
  id: string;
  name: string;
  host: string;
  status: "running" | "stopped" | "errored";
  uptime_seconds: number;
  restart_count: number;
  memory_bytes: number;
  type: "pm2" | "systemd";
  last_checked: string;
}

export interface NetworkConfig {
  id: string;
  name: string;
  type: "internet" | "backup_internet" | "lan" | "router";
  target: string | null;
}

export interface NetworkStatus {
  id: string;
  name: string;
  status: "online" | "offline" | "unknown";
  latency_ms: number | null;
  type: "internet" | "backup_internet" | "lan" | "router";
  last_checked: string;
}

export interface SiteStatus {
  id: string;
  name: string;
  url: string;
  status: "up" | "down" | "degraded";
  response_time_ms: number;
  http_status_code: number;
  ssl_expiry_date: string | null;
  ssl_days_remaining: number | null;
  last_checked: string;
}

export interface StatusSnapshot {
  hosts: HostStatus[];
  services: ServiceStatus[];
  network: NetworkStatus[];
  sites: SiteStatus[];
  last_updated: string;
}

export interface StatusSummary {
  hosts: { green: number; amber: number; red: number };
  services: { green: number; amber: number; red: number };
  network: { green: number; amber: number; red: number };
  sites: { green: number; amber: number; red: number };
  overall: "healthy" | "degraded" | "critical";
}

export interface AlertItem {
  category: "host" | "service" | "network" | "site";
  id: string;
  name: string;
  severity: "amber" | "red";
  message: string;
  last_checked: string;
}

export interface StatusConfig {
  hosts: HostConfig[];
  network: NetworkConfig[];
  sites: "auto" | { id: string; name: string; url: string }[];
}
