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' ) );