feat(gui): GUI add support to connect to config server (#1596)

This commit is contained in:
Mg Pig
2025-12-04 23:05:36 +08:00
committed by GitHub
parent 53f279f5ff
commit 0a718163fd
15 changed files with 458 additions and 105 deletions
+10 -3
View File
@@ -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) {