mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8120b65c9b | ||
|
|
7af0683775 | ||
|
|
4191a0a12d | ||
|
|
66d8bff8b4 |
+5
-3
@@ -3,10 +3,11 @@
|
||||
"private": true,
|
||||
"author": "leizi97",
|
||||
"description": "A simple network initiator based on Easytier",
|
||||
"version": "1.2.5",
|
||||
"version": "1.2.6",
|
||||
"scripts": {
|
||||
"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",
|
||||
"release": "node zip.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
@@ -26,10 +27,11 @@
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.0",
|
||||
"@vueuse/core": "^11.2.0",
|
||||
"archiver": "^7.0.1",
|
||||
"element-plus": "^2.8.7",
|
||||
"less": "^4.2.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"nuxt": "^3.13.2",
|
||||
"nuxt": "^3.14.1592",
|
||||
"pinia": "^2.2.6",
|
||||
"pinia-plugin-persistedstate": "^4.1.3",
|
||||
"postcss": "^8.4.38",
|
||||
|
||||
+44
-25
@@ -289,6 +289,11 @@
|
||||
>
|
||||
分享联机相关配置
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem
|
||||
disabled
|
||||
>
|
||||
<ElDivider class="!h-[2px] !m-0" />
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem
|
||||
:icon="SetUp"
|
||||
command="create_server"
|
||||
@@ -573,6 +578,7 @@
|
||||
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
import { sortedUniq, uniq } from "lodash-es";
|
||||
import { bounce, addQQGroup } from "~/utils";
|
||||
import { ElConfirmDanger, ElConfirmPrimary } from "~/utils/element";
|
||||
|
||||
let is_close = false;
|
||||
|
||||
@@ -984,18 +990,6 @@
|
||||
const getArgs = async () => {
|
||||
// console.error(config.proxyNetworks);
|
||||
const args = [];
|
||||
if (mainStore.enableCreateServer) {
|
||||
if (config.relayAllPeerrpc) {
|
||||
args.push("--relay-all-peer-rpc");
|
||||
}
|
||||
const whiteList = mainStore.ServerWhiteList.trim().split("\n").map(el => el.trim()).filter(el => el).join(" ");
|
||||
if(whiteList && mainStore.enableWhiteList) {
|
||||
args.push("--relay-network-whitelist", whiteList);
|
||||
}if(!whiteList && mainStore.enableWhiteList) {
|
||||
args.push("--relay-network-whitelist");
|
||||
}
|
||||
return args
|
||||
}
|
||||
if (mainStore.configStartEnable) {
|
||||
if (mainStore.configPath) {
|
||||
const isExists = await exists(mainStore.configPath, { baseDir: BaseDirectory.Resource });
|
||||
@@ -1022,6 +1016,25 @@
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if (mainStore.enableCreateServer) {
|
||||
if (config.relayAllPeerrpc) {
|
||||
args.push("--relay-all-peer-rpc");
|
||||
}
|
||||
const whiteList = mainStore.ServerWhiteList.trim()
|
||||
.split("\n")
|
||||
.map(el => el.trim())
|
||||
.filter(el => el)
|
||||
.join(" ");
|
||||
if (whiteList && mainStore.enableWhiteList) {
|
||||
args.push("--relay-network-whitelist", whiteList);
|
||||
}
|
||||
if (!whiteList && mainStore.enableWhiteList) {
|
||||
args.push("--relay-network-whitelist");
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
if (config.dhcp) {
|
||||
args.push("-d");
|
||||
}
|
||||
@@ -1192,25 +1205,31 @@
|
||||
importConfigData.visible = true;
|
||||
}
|
||||
if (command === "create_server") {
|
||||
if (data.isStart) {
|
||||
const [error] = await ElConfirmDanger("切换会停止{action},是否继续?", "提示", {
|
||||
action: "`联机/服务`",
|
||||
confirmButtonText: "继续",
|
||||
cancelButtonText: "取消"
|
||||
});
|
||||
if (!error) await reset();
|
||||
}
|
||||
mainStore.enableCreateServer = !mainStore.enableCreateServer;
|
||||
if (mainStore.config.relayAllPeerrpc && !mainStore.enableCreateServer) {
|
||||
try {
|
||||
await ElMessageBox.confirm("是否关闭RPC流量转发?", "提示", {
|
||||
confirmButtonText: "关闭",
|
||||
cancelButtonText: "取消"
|
||||
});
|
||||
mainStore.config.relayAllPeerrpc = false;
|
||||
} catch (err) {}
|
||||
const [error] = await ElConfirmPrimary("是否关闭RPC流量转发?", "提示", {
|
||||
confirmButtonText: "关闭",
|
||||
cancelButtonText: "取消"
|
||||
});
|
||||
if (!error) mainStore.config.relayAllPeerrpc = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const handleStartImport = async () => {
|
||||
try {
|
||||
await ElMessageBox.confirm("确定导入?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
});
|
||||
const [err] = await ElConfirmPrimary("确定导入?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
});
|
||||
if (!err) {
|
||||
const payload = JSON.parse(decodeURIComponent(atob(importConfigData.data)));
|
||||
mainStore.$patch({
|
||||
config: {
|
||||
@@ -1221,7 +1240,7 @@
|
||||
ElMessage.success("导入成功");
|
||||
importConfigData.visible = false;
|
||||
mainStore.basePeers = uniq([config.serverUrl, ...mainStore.basePeers]);
|
||||
} catch (err) {
|
||||
} else {
|
||||
console.error(err);
|
||||
if (err !== "cancel") {
|
||||
ElMessage.error("导入失败");
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@
|
||||
value.ipv4 = value.ipv4.split("/")[0];
|
||||
}
|
||||
});
|
||||
console.error(peerInfo);
|
||||
// console.error(peerInfo);
|
||||
data.member = peerInfo;
|
||||
};
|
||||
|
||||
|
||||
Generated
+485
-153
File diff suppressed because it is too large
Load Diff
Generated
+1
-1
@@ -1176,7 +1176,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
|
||||
|
||||
[[package]]
|
||||
name = "easytier-game"
|
||||
version = "1.2.5"
|
||||
version = "1.2.6"
|
||||
dependencies = [
|
||||
"log",
|
||||
"planif",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "easytier-game"
|
||||
version = "1.2.5"
|
||||
version = "1.2.6"
|
||||
homepage = "https://github.com/EasyTier/EasyTier"
|
||||
repository = "https://github.com/EasyTier/EasytierGame"
|
||||
description = "A simple network initiator based on Easytier"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "easytier-game",
|
||||
"version": "1.2.5",
|
||||
"version": "1.2.6",
|
||||
"identifier": "com.tauri.easytier-game",
|
||||
|
||||
"build": {
|
||||
@@ -13,7 +13,7 @@
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "easytier-game 1.2.5",
|
||||
"title": "easytier-game 1.2.6",
|
||||
"label": "main",
|
||||
"minWidth": 340,
|
||||
"width": 340,
|
||||
@@ -49,7 +49,7 @@
|
||||
"easytier/Packet.dll",
|
||||
"easytier/wintun.dll",
|
||||
"easytier/clear_local_data.bat",
|
||||
"easytier/帮助.txt"
|
||||
"帮助.txt"
|
||||
],
|
||||
"windows": {
|
||||
"webviewInstallMode": {
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* 生成 release 发布包 zip 文件
|
||||
*/
|
||||
|
||||
const releaseDir = "./src-tauri/target/release";
|
||||
const releaseDirEasytier = `${releaseDir}/easytier/`;
|
||||
const releaseExe = `${releaseDir}/easytier-game.exe`;
|
||||
const releaseHelp = `${releaseDir}/帮助.txt`;
|
||||
const deleteEasytierFiles = ["logs/", "guiLogs/"];
|
||||
const pkg = require("./package.json");
|
||||
const fileName = `easytier-game_windows_x86_64_${pkg.version}.zip`; // 发布包格式
|
||||
const releaseZipDir = "./release";
|
||||
const releaseZip = `${releaseZipDir}/${fileName}`;
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const archiver = require("archiver");
|
||||
|
||||
const output = fs.createWriteStream(path.join(__dirname, releaseZip));
|
||||
const archive = archiver("zip", {
|
||||
zlib: { level: 8 } // Sets the compression level.
|
||||
});
|
||||
|
||||
// listen for all archive data to be written
|
||||
// 'close' event is fired only when a file descriptor is involved
|
||||
output.on("close", function () {
|
||||
console.log(archive.pointer() + " total bytes");
|
||||
console.log(`archiver has been finalized and the output ${releaseZip}`);
|
||||
});
|
||||
|
||||
// This event is fired when the data source is drained no matter what was the data source.
|
||||
// It is not part of this library but rather from the NodeJS Stream API.
|
||||
// @see: https://nodejs.org/api/stream.html#stream_event_end
|
||||
output.on("end", function () {
|
||||
console.log("Data has been drained");
|
||||
});
|
||||
|
||||
// good practice to catch warnings (ie stat failures and other non-blocking errors)
|
||||
archive.on("warning", function (err) {
|
||||
if (err.code === "ENOENT") {
|
||||
// log warning
|
||||
} else {
|
||||
// throw error
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
archive.on("error", function (err) {
|
||||
throw err;
|
||||
});
|
||||
|
||||
for (const f of deleteEasytierFiles) {
|
||||
fs.rmSync(path.join(__dirname, releaseDirEasytier + f), { recursive: true, force: true });
|
||||
}
|
||||
const r = path.join(__dirname, releaseZipDir);
|
||||
if (!fs.existsSync(r)) {
|
||||
fs.mkdirSync(r);
|
||||
}
|
||||
|
||||
// pipe archive data to the file
|
||||
archive.pipe(output);
|
||||
archive
|
||||
.append(fs.createReadStream(path.join(__dirname, releaseExe)), { name: "easytier-game.exe" })
|
||||
.append(fs.createReadStream(path.join(__dirname, releaseHelp)), { name: "帮助.txt" })
|
||||
.directory(path.join(__dirname, releaseDirEasytier), "easytier")
|
||||
.finalize();
|
||||
Reference in New Issue
Block a user