"use client" import type { Server } from "@/lib/data" import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" import { RosBadge, rosVer } from "@/components/data-grids/servers-data-grid" import { CheckCircleIcon, XCircleIcon, RefreshCwIcon } from "lucide-react" const ROS_FEATURES = [ { name: "WireGuard", minVer: 701, label: "7.1+", desc: "WireGuard VPN туннели" }, { name: "Container", minVer: 704, label: "7.4+", desc: "Docker-совместимые контейнеры" }, { name: "BFD", minVer: 705, label: "7.5+", desc: "Bidirectional Forwarding Detection" }, { name: "Large Communities", minVer: 707, label: "7.7+", desc: "BGP Large Communities (RFC 8092)" }, { name: "VXLAN", minVer: 710, label: "7.10+", desc: "VXLAN overlay туннели" }, { name: "RPKI", minVer: 713, label: "7.13+", desc: "Route Origin Validation" }, { name: "BGP Flowspec", minVer: 714, label: "7.14+", desc: "BGP Flow Spec (RFC 8955)" }, { name: "IPv6 Firewall", minVer: 715, label: "7.15+", desc: "Расширенный IPv6 Firewall" }, { name: "REST API v2", minVer: 716, label: "7.16+", desc: "Обновлённый REST API" }, { name: "VRF Enhanced", minVer: 717, label: "7.17+", desc: "Расширенная поддержка VRF" }, ] interface ServerExpandedDetailProps { server: Server isLive: boolean isPolling: boolean onPoll: () => void } function ServerExpandedDetail({ server: s, isLive, isPolling, onPoll }: ServerExpandedDetailProps) { const ver = rosVer(s.os) return (
{s.model && s.model !== "—" && ( Модель: {s.model} )} {s.uptime && ( Uptime: {s.uptime} )} {s.cpuLoad != null && ( CPU: 80 ? "text-red-400" : s.cpuLoad > 50 ? "text-amber-400" : "text-emerald-400")}>{s.cpuLoad}% )} {s.asn && ( ASN: {s.asn} )} {s.ipv6Address && ( IPv6: {s.ipv6Address} )} {s.vrfNames?.map((v) => ( VRF: {v} ))} {s.comment && {s.comment}} {s.polledAt ? ( Опрошен: {new Date(s.polledAt).toLocaleString("ru")} ) : ( ⚠ Ещё не опрашивался )}
{isLive && ( )}

Возможности RouterOS

{ver >= 715 ? "✓ Актуальная версия — все ключевые фичи доступны" : ver >= 710 ? "⚠ Рекомендуется обновление до 7.15+" : s.os !== "—" ? "✗ Устаревшая версия — требуется обновление" : "Нет данных — нажмите «Опросить сейчас»"}
{ROS_FEATURES.map((f) => { const ok = ver >= f.minVer return (
{ok ? : }

{f.name}

{f.label} · {f.desc}

) })}
) } export { ServerExpandedDetail }