fix(map): показывать скорость сервисов по короткому окну IPFIX
Docker images / prepare-release (push) Successful in 11s
Docker images / backend-test (push) Successful in 3s
Docker images / frontend-image (push) Successful in 2m14s
Docker images / updater-image (push) Successful in 39s
Docker images / netflow-agent-image (push) Successful in 31s
Docker images / backend-image (push) Successful in 15s
Docker images / publish-release (push) Successful in 11s
Docker images / notify-webhook (push) Successful in 2s

This commit is contained in:
Denozordec committed 2026-11-27 13:08:08 +07:00
1 parent ed7b1e0350
commit c44bcd8f59
14 files changed
+261 -120

No files matched your search

+9 -4
View File
@@ -112,9 +112,11 @@ export function NodeHistory({ base, id, refresh, degraded }: { base: string | nu
</>
}
export function ServiceInspector({ service, paths, exits, exitName, country, base, refresh, windowLabel, flowAt, stale, activePath, onPath, onClose, filtered, onFilter, userId, ix, topology }: {
export function ServiceInspector({ service, paths, exits, exitName, country, base, refresh, windowLabel, history, shareOfVisible, flowAt, stale, activePath, onPath, onClose, filtered, onFilter, userId, ix, topology }: {
service: FlowMapService; paths: FlowMapServicePath[]; exits: FlowMapServiceEdge[]; exitName: (id: string) => string
country?: string; base: string | null; refresh: number; windowLabel: string; flowAt: string | null; stale: boolean
history?: {service?: FlowMapService; window: string}
shareOfVisible: boolean
activePath: FlowMapServicePath | null; onPath: (path: FlowMapServicePath) => void
onClose: () => void; filtered: boolean; onFilter: () => void
userId?: string; ix?: boolean; topology?: ReadonlySet<string>
@@ -157,6 +159,9 @@ export function ServiceInspector({ service, paths, exits, exitName, country, bas
const remainder = Math.max(0, service.bytes - attributedBytes)
const observed = service.bytes > 0 && !stale
const currentVolume = base === null || scoped
const average = history ? history.service : service
const averageWindow = history?.window ?? windowLabel
const volumeBytes = currentVolume ? average?.bytes : volume?.bytes
const trafficTypes = service.trafficTypes ?? []
const serviceEvidence = service.serviceEvidence ?? []
const otherTypeBytes = Math.max(0, service.bytes - trafficTypes.reduce((sum, row) => sum + row.bytes, 0))
@@ -181,9 +186,9 @@ export function ServiceInspector({ service, paths, exits, exitName, country, bas
</header>
<div className="mx-0.5 mb-0.5 min-h-0 overflow-y-auto rounded-lg border">
<InspectorMetrics rows={[
["Средняя скорость IPFIX", formatNetflowRate({ bps: service.bps }), "Сохранённые потоки за " + windowLabel],
[country ? "Доля страны" : "Доля трафика", percent.format(service.share)],
["Объём · " + (currentVolume ? windowLabel : volume?.window ?? "24 ч"), <>{currentVolume ? formatBytes(service.bytes) : volume?.bytes == null ? "—" : formatBytes(volume.bytes)}{volume && <time dateTime={volume.at} title={new Date(volume.at).toLocaleString("ru-RU")} className="block text-[10px] font-normal text-muted-foreground">ответ {new Date(volume.at).toLocaleTimeString("ru-RU")}</time>}</>],
["Средняя за " + averageWindow, average ? formatNetflowRate(average) : "—", "Скорость по сохранённым потокам IPFIX"],
[shareOfVisible ? "Доля показанных сервисов" : country ? "Доля страны" : "Доля трафика", percent.format(service.share), "IPFIX · " + windowLabel],
["Объём · " + (currentVolume ? averageWindow : volume?.window ?? "24 ч"), <>{volumeBytes == null ? "—" : formatBytes(volumeBytes)}{!currentVolume && volume && <time dateTime={volume.at} title={new Date(volume.at).toLocaleString("ru-RU")} className="block text-[10px] font-normal text-muted-foreground">ответ {new Date(volume.at).toLocaleTimeString("ru-RU")}</time>}</>],
exitIds.length || !exporterIds.length
? ["Exit-узел", exitIds.map(exitName).join(", ") || "—", remainder || exporterIds.length ? "Часть трафика без подтверждённого выхода" : undefined]
: ["Экспортёр", exporterIds.map(exitName).join(", "), "Наблюдение IPFIX, дальнейший маршрут не подтверждён"],