add geo info for in web device list (#1052)

This commit is contained in:
Sijie.Sun
2025-06-25 09:03:47 +08:00
committed by GitHub
parent ae4a158e36
commit ebab70ca3b
12 changed files with 248 additions and 25 deletions
+4 -1
View File
@@ -10,7 +10,7 @@ use easytier::proto::common::Void;
use easytier::proto::rpc_types::controller::BaseController;
use easytier::proto::web::*;
use crate::client_manager::session::Session;
use crate::client_manager::session::{Location, Session};
use crate::client_manager::ClientManager;
use crate::db::{ListNetworkProps, UserIdInDb};
@@ -66,6 +66,7 @@ struct ListNetworkInstanceIdsJsonResp {
struct ListMachineItem {
client_url: Option<url::Url>,
info: Option<HeartbeatRequest>,
location: Option<Location>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
@@ -308,9 +309,11 @@ impl NetworkApi {
for item in client_urls.iter() {
let client_url = item.clone();
let session = client_mgr.get_heartbeat_requests(&client_url).await;
let location = client_mgr.get_machine_location(&client_url).await;
machines.push(ListMachineItem {
client_url: Some(client_url),
info: session,
location,
});
}