From 755bd45a0b3a68572e3479a9842de40cf797e468 Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Sat, 4 Apr 2026 23:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8F=E7=AD=96?= =?UTF-8?q?=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index f8a9a29..f6b0d93 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -395,10 +395,12 @@ filtered = allServersData.filter(s => s.source === currentSourceFilter); } - // Sort before paginating + // Sort servers: online first, then alphabetically by name (job) filtered.sort((a, b) => { - if (a.up !== b.up) return b.up ? 1 : -1; - return b.cpuPercent - a.cpuPercent; + if (a.up !== b.up) return a.up ? -1 : 1; + const nameA = a.job || ''; + const nameB = b.job || ''; + return nameA.localeCompare(nameB); }); const totalFiltered = filtered.length;