From 8e9bb114d66a09a6ec7498e247e615788d6742b9 Mon Sep 17 00:00:00 2001 From: heixiansen Date: Mon, 26 May 2025 17:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E7=BA=A7=E9=80=89=E9=A1=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=AD=94=E6=B3=95DNS(=202.3.0=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A)=20=20=E4=BC=98=E5=8C=96=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=BB=B6=E8=BF=9F=E6=8E=92=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?1.4.5=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pages/member.vue | 49 ++++++++++++++++++++++++++++++++- src-tauri/Cargo.lock | 20 +------------- src-tauri/Cargo.toml | 4 +-- src-tauri/src/lib.rs | 57 ++++++++++++++++++++++++++++++--------- src-tauri/tauri.conf.json | 4 +-- 6 files changed, 99 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index b75dca1..1f1b5a6 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "author": "leizi97", "description": "A simple network initiator based on Easytier", - "version": "1.4.4", + "version": "1.4.5", "scripts": { "dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0", "build": "nuxt generate --dotenv env/.env.prod", diff --git a/pages/member.vue b/pages/member.vue index 77ae7bf..1dae5d6 100644 --- a/pages/member.vue +++ b/pages/member.vue @@ -54,9 +54,11 @@ prop="lat_ms" width="100" label="延迟/ms" + :sort-method="sortLatMs" + :sort-orders="['ascending', 'descending', null]" > { + const getLatencyValue = (row: any): number => { + const latMs = row.lat_ms; + + if (latMs === null || latMs === undefined || latMs === "") { + return Infinity; + } + + const num = Number(latMs); + if (isNaN(num) || num < 0) { + return Infinity; + } + + return Math.floor(num); + }; + + const valueA = getLatencyValue(a); + const valueB = getLatencyValue(b); + + if (valueA === Infinity && valueB === Infinity) { + return 0; + } + + return valueA - valueB; + }; + + // 格式化延迟显示 + const formatLatency = (latMs: any): string => { + if (latMs === null || latMs === undefined || latMs === "") { + return "-"; + } + + const num = Number(latMs); + if (isNaN(num)) { + return "-"; + } + + if (num < 0) { + return "-"; + } + + return num.toFixed(0); + }; + const _showTableHeader = [ ["hostname", "主机名"], ["cost", "路由"], diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a2c78a3..e315ef6 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1253,11 +1253,10 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "easytier-game" -version = "1.4.4" +version = "1.4.5" dependencies = [ "hashbrown 0.15.2", "log", - "planif", "rand 0.9.0", "reqwest", "serde", @@ -3496,14 +3495,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" -[[package]] -name = "planif" -version = "1.0.0" -source = "git+https://github.com/mattrobineau/planif?tag=1.0.1#90e228e2bc0f142b16a0ba415ec242e1c836cc35" -dependencies = [ - "windows 0.48.0", -] - [[package]] name = "plist" version = "1.7.0" @@ -5999,15 +5990,6 @@ dependencies = [ "windows-version", ] -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.57.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e309a8b..24120eb 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "easytier-game" -version = "1.4.4" +version = "1.4.5" homepage = "https://github.com/EasyTier/EasyTier" repository = "https://github.com/EasyTier/EasytierGame" description = "A simple network initiator based on Easytier" @@ -39,7 +39,7 @@ tauri-plugin-shell = "2.2.1" reqwest = { version = "0.12.12", features = ["json"] } zip = "2.2.3" sysinfo = '0.33.1' -planif = { git = "https://github.com/mattrobineau/planif", tag = "1.0.1" } +# planif = { git = "https://github.com/mattrobineau/planif", tag = "1.0.1" } whoami = "1.5.2" tauri-plugin-fs = "2.3.0" tauri-plugin-clipboard-manager = "2.2.2" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 01f9516..2a0e2b5 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -13,7 +13,7 @@ use sysinfo::System; use tauri::tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}; use tauri::Emitter; use tauri::Manager; -use windows::core::{BSTR, VARIANT}; +use windows::core::{Interface, BSTR, VARIANT}; use windows::Win32::Foundation::VARIANT_BOOL; use windows::Win32::NetworkManagement::IpHelper::{ GetAdaptersAddresses, GAA_FLAG_INCLUDE_PREFIX, IP_ADAPTER_ADDRESSES_LH, @@ -738,29 +738,62 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box