mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-03 23:04:49 +01:00
fix: update changelog & backup restore
This commit is contained in:
@@ -67,7 +67,7 @@ Future<void> doUpdate(BuildContext context, {bool force = false}) async {
|
||||
|
||||
showSnackBarWithAction(
|
||||
context,
|
||||
'${s.updateTip(newest)} \n${update.changelog}',
|
||||
'${s.updateTip(newest)} \n${update.changelog.current}',
|
||||
s.update,
|
||||
() => _doUpdate(url, context, s),
|
||||
);
|
||||
|
||||
@@ -6,9 +6,9 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:plain_notification_token/plain_notification_token.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:toolbox/data/provider/app.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
|
||||
import '../../data/provider/app.dart';
|
||||
import '../../locator.dart';
|
||||
import '../../view/widget/rebuild.dart';
|
||||
import 'platform.dart';
|
||||
|
||||
|
||||
8
lib/core/utils/navigator.dart
Normal file
8
lib/core/utils/navigator.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
extension ContextX on BuildContext {
|
||||
void pop<T>([T? result]) {
|
||||
Navigator.of(this).pop(T);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 263;
|
||||
static const int build = 268;
|
||||
static const String engine = "3.7.11";
|
||||
static const String buildAt = "2023-04-18 22:01:22.468457";
|
||||
static const int modifications = 3;
|
||||
static const String buildAt = "2023-04-19 20:26:15.641670";
|
||||
static const int modifications = 4;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"backDir": "Back",
|
||||
"backup": "Backup",
|
||||
"backupAndRestore": "Backup and Restore",
|
||||
"backupTip": "The exported data is simply encrypted. \nPlease keep it safe.\nRestoring will not overwrite existing data.",
|
||||
"backupTip": "The exported data is simply encrypted. \nPlease keep it safe.",
|
||||
"backupVersionNotMatch": "Backup version is not match.",
|
||||
"bgRun": "Run in backgroud",
|
||||
"cancel": "Cancel",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"backDir": "返回上一级",
|
||||
"backup": "备份",
|
||||
"backupAndRestore": "备份和恢复",
|
||||
"backupTip": "导出的数据仅进行了简单加密,请妥善保管。\n恢复的数据不会覆盖现有数据。",
|
||||
"backupTip": "导出的数据仅进行了简单加密,请妥善保管。",
|
||||
"backupVersionNotMatch": "备份版本不匹配,无法恢复",
|
||||
"bgRun": "后台运行",
|
||||
"cancel": "取消",
|
||||
|
||||
@@ -128,8 +128,7 @@ class BackupPage extends StatelessWidget {
|
||||
showSnackBar(context, Text(s.fieldMustNotEmpty));
|
||||
return;
|
||||
}
|
||||
_importBackup(text, context, s);
|
||||
Navigator.of(context).pop();
|
||||
await _importBackup(text, context, s);
|
||||
}
|
||||
|
||||
Future<void> _importBackup(String raw, BuildContext context, S s) async {
|
||||
@@ -163,12 +162,20 @@ class BackupPage extends StatelessWidget {
|
||||
for (final k in backup.dockerHosts.keys) {
|
||||
_dockerHosts.setDockerHost(k, backup.dockerHosts[k]!);
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
showSnackBarWithAction(
|
||||
showRoundDialog(
|
||||
context,
|
||||
s.restoreSuccess,
|
||||
s.restart,
|
||||
() => rebuildAll(context),
|
||||
s.attention,
|
||||
Text(s.restoreSuccess),
|
||||
[
|
||||
TextButton(
|
||||
onPressed: () => rebuildAll(context),
|
||||
child: Text(s.restart),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text(s.cancel),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
child: Text(s.ok),
|
||||
|
||||
Reference in New Issue
Block a user