-
- {failoverHistoryCopy(item)}
-
+ {item.copy}
)
diff --git a/apps/web/src/components/reui-kit/service-failover-panel.tsx b/apps/web/src/components/reui-kit/service-failover-panel.tsx
index 7cfb1d2..f31867f 100644
--- a/apps/web/src/components/reui-kit/service-failover-panel.tsx
+++ b/apps/web/src/components/reui-kit/service-failover-panel.tsx
@@ -2,10 +2,17 @@ import { UnplugIcon } from 'lucide-react'
import { FailoverTimeline } from '@/components/failover-timeline'
import {
+ mergeFailoverHistory,
toFailoverEvents,
type FailoverBindingPool,
type FailoverHealthInput,
} from '@/lib/failover-events'
+import {
+ latestHealthByIp,
+ resolveIpDisplayHealth,
+ type HealthLogProbe,
+ type HealthLogStatus,
+} from '@/lib/health-log'
import type { FailoverLogEntry } from '@/lib/schemas'
import { Badge } from '@/components/reui/badge'
import {
@@ -32,7 +39,7 @@ function failoverCountLabel(count: number): string {
}
/**
- * Failover — текущие Down + журнал add/remove по FQDN.
+ * Failover — текущие Down + кто вышел из пула и кто вернулся.
* Preview: https://reui.io/preview/base/components/c-timeline-10
* Preview: https://reui.io/preview/base/empty-state-12
* Docs: https://reui.io/docs/components/base/frame
@@ -44,12 +51,32 @@ export function ServiceFailoverPanel({
ipHealth,
bindings,
history,
+ probes = [],
}: {
ipHealth: readonly FailoverHealthInput[]
bindings: readonly FailoverBindingPool[]
history: readonly FailoverLogEntry[]
+ probes?: readonly HealthLogProbe[]
}) {
- const events = toFailoverEvents(ipHealth, bindings)
+ const liveByIp = latestHealthByIp(probes)
+ const overlayHealth = ipHealth.map((row) => {
+ const live = liveByIp.get(row.ip)
+ return {
+ ...row,
+ status: resolveIpDisplayHealth(
+ row.status as HealthLogStatus,
+ live?.status,
+ ),
+ last_error:
+ live && live.status !== 'unknown' ? live.last_error : row.last_error,
+ last_checked_at:
+ live && live.status !== 'unknown'
+ ? live.last_checked_at
+ : row.last_checked_at,
+ }
+ })
+ const events = toFailoverEvents(overlayHealth, bindings)
+ const mergedHistory = mergeFailoverHistory(history, probes, bindings)
const removedCount = events.filter((event) => event.kind === 'removed').length
return (
@@ -69,7 +96,7 @@ export function ServiceFailoverPanel({
)}