+
@@ -518,6 +518,61 @@ function IfaceRow({ c, showServer = false }: { c: BoundIfaceTraffic; showServer?
)
}
+/** Интерфейсы выбранного сервера таблицей (блок «Интерфейсы сервера» макета v3). */
+function ServerIfacesFrame({ server }: { server: ServerTraffic }) {
+ const cols = "grid-cols-[minmax(170px,1.6fr)_minmax(90px,1fr)_110px_100px_100px_150px]"
+ return (
+
} panelClassName="overflow-x-auto">
+
+
+ ИнтерфейсСерверСтатусRXTXУчтено
+
+ {server.boundIfaces.map((c) => (
+
+
+
+
+ {boundIfaceLabel(c)}
+ {IFACE_TYPE_LABEL[c.interfaceType]} · {c.comment || c.userLogin}
+
+
+ {server.name}
+ {c.status === "online" ? "Работает" : c.status === "unknown" ? "Нет данных" : "Неактивен"}
+ {fmtRate(c.rxNow)}
+ {fmtRate(c.txNow)}
+ {fmtGiB(c.rxTotal)} / {fmtGiB(c.txTotal)}
+
+ ))}
+
+
+ )
+}
+
+/** Доля RX по серверам с данными (блок rbl макета v3). */
+function RxShareFrame({ servers }: { servers: ServerTraffic[] }) {
+ const rows = servers.filter((s) => typeof s.rxNow === "number" && s.rxNow > 0).sort((a, b) => (b.rxNow ?? 0) - (a.rxNow ?? 0)).slice(0, 5)
+ const total = rows.reduce((sum, s) => sum + (s.rxNow ?? 0), 0)
+ if (!rows.length || total <= 0) return null
+ const max = rows[0].rxNow ?? 1
+ const colors = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)", "var(--muted-foreground)"]
+ return (
+
} panelClassName="flex flex-col gap-1.5 p-2.5">
+ {rows.map((s, i) => (
+
+
+
+
+ {s.name}
+
+
+ {fmtRate(s.rxNow)}
+ {Math.round(((s.rxNow ?? 0) / total) * 100)}%
+
+ ))}
+
+ )
+}
+
function BoundIfacesList({ clients, showServer = false }: { clients: BoundIfaceTraffic[]; showServer?: boolean }) {
if (clients.length === 0)
return
Нет привязанных интерфейсов
@@ -530,24 +585,46 @@ function BoundIfacesList({ clients, showServer = false }: { clients: BoundIfaceT
// ─── detail panel helpers ─────────────────────────────────────────────────────
-function DetailHeader({ range, setRange, children }: {
- range: Range; setRange: (r: Range) => void; children: ReactNode
+function DetailHeader({ range, setRange, children, status }: {
+ range: Range; setRange: (r: Range) => void; children: ReactNode; status?: ReactNode
}) {
return (
-
-
{children}
-
+
+
{children}
+ {status}
+
{TRAFFIC_RANGE_KEYS.map((r) => (
-
))}
)
}
+const SERVER_STATUS: Record
= {
+ online: { tone: "ok", label: "Онлайн" },
+ degraded: { tone: "wn", label: "Ухудшение" },
+ offline: { tone: "er", label: "Оффлайн" },
+}
+
+/** Текущие и пиковые скорости двумя колонками (блок kv макета v3). */
+function KvStats({ label, items }: { label: string; items: Array<{ id: string; label: string; value: string; hint?: string }> }) {
+ return (
+
+ {items.map((item) => (
+
+ {item.label}
+ {item.value}
+ {item.hint ? {item.hint} : null}
+
+ ))}
+
+ )
+}
+
function OfflinePlaceholder({ text = "Нет данных — объект недоступен" }: { text?: string }) {
return (
@@ -598,63 +675,24 @@ function ServerDetail({
const txNow = liveTx ?? sel.txNow
return (
<>
-
-
- {sel.name}
-
- {sel.site}
-
+ {SERVER_STATUS[sel.status].label}}>
+
+
{sel.name}
+
{sel.site}
+
-
-
,
- iconClassName: "text-success",
- },
- {
- id: "tx-now",
- label: "TX",
- value: fmtRate(txNow),
- hint: liveHint,
- icon:
,
- iconClassName: "text-info",
- },
- {
- id: "rx-peak",
- label: "Пик RX",
- value: fmtRate(sel.rxPeak),
- icon:
,
- iconClassName: "text-warning",
- },
- {
- id: "tx-peak",
- label: "Пик TX",
- value: fmtRate(sel.txPeak),
- icon:
,
- iconClassName: "text-warning",
- },
- ]}
- />
-
+
- {sel.boundIfaces.length > 0 && (
-
-
-
- Привязанные интерфейсы
- ({sel.boundIfaces.length})
-
-
-
- )}
>
)
}
@@ -1425,6 +1463,7 @@ export default function TrafficPage() {
) : (
{/* ── left panel ── */}
+
{/* search */}
@@ -1435,20 +1474,17 @@ export default function TrafficPage() {
value={search}
onChange={e => setSearch(e.target.value)}
aria-label="Поиск трафика" placeholder="Поиск…"
- className="w-full pl-8 pr-3 h-8 text-xs bg-muted/50 border border-border rounded-md outline-none focus:border-primary transition-colors"
+ className="border-input bg-input/30 focus:border-ring h-8 w-full rounded-lg border pr-3 pl-8 text-[13px] outline-none transition-colors"
/>
{/* sort controls */}
-
-
Сортировка:
+
{visibleSortFields.map(({ field, label }) => (
toggleSort(field)}
className={cn(
- "text-[10px] px-2 py-0.5 rounded border transition-colors",
- sortField === field
- ? "border-primary bg-primary/10 text-primary font-medium"
- : "border-border text-muted-foreground hover:text-foreground",
+ "text-muted-foreground hover:text-foreground h-[30px] rounded-md px-2.5 text-[13px] font-medium transition-colors",
+ sortField === field && "bg-background text-foreground shadow-sm",
)}>
{label}{sortField === field ? (sortDir === "desc" ? " ↓" : " ↑") : ""}
@@ -1475,8 +1511,11 @@ export default function TrafficPage() {
))}
+ {effectiveMode === "servers" ?
: null}
+
{/* ── detail panel ── */}
+
{isLive && effectiveMode === "servers" && (
@@ -1564,6 +1603,8 @@ export default function TrafficPage() {
{effectiveMode === "ifaces" && selIface && }
+ {effectiveMode === "servers" && detailServer && detailServer.boundIfaces.length > 0 ? : null}
+
)}
diff --git a/components/network-map/map-kpi-strip.tsx b/components/network-map/map-kpi-strip.tsx
new file mode 100644
index 00000000..3fd346eb
--- /dev/null
+++ b/components/network-map/map-kpi-strip.tsx
@@ -0,0 +1,102 @@
+"use client"
+
+import type { Server } from "@/lib/data"
+import { fmtRate } from "@/lib/fmt-rate"
+import { TONE_COLOR, type Tone } from "@/components/reui-kit/ops-blocks"
+import { cn } from "@/lib/utils"
+
+type StatusFilter = "online" | "degraded" | "offline"
+
+const STATUS: Array<{ key: StatusFilter; label: string; tone: Tone }> = [
+ { key: "online", label: "Онлайн", tone: "ok" },
+ { key: "degraded", label: "Внимание", tone: "wn" },
+ { key: "offline", label: "Оффлайн", tone: "er" },
+]
+
+function Seg({ parts }: { parts: Array<{ n: number; color: string }> }) {
+ const shown = parts.filter((part) => part.n > 0)
+ return (
+
+ {shown.length ? shown.map((part, i) => ) : }
+
+ )
+}
+
+function Card({ title, value, unit, children }: { title: string; value: string; unit: string; children: React.ReactNode }) {
+ return (
+
+
{title}
+
+ {value}
+ {unit}
+
+ {children}
+
+ )
+}
+
+/**
+ * KPI-полоса над картой (макет v3): узлы, GRE-туннели, NetFlow и узлы, требующие внимания.
+ * Счётчики статусов фильтруют карту, строки проблем открывают узел.
+ */
+export function MapKpiStrip({ servers, tunnels, netflowBytes, windowSec, filter, onFilter, onSelect, className }: {
+ servers: Server[]
+ tunnels: Array<{ status: "up" | "down" | "degraded" }>
+ /** Байты NetFlow за окно; null — потоки не загружены. */
+ netflowBytes: number | null
+ windowSec: number
+ filter: string
+ onFilter: (key: StatusFilter | "all") => void
+ onSelect: (server: Server) => void
+ className?: string
+}) {
+ const count = (status: Server["status"]) => servers.filter((server) => server.status === status).length
+ const up = tunnels.filter((tunnel) => tunnel.status === "up").length
+ const degraded = tunnels.filter((tunnel) => tunnel.status === "degraded").length
+ const problems = servers.filter((server) => server.enabled !== false && server.status !== "online")
+ const minutes = Math.max(1, Math.round(windowSec / 60))
+ return (
+
+
+ ({ n: count(s.key), color: TONE_COLOR[s.tone] }))} />
+
+ {STATUS.map((s) => (
+ onFilter(filter === s.key ? "all" : s.key)}
+ className={cn("text-muted-foreground hover:bg-muted/70 inline-flex h-[26px] items-center gap-1.5 rounded-md border border-transparent px-1.5 text-[12.5px] transition-colors", filter === s.key && "bg-muted border-border text-foreground")}
+ >
+
+ {s.label}
+ {count(s.key)}
+
+ ))}
+
+
+
+
+ {tunnels.length ? `Деградация: ${degraded} · недоступны: ${tunnels.length - up - degraded}` : "Туннелей на карте нет"}
+
+
+
+ {netflowBytes == null ? "Потоки ещё не загружены" : "Средняя скорость за окно потоков"}
+
+
+ {problems.length ? (
+
+ {problems.slice(0, 3).map((server) => (
+ onSelect(server)} className="hover:bg-muted/70 flex min-h-[26px] items-center gap-2 rounded-md px-1.5 text-left text-[12.5px] transition-colors">
+
+ {server.name} — {server.status === "offline" ? "нет ответа" : server.status === "degraded" ? "ухудшение" : "статус неизвестен"}
+
+ ))}
+
+ ) : (
+ Проблемных узлов нет
+ )}
+
+
+ )
+}
diff --git a/docs/ux-ui/screens/dashboard-observed-ping-1440.png b/docs/ux-ui/screens/dashboard-observed-ping-1440.png
index e9d82245..60e60805 100644
Binary files a/docs/ux-ui/screens/dashboard-observed-ping-1440.png and b/docs/ux-ui/screens/dashboard-observed-ping-1440.png differ
diff --git a/docs/ux-ui/screens/dashboard-observed-ping-320.png b/docs/ux-ui/screens/dashboard-observed-ping-320.png
index 14776383..ab05788f 100644
Binary files a/docs/ux-ui/screens/dashboard-observed-ping-320.png and b/docs/ux-ui/screens/dashboard-observed-ping-320.png differ
diff --git a/docs/ux-ui/screens/network-map-detail-desktop.png b/docs/ux-ui/screens/network-map-detail-desktop.png
index e22ce9dc..7352af3e 100644
Binary files a/docs/ux-ui/screens/network-map-detail-desktop.png and b/docs/ux-ui/screens/network-map-detail-desktop.png differ
diff --git a/docs/ux-ui/screens/network-map-detail-mobile.png b/docs/ux-ui/screens/network-map-detail-mobile.png
index 12fac160..9c05c536 100644
Binary files a/docs/ux-ui/screens/network-map-detail-mobile.png and b/docs/ux-ui/screens/network-map-detail-mobile.png differ
diff --git a/docs/ux-ui/screens/network-map-detail-narrow.png b/docs/ux-ui/screens/network-map-detail-narrow.png
index 4fa4a9e1..d62adcc1 100644
Binary files a/docs/ux-ui/screens/network-map-detail-narrow.png and b/docs/ux-ui/screens/network-map-detail-narrow.png differ
diff --git a/docs/ux-ui/screens/network-map-overview-desktop.png b/docs/ux-ui/screens/network-map-overview-desktop.png
index 480fb340..48b33d42 100644
Binary files a/docs/ux-ui/screens/network-map-overview-desktop.png and b/docs/ux-ui/screens/network-map-overview-desktop.png differ
diff --git a/docs/ux-ui/screens/network-map-overview-mobile.png b/docs/ux-ui/screens/network-map-overview-mobile.png
index 12569b1f..d7588874 100644
Binary files a/docs/ux-ui/screens/network-map-overview-mobile.png and b/docs/ux-ui/screens/network-map-overview-mobile.png differ
diff --git a/docs/ux-ui/screens/network-map-overview-narrow.png b/docs/ux-ui/screens/network-map-overview-narrow.png
index a2d42db5..2e68b95e 100644
Binary files a/docs/ux-ui/screens/network-map-overview-narrow.png and b/docs/ux-ui/screens/network-map-overview-narrow.png differ
diff --git a/docs/ux-ui/screens/traffic-history-error-1440-2026-10-12.png b/docs/ux-ui/screens/traffic-history-error-1440-2026-10-12.png
index df86619c..72ad0112 100644
Binary files a/docs/ux-ui/screens/traffic-history-error-1440-2026-10-12.png and b/docs/ux-ui/screens/traffic-history-error-1440-2026-10-12.png differ
diff --git a/docs/ux-ui/screens/traffic-history-error-320-2026-10-12.png b/docs/ux-ui/screens/traffic-history-error-320-2026-10-12.png
index 0c4e28e7..437d9d77 100644
Binary files a/docs/ux-ui/screens/traffic-history-error-320-2026-10-12.png and b/docs/ux-ui/screens/traffic-history-error-320-2026-10-12.png differ
diff --git a/docs/ux-ui/screens/traffic-live-error-1440-2026-10-12.png b/docs/ux-ui/screens/traffic-live-error-1440-2026-10-12.png
index 36b37076..5b02559d 100644
Binary files a/docs/ux-ui/screens/traffic-live-error-1440-2026-10-12.png and b/docs/ux-ui/screens/traffic-live-error-1440-2026-10-12.png differ
diff --git a/docs/ux-ui/screens/traffic-live-error-320-2026-10-12.png b/docs/ux-ui/screens/traffic-live-error-320-2026-10-12.png
index 937fe91a..62631f08 100644
Binary files a/docs/ux-ui/screens/traffic-live-error-320-2026-10-12.png and b/docs/ux-ui/screens/traffic-live-error-320-2026-10-12.png differ
diff --git a/docs/ux-ui/screens/traffic-volume-1440-2026-10-12.png b/docs/ux-ui/screens/traffic-volume-1440-2026-10-12.png
index 46d450f3..733fab19 100644
Binary files a/docs/ux-ui/screens/traffic-volume-1440-2026-10-12.png and b/docs/ux-ui/screens/traffic-volume-1440-2026-10-12.png differ
diff --git a/docs/ux-ui/screens/traffic-volume-320-2026-10-12.png b/docs/ux-ui/screens/traffic-volume-320-2026-10-12.png
index c962bb68..9939db9c 100644
Binary files a/docs/ux-ui/screens/traffic-volume-320-2026-10-12.png and b/docs/ux-ui/screens/traffic-volume-320-2026-10-12.png differ
diff --git a/docs/ux-ui/screens/wide-statistics-pivot-1440.png b/docs/ux-ui/screens/wide-statistics-pivot-1440.png
index 1dc353f9..12fc0f47 100644
Binary files a/docs/ux-ui/screens/wide-statistics-pivot-1440.png and b/docs/ux-ui/screens/wide-statistics-pivot-1440.png differ
diff --git a/docs/ux-ui/screens/wide-statistics-pivot-320.png b/docs/ux-ui/screens/wide-statistics-pivot-320.png
index dedff3e7..4bd762db 100644
Binary files a/docs/ux-ui/screens/wide-statistics-pivot-320.png and b/docs/ux-ui/screens/wide-statistics-pivot-320.png differ