diff --git a/easytier-gui/locales/cn.yml b/easytier-gui/locales/cn.yml index 6a7fcd7..49633c3 100644 --- a/easytier-gui/locales/cn.yml +++ b/easytier-gui/locales/cn.yml @@ -50,6 +50,7 @@ on_text: 点击开启 show_config: 显示配置 close: 关闭 +use_latency_first: 延迟优先模式 my_node_info: 当前节点信息 peer_count: 已连接 upload: 上传 diff --git a/easytier-gui/locales/en.yml b/easytier-gui/locales/en.yml index f4ddd9a..588b2a9 100644 --- a/easytier-gui/locales/en.yml +++ b/easytier-gui/locales/en.yml @@ -43,7 +43,7 @@ logging_copy_dir: Copy Log Path disable_auto_launch: Disable Launch on Reboot enable_auto_launch: Enable Launch on Reboot exit: Exit - +use_latency_first: Latency First Mode chips_placeholder: 'e.g: {0}, press Enter to add' hostname_placeholder: 'Leave blank and default to host name: {0}' off_text: Press to disable diff --git a/easytier-gui/src-tauri/src/lib.rs b/easytier-gui/src-tauri/src/lib.rs index 26067d4..08bbe0f 100644 --- a/easytier-gui/src-tauri/src/lib.rs +++ b/easytier-gui/src-tauri/src/lib.rs @@ -7,7 +7,7 @@ use anyhow::Context; use dashmap::DashMap; use easytier::{ common::config::{ - ConfigLoader, FileLoggerConfig, NetworkIdentity, PeerConfig, TomlConfigLoader, + ConfigLoader, FileLoggerConfig, Flags, NetworkIdentity, PeerConfig, TomlConfigLoader, VpnPortalConfig, }, launcher::{NetworkInstance, NetworkInstanceRunningInfo}, @@ -60,6 +60,7 @@ struct NetworkConfig { listener_urls: Vec, rpc_port: i32, + latency_first: bool, } impl NetworkConfig { @@ -160,7 +161,9 @@ impl NetworkConfig { })?, }); } - + let mut flags = Flags::default(); + flags.latency_first = self.latency_first; + cfg.set_flags(flags); Ok(cfg) } } diff --git a/easytier-gui/src/components/Config.vue b/easytier-gui/src/components/Config.vue index 67854fc..4072bc8 100644 --- a/easytier-gui/src/components/Config.vue +++ b/easytier-gui/src/components/Config.vue @@ -205,6 +205,15 @@ onMounted(async () => {
+
+
+
+ + +
+
+
+
diff --git a/easytier-gui/src/types/network.ts b/easytier-gui/src/types/network.ts index 17cb6ef..7a03398 100644 --- a/easytier-gui/src/types/network.ts +++ b/easytier-gui/src/types/network.ts @@ -31,6 +31,7 @@ export interface NetworkConfig { listener_urls: string[] rpc_port: number + latency_first: boolean } export function DEFAULT_NETWORK_CONFIG(): NetworkConfig { @@ -62,6 +63,7 @@ export function DEFAULT_NETWORK_CONFIG(): NetworkConfig { 'wg://0.0.0.0:11011', ], rpc_port: 0, + latency_first: true, } }