From: charleswrayjr Date: Mon, 8 Sep 2025 16:14:21 +0000 (-0500) Subject: Testing vpn paths. X-Git-Url: https://git.phasecustomsoft.com/%7B%60$%7BAPI_BASE_URL%7D/file/$%7Bf.id%7D/%7B?a=commitdiff_plain;h=390c5b16c55cfb0199a5068e076cbd4fb649c62a;p=phs-api.git Testing vpn paths. --- 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' ) );