opt.: backup page

This commit is contained in:
lollipopkit
2023-10-17 20:27:47 +08:00
parent 8ce2cc579c
commit cf231f9fe6
12 changed files with 70 additions and 36 deletions

View File

@@ -806,6 +806,12 @@ abstract class S {
/// **'Made with ❤️ by {myGithub}'**
String madeWithLove(Object myGithub);
/// No description provided for @manual.
///
/// In en, this message translates to:
/// **'Manual'**
String get manual;
/// No description provided for @max.
///
/// In en, this message translates to:
@@ -1325,7 +1331,7 @@ abstract class S {
/// No description provided for @syncTip.
///
/// In en, this message translates to:
/// **'After auto sync, a restart may be required for some changes to take effect.'**
/// **'A restart may be required for some changes to take effect.'**
String get syncTip;
/// No description provided for @system.

View File

@@ -380,6 +380,9 @@ class SDe extends S {
return 'Erstellt mit ❤️ von $myGithub';
}
@override
String get manual => 'Handbuch';
@override
String get max => 'max';
@@ -647,7 +650,7 @@ class SDe extends S {
String get suspendTip => 'Die Suspend-Funktion erfordert Root-Rechte und systemd-Unterstützung.';
@override
String get syncTip => 'Nach der automatischen Synchronisierung kann es erforderlich sein, die App neu zu starten, damit bestimmte Änderungen wirksam werden.';
String get syncTip => 'Damit einige Änderungen wirksam werden, kann ein Neustart erforderlich sein.';
@override
String get system => 'Systeme';

View File

@@ -380,6 +380,9 @@ class SEn extends S {
return 'Made with ❤️ by $myGithub';
}
@override
String get manual => 'Manual';
@override
String get max => 'max';
@@ -647,7 +650,7 @@ class SEn extends S {
String get suspendTip => 'The suspend function requires root privileges and systemd support.';
@override
String get syncTip => 'After auto sync, a restart may be required for some changes to take effect.';
String get syncTip => 'A restart may be required for some changes to take effect.';
@override
String get system => 'System';

View File

@@ -380,6 +380,9 @@ class SId extends S {
return 'Dibuat dengan ❤️ oleh $myGithub';
}
@override
String get manual => 'Manual';
@override
String get max => 'Max';
@@ -647,7 +650,7 @@ class SId extends S {
String get suspendTip => 'Fungsi penangguhan memerlukan hak akses root dan dukungan systemd.';
@override
String get syncTip => 'Setelah sinkronisasi otomatis, mungkin perlu memulai ulang aplikasi agar perubahan tertentu dapat diterapkan.';
String get syncTip => 'Pengaktifan ulang mungkin diperlukan agar beberapa perubahan dapat diterapkan.';
@override
String get system => 'Sistem';

View File

@@ -380,6 +380,9 @@ class SZh extends S {
return '用❤️制作 by $myGithub';
}
@override
String get manual => '手动';
@override
String get max => '最大';
@@ -647,7 +650,7 @@ class SZh extends S {
String get suspendTip => 'suspend 功能需要 root 权限及 systemd 支持。';
@override
String get syncTip => '在自动同步后,可能需要重新启动,某些更改才能生效。';
String get syncTip => '可能需要重新启动,某些更改才能生效。';
@override
String get system => '系统';
@@ -1136,6 +1139,9 @@ class SZhTw extends SZh {
return '用❤️製作 by $myGithub';
}
@override
String get manual => '手動';
@override
String get max => '最大';
@@ -1403,7 +1409,7 @@ class SZhTw extends SZh {
String get suspendTip => 'suspend 功能需要 root 權限及 systemd 支持。';
@override
String get syncTip => '在自動同步後,可能需要重新啟動,某些更改才能生效。';
String get syncTip => '可能需要重新啟動,某些更改才能生效。';
@override
String get system => '系統';

View File

@@ -47,6 +47,14 @@ class UIs {
static const centerLoading = Center(child: CircularProgressIndicator());
static const centerSizedLoadingSmall = SizedBox(
width: 23,
height: 23,
child: Center(
child: CircularProgressIndicator(),
),
);
static const centerSizedLoading = SizedBox(
width: 77,
height: 77,

View File

@@ -118,6 +118,7 @@
"log": "Log",
"loss": "loss",
"madeWithLove": "Erstellt mit ❤️ von {myGithub}",
"manual": "Handbuch",
"max": "max",
"maxRetryCount": "Anzahl an Verbindungsversuchen",
"maxRetryCountEqual0": "Unbegrenzte Verbindungsversuche zum Server",
@@ -204,7 +205,7 @@
"success": "Erfolgreich",
"suspend": "Suspend",
"suspendTip": "Die Suspend-Funktion erfordert Root-Rechte und systemd-Unterstützung.",
"syncTip": "Nach der automatischen Synchronisierung kann es erforderlich sein, die App neu zu starten, damit bestimmte Änderungen wirksam werden.",
"syncTip": "Damit einige Änderungen wirksam werden, kann ein Neustart erforderlich sein.",
"system": "Systeme",
"tag": "Tags",
"terminal": "Terminal",

View File

@@ -118,6 +118,7 @@
"log": "Log",
"loss": "loss",
"madeWithLove": "Made with ❤️ by {myGithub}",
"manual": "Manual",
"max": "max",
"maxRetryCount": "Number of server reconnection",
"maxRetryCountEqual0": "Will retry again and again.",
@@ -204,7 +205,7 @@
"success": "Success",
"suspend": "Suspend",
"suspendTip": "The suspend function requires root privileges and systemd support.",
"syncTip": "After auto sync, a restart may be required for some changes to take effect.",
"syncTip": "A restart may be required for some changes to take effect.",
"system": "System",
"tag": "Tags",
"terminal": "Terminal",

View File

@@ -118,6 +118,7 @@
"log": "Catatan",
"loss": "kehilangan",
"madeWithLove": "Dibuat dengan ❤️ oleh {myGithub}",
"manual": "Manual",
"max": "Max",
"maxRetryCount": "Jumlah penyambungan kembali server",
"maxRetryCountEqual0": "Akan mencoba lagi lagi dan lagi.",
@@ -204,7 +205,7 @@
"success": "Kesuksesan",
"suspend": "Suspend",
"suspendTip": "Fungsi penangguhan memerlukan hak akses root dan dukungan systemd.",
"syncTip": "Setelah sinkronisasi otomatis, mungkin perlu memulai ulang aplikasi agar perubahan tertentu dapat diterapkan.",
"syncTip": "Pengaktifan ulang mungkin diperlukan agar beberapa perubahan dapat diterapkan.",
"system": "Sistem",
"tag": "Tag",
"terminal": "Terminal",

View File

@@ -118,6 +118,7 @@
"log": "日志",
"loss": "丢包率",
"madeWithLove": "用❤️制作 by {myGithub}",
"manual": "手动",
"max": "最大",
"maxRetryCount": "服务器尝试重连次数",
"maxRetryCountEqual0": "会无限重试",
@@ -204,7 +205,7 @@
"success": "成功",
"suspend": "挂起",
"suspendTip": "suspend 功能需要 root 权限及 systemd 支持。",
"syncTip": "在自动同步后,可能需要重新启动,某些更改才能生效。",
"syncTip": "可能需要重新启动,某些更改才能生效。",
"system": "系统",
"tag": "标签",
"terminal": "终端",

View File

@@ -118,6 +118,7 @@
"log": "日誌",
"loss": "丟包率",
"madeWithLove": "用❤️製作 by {myGithub}",
"manual": "手動",
"max": "最大",
"maxRetryCount": "服務器嘗試重連次數",
"maxRetryCountEqual0": "會無限重試",
@@ -204,7 +205,7 @@
"success": "成功",
"suspend": "挂起",
"suspendTip": "suspend 功能需要 root 權限及 systemd 支持。",
"syncTip": "在自動同步後,可能需要重新啟動,某些更改才能生效。",
"syncTip": "可能需要重新啟動,某些更改才能生效。",
"system": "系統",
"tag": "标签",
"terminal": "终端機",

View File

@@ -52,31 +52,29 @@ class BackupPage extends StatelessWidget {
Widget _buildManual(BuildContext context) {
return CardX(
ListTile(
ExpandTile(
title: Text(l10n.files),
initiallyExpanded: true,
children: [
ListTile(
title: Text(l10n.backup),
trailing: const Icon(Icons.save),
subtitle: Text(
l10n.backupTip,
style: UIs.textGrey,
),
trailing: SizedBox(
width: 120,
child: Row(
children: [
TextButton(
onPressed: () => _onRestore(context),
child: Text(l10n.restore),
),
TextButton(
onPressed: () async {
onTap: () async {
await Backup.backup();
await shareFiles([await Paths.bak]);
},
child: Text(l10n.backup),
),
ListTile(
trailing: const Icon(Icons.restore),
title: Text(l10n.restore),
onTap: () => _onRestore(context),
),
],
),
),
),
);
}
@@ -93,7 +91,7 @@ class BackupPage extends StatelessWidget {
ListTile(
title: Text(l10n.auto),
subtitle: const Text(
'Please wait for optimization :)',
'Unavailable, please wait for optimization :)',
style: UIs.textGrey,
),
trailing: StoreSwitch(
@@ -107,12 +105,12 @@ class BackupPage extends StatelessWidget {
),
),
ListTile(
title: Text('Manual'),
title: Text(l10n.manual),
trailing: ValueBuilder(
listenable: icloudLoading,
build: () {
if (icloudLoading.value) {
return UIs.centerSizedLoading;
return UIs.centerSizedLoadingSmall;
}
return SizedBox(
width: 120,
@@ -125,6 +123,7 @@ class BackupPage extends StatelessWidget {
for (final file in files) {
await ICloud.download(relativePath: file);
}
icloudLoading.value = false;
},
child: Text(l10n.download),
),
@@ -136,6 +135,7 @@ class BackupPage extends StatelessWidget {
for (final file in files) {
await ICloud.upload(relativePath: file);
}
icloudLoading.value = false;
},
child: Text(l10n.upload),
),