* 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
* 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
* 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
* 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>