mirror of
https://github.com//cppla/ServerStatus
synced 2026-08-06 11:13:56 +08:00
少于10时折叠筛选
This commit is contained in:
+7
-1
@@ -201,6 +201,7 @@ function visibleServers(){
|
||||
|
||||
function render(){
|
||||
$('notice').style.display = 'none';
|
||||
normalizeServersToolbarState();
|
||||
renderOverview();
|
||||
renderOsOptions();
|
||||
renderServers();
|
||||
@@ -242,6 +243,11 @@ function alertStats(){
|
||||
return stats;
|
||||
}
|
||||
|
||||
function normalizeServersToolbarState(){
|
||||
const show = S.activeTab === 'servers' && S.servers.length > 10;
|
||||
$('serversToolbar').style.display = show ? 'flex' : 'none';
|
||||
}
|
||||
|
||||
function renderOsOptions(){
|
||||
const select = $('osFilter');
|
||||
const labels = [...new Set(S.servers.map(s => osLabel(s.os)).filter(Boolean))].sort((a,b)=>a.localeCompare(b,'zh-CN'));
|
||||
@@ -540,7 +546,7 @@ function bindTabs(){
|
||||
S.activeTab = tab;
|
||||
document.querySelectorAll('.nav button').forEach(btn => btn.classList.toggle('active', btn === e.target));
|
||||
document.querySelectorAll('.panel').forEach(panel => panel.classList.toggle('active', panel.id === 'panel-' + tab));
|
||||
$('serversToolbar').style.display = tab === 'servers' ? 'flex' : 'none';
|
||||
normalizeServersToolbarState();
|
||||
if(tab === 'config') ensureAdminChecked();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user