Features:
- Opencode AI chat interface
- SSH tunnel for secure API communication
- Auto-install Opencode on remote servers
- API key management with server-side storage
- Session history and management
- Integration with flutter_server_box server list
* feat (SSH page): Added server sorting, search, and history features
- Added sorting functionality to the SSH page, supporting sorting by name or date added
- Added a server search feature, allowing searches by name, username, or IP address
- Implemented a server access history feature, allowing users to view and clear the history
- Added persistent storage for sorting options in Settings
- Updated the multilingual files to support the new features
* fix(ssh/tab): Fixed an issue where tabs were not refreshed after sorting
Added _tabRN.notify() to refresh tabs after sorting, while also changing _TabBar from ConsumerWidget to StatelessWidget and fixing the sorting logic
* fix(ssh/tab): Fixed an issue where tabs were not refreshed after sorting
Added _tabRN.notify() to refresh tabs after sorting, while also changing _TabBar from ConsumerWidget to StatelessWidget and fixing the sorting logic
* fix(ssh): Fixed the sorting functionality and optimized the UI display
- Fixed performance issues caused by using `indexOf` during server sorting; switched to pre-built index mappings
- Optimized divider colors to use theme colors
- Removed unnecessary nested `Column` and `Expanded` structures
- Replaced hard-coded blue with theme colors
- Added error handling to display a snackbar
- Ensured all `ValueNotifier` instances are properly released upon disposal
* feat(port_forward): Supports local, remote, and dynamic port forwarding types
Added the PortForwardType enumeration to extend port forwarding functionality, supporting three modes:
1. Local forwarding (Local)
2. Remote forwarding (Remote)
3. Dynamic forwarding (SOCKS5)
Refactored the PortForwardConfig model and related adapters, and updated the UI configuration interface to support type selection
* fix(port_forward): Fixed display and validation issues with port forwarding configurations
Fixed the display logic for the local host; when the type is set to “Dynamic Forwarding,” 127.0.0.1 is used by default
Added validation for required fields in remote forwarding configurations to ensure that the remote host and port are not empty
Optimized remote forwarding log messages by removing redundant local address displays
* fix(port_forward): Fixed issues with remote port forwarding configuration and connections
- Fixed the handling of default values when the remote port forwarding type field is empty
- Corrected the labels for local/remote host and port displayed on the remote port forwarding interface
- Fixed the local port validation logic to disallow 0 or negative numbers
- Implemented connection management and error handling for remote port forwarding
* feat (Port Forwarding): Add localization labels for types and optimize code
Add localization labels for local and remote types in the port forwarding feature
Simplify the logic for retrieving prompt text on the port forwarding page
Change the default binding host from ‘0.0.0.0’ to 'localhost'
* fix(port_forward): Fixed an issue with the display format of remote port forwarding addresses
Added special handling for remote port forwarding types in the `displayAddr` method of `PortForwardConfig` to correctly display the remote bound address and port. Also optimized the code formatting to improve readability.
* refactor(port_forward): Remove automatically generated JSON serialization code and implement it manually
Modify the JSON parsing logic in PortForwardConfig and remove the automatically generated .g.dart files
Simplify the handling of localhost addresses in displayAddr
* refactor(sftp): Optimize file download logic and SSH command execution handling
Replace manual chunked downloads with a more concise `sftp.download` method
Consistently use `utf8.decode` to process SSH command output
Remove redundant code and comments, and simplify the logic
* chore: Update `dartssh2` submodule
* feat (Temperature Display): Added an option to switch between degrees Celsius and millicelsius
Allows users to switch temperature units in server settings, resolving the issue of incorrect temperature display on some devices
* chore: Add a participnt
* fix(sftp): Fixed a resource leak issue during file downloads and SSH command execution
Ensured that remote and local file handles are properly closed during file downloads to prevent resource leaks. Additionally, improved error handling during SSH command execution to ensure that all streams are either successfully completed or properly handled in the event of an error.
* fix(ssh): Fixed the logic for handling font paths
Correctly handles font filenames to avoid duplicate file extensions. Also optimized the logic for copying font files to ensure path accuracy.
Add an issue participant
* fix (Settings): Fixed the font clearing feature and added cache cleanup
On the SSH settings page, we fixed an issue where the font clearing feature failed to clear the cache and added logic to clear cached font files. Additionally, we changed the clearing operation to run asynchronously to ensure the page closes only after the operation is complete.
* fix: Check if the component has been mounted before popping the context
Avoid calling `context.pop()` when the component is unmounted, which causes an exception
* feat (Menu Features): Added a port forwarding button and optimized server storage logic
Added the `portForward` option to the `ServerFuncBtn` enumeration to support port forwarding
Added duplicate ID checks to `ServerStore` to prevent data conflicts
* fix(server): Fixed the update logic for redirect IDs in server storage
Prevents updates from being skipped when the ID remains unchanged, ensuring that redirect IDs are mapped correctly
* fix(server): Fixed an issue where existing records were not skipped correctly when updating the redirect ID
* feat (Connection Statistics): Restored the server connection statistics feature
* perf(store): Optimize data storage performance and implement caching mechanisms
- Implement caching mechanisms in SnippetStore and ServerStore to reduce redundant loading
- Refactor ConnectionStatsStore to use indexes and optimize query performance
- Adopt a more efficient approach when cleaning up expired records
- Add a maximum record limit to prevent data bloat
* perf(store): Optimize data storage performance and add a caching mechanism
Add a caching mechanism to PrivateKeyStore to reduce redundant loading
Make the cleanup and index rebuilding of ConnectionStatsStore asynchronous
Add database compression and size statistics
Display database size in the interface and optimize compression operations
* fix (Cache): Fixed cache invalidation and join statistics issues
- Added a cache invalidation call to the reload method
- Fixed an error in the calculation of join statistics timestamps
- Optimized the cache index rebuild logic
- Added tooltips and click effects for join statistics
* refactor(connection_stats): Convert file operations from synchronous to asynchronous and optimize record cleanup logic
Convert the database size retrieval method from synchronous to asynchronous to prevent UI blocking
Optimize server record cleanup logic by directly deleting redundant records instead of rebuilding indexes
* fix(connection_stats): Fixed an initialization issue when the index database is empty
During Stores initialization, the code now checks whether `connectionStats.indexDbKeys` is empty; if so, it calls `rebuildIndexAndCompact` to rebuild and compact the database. Additionally, the implementation of the `_pruneExcessRecords` method has been optimized to use tuples instead of temporary lists, thereby improving performance. A `mounted` check has been added at the UI layer to prevent state update issues during asynchronous operations.
* fix(server): Improved error string matching logic to more accurately identify connection issues
Error strings are now uniformly converted to lowercase for comparison, and matching criteria have been expanded to cover a wider range of error scenarios, including timeouts, authentication failures, and network errors
* fix(PrivateKeyStore): Fixed an issue where the cache state was not updated when clearing the cache
When clearing the private key store, ensure that the internal cache state is updated simultaneously to maintain consistency
* refactor(store): Add close methods and clean up subscription logic
Add close methods to PrivateKeyStore, SnippetStore, and ServerStore to unsubscribe
Unify cache cleanup logic to prevent memory leaks
* fix(store): Add a cache update suppression mechanism to prevent circular updates
Add an _suppressWatch flag to multiple Store classes to suppress cache invalidation during internal operations
Add a _putWithoutInvalidatingCache method to prevent recursive watchers from being triggered during data updates
* refactor(store): Improve caching and state management using try-finally
In PrivateKeyStore, ServerStore, and SnippetStore:
1. Remove redundant close methods
2. Use try-finally to ensure the _suppressWatch state is reset correctly
3. Optimize cache invalidation logic
4. Standardize transaction handling for update operations
* refactor(store): Optimize data storage operations and fix potential issues
- Ensure the safety and consistency of list operations in ConnectionStatsStore
- Replace direct calls to `box.put` with the `set` method in SnippetStore and ServerStore
- Extract decoding logic for PrivateKeyStore into a separate method
- Add logic to update server-hopping relationships
* fix: Fixed an issue where asynchronous operations were not being waited on and optimized storage operations
Fixed several issues where asynchronous operations were not being waited on to ensure data consistency
Added the _suppressWatch control to ServerStore and PrivateKeyStore
Optimized index management in ConnectionStatsStore to maintain record order
Added a new GitHub participant
* fix: Fixed potential state issues and memory leaks in asynchronous operations
Fixed potential state issues that could occur on the server edit page after a delete operation; added a mounted check
Changed the statistics clearing operation in connection_stats to run asynchronously
Optimized asynchronous operations in PrivateKeyStore and fixed potential memory leaks
* refactor(store): Convert asynchronous methods to synchronous ones to simplify the code
Fixed an issue where asynchronous operations were not handled correctly on the connection statistics page
* fix: Added mounted check and error handling for connection logs
Added a mounted check in _ConnectionStatsPageState to prevent the state from being updated after the component is unmounted
Added a try-catch block for connection logs in ServerNotifier to catch and log potential storage exceptions
* chore: Update submodules and dependencies
Update the fl_lib and circle_chart submodules to the latest commit
Upgrade the hive_ce_generator dependency from 1.9.2 to 1.11.0
* build: Updated dependency versions
Updated fl_chart to 1.2.0, json_serializable to 6.13.0, and test to 1.29.0
Replaced flutter_secure_storage_macos with flutter_secure_storage_darwin
Removed the animations and screenshot dependencies, which are no longer in use
* chore: Update French i18n
- Update Riverpod-related dependencies to the latest versions
- Remove the app_links and gtk plugins
- Update the reference path for hive_ce
- Adjust the provider implementation in the generated code
* feat: Added Port Forwarding Functionality
Implemented port forwarding functionality, including the following major changes:
- Added a port forwarding configuration model and related state management
- Added a port forwarding page and interaction logic
- Implemented forwarding connections between local and remote ports
- Integrated into the server features menu
- Added necessary Hive adapters and storage support
- Updated plugin configurations across all platforms to support the new feature
* feat (Port Forwarding): Added multilingual support and optimized implementation
Added multilingual support for the port forwarding feature, including Chinese, English, and other languages
Optimized the port forwarding implementation by adding connection management and error handling
Fixed an issue with state persistence when updating port forwarding configurations
Updated related dependencies and submodules
* fix(port_forward): Fixed port forwarding error handling and redesigned the configuration dialog
Handled uncaught errors when port forwarding is disabled or during connection attempts
Extracted the configuration dialog into a standalone component and added port range validation
* fix(port_forward): Fixed issues with port forwarding connection management and UI layout
Fixed an issue where port forwarding connections were not closed properly; now uses `clientGetter` to delay the retrieval of `SSHClient`
Added cleanup logic when connections are closed to prevent memory leaks
Added a `mounted` check in `PortForwardPage` to prevent operations from executing after the component is unmounted
Wrapped the configuration dialog content in a `SingleChildScrollView` to prevent content overflow
* fix(port_forward): Fixed a concurrent modification exception that occurred when closing a port forwarding connection
Fixed a concurrent modification exception that could occur when closing a local forwarding entry by copying the connection list to prevent modifications to the collection during iteration. Also improved the UI by using theme colors and added error handling for configuration saving.
* fix(port_forward_provider): Fixed an issue where entries were not properly removed when port forwarding was stopped
When port forwarding is stopped, ensure that the corresponding entries are removed from the _forwards map. Additionally, before adding a new forwarding rule, check for and close any existing forwarding rules with the same ID to prevent resource leaks.
* refactor(l1n): Remove unused localization and remote host port translations
* fix(port_forward_provider): Handle errors when closing port forwarding
Add error handling to prevent the program from crashing due to exceptions when closing port forwarding
* refactor(port_forward): Refactor port forwarding state management to use serverId
Directly link port forwarding state management to the server ID to simplify parameter passing
Remove direct dependencies on Spi and use serverId as the core identifier instead
Update relevant providers and page logic to accommodate the new state structure
* fix(port_forward): Fixed a race condition issue in port forwarding operations
Added an _inFlight collection to prevent duplicate operations
Added a _saving state when saving configurations to prevent duplicate submissions
Automatically cleans up forwarding when changes in server connection status are detected
* refactor(port_forward_provider): Remove unnecessary concurrency control logic
Simplify the `toggleForward` method by removing concurrency control for the `_inFlight` collection, as it is not required in the current scenario
* feat(PVE): Added display of PVE connection loading steps
Added a detailed display of loading steps during the PVE connection process, including stages such as establishing an SSH tunnel, authentication, and data retrieval
Also optimized the sorting of PVE storage content and the logic for handling connection errors
* feat(pve): Added error handling and prompts for PVE two-factor authentication
Added error handling for PVE servers when two-factor authentication is enabled, along with relevant error types and localized prompts
* feat(PVE): Added support for PVE passwords during key-based authentication
- Added the `pvePwd` field to the `ServerCustom` model
- Added a PVE password input field to the edit page (displayed only during key-based authentication)
- Updated multilingual files to support PVE-related loading states and password prompts
- Optimized PVE connection logic to support password verification during key-based authentication
* feat (Private Key Editing): Added private key format normalization
Added the _normalizePrivateKey method to normalize private key formats:
- Removes whitespace characters from Base64 content
- Ensures the standard format of 64 characters per line
- Ensures that the private key ends with a newline character
* fix(private_key): Fixes PEM private key formatting issues while preserving metadata headers
Properly handles metadata headers (such as Proc-Type and DEK-Info) in encrypted PEM keys and preserves these headers when cleaning up Base64 content. Additionally, optimizes the logic for removing whitespace characters and improves performance by using precompiled regular expressions.
* refactor(ui): Remove unused ctx parameters and optimize the selection window caching logic
- Remove unused egui::Context parameters from functions related to settings_page
- Add a check for the length of items in the selection window cache to improve cache validity
- Simplify the cache data structure and remove unnecessary online data validation logic
* fix(private_key): Fixed an issue with matching header and footer tags in PEM-format private keys
Added validation for consistency of header and footer tags in PEM-format private keys to ensure that the content following “BEGIN” and “END” is identical
* refactor(server): Move the SSH import and discovery features from the server edit page to the settings page
* feat (SSH Configuration): Added a feature to automatically import SSH configurations upon first launch
Checks for and prompts the user to import SSH configurations upon the first launch on the desktop
Optimized the SSH server import logic, adding duplicate detection and name conflict handling
Fixed an issue with mount status checks that could occur during the import process
* refactor (UI): Adjust the placement of the QR code scanning and SSH configuration import features
Move the QR code scanning feature from the server editing page to the settings page, and display different access points based on the platform
Optimize the SSH configuration import logic to ensure the status is updated correctly after the configuration is read for the first time
* refactor(ssh): Refactor server import logic and extract common methods
Extract server import logic into the `ServerDeduplication` class
Use the `importServersWithNotification` method consistently to handle imports
Remove duplicate `_importServers` and `_resolveServers` methods
Add checks for existing server IDs
* refactor(SSH): Optimized server import logic and fixed permission issues
- Moved the SSH configuration import logic from `edit.dart` to `actions.dart`
- Removed redundant checks for the `mounted` parameter
- Added handling for file permission exceptions
- Improved logic for resolving server name conflicts
* fix(ssh): Fixed an issue with message display during SSH configuration import
- Modified the format of the import success message to display the number of servers successfully imported
- Added a prompt for manual selection when permissions are denied
- Optimized the server deduplication logic to display an “already exists” message based on the original count
* fix(ssh): Fixed an issue with the count display when importing SSH configurations
Adjusted the server's deduplication logic to ensure the correct original count is used when displaying the number of imports
Removed unnecessary flag settings for the first read of SSH configurations
* fix: Fixed an issue where the “first read” flag was not updated when SSH configuration access was denied
When SSH configuration access is denied, set the “first read” flag to false to prevent repeated prompts
* fix(server): Optimized the logic for checking existing servers when importing SSH configurations
Moved the logic for checking existing servers to an earlier stage to avoid unnecessary parsing of SSH configurations
* feat (Editor): Add an option to set the editor font family
Add the `editorFontFamily` property to the settings storage and implement font family selection functionality on editor-related pages. Also, update all pages that use the editor settings to support the newly added font family option.
* refactor(editor): Optimize the logic for editor font settings
Standardize the method for retrieving font settings on the editor page to avoid redundant calls to the `fetch()` method. Extract the font retrieval logic into variables or anonymous functions to improve code readability and performance.
* fix(storage): Fixed an issue with the SFTP path history
Added path validity checks when processing the SFTP path history
Standardized the format of stored paths and removed extra slashes
* refactor(sftp): Standardize SFTP path handling and optimize resource management
Extract path normalization logic into a separate method: _normalizeSftpPath
Ensure that the SFTP client is properly closed after use
- Remove code related to Cupertino routing that is no longer in use
- Update the list of contributors on GitHub
- Update the version of the xterm submodule
* fix(ssh): Ensure that the private key ends with a newline character
Fixes an issue where SSH private key files were not written with a newline character at the end, preventing parsing errors in certain SSH clients
Update the package
* fix(server_func_btns): Fixed an issue with the order of SSH command parameters and added file permission settings
Added permission settings for private key files on non-Windows platforms to ensure secure access. Additionally, the order of SSH command parameters was adjusted to ensure that connection parameters are passed correctly.
* refactor(ssh): Remove terminal copy button and streamline clipboard functionality
Update dependency versions and remove the copy button from the terminal page, integrating clipboard functionality into the terminal controller.
* refactor(ssh): Optimize clipboard paste functionality implementation
Convert the _OnTerminalPaste method to an asynchronous implementation and remove duplicate _paste methods.
* refactor(ssh): Rename clipboard operation function and add new functionality
Renamed _onTerminalPaste to _onClipboardAction and expanded its functionality
Now supports copying selected text to the clipboard and performing paste operations when no text is selected
* fix: Fixed an issue where clipboard operations did not wait for asynchronous completion.
* fix(ssh): Fixed terminal paste operation return logic
Prevented redundant _onTerminalPaste calls after terminal paste operations
- Update the fl_lib submodule to the latest commit
- Remove dependency comments using submodules from pubspec.yaml
- Upgrade local_auth and related platform implementations to new versions
* 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>