mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-15 06:07:23 +08:00
feat(ui): Display network names and optimize list loading (#1503)
This commit is contained in:
@@ -8,7 +8,8 @@ use easytier::proto::api::manage::{
|
||||
WebClientServiceClientFactory,
|
||||
};
|
||||
use easytier::rpc_service::remote_client::{
|
||||
ListNetworkInstanceIdsJsonResp, ListNetworkProps, RemoteClientManager, Storage,
|
||||
GetNetworkMetasResponse, ListNetworkInstanceIdsJsonResp, ListNetworkProps, RemoteClientManager,
|
||||
Storage,
|
||||
};
|
||||
use easytier::{
|
||||
common::config::{ConfigLoader, FileLoggerConfig, LoggingConfigBuilder, TomlConfigLoader},
|
||||
@@ -249,6 +250,19 @@ fn load_configs(configs: Vec<NetworkConfig>, enabled_networks: Vec<String>) -> R
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn get_network_metas(
|
||||
app: AppHandle,
|
||||
instance_ids: Vec<uuid::Uuid>,
|
||||
) -> Result<GetNetworkMetasResponse, String> {
|
||||
CLIENT_MANAGER
|
||||
.get()
|
||||
.unwrap()
|
||||
.handle_get_network_metas(app, instance_ids)
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn toggle_window_visibility<R: tauri::Runtime>(app: &tauri::AppHandle<R>) {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
@@ -667,6 +681,7 @@ pub fn run() {
|
||||
validate_config,
|
||||
get_config,
|
||||
load_configs,
|
||||
get_network_metas,
|
||||
])
|
||||
.on_window_event(|_win, event| match event {
|
||||
#[cfg(not(target_os = "android"))]
|
||||
|
||||
Reference in New Issue
Block a user