code quality
This commit is contained in:
@@ -5,9 +5,11 @@ import { HealthAlertFormatter } from '@/lib/formatters/HealthAlertFormatter';
|
||||
import { HealthComponentFormatter } from '@/lib/formatters/HealthComponentFormatter';
|
||||
import { HealthMetricFormatter } from '@/lib/formatters/HealthMetricFormatter';
|
||||
import { HealthStatusFormatter } from '@/lib/formatters/HealthStatusFormatter';
|
||||
import type { HealthDTO } from '@/lib/types/generated/HealthDTO';
|
||||
import type { HealthDTO } from '../../../../api/src/domain/health/HealthDTO';
|
||||
import type { HealthAlert, HealthComponent, HealthMetrics, HealthStatus, HealthViewData } from '@/lib/view-data/HealthViewData';
|
||||
|
||||
export type { HealthDTO };
|
||||
|
||||
export class HealthViewDataBuilder {
|
||||
public static build(apiDto: HealthDTO): HealthViewData {
|
||||
const now = new Date();
|
||||
@@ -38,7 +40,7 @@ export class HealthViewDataBuilder {
|
||||
};
|
||||
|
||||
// Build components
|
||||
const components: HealthComponent[] = (apiDto.components || []).map((component) => ({
|
||||
const components: HealthComponent[] = (apiDto.components || []).map((component: { name: string; status: 'ok' | 'degraded' | 'error' | 'unknown'; lastCheck?: string; responseTime?: number; errorRate?: number; }) => ({
|
||||
name: component.name,
|
||||
status: component.status,
|
||||
statusLabel: HealthComponentFormatter.formatStatusLabel(component.status),
|
||||
@@ -51,7 +53,7 @@ export class HealthViewDataBuilder {
|
||||
}));
|
||||
|
||||
// Build alerts
|
||||
const alerts: HealthAlert[] = (apiDto.alerts || []).map((alert) => ({
|
||||
const alerts: HealthAlert[] = (apiDto.alerts || []).map((alert: { id: string; type: 'critical' | 'warning' | 'info'; title: string; message: string; timestamp: string; }) => ({
|
||||
id: alert.id,
|
||||
type: alert.type,
|
||||
title: alert.title,
|
||||
|
||||
Reference in New Issue
Block a user