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

@@ -73,7 +73,7 @@ Future<SSHClient> genClient(
privateKey: jumpPrivateKey,
timeout: timeout,
);
return await jumpClient.forwardLocal(
spi.ip,
spi.port,

View File

@@ -18,6 +18,7 @@ class ServerPrivateInfo {
final String user;
@HiveField(4)
final String? pwd;
/// [id] of private key
@HiveField(5)
final String? keyId;

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 616;
static const int build = 618;
static const String engine = "3.13.8";
static const String buildAt = "2023-10-30 14:48:00";
static const String buildAt = "2023-10-30 17:18:16";
static const int modifications = 5;
static const int script = 23;
}

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();