diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 125a68f5..38ea1d8e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -470,7 +470,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -478,7 +478,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -602,7 +602,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -610,7 +610,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -628,7 +628,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -636,7 +636,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -657,7 +657,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -670,7 +670,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -696,7 +696,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -709,7 +709,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -732,7 +732,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -745,7 +745,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 2fcf1c99..0e3ceca5 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,8 +2,8 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 450; + static const int build = 451; static const String engine = "3.10.6"; - static const String buildAt = "2023-08-08 14:47:37.806229"; - static const int modifications = 9; + static const String buildAt = "2023-08-08 15:07:48.571249"; + static const int modifications = 3; } diff --git a/lib/view/page/process.dart b/lib/view/page/process.dart index 8d1c1998..8985e5d3 100644 --- a/lib/view/page/process.dart +++ b/lib/view/page/process.dart @@ -27,6 +27,8 @@ class ProcessPage extends StatefulWidget { class _ProcessPageState extends State { late S _s; late Timer _timer; + late MediaQueryData _media; + SSHClient? _client; PsResult _result = PsResult(procs: []); @@ -46,6 +48,13 @@ class _ProcessPageState extends State { _timer = Timer.periodic(const Duration(seconds: 3), (_) => _refresh()); } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + _s = S.of(context)!; + _media = MediaQuery.of(context); + } + Future _refresh() async { if (mounted) { final result = await _client?.run('ps -aux'.withLangExport).string; @@ -66,12 +75,6 @@ class _ProcessPageState extends State { _timer.cancel(); } - @override - void didChangeDependencies() { - super.didChangeDependencies(); - _s = S.of(context)!; - } - @override Widget build(BuildContext context) { final actions = [ @@ -109,7 +112,18 @@ class _ProcessPageState extends State { padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 7), itemBuilder: (ctx, idx) { final proc = _result.procs[idx]; - return _buildListItem(proc); + return AnimatedSwitcher( + duration: const Duration(milliseconds: 277), + switchInCurve: Curves.easeIn, + switchOutCurve: Curves.easeOut, + transitionBuilder: (child, animation) { + return FadeTransition( + opacity: animation, + child: child, + ); + }, + child: _buildListItem(proc), + ); }, ); } @@ -124,46 +138,49 @@ class _ProcessPageState extends State { } Widget _buildListItem(Proc proc) { - return RoundRectCard(ListTile( - leading: SizedBox( - width: 57, - child: TwoLineText(up: proc.pid.toString(), down: proc.user), - ), - title: Text(proc.binary), - subtitle: Text( - proc.command, - style: grey, - maxLines: 3, - overflow: TextOverflow.fade, - ), - trailing: Row( - mainAxisSize: MainAxisSize.min, - children: [ - TwoLineText(up: proc.cpu.toStringAsFixed(1), down: 'cpu'), - width13, - TwoLineText(up: proc.mem.toStringAsFixed(1), down: 'mem'), - ], - ), - onTap: () => _lastFocusId = proc.pid, - onLongPress: () { - showRoundDialog( - context: context, - title: Text(_s.attention), - child: Text(_s.sureStop(proc.pid)), - actions: [ - TextButton( - onPressed: () async { - await _client?.run('kill ${proc.pid}'); - await _refresh(); - context.pop(); - }, - child: Text(_s.ok), - ), + return RoundRectCard( + ListTile( + leading: SizedBox( + width: _media.size.width / 6, + child: TwoLineText(up: proc.pid.toString(), down: proc.user), + ), + title: Text(proc.binary), + subtitle: Text( + proc.command, + style: grey, + maxLines: 3, + overflow: TextOverflow.fade, + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + TwoLineText(up: proc.cpu.toStringAsFixed(1), down: 'cpu'), + width13, + TwoLineText(up: proc.mem.toStringAsFixed(1), down: 'mem'), ], - ); - }, - selected: _lastFocusId == proc.pid, - autofocus: _lastFocusId == proc.pid, - )); + ), + onTap: () => _lastFocusId = proc.pid, + onLongPress: () { + showRoundDialog( + context: context, + title: Text(_s.attention), + child: Text(_s.sureStop(proc.pid)), + actions: [ + TextButton( + onPressed: () async { + await _client?.run('kill ${proc.pid}'); + await _refresh(); + context.pop(); + }, + child: Text(_s.ok), + ), + ], + ); + }, + selected: _lastFocusId == proc.pid, + autofocus: _lastFocusId == proc.pid, + ), + key: ValueKey(proc.pid), + ); } } diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 5b9244f4..1998a121 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -475,9 +475,9 @@ baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -490,9 +490,9 @@ baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -505,9 +505,9 @@ baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 450; + CURRENT_PROJECT_VERSION = 451; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.450; + MARKETING_VERSION = 1.0.451; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0;