fix: sftp mission error display

This commit is contained in:
lollipopkit
2023-10-31 18:50:37 +08:00
parent bff799afd9
commit f2edd14117
6 changed files with 37 additions and 22 deletions

View File

@@ -68,7 +68,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
/// List in dart is passed by pointer, so you need to copy it here
_tags.addAll(spi.tags ?? []);
_altUrlController.text = spi.alterUrl ?? '';
_autoConnect.value = spi.autoConnect ?? true;
_jumpServer.value = spi.jumpId;

View File

@@ -52,6 +52,20 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
}
Widget _buildItem(SftpReqStatus status) {
final err = status.error;
if (err != null) {
return _wrapInCard(
status: status,
subtitle: l10n.error,
trailing: IconButton(
onPressed: () => context.showRoundDialog(
title: Text(l10n.error),
child: Text(err.toString()),
),
icon: const Icon(Icons.error),
),
);
}
switch (status.status) {
case SftpWorkerStatus.finished:
final time = status.spentTime.toString();