diff --git a/package.json b/package.json index c0a3ad3..6f59c22 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.5", + "version": "1.1.6", "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 7c2a940..b27170b 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -4,179 +4,185 @@ label-position="top" :model="config" > - - - - - -
- {{ item }} - -
-
-
-
-
-
- - - - -
-
- - - - -
-
-
- - - - + + - + + + +
+ {{ item }} + +
+
+
-
+
+
+ + + + +
+
+ + + + +
+
+
+ + + + + + + + +
+
@@ -479,8 +485,8 @@ data.isStart = true; if (event.payload) { data.startLoading = false; - let ipv4 = /new: Some\((\d+\.\d+\.\d+\.\d+)\/.*\)/g.exec(event.payload as string)?.[1]; - if (config.dhcp) { + let ipv4 = /dhcp ip changed. old: None, new: Some\((\d+\.\d+\.\d+\.\d+).*\)/g.exec(event.payload as string)?.[1]; + if (config.dhcp || mainStore.configStartEnable) { if (ipv4) { config.ipv4 = ipv4; await setTrayRunState(tray, true); @@ -495,8 +501,11 @@ } } } - appWindow.emitTo("log", "logs", data.log); + const logArr = data.log.split("\n"); + const start = logArr.length > 1000 ? logArr.length - 1000 : 0; + data.log = logArr.slice(start).join("\n"); data.log += (event.payload as string) + "\n"; + }); this.unListenOutPut = unListen; }, @@ -772,10 +781,15 @@ await reset(); } else { const args = await getArgs(); - if (!args || args.length <= 0) { return ElMessage.error("无配置"); } + if(args[0] === "-c") { + ElMessage.warning({ + message: "使用配置文件中.", + duration: 5000, + }); + } data.log = ""; //清空日志 data.startLoading = true; await unListenAll(); @@ -864,9 +878,9 @@ if (!data.isStart) { return ElMessage.warning("请先开始联机"); } - if (!mainStore.config.ipv4) { - return ElMessage.warning("请等待获取IP"); - } + // if (!mainStore.config.ipv4) { + // return ElMessage.warning("请等待获取IP"); + // } await etWindows( "member", @@ -899,7 +913,7 @@ data.logVisible = true; logsTimer && clearInterval(logsTimer); logsTimer = setInterval(() => { - appWindow.emitTo("log", "logs", data.log ? (data.log as string).split("\n").slice(-1000).join("\n") : ""); + appWindow.emitTo("log", "logs", data.log); }, 600); }, () => { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 9b9240f..7a2e334 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1236,7 +1236,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "easytier-game" -version = "1.1.5" +version = "1.1.6" dependencies = [ "log", "planif", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 8f70b60..7261d6e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "easytier-game" -version = "1.1.5" +version = "1.1.6" homepage = "https://github.com/EasyTier/EasyTier" repository = "https://github.com/EasyTier/EasytierGame" description = "A simple network initiator based on Easytier" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index f98534a..be67a12 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "easytier-game", - "version": "1.1.5", + "version": "1.1.6", "identifier": "com.tauri.easytier-game", "build": { @@ -13,7 +13,7 @@ "app": { "windows": [ { - "title": "easytier-game 1.1.5", + "title": "easytier-game 1.1.6", "width": 335, "height": 305, "resizable": false, diff --git a/stores/index.ts b/stores/index.ts index cec8814..2aaf879 100644 --- a/stores/index.ts +++ b/stores/index.ts @@ -44,6 +44,8 @@ export default defineStore("main", { "basePeers", "cidrEnable", "theme", + "configStartEnable", + "configPath", "winIpBcAutoStart", "config.proxyNetworks", "config.serverUrl",