feat: Added Port Forwarding Functionality (#1083)
* 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
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <dynamic_color/dynamic_color_plugin.h>
|
||||
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||
#include <gtk/gtk_plugin.h>
|
||||
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
#include <window_manager/window_manager_plugin.h>
|
||||
@@ -19,6 +20,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) gtk_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
|
||||
gtk_plugin_register_with_registrar(gtk_registrar);
|
||||
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
|
||||
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
dynamic_color
|
||||
flutter_secure_storage_linux
|
||||
gtk
|
||||
screen_retriever_linux
|
||||
url_launcher_linux
|
||||
window_manager
|
||||
|
||||
Reference in New Issue
Block a user