diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 91540a3c..9df153ec 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -660,7 +660,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -670,7 +670,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -796,7 +796,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -806,7 +806,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -824,7 +824,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -834,7 +834,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -855,7 +855,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -868,7 +868,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -894,7 +894,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -907,7 +907,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -930,7 +930,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -943,7 +943,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -966,7 +966,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -978,7 +978,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -1007,7 +1007,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1019,7 +1019,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -1045,7 +1045,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1057,7 +1057,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/core/utils/platform/auth.dart b/lib/core/utils/platform/auth.dart index 083be6ea..0016b287 100644 --- a/lib/core/utils/platform/auth.dart +++ b/lib/core/utils/platform/auth.dart @@ -41,7 +41,9 @@ abstract final class BioAuth { case AuthResult.success: // wait for animation Future.delayed( - count >= 3 ? const Duration(milliseconds: 500) : const Duration(seconds: 1), + count >= 3 + ? const Duration(milliseconds: 500) + : const Duration(seconds: 1), () => _isAuthing = false, ); break; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 894d01ee..42490b4e 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 = 817; + static const int build = 822; static const String engine = "3.19.3"; - static const String buildAt = "2024-03-19 16:44:04"; + static const String buildAt = "2024-03-21 17:33:04"; static const int modifications = 4; static const int script = 41; } diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart index da342a01..9e70bc70 100644 --- a/lib/view/page/home.dart +++ b/lib/view/page/home.dart @@ -111,7 +111,8 @@ class _HomePageState extends State return Scaffold( drawer: _buildDrawer(), - appBar: CustomAppBar( + appBar: _AppBar( + selectIndex: _selectIndex, centerTitle: false, title: const Text(BuildData.name), actions: [ @@ -357,3 +358,27 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')} } } } + +final class _AppBar extends CustomAppBar { + final ValueNotifier selectIndex; + + const _AppBar({ + required this.selectIndex, + super.title, + super.actions, + super.centerTitle, + }); + + @override + Widget build(BuildContext context) { + return ValueListenableBuilder( + valueListenable: selectIndex, + builder: (_, idx, __) { + if (idx == AppTab.ssh.index) { + return SizedBox(height: CustomAppBar.barHeight); + } + return super.build(context); + }, + ); + } +} diff --git a/lib/view/page/pve.dart b/lib/view/page/pve.dart index e7cd3872..cd55863e 100644 --- a/lib/view/page/pve.dart +++ b/lib/view/page/pve.dart @@ -231,19 +231,13 @@ final class _PvePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ const SizedBox(width: 15), - RichText( - text: TextSpan( - children: [ - TextSpan( - text: _wrapNodeName(item), - style: UIs.text13Bold, - ), - TextSpan( - text: ' / ${item.summary}', - style: UIs.text12Grey, - ), - ], - ), + Text( + _wrapNodeName(item), + style: UIs.text13Bold, + ), + Text( + ' / ${item.summary}', + style: UIs.text12Grey, ), const Spacer(), _buildCtrlBtns(item), @@ -314,19 +308,13 @@ final class _PvePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ const SizedBox(width: 15), - RichText( - text: TextSpan( - children: [ - TextSpan( - text: _wrapNodeName(item), - style: UIs.text13Bold, - ), - TextSpan( - text: ' / ${item.summary}', - style: UIs.text12Grey, - ), - ], - ), + Text( + _wrapNodeName(item), + style: UIs.text13Bold, + ), + Text( + ' / ${item.summary}', + style: UIs.text12Grey, ), const Spacer(), _buildCtrlBtns(item), diff --git a/lib/view/page/ssh/page.dart b/lib/view/page/ssh/page.dart index 27234d45..65c5aff1 100644 --- a/lib/view/page/ssh/page.dart +++ b/lib/view/page/ssh/page.dart @@ -32,14 +32,14 @@ const _echoPWD = 'echo \$PWD'; class SSHPage extends StatefulWidget { final ServerPrivateInfo spi; final String? initCmd; - final bool pop; + final bool notFromTab; final Function()? onSessionEnd; const SSHPage({ super.key, required this.spi, this.initCmd, - this.pop = true, + this.notFromTab = true, this.onSessionEnd, }); @@ -129,7 +129,7 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { _media.padding.top, child: Padding( padding: EdgeInsets.only( - top: CustomAppBar.barHeight ?? 0, + top: widget.notFromTab ? CustomAppBar.barHeight ?? 0 : 0, left: _horizonPadding, right: _horizonPadding, ), @@ -177,9 +177,7 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { Widget _buildVirtualKey() { final rows = _virtKeysList - .map((e) => Row( - children: e.map((ee) => _buildVirtualKeyItem(ee)).toList(), - )) + .map((e) => Row(children: e.map((f) => _buildVirtKeyItem(f)).toList())) .toList(); return Column( mainAxisSize: MainAxisSize.min, @@ -187,7 +185,7 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { ); } - Widget _buildVirtualKeyItem(VirtKey item) { + Widget _buildVirtKeyItem(VirtKey item) { var selected = false; switch (item.key) { case TerminalKey.control: @@ -399,7 +397,7 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { } await session.done; - if (mounted && widget.pop) { + if (mounted && widget.notFromTab) { context.pop(); } widget.onSessionEnd?.call(); diff --git a/lib/view/page/ssh/tab.dart b/lib/view/page/ssh/tab.dart index 37f5ecd0..658a351e 100644 --- a/lib/view/page/ssh/tab.dart +++ b/lib/view/page/ssh/tab.dart @@ -44,7 +44,7 @@ class _SSHTabPageState extends State floatingActionButton: ListenableBuilder( listenable: _fabRN, builder: (_, __) { - if (_fabRN.value == 0) return const SizedBox(); + if (_fabRN.value != 0) return const SizedBox(); return FloatingActionButton( onPressed: () => AppRoute.serverEdit().go(context), tooltip: l10n.addAServer, @@ -127,7 +127,7 @@ class _SSHTabPageState extends State _tabIds[name] = SSHPage( key: key, spi: spi, - pop: false, + notFromTab: false, onSessionEnd: () { // debugPrint("Session done received on page whose tabId = $name"); // debugPrint("key = $key"); diff --git a/lib/view/widget/choice_chip.dart b/lib/view/widget/choice_chip.dart index 6f5d1aca..58324ad5 100644 --- a/lib/view/widget/choice_chip.dart +++ b/lib/view/widget/choice_chip.dart @@ -15,13 +15,14 @@ class ChoiceChipX extends StatelessWidget { @override Widget build(BuildContext context) { - return ChoiceChip( - label: Text(label), - side: BorderSide.none, - padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1), - labelPadding: const EdgeInsets.symmetric(horizontal: 5), - selected: state.selected(value), - onSelected: state.onSelected(value), + return Padding( + padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 3), + child: ChoiceChip( + label: Text(label), + side: BorderSide.none, + selected: state.selected(value), + onSelected: state.onSelected(value), + ), ); } } diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index f7497c9f..d42249c4 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -467,7 +467,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -477,7 +477,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -604,7 +604,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -614,7 +614,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -634,7 +634,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 817; + CURRENT_PROJECT_VERSION = 822; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; @@ -645,7 +645,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.817; + MARKETING_VERSION = 1.0.822; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = "";