fix: Use latest dartssh2 and add a switch for temperature between celsius and millicelsius (#1095)

* refactor(sftp): Optimize file download logic and SSH command execution handling

Replace manual chunked downloads with a more concise `sftp.download` method
Consistently use `utf8.decode` to process SSH command output

Remove redundant code and comments, and simplify the logic

* chore: Update `dartssh2` submodule

* feat (Temperature Display): Added an option to switch between degrees Celsius and millicelsius

Allows users to switch temperature units in server settings, resolving the issue of incorrect temperature display on some devices

* chore: Add a participnt

* fix(sftp): Fixed a resource leak issue during file downloads and SSH command execution

Ensured that remote and local file handles are properly closed during file downloads to prevent resource leaks. Additionally, improved error handling during SSH command execution to ensure that all streams are either successfully completed or properly handled in the event of an error.
This commit is contained in:
GT610
2026-04-01 11:27:58 +08:00
committed by GitHub
parent 36851ef1c2
commit 3c592baf2c
36 changed files with 211 additions and 102 deletions

View File

@@ -42,7 +42,7 @@ final class PrivateKeyNotifierProvider
}
String _$privateKeyNotifierHash() =>
r'12edd05dca29d1cbc9e2a3e047c3d417d22f7bb7';
r'79d02e116fe665df1ccb0719590947e109a5a736';
abstract class _$PrivateKeyNotifier extends $Notifier<PrivateKeyState> {
PrivateKeyState build();

View File

@@ -41,7 +41,7 @@ final class ServersNotifierProvider
}
}
String _$serversNotifierHash() => r'c90c2d8ce73a63f926bcf9679a84ae150c9d4808';
String _$serversNotifierHash() => r'29a4cb286b7032e5e74841f4eba66941b0dec34e';
abstract class _$ServersNotifier extends $Notifier<ServersState> {
ServersState build();

View File

@@ -361,6 +361,7 @@ class ServerNotifier extends _$ServerNotifier {
parsedOutput: parsedOutput,
system: state.status.system,
customCmds: spi.custom?.cmds ?? {},
tempDivisor: spi.custom?.tempIsCelsius == true ? 1.0 : 1000.0,
);
final newStatus = await Computer.shared.start(getStatus, req, taskName: 'StatusUpdateReq<${spi.id}>');
updateStatus(newStatus);

View File

@@ -58,7 +58,7 @@ final class ServerNotifierProvider
}
}
String _$serverNotifierHash() => r'04b1beef4d96242fd10d5b523c6f5f17eb774bae';
String _$serverNotifierHash() => r'bf724a58c5d0ec99f4e00ebe7cea47a7b6b2cc64';
final class ServerNotifierFamily extends $Family
with

View File

@@ -41,7 +41,7 @@ final class SnippetNotifierProvider
}
}
String _$snippetNotifierHash() => r'8285c7edf905a4aaa41cd8b65b0a6755c8b97fc9';
String _$snippetNotifierHash() => r'46297b84ec6497e5c454be6ffe32330b37c6a465';
abstract class _$SnippetNotifier extends $Notifier<SnippetState> {
SnippetState build();