opt: Improve container parsing and error handling (#1001)

* fix(ssh): Modify the return type of execWithPwd to include the output content

Adjust the return type of the `execWithPwd` method to `(int?, String)` so that it can simultaneously return the exit code and output content

Fix the issue in ContainerNotifier where the return result of execWithPwd is not handled correctly

Ensure that server operations (shutdown/restart/suspend) are correctly pending until the command execution is completed

* refactor(container): Change single error handling to multiple error lists

Support the simultaneous display of multiple container operation errors, enhancing error handling capabilities

* fix(container): Adjust the layout width and optimize the handling of text overflow

Adjust the width calculation for the container page layout, changing from subtracting a fixed value to subtracting a smaller value to improve the layout

Add overflow ellipsis processing to the text to prevent anomalies when the text is too long

* Revert "refactor(container): Change single error handling to multiple error lists"

This reverts commit 72aaa173f5.

* feat(container): Add Podman Docker emulation detection function

Add detection for Podman Docker emulation in the container module. When detected, a prompt message will be displayed and users will be advised to switch to Podman settings.

Updated the multilingual translation files to support the new features.

* fix: Fix error handling in SSH client and container operations

Fix the issue where the SSH client does not handle stderr when executing commands

Error handling for an empty client in the container addition operation

Fix the issue where null may be returned during server page operations

* fix(container): Check if client is empty before running the command

When the client is null, directly return an error to avoid null pointer exception

* fix: Revert `stderr` ignore

* fix(container): Detect Podman simulation in advance and optimize error handling

Move the Podman simulation detection to the initial parsing stage to avoid redundant checks

Remove duplicated error handling code and simplify the logic

* fix(container): Fix the error handling logic during container command execution

Increase the inspection of error outputs, including handling situations such as sudo password prompts and Podman not being installed

* refactor(macOS): Remove unused path_provider_foundation plugin
This commit is contained in:
GT610
2026-01-17 14:40:44 +08:00
committed by GitHub
parent cd3c094af0
commit 39a3e0800b
32 changed files with 181 additions and 54 deletions

View File

@@ -1933,6 +1933,12 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Logs'**
String get logs;
/// No description provided for @podmanDockerEmulationDetected.
///
/// In en, this message translates to:
/// **'Podman Docker emulation detected. Please switch to Podman in settings.'**
String get podmanDockerEmulationDetected;
}
class _AppLocalizationsDelegate

View File

@@ -1031,4 +1031,8 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get logs => 'Protokolle';
@override
String get podmanDockerEmulationDetected =>
'Podman Docker-Emulation erkannt. Bitte wechseln Sie in den Einstellungen zu Podman.';
}

View File

@@ -1022,4 +1022,8 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get logs => 'Logs';
@override
String get podmanDockerEmulationDetected =>
'Podman Docker emulation detected. Please switch to Podman in settings.';
}

View File

@@ -1033,4 +1033,8 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get logs => 'Registros';
@override
String get podmanDockerEmulationDetected =>
'Detectada emulación de Podman Docker. Por favor, cambie a Podman en la configuración.';
}

View File

@@ -1036,4 +1036,8 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get logs => 'Journaux';
@override
String get podmanDockerEmulationDetected =>
'Émulation Podman Docker détectée. Veuillez passer à Podman dans les paramètres.';
}

View File

@@ -1022,4 +1022,8 @@ class AppLocalizationsId extends AppLocalizations {
@override
String get logs => 'Log';
@override
String get podmanDockerEmulationDetected =>
'Emulasi Podman Docker terdeteksi. Silakan beralih ke Podman di pengaturan.';
}

View File

@@ -992,4 +992,8 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get logs => 'ログ';
@override
String get podmanDockerEmulationDetected =>
'Podman Docker エミュレーションが検出されました。設定で Podman に切り替えてください。';
}

View File

@@ -1029,4 +1029,8 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get logs => 'Logboeken';
@override
String get podmanDockerEmulationDetected =>
'Podman Docker-emulatie gedetecteerd. Schakel over naar Podman in de instellingen.';
}

View File

@@ -1024,4 +1024,8 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get logs => 'Logs';
@override
String get podmanDockerEmulationDetected =>
'Emulação Podman Docker detectada. Por favor, alterne para Podman nas configurações.';
}

View File

@@ -1028,4 +1028,8 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get logs => 'Журналы';
@override
String get podmanDockerEmulationDetected =>
'Обнаружена эмуляция Podman Docker. Пожалуйста, переключитесь на Podman в настройках.';
}

View File

@@ -1023,4 +1023,8 @@ class AppLocalizationsTr extends AppLocalizations {
@override
String get logs => 'Günlükler';
@override
String get podmanDockerEmulationDetected =>
'Podman Docker emülasyonu tespit edildi. Lütfen ayarlarda Podman\'a geçin.';
}

View File

@@ -1028,4 +1028,8 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get logs => 'Журнали';
@override
String get podmanDockerEmulationDetected =>
'Виявлено емуляцію Podman Docker. Будь ласка, переключіться на Podman у налаштуваннях.';
}

View File

@@ -977,6 +977,10 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get logs => '日志';
@override
String get podmanDockerEmulationDetected =>
'检测到 Podman Docker 仿真。请在设置中切换到 Podman。';
}
/// The translations for Chinese, as used in Taiwan (`zh_TW`).
@@ -1931,4 +1935,8 @@ class AppLocalizationsZhTw extends AppLocalizationsZh {
@override
String get logs => '日誌';
@override
String get podmanDockerEmulationDetected =>
'檢測到 Podman Docker 仿真。請在設定中切換到 Podman。';
}