mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
修复与优化
- 没有自动保存配置文件启动的bug - 修复配置文件启动无法打开成员列表的bug - 修复动态ipv4获取后,没有正确赋值到界面上的bug - 增加使用配置文件启动时的提示
This commit is contained in:
+1
-1
@@ -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.1.5",
|
"version": "1.1.6",
|
||||||
"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"
|
||||||
|
|||||||
+189
-175
@@ -4,179 +4,185 @@
|
|||||||
label-position="top"
|
label-position="top"
|
||||||
:model="config"
|
:model="config"
|
||||||
>
|
>
|
||||||
<ElFormItem
|
<!-- element-loading-custom-class="config-start"
|
||||||
label="服务器"
|
v-loading="mainStore.configStartEnable"
|
||||||
prop="serverUrl"
|
:element-loading-spinner="'<path />'"
|
||||||
>
|
element-loading-text="-------已经启用配置文件,界面配置不再生效-------" -->
|
||||||
<template #label>
|
<!-- <div> -->
|
||||||
<div class="flex items-center gap-[0_5px]">
|
|
||||||
<div>服务器</div>
|
|
||||||
<span>-</span>
|
|
||||||
<ElTag
|
|
||||||
effect="dark"
|
|
||||||
:type="data.isSuccessGetIp ? 'success' : 'info'"
|
|
||||||
>
|
|
||||||
{{ data.isSuccessGetIp ? "联机成功" : data.isStart && !data.isSuccessGetIp ? "联机中" : "未联机" }}
|
|
||||||
</ElTag>
|
|
||||||
<ElButton
|
|
||||||
v-if="!data.coreVersion"
|
|
||||||
@click="getCoreVersion(true)"
|
|
||||||
>
|
|
||||||
获取内核版本
|
|
||||||
</ElButton>
|
|
||||||
<ElTag
|
|
||||||
v-else
|
|
||||||
type="info"
|
|
||||||
>
|
|
||||||
{{ data.coreVersion }}
|
|
||||||
</ElTag>
|
|
||||||
<ElPopconfirm
|
|
||||||
width="325"
|
|
||||||
cancel-button-text="取消"
|
|
||||||
confirm-button-text="继续"
|
|
||||||
title="内核从github下载,需要出国工具,可能下载缓慢或失败,是否继续?
|
|
||||||
也可以从官方群里手动下载后解压到easytier-game.exe同级目录下的easytier目录里,全部覆盖即可"
|
|
||||||
@confirm="handleUpdateCore"
|
|
||||||
>
|
|
||||||
<template #reference>
|
|
||||||
<ElButton
|
|
||||||
:disabled="data.isStart"
|
|
||||||
:loading="data.update"
|
|
||||||
type="warning"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ data.coreVersion ? "更新内核" : "下载内核" }}
|
|
||||||
</ElButton>
|
|
||||||
</template>
|
|
||||||
</ElPopconfirm>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<ElSelect
|
|
||||||
allow-create
|
|
||||||
filterable
|
|
||||||
default-first-option
|
|
||||||
v-model="config.serverUrl"
|
|
||||||
@change="handleServerUrlChange"
|
|
||||||
>
|
|
||||||
<template #prefix>
|
|
||||||
<div :class="config.protocol && config.protocol.length > 1 ? 'w-[120px]' : 'w-[80px]'">
|
|
||||||
<ElSelect
|
|
||||||
placeholder="协议"
|
|
||||||
multiple
|
|
||||||
collapse-tags
|
|
||||||
@click.stop
|
|
||||||
v-model="config.protocol"
|
|
||||||
@change="handleServerUrlChange"
|
|
||||||
>
|
|
||||||
<ElOption
|
|
||||||
v-for="item in protocols"
|
|
||||||
:key="item"
|
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
></ElOption>
|
|
||||||
</ElSelect>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<ElOption
|
|
||||||
v-for="item in mainStore.basePeers"
|
|
||||||
:key="item"
|
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
>
|
|
||||||
<div class="flex items-center justify-between">
|
|
||||||
<span style="float: left">{{ item }}</span>
|
|
||||||
<ElButton
|
|
||||||
@click.stop="handleDeleteServerUrl(item)"
|
|
||||||
round
|
|
||||||
:icon="Delete"
|
|
||||||
type="danger"
|
|
||||||
></ElButton>
|
|
||||||
</div>
|
|
||||||
</ElOption>
|
|
||||||
</ElSelect>
|
|
||||||
</ElFormItem>
|
|
||||||
<div class="flex flex-wrap gap-[0_10px] items-center">
|
|
||||||
<div class="flex-1">
|
|
||||||
<ElFormItem label="网络名">
|
|
||||||
<template #label>
|
|
||||||
<div class="flex items-center">
|
|
||||||
网络名
|
|
||||||
<ElTooltip content="对应命令行参数 --network-name">
|
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
|
||||||
</ElTooltip>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<ElInput
|
|
||||||
maxlength="100"
|
|
||||||
placeholder="请输入网络名"
|
|
||||||
v-model="config.networkName"
|
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
</div>
|
|
||||||
<div class="flex-1">
|
|
||||||
<ElFormItem label="网络密码">
|
|
||||||
<template #label>
|
|
||||||
<div class="flex items-center">
|
|
||||||
网络密码
|
|
||||||
<ElTooltip content="对应命令行参数 --network-secret">
|
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
|
||||||
</ElTooltip>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<ElInput
|
|
||||||
show-password
|
|
||||||
maxlength="100"
|
|
||||||
placeholder="请输入网络密码"
|
|
||||||
v-model="config.networkPassword"
|
|
||||||
type="password"
|
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex gap-[0_10px]">
|
|
||||||
<ElFormItem label="主机名">
|
|
||||||
<template #label>
|
|
||||||
<div class="flex items-center">
|
|
||||||
主机名
|
|
||||||
<ElTooltip content="对应命令行参数 --hostname">
|
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
|
||||||
</ElTooltip>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<ElInput
|
|
||||||
maxlength="100"
|
|
||||||
placeholder="例如: Player1"
|
|
||||||
v-model="config.hostname"
|
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
class="w-[70%]"
|
label="服务器"
|
||||||
label="局域网IP"
|
prop="serverUrl"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex items-center h-[20px]">
|
<div class="flex items-center gap-[0_5px]">
|
||||||
虚拟网IP
|
<div>服务器</div>
|
||||||
<ElTooltip content="对应命令行参数 --ipv4">
|
<span>-</span>
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElTag
|
||||||
</ElTooltip>
|
effect="dark"
|
||||||
<ElSwitch
|
:type="data.isSuccessGetIp ? 'success' : 'info'"
|
||||||
v-model="config.dhcp"
|
>
|
||||||
class="ml-[5px]"
|
{{ data.isSuccessGetIp ? "联机成功" : data.isStart && !data.isSuccessGetIp ? "联机中" : "未联机" }}
|
||||||
inline-prompt
|
</ElTag>
|
||||||
inactive-text="固定IP"
|
<ElButton
|
||||||
active-text="动态获取IP"
|
v-if="!data.coreVersion"
|
||||||
size="small"
|
@click="getCoreVersion(true)"
|
||||||
></ElSwitch>
|
>
|
||||||
|
获取内核版本
|
||||||
|
</ElButton>
|
||||||
|
<ElTag
|
||||||
|
v-else
|
||||||
|
type="info"
|
||||||
|
>
|
||||||
|
{{ data.coreVersion }}
|
||||||
|
</ElTag>
|
||||||
|
<ElPopconfirm
|
||||||
|
width="325"
|
||||||
|
cancel-button-text="取消"
|
||||||
|
confirm-button-text="继续"
|
||||||
|
title="内核从github下载,需要出国工具,可能下载缓慢或失败,是否继续?
|
||||||
|
也可以从官方群里手动下载后解压到easytier-game.exe同级目录下的easytier目录里,全部覆盖即可"
|
||||||
|
@confirm="handleUpdateCore"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<ElButton
|
||||||
|
:disabled="data.isStart"
|
||||||
|
:loading="data.update"
|
||||||
|
type="warning"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
{{ data.coreVersion ? "更新内核" : "下载内核" }}
|
||||||
|
</ElButton>
|
||||||
|
</template>
|
||||||
|
</ElPopconfirm>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<ElInput
|
<ElSelect
|
||||||
maxlength="100"
|
allow-create
|
||||||
:disabled="config.dhcp"
|
filterable
|
||||||
:placeholder="data.isStart ? '等待动态分配IP...' : '例如: 10.126.126.1'"
|
default-first-option
|
||||||
v-model="config.ipv4"
|
v-model="config.serverUrl"
|
||||||
></ElInput>
|
@change="handleServerUrlChange"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<div :class="config.protocol && config.protocol.length > 1 ? 'w-[120px]' : 'w-[80px]'">
|
||||||
|
<ElSelect
|
||||||
|
placeholder="协议"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
@click.stop
|
||||||
|
v-model="config.protocol"
|
||||||
|
@change="handleServerUrlChange"
|
||||||
|
>
|
||||||
|
<ElOption
|
||||||
|
v-for="item in protocols"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
></ElOption>
|
||||||
|
</ElSelect>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<ElOption
|
||||||
|
v-for="item in mainStore.basePeers"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span style="float: left">{{ item }}</span>
|
||||||
|
<ElButton
|
||||||
|
@click.stop="handleDeleteServerUrl(item)"
|
||||||
|
round
|
||||||
|
:icon="Delete"
|
||||||
|
type="danger"
|
||||||
|
></ElButton>
|
||||||
|
</div>
|
||||||
|
</ElOption>
|
||||||
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
<div class="flex flex-wrap gap-[0_10px] items-center">
|
||||||
|
<div class="flex-1">
|
||||||
|
<ElFormItem label="网络名">
|
||||||
|
<template #label>
|
||||||
|
<div class="flex items-center">
|
||||||
|
网络名
|
||||||
|
<ElTooltip content="对应命令行参数 --network-name">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<ElInput
|
||||||
|
maxlength="100"
|
||||||
|
placeholder="请输入网络名"
|
||||||
|
v-model="config.networkName"
|
||||||
|
></ElInput>
|
||||||
|
</ElFormItem>
|
||||||
|
</div>
|
||||||
|
<div class="flex-1">
|
||||||
|
<ElFormItem label="网络密码">
|
||||||
|
<template #label>
|
||||||
|
<div class="flex items-center">
|
||||||
|
网络密码
|
||||||
|
<ElTooltip content="对应命令行参数 --network-secret">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<ElInput
|
||||||
|
show-password
|
||||||
|
maxlength="100"
|
||||||
|
placeholder="请输入网络密码"
|
||||||
|
v-model="config.networkPassword"
|
||||||
|
type="password"
|
||||||
|
></ElInput>
|
||||||
|
</ElFormItem>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-[0_10px]">
|
||||||
|
<ElFormItem label="主机名">
|
||||||
|
<template #label>
|
||||||
|
<div class="flex items-center">
|
||||||
|
主机名
|
||||||
|
<ElTooltip content="对应命令行参数 --hostname">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<ElInput
|
||||||
|
maxlength="100"
|
||||||
|
placeholder="例如: Player1"
|
||||||
|
v-model="config.hostname"
|
||||||
|
></ElInput>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem
|
||||||
|
class="w-[70%]"
|
||||||
|
label="局域网IP"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
<div class="flex items-center h-[20px]">
|
||||||
|
虚拟网IP
|
||||||
|
<ElTooltip content="对应命令行参数 --ipv4">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
<ElSwitch
|
||||||
|
v-model="config.dhcp"
|
||||||
|
class="ml-[5px]"
|
||||||
|
inline-prompt
|
||||||
|
inactive-text="固定IP"
|
||||||
|
active-text="动态获取IP"
|
||||||
|
size="small"
|
||||||
|
></ElSwitch>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<ElInput
|
||||||
|
maxlength="100"
|
||||||
|
:disabled="config.dhcp"
|
||||||
|
:placeholder="data.isStart && config.dhcp ? '等待动态分配IP...' : '例如: 10.126.126.1'"
|
||||||
|
v-model="config.ipv4"
|
||||||
|
></ElInput>
|
||||||
|
</ElFormItem>
|
||||||
|
</div>
|
||||||
|
<!-- </div> -->
|
||||||
<div class="flex items-start gap-[0_10px]">
|
<div class="flex items-start gap-[0_10px]">
|
||||||
<div class="w-[122px]">
|
<div class="w-[122px]">
|
||||||
<div>
|
<div>
|
||||||
@@ -479,8 +485,8 @@
|
|||||||
data.isStart = true;
|
data.isStart = true;
|
||||||
if (event.payload) {
|
if (event.payload) {
|
||||||
data.startLoading = false;
|
data.startLoading = false;
|
||||||
let ipv4 = /new: Some\((\d+\.\d+\.\d+\.\d+)\/.*\)/g.exec(event.payload as string)?.[1];
|
let ipv4 = /dhcp ip changed. old: None, new: Some\((\d+\.\d+\.\d+\.\d+).*\)/g.exec(event.payload as string)?.[1];
|
||||||
if (config.dhcp) {
|
if (config.dhcp || mainStore.configStartEnable) {
|
||||||
if (ipv4) {
|
if (ipv4) {
|
||||||
config.ipv4 = ipv4;
|
config.ipv4 = ipv4;
|
||||||
await setTrayRunState(tray, true);
|
await setTrayRunState(tray, true);
|
||||||
@@ -495,8 +501,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appWindow.emitTo("log", "logs", data.log);
|
const logArr = data.log.split("\n");
|
||||||
|
const start = logArr.length > 1000 ? logArr.length - 1000 : 0;
|
||||||
|
data.log = logArr.slice(start).join("\n");
|
||||||
data.log += (event.payload as string) + "\n";
|
data.log += (event.payload as string) + "\n";
|
||||||
|
|
||||||
});
|
});
|
||||||
this.unListenOutPut = unListen;
|
this.unListenOutPut = unListen;
|
||||||
},
|
},
|
||||||
@@ -772,10 +781,15 @@
|
|||||||
await reset();
|
await reset();
|
||||||
} else {
|
} else {
|
||||||
const args = await getArgs();
|
const args = await getArgs();
|
||||||
|
|
||||||
if (!args || args.length <= 0) {
|
if (!args || args.length <= 0) {
|
||||||
return ElMessage.error("无配置");
|
return ElMessage.error("无配置");
|
||||||
}
|
}
|
||||||
|
if(args[0] === "-c") {
|
||||||
|
ElMessage.warning({
|
||||||
|
message: "使用配置文件中.",
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
}
|
||||||
data.log = ""; //清空日志
|
data.log = ""; //清空日志
|
||||||
data.startLoading = true;
|
data.startLoading = true;
|
||||||
await unListenAll();
|
await unListenAll();
|
||||||
@@ -864,9 +878,9 @@
|
|||||||
if (!data.isStart) {
|
if (!data.isStart) {
|
||||||
return ElMessage.warning("请先开始联机");
|
return ElMessage.warning("请先开始联机");
|
||||||
}
|
}
|
||||||
if (!mainStore.config.ipv4) {
|
// if (!mainStore.config.ipv4) {
|
||||||
return ElMessage.warning("请等待获取IP");
|
// return ElMessage.warning("请等待获取IP");
|
||||||
}
|
// }
|
||||||
|
|
||||||
await etWindows(
|
await etWindows(
|
||||||
"member",
|
"member",
|
||||||
@@ -899,7 +913,7 @@
|
|||||||
data.logVisible = true;
|
data.logVisible = true;
|
||||||
logsTimer && clearInterval(logsTimer);
|
logsTimer && clearInterval(logsTimer);
|
||||||
logsTimer = setInterval(() => {
|
logsTimer = setInterval(() => {
|
||||||
appWindow.emitTo("log", "logs", data.log ? (data.log as string).split("\n").slice(-1000).join("\n") : "");
|
appWindow.emitTo("log", "logs", data.log);
|
||||||
}, 600);
|
}, 600);
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
Generated
+1
-1
@@ -1236,7 +1236,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.1.5"
|
version = "1.1.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"planif",
|
"planif",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.1.5"
|
version = "1.1.6"
|
||||||
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"
|
||||||
|
|||||||
@@ -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.1.5",
|
"version": "1.1.6",
|
||||||
"identifier": "com.tauri.easytier-game",
|
"identifier": "com.tauri.easytier-game",
|
||||||
|
|
||||||
"build": {
|
"build": {
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"title": "easytier-game 1.1.5",
|
"title": "easytier-game 1.1.6",
|
||||||
"width": 335,
|
"width": 335,
|
||||||
"height": 305,
|
"height": 305,
|
||||||
"resizable": false,
|
"resizable": false,
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ export default defineStore("main", {
|
|||||||
"basePeers",
|
"basePeers",
|
||||||
"cidrEnable",
|
"cidrEnable",
|
||||||
"theme",
|
"theme",
|
||||||
|
"configStartEnable",
|
||||||
|
"configPath",
|
||||||
"winIpBcAutoStart",
|
"winIpBcAutoStart",
|
||||||
"config.proxyNetworks",
|
"config.proxyNetworks",
|
||||||
"config.serverUrl",
|
"config.serverUrl",
|
||||||
|
|||||||
Reference in New Issue
Block a user