From 8ed652ee2613103e4d16f726ea80a1924729bbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E5=85=88=E6=A3=AE?= Date: Fri, 3 Jan 2025 17:16:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=98=E7=9B=98=E8=8F=9C=E5=8D=95=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=AC=E5=85=B1=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composables/tray.ts | 15 ++++++++++++++- pages/tool.vue | 18 +++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/composables/tray.ts b/composables/tray.ts index 750d856..6074f09 100644 --- a/composables/tray.ts +++ b/composables/tray.ts @@ -7,7 +7,7 @@ import useMainStore from "@/stores/index"; import { resourceDir as getResourceDir, join } from "@tauri-apps/api/path"; import { invoke } from "@tauri-apps/api/core"; // import { ElConfirmPrimary } from "~/utils/element"; -// import { open } from "@tauri-apps/plugin-shell"; +import { open } from "@tauri-apps/plugin-shell"; const DEFAULT_TRAY_NAME = "main"; @@ -64,6 +64,8 @@ export async function generateMenuItem(beforExit: Function, handleConnection:Fun await MenuItemExchangeConnection("联机 / 断开", handleConnection), await MenuItemTheme(), await PredefinedMenuItem.new({ item: "Separator" }), + await MenuItemPublicPeers(), + await PredefinedMenuItem.new({ item: "Separator" }), await MenuItemExit("退出", beforExit), ]; } @@ -81,6 +83,17 @@ export async function MenuItemExit(text: string, beforExit: Function) { }); } +export async function MenuItemPublicPeers() { + + return await MenuItem.new({ + id: "publicPeers", + text: "公共节点", + action: async () => { + await open("https://easytier.gd.nkbpal.cn/status/easytier") + }, + }); +} + export async function MenuItemShow(text: string) { return await MenuItem.new({ id: "show", diff --git a/pages/tool.vue b/pages/tool.vue index 140211d..1c468a3 100644 --- a/pages/tool.vue +++ b/pages/tool.vue @@ -41,7 +41,9 @@ >
- + 方案2 @@ -85,12 +87,11 @@
{ const guids = await invoke("get_network_adapter_guids"); - mainStore.forceBindInput = mainStore.config.ipv4; - if (guids && guids.length > 0) { - data.guids = guids; + data.guids = guids && guids.length > 0 ? guids : []; + if (mainStore.forceBindInput.startsWith("{")) { + const has = data.guids.find(el => el[0] == mainStore.forceBindInput); + if (!has) { + mainStore.forceBindInput = ""; + } } };