From 390c5b16c55cfb0199a5068e076cbd4fb649c62a Mon Sep 17 00:00:00 2001 From: charleswrayjr Date: Mon, 8 Sep 2025 11:14:21 -0500 Subject: [PATCH] Testing vpn paths. --- src/controllers/vpn.controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index ebac448..5d581b3 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -126,9 +126,10 @@ module.exports = { if (client) client.virtual_ip = parts[0]; } - console.log('clientsMap: ', clientsMap); + const clientsArray = Array.from(clientsMap.values()).sort((a, b) => Date.parse(b.connectedSince) - Date.parse(a.connectedSince)); + console.log('clients: ', clientsArray); - res.json(clientsMap.values()); + res.json(clientsArray); /*const lines = output.split( '\n' ); const sIndex = lines.findIndex( line => line.startsWith( 'Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since' ) ); const mIndex = lines.findIndex( line => line.startsWith( 'ROUTING TABLE' ) ); -- 2.43.0