From 6b5458157390098169f5172bf25f2f1f12a692fe Mon Sep 17 00:00:00 2001 From: Raul Date: Sat, 19 Jun 2021 13:04:33 +0200 Subject: [PATCH] Added sort clients on webUI by last IP number --- src/www/js/app.js | 6 ++++++ 1 file changed, 6 insertions(+) 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`;