From dfea29afc3587e4cb7c63c99435d8a8ed5a0ac55 Mon Sep 17 00:00:00 2001 From: David Braden Date: Thu, 25 Jul 2024 13:23:47 -0600 Subject: [PATCH] display record ip, not record viewer ip (#34) * display record ip, not record viewer ip * correct field name --- ts/sbd-server/src/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ts/sbd-server/src/index.ts b/ts/sbd-server/src/index.ts index 1283276..87074e4 100644 --- a/ts/sbd-server/src/index.ts +++ b/ts/sbd-server/src/index.ts @@ -57,6 +57,7 @@ export default { let opened = 0; let active = 0; let activeBytesReceived = 0; + let recIp = 'no-ip'; if ( 'op' in item.metadata && @@ -76,6 +77,12 @@ export default { ) { activeBytesReceived = item.metadata.br; } + if ( + 'ip' in item.metadata && + typeof item.metadata.ip === 'string' + ) { + recIp = item.metadata.ip; + } const now = common.timestamp(); @@ -92,7 +99,7 @@ export default { openedD, active, activeD, - ip, + ip: recIp, }, activeBytesReceived, );