fix(traffic): исправить пики, историю и итоги трафика
Docker images / prepare-release (push) Successful in 12s
Docker images / backend-test (push) Successful in 10m29s
Docker images / frontend-image (push) Successful in 2m55s
Docker images / updater-image (push) Successful in 1m38s
Docker images / netflow-agent-image (push) Successful in 32s
Docker images / backend-image (push) Successful in 3m38s
Docker images / publish-release (push) Successful in 12s
Docker images / notify-webhook (push) Successful in 2s

This commit is contained in:
Denozordec committed 2026-11-22 16:57:52 +07:00
1 parent 165f5e1260
commit e85e347cbe
26 files changed
+465 -119

No files matched your search

@@ -22,8 +22,8 @@ import { getFlowMonthly } from "../../services/traffic-flow-analytics.js"
import { readPublicTrafficSettings, updateTrafficSettings } from "../../services/traffic-collector.js"
import { readUptimeSettings, updateUptimeSettings, readProbeRows, replaceProbes } from "../../services/uptime-collector.js"
import { readSpeedProbeCatalog, replaceSpeedProbeCatalog } from "../../services/speed-probe-catalog.js"
import { getTrafficFlowSettingsRow, toTrafficFlowSettingsDto } from "../../services/traffic-flow-settings.js"
import { getFlowListenerState } from "../../services/traffic-flow-ingest.js"
import { getTrafficFlowSettingsRow } from "../../services/traffic-flow-settings.js"
import { readTrafficFlowSettingsStatus } from "../../services/traffic-flow-ingest.js"
import { withFlowConfigurationLock, getFlowHostStatus, reconcileFlowHost } from "../../services/traffic-flow-host-agent.js"
import { agentSocket } from "../../services/traffic-flow-agent-client.js"
import { getStatistics, getStatisticsPivot, pivotDimsConflict } from "../../services/statistics-aggregate.js"
@@ -185,7 +185,7 @@ export function registerApplicationActions(register: typeof add) {
change("traffic.settings.update", "mm_traffic_settings_update_plan", "План настроек сбора трафика", "mm:traffic:write", z.object({ settings: trafficSettings }).strict(), readTrafficConfiguration, async input => { const result = await updateTrafficSettings(trafficSettings.parse(input.settings)); await refreshScheduler(); return result })
query("uptime.settings.read", "mm_uptime_settings_get", "Настройки мониторинга и проб", "mm:uptime:read", async () => readUptimeSettings())
change("uptime.settings.update", "mm_uptime_settings_update_plan", "План расписания мониторинга и проб", "mm:uptime:write", z.object({ settings: uptimeSettings }).strict(), readUptimeConfiguration, async input => { const result = await updateUptimeSettings(uptimeSettings.parse(input.settings)); await refreshScheduler(); return result })
query("netflow.settings.read", "mm_netflow_settings_get", "Публичные настройки NetFlow", "mm:traffic:read", async () => toTrafficFlowSettingsDto(getFlowListenerState()))
query("netflow.settings.read", "mm_netflow_settings_get", "Публичные настройки NetFlow", "mm:traffic:read", readTrafficFlowSettingsStatus)
query("scheduler.runs", "mm_scheduler_runs_list", "История заданий", "mm:settings:admin", async input => listSchedulerRuns({ limit: Number(input.limit), offset: Number(input.offset), jobKey: input.jobKey as string | undefined }), z.object({ ...paging, jobKey: z.enum(JOB_KEYS).optional() }).strict())
query("servers.api-ping.settings.read", "mm_servers_api_ping_settings_get", "Настройки API-ping серверов", "mm:servers:read", async () => getServersApiPingSettings())
change("servers.api-ping.settings.update", "mm_servers_api_ping_settings_update_plan", "План API-ping серверов", "mm:servers:write", z.object({ settings: z.object({ enabled: z.boolean().optional(), intervalSec: z.number().int().min(10).max(86400).optional() }).strict().refine(value => Object.keys(value).length > 0) }).strict(), readServersApiPingConfiguration, async input => { const result = await updateServersApiPingSettings(input.settings as Parameters<typeof updateServersApiPingSettings>[0]); await refreshScheduler(); return result })
@@ -25,6 +25,7 @@ export function registerLegacyFlowAnalyticsAction(register: typeof add) {
{ serverIds: context.connection.policy.scope.serverIds, maxRows: 20000, authorize }), context.signal)
return {
serverId: input.serverId, source: "PostgreSQL/flow_buckets", observedAt: new Date().toISOString(), sourceWindow: result.sourceWindow,
timeBasis: result.timeBasis, admittedTotals: result.admittedTotals,
bpsNow: result.bpsNow, bytes: result.bytes, packets: result.packets, conversations: result.conversations,
uniqueSrc: result.uniqueSrc, uniqueDst: result.uniqueDst, rxSeries: result.rxSeries, txSeries: result.txSeries,
applications: result.applications, protocols: result.protocols, countries: result.countries,