/**
 * TypeScript interfaces that mirror the backend's server status Pydantic models.
 *
 * `backend/app/models/server.py`
 */

/** Cached fail2ban server health snapshot. */
export interface ServerStatus {
  /** Whether fail2ban is reachable via its socket. */
  online: boolean;
  /** fail2ban version string, or null when offline. */
  version: string | null;
  /** Number of currently active jails. */
  active_jails: number;
  /** Aggregated current ban count across all jails. */
  total_bans: number;
  /** Aggregated current failure count across all jails. */
  total_failures: number;
}

/** Response shape for ``GET /api/dashboard/status``. */
export interface ServerStatusResponse {
  status: ServerStatus;
}

/** Response shape for ``GET /api/health``. */
export interface HealthResponse {
  status: "ok";
  fail2ban: "online" | "offline";
}
