From 0abdac82de3fd53fa0eeaae672a3681918191a9a Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 16 Oct 2026 15:45:10 +0700 Subject: [PATCH] =?UTF-8?q?fix(netflow):=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D1=82=D0=B5=D0=BA=D1=83=D1=89?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D1=87=D1=91=D1=82=D1=87=D0=B8=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=D1=91=D0=BC=D0=BD=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/routes/traffic-flow.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/routes/traffic-flow.ts b/backend/src/routes/traffic-flow.ts index cbf6d44d..f2eba30e 100644 --- a/backend/src/routes/traffic-flow.ts +++ b/backend/src/routes/traffic-flow.ts @@ -19,6 +19,7 @@ import { } from "../services/traffic-flow-settings.js" import { getFlowListenerState, + getFlowRuntimeCounters, purgeTrafficFlowStore, startTrafficFlowListener, listFlowTalkers, @@ -158,7 +159,11 @@ const trafficFlowRoutes: FastifyPluginAsyncZod = async (app) => { reconcile: () => withFlowConfigurationLock(reconcileFlowHost), })) await app.register(createTrafficFlowSettingsRoutes({ - read: () => toTrafficFlowSettingsDto(getFlowListenerState()), + read: async () => { + const settings = await toTrafficFlowSettingsDto(getFlowListenerState()) + const { packetsReceived, lastExporterIp, lastError, lastDatagramAt } = await getFlowRuntimeCounters() + return { ...settings, packetsReceived, lastExporterIp, lastError, lastDatagramAt } + }, update: async patch => { await withFlowConfigurationLock(async () => { const current = await getTrafficFlowSettingsRow() if (agentSocket() && (["collectorIp", "prefix", "flowListenPort", "wgListenPort"] as const).some(key => patch[key] !== undefined && patch[key] !== current[key])) {