diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 7d34455b..2f00eb78 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -586,7 +586,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -596,7 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -720,7 +720,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -730,7 +730,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -748,7 +748,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -758,7 +758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -779,7 +779,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -792,7 +792,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -818,7 +818,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -831,7 +831,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -854,7 +854,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -867,7 +867,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -890,7 +890,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -902,7 +902,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -931,7 +931,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -943,7 +943,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -969,7 +969,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 618; + CURRENT_PROJECT_VERSION = 622; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -981,7 +981,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.618; + MARKETING_VERSION = 1.0.622; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 06291e53..ae74c2d7 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 618; + static const int build = 622; static const String engine = "3.13.8"; - static const String buildAt = "2023-10-31 15:59:28"; - static const int modifications = 7; - static const int script = 23; + static const String buildAt = "2023-10-31 20:16:41"; + static const int modifications = 2; + static const int script = 25; } diff --git a/lib/data/res/ui.dart b/lib/data/res/ui.dart index e57f50cd..264530a7 100644 --- a/lib/data/res/ui.dart +++ b/lib/data/res/ui.dart @@ -7,10 +7,16 @@ class UIs { static const textSize9Grey = TextStyle(color: Colors.grey, fontSize: 9); static const textSize11 = TextStyle(fontSize: 11); + static const textSize11Bold = TextStyle( + fontSize: 11, + fontWeight: FontWeight.w500, + ); static const textSize11Grey = TextStyle(color: Colors.grey, fontSize: 11); static const textSize13 = TextStyle(fontSize: 13); - static const textSize13Bold = - TextStyle(fontSize: 13, fontWeight: FontWeight.bold); + static const textSize13Bold = TextStyle( + fontSize: 13, + fontWeight: FontWeight.bold, + ); static const textSize13Grey = TextStyle(color: Colors.grey, fontSize: 13); static const textSize15 = TextStyle(fontSize: 15); static const textSize18 = TextStyle(fontSize: 18); diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index b3e63d7a..141e892f 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -134,25 +134,24 @@ class _ServerDetailPageState extends State } return CardX( - Padding( - padding: UIs.roundRectCardPadding, - child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - _buildAnimatedText( - ValueKey(percent), - '$percent%', - UIs.textSize27, - ), - Row( - children: details, - ) - ], - ), - UIs.height13, - _buildCPUProgress(ss.cpu) - ]), + ExpandTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _buildAnimatedText( + ValueKey(percent), + '$percent%', + UIs.textSize27, + ), + Row( + mainAxisSize: MainAxisSize.min, + children: details, + ), + ], + ), + childrenPadding: const EdgeInsets.symmetric(vertical: 13), + initiallyExpanded: ss.cpu.coresCount <= 8, + children: _buildCPUProgress(ss.cpu), ), ); } @@ -177,18 +176,18 @@ class _ServerDetailPageState extends State ); } - Widget _buildCPUProgress(Cpus cs) { + List _buildCPUProgress(Cpus cs) { final children = []; for (var i = 0; i < cs.coresCount; i++) { if (i == 0) continue; children.add( Padding( - padding: const EdgeInsets.all(2), + padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 17), child: _buildProgress(cs.usedPercent(coreIdx: i)), ), ); } - return Column(children: children); + return children; } Widget _buildProgress(double percent) { @@ -320,6 +319,7 @@ class _ServerDetailPageState extends State return CardX( ExpandTile( title: Text(l10n.disk), + childrenPadding: EdgeInsets.zero, leading: const Icon(Icons.storage, size: 17), initiallyExpanded: children.length <= 7, children: children, @@ -330,30 +330,36 @@ class _ServerDetailPageState extends State Widget _buildDiskItem(Disk disk, ServerStatus ss) { final (read, write) = ss.diskIO.getReadSpeed(disk.dev); final text = () { - final use = '${disk.usedPercent}% of ${disk.size}'; + final use = '${disk.used} / ${disk.size}'; if (read == null || write == null) return use; - return '$use\n↑ $read | ↓ $write'; + return '$use\nR $read | W $write'; }(); return ListTile( title: Text( disk.dev, - style: UIs.textSize13Bold, + style: UIs.textSize11Bold, textScaleFactor: _textFactor, ), - contentPadding: const EdgeInsets.symmetric(vertical: 3, horizontal: 17), + contentPadding: const EdgeInsets.symmetric(horizontal: 17), subtitle: Text( text, - style: UIs.textSize11, + style: UIs.textSize11Grey, textScaleFactor: _textFactor, ), trailing: SizedBox( height: 37, width: 37, - child: CircularProgressIndicator( - value: disk.usedPercent / 100, - strokeWidth: 7, - backgroundColor: DynamicColors.progress.resolve(context), - valueColor: AlwaysStoppedAnimation(primaryColor), + child: Stack( + alignment: Alignment.center, + children: [ + CircularProgressIndicator( + value: disk.usedPercent / 100, + strokeWidth: 5, + backgroundColor: DynamicColors.progress.resolve(context), + color: primaryColor, + ), + Text('${disk.usedPercent}%', style: UIs.textSize9Grey) + ], ), ), ); @@ -413,14 +419,14 @@ class _ServerDetailPageState extends State return ListTile( title: Text( device, - style: UIs.textSize13Bold, + style: UIs.textSize11Bold, textScaleFactor: _textFactor, maxLines: 1, overflow: TextOverflow.ellipsis, ), subtitle: Text( '${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}', - style: UIs.textSize11, + style: UIs.textSize11Grey, textScaleFactor: _textFactor, ), trailing: SizedBox( @@ -428,6 +434,7 @@ class _ServerDetailPageState extends State child: Text( '↑ ${ns.speedOut(device: device)}\n↓ ${ns.speedIn(device: device)}', textAlign: TextAlign.end, + style: UIs.textSize11Grey, ), ), ); @@ -464,6 +471,7 @@ class _ServerDetailPageState extends State text, style: style, textScaleFactor: _textFactor, + textAlign: TextAlign.left, ), transitionBuilder: (child, animation) => FadeTransition( opacity: animation, diff --git a/lib/view/widget/expand_tile.dart b/lib/view/widget/expand_tile.dart index 99f1415f..d09797bc 100644 --- a/lib/view/widget/expand_tile.dart +++ b/lib/view/widget/expand_tile.dart @@ -10,5 +10,9 @@ class ExpandTile extends ExpansionTile { super.children, super.subtitle, super.initiallyExpanded, + super.tilePadding, + super.childrenPadding, + super.trailing, + super.controller, }) : super(shape: _shape, collapsedShape: _shape); }