"use client" import type { ReactNode } from "react" import Link from "next/link" import { Badge } from "@/components/reui/badge" import { StatusBadge } from "@/components/status-badge" import { Flag } from "@/components/flag" import type { InternetPathViewModel } from "@/lib/dashboard-internet-path" import type { ServerStatus } from "@/lib/data" function pathStateToServerStatus(state: InternetPathViewModel["pathState"]): ServerStatus { if (state === "healthy") return "online" if (state === "failover" || state === "degraded") return "degraded" return "unknown" } function Kv({ label, children }: { label: string; children: ReactNode }) { return (
{label} {children}
) } function Node({ name, country }: { name: string; country?: string }) { return ( <> {country ? : null} {name} ) } /** * Сводка маршрута (блок kv макета v3): узлы пути и последние подтверждённые метрики участка WAN → JH. * Docs: https://reui.io/docs/components/base/frame */ export function InternetPathSummary({ model }: { model: InternetPathViewModel | null }) { if (!model) { return (

Недостаточно данных для пути. Добавьте home-router и проверьте{" "} карту сети .

) } const hop = model.currentHop ?? model.primaryHop const wanName = hop?.wan.name ?? model.activeWanUplink?.name ?? "WAN" const wanIsp = hop?.wan.isp ?? model.activeWanUplink?.isp ?? "—" const ping = hop?.wanJhMetrics.pingMs const dl = hop?.wanJhMetrics.dlMbps return (
Home → WAN → JH → Exit {model.pathState === "failover" ? failover : null} {ping != null ? {`${ping} мс`} : "—"} {dl != null ? {`${Math.round(dl)} ↓ Мбит/с`} : "—"} {`${wanName} · ${wanIsp}`}

JH/Exit — схема кандидатов. Default route подтверждает только WAN. Метрики — последние подтверждённые пробы участков.

) }