Compare commits

...
4 Commits
Author SHA1 Message Date
黑先森 cefcc930b8 打包最新版easytier内核 2.1.1 2024-12-25 15:32:42 +08:00
黑先森 e7d92cce47 更新包版本,优化分享配置操作,增加不进行分享的配置提示
Cargo.toml
+ tauri-plugin-single-instance 2.2.0
+ tauri-plugin-cli 2.2.0
+ tauri-plugin-window-state 2.2.0
+ tauri-plugin-fs 2.2.0
+ tauri-plugin-log 2.2.0
+ tauri-plugin-shell 2.2.0

package.json
+ "@tauri-apps/plugin-cli" -> ^2.2.0
2024-12-25 15:26:27 +08:00
黑先森 76bdec0e1d 修复自定义协议勾选后没持久化存储的bug 2024-12-21 17:53:55 +08:00
黑先森 997f3798ae 优化文字提示,修复压缩算法选择不生效问题 2024-12-20 22:29:04 +08:00
12 changed files with 121 additions and 59 deletions
+2 -2
View File
@@ -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.3.2", "version": "1.3.4",
"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",
@@ -16,7 +16,7 @@
"@pinia/nuxt": "0.9.0", "@pinia/nuxt": "0.9.0",
"@tauri-apps/api": "^2.1.1", "@tauri-apps/api": "^2.1.1",
"@tauri-apps/cli": "^2.1.0", "@tauri-apps/cli": "^2.1.0",
"@tauri-apps/plugin-cli": "^2.0.0", "@tauri-apps/plugin-cli": "^2.2.0",
"@tauri-apps/plugin-clipboard-manager": "^2.0.0", "@tauri-apps/plugin-clipboard-manager": "^2.0.0",
"@tauri-apps/plugin-fs": "^2.2.0", "@tauri-apps/plugin-fs": "^2.2.0",
"@tauri-apps/plugin-log": "^2.2.0", "@tauri-apps/plugin-log": "^2.2.0",
+4 -4
View File
@@ -58,7 +58,7 @@
打开config.json目录 打开config.json目录
</ElButton> </ElButton>
</div> </div>
<div><ElCheckbox v-model="mainStore.config.enablePreventSleep">防止休眠</ElCheckbox></div> <div><ElCheckbox v-model="mainStore.config.enablePreventSleep">防止系统休眠(比如:屏幕会一直亮着)</ElCheckbox></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>
@@ -86,7 +86,7 @@
:disabled="mainStore.config.disbleListenner" :disabled="mainStore.config.disbleListenner"
v-model="mainStore.config.enableCustomListener" v-model="mainStore.config.enableCustomListener"
> >
自定义IPV4监听地址 自定义监听地址
</ElCheckbox> </ElCheckbox>
<ElButton <ElButton
size="small" size="small"
@@ -188,7 +188,7 @@
<div><ElCheckbox v-model="mainStore.config.multiThread">启用多线程运行</ElCheckbox></div> <div><ElCheckbox v-model="mainStore.config.multiThread">启用多线程运行</ElCheckbox></div>
<div class="flex items-center gap-[10px]"> <div class="flex items-center gap-[10px]">
<ElText>压缩算法</ElText> <ElText>压缩算法</ElText>
<div class="w-[90px]"> <div class="w-[160px]">
<ElSelect <ElSelect
size="small" size="small"
v-model="mainStore.config.compression" v-model="mainStore.config.compression"
@@ -196,7 +196,7 @@
> >
<ElOption <ElOption
v-for="item in [ v-for="item in [
['none', '默认'], ['none', '不压缩(游戏联机推荐)'],
['zstd', 'zstd算法'] ['zstd', 'zstd算法']
]" ]"
:key="item[0]" :key="item[0]"
+73 -15
View File
@@ -55,6 +55,7 @@
placeholder="请选择服务器地址" placeholder="请选择服务器地址"
default-first-option default-first-option
v-model="config.serverUrl" v-model="config.serverUrl"
no-data-text="无服务器地址"
@change="handleServerUrlChange" @change="handleServerUrlChange"
> >
<template #prefix> <template #prefix>
@@ -542,7 +543,7 @@
Folder, Folder,
CopyDocument CopyDocument
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { reactive, onBeforeUnmount, onMounted, ref } from "vue"; import { reactive, onBeforeUnmount, onMounted, ref, toRaw } from "vue";
import { useTray, setTrayRunState, setTrayTooltip, checkNewVersion } from "~/composables/tray"; import { useTray, setTrayRunState, setTrayTooltip, checkNewVersion } from "~/composables/tray";
import { getMatches } from "@tauri-apps/plugin-cli"; import { getMatches } from "@tauri-apps/plugin-cli";
import { initStartWinIpBroadcast } from "~/composables/netcard"; import { initStartWinIpBroadcast } from "~/composables/netcard";
@@ -1135,8 +1136,8 @@
args.push("-l", ...customListener); args.push("-l", ...customListener);
} }
} }
if (!config.disbleListenner && config.enableCustomListenerV6 && config.customListenerV6Data){ if (!config.disbleListenner && config.enableCustomListenerV6 && config.customListenerV6Data) {
args.push("--ipv6-listener", config.customListenerV6Data) args.push("--ipv6-listener", config.customListenerV6Data);
} }
if (!config.disbleListenner && !config.enableCustomListener && config.port) { if (!config.disbleListenner && !config.enableCustomListener && config.port) {
args.push("-l", config.port); args.push("-l", config.port);
@@ -1183,6 +1184,9 @@
if (config.devName && config.devNameValue) { if (config.devName && config.devNameValue) {
args.push("--dev-name", config.devNameValue); args.push("--dev-name", config.devNameValue);
} }
if (config.compression && config.compression != "none") {
args.push("--compression", config.compression);
}
return args; return args;
}; };
@@ -1259,25 +1263,78 @@
if (command === "share_config") { if (command === "share_config") {
try { try {
const { const {
proxyNetworks, protocol,
autoStart, serverUrl,
connectAfterStart, networkName,
networkPassword,
dhcp,
disableIpv6,
disbleP2p,
enableCustomProtocol,
customProtocol,
disbleListenner,
port,
enableCustomListener,
customListenerData,
enableCustomListenerV6,
customListenerV6Data,
devName,
devNameValue,
enableNetCardMetric,
netCardMetricValue,
disableEncryption,
multiThread, multiThread,
hostname, latencyfirst,
enablExitNode, disableUdpHolePunching,
useSmoltcp, relayAllPeerrpc,
saveErrorLog, compression,
logLevel, enablePreventSleep,
ipv4,
...otherConfig
} = mainStore.config; } = mainStore.config;
const WT = btoa(encodeURIComponent(JSON.stringify({ config: otherConfig }))); const WT = btoa(
encodeURIComponent(
JSON.stringify({
config: {
protocol,
serverUrl,
networkName,
networkPassword,
dhcp,
disableIpv6,
disbleP2p,
enableCustomProtocol,
customProtocol,
disbleListenner,
port,
enableCustomListener,
customListenerData,
enableCustomListenerV6,
customListenerV6Data,
devName,
devNameValue,
enableNetCardMetric,
netCardMetricValue,
disableEncryption,
multiThread,
latencyfirst,
disableUdpHolePunching,
relayAllPeerrpc,
compression,
enablePreventSleep
}
})
)
);
await writeText(WT); await writeText(WT);
ElMessage.success("配置已复制"); ElMessage.success("配置已复制");
} catch (err) { } catch (err) {
console.error(err); console.error(err);
ElMessage.error("分享失败"); ElMessage.error("分享失败");
} }
ElConfirmPrimary(`{action} 虚拟网IP,主机名,子网代理,为子网代理启用smoltcp堆栈,开机自启,软件启动自动联机,出口节点,不生成Tun网卡,错误日志相关配置`, "提示", {
confirmButtonText: "知道了",
showCancelButton: false,
action: "不会分享"
});
} }
if (command === "import_config") { if (command === "import_config") {
importConfigData.data = ""; importConfigData.data = "";
@@ -1295,6 +1352,7 @@
}); });
if (!err) { if (!err) {
const payload = JSON.parse(decodeURIComponent(atob(importConfigData.data))); const payload = JSON.parse(decodeURIComponent(atob(importConfigData.data)));
payload.config.serverUrl = payload?.config?.serverUrl?.trim() || config.serverUrl;
mainStore.$patch({ mainStore.$patch({
config: { config: {
...mainStore.config, ...mainStore.config,
@@ -1303,7 +1361,7 @@
}); });
ElMessage.success("导入成功"); ElMessage.success("导入成功");
importConfigData.visible = false; importConfigData.visible = false;
mainStore.basePeers = uniq([config.serverUrl, ...mainStore.basePeers]); mainStore.basePeers = uniq([config.serverUrl, ...mainStore.basePeers].filter(el => el.trim()));
} else { } else {
console.error(err); console.error(err);
if (err !== "cancel") { if (err !== "cancel") {
+1 -1
View File
@@ -39,7 +39,7 @@
effect="dark" effect="dark"
:type="row.cost == 'p2p' ? 'success' : 'info'" :type="row.cost == 'p2p' ? 'success' : 'info'"
> >
{{ row.cost }} {{ row.cost ? row.cost.replace("relay", "中转") : row.cost }}
</ElTag> </ElTag>
</template> </template>
</ElTableColumn> </ElTableColumn>
+5 -5
View File
@@ -27,8 +27,8 @@ importers:
specifier: ^2.1.0 specifier: ^2.1.0
version: 2.1.0 version: 2.1.0
'@tauri-apps/plugin-cli': '@tauri-apps/plugin-cli':
specifier: ^2.0.0 specifier: ^2.2.0
version: 2.0.0 version: 2.2.0
'@tauri-apps/plugin-clipboard-manager': '@tauri-apps/plugin-clipboard-manager':
specifier: ^2.0.0 specifier: ^2.0.0
version: 2.0.0 version: 2.0.0
@@ -1147,8 +1147,8 @@ packages:
engines: {node: '>= 10'} engines: {node: '>= 10'}
hasBin: true hasBin: true
'@tauri-apps/plugin-cli@2.0.0': '@tauri-apps/plugin-cli@2.2.0':
resolution: {integrity: sha512-glQmlL1IiCGEa1FHYa/PTPSeYhfu56omLRgHXWlJECDt6DbJyRuJWVgtkQfUxtqnVdYnnU+DGIGeiInoEqtjLw==} resolution: {integrity: sha512-rvNhMog9rHr01Xk+trBFKJ0eZICIvPkm9GX6ogB89/0hROU/lf+a/sb4vC0wtSeR7zrJuCSxwxYuvHCZheaYFA==}
'@tauri-apps/plugin-clipboard-manager@2.0.0': '@tauri-apps/plugin-clipboard-manager@2.0.0':
resolution: {integrity: sha512-V1sXmbjnwfXt/r48RJMwfUmDMSaP/8/YbH4CLNxt+/sf1eHlIP8PRFdFDQwLN0cNQKu2rqQVbG/Wc/Ps6cDUhw==} resolution: {integrity: sha512-V1sXmbjnwfXt/r48RJMwfUmDMSaP/8/YbH4CLNxt+/sf1eHlIP8PRFdFDQwLN0cNQKu2rqQVbG/Wc/Ps6cDUhw==}
@@ -5042,7 +5042,7 @@ snapshots:
'@tauri-apps/cli-win32-ia32-msvc': 2.1.0 '@tauri-apps/cli-win32-ia32-msvc': 2.1.0
'@tauri-apps/cli-win32-x64-msvc': 2.1.0 '@tauri-apps/cli-win32-x64-msvc': 2.1.0
'@tauri-apps/plugin-cli@2.0.0': '@tauri-apps/plugin-cli@2.2.0':
dependencies: dependencies:
'@tauri-apps/api': 2.1.1 '@tauri-apps/api': 2.1.1
+22 -20
View File
@@ -1227,7 +1227,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]] [[package]]
name = "easytier-game" name = "easytier-game"
version = "1.3.2" version = "1.3.4"
dependencies = [ dependencies = [
"log", "log",
"planif", "planif",
@@ -4496,9 +4496,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.0.1" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bccd4692b56822a60874542c7655546c8e7aed3c2e2926166e1498e595bd2a2" checksum = "e5458ae16eac81bdbe8d9da2a9f3e01e8cdedbc381cc1727c01127542c8a61c5"
dependencies = [ dependencies = [
"clap", "clap",
"log", "log",
@@ -4506,7 +4506,7 @@ dependencies = [
"serde_json", "serde_json",
"tauri", "tauri",
"tauri-plugin", "tauri-plugin",
"thiserror 1.0.64", "thiserror 2.0.3",
] ]
[[package]] [[package]]
@@ -4526,9 +4526,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.0.3" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96ba7d46e86db8c830d143ef90ab5a453328365b0cc834c24edea4267b16aba0" checksum = "a1a1edf18000f02903a7c2e5997fb89aca455ecbc0acc15c6535afbb883be223"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"dunce", "dunce",
@@ -4540,16 +4540,18 @@ dependencies = [
"serde_repr", "serde_repr",
"tauri", "tauri",
"tauri-plugin", "tauri-plugin",
"thiserror 1.0.64", "tauri-utils",
"thiserror 2.0.3",
"toml 0.8.2",
"url", "url",
"uuid", "uuid",
] ]
[[package]] [[package]]
name = "tauri-plugin-log" name = "tauri-plugin-log"
version = "2.0.2" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8aa13d15daf90230ba26d5a9b4a4612975fa64ce17290cb7f6e0f89bb6997d82" checksum = "eddd784c138c08a43954bc3e735402e6b2b2ee8d8c254a7391f4e77c01273dd5"
dependencies = [ dependencies = [
"android_logger", "android_logger",
"byte-unit", "byte-unit",
@@ -4563,15 +4565,15 @@ dependencies = [
"swift-rs", "swift-rs",
"tauri", "tauri",
"tauri-plugin", "tauri-plugin",
"thiserror 1.0.64", "thiserror 2.0.3",
"time", "time",
] ]
[[package]] [[package]]
name = "tauri-plugin-shell" name = "tauri-plugin-shell"
version = "2.0.2" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ad7880c5586b6b2104be451e3d7fc0f3800c84bda69e9ba81c828f87cb34267" checksum = "bb2c50a63e60fb8925956cc5b7569f4b750ac197a4d39f13b8dd46ea8e2bad79"
dependencies = [ dependencies = [
"encoding_rs", "encoding_rs",
"log", "log",
@@ -4584,30 +4586,30 @@ dependencies = [
"shared_child", "shared_child",
"tauri", "tauri",
"tauri-plugin", "tauri-plugin",
"thiserror 1.0.64", "thiserror 2.0.3",
"tokio", "tokio",
] ]
[[package]] [[package]]
name = "tauri-plugin-single-instance" name = "tauri-plugin-single-instance"
version = "2.0.1" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a25ac834491d089699a2bc9266a662faf373c9f779f05a2235bc6e4d9e61769a" checksum = "0f36019ee9832dc99e4450bb55a21cfad8633b19c2c18bd17c7741939b070ede"
dependencies = [ dependencies = [
"log",
"serde", "serde",
"serde_json", "serde_json",
"tauri", "tauri",
"thiserror 1.0.64", "thiserror 2.0.3",
"tracing",
"windows-sys 0.59.0", "windows-sys 0.59.0",
"zbus", "zbus",
] ]
[[package]] [[package]]
name = "tauri-plugin-window-state" name = "tauri-plugin-window-state"
version = "2.0.2" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683c8764751fbbcebf3a594bcee24cf84c62773fa0080d1b40fc80698472421e" checksum = "234dd891cc7960fa28f93ea911f3e0d9ce8375ebf9ff303831bdd7a3443d5714"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"log", "log",
@@ -4615,7 +4617,7 @@ dependencies = [
"serde_json", "serde_json",
"tauri", "tauri",
"tauri-plugin", "tauri-plugin",
"thiserror 1.0.64", "thiserror 2.0.3",
] ]
[[package]] [[package]]
+7 -7
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "easytier-game" name = "easytier-game"
version = "1.3.2" version = "1.3.4"
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"
@@ -31,14 +31,14 @@ tauri = { version = "2.1.1", features = [
"image-ico", "image-ico",
] } ] }
tauri-plugin-log = "2.0.2" tauri-plugin-log = "2.2.0"
tauri-plugin-shell = "2.0.2" tauri-plugin-shell = "2.2.0"
reqwest = { version = "0.12", features = ["json"] } reqwest = { version = "0.12", features = ["json"] }
zip = "2.2" zip = "2.2"
sysinfo = '0.32.0' sysinfo = '0.32.0'
planif = { git = "https://github.com/mattrobineau/planif", tag = "1.0.1" } planif = { git = "https://github.com/mattrobineau/planif", tag = "1.0.1" }
whoami = "1.5.2" whoami = "1.5.2"
tauri-plugin-fs = "2" tauri-plugin-fs = "2.2.0"
tauri-plugin-clipboard-manager = "2.0.2" tauri-plugin-clipboard-manager = "2.0.2"
rand = "0.8.5" rand = "0.8.5"
tokio = { version = "1.41.1", features = ["process"] } tokio = { version = "1.41.1", features = ["process"] }
@@ -51,6 +51,6 @@ version = "0.58.0"
features = ["Win32_System_TaskScheduler", "Win32_System_Power"] features = ["Win32_System_TaskScheduler", "Win32_System_Power"]
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-cli = "2" tauri-plugin-cli = "2.2.0"
tauri-plugin-single-instance = "2.0.1" tauri-plugin-single-instance = "2.2.0"
tauri-plugin-window-state = "2" tauri-plugin-window-state = "2.2.0"
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -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.3.2", "version": "1.3.4",
"identifier": "com.tauri.easytier-game", "identifier": "com.tauri.easytier-game",
"build": { "build": {
@@ -13,7 +13,7 @@
"app": { "app": {
"windows": [ "windows": [
{ {
"title": "easytier-game 1.3.2", "title": "easytier-game 1.3.4",
"label": "main", "label": "main",
"minWidth": 340, "minWidth": 340,
"width": 340, "width": 340,
+1 -1
View File
@@ -98,7 +98,7 @@ const store = defineStore("main", {
"config.enableCustomListenerV6", "config.enableCustomListenerV6",
"config.customListenerV6Data", "config.customListenerV6Data",
"config.enableCustonProtocol", "config.enableCustomProtocol",
"config.customProtocol", "config.customProtocol",
"config.enablePreventSleep", "config.enablePreventSleep",
"config.compression", "config.compression",
+4 -2
View File
@@ -1,7 +1,7 @@
import { ElMessageBox } from "element-plus"; import { ElMessageBox } from "element-plus";
import { ATJ } from "./index"; import { ATJ } from "./index";
import { h, type VNode } from "vue"; import { h, type VNode } from "vue";
type Opt = { action?: string; confirmButtonText?: string; cancelButtonText?: string; VNode?: VNode | null } type Opt = { action?: string; confirmButtonText?: string; cancelButtonText?: string; VNode?: VNode | null, showCancelButton?:boolean }
export const ElConfirmDanger = ( export const ElConfirmDanger = (
content: string, content: string,
title: string, title: string,
@@ -81,10 +81,11 @@ export const ElConfirmPrimary = (
action: "", action: "",
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
showCancelButton: true,
VNode: null VNode: null
} }
): Promise<any | [any, any]> => { ): Promise<any | [any, any]> => {
const { action = "", confirmButtonText = "确定", cancelButtonText = "取消", VNode = null } = opt; const { action = "", confirmButtonText = "确定", cancelButtonText = "取消", VNode = null, showCancelButton = true } = opt;
const formatContentArr = content.split("{action}"); const formatContentArr = content.split("{action}");
const action_length = formatContentArr.length - 1; const action_length = formatContentArr.length - 1;
const messageArr = []; const messageArr = [];
@@ -103,6 +104,7 @@ export const ElConfirmPrimary = (
ElMessageBox.confirm(message, title, { ElMessageBox.confirm(message, title, {
closeOnClickModal: false, // 点击遮罩层不关闭弹窗 closeOnClickModal: false, // 点击遮罩层不关闭弹窗
closeOnPressEscape: false, // 按下Esc键不关闭弹窗 closeOnPressEscape: false, // 按下Esc键不关闭弹窗
showCancelButton,
cancelButtonText, cancelButtonText,
confirmButtonText, confirmButtonText,
confirmButtonClass: "el-button--primary" confirmButtonClass: "el-button--primary"