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:
@@ -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`)
|
||||
}
|
||||
Reference in New Issue
Block a user