backup add docker

This commit is contained in:
lollipopkit
2023-03-27 15:09:19 +08:00
parent 2747df64dd
commit 2ea061d324
14 changed files with 49 additions and 56 deletions

View File

@@ -9,9 +9,7 @@ class Backup {
final List<ServerPrivateInfo> spis;
final List<Snippet> snippets;
final List<PrivateKeyInfo> keys;
final int primaryColor;
final int serverStatusUpdateInterval;
final int launchPage;
final Map<String, String> dockerHosts;
Backup(
this.version,
@@ -19,9 +17,7 @@ class Backup {
this.spis,
this.snippets,
this.keys,
this.primaryColor,
this.serverStatusUpdateInterval,
this.launchPage,
this.dockerHosts,
);
Backup.fromJson(Map<String, dynamic> json)
@@ -35,9 +31,7 @@ class Backup {
keys = (json['keys'] as List)
.map((e) => PrivateKeyInfo.fromJson(e))
.toList(),
primaryColor = json['primaryColor'],
serverStatusUpdateInterval = json['serverStatusUpdateInterval'],
launchPage = json['launchPage'];
dockerHosts = json['dockerHosts'];
Map<String, dynamic> toJson() => {
'version': version,
@@ -45,8 +39,5 @@ class Backup {
'spis': spis,
'snippets': snippets,
'keys': keys,
'primaryColor': primaryColor,
'serverStatusUpdateInterval': serverStatusUpdateInterval,
'launchPage': launchPage,
};
}

View File

@@ -2,8 +2,8 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 244;
static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (13 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
static const String buildAt = "2023-03-21 15:36:44.082988";
static const int build = 245;
static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (3 weeks ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
static const String buildAt = "2023-03-27 13:57:46.119777";
static const int modifications = 2;
}

View File

@@ -7,14 +7,14 @@ Future<Directory> get docDir async {
if (isAndroid) {
final dir = await getExternalStorageDirectory();
if (dir != null) {
return Directory('${dir.path}/server_box');
return dir;
}
// fallthrough to getApplicationDocumentsDirectory
}
return await getApplicationDocumentsDirectory();
}
Future<Directory> get sftpDownloadDir async {
Future<Directory> get sftpDir async {
final dir = Directory('${(await docDir).path}/sftp');
return dir.create(recursive: true);
}

View File

@@ -8,4 +8,8 @@ class DockerStore extends PersistentStore {
void setDockerHost(String id, String host) {
box.put(id, host);
}
Map<String, String> fetch() {
return box.toMap().cast<String, String>();
}
}