diff --git a/assets/css/main.css b/assets/css/main.css index 30ca3ed..6885e4d 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -46,4 +46,8 @@ html.dark body { align-items: flex-start; overflow: auto; flex: 1; +} + +.el-table { + font-size: 12px!important; } \ No newline at end of file diff --git a/composables/configJson.ts b/composables/configJson.ts index d9ee8e8..1f6734d 100644 --- a/composables/configJson.ts +++ b/composables/configJson.ts @@ -24,6 +24,7 @@ export const updateConfigJson = async (configJsonSeverUrl: Array | strin serverUrl, port, enableCustomListener, + enablePreventSleep, customListenerData, ...otherConfig } = mainStore.config; diff --git a/composables/netcard.ts b/composables/netcard.ts index 4baf8ec..0c7aba2 100644 --- a/composables/netcard.ts +++ b/composables/netcard.ts @@ -44,7 +44,7 @@ export const handleWinipBcStart = async () => { await getWinIpBroadcastPid(); if (mainStore.winipBcPid <= 0) { mainStore.$patch({ - winIpBcAutoStart: true + winIpBcAutoStart: false }); } } diff --git a/package.json b/package.json index 16de156..abad253 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.2.9", + "version": "1.3.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/advance.vue b/pages/advance.vue index c870307..d248d99 100644 --- a/pages/advance.vue +++ b/pages/advance.vue @@ -58,6 +58,7 @@ 打开config.json目录 +
防止休眠
不监听任何端口,只连接到对等节点 @@ -184,6 +185,7 @@ import { reactive } from "vue"; import { dataSubscribe } from "@/composables/windows"; import { supportProtocols } from "~/utils"; +import { getCurrentWindow } from "@tauri-apps/api/window"; const protocols = supportProtocols(); const listenerDialogData = reactive<{ [key: string]: any }>({ diff --git a/pages/index.vue b/pages/index.vue index 3f5957d..bd3ec8f 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -523,7 +523,7 @@ import { updateConfigJson } from "~/composables/configJson"; import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager"; import { sortedUniq, uniq } from "lodash-es"; - import { bounce, addQQGroup, supportProtocols } from "~/utils"; + import { bounce, addQQGroup, supportProtocols, preventSleep, stopPreventSleep } from "~/utils"; import { ElConfirmDanger, ElConfirmPrimary } from "~/utils/element"; import { getServerArgs } from "@/composables/server"; @@ -668,9 +668,9 @@ mainStore.config.ipv4 = configIpv4; } } - if (event.payload.includes("peer connection removed")) { - data.isSuccessGetIp = false; - } + // if (event.payload.includes("peer connection removed")) { + // data.isSuccessGetIp = false; + // } if (event.payload.includes("new peer connection added") && !data.isSuccessGetIp) { await setTrayRunState(tray, true); data.isSuccessGetIp = true; @@ -737,10 +737,14 @@ async listenConfigStart() { const appWindow = getCurrentWindow(); const unListen = await listen("config", event => { - // console.error("config", event.payload); const ipv4 = config.ipv4; mainStore.$patch(event.payload as any); config.ipv4 = ipv4; + if(mainStore.config.enablePreventSleep) { + preventSleep(); + }else { + stopPreventSleep(); + } appWindow.emitTo({ kind: "Any" }, "global-main-store", { store: { ...mainStore.$state } }); }); const unListen2 = mainStore.$subscribe(() => { @@ -949,6 +953,12 @@ } }; + const initPreventSleep = async () => { + if (mainStore.config.enablePreventSleep) { + preventSleep(); + } + } + const mountedShow = async () => { const args = await getMatches(); if (!args.args?.["task-auto-start"]?.value) { @@ -974,6 +984,7 @@ await initConfigDir(); await initAutoStartServer(); await initConnectAfterStart(); + initPreventSleep(); mountedShow(); // 不需要await closePrevent(); }); @@ -986,6 +997,7 @@ listenObj.unListenStartStopServer && listenObj.unListenStartStopServer(); logsTimer && clearInterval(logsTimer); serverLogsTimer && clearInterval(serverLogsTimer); + stopPreventSleep(); }); const getArgs = async () => { diff --git a/pages/member.vue b/pages/member.vue index 8515056..b3c9ec4 100644 --- a/pages/member.vue +++ b/pages/member.vue @@ -1,7 +1,7 @@