File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535
3636 < section class ="ops-overview " id ="overviewCards " aria-label ="运行概览 "> </ section >
3737
38- < section class ="ops-toolbar " id ="serversToolbar " aria-label ="主机筛选 ">
38+ < section class ="ops-toolbar " id ="serversToolbar " aria-label ="主机筛选 " style =" display:none; " >
3939 < label class ="search-field ">
4040 < span > 搜索</ span >
4141 < input id ="serverSearch " type ="search " autocomplete ="off " placeholder ="节点 / 地区 / 系统 / 主机名 " />
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ function visibleServers(){
201201
202202function render ( ) {
203203 $ ( 'notice' ) . style . display = 'none' ;
204+ normalizeServersToolbarState ( ) ;
204205 renderOverview ( ) ;
205206 renderOsOptions ( ) ;
206207 renderServers ( ) ;
@@ -242,6 +243,11 @@ function alertStats(){
242243 return stats ;
243244}
244245
246+ function normalizeServersToolbarState ( ) {
247+ const show = S . activeTab === 'servers' && S . servers . length > 10 ;
248+ $ ( 'serversToolbar' ) . style . display = show ? 'flex' : 'none' ;
249+ }
250+
245251function renderOsOptions ( ) {
246252 const select = $ ( 'osFilter' ) ;
247253 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(){
540546 S . activeTab = tab ;
541547 document . querySelectorAll ( '.nav button' ) . forEach ( btn => btn . classList . toggle ( 'active' , btn === e . target ) ) ;
542548 document . querySelectorAll ( '.panel' ) . forEach ( panel => panel . classList . toggle ( 'active' , panel . id === 'panel-' + tab ) ) ;
543- $ ( 'serversToolbar' ) . style . display = tab === 'servers' ? 'flex' : 'none' ;
549+ normalizeServersToolbarState ( ) ;
544550 if ( tab === 'config' ) ensureAdminChecked ( ) ;
545551 } ) ;
546552}
You can’t perform that action at this time.
0 commit comments