feat. & fix.

- support backup & restore
- fix when client.run empty return
This commit is contained in:
Junyuan Feng
2022-05-22 13:02:54 +08:00
parent 228f228d44
commit 0fdc1b784b
10 changed files with 386 additions and 127 deletions

View File

@@ -193,6 +193,12 @@ class ServerProvider extends BusyProvider {
final si = _servers[idx];
if (si.client == null) return;
final raw = await si.client!.run("sh $shellPath").string;
if (raw.isEmpty) {
_servers[idx].connectionState = ServerConnectionState.failed;
_servers[idx].status.failedInfo = 'Empty output';
notifyListeners();
return;
}
final lines = raw.split(seperator).map((e) => e.trim()).toList();
lines.removeAt(0);