This commit is contained in:
lollipopkit
2023-10-05 21:17:04 +08:00
parent a23a284d1a
commit da65babd56
20 changed files with 169 additions and 83 deletions

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 578;
static const String engine = "3.13.5";
static const String buildAt = "2023-09-25 19:49:19";
static const int build = 580;
static const String engine = "3.13.6";
static const String buildAt = "2023-10-05 19:51:55";
static const int modifications = 4;
static const int script = 19;
}

View File

@@ -161,6 +161,7 @@
"process": "Prozess",
"pushToken": "Push Token",
"pwd": "Passwort",
"reboot": "Neustart",
"remotePath": "Entfernte Pfade",
"rename": "Umbenennen",
"reportBugsOnGithubIssue": "Bitte Bugs auf {url} melden",
@@ -187,6 +188,7 @@
"sftpRmrDirSummary": "Verwenden Sie \"rm -r\", um das Verzeichnis in SFTP zu löschen.",
"sftpSSHConnected": "SFTP Verbunden",
"showDistLogo": "Distributionslogo anzeigen",
"shutdown": "Abschaltung",
"snippet": "Snippet",
"speed": "Tempo",
"spentTime": "Benötigte Zeit: {time}",
@@ -196,6 +198,7 @@
"stats": "Statistik",
"stop": "Stop",
"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.",
"system": "Systeme",

View File

@@ -161,6 +161,7 @@
"process": "Process",
"pushToken": "Push token",
"pwd": "Password",
"reboot": "Reboot",
"remotePath": "Remote path",
"rename": "Rename",
"reportBugsOnGithubIssue": "Please report bugs on {url}",
@@ -187,6 +188,7 @@
"sftpRmrDirSummary": "Use `rm -r` to delete a folder in SFTP.",
"sftpSSHConnected": "SFTP Connected",
"showDistLogo": "Show distribution logo",
"shutdown": "Shutdown",
"snippet": "Snippet",
"speed": "Speed",
"spentTime": "Spent time: {time}",
@@ -196,6 +198,7 @@
"stats": "Stats",
"stop": "Stop",
"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.",
"system": "System",

View File

@@ -161,6 +161,7 @@
"process": "Proses",
"pushToken": "Dorong token",
"pwd": "Kata sandi",
"reboot": "Reboot",
"remotePath": "Jalur jarak jauh",
"rename": "Ganti nama",
"reportBugsOnGithubIssue": "Harap laporkan bug di {url}",
@@ -187,6 +188,7 @@
"sftpRmrDirSummary": "Gunakan `rm -r` untuk menghapus dir di SFTP",
"sftpSSHConnected": "Sftp terhubung",
"showDistLogo": "Tampilkan logo distribusi",
"shutdown": "Matikan",
"snippet": "Snippet",
"speed": "Kecepatan",
"spentTime": "Menghabiskan waktu: {time}",
@@ -196,6 +198,7 @@
"stats": "Statistik",
"stop": "Berhenti",
"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.",
"system": "Sistem",

View File

@@ -161,6 +161,7 @@
"process": "进程",
"pushToken": "消息推送 Token",
"pwd": "密码",
"reboot": "重启",
"remotePath": "远端路径",
"rename": "重命名",
"reportBugsOnGithubIssue": "请到 {url} 提交问题",
@@ -187,6 +188,7 @@
"sftpRmrDirSummary": "在 SFTP 中使用 `rm -r` 来删除文件夹",
"sftpSSHConnected": "SFTP 已连接...",
"showDistLogo": "显示发行版 Logo",
"shutdown": "关机",
"snippet": "代码片段",
"speed": "速度",
"spentTime": "耗时: {time}",
@@ -196,6 +198,7 @@
"stats": "统计",
"stop": "停止",
"success": "成功",
"suspend": "挂起",
"suspendTip": "suspend 功能需要 root 权限及 systemd 支持。",
"syncTip": "在自动同步后,可能需要重新启动,某些更改才能生效。",
"system": "系统",

View File

@@ -161,6 +161,7 @@
"process": "進程",
"pushToken": "消息推送 Token",
"pwd": "密碼",
"reboot": "重启",
"remotePath": "遠端路徑",
"rename": "重命名",
"reportBugsOnGithubIssue": "請到 {url} 提交問題",
@@ -187,6 +188,7 @@
"sftpRmrDirSummary": "在 SFTP 中使用 `rm -r` 來刪除文件夾",
"sftpSSHConnected": "SFTP 已連接...",
"showDistLogo": "顯示發行版 Logo",
"shutdown": "关机",
"snippet": "程式片段",
"speed": "速度",
"spentTime": "耗時: {time}",
@@ -196,6 +198,7 @@
"stats": "統計",
"stop": "停止",
"success": "成功",
"suspend": "挂起",
"suspendTip": "suspend 功能需要 root 權限及 systemd 支持。",
"syncTip": "在自動同步後,可能需要重新啟動,某些更改才能生效。",
"system": "系統",

View File

