From 4bedec63ca40ed937d549d38851747eb18504e96 Mon Sep 17 00:00:00 2001 From: leizi97 Date: Fri, 15 Nov 2024 00:13:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E6=9C=BA=E8=87=AA=E5=90=AF=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BF=AE=E5=A4=8D=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composables/log.ts | 8 -- composables/tray.ts | 6 +- package.json | 2 +- pages/index.vue | 207 ++++++++++++---------------- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/capabilities/default.json | 6 +- src-tauri/src/lib.rs | 79 +++++++---- src-tauri/tauri.conf.json | 4 +- 9 files changed, 152 insertions(+), 164 deletions(-) delete mode 100644 composables/log.ts diff --git a/composables/log.ts b/composables/log.ts deleted file mode 100644 index 6e8e607..0000000 --- a/composables/log.ts +++ /dev/null @@ -1,8 +0,0 @@ -// const infoDialog = new WebviewWindow("log", { -// title: "日志", -// resizable: false, -// width: 600, -// height: 400, -// parent: appWindow, -// url: "/log" -// }); \ No newline at end of file diff --git a/composables/tray.ts b/composables/tray.ts index 3aed2ca..6c87aba 100644 --- a/composables/tray.ts +++ b/composables/tray.ts @@ -4,6 +4,7 @@ import { getCurrentWindow } from "@tauri-apps/api/window"; import pkg from "@/package.json"; import { setTheme } from "~/composables/theme"; import useMainStore from "@/stores/index"; +import { resourceDir as getResourceDir, join } from "@tauri-apps/api/path"; const DEFAULT_TRAY_NAME = "main"; @@ -113,7 +114,10 @@ export async function MenuItemTheme() { export async function setTrayRunState(tray: TrayIcon | null, isRunning: boolean = false) { if (!tray) return; - await tray.setIcon(isRunning ? "easytier/icons/icon-inactive.ico" : "easytier/icons/icon.ico"); + const resourceDir = await getResourceDir(); + const path = await join(resourceDir, isRunning ? "easytier/icons/icon-inactive.ico" : "easytier/icons/icon.ico"); + // "easytier/icons/icon-inactive.ico", { baseDir: BaseDirectory.Resource } + await tray.setIcon(path); } export async function setTrayTooltip(tray: TrayIcon | null, tooltip?: string | null) { diff --git a/package.json b/package.json index 4146e74..6eb2ef4 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.1.9", + "version": "1.2.0", "scripts": { "dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0", "build": "nuxt generate --dotenv env/.env.prod" diff --git a/pages/index.vue b/pages/index.vue index 995646f..1be9483 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -2,8 +2,7 @@ + :model="config"> + prop="serverUrl">