Compare commits

..
4 Commits
11 changed files with 46 additions and 17 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ Releases [https://github.com/EasyTier/EasytierGame/releases](https://github.c
![game-step12](/assets/game-step12.png)
- 1.2.6重写 自建服务器功能,可以自行搭建服务器,但是需要一些网络知识,具体可以查看文档[自建服务器](https://www.easytier.top/guide/network/host-public-server.html),也可查看帮助.txt
![game-step12](/assets/game-step12.png)
![game-step13](/assets/game-step13.png)
## 特性
+1
View File
@@ -1,4 +1,5 @@
VITE_CONFIG_PATH=easytier/config/
VITE_CONFIG_FILE_NAME=easytier/config.json
VITE_LOG_PATH=easytier/logs/
VITE_CACHE_PATH=easytier/cache/
VITE_AUTO_START_SERVICE_NAME=easytierGameAutoStart
+1
View File
@@ -1,4 +1,5 @@
VITE_CONFIG_PATH=easytier/config/
VITE_CONFIG_FILE_NAME=easytier/config.json
VITE_LOG_PATH=easytier/logs/
VITE_CACHE_PATH=easytier/cache/
VITE_AUTO_START_SERVICE_NAME=easytierGameAutoStart
+1 -1
View File
@@ -3,7 +3,7 @@
"private": true,
"author": "leizi97",
"description": "A simple network initiator based on Easytier",
"version": "1.2.6",
"version": "1.2.7",
"scripts": {
"dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0",
"build": "nuxt generate --dotenv env/.env.prod",
+18 -1
View File
@@ -335,6 +335,9 @@
>
刷新
</ElButton>
<ElTooltip content="打开内核缓存目录">
<ElButton :icon="Folder" size="small" @click="handleOpenCache"></ElButton>
</ElTooltip>
</div>
<ElSelect
placeholder="请选择内核版本"
@@ -479,7 +482,7 @@
import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { open, Command } from "@tauri-apps/plugin-shell";
import { QuestionFilled, Delete, List, UserFilled, Setting, Share, RefreshRight, Link, Tools, MagicStick, SetUp } from "@element-plus/icons-vue";
import { QuestionFilled, Delete, List, UserFilled, Setting, Share, RefreshRight, Link, Tools, MagicStick, SetUp, Folder } from "@element-plus/icons-vue";
import { reactive, onBeforeUnmount, onMounted, ref } from "vue";
import { useTray, setTrayRunState, setTrayTooltip } from "~/composables/tray";
import { initStartWinIpBroadcast } from "~/composables/netcard";
@@ -571,6 +574,20 @@
}
};
const handleOpenCache = async () => {
const cache_path = import.meta.env.VITE_CACHE_PATH;
const resourceDir = await getResourceDir();
const configPath = await join(resourceDir, cache_path);
const isExists = await exists(cache_path, { baseDir: BaseDirectory.Resource });
if (!isExists) {
try {
await mkdir(cache_path, { baseDir: BaseDirectory.Resource });
} catch (err) {}
}
// console.error(configPath);
await Command.create("explorer", [configPath]).execute();
}
const handleDeleteServerUrl = (url: string) => {
const newBasePeers = [...mainStore.basePeers];
const idx = newBasePeers.indexOf(url);
+4 -5
View File
@@ -134,6 +134,7 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
return "";
}
if (member === "_EasytierGameCliFailedToConnect_") {
data.member = [];
stopTimer();
const [error] = await ElConfirmDanger("连接已断开,是否重新尝试?", "警告", {
confirmButtonText: "重试",
@@ -145,7 +146,6 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
const appWindow = getCurrentWindow();
await appWindow.close();
}
data.member = [];
return;
}
const peerInfo = parsePeerInfo(member);
@@ -161,10 +161,10 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
startTimer();
};
const startTimer = async () => {
const startTimer = () => {
timer && clearTimeout(timer);
timer = setTimeout(async () => {
await listenOutput();
timer = setTimeout(() => {
listenOutput();
}, 1000);
};
@@ -175,7 +175,6 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
onMounted(async () => {
await listenOutput();
await startTimer();
});
onBeforeUnmount(() => {
+5 -3
View File
@@ -1176,7 +1176,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]]
name = "easytier-game"
version = "1.2.6"
version = "1.2.7"
dependencies = [
"log",
"planif",
@@ -1193,6 +1193,7 @@ dependencies = [
"tauri-plugin-shell",
"tauri-plugin-single-instance",
"tauri-plugin-window-state",
"tokio",
"whoami",
"windows 0.58.0",
"zip",
@@ -4782,15 +4783,16 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.40.0"
version = "1.41.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998"
checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33"
dependencies = [
"backtrace",
"bytes",
"libc",
"mio",
"pin-project-lite",
"signal-hook-registry",
"socket2",
"windows-sys 0.52.0",
]
+2 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "easytier-game"
version = "1.2.6"
version = "1.2.7"
homepage = "https://github.com/EasyTier/EasyTier"
repository = "https://github.com/EasyTier/EasytierGame"
description = "A simple network initiator based on Easytier"
@@ -40,6 +40,7 @@ planif = { git = "https://github.com/mattrobineau/planif", tag = "1.0.1" }
whoami = "1.5.2"
tauri-plugin-fs = "2"
tauri-plugin-clipboard-manager = "2.0.2"
tokio = { version = "1.41.1", features = ["process"] }
# prost = "0.13"
# prost-types = "0.13"
+5 -3
View File
@@ -21,6 +21,8 @@ use windows::Win32::Foundation::VARIANT_BOOL;
use windows::Win32::System::Com::*;
use windows::Win32::System::TaskScheduler::*;
use tokio::process::Command as tokioCommand;
// 定义GitHub Release的结构体
#[derive(Debug, Deserialize)]
pub struct Release {
@@ -130,13 +132,13 @@ struct MyResponse {
}
#[tauri::command(rename_all = "snake_case")]
fn get_members_by_cli() -> String {
async fn get_members_by_cli() -> String {
let cli_path = get_tool_exe_path(String::from("\\easytier\\easytier-cli.exe"));
match Command::new(&cli_path)
match tokioCommand::new(&cli_path)
.arg("peer")
.arg("list")
.creation_flags(0x08000000)
.output()
.output().await
{
Ok(output) => {
if output.status.success() {
+2 -2
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "easytier-game",
"version": "1.2.6",
"version": "1.2.7",
"identifier": "com.tauri.easytier-game",
"build": {
@@ -13,7 +13,7 @@
"app": {
"windows": [
{
"title": "easytier-game 1.2.6",
"title": "easytier-game 1.2.7",
"label": "main",
"minWidth": 340,
"width": 340,
+6
View File
@@ -29,6 +29,8 @@ export const ElConfirmDanger = (
}
return ATJ(
ElMessageBox.confirm(message, title, {
closeOnClickModal: false, // 点击遮罩层不关闭弹窗
closeOnPressEscape: false, // 按下Esc键不关闭弹窗
cancelButtonText,
confirmButtonText,
confirmButtonClass: "el-button--danger"
@@ -63,6 +65,8 @@ export const ElConfirmSucces = (
}
return ATJ(
ElMessageBox.confirm(message, title, {
closeOnClickModal: false, // 点击遮罩层不关闭弹窗
closeOnPressEscape: false, // 按下Esc键不关闭弹窗
cancelButtonText,
confirmButtonText,
confirmButtonClass: "el-button--success"
@@ -97,6 +101,8 @@ export const ElConfirmPrimary = (
}
return ATJ(
ElMessageBox.confirm(message, title, {
closeOnClickModal: false, // 点击遮罩层不关闭弹窗
closeOnPressEscape: false, // 按下Esc键不关闭弹窗
cancelButtonText,
confirmButtonText,
confirmButtonClass: "el-button--primary"