auto scroll on apt/yum upgrading.

This commit is contained in:
Junyuan Feng
2022-05-03 09:17:42 +08:00
parent a06ea82f2c
commit fd1b2fc7b0
5 changed files with 20 additions and 13 deletions

View File

@@ -11,12 +11,15 @@ class AptProvider extends BusyProvider {
List<UpgradePkgInfo>? upgradeable;
String? error;
String? updateLog;
Function()? onUpgrade;
AptProvider();
Future<void> init(SSHClient client, Distribution dist) async {
Future<void> init(
SSHClient client, Distribution dist, Function() onUpgrade) async {
this.client = client;
this.dist = dist;
this.onUpgrade = onUpgrade;
whoami = (await client.run('whoami').string).trim();
}
@@ -88,6 +91,7 @@ class AptProvider extends BusyProvider {
session.stdout.listen((data) {
updateLog = (updateLog ?? '') + data.string;
notifyListeners();
onUpgrade!();
});
refreshInstalled();
}

View File

@@ -139,6 +139,7 @@ class ServerProvider extends BusyProvider {
void delServer(ServerPrivateInfo info) {
final idx = _servers.indexWhere((s) => s.info == info);
if (idx == -1) return;
_servers[idx].client?.close();
_servers.removeAt(idx);
notifyListeners();

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 114;
static const int build = 115;
static const String engine =
"Flutter 2.10.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision c860cba910 (3 weeks ago) • 2022-03-25 00:23:12 -0500\nEngine • revision 57d3bac3dd\nTools • Dart 2.16.2 • DevTools 2.9.2\n";
static const String buildAt = "2022-04-15 20:20:29.860208";
static const int modifications = 1;
"Flutter 2.10.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision c860cba910 (6 weeks ago) • 2022-03-25 00:23:12 -0500\nEngine • revision 57d3bac3dd\nTools • Dart 2.16.2 • DevTools 2.9.2\n";
static const String buildAt = "2022-05-03 08:33:56.199910";
static const int modifications = 3;
}