]> PHS Git Server - phs-api.git/commitdiff
Testing vpn paths.
authorcharleswrayjr <charleswrayjr@gmail.com>
Mon, 8 Sep 2025 16:14:21 +0000 (11:14 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Mon, 8 Sep 2025 16:14:21 +0000 (11:14 -0500)
src/controllers/vpn.controller.js

index ebac4484ee93a6f4b57170ff11b973e008115f04..5d581b3b738599860f8734a6ee9f912364ce4c45 100644 (file)
@@ -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' ) );