mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
chore: screenshots
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/data/model/server/private_key_info.dart';
|
||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||
import 'package:toolbox/data/model/server/snippet.dart';
|
||||
@@ -60,8 +61,8 @@ class Backup {
|
||||
spis = Stores.server.fetch(),
|
||||
snippets = Stores.snippet.fetch(),
|
||||
keys = Stores.key.fetch(),
|
||||
dockerHosts = Stores.docker.toJson(),
|
||||
settings = Stores.setting.toJson();
|
||||
dockerHosts = Stores.docker.box.toJson(),
|
||||
settings = Stores.setting.box.toJson();
|
||||
|
||||
static Future<String> backup() async {
|
||||
final result = _diyEncrypt(json.encode(Backup.loadFromStore()));
|
||||
|
||||
24
lib/data/model/app/sync.dart
Normal file
24
lib/data/model/app/sync.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'dart:async';
|
||||
|
||||
class SyncResult<T, E> {
|
||||
final List<T> up;
|
||||
final List<T> down;
|
||||
final Map<T, E> err;
|
||||
|
||||
const SyncResult({
|
||||
required this.up,
|
||||
required this.down,
|
||||
required this.err,
|
||||
});
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SyncResult{up: $up, down: $down, err: $err}';
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SyncIface<T> {
|
||||
/// Merge [other] into [this], return [this] after merge.
|
||||
/// Data in [other] has higher priority than [this].
|
||||
FutureOr<void> sync(T other);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
abstract class SyncAble<T> {
|
||||
/// If [other] is newer than [this] then return true,
|
||||
/// else return false
|
||||
bool needSync(T other);
|
||||
|
||||
/// Merge [other] into [this],
|
||||
/// return [this] after merge
|
||||
T merge(T other);
|
||||
}
|
||||
Reference in New Issue
Block a user