fix & opt.

- fix: `sftpGoPath`
- opt.: `PersistentStore.toJson`
- rm: `first` store
- opt.: log print
This commit is contained in:
lollipopkit
2023-10-27 18:13:02 +08:00
parent 6579190ae4
commit 92bb653e81
14 changed files with 38 additions and 51 deletions

View File

@@ -60,11 +60,11 @@ class Backup {
spis = Stores.server.fetch(),
snippets = Stores.snippet.fetch(),
keys = Stores.key.fetch(),
dockerHosts = Stores.docker.fetchAll(),
dockerHosts = Stores.docker.toJson(),
settings = Stores.setting.toJson();
static Future<String> backup() async {
final result = _diyEncrtpt(json.encode(Backup.loadFromStore()));
final result = _diyEncrypt(json.encode(Backup.loadFromStore()));
final path = await Paths.bak;
await File(path).writeAsString(result);
return path;
@@ -95,7 +95,7 @@ class Backup {
: this.fromJson(json.decode(_diyDecrypt(raw)));
}
String _diyEncrtpt(String raw) => json.encode(
String _diyEncrypt(String raw) => json.encode(
raw.codeUnits.map((e) => e * 2 + 1).toList(growable: false),
);