mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
opt.: backup page
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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": "终端",
|
||||
|
||||
@@ -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": "终端機",
|
||||
|
||||
@@ -52,30 +52,28 @@ class BackupPage extends StatelessWidget {
|
||||
|
||||
Widget _buildManual(BuildContext context) {
|
||||
return CardX(
|
||||
ListTile(
|
||||
ExpandTile(
|
||||
title: Text(l10n.files),
|
||||
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 {
|
||||
await Backup.backup();
|
||||
await shareFiles([await Paths.bak]);
|
||||
},
|
||||
child: Text(l10n.backup),
|
||||
),
|
||||
],
|
||||
initiallyExpanded: true,
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text(l10n.backup),
|
||||
trailing: const Icon(Icons.save),
|
||||
subtitle: Text(
|
||||
l10n.backupTip,
|
||||
style: UIs.textGrey,
|
||||
),
|
||||
onTap: () async {
|
||||
await Backup.backup();
|
||||
await shareFiles([await Paths.bak]);
|
||||
},
|
||||
),
|
||||
),
|
||||
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),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user