diff --git a/src/www/js/app.js b/src/www/js/app.js index c257fc1f..96976951 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -34,6 +34,12 @@ new Vue({ if (!this.authenticated) return; const clients = await this.api.getClients(); + + // Sort clients by last IP number + clients.sort((clientA, clientB) => { + return +clientA.address.split('.').pop() - +clientB.address.split('.').pop(); + }); + this.clients = clients.map(client => { if (client.name.includes('@') && client.name.includes('.')) { client.avatar = `https://www.gravatar.com/avatar/${md5(client.name)}?d=blank`;