fix: update changelog & backup restore

This commit is contained in:
lollipopkit
2023-04-19 20:52:02 +08:00
parent 20d2817c8d
commit e709262477
11 changed files with 39 additions and 24 deletions

View File

@@ -168,7 +168,7 @@ abstract class S {
/// No description provided for @backupTip.
///
/// In en, this message translates to:
/// **'The exported data is simply encrypted. \nPlease keep it safe.\nRestoring will not overwrite existing data.'**
/// **'The exported data is simply encrypted. \nPlease keep it safe.'**
String get backupTip;
/// No description provided for @backupVersionNotMatch.

View File

@@ -41,7 +41,7 @@ class SEn extends S {
String get backupAndRestore => 'Backup and Restore';
@override
String get backupTip => 'The exported data is simply encrypted. \nPlease keep it safe.\nRestoring will not overwrite existing data.';
String get backupTip => 'The exported data is simply encrypted. \nPlease keep it safe.';
@override
String get backupVersionNotMatch => 'Backup version is not match.';

View File

@@ -41,7 +41,7 @@ class SZh extends S {
String get backupAndRestore => '备份和恢复';
@override
String get backupTip => '导出的数据仅进行了简单加密,请妥善保管。\n恢复的数据不会覆盖现有数据。';
String get backupTip => '导出的数据仅进行了简单加密,请妥善保管。';
@override
String get backupVersionNotMatch => '备份版本不匹配,无法恢复';

View File

@@ -359,7 +359,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 263;
CURRENT_PROJECT_VERSION = 268;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -367,7 +367,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.263;
MARKETING_VERSION = 1.0.268;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -490,7 +490,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 263;
CURRENT_PROJECT_VERSION = 268;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -498,7 +498,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.263;
MARKETING_VERSION = 1.0.268;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -515,7 +515,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 263;
CURRENT_PROJECT_VERSION = 268;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -523,7 +523,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.263;
MARKETING_VERSION = 1.0.268;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View File

@@ -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),
);

View File

@@ -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';

View File

@@ -0,0 +1,8 @@
import 'package:flutter/material.dart';
extension ContextX on BuildContext {
void pop<T>([T? result]) {
Navigator.of(this).pop(T);
}
}

View File

@@ -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;
}

View File

@@ -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",

View File

@@ -11,7 +11,7 @@
"backDir": "返回上一级",
"backup": "备份",
"backupAndRestore": "备份和恢复",
"backupTip": "导出的数据仅进行了简单加密,请妥善保管。\n恢复的数据不会覆盖现有数据。",
"backupTip": "导出的数据仅进行了简单加密,请妥善保管。",
"backupVersionNotMatch": "备份版本不匹配,无法恢复",
"bgRun": "后台运行",
"cancel": "取消",

View File

@@ -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),