* docs(l10n): fix un-updated English translation
* feat(container): Add support for requiring a sudo password
Add support for sudo password verification for Docker container operations, including:
1. Added ContainerErrType.sudoPasswordRequired error type
2. Add password prompt text in multi-language files
3. Modify the SSH execution logic to correctly handle the input of sudo password
4. Implement password caching and verification mechanism
* feat(container): Add sudo password error handling logic
Add a new error type `sudoPasswordIncorrect` to handle situations where the sudo password is incorrect
Modify the password verification logic in the SSH client, and return a specific error code when a password error is detected
Update multilingual files to support password error prompt information
* fix(ssh): Remove unnecessary stderr parameter and improve sudo command handling
Clean up the no longer needed stderr parameter in the SSH client, which was originally used to handle sudo password prompts
Unify the sudo command construction logic, always use the _buildSudoCmd method, and add stderr redirection
Clear cached passwords when passwords are incorrect
* fix(container): Improved sudo command handling and Podman simulation detection
Fix the sudo command processing logic, remove the masking of stderr to capture password errors
Override the detection logic simulated by Podman
Refactor the command building logic to support sh wrapping of multi-line commands
* fix(container): Improve the prompt message for sudo password errors
Update the sudo password error prompt messages for all languages to more accurately reflect situations of incorrect password or lack of permission
Fix the password error detection logic for both the SSH client and container providers simultaneously
* refactor(container): Remove unused sudo and password parameters in exec method
Simplify the exec method signature by removing the sudo and password parameters that are no longer needed, as these functions are no longer in use
* feat: Add new contributors and optimize container command handling
Add two new contributors to the GithubIds list and refactor the container command processing logic:
1. Simplify the command wrapping logic and uniformly use `sh -c` for processing
2. Specific error handling when adding a sudo password incorrectly
3. Remove redundant conditional checks and temporary variables
* feat(database): Add database compression function
Add database compression functionality to the connection statistics page to reduce the size of the database file
Add multi-language support and related UI interactions
* fix(database): Update the description of database compression operations and fix the statistics cleanup logic
Update the description of database compression operations in the multilingual files to explicitly state that data will not be lost
Fix the connection statistics cleanup logic to ensure correct matching of server IDs
Add error handling for the compression operation to prevent the UI from freezing
* Update lib/l10n/app_en.arb
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* refactor(Settings page): Simplify the click handling logic of the cancel button
* fix(backup_service): Add a cancel button in the restore backup dialog
* refactor(Settings Page): Refactor the ordered list component and optimize state management
- Extract the logic for building list items into a separate method to improve maintainability
- Add animation effects to enhance the dragging experience
- Use PageStorageKey to maintain the scroll position
- Optimize the state management logic of the checkbox
- Add new contributors in github_id.dart
* fix: Add SafeArea to the settings page to prevent content from being obscured
Add SafeArea wrapping content in multiple settings pages to prevent content from being obscured by the navigation bar on certain devices, thereby enhancing user experience
* refactor: Extract file list retrieval method and optimize asynchronous loading of iOS settings page
Extract the `_getEntities` method from an inline function to a class member method to enhance code readability
Preload watch context and push token in the iOS settings page to avoid repeatedly creating Futures
* fix: Add a `key` attribute to the ChoiceChipX component to avoid rendering issues
* refactor(Settings page): Refactor the platform-related settings logic and merge the Android settings into the main page
Migrate the Android platform settings from a standalone page to the main settings page, and remove redundant Android settings page files
Adjust the platform setting logic, retaining only the special setting entry for the iOS platform
* build: Update fl_lib dependency to v1.0.363
* feat(Settings): Add persistent disable state for cards and virtual keys
Add persistent storage functionality for server detail cards and SSH virtual key disable status
Modify the logic of relevant pages to support the saving and restoration of disabled states
* refactor(setting): Simplify save logic and optimize file sorting performance
In the settings page, remove the unnecessary `enabledList` filtering and directly save the `_order` list
Optimize the sorting logic on the local file page by first retrieving the file status before proceeding with sorting
* fix: Optimize data filtering and backup service error handling on the settings page
Fix the data filtering logic in the settings page to only process key-value pairs with specific prefixes
Add error handling to the backup service, capture and display merge failure exceptions
* fix(Settings page): Fixed the issue where disabled items were not included in the order settings and asynchronously saved preference settings
Fix the issue where disabled items in the virtual keyboard and service details order settings are not included in the order list
Change the preference setting saving method to an asynchronous operation, and add a mounted check to prevent updating the state after the component is unmounted
* refactor: Optimize the reordering logic and remove redundant sorting methods
Narrow the scope of state updates in the reordering logic to only encompass the parts where data is actually modified
Remove the unused sorting methods in `_local.dart` to simplify the code
* refactor(view): Optimize the refresh logic of the local file page
Refactor the refresh method that directly calls setState into a unified _refresh method
Use the `_entitiesFuture` to cache the list of files to obtain results and avoid redundant calculations
* Update lib/view/page/storage/local.dart
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix(systemd): Fix the issue of special characters in unit names
In systemd unit processing, filtering of special characters in unit names has been added to prevent command injection and security issues. Additionally, the rendering performance of the unit list has been optimized by merging unnecessary watch calls and removing confirmation dialogs to simplify the operation process.
* feat(Systemd): Add a confirmation dialog for systemd unit operations
Display a confirmation dialog when stopping or restarting systemd units to prevent accidental operations. For other operations, directly navigate to the SSH page to execute commands.
* fix(systemd): Fix the range of characters allowed in unit names
Extend the regular expression to allow more valid characters, including dots, @, and colons, in system unit names, to support a broader range of unit naming conventions
* fix(systemd): Fix the issue of parsing service names with dots
When dealing with service IDs containing multiple dots (such as org.cups.cupsd.service), correctly extract the service name and type. When there are no dots in the service ID, set the type to an empty string.
* fix(storage): Set the initial SFTP path based on the user's role
When the user is not root, set the initial path to `/home/$user`. For root users, use `/root` as the path
* chore: Add issue participants into github_id
* fix(sftp): Improved the logic for obtaining the initial path and asynchronously processed directory listings
Attempt to obtain the user's home directory path by executing a command, and fall back to the default path if it fails. At the same time, change the _listDir call to asynchronous to avoid potential issues.
* fix(storage): Fixed the logic for determining the initial path of SFTP
Change the condition from checking if the path is not equal to '~' to checking if the path starts with '/', to ensure the correct user home directory path is obtained
* 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
* refactor(server): Replace Future.wait with an explicit list of futures to enhance readability
Refactor the nested map and async functions into explicit for loops and future lists to make the code logic clearer
* fix(server): Fixed the auto-refresh logic and concurrency control issues
- Add `_refreshCompleter` to prevent concurrent refreshes
- Fixed the issue where the status was not updated after the automatic refresh timer was canceled
- Remove the invalid check for `duration == 1`
* refactor(server): Optimize the server refresh logic by filtering out servers that do not need to be refreshed in advance
Move the server filtering logic outside the loop and use the `where` method to filter the servers that need to be refreshed, avoiding repeated condition checks within the loop. This improves code readability and reduces redundant condition checks.
* refactor: Optimize server refresh logic to enhance readability
Break down complex conditional checks into clearer steps, separating the logic for server refresh and rate limiter reset. Replace chained calls with explicit loops to make the code easier to maintain and understand.
* refactor(server): Remove `updateFuture` from `ServerState` and use the `_isRefreshing` flag instead
Simplify the server refresh logic, replace Future state tracking with a boolean flag, and avoid unnecessary state updates
* refactor(server_detail): Extract the setting items as local variables to improve performance
Extract the globally set items that are accessed repeatedly as local variables, reduce unnecessary state retrieval operations, and optimize page performance
* refactor: Rename `_displayCpuIndexSetting` to `_displayCpuIndex` for consistency
* refactor(server): Fix the issue of parallel blocking in server refresh
The original code uses Future.wait to wait for all refresh operations to complete, but in fact, there is no need to wait for the results of these operations. Instead, directly calling ignore() to ignore the results can avoid blocking caused by the slowest server
* fix: Adjust the order of logging and default value settings
Ensure to set the default value after recording the invalid duration warning
* refactor(server): Rename _refreshCompleter to _refreshInProgress to enhance readability
Change the variable name from `_refreshCompleter` to `_refreshInProgress`, so that it more accurately reflects the actual purpose of the variable, which is to indicate whether the refresh operation is in progress
* refactor(server): Remove unnecessary refresh progress status management
Simplify the server refresh logic, remove the unused _refreshInProgress state variable and related Completer handling, making the code more concise and straightforward
* chore: Update dependent package versions
Update the following dependent package versions:
- camera_web has been upgraded from 0.3.5 to 0.3.5+3
- ffi has been upgraded from 2.1.4 to 2.1.5
- hive_ce_flutter is upgraded from 2.3.3 to 2.3.4
- watcher is upgraded from 1.1.4 to 1.2.1
* opt.
---------
Co-authored-by: lollipopkit🏳️⚧️ <10864310+lollipopkit@users.noreply.github.com>
* fix: Added logging to exception handling
Added detailed error logging to exception handling across multiple files, including exception information and stack traces, to facilitate troubleshooting.
* refactor(logging): Standardize logging output methods
Replace existing debugPrint and lprint with Loggers.app.warning to enhance logging consistency and maintainability.
* refactor: Remove redundant debug log prints
Clean up unnecessary log print statements in debug code
* feat(i18n): Added internationalization support for the logging feature
* fix: Resolved boundary condition issues in string processing
Addressed null and length checks during string splitting across multiple model classes to prevent potential null pointer exceptions and array out-of-bounds errors
* fix: Throw exceptions instead of silently returning when package manager output formats are invalid
Modified the _pacman, _opkg, and _apk parsing methods to throw exceptions when input formats are invalid, rather than silently returning, to prevent potential error handling issues.
* fix(container): Added version parameter to accommodate Podman 5.x network statistics format
Modified the parseStats method to accept a version parameter, handling changes in Podman 5.x's network statistics data structure. When the version is 5.x, network traffic data is retrieved from the RxBytes/TxBytes fields of the Network interface.
* fix(container): Fixed Podman version detection logic to correctly retrieve network statistics
Addressed Podman version number parsing issues and improved version comparison logic to support all 4.x and below versions as well as 5.x and above versions
* fix(container): Resolved display formatting issues for network and disk I/O statistics
Handled default values when NetIO and BlockIO are null, and reformatted display strings to distinguish upstream/downstream traffic and read/write operations.
* fix: Why did I mess up the tag order?