@@ -259,10 +259,11 @@ class _ServerPageState extends State<ServerPage>
context: context,
);
},
msg: 'Suspend ${srv.spi.name}',
typ: l10n.suspend,
name: srv.spi.name,
),
icon: const Icon(Icons.stop),
tooltip: 'Suspend',
tooltip: l10n.suspend,
),
IconButton(
onPressed: () => _askFor(
@@ -270,10 +271,11 @@ class _ServerPageState extends State<ServerPage>
ShellFunc.shutdown.exec,
context: context,
),
msg: 'Shutdown ${srv.spi.name}',
typ: l10n.shutdown,
name: srv.spi.name,
),
icon: const Icon(Icons.power_off),
tooltip: 'Shutdown',
tooltip: l10n.shutdown,
),
IconButton(
onPressed: () => _askFor(
@@ -281,10 +283,11 @@ class _ServerPageState extends State<ServerPage>
ShellFunc.reboot.exec,
context: context,
),
msg: 'Reboot ${srv.spi.name}',
typ: l10n.reboot,
name: srv.spi.name,
),
icon: const Icon(Icons.restart_alt),
tooltip: 'Reboot',
tooltip: l10n.reboot,
),
IconButton(
onPressed: () => AppRoute.serverEdit(spi: srv.spi).go(context),
@@ -542,10 +545,14 @@ class _ServerPageState extends State<ServerPage>
return 107;
}
void _askFor({required void Function() func, required String msg}) {
void _askFor({
required void Function() func,
required String typ,
required String name,
}) {
context.showRoundDialog(
title: Text(l10n.attention),
child: Text(l10n.askContinue(msg)),
child: Text(l10n.askContinue('$typ ${l10n.server}($name)')),
actions: [
TextButton(
onPressed: () {

View File

@@ -332,44 +332,45 @@ class _SettingPageState extends State<SettingPage> {
onTap: () async {
final ctrl = TextEditingController(text: primaryColor.toHex);
await context.showRoundDialog(
title: Text(l10n.primaryColorSeed),
child: StatefulBuilder(builder: (context, setState) {
final children = <Widget>[
/// Plugin [dynamic_color] is not supported on iOS
if (!isIOS)
ListTile(
title: Text(l10n.followSystem),
trailing: StoreSwitch(
prop: _setting.useSystemPrimaryColor,
func: (_) => setState(() {}),
),
)
];
if (!_setting.useSystemPrimaryColor.fetch()) {
children.addAll([
Input(
onSubmitted: _onSaveColor,
controller: ctrl,
hint: '#8b2252',
icon: Icons.colorize,
title: Text(l10n.primaryColorSeed),
child: StatefulBuilder(builder: (context, setState) {
final children = <Widget>[
/// Plugin [dynamic_color] is not supported on iOS
if (!isIOS)
ListTile(
title: Text(l10n.followSystem),
trailing: StoreSwitch(
prop: _setting.useSystemPrimaryColor,
func: (_) => setState(() {}),
),
ColorPicker(
color: primaryColor,
onColorChanged: (c) => ctrl.text = c.toHex,
)
]);
}
return Column(
mainAxisSize: MainAxisSize.min,
children: children,
);
}),
actions: [
TextButton(
onPressed: () => _onSaveColor(ctrl.text),
child: Text(l10n.ok),
),
]);
)
];
if (!_setting.useSystemPrimaryColor.fetch()) {
children.addAll([
Input(
onSubmitted: _onSaveColor,
controller: ctrl,
hint: '#8b2252',
icon: Icons.colorize,
),
ColorPicker(
color: primaryColor,
onColorChanged: (c) => ctrl.text = c.toHex,
)
]);
}
return Column(
mainAxisSize: MainAxisSize.min,
children: children,
);
}),
actions: [
TextButton(
onPressed: () => _onSaveColor(ctrl.text),
child: Text(l10n.ok),
),
],
);
},
);
}

View File

@@ -128,9 +128,9 @@ class _SnippetListPageState extends State<SnippetListPage> {
Future<void> _runSnippet(Snippet snippet) async {
final servers = await context.showPickDialog<Server>(
items: Pros.server.servers.toList(),
name: (e) => e.spi.name,
);
items: Pros.server.servers.toList(),
name: (e) => e.spi.name,
);
if (servers == null) {
return;
}

View File

@@ -338,7 +338,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
final fileName = file.path.split('/').last;
context.showRoundDialog(
title: Text(l10n.delete),
child: Text(l10n.askContinue('${l10n.delete}: $fileName')),
child: Text(l10n.askContinue('${l10n.delete} $fileName')),
actions: [
TextButton(
onPressed: () => context.pop(),

View File

@@ -412,10 +412,10 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
final useRmr = Stores.setting.sftpRmrDir.fetch();
final text = () {
if (isDir && !useRmr) {
return l10n.askContinue(
'${l10n.dirEmpty}\n${l10n.delete} ${l10n.files}(${file.filename})');
return l10n
.askContinue('${l10n.dirEmpty}\n${l10n.delete} ${file.filename}');
}
return l10n.askContinue('${l10n.delete} ${l10n.files}(${file.filename})');
return l10n.askContinue('${l10n.delete} ${file.filename}');
}();
context.showRoundDialog(
child: Text(text),

View File

@@ -96,9 +96,9 @@ void _onTapMoreBtns(
break;
case ServerTabMenuType.snippet:
final snippets = await context.showPickDialog<Snippet>(
items: Pros.snippet.snippets,
name: (e) => e.name,
);
items: Pros.snippet.snippets,
name: (e) => e.name,
);
if (snippets == null) {
return;
}