mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
opt: Shares
This commit is contained in:
@@ -63,9 +63,11 @@ class Backup {
|
||||
dockerHosts = Stores.docker.fetchAll(),
|
||||
settings = Stores.setting.toJson();
|
||||
|
||||
static Future<void> backup() async {
|
||||
static Future<String> backup() async {
|
||||
final result = _diyEncrtpt(json.encode(Backup.loadFromStore()));
|
||||
await File(await Paths.bak).writeAsString(result);
|
||||
final path = await Paths.bak;
|
||||
await File(path).writeAsString(result);
|
||||
return path;
|
||||
}
|
||||
|
||||
Future<void> restore() async {
|
||||
|
||||
@@ -308,14 +308,13 @@ class ServerProvider extends ChangeNotifier {
|
||||
try {
|
||||
Loggers.app.warning('Using SFTP to write script to ${spi.name}');
|
||||
file.writeAsString(ShellFunc.allScript);
|
||||
final sftp = Pros.sftp;
|
||||
final completer = Completer();
|
||||
final reqId = sftp.add(
|
||||
final reqId = Pros.sftp.add(
|
||||
SftpReq(spi, installShellPath, localPath, SftpReqType.upload),
|
||||
completer: completer,
|
||||
);
|
||||
await completer.future;
|
||||
final err = sftp.get(reqId)?.error;
|
||||
final err = Pros.sftp.get(reqId)?.error;
|
||||
if (err != null) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user