feat: Stage 4 — fail2ban connection and server status
This commit is contained in:
24
frontend/src/types/server.ts
Normal file
24
frontend/src/types/server.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user