@@ -875,17 +875,17 @@ export default function TunnelsPage() {
875875 重试
876876 </ Button >
877877 </ div >
878- ) : (
879- < div className = "flex flex-col items-center gap-4" >
880- < div className = "w-20 h-20 rounded-full bg-default-100 flex items-center justify-center" >
881- < FontAwesomeIcon icon = { faEye } className = "text-3xl text-default-400" />
882- </ div >
883- < div className = "space-y-2" >
884- < p className = "text-default-500 text-base font-medium" > 暂无实例</ p >
885- < p className = "text-default-400 text-sm" > 您还没有创建任何实例</ p >
886- </ div >
878+ ) : (
879+ < div className = "flex flex-col items-center justify-center gap-4 text-center" >
880+ < div className = "w-20 h-20 rounded-full bg-default-100 flex items-center justify-center" >
881+ < FontAwesomeIcon icon = { faEye } className = "text-3xl text-default-400" />
882+ </ div >
883+ < div className = "space-y-2" >
884+ < p className = "text-default-500 text-base font-medium" > 暂无实例</ p >
885+ < p className = "text-default-400 text-sm" > 您还没有创建任何实例</ p >
887886 </ div >
888- ) }
887+ </ div >
888+ ) }
889889 </ div >
890890 ) : (
891891 < Table
@@ -1036,27 +1036,15 @@ export default function TunnelsPage() {
10361036 </ Box >
10371037
10381038 { /* 分页器 - 响应式优化 */ }
1039- < Flex justify = "between" align = "center" className = "w-full px-3 md:px-4 py-3 gap-2 md:gap-4 flex-col lg:flex-row" >
1040- { /* 左侧:统计信息 */ }
1041- < Box className = "text-xs md:text-sm text-default-500 order-3 lg:order-1" >
1042- { loading ? (
1043- < div className = "flex items-center gap-2" >
1044- < Spinner size = "sm" />
1045- < span > 统计中...</ span >
1046- </ div >
1047- ) : (
1039+ { ! loading && ! error && filteredItems . length > 0 && (
1040+ < Flex justify = "between" align = "center" className = "w-full px-3 md:px-4 py-3 gap-2 md:gap-4 flex-col lg:flex-row" >
1041+ { /* 左侧:统计信息 */ }
1042+ < Box className = "text-xs md:text-sm text-default-500 order-3 lg:order-1" >
10481043 < span > 共 { filteredItems . length } 个实例</ span >
1049- ) }
1050- </ Box >
1051-
1052- { /* 中间:分页器 */ }
1053- < div className = "order-1 lg:order-2" >
1054- { loading ? (
1055- < div className = "flex items-center gap-2" >
1056- < Spinner size = "sm" />
1057- < span className = "text-sm text-default-500" > 分页加载中...</ span >
1058- </ div >
1059- ) : (
1044+ </ Box >
1045+
1046+ { /* 中间:分页器 */ }
1047+ < div className = "order-1 lg:order-2" >
10601048 < Pagination
10611049 loop
10621050 total = { pages || 1 }
@@ -1069,29 +1057,29 @@ export default function TunnelsPage() {
10691057 item : "text-xs md:text-sm"
10701058 } }
10711059 />
1072- ) }
1073- </ div >
1060+ </ div >
10741061
1075- { /* 右侧:每页数量选择器 */ }
1076- < div className = "flex items-center gap-2 order-2 lg:order-3" >
1077- < span className = "text-xs text-default-400" > 每页显示:</ span >
1078- < Select
1079- size = "sm"
1080- className = "w-20"
1081- selectedKeys = { [ String ( rowsPerPage ) ] }
1082- onSelectionChange = { ( keys ) => {
1083- const value = Array . from ( keys ) [ 0 ] as string ;
1084- setRowsPerPage ( Number ( value ) ) ;
1085- setPage ( 1 ) ;
1086- } }
1087- >
1088- < SelectItem key = "10" > 10</ SelectItem >
1089- < SelectItem key = "20" > 20</ SelectItem >
1090- < SelectItem key = "50" > 50</ SelectItem >
1091- < SelectItem key = "100" > 100</ SelectItem >
1092- </ Select >
1093- </ div >
1094- </ Flex >
1062+ { /* 右侧:每页数量选择器 */ }
1063+ < div className = "flex items-center gap-2 order-2 lg:order-3" >
1064+ < span className = "text-xs text-default-400" > 每页显示:</ span >
1065+ < Select
1066+ size = "sm"
1067+ className = "w-20"
1068+ selectedKeys = { [ String ( rowsPerPage ) ] }
1069+ onSelectionChange = { ( keys ) => {
1070+ const value = Array . from ( keys ) [ 0 ] as string ;
1071+ setRowsPerPage ( Number ( value ) ) ;
1072+ setPage ( 1 ) ;
1073+ } }
1074+ >
1075+ < SelectItem key = "10" > 10</ SelectItem >
1076+ < SelectItem key = "20" > 20</ SelectItem >
1077+ < SelectItem key = "50" > 50</ SelectItem >
1078+ < SelectItem key = "100" > 100</ SelectItem >
1079+ </ Select >
1080+ </ div >
1081+ </ Flex >
1082+ ) }
10951083 </ Flex >
10961084 </ div >
10971085
0 commit comments