From 1a49c7870c91a581a95181b67314218e8495759a Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Sun, 19 Nov 2023 14:47:27 +0800 Subject: [PATCH] fix: temporarily disable` jump server` --- ios/Runner.xcodeproj/project.pbxproj | 36 +++++++++++++-------------- lib/core/utils/server.dart | 37 +++++++++++++++------------- lib/data/provider/server.dart | 2 +- lib/data/store/setting.dart | 17 ++++++------- lib/view/page/full_screen.dart | 6 +++-- lib/view/page/server/edit.dart | 4 +++ pubspec.lock | 11 ++++----- pubspec.yaml | 9 ++++--- 8 files changed, 64 insertions(+), 58 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0ff1902b0..37158f124 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 = 640; + CURRENT_PROJECT_VERSION = 642; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -596,7 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -730,7 +730,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -758,7 +758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; 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.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; 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.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; 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.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -902,7 +902,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -943,7 +943,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.640; + MARKETING_VERSION = 1.0.642; 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 = 640; + CURRENT_PROJECT_VERSION = 642; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -981,7 +981,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.640; + MARKETING_VERSION = 1.0.642; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/core/utils/server.dart b/lib/core/utils/server.dart index 8807da2e8..8a4009374 100644 --- a/lib/core/utils/server.dart +++ b/lib/core/utils/server.dart @@ -60,25 +60,28 @@ Future genClient( onStatus?.call(GenSSHClientStatus.socket); final socket = await () async { + /// Issues #210 + /// Temporarily comment out the proxy function + // Proxy - final jumpSpi_ = () { - // Multi-thread or key login - if (jumpSpi != null) return jumpSpi; - // Main thread - if (spi.jumpId != null) return Stores.server.box.get(spi.jumpId); - }(); - if (jumpSpi_ != null) { - final jumpClient = await genClient( - jumpSpi_, - privateKey: jumpPrivateKey, - timeout: timeout, - ); + // final jumpSpi_ = () { + // // Multi-thread or key login + // if (jumpSpi != null) return jumpSpi; + // // Main thread + // if (spi.jumpId != null) return Stores.server.box.get(spi.jumpId); + // }(); + // if (jumpSpi_ != null) { + // final jumpClient = await genClient( + // jumpSpi_, + // privateKey: jumpPrivateKey, + // timeout: timeout, + // ); - return await jumpClient.forwardLocal( - spi.ip, - spi.port, - ); - } + // return await jumpClient.forwardLocal( + // spi.ip, + // spi.port, + // ); + // } // Direct try { diff --git a/lib/data/provider/server.dart b/lib/data/provider/server.dart index 35f1fea2e..1224b8c90 100644 --- a/lib/data/provider/server.dart +++ b/lib/data/provider/server.dart @@ -273,7 +273,7 @@ class ServerProvider extends ChangeNotifier { final time1 = DateTime.now(); s.client = await genClient( spi, - timeout: Stores.setting.timeoutD, + timeout: Duration(seconds: Stores.setting.timeout.fetch()), ); final time2 = DateTime.now(); final spentTime = time2.difference(time1).inMilliseconds; diff --git a/lib/data/store/setting.dart b/lib/data/store/setting.dart index 9be29f0f7..2628b7ad4 100644 --- a/lib/data/store/setting.dart +++ b/lib/data/store/setting.dart @@ -28,9 +28,6 @@ class SettingStore extends PersistentStore { 5, ); - /// Duration of [timeout] - Duration get timeoutD => Duration(seconds: timeout.fetch()); - /// Record history of SFTP path and etc. late final recordHistory = StoreProperty( box, @@ -65,6 +62,13 @@ class SettingStore extends PersistentStore { isDesktop, ); + /// Disk view: amount / IO + late final serverTabPreferDiskAmount = StoreProperty( + box, + 'serverTabPreferDiskAmount', + false, + ); + // ------END------ late final primaryColor = StoreProperty( @@ -224,13 +228,6 @@ class SettingStore extends PersistentStore { late final serverFuncBtnsDisplayName = StoreProperty(box, 'serverFuncBtnsDisplayName', true); - /// Disk view: amount / IO - late final serverTabPreferDiskAmount = StoreProperty( - box, - 'serverTabPreferDiskAmount', - false, - ); - // Never show these settings for users // // ------BEGIN------ diff --git a/lib/view/page/full_screen.dart b/lib/view/page/full_screen.dart index f83b00101..675865d7d 100644 --- a/lib/view/page/full_screen.dart +++ b/lib/view/page/full_screen.dart @@ -215,8 +215,10 @@ class _FullScreenPageState extends State with AfterLayoutMixin { children: [ Text( spi.name, - style: - const TextStyle(fontWeight: FontWeight.bold, fontSize: 19,), + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 19, + ), textAlign: TextAlign.center, ), const Icon( diff --git a/lib/view/page/server/edit.dart b/lib/view/page/server/edit.dart index f7217c3df..07a25ac45 100644 --- a/lib/view/page/server/edit.dart +++ b/lib/view/page/server/edit.dart @@ -378,6 +378,10 @@ class _ServerEditPageState extends State { leading: const Icon(Icons.map), initiallyExpanded: _jumpServer.value != null, title: Text(l10n.jumpServer), + subtitle: const Text( + "It was temporarily disabled because it has some bugs (Issues #210)", + style: UIs.textGrey, + ), children: children, ), ); diff --git a/pubspec.lock b/pubspec.lock index 12f96c026..0e7e32ba6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -245,12 +245,11 @@ packages: dartssh2: dependency: "direct main" description: - path: "." - ref: master - resolved-ref: b4f6b6551a4f60f86b2b0fcf601c786e110a8934 - url: "https://github.com/lollipopkit/dartssh2" - source: git - version: "2.9.1-pre" + name: dartssh2 + sha256: "53a230c7dd6f487b704ceef1b29323ad64d19be89e786ccbc81e157a70417a56" + url: "https://pub.dev" + source: hosted + version: "2.8.2" dio: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index b4da53056..6876f79eb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,10 +19,11 @@ dependencies: after_layout: ^1.1.0 url_launcher: ^6.1.8 countly_flutter: ^23.6.0 - dartssh2: - git: - ref: master - url: https://github.com/lollipopkit/dartssh2 + dartssh2: ^2.8.2 + # newer version has some issues + # git: + # ref: master + # url: https://github.com/lollipopkit/dartssh2 logging: ^1.0.2 circle_chart: git: