fix: temporarily disable jump server

This commit is contained in:
lollipopkit
2023-11-19 14:47:27 +08:00
parent 691471dae5
commit 1a49c7870c
8 changed files with 65 additions and 59 deletions

View File

@@ -60,25 +60,28 @@ Future<SSHClient> genClient(
onStatus?.call(GenSSHClientStatus.socket);
final socket = await () async {
// 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,
);
/// Issues #210
/// Temporarily comment out the proxy function
return await jumpClient.forwardLocal(
spi.ip,
spi.port,
);
}
// 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,
// );
// return await jumpClient.forwardLocal(
// spi.ip,
// spi.port,
// );
// }
// Direct
try {

View File

@@ -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;

View File

@@ -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------

View File

@@ -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(

View File

@@ -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,
),
);