mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2026-09-25 03:35:55 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f2c800380 | ||
|
|
8b2ce406d8 | ||
|
|
10dde939cb | ||
|
|
84460409ed | ||
|
|
60faa01769 | ||
|
|
26f3f6fb36 | ||
|
|
494087820a | ||
|
|
87f4d98518 | ||
|
|
30a2c3430b | ||
|
|
aab8175ce3 | ||
|
|
136ce06c33 | ||
|
|
bdeda8bebd | ||
|
|
3ee09f7d60 | ||
|
|
7853d3b2f5 | ||
|
|
aacf47b6f5 | ||
|
|
d9b01fc754 | ||
|
|
844fba8462 |
@@ -20,5 +20,8 @@ export const getServerArgs = () => {
|
|||||||
if (!whiteList && mainStore.serverConfig.enableWhiteList) {
|
if (!whiteList && mainStore.serverConfig.enableWhiteList) {
|
||||||
args.push("--relay-network-whitelist");
|
args.push("--relay-network-whitelist");
|
||||||
}
|
}
|
||||||
|
if (mainStore.serverConfig.privateMode) {
|
||||||
|
args.push("--private-mode", "true");
|
||||||
|
}
|
||||||
return args;
|
return args;
|
||||||
};
|
};
|
||||||
|
|||||||
+15
-4
@@ -22,7 +22,7 @@ async function toggleVisibility() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function useTray(init: boolean = false, beforExit: Function, handleConnection: Function) {
|
export async function useTray(init: boolean = false, beforExit: Function, handleConnection: Function, handleReconnect: Function) {
|
||||||
let tray;
|
let tray;
|
||||||
try {
|
try {
|
||||||
tray = await TrayIcon.getById(DEFAULT_TRAY_NAME);
|
tray = await TrayIcon.getById(DEFAULT_TRAY_NAME);
|
||||||
@@ -31,7 +31,7 @@ export async function useTray(init: boolean = false, beforExit: Function, handle
|
|||||||
tooltip: `EasyTierGame\n${pkg.version}`,
|
tooltip: `EasyTierGame\n${pkg.version}`,
|
||||||
title: `EasyTierGame\n${pkg.version}`,
|
title: `EasyTierGame\n${pkg.version}`,
|
||||||
id: DEFAULT_TRAY_NAME,
|
id: DEFAULT_TRAY_NAME,
|
||||||
menu: await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection) }),
|
menu: await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection, handleReconnect) }),
|
||||||
action: async e => {
|
action: async e => {
|
||||||
toggleVisibility();
|
toggleVisibility();
|
||||||
}
|
}
|
||||||
@@ -45,16 +45,17 @@ export async function useTray(init: boolean = false, beforExit: Function, handle
|
|||||||
if (init) {
|
if (init) {
|
||||||
tray.setTooltip(`EasyTierGame\n${pkg.version}`);
|
tray.setTooltip(`EasyTierGame\n${pkg.version}`);
|
||||||
tray.setShowMenuOnLeftClick(false);
|
tray.setShowMenuOnLeftClick(false);
|
||||||
tray.setMenu(await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection) }));
|
tray.setMenu(await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection, handleReconnect) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
return tray;
|
return tray;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMenuItem(beforExit: Function, handleConnection: Function) {
|
export async function generateMenuItem(beforExit: Function, handleConnection: Function, handleReconnect: Function) {
|
||||||
return [
|
return [
|
||||||
await MenuItemShow("显示 / 隐藏"),
|
await MenuItemShow("显示 / 隐藏"),
|
||||||
await MenuItemExchangeConnection("联机 / 断开", handleConnection),
|
await MenuItemExchangeConnection("联机 / 断开", handleConnection),
|
||||||
|
await MenuItemReconnect("重新联机", handleReconnect),
|
||||||
await MenuItemTheme(),
|
await MenuItemTheme(),
|
||||||
await PredefinedMenuItem.new({ item: "Separator" }),
|
await PredefinedMenuItem.new({ item: "Separator" }),
|
||||||
await MenuItemPublicPeers(),
|
await MenuItemPublicPeers(),
|
||||||
@@ -63,6 +64,16 @@ export async function generateMenuItem(beforExit: Function, handleConnection: Fu
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function MenuItemReconnect(text: string, handleReconnect: Function) {
|
||||||
|
return await MenuItem.new({
|
||||||
|
id: "reconnect",
|
||||||
|
text,
|
||||||
|
action: async () => {
|
||||||
|
await handleReconnect();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function MenuItemExit(text: string, beforExit: Function) {
|
export async function MenuItemExit(text: string, beforExit: Function) {
|
||||||
return await MenuItem.new({
|
return await MenuItem.new({
|
||||||
id: "quit",
|
id: "quit",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { type UnlistenFn } from "@tauri-apps/api/event";
|
import { type UnlistenFn } from "@tauri-apps/api/event";
|
||||||
import { getCurrentWindow, PhysicalPosition, type WindowOptions, Window, currentMonitor } from "@tauri-apps/api/window";
|
import { getCurrentWindow, PhysicalPosition, type WindowOptions, Window, currentMonitor, PhysicalSize } from "@tauri-apps/api/window";
|
||||||
import { WebviewWindow } from "@tauri-apps/api/webviewWindow";
|
import { WebviewWindow } from "@tauri-apps/api/webviewWindow";
|
||||||
import type { WebviewLabel, WebviewOptions } from "@tauri-apps/api/webview";
|
import type { WebviewLabel, WebviewOptions } from "@tauri-apps/api/webview";
|
||||||
import useMainStore from "@/stores/index";
|
import useMainStore from "@/stores/index";
|
||||||
@@ -44,18 +44,21 @@ export default async (
|
|||||||
defaultOpts.parent = appWindow;
|
defaultOpts.parent = appWindow;
|
||||||
// console.error(logicalPosition);
|
// console.error(logicalPosition);
|
||||||
if (defaultOpts.x == 0 && defaultOpts.y == 0) {
|
if (defaultOpts.x == 0 && defaultOpts.y == 0) {
|
||||||
const appSize = await appWindow.outerSize();
|
const logicalAppSize = {
|
||||||
|
width: 340,
|
||||||
|
height: 305
|
||||||
|
}
|
||||||
const factor = await appWindow.scaleFactor();
|
const factor = await appWindow.scaleFactor();
|
||||||
const appPosition = await appWindow.outerPosition();
|
const appPosition = await appWindow.outerPosition();
|
||||||
const logicalPosition = new PhysicalPosition(appPosition.x + appSize.width, appPosition.y).toLogical(factor);
|
const logicalPosition = new PhysicalPosition(appPosition.x + Math.ceil((logicalAppSize.width + 5) * factor), appPosition.y).toLogical(factor);
|
||||||
defaultOpts.x = logicalPosition.x;
|
defaultOpts.x = logicalPosition.x;
|
||||||
defaultOpts.y = logicalPosition.y;
|
defaultOpts.y = logicalPosition.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialog = new WebviewWindow(label, { ...defaultOpts, ...options });
|
dialog = new WebviewWindow(label, { ...defaultOpts, ...options });
|
||||||
await dealCloseListener(dialog, label, beforeCloseFunc);
|
await dealCloseListener(dialog, label, beforeCloseFunc);
|
||||||
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
|
||||||
await dialog.show();
|
await dialog.show();
|
||||||
|
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
||||||
} else {
|
} else {
|
||||||
const visible = await dialog.isVisible();
|
const visible = await dialog.isVisible();
|
||||||
if (visible) {
|
if (visible) {
|
||||||
@@ -63,8 +66,8 @@ export default async (
|
|||||||
} else {
|
} else {
|
||||||
const appWindow = getCurrentWindow();
|
const appWindow = getCurrentWindow();
|
||||||
await dealCloseListener(dialog, label, beforeCloseFunc);
|
await dealCloseListener(dialog, label, beforeCloseFunc);
|
||||||
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
|
||||||
await dialog.show();
|
await dialog.show();
|
||||||
|
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+7
-7
@@ -3,7 +3,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"author": "leizi97",
|
"author": "leizi97",
|
||||||
"description": "A simple network initiator based on Easytier",
|
"description": "A simple network initiator based on Easytier",
|
||||||
"version": "1.4.5",
|
"version": "1.4.7",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0",
|
"dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0",
|
||||||
"build": "nuxt generate --dotenv env/.env.prod",
|
"build": "nuxt generate --dotenv env/.env.prod",
|
||||||
@@ -12,9 +12,9 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@element-plus/nuxt": "1.1.2",
|
"@element-plus/nuxt": "1.1.3",
|
||||||
"@nuxtjs/tailwindcss": "6.13.2",
|
"@nuxtjs/tailwindcss": "6.13.2",
|
||||||
"@pinia/nuxt": "0.11.0",
|
"@pinia/nuxt": "0.11.1",
|
||||||
"@tauri-apps/api": "2.5.0",
|
"@tauri-apps/api": "2.5.0",
|
||||||
"@tauri-apps/cli": "2.5.0",
|
"@tauri-apps/cli": "2.5.0",
|
||||||
"@tauri-apps/plugin-cli": "^2.2.0",
|
"@tauri-apps/plugin-cli": "^2.2.0",
|
||||||
@@ -28,14 +28,14 @@
|
|||||||
"@vitejs/plugin-vue-jsx": "4.1.2",
|
"@vitejs/plugin-vue-jsx": "4.1.2",
|
||||||
"@vueuse/core": "12.7.0",
|
"@vueuse/core": "12.7.0",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"element-plus": "2.9.11",
|
"element-plus": "2.10.2",
|
||||||
"less": "4.2.1",
|
"less": "4.2.1",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"nuxt": "3.17.4",
|
"nuxt": "3.17.5",
|
||||||
"pinia": "3.0.2",
|
"pinia": "3.0.3",
|
||||||
"pinia-plugin-persistedstate": "4.3.0",
|
"pinia-plugin-persistedstate": "4.3.0",
|
||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
"prettier": "3.5.2",
|
"prettier": "3.5.2",
|
||||||
"prettier-plugin-tailwindcss": "0.6.11"
|
"prettier-plugin-tailwindcss": "0.6.13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+55
-4
@@ -44,19 +44,43 @@
|
|||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-nowrap items-center gap-[5px]">
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
<ElCheckbox v-model="mainStore.config.enableKcpProxy">启用KCP代理</ElCheckbox>
|
<ElCheckbox
|
||||||
<ElTooltip content="将TCP流量转为KCP流量,降低传输延迟,提升传输速度">
|
@change="handleKcpProxyChange"
|
||||||
|
v-model="mainStore.config.enableKcpProxy"
|
||||||
|
>
|
||||||
|
启用KCP代理
|
||||||
|
</ElCheckbox>
|
||||||
|
<ElTooltip content="(不可与QUIC代理同时开启)将TCP流量转为KCP流量,降低传输延迟,提升传输速度">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<CoreVersionWarning version="2.2.0" />
|
<CoreVersionWarning version="2.2.0" />
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-nowrap items-center gap-[5px]">
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
<ElCheckbox v-model="mainStore.config.disableKcpInput">禁用KCP输入</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.disableKcpInput">禁用KCP输入</ElCheckbox>
|
||||||
<ElTooltip content="禁用KCP入站流量,其他开启KCP代理的节点无法连接到本节点">
|
<ElTooltip content="不允许其他节点使用 KCP 代理 TCP 流到此节点。开启 KCP 代理的节点访问此节点时,依然使用原始 TCP 连接">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<CoreVersionWarning version="2.2.0" />
|
<CoreVersionWarning version="2.2.0" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
|
<ElCheckbox
|
||||||
|
@change="handleQuicProxyChange"
|
||||||
|
v-model="mainStore.config.enableQuicProxy"
|
||||||
|
>
|
||||||
|
启用QUIC代理
|
||||||
|
</ElCheckbox>
|
||||||
|
<ElTooltip content="(不可与KCP代理同时开启)使用 QUIC 代理 TCP 流,提高在 UDP 丢包网络上的延迟和吞吐量">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
<CoreVersionWarning version="2.3.2" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
|
<ElCheckbox v-model="mainStore.config.disableQuicInput">禁用QUIC输入</ElCheckbox>
|
||||||
|
<ElTooltip content="不允许其他节点使用 QUIC 代理 TCP 流到此节点。开启 QUIC 代理的节点访问此节点时,依然使用原始 TCP 连接">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
<CoreVersionWarning version="2.3.2" />
|
||||||
|
</div>
|
||||||
<div><ElCheckbox v-model="mainStore.config.disableUdpHolePunching">禁用UDP打洞功能</ElCheckbox></div>
|
<div><ElCheckbox v-model="mainStore.config.disableUdpHolePunching">禁用UDP打洞功能</ElCheckbox></div>
|
||||||
<div><ElCheckbox v-model="mainStore.config.disableIpv6">不使用IPv6</ElCheckbox></div>
|
<div><ElCheckbox v-model="mainStore.config.disableIpv6">不使用IPv6</ElCheckbox></div>
|
||||||
<div class="flex flex-nowrap items-center gap-[5px]">
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
@@ -66,6 +90,13 @@
|
|||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<CoreVersionWarning version="2.3.0" />
|
<CoreVersionWarning version="2.3.0" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
|
<ElCheckbox v-model="mainStore.config.privateMode">启用私有模式</ElCheckbox>
|
||||||
|
<ElTooltip content="启用后,不允许使用了与本网络不同的房间名和密码的节点通过本节点进行握手或中转">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
<CoreVersionWarning version="2.3.1" />
|
||||||
|
</div>
|
||||||
<ElDivider />
|
<ElDivider />
|
||||||
<div class="flex items-center gap-[10px]">
|
<div class="flex items-center gap-[10px]">
|
||||||
<ElCheckbox v-model="mainStore.config.disbleListenner">不监听任何端口,只连接到对等节点</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.disbleListenner">不监听任何端口,只连接到对等节点</ElCheckbox>
|
||||||
@@ -146,7 +177,9 @@
|
|||||||
配置
|
配置
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<ElTooltip content="将本地端口转发到虚拟网络中的远程端口.如:udp://0.0.0.0:12345/10.126.126.1:23456,表示将本地UDP端口12345转发到虚拟网络中的10.126.126.1:23456.可以指定多个">
|
<ElTooltip
|
||||||
|
content="将本地端口转发到虚拟网络中的远程端口.如:udp://0.0.0.0:12345/10.126.126.1:23456,表示将本地UDP端口12345转发到虚拟网络中的10.126.126.1:23456.可以指定多个"
|
||||||
|
>
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<CoreVersionWarning version="2.3.0" />
|
<CoreVersionWarning version="2.3.0" />
|
||||||
@@ -379,6 +412,24 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleKcpProxyChange = () => {
|
||||||
|
if (mainStore.config.enableKcpProxy) {
|
||||||
|
if (mainStore.config.enableQuicProxy) {
|
||||||
|
ElMessage.warning("KCP代理和QUIC代理不能同时开启");
|
||||||
|
}
|
||||||
|
mainStore.config.enableQuicProxy = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleQuicProxyChange = () => {
|
||||||
|
if (mainStore.config.enableQuicProxy) {
|
||||||
|
if (mainStore.config.enableKcpProxy) {
|
||||||
|
ElMessage.warning("KCP代理和QUIC代理不能同时开启");
|
||||||
|
}
|
||||||
|
mainStore.config.enableKcpProxy = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 为bind_device功能增加改方法
|
// 为bind_device功能增加改方法
|
||||||
const getGuids = async () => {
|
const getGuids = async () => {
|
||||||
const guidsValue = await invoke<string[][]>("get_network_adapter_guids");
|
const guidsValue = await invoke<string[][]>("get_network_adapter_guids");
|
||||||
|
|||||||
+104
-35
@@ -272,21 +272,6 @@
|
|||||||
{{ !data.isStart ? "启动联机" : "停止联机" }}
|
{{ !data.isStart ? "启动联机" : "停止联机" }}
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<ElDropdownMenu>
|
<ElDropdownMenu>
|
||||||
<ElDropdownItem
|
|
||||||
command="import_config"
|
|
||||||
:icon="Link"
|
|
||||||
>
|
|
||||||
导入联机配置
|
|
||||||
</ElDropdownItem>
|
|
||||||
<ElDropdownItem
|
|
||||||
command="share_config"
|
|
||||||
:icon="Share"
|
|
||||||
>
|
|
||||||
分享联机配置
|
|
||||||
</ElDropdownItem>
|
|
||||||
<ElDropdownItem disabled>
|
|
||||||
<ElDivider class="!m-0 !h-[2px]" />
|
|
||||||
</ElDropdownItem>
|
|
||||||
<ElDropdownItem
|
<ElDropdownItem
|
||||||
:icon="SetUp"
|
:icon="SetUp"
|
||||||
command="create_server"
|
command="create_server"
|
||||||
@@ -328,6 +313,27 @@
|
|||||||
>
|
>
|
||||||
本地游戏列表
|
本地游戏列表
|
||||||
</ElDropdownItem>
|
</ElDropdownItem>
|
||||||
|
<ElDropdownItem disabled>
|
||||||
|
<ElDivider class="!m-0 !h-[2px]" />
|
||||||
|
</ElDropdownItem>
|
||||||
|
<ElDropdownItem
|
||||||
|
command="import_config"
|
||||||
|
:icon="Link"
|
||||||
|
>
|
||||||
|
导入联机配置
|
||||||
|
</ElDropdownItem>
|
||||||
|
<ElDropdownItem
|
||||||
|
command="share_config"
|
||||||
|
:icon="Share"
|
||||||
|
>
|
||||||
|
分享联机配置
|
||||||
|
</ElDropdownItem>
|
||||||
|
<ElDropdownItem
|
||||||
|
command="reconnect"
|
||||||
|
:icon="RefreshRight"
|
||||||
|
>
|
||||||
|
重新联机
|
||||||
|
</ElDropdownItem>
|
||||||
</ElDropdownMenu>
|
</ElDropdownMenu>
|
||||||
</template>
|
</template>
|
||||||
</ElDropdown>
|
</ElDropdown>
|
||||||
@@ -720,7 +726,7 @@
|
|||||||
import { initStartWinIpBroadcast } from "~/composables/netcard";
|
import { initStartWinIpBroadcast } from "~/composables/netcard";
|
||||||
import useMainStore from "@/stores/index";
|
import useMainStore from "@/stores/index";
|
||||||
import { ElMessage, ElMessageBox, ElTooltip } from "element-plus";
|
import { ElMessage, ElMessageBox, ElTooltip } from "element-plus";
|
||||||
import { getCurrentWindow, type Window } from "@tauri-apps/api/window";
|
import { getCurrentWindow, PhysicalSize, type Window } from "@tauri-apps/api/window";
|
||||||
import { getAllWebviewWindows, WebviewWindow } from "@tauri-apps/api/webviewWindow";
|
import { getAllWebviewWindows, WebviewWindow } from "@tauri-apps/api/webviewWindow";
|
||||||
import etWindows, { dataSubscribe } from "@/composables/windows";
|
import etWindows, { dataSubscribe } from "@/composables/windows";
|
||||||
import { resourceDir as getResourceDir, join } from "@tauri-apps/api/path";
|
import { resourceDir as getResourceDir, join } from "@tauri-apps/api/path";
|
||||||
@@ -746,6 +752,9 @@
|
|||||||
async () => {
|
async () => {
|
||||||
await handleConnection();
|
await handleConnection();
|
||||||
return data.isStart;
|
return data.isStart;
|
||||||
|
},
|
||||||
|
async () => {
|
||||||
|
await handleReconnect();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1085,8 +1094,8 @@
|
|||||||
const list = await invoke<string[][][]>("fetch_easytier_list");
|
const list = await invoke<string[][][]>("fetch_easytier_list");
|
||||||
data.releaseList = [
|
data.releaseList = [
|
||||||
...list.flat().filter(el => {
|
...list.flat().filter(el => {
|
||||||
// console.log(el, el[0], el[2]);
|
// console.log(el, el[0], el[2], el[3]); // el[3] 是prerelease bool值
|
||||||
return el && el[0] && el[2] && !el[2].includes("gui");
|
return el && el[0] && el[2] && !el[2].includes("gui") && (el[3] != 'true' || !el[3]);
|
||||||
})
|
})
|
||||||
] as any;
|
] as any;
|
||||||
coreManagementData.loading = false;
|
coreManagementData.loading = false;
|
||||||
@@ -1174,6 +1183,10 @@
|
|||||||
saveServerUrl = mainStore.basePeers.length > 0 ? mainStore.basePeers[0] || "" : "";
|
saveServerUrl = mainStore.basePeers.length > 0 ? mainStore.basePeers[0] || "" : "";
|
||||||
}
|
}
|
||||||
data.configJsonSeverUrl = guiJson.serverUrl;
|
data.configJsonSeverUrl = guiJson.serverUrl;
|
||||||
|
if(guiJson.enableKcpProxy && guiJson.enableQuicProxy) {
|
||||||
|
// 如果同时开启kcp代理和quic代理,则禁用quic代理
|
||||||
|
guiJson.enableQuicProxy = false;
|
||||||
|
}
|
||||||
mainStore.$patch({
|
mainStore.$patch({
|
||||||
config: {
|
config: {
|
||||||
...mainStore.config,
|
...mainStore.config,
|
||||||
@@ -1224,6 +1237,18 @@
|
|||||||
await appWindow.show();
|
await appWindow.show();
|
||||||
await appWindow.setFocus();
|
await appWindow.setFocus();
|
||||||
}
|
}
|
||||||
|
const appWindow = getCurrentWindow();
|
||||||
|
const logicalAppSize = {
|
||||||
|
width: 340,
|
||||||
|
height: 305
|
||||||
|
}
|
||||||
|
const scaleFactor = await appWindow.scaleFactor();
|
||||||
|
const size = new PhysicalSize(Math.ceil(logicalAppSize.width * scaleFactor), Math.ceil(logicalAppSize.height * scaleFactor));
|
||||||
|
appWindow.setSize(size);
|
||||||
|
appWindow.onScaleChanged(({ payload: { scaleFactor } }) => {
|
||||||
|
console.log("scaleFactor", scaleFactor);
|
||||||
|
appWindow.setSize(new PhysicalSize(Math.ceil(logicalAppSize.width * scaleFactor), Math.ceil(logicalAppSize.height * scaleFactor)));
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let logsTimer: NodeJS.Timeout | null = null;
|
let logsTimer: NodeJS.Timeout | null = null;
|
||||||
@@ -1234,7 +1259,7 @@
|
|||||||
await initGuiJson();
|
await initGuiJson();
|
||||||
await compatibleInitAutoStart();
|
await compatibleInitAutoStart();
|
||||||
// await initAutoStart();
|
// await initAutoStart();
|
||||||
await initStartWinIpBroadcast();
|
// await initStartWinIpBroadcast(); // 对于三层tun而言,winipbroadcast没有作用,先禁用
|
||||||
await compatibleIpv6Listener();
|
await compatibleIpv6Listener();
|
||||||
await getCoreVersion();
|
await getCoreVersion();
|
||||||
await listenObj.listenThreadId();
|
await listenObj.listenThreadId();
|
||||||
@@ -1400,10 +1425,16 @@
|
|||||||
args.push("--compression", mainStore.config.compression);
|
args.push("--compression", mainStore.config.compression);
|
||||||
}
|
}
|
||||||
if (mainStore.config.enableKcpProxy) {
|
if (mainStore.config.enableKcpProxy) {
|
||||||
args.push("--enable-kcp-proxy");
|
args.push("--enable-kcp-proxy", 'true');
|
||||||
}
|
}
|
||||||
if (mainStore.config.disableKcpInput) {
|
if (mainStore.config.disableKcpInput) {
|
||||||
args.push("--disable-kcp-input");
|
args.push("--disable-kcp-input", 'true');
|
||||||
|
}
|
||||||
|
if (mainStore.config.enableQuicProxy) {
|
||||||
|
args.push("--enable-quic-proxy", 'true');
|
||||||
|
}
|
||||||
|
if (mainStore.config.disableQuicInput) {
|
||||||
|
args.push("--disable-quic-input", 'true');
|
||||||
}
|
}
|
||||||
if (mainStore.config.bindDeviceEnable) {
|
if (mainStore.config.bindDeviceEnable) {
|
||||||
args.push("--bind-device", "true");
|
args.push("--bind-device", "true");
|
||||||
@@ -1412,7 +1443,7 @@
|
|||||||
args.push("--proxy-forward-by-system");
|
args.push("--proxy-forward-by-system");
|
||||||
}
|
}
|
||||||
if (mainStore.config.acceptDNS) {
|
if (mainStore.config.acceptDNS) {
|
||||||
args.push("--accept-dns");
|
args.push("--accept-dns", "true");
|
||||||
}
|
}
|
||||||
if (mainStore.config.enablePortForward) {
|
if (mainStore.config.enablePortForward) {
|
||||||
let formatPortForward = mainStore.config.portForwardData.trim().split("\n");
|
let formatPortForward = mainStore.config.portForwardData.trim().split("\n");
|
||||||
@@ -1423,6 +1454,9 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mainStore.config.privateMode) {
|
||||||
|
args.push("--private-mode", "true");
|
||||||
|
}
|
||||||
return args;
|
return args;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1531,7 +1565,10 @@
|
|||||||
compression,
|
compression,
|
||||||
enablePreventSleep,
|
enablePreventSleep,
|
||||||
enableKcpProxy,
|
enableKcpProxy,
|
||||||
disableKcpInput
|
disableKcpInput,
|
||||||
|
enableQuicProxy,
|
||||||
|
disableQuicInput,
|
||||||
|
privateMode
|
||||||
} = mainStore.config;
|
} = mainStore.config;
|
||||||
const WT = btoa(
|
const WT = btoa(
|
||||||
encodeURIComponent(
|
encodeURIComponent(
|
||||||
@@ -1564,7 +1601,10 @@
|
|||||||
compression,
|
compression,
|
||||||
enablePreventSleep,
|
enablePreventSleep,
|
||||||
enableKcpProxy,
|
enableKcpProxy,
|
||||||
disableKcpInput
|
disableKcpInput,
|
||||||
|
enableQuicProxy,
|
||||||
|
disableQuicInput,
|
||||||
|
privateMode
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -1683,6 +1723,25 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (command === "reconnect") {
|
||||||
|
handleReconnect();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReconnect = async () => {
|
||||||
|
if (data.isStart) {
|
||||||
|
ElMessage.info({
|
||||||
|
message: "正在重新联机...",
|
||||||
|
duration: 2200
|
||||||
|
});
|
||||||
|
await handleConnection();
|
||||||
|
setTimeout(() => {
|
||||||
|
handleConnection();
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
|
handleConnection();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteAdminConfig = async () => {
|
const handleDeleteAdminConfig = async () => {
|
||||||
@@ -1921,16 +1980,26 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const storageDialog = async () => {
|
const storageDialog = async () => {
|
||||||
await etWindows("storage-listener", {
|
await etWindows(
|
||||||
title: "自建服务器",
|
"storage-listener",
|
||||||
minWidth: 1,
|
{
|
||||||
minHeight: 1,
|
title: "存储监听",
|
||||||
width: 1,
|
minWidth: 0,
|
||||||
height: 1,
|
minHeight: 0,
|
||||||
x: 9999,
|
width: 0,
|
||||||
y: 9999,
|
height: 0,
|
||||||
resizable: false,
|
x: 9999,
|
||||||
url: "#/storage-listener"
|
y: 9999,
|
||||||
});
|
resizable: false,
|
||||||
|
transparent: true,
|
||||||
|
hiddenTitle: true,
|
||||||
|
alwaysOnBottom: true,
|
||||||
|
visible: false,
|
||||||
|
url: "#/storage-listener"
|
||||||
|
},
|
||||||
|
dialog => {
|
||||||
|
dialog.hide();
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
width="120"
|
width="120"
|
||||||
prop="ipv4"
|
prop="ipv4"
|
||||||
label="虚拟网IP"
|
label="虚拟网IP"
|
||||||
|
:sort-method="sortIpv4"
|
||||||
|
:sort-orders="['ascending', 'descending', null]"
|
||||||
></ElTableColumn>
|
></ElTableColumn>
|
||||||
<ElTableColumn
|
<ElTableColumn
|
||||||
sortable
|
sortable
|
||||||
@@ -98,11 +100,15 @@
|
|||||||
width="90"
|
width="90"
|
||||||
prop="rx_bytes"
|
prop="rx_bytes"
|
||||||
label="接收"
|
label="接收"
|
||||||
|
:sort-method="sortBytes"
|
||||||
|
:sort-orders="['ascending', 'descending', null]"
|
||||||
></ElTableColumn>
|
></ElTableColumn>
|
||||||
<ElTableColumn
|
<ElTableColumn
|
||||||
sortable
|
sortable
|
||||||
prop="tx_bytes"
|
prop="tx_bytes"
|
||||||
label="传输"
|
label="传输"
|
||||||
|
:sort-method="(a, b) => sortBytes(a, b, 'tx_bytes')"
|
||||||
|
:sort-orders="['ascending', 'descending', null]"
|
||||||
></ElTableColumn>
|
></ElTableColumn>
|
||||||
</ElTable>
|
</ElTable>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,6 +179,101 @@
|
|||||||
return valueA - valueB;
|
return valueA - valueB;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// IP地址排序函数
|
||||||
|
const sortIpv4 = (a: any, b: any): number => {
|
||||||
|
const ipToNumber = (ip: string): number => {
|
||||||
|
if (!ip || ip === "-" || ip === "") {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理可能包含端口号或子网掩码的情况
|
||||||
|
const cleanIp = ip.split("/")[0].split(":")[0];
|
||||||
|
const parts = cleanIp.split(".");
|
||||||
|
|
||||||
|
if (parts.length !== 4) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const nums = parts.map(part => {
|
||||||
|
const num = parseInt(part, 10);
|
||||||
|
return isNaN(num) || num < 0 || num > 255 ? 0 : num;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 将IP地址转换为32位数字进行比较
|
||||||
|
return (nums[0] << 24) + (nums[1] << 16) + (nums[2] << 8) + nums[3];
|
||||||
|
} catch {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const numA = ipToNumber(a.ipv4);
|
||||||
|
const numB = ipToNumber(b.ipv4);
|
||||||
|
|
||||||
|
return numA - numB;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 字节数据排序函数
|
||||||
|
const sortBytes = (a: any, b: any, field: string = 'rx_bytes'): number => {
|
||||||
|
const parseBytes = (bytesStr: string): number => {
|
||||||
|
if (!bytesStr || bytesStr === "-" || bytesStr === "") {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统一转换为小写并去除空格
|
||||||
|
const cleanStr = bytesStr.toLowerCase().trim();
|
||||||
|
|
||||||
|
// 使用正则表达式匹配数字和单位
|
||||||
|
const match = cleanStr.match(/^(\d+(?:\.\d+)?)\s*([a-z]*)$/);
|
||||||
|
if (!match) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = parseFloat(match[1]);
|
||||||
|
const unit = match[2];
|
||||||
|
|
||||||
|
if (isNaN(value)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据单位转换为字节数
|
||||||
|
switch (unit) {
|
||||||
|
case 'b':
|
||||||
|
case 'byte':
|
||||||
|
case 'bytes':
|
||||||
|
case '':
|
||||||
|
return value;
|
||||||
|
case 'k':
|
||||||
|
case 'kb':
|
||||||
|
case 'kib':
|
||||||
|
return value * 1024;
|
||||||
|
case 'm':
|
||||||
|
case 'mb':
|
||||||
|
case 'mib':
|
||||||
|
return value * 1024 * 1024;
|
||||||
|
case 'g':
|
||||||
|
case 'gb':
|
||||||
|
case 'gib':
|
||||||
|
return value * 1024 * 1024 * 1024;
|
||||||
|
case 't':
|
||||||
|
case 'tb':
|
||||||
|
case 'tib':
|
||||||
|
return value * 1024 * 1024 * 1024 * 1024;
|
||||||
|
case 'p':
|
||||||
|
case 'pb':
|
||||||
|
case 'pib':
|
||||||
|
return value * 1024 * 1024 * 1024 * 1024 * 1024;
|
||||||
|
default:
|
||||||
|
return value; // 未知单位当作字节处理
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const bytesA = parseBytes(a[field]);
|
||||||
|
const bytesB = parseBytes(b[field]);
|
||||||
|
|
||||||
|
return bytesA - bytesB;
|
||||||
|
};
|
||||||
|
|
||||||
// 格式化延迟显示
|
// 格式化延迟显示
|
||||||
const formatLatency = (latMs: any): string => {
|
const formatLatency = (latMs: any): string => {
|
||||||
if (latMs === null || latMs === undefined || latMs === "") {
|
if (latMs === null || latMs === undefined || latMs === "") {
|
||||||
|
|||||||
@@ -27,6 +27,12 @@
|
|||||||
>
|
>
|
||||||
<ElCheckbox v-model="mainStore.serverConfig.autoStart">自动启动</ElCheckbox>
|
<ElCheckbox v-model="mainStore.serverConfig.autoStart">自动启动</ElCheckbox>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
|
<ElTooltip
|
||||||
|
placement="top"
|
||||||
|
content="启用后,不允许使用了与本网络不同的房间名和密码的节点通过本节点进行握手或中转"
|
||||||
|
>
|
||||||
|
<ElCheckbox v-model="mainStore.serverConfig.privateMode">私有模式</ElCheckbox>
|
||||||
|
</ElTooltip>
|
||||||
<ElTooltip
|
<ElTooltip
|
||||||
placement="top"
|
placement="top"
|
||||||
content="帮助其他虚拟网建立P2P链接"
|
content="帮助其他虚拟网建立P2P链接"
|
||||||
|
|||||||
+5
-5
@@ -10,7 +10,7 @@
|
|||||||
name="netcard"
|
name="netcard"
|
||||||
class="flex h-full flex-col"
|
class="flex h-full flex-col"
|
||||||
>
|
>
|
||||||
<div>
|
<!-- <div>
|
||||||
<div>
|
<div>
|
||||||
<ElTooltip
|
<ElTooltip
|
||||||
content="找不到游戏房间时,就开启它后再尝试搜索房间(默认开启)
|
content="找不到游戏房间时,就开启它后再尝试搜索房间(默认开启)
|
||||||
@@ -39,13 +39,13 @@
|
|||||||
active-text="已开启"
|
active-text="已开启"
|
||||||
inactive-text="已关闭"
|
inactive-text="已关闭"
|
||||||
></ElSwitch>
|
></ElSwitch>
|
||||||
</div>
|
</div> -->
|
||||||
<div>
|
<div>
|
||||||
<ElTooltip
|
<ElTooltip
|
||||||
content="使用ForceBindIP启动应用 (强制绑定IP或者网卡),如果还没有启动联机,请先启动联机,联机成功后,点击刷新获取easytier生成的网卡"
|
content="使用ForceBindIP启动应用 (强制绑定IP或者网卡),如果还没有启动联机,请先启动联机,联机成功后,点击刷新获取easytier生成的网卡"
|
||||||
>
|
>
|
||||||
<ElText>
|
<ElText>
|
||||||
方案2
|
方案1
|
||||||
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
|
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
|
||||||
</ElText>
|
</ElText>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<ElTooltip content="设置网卡的跃点,提升网卡优先级,尝试将您联机使用的网卡跃点设置为最小,请先查询网卡信息">
|
<ElTooltip content="设置网卡的跃点,提升网卡优先级,尝试将您联机使用的网卡跃点设置为最小,请先查询网卡信息">
|
||||||
<ElText>
|
<ElText>
|
||||||
方案3
|
方案2
|
||||||
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
|
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
|
||||||
</ElText>
|
</ElText>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
@@ -502,7 +502,7 @@
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
data.pingIp = mainStore.config.ipv4;
|
data.pingIp = mainStore.config.ipv4;
|
||||||
initStartWinIpBroadcast();
|
// initStartWinIpBroadcast();
|
||||||
getGuids();
|
getGuids();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Generated
+775
-940
File diff suppressed because it is too large
Load Diff
Generated
+1
-1
@@ -1253,7 +1253,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.4.5"
|
version = "1.4.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.15.2",
|
"hashbrown 0.15.2",
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.4.5"
|
version = "1.4.7"
|
||||||
homepage = "https://github.com/EasyTier/EasyTier"
|
homepage = "https://github.com/EasyTier/EasyTier"
|
||||||
repository = "https://github.com/EasyTier/EasytierGame"
|
repository = "https://github.com/EasyTier/EasytierGame"
|
||||||
description = "A simple network initiator based on Easytier"
|
description = "A simple network initiator based on Easytier"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"core:tray:allow-get-by-id",
|
"core:tray:allow-get-by-id",
|
||||||
"core:tray:allow-set-icon",
|
"core:tray:allow-set-icon",
|
||||||
"core:tray:allow-new",
|
"core:tray:allow-new",
|
||||||
|
"core:window:allow-set-size",
|
||||||
{
|
{
|
||||||
"identifier": "shell:allow-spawn",
|
"identifier": "shell:allow-spawn",
|
||||||
"allow": [
|
"allow": [
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
"netCardMetricValue": 1, // 网卡跃点
|
"netCardMetricValue": 1, // 网卡跃点
|
||||||
"enablePreventSleep": false, // 启用防止睡眠
|
"enablePreventSleep": false, // 启用防止睡眠
|
||||||
"compression": "none", // 压缩算法
|
"compression": "none", // 压缩算法
|
||||||
"enableKcpProxy": true, // 启用kcp代理
|
"enableKcpProxy": true, // 启用kcp代理,就不能启用quic代理
|
||||||
"disableKcpInput": false // 禁用kcp输入
|
"disableKcpInput": false, // 禁用kcp输入
|
||||||
|
"enableQuicProxy": false, // 启用quic代理,就不能启用kcp代理
|
||||||
|
"disableQuicInput": false, // 禁用quic输入
|
||||||
|
"privateMode": false // 启用私有模式
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
+32
-24
@@ -322,7 +322,11 @@ async fn get_route_by_cli() -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command(rename_all = "snake_case")]
|
#[tauri::command(rename_all = "snake_case")]
|
||||||
async fn download_easytier_zip(app_handle: tauri::AppHandle ,download_url: String, file_name: String) {
|
async fn download_easytier_zip(
|
||||||
|
app_handle: tauri::AppHandle,
|
||||||
|
download_url: String,
|
||||||
|
file_name: String,
|
||||||
|
) {
|
||||||
let cache_dir_path = get_tool_exe_path("\\easytier\\cache");
|
let cache_dir_path = get_tool_exe_path("\\easytier\\cache");
|
||||||
let cache_file_name = format!("{}\\{}", cache_dir_path, file_name);
|
let cache_file_name = format!("{}\\{}", cache_dir_path, file_name);
|
||||||
let cache_file_name_path = path::Path::new(&cache_file_name);
|
let cache_file_name_path = path::Path::new(&cache_file_name);
|
||||||
@@ -355,14 +359,18 @@ async fn download_easytier_zip(app_handle: tauri::AppHandle ,download_url: Strin
|
|||||||
while let Some(item) = response.chunk().await.unwrap() {
|
while let Some(item) = response.chunk().await.unwrap() {
|
||||||
match file.write_all(&item) {
|
match file.write_all(&item) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
app_handle.emit("download_core_progress", [item.len() as u64, context_size]).expect("error to emit download_core_progress");
|
app_handle
|
||||||
},Err(why) => {
|
.emit("download_core_progress", [item.len() as u64, context_size])
|
||||||
|
.expect("error to emit download_core_progress");
|
||||||
|
}
|
||||||
|
Err(why) => {
|
||||||
log::error!("error to write file: {}", why);
|
log::error!("error to write file: {}", why);
|
||||||
app_handle.emit("download_core_progress_error", why.to_string()).expect("error to emit download_core_progress_error");
|
app_handle
|
||||||
return
|
.emit("download_core_progress_error", why.to_string())
|
||||||
|
.expect("error to emit download_core_progress_error");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
println!("下载完成");
|
println!("下载完成");
|
||||||
unzip(path);
|
unzip(path);
|
||||||
@@ -512,18 +520,19 @@ fn stop_command(child_id: u32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command(rename_all = "snake_case")]
|
#[tauri::command(rename_all = "snake_case")]
|
||||||
async fn fetch_easytier_list() -> Vec<Vec<[String; 3]>> {
|
async fn fetch_easytier_list() -> Vec<Vec<[String; 4]>> {
|
||||||
// 获取release列表
|
// 获取release列表
|
||||||
if let Ok(release) = fetch_releases().await {
|
if let Ok(release) = fetch_releases().await {
|
||||||
let mut release_list = Vec::new();
|
let mut release_list: Vec<Vec<[String; 4]>> = Vec::new();
|
||||||
for re in release {
|
for re in release {
|
||||||
let mut assets_list = Vec::new();
|
let mut assets_list: Vec<[String; 4]> = Vec::new();
|
||||||
for asset in re.assets {
|
for asset in re.assets {
|
||||||
if asset.name.contains("windows-x86_64") {
|
if asset.name.contains("windows-x86_64") {
|
||||||
assets_list.push([
|
assets_list.push([
|
||||||
re.tag_name.clone(),
|
re.tag_name.clone(),
|
||||||
asset.name.clone(),
|
asset.name.clone(),
|
||||||
asset.browser_download_url.clone(),
|
asset.browser_download_url.clone(),
|
||||||
|
re.prerelease.to_string(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -661,11 +670,11 @@ fn ensure_task_folder_and_cleanup(
|
|||||||
unsafe {
|
unsafe {
|
||||||
let root = BSTR::from("\\");
|
let root = BSTR::from("\\");
|
||||||
let root_folder: ITaskFolder = task_service.GetFolder(&root)?;
|
let root_folder: ITaskFolder = task_service.GetFolder(&root)?;
|
||||||
|
|
||||||
match task_service.GetFolder(folder_path) {
|
match task_service.GetFolder(folder_path) {
|
||||||
Ok(existing_folder) => {
|
Ok(existing_folder) => {
|
||||||
println!("任务文件夹已存在: {}", folder_path);
|
println!("任务文件夹已存在: {}", folder_path);
|
||||||
|
|
||||||
// 检查并清理现有任务
|
// 检查并清理现有任务
|
||||||
if let Ok(_existing_task) = existing_folder.GetTask(task_name) {
|
if let Ok(_existing_task) = existing_folder.GetTask(task_name) {
|
||||||
println!("发现同名任务: {},准备删除", task_name);
|
println!("发现同名任务: {},准备删除", task_name);
|
||||||
@@ -738,23 +747,23 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
|
|||||||
&VARIANT::default(),
|
&VARIANT::default(),
|
||||||
&VARIANT::default(),
|
&VARIANT::default(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let folder_path = BSTR::from("\\easytierGame");
|
let folder_path = BSTR::from("\\easytierGame");
|
||||||
let task_name = BSTR::from("auto start");
|
let task_name = BSTR::from("auto start");
|
||||||
|
|
||||||
let task_definition = task_service.NewTask(0)?;
|
let task_definition = task_service.NewTask(0)?;
|
||||||
|
|
||||||
// 设置任务信息
|
// 设置任务信息
|
||||||
let registration_info = task_definition.RegistrationInfo()?;
|
let registration_info = task_definition.RegistrationInfo()?;
|
||||||
registration_info.SetDescription(&BSTR::from("EasytierGame auto start task"))?;
|
registration_info.SetDescription(&BSTR::from("EasytierGame auto start task"))?;
|
||||||
registration_info.SetAuthor(&BSTR::from("EasytierGame"))?;
|
registration_info.SetAuthor(&BSTR::from("EasytierGame"))?;
|
||||||
|
|
||||||
// 改为用户登录触发
|
// 改为用户登录触发
|
||||||
let triggers = task_definition.Triggers()?;
|
let triggers = task_definition.Triggers()?;
|
||||||
let trigger = triggers.Create(TASK_TRIGGER_LOGON)?;
|
let trigger = triggers.Create(TASK_TRIGGER_LOGON)?;
|
||||||
let logon_trigger: ILogonTrigger = trigger.cast()?;
|
let logon_trigger: ILogonTrigger = trigger.cast()?;
|
||||||
logon_trigger.SetEnabled(VARIANT_BOOL::from(true))?;
|
logon_trigger.SetEnabled(VARIANT_BOOL::from(true))?;
|
||||||
|
|
||||||
// 设置动作
|
// 设置动作
|
||||||
let actions = task_definition.Actions()?;
|
let actions = task_definition.Actions()?;
|
||||||
let action = actions.Create(TASK_ACTION_EXEC)?;
|
let action = actions.Create(TASK_ACTION_EXEC)?;
|
||||||
@@ -763,14 +772,13 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
|
|||||||
let exe_path: &str = exe.to_str().unwrap();
|
let exe_path: &str = exe.to_str().unwrap();
|
||||||
exec_action.SetPath(&BSTR::from(exe_path))?;
|
exec_action.SetPath(&BSTR::from(exe_path))?;
|
||||||
exec_action.SetArguments(&BSTR::from("--task-auto-start"))?;
|
exec_action.SetArguments(&BSTR::from("--task-auto-start"))?;
|
||||||
|
|
||||||
// 使用当前用户运行
|
// 使用当前用户运行
|
||||||
let principal = task_definition.Principal()?;
|
let principal = task_definition.Principal()?;
|
||||||
principal.SetUserId(&BSTR::from(whoami::username().as_str()))?;
|
principal.SetUserId(&BSTR::from(whoami::username().as_str()))?;
|
||||||
principal.SetLogonType(TASK_LOGON_INTERACTIVE_TOKEN)?;
|
principal.SetLogonType(TASK_LOGON_INTERACTIVE_TOKEN)?;
|
||||||
principal.SetRunLevel(TASK_RUNLEVEL_HIGHEST)?;
|
principal.SetRunLevel(TASK_RUNLEVEL_HIGHEST)?;
|
||||||
|
|
||||||
|
|
||||||
// 设置任务设置
|
// 设置任务设置
|
||||||
let settings = task_definition.Settings()?;
|
let settings = task_definition.Settings()?;
|
||||||
settings.SetEnabled(VARIANT_BOOL::from(true))?;
|
settings.SetEnabled(VARIANT_BOOL::from(true))?;
|
||||||
@@ -778,12 +786,12 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
|
|||||||
settings.SetStartWhenAvailable(VARIANT_BOOL::from(true))?;
|
settings.SetStartWhenAvailable(VARIANT_BOOL::from(true))?;
|
||||||
// settings.SetHidden(VARIANT_BOOL::from(true))?; // 注释掉让任务可见
|
// settings.SetHidden(VARIANT_BOOL::from(true))?; // 注释掉让任务可见
|
||||||
settings.SetExecutionTimeLimit(&BSTR::from("PT0S"))?;
|
settings.SetExecutionTimeLimit(&BSTR::from("PT0S"))?;
|
||||||
|
settings.SetDisallowStartIfOnBatteries(VARIANT_BOOL(0))?; // 允许在电池供电时启动
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取文件夹并注册任务
|
// 获取文件夹并注册任务
|
||||||
let task_folder = ensure_task_folder_and_cleanup(&task_service, &folder_path, &task_name)?;
|
let task_folder =
|
||||||
|
ensure_task_folder_and_cleanup(&task_service, &folder_path, &task_name)?;
|
||||||
|
|
||||||
let _auto_task = task_folder.RegisterTaskDefinition(
|
let _auto_task = task_folder.RegisterTaskDefinition(
|
||||||
&task_name,
|
&task_name,
|
||||||
&task_definition,
|
&task_definition,
|
||||||
@@ -791,9 +799,9 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
|
|||||||
&VARIANT::default(),
|
&VARIANT::default(),
|
||||||
&VARIANT::default(),
|
&VARIANT::default(),
|
||||||
TASK_LOGON_INTERACTIVE_TOKEN,
|
TASK_LOGON_INTERACTIVE_TOKEN,
|
||||||
&VARIANT::default()
|
&VARIANT::default(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"productName": "easytier-game",
|
"productName": "easytier-game",
|
||||||
"version": "1.4.5",
|
"version": "1.4.7",
|
||||||
"identifier": "com.tauri.easytier-game",
|
"identifier": "com.tauri.easytier-game",
|
||||||
|
|
||||||
"build": {
|
"build": {
|
||||||
@@ -12,14 +12,14 @@
|
|||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"title": "easytier-game 1.4.5",
|
"title": "easytier-game 1.4.7",
|
||||||
"label": "main",
|
"label": "main",
|
||||||
"minWidth": 340,
|
"minWidth": 340,
|
||||||
"width": 340,
|
"width": 340,
|
||||||
"height": 305,
|
"height": 305,
|
||||||
"minHeight": 305,
|
"minHeight": 305,
|
||||||
"maxHeight": 305,
|
"maxHeight": 405,
|
||||||
"maxWidth": 360,
|
"maxWidth": 460,
|
||||||
"resizable": true,
|
"resizable": true,
|
||||||
"fullscreen": false,
|
"fullscreen": false,
|
||||||
"decorations": true,
|
"decorations": true,
|
||||||
|
|||||||
+11
-1
@@ -44,8 +44,11 @@ const store = defineStore("main", {
|
|||||||
compression: "none", //加密算法
|
compression: "none", //加密算法
|
||||||
enableKcpProxy: true, //启用kcp代理 默认开启
|
enableKcpProxy: true, //启用kcp代理 默认开启
|
||||||
disableKcpInput: false, //禁用kcp输入
|
disableKcpInput: false, //禁用kcp输入
|
||||||
|
enableQuicProxy: false, //启用quic代理 默认开启
|
||||||
|
disableQuicInput: false, //禁用quic输入
|
||||||
bindDeviceEnable: false, //是否绑定设备
|
bindDeviceEnable: false, //是否绑定设备
|
||||||
acceptDNS: false, //魔法dns
|
acceptDNS: false, //魔法dns
|
||||||
|
privateMode: false, //是否启用私有模式
|
||||||
|
|
||||||
enablePortForward: false, //是否启用端口转发
|
enablePortForward: false, //是否启用端口转发
|
||||||
portForwardData: "", //端口转发数据
|
portForwardData: "", //端口转发数据
|
||||||
@@ -56,7 +59,8 @@ const store = defineStore("main", {
|
|||||||
serverWhiteList: "", // 服务器流量转发白名单
|
serverWhiteList: "", // 服务器流量转发白名单
|
||||||
// enableListener: true, // 是否启用监听
|
// enableListener: true, // 是否启用监听
|
||||||
autoStart: false, //随软件自启
|
autoStart: false, //随软件自启
|
||||||
port: "11010" // 服务器端口
|
port: "11010", // 服务器端口
|
||||||
|
privateMode: false, //是否启用私有模式
|
||||||
},
|
},
|
||||||
cidrEnable: false,
|
cidrEnable: false,
|
||||||
proxyForwardBySystem: false, // 是否通过系统内核转发子网代理数据包,禁用内置NAT
|
proxyForwardBySystem: false, // 是否通过系统内核转发子网代理数据包,禁用内置NAT
|
||||||
@@ -128,17 +132,23 @@ const store = defineStore("main", {
|
|||||||
|
|
||||||
"config.enableKcpProxy",
|
"config.enableKcpProxy",
|
||||||
"config.disableKcpInput",
|
"config.disableKcpInput",
|
||||||
|
"config.enableQuicProxy",
|
||||||
|
"config.disableQuicInput",
|
||||||
|
|
||||||
|
|
||||||
"config.bindDeviceEnable",
|
"config.bindDeviceEnable",
|
||||||
|
|
||||||
"config.acceptDNS",
|
"config.acceptDNS",
|
||||||
|
|
||||||
|
"config.privateMode",
|
||||||
|
|
||||||
"serverConfig.autoStart",
|
"serverConfig.autoStart",
|
||||||
// 'serverConfig.enableListener',
|
// 'serverConfig.enableListener',
|
||||||
"serverConfig.enableWhiteList",
|
"serverConfig.enableWhiteList",
|
||||||
"serverConfig.relayAllPeerrpc",
|
"serverConfig.relayAllPeerrpc",
|
||||||
"serverConfig.serverWhiteList",
|
"serverConfig.serverWhiteList",
|
||||||
"serverConfig.port",
|
"serverConfig.port",
|
||||||
|
"serverConfig.privateMode",
|
||||||
|
|
||||||
"cidrEnable",
|
"cidrEnable",
|
||||||
"proxyForwardBySystem",
|
"proxyForwardBySystem",
|
||||||
|
|||||||
Reference in New Issue
Block a user