mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
增加子网代理和部分高级配置功能 升级tauri到2.0.6
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.0.6",
|
"version": "1.0.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"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<template>
|
||||||
|
<div class="h-full overflow-auto flex flex-col items-start px-[25px]">
|
||||||
|
<div>
|
||||||
|
<ElCheckbox v-model="mainStore.config.disableIpv6">不使用IPv6</ElCheckbox>
|
||||||
|
</div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.disbleListenner">不监听任何端口,只连接到对等节点</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.enablExitNode">允许此节点成为出口节点</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.disableEncryption">禁用对等节点通信的加密,默认为false,必须与对等节点相同</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.multiThread">使用多线程运行时,默认为单线程</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.noTun">不创建TUN设备,可以使用子网代理访问节点</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.useSmoltcp">为子网代理启用smoltcp堆栈</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.latencyfirst">延迟优先模式,将尝试使用最低延迟路径转发流量,默认使用最短路径</ElCheckbox></div>
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.disableUdpHolePunching">禁用UDP打洞功能</ElCheckbox></div>
|
||||||
|
<div>
|
||||||
|
<ElCheckbox v-model="mainStore.config.relayAllPeerrpc">转发所有对等节点的RPC数据包,即使对等节点不在转发网络白名</ElCheckbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import useMainStore from "@/stores/index";
|
||||||
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||||
|
const mainStore = useMainStore();
|
||||||
|
const appWindow = getCurrentWindow();
|
||||||
|
mainStore.$subscribe((...a) => {
|
||||||
|
// console.log("subscribe", a);
|
||||||
|
appWindow.emitTo("main", "config", { config: { ...mainStore.config } });
|
||||||
|
});
|
||||||
|
</script>
|
||||||
+22
-3
@@ -1,6 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
test
|
<div class="h-full flex flex-col gap-[10px]">
|
||||||
|
<ElRadioGroup v-model="mainStore.cidrEnable">
|
||||||
|
<ElRadioButton :value="true">开启</ElRadioButton>
|
||||||
|
<ElRadioButton :value="false">关闭</ElRadioButton>
|
||||||
|
</ElRadioGroup>
|
||||||
|
<div class="flex-1 overflow-auto">
|
||||||
|
<ElInput
|
||||||
|
placeholder="例如: 192.168.1.0/24 一行一个"
|
||||||
|
v-model="mainStore.config.proxyNetworks"
|
||||||
|
type="textarea"
|
||||||
|
:rows="30"
|
||||||
|
resize="none"></ElInput>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import useMainStore from "@/stores/index";
|
||||||
</script>
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||||
|
const mainStore = useMainStore();
|
||||||
|
const appWindow = getCurrentWindow();
|
||||||
|
mainStore.$subscribe((...a) => {
|
||||||
|
appWindow.emitTo("main", "config", { cidrEnable: mainStore.cidrEnable, config: { ...mainStore.config } });
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|||||||
+117
-67
@@ -2,32 +2,27 @@
|
|||||||
<ElForm
|
<ElForm
|
||||||
size="small"
|
size="small"
|
||||||
label-position="top"
|
label-position="top"
|
||||||
:model="config"
|
:model="config">
|
||||||
>
|
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
label="服务器"
|
label="服务器"
|
||||||
prop="serverUrl"
|
prop="serverUrl">
|
||||||
>
|
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex items-center gap-[0_5px]">
|
<div class="flex items-center gap-[0_5px]">
|
||||||
<div>服务器</div>
|
<div>服务器</div>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
<ElTag
|
<ElTag
|
||||||
effect="dark"
|
effect="dark"
|
||||||
:type="data.isSuccessGetIp ? 'success' : 'info'"
|
:type="data.isSuccessGetIp ? 'success' : 'info'">
|
||||||
>
|
|
||||||
{{ data.isSuccessGetIp ? "联机成功" : data.isStart && !data.isSuccessGetIp ? "联机中" : "未联机" }}
|
{{ data.isSuccessGetIp ? "联机成功" : data.isStart && !data.isSuccessGetIp ? "联机中" : "未联机" }}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="!data.coreVersion"
|
v-if="!data.coreVersion"
|
||||||
@click="getCoreVersion(true)"
|
@click="getCoreVersion(true)">
|
||||||
>
|
|
||||||
获取工具版本
|
获取工具版本
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElTag
|
<ElTag
|
||||||
v-else
|
v-else
|
||||||
type="info"
|
type="info">
|
||||||
>
|
|
||||||
core-{{ data.coreVersion }}
|
core-{{ data.coreVersion }}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
<ElButton
|
<ElButton
|
||||||
@@ -35,8 +30,7 @@
|
|||||||
:loading="data.update"
|
:loading="data.update"
|
||||||
type="warning"
|
type="warning"
|
||||||
@click="handleUpdateCore"
|
@click="handleUpdateCore"
|
||||||
size="small"
|
size="small">
|
||||||
>
|
|
||||||
{{ data.coreVersion ? "更新" : "下载" }}
|
{{ data.coreVersion ? "更新" : "下载" }}
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,8 +40,7 @@
|
|||||||
filterable
|
filterable
|
||||||
default-first-option
|
default-first-option
|
||||||
v-model="config.serverUrl"
|
v-model="config.serverUrl"
|
||||||
@change="handleServerUrlChange"
|
@change="handleServerUrlChange">
|
||||||
>
|
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<div :class="config.protocol && config.protocol.length > 1 ? 'w-[120px]' : 'w-[80px]'">
|
<div :class="config.protocol && config.protocol.length > 1 ? 'w-[120px]' : 'w-[80px]'">
|
||||||
<ElSelect
|
<ElSelect
|
||||||
@@ -56,14 +49,12 @@
|
|||||||
collapse-tags
|
collapse-tags
|
||||||
@click.stop
|
@click.stop
|
||||||
v-model="config.protocol"
|
v-model="config.protocol"
|
||||||
@change="handleServerUrlChange"
|
@change="handleServerUrlChange">
|
||||||
>
|
|
||||||
<ElOption
|
<ElOption
|
||||||
v-for="item in protocols"
|
v-for="item in protocols"
|
||||||
:key="item"
|
:key="item"
|
||||||
:label="item"
|
:label="item"
|
||||||
:value="item"
|
:value="item"></ElOption>
|
||||||
></ElOption>
|
|
||||||
</ElSelect>
|
</ElSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -71,16 +62,14 @@
|
|||||||
v-for="item in mainStore.basePeers"
|
v-for="item in mainStore.basePeers"
|
||||||
:key="item"
|
:key="item"
|
||||||
:label="item"
|
:label="item"
|
||||||
:value="item"
|
:value="item">
|
||||||
>
|
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<span style="float: left">{{ item }}</span>
|
<span style="float: left">{{ item }}</span>
|
||||||
<ElButton
|
<ElButton
|
||||||
@click.stop="handleDeleteServerUrl(item)"
|
@click.stop="handleDeleteServerUrl(item)"
|
||||||
round
|
round
|
||||||
:icon="Delete"
|
:icon="Delete"
|
||||||
type="danger"
|
type="danger"></ElButton>
|
||||||
></ElButton>
|
|
||||||
</div>
|
</div>
|
||||||
</ElOption>
|
</ElOption>
|
||||||
</ElSelect>
|
</ElSelect>
|
||||||
@@ -99,8 +88,7 @@
|
|||||||
<ElInput
|
<ElInput
|
||||||
maxlength="100"
|
maxlength="100"
|
||||||
placeholder="请输入网络名"
|
placeholder="请输入网络名"
|
||||||
v-model="config.networkName"
|
v-model="config.networkName"></ElInput>
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
@@ -118,8 +106,7 @@
|
|||||||
maxlength="100"
|
maxlength="100"
|
||||||
placeholder="请输入网络密码"
|
placeholder="请输入网络密码"
|
||||||
v-model="config.networkPassword"
|
v-model="config.networkPassword"
|
||||||
type="password"
|
type="password"></ElInput>
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -136,13 +123,11 @@
|
|||||||
<ElInput
|
<ElInput
|
||||||
maxlength="100"
|
maxlength="100"
|
||||||
placeholder="例如: Player1"
|
placeholder="例如: Player1"
|
||||||
v-model="config.hostname"
|
v-model="config.hostname"></ElInput>
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
class="w-[70%]"
|
class="w-[70%]"
|
||||||
label="局域网IP"
|
label="局域网IP">
|
||||||
>
|
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex items-center h-[20px]">
|
<div class="flex items-center h-[20px]">
|
||||||
虚拟网IP
|
虚拟网IP
|
||||||
@@ -155,16 +140,14 @@
|
|||||||
inline-prompt
|
inline-prompt
|
||||||
inactive-text="固定IP"
|
inactive-text="固定IP"
|
||||||
active-text="动态获取IP"
|
active-text="动态获取IP"
|
||||||
size="small"
|
size="small"></ElSwitch>
|
||||||
></ElSwitch>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<ElInput
|
<ElInput
|
||||||
maxlength="100"
|
maxlength="100"
|
||||||
:disabled="config.dhcp"
|
:disabled="config.dhcp"
|
||||||
:placeholder="data.isStart ? '等待动态分配IP...' : '例如: 10.126.126.1'"
|
:placeholder="data.isStart ? '等待动态分配IP...' : '例如: 10.126.126.1'"
|
||||||
v-model="config.ipv4"
|
v-model="config.ipv4"></ElInput>
|
||||||
></ElInput>
|
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-start gap-[0_30px]">
|
<div class="flex items-start gap-[0_30px]">
|
||||||
@@ -174,8 +157,7 @@
|
|||||||
:type="!data.isStart ? 'primary' : 'danger'"
|
:type="!data.isStart ? 'primary' : 'danger'"
|
||||||
:disabled="data.startLoading || !data.coreVersion || data.update"
|
:disabled="data.startLoading || !data.coreVersion || data.update"
|
||||||
@click="handleConnection"
|
@click="handleConnection"
|
||||||
size="default"
|
size="default">
|
||||||
>
|
|
||||||
{{ !data.isStart ? "启动联机" : "停止联机" }}
|
{{ !data.isStart ? "启动联机" : "停止联机" }}
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
@@ -183,27 +165,23 @@
|
|||||||
<!-- <ElButtonGroup> -->
|
<!-- <ElButtonGroup> -->
|
||||||
<ElTooltip
|
<ElTooltip
|
||||||
placement="left"
|
placement="left"
|
||||||
content="日志"
|
content="日志">
|
||||||
>
|
|
||||||
<ElButton
|
<ElButton
|
||||||
:type="!data.logVisible ? 'info' : 'warning'"
|
:type="!data.logVisible ? 'info' : 'warning'"
|
||||||
@click="handleShowLogDialog"
|
@click="handleShowLogDialog"
|
||||||
:icon="List"
|
:icon="List"
|
||||||
size="small"
|
size="small"
|
||||||
plain
|
plain></ElButton>
|
||||||
></ElButton>
|
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<ElTooltip
|
<ElTooltip
|
||||||
placement="left"
|
placement="left"
|
||||||
content="成员"
|
content="成员">
|
||||||
>
|
|
||||||
<ElButton
|
<ElButton
|
||||||
@click="handleShowMemberDialog"
|
@click="handleShowMemberDialog"
|
||||||
:icon="UserFilled"
|
:icon="UserFilled"
|
||||||
plain
|
plain
|
||||||
type="success"
|
type="success"
|
||||||
size="small"
|
size="small"></ElButton>
|
||||||
></ElButton>
|
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<!-- </ElButtonGroup> -->
|
<!-- </ElButtonGroup> -->
|
||||||
</div>
|
</div>
|
||||||
@@ -211,8 +189,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<ElCheckbox
|
<ElCheckbox
|
||||||
v-model="config.disbleP2p"
|
v-model="config.disbleP2p"
|
||||||
size="small"
|
size="small">
|
||||||
>
|
|
||||||
强制中转
|
强制中转
|
||||||
</ElCheckbox>
|
</ElCheckbox>
|
||||||
<!-- <ElCheckbox
|
<!-- <ElCheckbox
|
||||||
@@ -224,8 +201,7 @@
|
|||||||
<ElCheckbox
|
<ElCheckbox
|
||||||
@change="handleAutoStart"
|
@change="handleAutoStart"
|
||||||
:model-value="config.autoStart"
|
:model-value="config.autoStart"
|
||||||
size="small"
|
size="small">
|
||||||
>
|
|
||||||
开机自启
|
开机自启
|
||||||
</ElCheckbox>
|
</ElCheckbox>
|
||||||
<!-- <ElCheckbox
|
<!-- <ElCheckbox
|
||||||
@@ -235,8 +211,16 @@
|
|||||||
禁用端口监听
|
禁用端口监听
|
||||||
</ElCheckbox> -->
|
</ElCheckbox> -->
|
||||||
<div>
|
<div>
|
||||||
<ElButton @click="handleShowCidrDialog" :icon="Share">子网代理</ElButton>
|
<ElButton
|
||||||
<ElButton :icon="Setting">高级配置</ElButton>
|
@click="handleShowCidrDialog"
|
||||||
|
:icon="Share"
|
||||||
|
>子网代理</ElButton
|
||||||
|
>
|
||||||
|
<ElButton
|
||||||
|
@click="handleShowAdvanceDialog"
|
||||||
|
:icon="Setting"
|
||||||
|
>高级选项</ElButton
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-[0_5px]">
|
<div class="flex items-center gap-[0_5px]">
|
||||||
<div>
|
<div>
|
||||||
@@ -244,8 +228,7 @@
|
|||||||
class="!text-[11px]"
|
class="!text-[11px]"
|
||||||
type="info"
|
type="info"
|
||||||
:underline="false"
|
:underline="false"
|
||||||
@click="open('https://github.com/dechamps/WinIPBroadcast/releases/tag/winipbroadcast-1.6')"
|
@click="open('https://github.com/dechamps/WinIPBroadcast/releases/tag/winipbroadcast-1.6')">
|
||||||
>
|
|
||||||
WinIPBroadcast
|
WinIPBroadcast
|
||||||
<ElTooltip content="找不到游戏房间时,就开启它后再刷新尝试(默认开启)">
|
<ElTooltip content="找不到游戏房间时,就开启它后再刷新尝试(默认开启)">
|
||||||
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
|
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
|
||||||
@@ -258,15 +241,13 @@
|
|||||||
size="small"
|
size="small"
|
||||||
label="WinIPBroadcast"
|
label="WinIPBroadcast"
|
||||||
active-text="开启"
|
active-text="开启"
|
||||||
inactive-text="关闭"
|
inactive-text="关闭"></ElSwitch>
|
||||||
></ElSwitch>
|
|
||||||
</div>
|
</div>
|
||||||
<ElLink
|
<ElLink
|
||||||
class="!text-[11px] pb-[2px] ml-[15px]"
|
class="!text-[11px] pb-[2px] ml-[15px]"
|
||||||
type="info"
|
type="info"
|
||||||
:underline="false"
|
:underline="false"
|
||||||
@click="open('https://github.com/EasyTier/EasytierGame')"
|
@click="open('https://github.com/EasyTier/EasytierGame')">
|
||||||
>
|
|
||||||
主页
|
主页
|
||||||
</ElLink>
|
</ElLink>
|
||||||
</div>
|
</div>
|
||||||
@@ -298,10 +279,12 @@
|
|||||||
|
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
const config = mainStore.config;
|
const config = mainStore.config;
|
||||||
|
// console.log(config);
|
||||||
const protocols = ["tcp", "udp", "ws", "wss", "wg"];
|
const protocols = ["tcp", "udp", "ws", "wss", "wg"];
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
logVisible: false,
|
logVisible: false,
|
||||||
cidrVisible: false,
|
cidrVisible: false,
|
||||||
|
advanceVisible: false,
|
||||||
winipBcPid: 0, //WinIPBroadcast进程id
|
winipBcPid: 0, //WinIPBroadcast进程id
|
||||||
winipBcStart: false,
|
winipBcStart: false,
|
||||||
memberVisible: false,
|
memberVisible: false,
|
||||||
@@ -311,13 +294,13 @@
|
|||||||
coreVersion: "",
|
coreVersion: "",
|
||||||
isSuccessGetIp: false,
|
isSuccessGetIp: false,
|
||||||
startLoading: false,
|
startLoading: false,
|
||||||
isStart: false
|
isStart: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const closePrevent = async () => {
|
const closePrevent = async () => {
|
||||||
const appWindow = getCurrentWindow();
|
const appWindow = getCurrentWindow();
|
||||||
if (appWindow.label == "main") {
|
if (appWindow.label == "main") {
|
||||||
appWindow.onCloseRequested(async event => {
|
appWindow.onCloseRequested(async (event) => {
|
||||||
console.log(appWindow.label);
|
console.log(appWindow.label);
|
||||||
if (!is_close) {
|
if (!is_close) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -346,10 +329,11 @@
|
|||||||
const listenObj: { [key: string]: any } = {
|
const listenObj: { [key: string]: any } = {
|
||||||
unListenOutPut: null,
|
unListenOutPut: null,
|
||||||
unListenThreadId: null,
|
unListenThreadId: null,
|
||||||
|
unListenConfigStart: null,
|
||||||
thread_id: null,
|
thread_id: null,
|
||||||
async listenOutput() {
|
async listenOutput() {
|
||||||
const appWindow = getCurrentWindow();
|
const appWindow = getCurrentWindow();
|
||||||
const unListen = await listen("command-output", async event => {
|
const unListen = await listen("command-output", async (event) => {
|
||||||
data.isStart = true;
|
data.isStart = true;
|
||||||
if (event.payload) {
|
if (event.payload) {
|
||||||
data.startLoading = false;
|
data.startLoading = false;
|
||||||
@@ -366,13 +350,22 @@
|
|||||||
this.unListenOutPut = unListen;
|
this.unListenOutPut = unListen;
|
||||||
},
|
},
|
||||||
async listenThreadId() {
|
async listenThreadId() {
|
||||||
const unListen = await listen("thread-id", event => {
|
const unListen = await listen("thread-id", (event) => {
|
||||||
if (event.payload) {
|
if (event.payload) {
|
||||||
this.thread_id = event.payload;
|
this.thread_id = event.payload;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.unListenThreadId = unListen;
|
this.unListenThreadId = unListen;
|
||||||
}
|
},
|
||||||
|
async listenConfigStart() {
|
||||||
|
const unListen = await listen("config", (event) => {
|
||||||
|
// console.log("config", event.payload);
|
||||||
|
const ipv4 = config.ipv4;
|
||||||
|
mainStore.$patch(event.payload);
|
||||||
|
config.ipv4 = ipv4;
|
||||||
|
});
|
||||||
|
this.unListenConfigStart = unListen;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const unListenAll = async () => {
|
const unListenAll = async () => {
|
||||||
@@ -514,16 +507,19 @@
|
|||||||
await initStartWinIpBroadcast();
|
await initStartWinIpBroadcast();
|
||||||
await getCoreVersion();
|
await getCoreVersion();
|
||||||
await listenObj.listenThreadId();
|
await listenObj.listenThreadId();
|
||||||
|
await listenObj.listenConfigStart();
|
||||||
closePrevent();
|
closePrevent();
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
unListenAll();
|
unListenAll();
|
||||||
listenObj.unListenReleaseList && listenObj.unListenReleaseList();
|
listenObj.unListenReleaseList && listenObj.unListenReleaseList();
|
||||||
|
listenObj.unListenConfigStart && listenObj.unListenConfigStart();
|
||||||
logsTimer && clearInterval(logsTimer);
|
logsTimer && clearInterval(logsTimer);
|
||||||
});
|
});
|
||||||
|
|
||||||
const getArgs = () => {
|
const getArgs = () => {
|
||||||
|
// console.log(config.proxyNetworks);
|
||||||
const args = [];
|
const args = [];
|
||||||
if (config.dhcp) {
|
if (config.dhcp) {
|
||||||
args.push("-d");
|
args.push("-d");
|
||||||
@@ -542,7 +538,7 @@
|
|||||||
}
|
}
|
||||||
if (config.serverUrl) {
|
if (config.serverUrl) {
|
||||||
const formatUrl = config.serverUrl.replace(/\\/g, "/");
|
const formatUrl = config.serverUrl.replace(/\\/g, "/");
|
||||||
args.push("--peers", ...config.protocol.map(protocol => `${protocol}://${formatUrl}`));
|
args.push("--peers", ...config.protocol.map((protocol) => `${protocol}://${formatUrl}`));
|
||||||
}
|
}
|
||||||
if (config.disbleP2p) {
|
if (config.disbleP2p) {
|
||||||
args.push("--disable-p2p");
|
args.push("--disable-p2p");
|
||||||
@@ -553,6 +549,40 @@
|
|||||||
if (config.disbleListenner) {
|
if (config.disbleListenner) {
|
||||||
args.push("--no-listener");
|
args.push("--no-listener");
|
||||||
}
|
}
|
||||||
|
if (mainStore.cidrEnable && config.proxyNetworks) {
|
||||||
|
// console.log(config.proxyNetworks);
|
||||||
|
const reg = /\d+\.\d+\.\d+\.\d+\/\d+/g;
|
||||||
|
const formatProxyNetworks = config.proxyNetworks
|
||||||
|
.split("\n")
|
||||||
|
.map((item) => item.trim())
|
||||||
|
.filter((item) => item && reg.test(item));
|
||||||
|
args.push("--proxy-networks", ...formatProxyNetworks);
|
||||||
|
config.proxyNetworks = formatProxyNetworks.join("\n");
|
||||||
|
}
|
||||||
|
if (config.disableEncryption) {
|
||||||
|
args.push("--disable-encryption");
|
||||||
|
}
|
||||||
|
if (config.multiThread) {
|
||||||
|
args.push("--multi-thread");
|
||||||
|
}
|
||||||
|
if (config.enablExitNode) {
|
||||||
|
args.push("--enable-exit-node");
|
||||||
|
}
|
||||||
|
if (config.noTun) {
|
||||||
|
args.push("--no-tun");
|
||||||
|
}
|
||||||
|
if (config.latencyfirst) {
|
||||||
|
args.push("--latency-first");
|
||||||
|
}
|
||||||
|
if (config.useSmoltcp) {
|
||||||
|
args.push("--use-smoltcp");
|
||||||
|
}
|
||||||
|
if (config.disableUdpHolePunching) {
|
||||||
|
args.push("--disable-udp-hole-punching");
|
||||||
|
}
|
||||||
|
if (config.relayAllPeerrpc) {
|
||||||
|
args.push("--relay-all-peer-rpc");
|
||||||
|
}
|
||||||
return args;
|
return args;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -563,7 +593,7 @@
|
|||||||
config.ipv4 = "";
|
config.ipv4 = "";
|
||||||
}
|
}
|
||||||
const memberDialog = await getAllWebviewWindows();
|
const memberDialog = await getAllWebviewWindows();
|
||||||
const memberDialogs = memberDialog.filter(item => item.label === "member");
|
const memberDialogs = memberDialog.filter((item) => item.label === "member");
|
||||||
if (memberDialogs && memberDialogs.length > 0) {
|
if (memberDialogs && memberDialogs.length > 0) {
|
||||||
data.memberVisible = false;
|
data.memberVisible = false;
|
||||||
for (const memberDialog of memberDialogs) {
|
for (const memberDialog of memberDialogs) {
|
||||||
@@ -581,12 +611,13 @@
|
|||||||
if (data.isStart) {
|
if (data.isStart) {
|
||||||
await reset();
|
await reset();
|
||||||
} else {
|
} else {
|
||||||
|
data.log = ""; //清空日志
|
||||||
data.startLoading = true;
|
data.startLoading = true;
|
||||||
await unListenAll();
|
await unListenAll();
|
||||||
await listenObj.listenOutput();
|
await listenObj.listenOutput();
|
||||||
const args = getArgs();
|
const args = getArgs();
|
||||||
await invoke("run_command", {
|
await invoke("run_command", {
|
||||||
args
|
args,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -605,7 +636,7 @@
|
|||||||
title: "成员列表",
|
title: "成员列表",
|
||||||
width: 470,
|
width: 470,
|
||||||
height: 380,
|
height: 380,
|
||||||
url: "#/member"
|
url: "#/member",
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
data.memberVisible = true;
|
data.memberVisible = true;
|
||||||
@@ -624,7 +655,7 @@
|
|||||||
width: 600,
|
width: 600,
|
||||||
height: 380,
|
height: 380,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
url: "#/log"
|
url: "#/log",
|
||||||
},
|
},
|
||||||
(_, appWindow) => {
|
(_, appWindow) => {
|
||||||
data.logVisible = true;
|
data.logVisible = true;
|
||||||
@@ -647,7 +678,7 @@
|
|||||||
width: 600,
|
width: 600,
|
||||||
height: 380,
|
height: 380,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
url: "#/cidr"
|
url: "#/cidr",
|
||||||
},
|
},
|
||||||
(_, appWindow) => {
|
(_, appWindow) => {
|
||||||
data.cidrVisible = true;
|
data.cidrVisible = true;
|
||||||
@@ -657,4 +688,23 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleShowAdvanceDialog = async () => {
|
||||||
|
await etWindows(
|
||||||
|
"advance",
|
||||||
|
{
|
||||||
|
title: "高级选项",
|
||||||
|
width: 600,
|
||||||
|
height: 380,
|
||||||
|
resizable: false,
|
||||||
|
url: "#/advance",
|
||||||
|
},
|
||||||
|
(_, appWindow) => {
|
||||||
|
data.advanceVisible = true;
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
data.advanceVisible = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Generated
+1
-1
@@ -1109,7 +1109,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.0.6"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"planif",
|
"planif",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.0.6"
|
version = "1.0.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"
|
||||||
|
|||||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
"$schema": "../gen/schemas/desktop-schema.json",
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
"identifier": "default",
|
"identifier": "default",
|
||||||
"description": "enables the default permissions",
|
"description": "enables the default permissions",
|
||||||
"windows": ["main", "log", "member"],
|
"windows": ["main", "log", "member", "cidr", "advance"],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"core:default",
|
"core:default",
|
||||||
"core:window:allow-minimize",
|
"core:window:allow-minimize",
|
||||||
|
|||||||
@@ -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.0.6",
|
"version": "1.0.7",
|
||||||
"identifier": "com.tauri.easytier-game",
|
"identifier": "com.tauri.easytier-game",
|
||||||
|
|
||||||
"build": {
|
"build": {
|
||||||
|
|||||||
@@ -9,18 +9,30 @@ export default defineStore("main", {
|
|||||||
networkPassword: "",
|
networkPassword: "",
|
||||||
hostname: "",
|
hostname: "",
|
||||||
ipv4: "",
|
ipv4: "",
|
||||||
|
proxyNetworks: "", // 子网代理
|
||||||
autoStart: false, // 是否自动启动
|
autoStart: false, // 是否自动启动
|
||||||
disableIpv6: false, // 是否禁用IPv6
|
disableIpv6: false, // 是否禁用IPv6
|
||||||
disbleListenner: false, // 是否禁用监听
|
disbleListenner: false, // 是否禁用监听
|
||||||
|
disableEncryption: false, // 是否禁用加密
|
||||||
|
multiThread: false, //使用多线程
|
||||||
|
enablExitNode: false, // 是否启用退出节点
|
||||||
|
noTun: false, // 是否使用TUN
|
||||||
|
latencyfirst: false, // 是否优先延迟
|
||||||
|
useSmoltcp: false, // 是否为子网代理启用smoltcp堆栈
|
||||||
|
disableUdpHolePunching: false, // 是否禁用UDP打洞
|
||||||
|
relayAllPeerrpc: false, // 是否启用所有对等RPC
|
||||||
disbleP2p: false, // 是否使用P2P
|
disbleP2p: false, // 是否使用P2P
|
||||||
dhcp: true, // 是否使用DHCP
|
dhcp: true, // 是否使用DHCP
|
||||||
},
|
},
|
||||||
|
cidrEnable: false,
|
||||||
basePeers: ["public.easytier.top:11010"],
|
basePeers: ["public.easytier.top:11010"],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
persist: {
|
persist: {
|
||||||
paths: [
|
paths: [
|
||||||
"basePeers",
|
"basePeers",
|
||||||
|
"cidrEnable",
|
||||||
|
"config.proxyNetworks",
|
||||||
"config.serverUrl",
|
"config.serverUrl",
|
||||||
"config.networkName",
|
"config.networkName",
|
||||||
"config.protocol",
|
"config.protocol",
|
||||||
@@ -29,6 +41,14 @@ export default defineStore("main", {
|
|||||||
"config.autoStart",
|
"config.autoStart",
|
||||||
"config.disableIpv6",
|
"config.disableIpv6",
|
||||||
"config.disbleListenner",
|
"config.disbleListenner",
|
||||||
|
"config.disableEncryption",
|
||||||
|
"config.multiThread",
|
||||||
|
"config.enablExitNode",
|
||||||
|
"config.noTun",
|
||||||
|
"config.latencyfirst",
|
||||||
|
"config.useSmoltcp",
|
||||||
|
"config.disableUdpHolePunching",
|
||||||
|
"config.relayAllPeerrpc",
|
||||||
"config.hostname",
|
"config.hostname",
|
||||||
"config.dhcp",
|
"config.dhcp",
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user