Skip to content

Commit

Permalink
fix: temporarily disable jump server
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed Nov 19, 2023
1 parent 691471d commit 1a49c78
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 58 deletions.
36 changes: 18 additions & 18 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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)";
Expand All @@ -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;
Expand All @@ -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)";
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
37 changes: 20 additions & 17 deletions lib/core/utils/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,28 @@ Future<SSHClient> 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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/provider/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 7 additions & 10 deletions lib/data/store/setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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------
Expand Down
6 changes: 4 additions & 2 deletions lib/view/page/full_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ class _FullScreenPageState extends State<FullScreenPage> 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(
Expand Down
4 changes: 4 additions & 0 deletions lib/view/page/server/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ class _ServerEditPageState extends State<ServerEditPage> {
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,
),
);
Expand Down
11 changes: 5 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1a49c78

Please sign in to comment.