mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
fix SSHClient.exec
This commit is contained in:
@@ -99,7 +99,7 @@ class AptProvider extends BusyProvider {
|
||||
onStdout: (data, sink) {
|
||||
updateLog = (updateLog ?? '') + data;
|
||||
notifyListeners();
|
||||
onUpdate!();
|
||||
if (onUpdate != null) onUpdate!();
|
||||
},
|
||||
);
|
||||
return await client
|
||||
@@ -120,13 +120,13 @@ class AptProvider extends BusyProvider {
|
||||
|
||||
await client!.exec(
|
||||
_wrap(upgradeCmd),
|
||||
onStderr: (data, sink) => _onPwd(data, sink),
|
||||
onStderr: _onPwd,
|
||||
onStdout: (log, sink) {
|
||||
if (lastLog == log.trim()) return;
|
||||
upgradeLog = (upgradeLog ?? '') + log;
|
||||
lastLog = log.trim();
|
||||
notifyListeners();
|
||||
onUpgrade!();
|
||||
if (onUpgrade != null) onUpgrade!();
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ class DockerProvider extends BusyProvider {
|
||||
DockerErr? error;
|
||||
PwdRequestFunc? onPwdReq;
|
||||
String? hostId;
|
||||
String? runLog;
|
||||
bool isRequestingPwd = false;
|
||||
|
||||
void init(SSHClient client, String userName, PwdRequestFunc onPwdReq,
|
||||
@@ -44,7 +43,7 @@ class DockerProvider extends BusyProvider {
|
||||
void clear() {
|
||||
client = userName = error = items = version = edition = onPwdReq = null;
|
||||
isRequestingPwd = false;
|
||||
hostId = runLog = null;
|
||||
hostId = null;
|
||||
}
|
||||
|
||||
Future<void> refresh() async {
|
||||
@@ -124,14 +123,8 @@ class DockerProvider extends BusyProvider {
|
||||
final code = await client!.exec(
|
||||
_wrapHost(cmd),
|
||||
onStderr: _onPwd,
|
||||
onStdout: (data, _) {
|
||||
runLog = '$runLog$data';
|
||||
notifyListeners();
|
||||
},
|
||||
);
|
||||
|
||||
runLog = null;
|
||||
|
||||
if (code != 0) {
|
||||
setBusyState(false);
|
||||
return DockerErr(type: DockerErrType.unknown, message: errs.join('\n'));
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 166;
|
||||
static const int build = 169;
|
||||
static const String engine =
|
||||
"Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b8f7f1f986 (12 days ago) • 2022-11-23 06:43:51 +0900\nEngine • revision 8f2221fbef\nTools • Dart 2.18.5 • DevTools 2.15.0\n";
|
||||
static const String buildAt = "2022-12-04 21:57:10.591121";
|
||||
static const int modifications = 2;
|
||||
"Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b8f7f1f986 (3 weeks ago) • 2022-11-23 06:43:51 +0900\nEngine • revision 8f2221fbef\nTools • Dart 2.18.5 • DevTools 2.15.0\n";
|
||||
static const String buildAt = "2022-12-11 12:36:17.737879";
|
||||
static const int modifications = 8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user