From d94b2a7805891da3e652a9a65cc0c774a2ec6db4 Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Sun, 21 Apr 2024 11:57:51 +0800 Subject: [PATCH] fix: `preferTempDev` --- ios/Runner.xcodeproj/project.pbxproj | 36 +++++++++++++------------- lib/data/model/server/custom.dart | 9 +++++-- lib/data/model/server/custom.g.dart | 7 +++-- lib/data/res/build_data.dart | 8 +++--- lib/view/page/server/edit.dart | 17 +++++++----- macos/Runner.xcodeproj/project.pbxproj | 12 ++++----- 6 files changed, 50 insertions(+), 39 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 01f6a43f7..33cdf7567 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -672,7 +672,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -682,7 +682,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -808,7 +808,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -818,7 +818,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -836,7 +836,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -846,7 +846,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -867,7 +867,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -880,7 +880,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -906,7 +906,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -919,7 +919,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -942,7 +942,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -955,7 +955,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -978,7 +978,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -990,7 +990,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -1019,7 +1019,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1031,7 +1031,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -1057,7 +1057,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1069,7 +1069,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/data/model/server/custom.dart b/lib/data/model/server/custom.dart index 91b0dc026..bfb9630d9 100644 --- a/lib/data/model/server/custom.dart +++ b/lib/data/model/server/custom.dart @@ -10,12 +10,12 @@ final class ServerCustom { final String? pveAddr; @HiveField(2, defaultValue: false) final bool pveIgnoreCert; - @HiveField(3) - final String? preferTempDev; /// {"title": "cmd"} @HiveField(3) final Map? cmds; + @HiveField(4) + final String? preferTempDev; const ServerCustom({ //this.temperature, @@ -58,4 +58,9 @@ final class ServerCustom { } return json; } + + @override + String toString() { + return toJson().toString(); + } } diff --git a/lib/data/model/server/custom.g.dart b/lib/data/model/server/custom.g.dart index 5fa9aff32..d74ba30c4 100644 --- a/lib/data/model/server/custom.g.dart +++ b/lib/data/model/server/custom.g.dart @@ -20,19 +20,22 @@ class ServerCustomAdapter extends TypeAdapter { pveAddr: fields[1] as String?, pveIgnoreCert: fields[2] == null ? false : fields[2] as bool, cmds: (fields[3] as Map?)?.cast(), + preferTempDev: fields[4] as String?, ); } @override void write(BinaryWriter writer, ServerCustom obj) { writer - ..writeByte(3) + ..writeByte(4) ..writeByte(1) ..write(obj.pveAddr) ..writeByte(2) ..write(obj.pveIgnoreCert) ..writeByte(3) - ..write(obj.cmds); + ..write(obj.cmds) + ..writeByte(4) + ..write(obj.preferTempDev); } @override diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 11962b9a4..cc9a8e074 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 = 852; + static const int build = 867; static const String engine = "3.19.5"; - static const String buildAt = "2024-04-15 09:41:06"; - static const int modifications = 4; - static const int script = 44; + static const String buildAt = "2024-04-21 01:05:20"; + static const int modifications = 2; + static const int script = 45; } diff --git a/lib/view/page/server/edit.dart b/lib/view/page/server/edit.dart index edf82544d..ff11e7cc1 100644 --- a/lib/view/page/server/edit.dart +++ b/lib/view/page/server/edit.dart @@ -346,9 +346,9 @@ class _ServerEditPageState extends State { ListTile( title: Text(l10n.addPrivateKey), contentPadding: const EdgeInsets.symmetric(horizontal: 17), - trailing: IconButton( - icon: const Icon(Icons.add), - onPressed: () {}, + trailing: const Padding( + padding: EdgeInsets.only(right: 13), + child: Icon(Icons.add), ), onTap: () => AppRoute.keyEdit().go(context), ), @@ -457,7 +457,10 @@ class _ServerEditPageState extends State { .toList(); children.add(ListTile( title: Text(l10n.clear), - trailing: IconButton(onPressed: () {}, icon: const Icon(Icons.clear)), + trailing: const Padding( + padding: EdgeInsets.only(right: 13), + child: Icon(Icons.clear), + ), onTap: () => _jumpServer.value = null, contentPadding: const EdgeInsets.symmetric(horizontal: 17), )); @@ -493,7 +496,7 @@ class _ServerEditPageState extends State { ) ], ); - if (cancel ?? true) { + if (cancel != false) { return; } } @@ -531,12 +534,12 @@ class _ServerEditPageState extends State { ip: _ipController.text, port: int.parse(_portController.text), user: _usernameController.text, - pwd: _passwordController.text.isEmpty ? null : _passwordController.text, + pwd: _passwordController.text.selfIfNotNullEmpty, keyId: _keyIdx.value != null ? Pros.key.pkis.elementAt(_keyIdx.value!).id : null, tags: _tags, - alterUrl: _altUrlController.text.isEmpty ? null : _altUrlController.text, + alterUrl: _altUrlController.text.selfIfNotNullEmpty, autoConnect: _autoConnect.value, jumpId: _jumpServer.value, custom: custom, diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 9968e1d34..d60c5dac3 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -471,7 +471,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -481,7 +481,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -608,7 +608,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -618,7 +618,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -638,7 +638,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 859; + CURRENT_PROJECT_VERSION = 867; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; @@ -649,7 +649,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.859; + MARKETING_VERSION = 1.0.867; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = "";