Files
gridpilot.gg/apps/website/lib/view-data/HealthViewData.ts
Marc Mintel 18133aef4c
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 5m42s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-22 23:40:38 +01:00

69 lines
1.5 KiB
TypeScript

/**
* Health View Data Types
*
* Defines the UI model for health monitoring data.
* This layer isolates the UI from API churn by providing a stable interface
* between the API layer and the presentation layer.
*/
export interface HealthStatus {
status: 'ok' | 'degraded' | 'error' | 'unknown';
timestamp: string;
formattedTimestamp: string;
relativeTime: string;
statusLabel: string;
statusColor: string;
statusIcon: string;
}
export interface HealthMetrics {
uptime: string;
responseTime: string;
errorRate: string;
lastCheck: string;
formattedLastCheck: string;
checksPassed: number;
checksFailed: number;
totalChecks: number;
successRate: string;
}
export interface HealthComponent {
name: string;
status: 'ok' | 'degraded' | 'error' | 'unknown';
statusLabel: string;
statusColor: string;
statusIcon: string;
lastCheck: string;
formattedLastCheck: string;
responseTime: string;
errorRate: string;
}
export interface HealthAlert {
id: string;
type: 'critical' | 'warning' | 'info';
title: string;
message: string;
timestamp: string;
formattedTimestamp: string;
relativeTime: string;
severity: string;
severityColor: string;
}
import { ViewData } from "../contracts/view-data/ViewData";
export interface HealthViewData extends ViewData {
overallStatus: HealthStatus;
metrics: HealthMetrics;
components: HealthComponent[];
alerts: HealthAlert[];
hasAlerts: boolean;
hasDegradedComponents: boolean;
hasErrorComponents: boolean;
lastUpdated: string;
formattedLastUpdated: string;
}