mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
refactor: get_running_info fn replace status polling with direct calls (#1441)
This commit is contained in:
@@ -3,7 +3,9 @@ use std::sync::Arc;
|
||||
use crate::{
|
||||
instance_manager::NetworkInstanceManager,
|
||||
proto::{
|
||||
api::config::{ConfigRpc, PatchConfigRequest, PatchConfigResponse},
|
||||
api::config::{
|
||||
ConfigRpc, GetConfigRequest, GetConfigResponse, PatchConfigRequest, PatchConfigResponse,
|
||||
},
|
||||
rpc_types::{self, controller::BaseController},
|
||||
},
|
||||
};
|
||||
@@ -33,4 +35,15 @@ impl ConfigRpc for ConfigRpcService {
|
||||
.patch_config(ctrl, input)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn get_config(
|
||||
&self,
|
||||
ctrl: Self::Controller,
|
||||
input: GetConfigRequest,
|
||||
) -> Result<GetConfigResponse, rpc_types::error::Error> {
|
||||
super::get_instance_service(&self.instance_manager, &input.instance)?
|
||||
.get_config_service()
|
||||
.get_config(ctrl, input)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ impl WebClientService for InstanceManageRpcService {
|
||||
let mut ret = NetworkInstanceRunningInfoMap {
|
||||
map: self
|
||||
.manager
|
||||
.collect_network_infos()?
|
||||
.collect_network_infos()
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(|(k, v)| (k.to_string(), v))
|
||||
.collect(),
|
||||
|
||||
@@ -78,6 +78,17 @@ impl PeerManageRpc for PeerManageRpcService {
|
||||
.await
|
||||
}
|
||||
|
||||
async fn get_foreign_network_summary(
|
||||
&self,
|
||||
ctrl: Self::Controller,
|
||||
req: crate::proto::api::instance::GetForeignNetworkSummaryRequest,
|
||||
) -> crate::proto::rpc_types::error::Result<instance::GetForeignNetworkSummaryResponse> {
|
||||
super::get_instance_service(&self.instance_manager, &req.instance)?
|
||||
.get_peer_manage_service()
|
||||
.get_foreign_network_summary(ctrl, req)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn show_node_info(
|
||||
&self,
|
||||
ctrl: Self::Controller,
|
||||
|
||||
Reference in New Issue
Block a user