Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/view/widget/server_func_btns.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ void _gotoSSH(Spi spi, BuildContext context) async {
SSHPage.route.go(context, args);
return;
}

final extraArgs = <String>[];
if (spi.port != 22) {
extraArgs.addAll(['-p', '${spi.port}']);
Expand All @@ -227,17 +228,24 @@ void _gotoSSH(Spi spi, BuildContext context) async {
/// For security reason, save the private key file to app doc path
return Paths.doc.joinPath(tempKeyFileName);
}();

final file = File(path);
final shouldGenKey = spi.keyId != null;
if (shouldGenKey) {
if (await file.exists()) {
await file.delete();
}
await file.writeAsString(getPrivateKey(spi.keyId!));
final keyContent = getPrivateKey(spi.keyId!);
final keyContentWithNewline = keyContent.endsWith('\n') ? keyContent : '$keyContent\n';
await file.writeAsString(keyContentWithNewline);
if (!Platform.isWindows) {
await Process.run('chmod', ['600', path]);
}
extraArgs.addAll(['-i', path]);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

final sshCommand = ['ssh', '${spi.user}@${spi.ip}'] + extraArgs;
final sshCommand = ['ssh'] + extraArgs + ['${spi.user}@${spi.ip}'];

final system = Pfs.type;
switch (system) {
case Pfs.windows:
Expand Down
1 change: 1 addition & 0 deletions packages/computer
Submodule computer added at b0819c
80 changes: 40 additions & 40 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ packages:
dependency: transitive
description:
name: build_config
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
sha256: "4070d2a59f8eec34c97c86ceb44403834899075f66e8a9d59706f8e7834f6f71"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
build_daemon:
dependency: transitive
description:
Expand All @@ -149,10 +149,10 @@ packages:
dependency: "direct dev"
description:
name: build_runner
sha256: "39ad4ca8a2876779737c60e4228b4bcd35d4352ef7e14e47514093edc012c734"
sha256: "3552e5c2874ed47cf9ed9d6813ac71b2276ee07622f48530468b8013f1767e3f"
url: "https://pub.dev"
source: hosted
version: "2.11.1"
version: "2.13.0"
built_collection:
dependency: transitive
description:
Expand Down Expand Up @@ -380,18 +380,18 @@ packages:
dependency: "direct main"
description:
name: dio
sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c
url: "https://pub.dev"
source: hosted
version: "5.9.0"
version: "5.9.2"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"
sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
dynamic_color:
dependency: "direct main"
description:
Expand Down Expand Up @@ -483,10 +483,10 @@ packages:
dependency: "direct main"
description:
name: fl_chart
sha256: "7ca9a40f4eb85949190e54087be8b4d6ac09dc4c54238d782a34cf1f7c011de9"
sha256: b938f77d042cbcd822936a7a359a7235bad8bd72070de1f827efc2cc297ac888
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.2.0"
fl_lib:
dependency: "direct main"
description:
Expand Down Expand Up @@ -644,10 +644,10 @@ packages:
dependency: transitive
description:
name: flutter_svg
sha256: "87fbd7c534435b6c5d9d98b01e1fd527812b82e68ddd8bd35fc45ed0fa8f0a95"
sha256: "1ded017b39c8e15c8948ea855070a5ff8ff8b3d5e83f3446e02d6bb12add7ad9"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.2.4"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -751,10 +751,10 @@ packages:
dependency: transitive
description:
name: hooks
sha256: "7a08a0d684cb3b8fb604b78455d5d352f502b68079f7b80b831c62220ab0a4f6"
sha256: e79ed1e8e1929bc6ecb6ec85f0cb519c887aa5b423705ded0d0f2d9226def388
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "1.0.2"
html:
dependency: transitive
description:
Expand Down Expand Up @@ -919,26 +919,26 @@ packages:
dependency: transitive
description:
name: local_auth
sha256: a4f1bf57f0236a4aeb5e8f0ec180e197f4b112a3456baa6c1e73b546630b0422
sha256: ae6f382f638108c6becd134318d7c3f0a93875383a54010f61d7c97ac05d5137
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "3.0.1"
local_auth_android:
dependency: transitive
description:
name: local_auth_android
sha256: "162b8e177fd9978c4620da2a8002a5c6bed4d20f0c6daf5137e72e9a8b767d2e"
sha256: dc9663a7bc8ac33d7d988e63901974f63d527ebef260eabd19c479447cc9c911
url: "https://pub.dev"
source: hosted
version: "2.0.4"
version: "2.0.5"
local_auth_darwin:
dependency: transitive
description:
name: local_auth_darwin
sha256: "176480aa855ebedeed195e26ac7d6601a45e6b255dfc7433f353e0c1aeafa9a2"
sha256: a8c3d4e17454111f7fd31ff72a31222359f6059f7fe956c2dcfe0f88f49826d4
url: "https://pub.dev"
source: hosted
version: "2.0.2"
version: "2.0.3"
local_auth_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -983,10 +983,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
url: "https://pub.dev"
source: hosted
version: "0.12.19"
version: "0.12.18"
material_color_utilities:
dependency: transitive
description:
Expand Down Expand Up @@ -1031,10 +1031,10 @@ packages:
dependency: transitive
description:
name: native_toolchain_c
sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac"
sha256: "6ba77bb18063eebe9de401f5e6437e95e1438af0a87a3a39084fbd37c90df572"
url: "https://pub.dev"
source: hosted
version: "0.17.4"
version: "0.17.6"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -1406,10 +1406,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc"
sha256: "8374d6200ab33ac99031a852eba4c8eb2170c4bf20778b3e2c9eccb45384fb41"
url: "https://pub.dev"
source: hosted
version: "2.4.18"
version: "2.4.21"
shared_preferences_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -1491,10 +1491,10 @@ packages:
dependency: transitive
description:
name: source_gen
sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17"
sha256: adc962c96fffb2de1728ef396a995aaedcafbe635abdca13d2a987ce17e57751
url: "https://pub.dev"
source: hosted
version: "4.2.0"
version: "4.2.1"
source_helper:
dependency: transitive
description:
Expand Down Expand Up @@ -1579,26 +1579,26 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: "280d6d890011ca966ad08df7e8a4ddfab0fb3aa49f96ed6de56e3521347a9ae7"
sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a"
url: "https://pub.dev"
source: hosted
version: "1.30.0"
version: "1.29.0"
test_api:
dependency: transitive
description:
name: test_api
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
version: "0.7.9"
test_core:
dependency: transitive
description:
name: test_core
sha256: "0381bd1585d1a924763c308100f2138205252fb90c9d4eeaf28489ee65ccde51"
sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943"
url: "https://pub.dev"
source: hosted
version: "0.6.16"
version: "0.6.15"
tuple:
dependency: transitive
description:
Expand Down Expand Up @@ -1699,10 +1699,10 @@ packages:
dependency: transitive
description:
name: vector_graphics
sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6
sha256: "7076216a10d5c390315fbe536a30f1254c341e7543e6c4c8a815e591307772b1"
url: "https://pub.dev"
source: hosted
version: "1.1.19"
version: "1.1.20"
vector_graphics_codec:
dependency: transitive
description:
Expand Down Expand Up @@ -1747,18 +1747,18 @@ packages:
dependency: "direct main"
description:
name: wakelock_plus
sha256: "9296d40c9adbedaba95d1e704f4e0b434be446e2792948d0e4aa977048104228"
sha256: "8b12256f616346910c519a35606fb69b1fe0737c06b6a447c6df43888b097f39"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.5.1"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "036deb14cd62f558ca3b73006d52ce049fabcdcb2eddfe0bf0fe4e8a943b5cf2"
sha256: "24b84143787220a403491c2e5de0877fbbb87baf3f0b18a2a988973863db4b03"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.0"
watch_connectivity:
dependency: "direct main"
description:
Expand Down
Loading