CI / changes (push) Successful in 10s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Successful in 52s
CI / go (push) Has been skipped
CI / bird2 (push) Has been skipped
CI / release (push) Successful in 4m7s
Refactored multiple dashboard components to utilize the new PanelCard for better organization and presentation. Updated the DashboardFramePanel, DashboardQuickLinks, and DashboardOperationsBreakdown components to streamline layouts and enhance user experience. Removed deprecated components and improved loading states in various sections, ensuring a cohesive interface throughout the application.
37 lines
931 B
TypeScript
37 lines
931 B
TypeScript
import { DonutBreakdownCard } from '@/components/patterns/donut-breakdown-card'
|
|
import { readinessBreakdown } from '@/lib/metrics'
|
|
import type { ReadyStatus } from '@/queries/monitoring'
|
|
|
|
export function MonitoringHealthCard({
|
|
healthOk,
|
|
ready,
|
|
loading,
|
|
}: {
|
|
healthOk: boolean
|
|
ready: ReadyStatus | null | undefined
|
|
loading?: boolean
|
|
}) {
|
|
const slices = readinessBreakdown(ready, healthOk)
|
|
|
|
if (loading) {
|
|
return (
|
|
<DonutBreakdownCard
|
|
title="Доступность системы"
|
|
description="Проверки живучести и готовности"
|
|
slices={[]}
|
|
centerLabel="Проверки"
|
|
/>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<DonutBreakdownCard
|
|
title="Доступность системы"
|
|
description="GET /v1/health · GET /v1/ready"
|
|
slices={slices}
|
|
centerLabel="Проверки"
|
|
badge={healthOk ? 'API OK' : undefined}
|
|
/>
|
|
)
|
|
}
|