feat: Gateway health monitoring (Hermes CLI, API, frontend)

- Hermes CLI wrapper using subprocess.run for gateway status
- Gateway API: status list (with filter), events (placeholder), start/stop/restart with audit logging
- Frontend GatewayPage: timeline, filter bar, status table with 10s polling, operation modals
- usePolling hook for periodic data refresh

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
enzo
2026-07-22 17:05:41 +08:00
co-authored by Claude
parent 76045538bb
commit 6d4a5c955b
6 changed files with 553 additions and 3 deletions
+46
View File
@@ -0,0 +1,46 @@
import client from './client'
export interface GatewayInfo {
id: string
name: string
status: 'online' | 'offline' | 'warn'
downtime_minutes: number
restarts_today: number
last_event: string
profile_type: string
}
export interface GatewayEvent {
time: string
profile: string
type: string
detail: string
}
export interface OperationResult {
success: boolean
action: string
profile: string
detail: string
}
export function getGatewayStatus(status?: string) {
const params = status ? { status } : undefined
return client.get<GatewayInfo[]>('/gateway/status', { params })
}
export function getGatewayEvents() {
return client.get<GatewayEvent[]>('/gateway/events')
}
export function startGateway(profile: string) {
return client.post<OperationResult>(`/gateway/${profile}/start`)
}
export function stopGateway(profile: string) {
return client.post<OperationResult>(`/gateway/${profile}/stop`)
}
export function restartGateway(profile: string) {
return client.post<OperationResult>(`/gateway/${profile}/restart`)
}