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;