diff --git a/web/index.html b/web/index.html index 47e57d6..faeb3ea 100644 --- a/web/index.html +++ b/web/index.html @@ -35,7 +35,7 @@ - + 搜索 diff --git a/web/js/app.js b/web/js/app.js index 5c39780..e7ef5b8 100644 --- a/web/js/app.js +++ b/web/js/app.js @@ -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(); }); }