mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-06 17:59:11 +00:00
feat(gui): GUI add support to connect to config server (#1596)
This commit is contained in:
@@ -2,21 +2,28 @@ use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
instance_manager::NetworkInstanceManager,
|
||||
rpc_service::instance_manage::InstanceManageRpcService,
|
||||
rpc_service::instance_manage::InstanceManageRpcService, web_client::WebClientHooks,
|
||||
};
|
||||
|
||||
pub struct Controller {
|
||||
token: String,
|
||||
hostname: String,
|
||||
manager: Arc<NetworkInstanceManager>,
|
||||
hooks: Arc<dyn WebClientHooks>,
|
||||
}
|
||||
|
||||
impl Controller {
|
||||
pub fn new(token: String, hostname: String, manager: Arc<NetworkInstanceManager>) -> Self {
|
||||
pub fn new(
|
||||
token: String,
|
||||
hostname: String,
|
||||
manager: Arc<NetworkInstanceManager>,
|
||||
hooks: Arc<dyn WebClientHooks>,
|
||||
) -> Self {
|
||||
Controller {
|
||||
token,
|
||||
hostname,
|
||||
manager,
|
||||
hooks,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +40,7 @@ impl Controller {
|
||||
}
|
||||
|
||||
pub fn get_rpc_service(&self) -> InstanceManageRpcService {
|
||||
InstanceManageRpcService::new(self.manager.clone())
|
||||
InstanceManageRpcService::new(self.manager.clone(), self.hooks.clone())
|
||||
}
|
||||
|
||||
pub(super) fn notify_manager_stopping(&self) {
|
||||
|
||||
Reference in New Issue
Block a user