mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cd19ae42a | ||
|
|
5be1a681ca | ||
|
|
29464179f5 | ||
|
|
88f06fbeba | ||
|
|
ced035dc36 | ||
|
|
feea75dcb6 | ||
|
|
229fd31de6 | ||
|
|
db3acd0c32 |
@@ -1,12 +1,12 @@
|
|||||||
pnpm run build
|
pnpm run build
|
||||||
rustup default nightly
|
@REM rustup default nightly
|
||||||
rem 使用rust nightly构建支持win7的版本,请先将根目录的windows.0.48.5 放入以下目录
|
@REM rem 使用rust nightly构建支持win7的版本,请先将根目录的windows.0.48.5 放入以下目录
|
||||||
rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\lib\x64
|
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\lib\x64
|
||||||
rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\lib\x86
|
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\lib\x86
|
||||||
rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\atlmfc\lib\x64
|
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\atlmfc\lib\x64
|
||||||
rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\atlmfc\lib\x86
|
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\atlmfc\lib\x86
|
||||||
pnpm tauri build -- -Z build-std --target x86_64-win7-windows-msvc
|
@REM pnpm tauri build -- -Z build-std --target x86_64-win7-windows-msvc
|
||||||
rustup default stable
|
rustup default stable
|
||||||
pnpm tauri build
|
pnpm tauri build
|
||||||
pnpm run release
|
pnpm run release
|
||||||
pnpm run release-win7
|
@REM pnpm run release-win7
|
||||||
@@ -14,23 +14,16 @@ export const updateConfigJson = async (configJsonSeverUrl: Array<string> | strin
|
|||||||
const {
|
const {
|
||||||
proxyNetworks,
|
proxyNetworks,
|
||||||
autoStart,
|
autoStart,
|
||||||
relayAllPeerrpc,
|
|
||||||
connectAfterStart,
|
connectAfterStart,
|
||||||
multiThread,
|
|
||||||
enablExitNode,
|
|
||||||
useSmoltcp,
|
|
||||||
saveErrorLog,
|
saveErrorLog,
|
||||||
logLevel,
|
|
||||||
serverUrl,
|
serverUrl,
|
||||||
port,
|
|
||||||
enableCustomListener,
|
enableCustomListener,
|
||||||
enablePreventSleep,
|
|
||||||
customListenerData,
|
customListenerData,
|
||||||
customListenerV6Data,
|
bindDeviceEnable,
|
||||||
enableCustomListenerV6,
|
|
||||||
...otherConfig
|
...otherConfig
|
||||||
} = mainStore.config;
|
} = mainStore.config;
|
||||||
let writeServerUrl: Array<string> | string = serverUrl;
|
let writeServerUrl: Array<string> | string = serverUrl;
|
||||||
|
let writeCustomListenerData: Array<string> = (customListenerData || "").split("\n");
|
||||||
if (isArray) {
|
if (isArray) {
|
||||||
writeServerUrl = intersection(
|
writeServerUrl = intersection(
|
||||||
uniq([serverUrl, ...configJsonSeverUrl]).filter(boolean => boolean),
|
uniq([serverUrl, ...configJsonSeverUrl]).filter(boolean => boolean),
|
||||||
@@ -43,7 +36,11 @@ export const updateConfigJson = async (configJsonSeverUrl: Array<string> | strin
|
|||||||
mainStore.basePeers
|
mainStore.basePeers
|
||||||
).join(",");
|
).join(",");
|
||||||
}
|
}
|
||||||
await writeTextFile(path, JSON.stringify({ serverUrl: writeServerUrl, ...otherConfig }, null, 4), { baseDir: BaseDirectory.Resource });
|
await writeTextFile(
|
||||||
|
path,
|
||||||
|
JSON.stringify({ serverUrl: writeServerUrl, enableCustomListener, customListenerData: writeCustomListenerData, ...otherConfig }, null, 4),
|
||||||
|
{ baseDir: BaseDirectory.Resource }
|
||||||
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
ElMessage.error(`更新config.json失败`);
|
ElMessage.error(`更新config.json失败`);
|
||||||
|
|||||||
+37
-38
@@ -8,6 +8,7 @@ import { resourceDir as getResourceDir, join } from "@tauri-apps/api/path";
|
|||||||
import { invoke } from "@tauri-apps/api/core";
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
// import { ElConfirmPrimary } from "~/utils/element";
|
// import { ElConfirmPrimary } from "~/utils/element";
|
||||||
import { open } from "@tauri-apps/plugin-shell";
|
import { open } from "@tauri-apps/plugin-shell";
|
||||||
|
import { computed } from "vue";
|
||||||
|
|
||||||
const DEFAULT_TRAY_NAME = "main";
|
const DEFAULT_TRAY_NAME = "main";
|
||||||
|
|
||||||
@@ -30,13 +31,10 @@ export async function useTray(init: boolean = false, beforExit: Function, handle
|
|||||||
tooltip: `EasyTierGame\n${pkg.version}`,
|
tooltip: `EasyTierGame\n${pkg.version}`,
|
||||||
title: `EasyTierGame\n${pkg.version}`,
|
title: `EasyTierGame\n${pkg.version}`,
|
||||||
id: DEFAULT_TRAY_NAME,
|
id: DEFAULT_TRAY_NAME,
|
||||||
menu: await Menu.new({
|
menu: await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection) }),
|
||||||
id: "main",
|
action: async e => {
|
||||||
items: await generateMenuItem(beforExit, handleConnection),
|
|
||||||
}),
|
|
||||||
action: async (e) => {
|
|
||||||
toggleVisibility();
|
toggleVisibility();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -47,18 +45,13 @@ export async function useTray(init: boolean = false, beforExit: Function, handle
|
|||||||
if (init) {
|
if (init) {
|
||||||
tray.setTooltip(`EasyTierGame\n${pkg.version}`);
|
tray.setTooltip(`EasyTierGame\n${pkg.version}`);
|
||||||
tray.setShowMenuOnLeftClick(false);
|
tray.setShowMenuOnLeftClick(false);
|
||||||
tray.setMenu(
|
tray.setMenu(await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection) }));
|
||||||
await Menu.new({
|
|
||||||
id: "main",
|
|
||||||
items: await generateMenuItem(beforExit, handleConnection),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tray;
|
return tray;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMenuItem(beforExit: Function, handleConnection:Function) {
|
export async function generateMenuItem(beforExit: Function, handleConnection: Function) {
|
||||||
return [
|
return [
|
||||||
await MenuItemShow("显示 / 隐藏"),
|
await MenuItemShow("显示 / 隐藏"),
|
||||||
await MenuItemExchangeConnection("联机 / 断开", handleConnection),
|
await MenuItemExchangeConnection("联机 / 断开", handleConnection),
|
||||||
@@ -66,7 +59,7 @@ export async function generateMenuItem(beforExit: Function, handleConnection:Fun
|
|||||||
await PredefinedMenuItem.new({ item: "Separator" }),
|
await PredefinedMenuItem.new({ item: "Separator" }),
|
||||||
await MenuItemPublicPeers(),
|
await MenuItemPublicPeers(),
|
||||||
await PredefinedMenuItem.new({ item: "Separator" }),
|
await PredefinedMenuItem.new({ item: "Separator" }),
|
||||||
await MenuItemExit("退出", beforExit),
|
await MenuItemExit("退出", beforExit)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,18 +72,17 @@ export async function MenuItemExit(text: string, beforExit: Function) {
|
|||||||
await beforExit();
|
await beforExit();
|
||||||
}
|
}
|
||||||
await getCurrentWindow().close();
|
await getCurrentWindow().close();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function MenuItemPublicPeers() {
|
export async function MenuItemPublicPeers() {
|
||||||
|
|
||||||
return await MenuItem.new({
|
return await MenuItem.new({
|
||||||
id: "publicPeers",
|
id: "publicPeers",
|
||||||
text: "公共节点",
|
text: "公共节点",
|
||||||
action: async () => {
|
action: async () => {
|
||||||
await open(import.meta.env.VITE_PUBLIC_PEERS_URL)
|
await open(import.meta.env.VITE_PUBLIC_PEERS_URL);
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,17 +92,17 @@ export async function MenuItemShow(text: string) {
|
|||||||
text,
|
text,
|
||||||
action: async () => {
|
action: async () => {
|
||||||
await toggleVisibility();
|
await toggleVisibility();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function MenuItemExchangeConnection(text: string, handleConnection:Function) {
|
export async function MenuItemExchangeConnection(text: string, handleConnection: Function) {
|
||||||
const menutItem = await MenuItem.new({
|
const menutItem = await MenuItem.new({
|
||||||
id: "exchangeConnection",
|
id: "exchangeConnection",
|
||||||
text,
|
text,
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const isStart = await handleConnection();
|
const isStart = await handleConnection();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
return menutItem;
|
return menutItem;
|
||||||
}
|
}
|
||||||
@@ -121,12 +113,10 @@ export async function MenuItemTheme() {
|
|||||||
text: "主题切换",
|
text: "主题切换",
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
mainStore.$patch({
|
mainStore.$patch({ theme: !mainStore.theme });
|
||||||
theme: !mainStore.theme
|
|
||||||
});
|
|
||||||
// mainStore.$persist();
|
// mainStore.$persist();
|
||||||
await setTheme(mainStore.theme);
|
await setTheme(mainStore.theme);
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,18 +149,27 @@ export async function setTrayTooltip(tray: TrayIcon | null, tooltip?: string | n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const versionWeight = (version: string) => {
|
||||||
|
version = version ? version.trim() : "";
|
||||||
|
const [major = "0", minor = "0", patch = "0"] = version.split(".");
|
||||||
|
return parseInt(major) * 10000 + parseInt(minor) * 100 + parseInt(patch);
|
||||||
|
};
|
||||||
|
|
||||||
|
const versionDifference = (current: string, latest: string) => {
|
||||||
|
const currentVersion = versionWeight(current);
|
||||||
|
const latestVersion = versionWeight(latest);
|
||||||
|
return currentVersion - latestVersion;
|
||||||
|
};
|
||||||
|
|
||||||
export const checkNewVersion = async () => {
|
export const checkNewVersion = async () => {
|
||||||
|
const mainStore = useMainStore();
|
||||||
|
// if(mainStore.latestTagName && mainStore.latestTagName == pkg.version) return;
|
||||||
|
if (hasNewVersion.value) return;
|
||||||
let [tagName, downloadUrl] = await invoke<string[]>("fetch_game_releases");
|
let [tagName, downloadUrl] = await invoke<string[]>("fetch_game_releases");
|
||||||
if(tagName && pkg.version !== tagName) {
|
mainStore.latestTagName = tagName;
|
||||||
return true; //有新版
|
};
|
||||||
// const [err] = await ElConfirmPrimary("有新版本是否下载?", "发现新版本", {
|
|
||||||
// confirmButtonText: "下载",
|
export const hasNewVersion = computed<boolean>(() => {
|
||||||
// cancelButtonText: "取消",
|
const mainStore = useMainStore();
|
||||||
// })
|
return !!mainStore.latestTagName && versionDifference(pkg.version, mainStore.latestTagName) < 0 ;
|
||||||
// if(!err) {
|
});
|
||||||
// open(downloadUrl);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
return false; //没有新版
|
|
||||||
}
|
|
||||||
|
|||||||
+39
-28
@@ -5,16 +5,31 @@ import type { WebviewLabel, WebviewOptions } from "@tauri-apps/api/webview";
|
|||||||
import useMainStore from "@/stores/index";
|
import useMainStore from "@/stores/index";
|
||||||
import { onBeforeUnmount } from "vue";
|
import { onBeforeUnmount } from "vue";
|
||||||
|
|
||||||
const _listenersMaps: { [key: string]: [UnlistenFn | null, UnlistenFn | null] } = {};
|
const _listenersMaps: { [key: string]: [UnlistenFn | null] } = {};
|
||||||
|
|
||||||
|
const dealCloseListener = async (
|
||||||
|
dialog: WebviewWindow,
|
||||||
|
label: string,
|
||||||
|
beforeCloseFunc?: () => void | null
|
||||||
|
) => {
|
||||||
|
const unlistenFnList: [UnlistenFn | null] = _listenersMaps[label] || [null];
|
||||||
|
let [unListenlogClose] = unlistenFnList;
|
||||||
|
|
||||||
|
unListenlogClose && (await unListenlogClose());
|
||||||
|
|
||||||
|
unListenlogClose = await dialog.onCloseRequested(async () => {
|
||||||
|
beforeCloseFunc && (await beforeCloseFunc());
|
||||||
|
unListenlogClose && (await unListenlogClose());
|
||||||
|
console.log("close")
|
||||||
|
});
|
||||||
|
};
|
||||||
export default async (
|
export default async (
|
||||||
label: WebviewLabel,
|
label: WebviewLabel,
|
||||||
options?: Omit<WebviewOptions, "x" | "y" | "width" | "height"> & WindowOptions,
|
options?: Omit<WebviewOptions, "x" | "y" | "width" | "height"> & WindowOptions,
|
||||||
afterCreatedFunc?: (webviewWindow: WebviewWindow, appWindow: Window) => void | null,
|
afterCreatedFunc?: (webviewWindow: WebviewWindow, appWindow: Window) => void | null,
|
||||||
beforeCloseFunc?: () => void | null
|
beforeCloseFunc?: () => void | null
|
||||||
) => {
|
) => {
|
||||||
const unlistenFnList: [UnlistenFn | null, UnlistenFn | null] = _listenersMaps[label] || [null, null];
|
const unlistenFnList: [UnlistenFn | null] = _listenersMaps[label] || [null];
|
||||||
let [unlistenLogCreated, unListenlogClose] = unlistenFnList;
|
|
||||||
let dialog = await WebviewWindow.getByLabel(label);
|
let dialog = await WebviewWindow.getByLabel(label);
|
||||||
if (!dialog) {
|
if (!dialog) {
|
||||||
let defaultOpts: { [key: string]: any; parent: Window | undefined } = {
|
let defaultOpts: { [key: string]: any; parent: Window | undefined } = {
|
||||||
@@ -38,28 +53,20 @@ export default async (
|
|||||||
defaultOpts.x = logicalPosition.x;
|
defaultOpts.x = logicalPosition.x;
|
||||||
defaultOpts.y = logicalPosition.y;
|
defaultOpts.y = logicalPosition.y;
|
||||||
}
|
}
|
||||||
unlistenLogCreated && (await (unlistenLogCreated as Function)());
|
|
||||||
unListenlogClose && (await unListenlogClose());
|
|
||||||
dialog = new WebviewWindow(label, { ...defaultOpts, ...options });
|
dialog = new WebviewWindow(label, { ...defaultOpts, ...options });
|
||||||
unlistenLogCreated = await dialog.listen("tauri://webview-created", async () => {
|
await dealCloseListener(dialog, label, beforeCloseFunc);
|
||||||
if (dialog) {
|
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
||||||
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
await dialog.show();
|
||||||
await dialog.show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
unlistenFnList[0] = unlistenLogCreated;
|
|
||||||
unListenlogClose = await dialog.onCloseRequested(async () => {
|
|
||||||
beforeCloseFunc && (await beforeCloseFunc());
|
|
||||||
unListenlogClose && (await unListenlogClose());
|
|
||||||
unlistenLogCreated && (await (unlistenLogCreated as Function)());
|
|
||||||
});
|
|
||||||
unlistenFnList[1] = unlistenLogCreated;
|
|
||||||
_listenersMaps[label] = unlistenFnList;
|
|
||||||
} else {
|
} else {
|
||||||
const visible = await dialog.isVisible();
|
const visible = await dialog.isVisible();
|
||||||
if (visible) {
|
if (visible) {
|
||||||
await dialog.close();
|
await dialog.close();
|
||||||
unlistenLogCreated && (await (unlistenLogCreated as Function)());
|
} else {
|
||||||
|
const appWindow = getCurrentWindow();
|
||||||
|
await dealCloseListener(dialog, label, beforeCloseFunc);
|
||||||
|
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
|
||||||
|
await dialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -68,15 +75,19 @@ export const dataSubscribe = async (cb?: (...args: any) => any) => {
|
|||||||
if (!cb) return;
|
if (!cb) return;
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
const abort = new AbortController();
|
const abort = new AbortController();
|
||||||
window.addEventListener("storage", async () => {
|
window.addEventListener(
|
||||||
mainStore.$hydrate();
|
"storage",
|
||||||
if (cb && cb instanceof Function) {
|
async () => {
|
||||||
await cb();
|
mainStore.$hydrate();
|
||||||
|
if (cb && cb instanceof Function) {
|
||||||
|
await cb();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
signal: abort.signal
|
||||||
}
|
}
|
||||||
}, {
|
);
|
||||||
signal: abort.signal
|
|
||||||
})
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
abort?.abort();
|
abort?.abort();
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
+93
-93
@@ -3,107 +3,107 @@ import path from "path";
|
|||||||
import vueJSX from "@vitejs/plugin-vue-jsx";
|
import vueJSX from "@vitejs/plugin-vue-jsx";
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
ssr: false,
|
ssr: false,
|
||||||
|
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 5000
|
port: 5000
|
||||||
},
|
},
|
||||||
|
|
||||||
telemetry: false,
|
|
||||||
|
|
||||||
imports: {
|
telemetry: false,
|
||||||
autoImport: false
|
|
||||||
},
|
|
||||||
|
|
||||||
css: ["~/assets/css/main.css", "element-plus/theme-chalk/dark/css-vars.css"],
|
imports: {
|
||||||
modules: [
|
autoImport: false
|
||||||
"@element-plus/nuxt",
|
},
|
||||||
"@pinia/nuxt",
|
|
||||||
[
|
|
||||||
"pinia-plugin-persistedstate/nuxt",
|
|
||||||
{
|
|
||||||
key: "__glj_persisted_%id",
|
|
||||||
storage: "localStorage"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@nuxtjs/tailwindcss"
|
|
||||||
],
|
|
||||||
|
|
||||||
alias: {
|
css: ["~/assets/css/main.css", "element-plus/theme-chalk/dark/css-vars.css"],
|
||||||
"@": path.resolve(__dirname, "./")
|
modules: [
|
||||||
},
|
"@element-plus/nuxt",
|
||||||
|
"@pinia/nuxt",
|
||||||
|
[
|
||||||
|
"pinia-plugin-persistedstate/nuxt",
|
||||||
|
{
|
||||||
|
key: "__glj_persisted_%id",
|
||||||
|
storage: "localStorage"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@nuxtjs/tailwindcss"
|
||||||
|
],
|
||||||
|
|
||||||
experimental: {
|
alias: {
|
||||||
payloadExtraction: false
|
"@": path.resolve(__dirname, "./")
|
||||||
},
|
},
|
||||||
|
|
||||||
devtools: {
|
experimental: {
|
||||||
enabled: false
|
payloadExtraction: false
|
||||||
},
|
},
|
||||||
|
|
||||||
router: {
|
devtools: {
|
||||||
options: {
|
enabled: false
|
||||||
hashMode: true
|
},
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
vite: {
|
router: {
|
||||||
plugins: [vueJSX({})],
|
options: {
|
||||||
envDir: "env",
|
hashMode: true
|
||||||
optimizeDeps: {
|
}
|
||||||
// include: [...optimizeDepsElementPlusIncludes]
|
},
|
||||||
},
|
|
||||||
// prevent vite from obscuring rust errors
|
|
||||||
clearScreen: false,
|
|
||||||
// Tauri expects a fixed port, fail if that port is not available
|
|
||||||
server: {
|
|
||||||
strictPort: true
|
|
||||||
},
|
|
||||||
// to access the Tauri environment variables set by the CLI with information about the current target
|
|
||||||
envPrefix: ["VITE_", "TAURI_"],
|
|
||||||
build: {
|
|
||||||
// minify: "esbuild",
|
|
||||||
chunkSizeWarningLimit: 1500,
|
|
||||||
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
|
||||||
target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
|
|
||||||
// don't minify for debug builds
|
|
||||||
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
|
|
||||||
// 为调试构建生成源代码映射 (sourcemap)
|
|
||||||
sourcemap: !!process.env.TAURI_DEBUG
|
|
||||||
},
|
|
||||||
esbuild: {
|
|
||||||
// pure: ["console.log"],
|
|
||||||
drop: ["debugger"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
postcss: {
|
vite: {
|
||||||
plugins: {
|
plugins: [vueJSX({})],
|
||||||
tailwindcss: {},
|
envDir: "env",
|
||||||
autoprefixer: {}
|
optimizeDeps: {
|
||||||
}
|
// include: [...optimizeDepsElementPlusIncludes]
|
||||||
},
|
},
|
||||||
|
// prevent vite from obscuring rust errors
|
||||||
|
clearScreen: false,
|
||||||
|
// Tauri expects a fixed port, fail if that port is not available
|
||||||
|
server: {
|
||||||
|
strictPort: true
|
||||||
|
},
|
||||||
|
// to access the Tauri environment variables set by the CLI with information about the current target
|
||||||
|
envPrefix: ["VITE_", "TAURI_"],
|
||||||
|
build: {
|
||||||
|
// minify: "esbuild",
|
||||||
|
chunkSizeWarningLimit: 1500,
|
||||||
|
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
||||||
|
target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
|
||||||
|
// don't minify for debug builds
|
||||||
|
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
|
||||||
|
// 为调试构建生成源代码映射 (sourcemap)
|
||||||
|
sourcemap: !!process.env.TAURI_DEBUG
|
||||||
|
},
|
||||||
|
esbuild: {
|
||||||
|
// pure: ["console.log"],
|
||||||
|
drop: ["debugger"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
app: {
|
postcss: {
|
||||||
rootId: "__easytier",
|
plugins: {
|
||||||
cdnURL: "./",
|
tailwindcss: {},
|
||||||
buildAssetsDir: "__easytier/",
|
autoprefixer: {}
|
||||||
head: {
|
}
|
||||||
meta: [
|
},
|
||||||
{
|
|
||||||
name: "viewport",
|
app: {
|
||||||
content: "width=device-width, initial-scale=1"
|
rootId: "__easytier",
|
||||||
},
|
cdnURL: "./",
|
||||||
{
|
buildAssetsDir: "__easytier/",
|
||||||
charset: "utf-8"
|
head: {
|
||||||
}
|
meta: [
|
||||||
],
|
{
|
||||||
title: "easytier-game"
|
name: "viewport",
|
||||||
// link: [],
|
content: "width=device-width, initial-scale=1"
|
||||||
// style: [],
|
},
|
||||||
// script: [],
|
{
|
||||||
// noscript: []
|
charset: "utf-8"
|
||||||
}
|
}
|
||||||
},
|
],
|
||||||
compatibilityDate: "2024-11-12"
|
title: "easytier-game"
|
||||||
|
// link: [],
|
||||||
|
// style: [],
|
||||||
|
// script: [],
|
||||||
|
// noscript: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
compatibilityDate: "2024-11-12"
|
||||||
});
|
});
|
||||||
|
|||||||
+18
-18
@@ -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.4.1",
|
"version": "1.4.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",
|
||||||
@@ -12,30 +12,30 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@element-plus/nuxt": "^1.1.1",
|
"@element-plus/nuxt": "1.1.1",
|
||||||
"@nuxtjs/tailwindcss": "6.13.1",
|
"@nuxtjs/tailwindcss": "6.13.2",
|
||||||
"@pinia/nuxt": "0.9.0",
|
"@pinia/nuxt": "0.11.0",
|
||||||
"@tauri-apps/api": "^2.2.0",
|
"@tauri-apps/api": "2.5.0",
|
||||||
"@tauri-apps/cli": "2.2.7",
|
"@tauri-apps/cli": "2.5.0",
|
||||||
"@tauri-apps/plugin-cli": "^2.2.0",
|
"@tauri-apps/plugin-cli": "^2.2.0",
|
||||||
"@tauri-apps/plugin-clipboard-manager": "2.2.0",
|
"@tauri-apps/plugin-clipboard-manager": "2.2.2",
|
||||||
"@tauri-apps/plugin-dialog": "2.2.0",
|
"@tauri-apps/plugin-dialog": "2.2.1",
|
||||||
"@tauri-apps/plugin-fs": "^2.2.0",
|
"@tauri-apps/plugin-fs": "2.2.1",
|
||||||
"@tauri-apps/plugin-log": "2.2.1",
|
"@tauri-apps/plugin-log": "2.3.1",
|
||||||
"@tauri-apps/plugin-shell": "^2.2.0",
|
"@tauri-apps/plugin-shell": "2.2.1",
|
||||||
"@tauri-apps/plugin-window-state": "2.2.1",
|
"@tauri-apps/plugin-window-state": "2.2.2",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
"@vitejs/plugin-vue-jsx": "4.1.2",
|
||||||
"@vueuse/core": "12.4.0",
|
"@vueuse/core": "12.7.0",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"element-plus": "2.9.4",
|
"element-plus": "2.9.10",
|
||||||
"less": "4.2.1",
|
"less": "4.2.1",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"nuxt": "3.15.4",
|
"nuxt": "3.17.2",
|
||||||
"pinia": "2.3.1",
|
"pinia": "3.0.2",
|
||||||
"pinia-plugin-persistedstate": "^4.2.0",
|
"pinia-plugin-persistedstate": "^4.2.0",
|
||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
"prettier": "3.4.2",
|
"prettier": "3.5.2",
|
||||||
"prettier-plugin-tailwindcss": "0.6.11"
|
"prettier-plugin-tailwindcss": "0.6.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+79
-22
@@ -2,8 +2,8 @@
|
|||||||
<div class="flex h-full flex-col items-start overflow-auto px-[25px]">
|
<div class="flex h-full flex-col items-start overflow-auto px-[25px]">
|
||||||
<div class="flex flex-nowrap items-center gap-[15px]">
|
<div class="flex flex-nowrap items-center gap-[15px]">
|
||||||
<div class="flex flex-nowrap items-center gap-[5px]">
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
<ElCheckbox v-model="mainStore.config.enableCustomProtocol">默认直连(p2p)使用的协议</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.enableCustomProtocol">直连(P2P)优先使用传输协议</ElCheckbox>
|
||||||
<ElTooltip content="如果没有支持该协议的节点地址,程序会自动处理,请放心使用">
|
<ElTooltip content="若无法建立指定的协议,会自动使用可建立连接的协议">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ElCheckbox v-model="mainStore.config.relayAllPeerrpc">帮助对等节点建立直连(p2p)通信</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.relayAllPeerrpc">帮助他人建立直连(P2P)连接</ElCheckbox>
|
||||||
</div>
|
</div>
|
||||||
<div><ElCheckbox v-model="mainStore.config.connectAfterStart">软件启动后,自动"启动联机"(搭配开机自启,无感联机)</ElCheckbox></div>
|
<div><ElCheckbox v-model="mainStore.config.connectAfterStart">软件启动后,自动"启动联机"(搭配开机自启,无感联机)</ElCheckbox></div>
|
||||||
<div class="flex flex-nowrap items-center gap-[15px]">
|
<div class="flex flex-nowrap items-center gap-[15px]">
|
||||||
@@ -38,8 +38,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div><ElCheckbox v-model="mainStore.config.enablePreventSleep">防止系统休眠(比如:屏幕会一直亮着)</ElCheckbox></div>
|
<div><ElCheckbox v-model="mainStore.config.enablePreventSleep">防止系统休眠(比如:屏幕会一直亮着)</ElCheckbox></div>
|
||||||
<div class="flex flex-nowrap items-center gap-[5px]">
|
<div class="flex flex-nowrap items-center gap-[5px]">
|
||||||
<ElCheckbox v-model="mainStore.config.latencyfirst">延迟优先模式,将尝试使用最低延迟路径转发流量</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.latencyfirst">使用低延迟模式</ElCheckbox>
|
||||||
<ElTooltip content="视网络质量进行选择,可能会出现中转与直连(p2p)来回切换的情况">
|
<ElTooltip content="弱网环境下可能会导致网络延迟延迟忽高忽低">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
@@ -124,10 +124,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</ElDialog>
|
</ElDialog>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-[10px]">
|
<!-- <div class="flex items-center gap-[10px]">
|
||||||
<ElCheckbox
|
<ElCheckbox
|
||||||
:disabled="mainStore.config.disbleListenner"
|
:disabled="mainStore.config.disbleListenner"
|
||||||
v-model="mainStore.config.enableCustomListenerV6"
|
:model-value="mainStore.config.enableCustomListenerV6"
|
||||||
|
@change="handleCustomListenerV6Change"
|
||||||
>
|
>
|
||||||
自定义IPV6监听地址
|
自定义IPV6监听地址
|
||||||
</ElCheckbox>
|
</ElCheckbox>
|
||||||
@@ -140,23 +141,23 @@
|
|||||||
placeholder="请输入自定义IPV6监听地址"
|
placeholder="请输入自定义IPV6监听地址"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ElTooltip content="例如:tcp://[::]:11010,如果未设置,将在随机UDP端口上监听">
|
<ElTooltip content="例如:tcp://[::]:11010,如果未设置,将在随机UDP端口上监听(内核版本2.2.3之后,ipv6监听被移除并合并到'自定义监听')">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<CoreVersionWarning version="2.1.0" />
|
<CoreVersionWarning version="2.1.0" />
|
||||||
</div>
|
</div> -->
|
||||||
<ElDivider />
|
<ElDivider />
|
||||||
<div class="flex items-center gap-[10px]">
|
<div class="flex items-center gap-[10px]">
|
||||||
<ElCheckbox v-model="mainStore.config.devName">自定义网卡名</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.devName">自定义虚拟网卡名称</ElCheckbox>
|
||||||
<ElInput
|
<ElInput
|
||||||
size="small"
|
size="small"
|
||||||
maxlength="10"
|
maxlength="10"
|
||||||
v-model="mainStore.config.devNameValue"
|
v-model="mainStore.config.devNameValue"
|
||||||
placeholder="请输入网卡名"
|
placeholder="请输入虚拟网卡名称"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-[10px]">
|
<div class="flex items-center gap-[10px]">
|
||||||
<ElCheckbox v-model="mainStore.config.enableNetCardMetric">自定义easytier网卡跃点</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.enableNetCardMetric">自定义虚拟网卡优先级</ElCheckbox>
|
||||||
<ElInputNumber
|
<ElInputNumber
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:min="1"
|
:min="1"
|
||||||
@@ -166,9 +167,9 @@
|
|||||||
:precision="0"
|
:precision="0"
|
||||||
size="small"
|
size="small"
|
||||||
v-model="mainStore.config.netCardMetricValue"
|
v-model="mainStore.config.netCardMetricValue"
|
||||||
placeholder="请选择跃点数"
|
placeholder="请输入优先级"
|
||||||
/>
|
/>
|
||||||
<ElTooltip content="设置easytier网卡的跃点,提升网卡优先级,跃点越小,网卡优先级越高">
|
<ElTooltip content="数值越小,优先级越高">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
@@ -177,17 +178,59 @@
|
|||||||
size="small"
|
size="small"
|
||||||
type="warning"
|
type="warning"
|
||||||
>
|
>
|
||||||
(不使用自定义网卡名,那么联机时默认会生成一个名为 "et_xxx" 的网卡,也可以使用 “设置跃点” 功能,除非你启用了下面的功能)
|
(不使用自定义虚拟网卡名称,那么联机时默认会生成一个名为 "et_xxx" 的网卡,也可以使用 “自定义虚拟网卡优先级”
|
||||||
|
功能,除非你启用了下面的功能)
|
||||||
</ElText>
|
</ElText>
|
||||||
</div>
|
</div>
|
||||||
<div><ElCheckbox v-model="mainStore.config.noTun">不创建TUN设备(网卡),可以使用子网代理访问节点</ElCheckbox></div>
|
|
||||||
|
<div class="flex items-center gap-[5px]">
|
||||||
|
<ElCheckbox v-model="mainStore.config.noTun">不创建TUN虚拟网卡</ElCheckbox>
|
||||||
|
|
||||||
|
<ElTooltip content="开启后该节点无法主动访问其他节点">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-[5px]">
|
||||||
|
<div><ElCheckbox v-model="mainStore.config.bindDeviceEnable">绑定物理网卡</ElCheckbox></div>
|
||||||
|
<!-- <div class="flex items-center gap-[5px]"> -->
|
||||||
|
<!-- <ElSelect
|
||||||
|
placeholder="选择设备"
|
||||||
|
v-model="mainStore.config.bindDevice"
|
||||||
|
filterable
|
||||||
|
no-data-text="暂无网卡设备数据,请刷新"
|
||||||
|
>
|
||||||
|
<ElOption
|
||||||
|
v-for="guid in guids"
|
||||||
|
:key="guid[0]"
|
||||||
|
:label="guid[1]"
|
||||||
|
:value="guid[0]"
|
||||||
|
></ElOption>
|
||||||
|
</ElSelect> -->
|
||||||
|
<!-- <ElButton @click="getGuids">刷新</ElButton> -->
|
||||||
|
<ElTooltip content="将连接器的套接字绑定到物理设备以避免路由问题。比如子网代理网段与某节点的网段冲突,绑定物理设备后可以与该节点正常通信">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
<!-- </div> -->
|
||||||
|
<CoreVersionWarning version="2.2.3" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<ElDivider />
|
<ElDivider />
|
||||||
<div><ElCheckbox v-model="mainStore.config.enablExitNode">允许此节点成为出口节点</ElCheckbox></div>
|
<div><ElCheckbox v-model="mainStore.config.enablExitNode">允许此节点成为出口节点</ElCheckbox></div>
|
||||||
<div><ElCheckbox v-model="mainStore.config.disableEncryption">禁用对等节点通信的加密</ElCheckbox></div>
|
<div class="flex items-center gap-[5px]">
|
||||||
<div><ElCheckbox v-model="mainStore.config.multiThread">启用多线程运行</ElCheckbox></div>
|
<ElCheckbox v-model="mainStore.config.disableEncryption">关闭信息加密</ElCheckbox>
|
||||||
|
<ElTooltip content="关闭后通信数据将在互联网上明文传输,如房间名和密码">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-[5px]">
|
||||||
|
<ElCheckbox v-model="mainStore.config.multiThread">开启多线程</ElCheckbox>
|
||||||
|
<ElTooltip content="开启后可能会提高网络性能">
|
||||||
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
|
</ElTooltip>
|
||||||
|
</div>
|
||||||
<div class="flex items-center gap-[10px]">
|
<div class="flex items-center gap-[10px]">
|
||||||
<ElText>压缩算法</ElText>
|
<ElText>传输数据压缩算法</ElText>
|
||||||
<div class="w-[160px]">
|
<div class="w-[160px]">
|
||||||
<ElSelect
|
<ElSelect
|
||||||
size="small"
|
size="small"
|
||||||
@@ -210,8 +253,8 @@
|
|||||||
<ElDivider />
|
<ElDivider />
|
||||||
|
|
||||||
<div class="flex items-center gap-[10px]">
|
<div class="flex items-center gap-[10px]">
|
||||||
<ElCheckbox v-model="mainStore.config.useSmoltcp">为子网代理启用smoltcp堆栈</ElCheckbox>
|
<ElCheckbox v-model="mainStore.config.useSmoltcp">为子网代理和 KCP 代理开启用户网络栈</ElCheckbox>
|
||||||
<ElTooltip content="使用用户态TCP/IP协议栈smoltcp,避免操作系统防火墙问题导致无法子网代理">
|
<ElTooltip content="开启后会降低网络性能,但不需要配置防火墙">
|
||||||
<ElIcon><QuestionFilled /></ElIcon>
|
<ElIcon><QuestionFilled /></ElIcon>
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
@@ -269,6 +312,20 @@
|
|||||||
listenerDialogData.visible = false;
|
listenerDialogData.visible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// const handleCustomListenerV6Change = async (value: boolean) => {
|
||||||
|
// if (value) {
|
||||||
|
// const [error, _] = await ElConfirmDanger("内核版本2.2.3之后,ipv6监听被移除并合并到'自定义监听',请谨慎使用", "警告", {
|
||||||
|
// confirmButtonText: "继续使用",
|
||||||
|
// cancelButtonText: "取消"
|
||||||
|
// });
|
||||||
|
// if (!error) {
|
||||||
|
// mainStore.config.enableCustomListenerV6 = value;
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// mainStore.config.enableCustomListenerV6 = value;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
const data = ["trace", "debug", "info", "warn", "error", "off"];
|
const data = ["trace", "debug", "info", "warn", "error", "off"];
|
||||||
const guids = ref<string[][]>([]);
|
const guids = ref<string[][]>([]);
|
||||||
@@ -297,7 +354,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 为bind_device功能增加改方法
|
// 为bind_device功能增加改方法
|
||||||
const _getGuids = async () => {
|
const getGuids = async () => {
|
||||||
const guidsValue = await invoke<string[][]>("get_network_adapter_guids");
|
const guidsValue = await invoke<string[][]>("get_network_adapter_guids");
|
||||||
guids.value = guidsValue && guidsValue.length > 0 ? guidsValue : [];
|
guids.value = guidsValue && guidsValue.length > 0 ? guidsValue : [];
|
||||||
};
|
};
|
||||||
|
|||||||
+13
-9
@@ -1,12 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex h-full flex-col gap-[10px]">
|
<div class="flex h-full flex-col gap-[10px]">
|
||||||
<ElRadioGroup
|
<div class="flex items-center gap-[10px]">
|
||||||
:disabled="!data.isSwitchEnable"
|
<ElRadioGroup
|
||||||
v-model="mainStore.cidrEnable"
|
:disabled="!data.isSwitchEnable"
|
||||||
>
|
v-model="mainStore.cidrEnable"
|
||||||
<ElRadioButton :value="true">开启</ElRadioButton>
|
>
|
||||||
<ElRadioButton :value="false">关闭</ElRadioButton>
|
<ElRadioButton :value="true">开启</ElRadioButton>
|
||||||
</ElRadioGroup>
|
<ElRadioButton :value="false">关闭</ElRadioButton>
|
||||||
|
</ElRadioGroup>
|
||||||
|
<div class="flex items-center gap-[10px]">
|
||||||
|
<ElCheckbox v-model="mainStore.proxyForwardBySystem">通过系统内核转发子网代理数据包,禁用内置NAT</ElCheckbox>
|
||||||
|
<CoreVersionWarning version="2.2.3" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="flex-1 overflow-auto">
|
<div class="flex-1 overflow-auto">
|
||||||
<ElInput
|
<ElInput
|
||||||
placeholder="例如: 192.168.1.0/24 一行一个"
|
placeholder="例如: 192.168.1.0/24 一行一个"
|
||||||
@@ -113,6 +119,4 @@
|
|||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
unlistenStart && unlistenStart();
|
unlistenStart && unlistenStart();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+44
-10
@@ -252,6 +252,10 @@
|
|||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
</ElForm>
|
</ElForm>
|
||||||
|
<!-- <div class="flex justify-center items-center gap-[5px]">
|
||||||
|
<el-button>分享当前配置</el-button>
|
||||||
|
<el-button>导入联机配置</el-button>
|
||||||
|
</div> -->
|
||||||
<div class="mt-auto flex items-start">
|
<div class="mt-auto flex items-start">
|
||||||
<div>
|
<div>
|
||||||
<div class="pt-[4px]">
|
<div class="pt-[4px]">
|
||||||
@@ -330,7 +334,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-[10px] pl-[2px]">
|
<div class="mt-[10px] pl-[2px]">
|
||||||
<ElTooltip
|
<ElTooltip
|
||||||
placement="left"
|
placement="top"
|
||||||
content="日志"
|
content="日志"
|
||||||
>
|
>
|
||||||
<ElButton
|
<ElButton
|
||||||
@@ -407,7 +411,7 @@
|
|||||||
|
|
||||||
<ElBadge
|
<ElBadge
|
||||||
badge-class="!text-[9px] cursor-pointer"
|
badge-class="!text-[9px] cursor-pointer"
|
||||||
:hidden="!data.hasNewVersion"
|
:hidden="!hasNewVersion"
|
||||||
:offset="[6, 7]"
|
:offset="[6, 7]"
|
||||||
value="N"
|
value="N"
|
||||||
>
|
>
|
||||||
@@ -711,7 +715,7 @@
|
|||||||
SwitchFilled
|
SwitchFilled
|
||||||
} from "@element-plus/icons-vue";
|
} from "@element-plus/icons-vue";
|
||||||
import { reactive, onBeforeUnmount, onMounted, ref, toRaw, computed } from "vue";
|
import { reactive, onBeforeUnmount, onMounted, ref, toRaw, computed } from "vue";
|
||||||
import { useTray, setTrayRunState, setTrayTooltip, checkNewVersion } from "~/composables/tray";
|
import { useTray, setTrayRunState, setTrayTooltip, checkNewVersion, hasNewVersion } 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";
|
||||||
import useMainStore from "@/stores/index";
|
import useMainStore from "@/stores/index";
|
||||||
@@ -750,7 +754,7 @@
|
|||||||
// console.error(config);
|
// console.error(config);
|
||||||
const protocols = supportProtocols();
|
const protocols = supportProtocols();
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
hasNewVersion: false, //easytierGame有没有新版
|
//easytierGame有没有新版
|
||||||
logVisible: false,
|
logVisible: false,
|
||||||
cidrVisible: false,
|
cidrVisible: false,
|
||||||
advanceVisible: false,
|
advanceVisible: false,
|
||||||
@@ -1116,6 +1120,26 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const compatibleIpv6Listener = async () => {
|
||||||
|
// ipv6监听在后续版本合并到customListenner里了,这里做兼容处理
|
||||||
|
if (config.enableCustomListenerV6 && config.customListenerV6Data) {
|
||||||
|
const customListener = config.customListenerV6Data.trim();
|
||||||
|
if (customListener) {
|
||||||
|
const customListenerV4 = config.customListenerData
|
||||||
|
.trim()
|
||||||
|
.split("\n")
|
||||||
|
.map(el => el.trim())
|
||||||
|
.filter(el => el);
|
||||||
|
if (!customListenerV4.includes(customListener)) {
|
||||||
|
config.customListenerData += `\n${customListener}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (config.enableCustomListenerV6) {
|
||||||
|
config.enableCustomListenerV6 = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const initConnectAfterStart = async () => {
|
const initConnectAfterStart = async () => {
|
||||||
if (config.connectAfterStart && data.coreVersion) {
|
if (config.connectAfterStart && data.coreVersion) {
|
||||||
await reset();
|
await reset();
|
||||||
@@ -1132,10 +1156,12 @@
|
|||||||
try {
|
try {
|
||||||
const decoder = new TextDecoder("utf-8");
|
const decoder = new TextDecoder("utf-8");
|
||||||
const guiJsonStr = decoder.decode(guiJsonStrUint8);
|
const guiJsonStr = decoder.decode(guiJsonStrUint8);
|
||||||
const regex = /^(\s*\/\/.*)/gm;
|
// console.log(guiJsonStr);
|
||||||
const regex2 = /(,?)\s*\/\/.*(?=\n|$|\r\n)/gm;
|
// const regex = /^(\s*\/\/.*)/gm;
|
||||||
const resultStr = guiJsonStr.replace(regex, "").replace(regex2, "$1");
|
// const regex2 = /(,?)\s*\/\/.*(?=\n|$|\r\n)/gm;
|
||||||
const guiJson = JSON.parse(resultStr);
|
// const resultStr = guiJsonStr.replace(regex, "").replace(regex2, "$1");
|
||||||
|
// console.log(resultStr);
|
||||||
|
const guiJson = JSON.parse(guiJsonStr);
|
||||||
let saveServerUrl = "";
|
let saveServerUrl = "";
|
||||||
if (guiJson.serverUrl) {
|
if (guiJson.serverUrl) {
|
||||||
if (Array.isArray(guiJson.serverUrl)) {
|
if (Array.isArray(guiJson.serverUrl)) {
|
||||||
@@ -1153,6 +1179,7 @@
|
|||||||
config: {
|
config: {
|
||||||
...mainStore.config,
|
...mainStore.config,
|
||||||
...guiJson,
|
...guiJson,
|
||||||
|
customListenerData: guiJson?.customListenerData.join("\n") || "",
|
||||||
serverUrl: saveServerUrl
|
serverUrl: saveServerUrl
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1210,6 +1237,7 @@
|
|||||||
await compatibleInitAutoStart();
|
await compatibleInitAutoStart();
|
||||||
// await initAutoStart();
|
// await initAutoStart();
|
||||||
await initStartWinIpBroadcast();
|
await initStartWinIpBroadcast();
|
||||||
|
await compatibleIpv6Listener();
|
||||||
await getCoreVersion();
|
await getCoreVersion();
|
||||||
await listenObj.listenThreadId();
|
await listenObj.listenThreadId();
|
||||||
await listenObj.listenServerThreadId();
|
await listenObj.listenServerThreadId();
|
||||||
@@ -1220,7 +1248,6 @@
|
|||||||
initPreventSleep();
|
initPreventSleep();
|
||||||
mountedShow(); // 不需要await
|
mountedShow(); // 不需要await
|
||||||
closePrevent();
|
closePrevent();
|
||||||
data.hasNewVersion = await checkNewVersion();
|
|
||||||
dataSubscribe(async () => {
|
dataSubscribe(async () => {
|
||||||
if (mainStore.createConfigInEasytier) {
|
if (mainStore.createConfigInEasytier) {
|
||||||
b(async () => {
|
b(async () => {
|
||||||
@@ -1229,6 +1256,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
getReleaseList();
|
getReleaseList();
|
||||||
|
checkNewVersion();
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -1372,6 +1400,12 @@
|
|||||||
if (config.disableKcpInput) {
|
if (config.disableKcpInput) {
|
||||||
args.push("--disable-kcp-input");
|
args.push("--disable-kcp-input");
|
||||||
}
|
}
|
||||||
|
if (config.bindDeviceEnable) {
|
||||||
|
args.push("--bind-device", "true");
|
||||||
|
}
|
||||||
|
if (mainStore.proxyForwardBySystem) {
|
||||||
|
args.push("--proxy-forward-by-system");
|
||||||
|
}
|
||||||
return args;
|
return args;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1793,7 +1827,7 @@
|
|||||||
cidrTimer && clearInterval(cidrTimer);
|
cidrTimer && clearInterval(cidrTimer);
|
||||||
cidrTimer = setInterval(() => {
|
cidrTimer = setInterval(() => {
|
||||||
appWindow.emitTo({ kind: "WebviewWindow", label: "cidr" }, "route", data.isStart);
|
appWindow.emitTo({ kind: "WebviewWindow", label: "cidr" }, "route", data.isStart);
|
||||||
}, 1000);
|
}, 650);
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
cidrTimer && clearInterval(cidrTimer);
|
cidrTimer && clearInterval(cidrTimer);
|
||||||
|
|||||||
+6
-1
@@ -54,7 +54,11 @@
|
|||||||
prop="lat_ms"
|
prop="lat_ms"
|
||||||
width="100"
|
width="100"
|
||||||
label="延迟/ms"
|
label="延迟/ms"
|
||||||
></ElTableColumn>
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.lat_ms && !isNaN(Number(row.lat_ms)) ? Number(row.lat_ms).toFixed(0) : row.lat_ms || "-" }}
|
||||||
|
</template>
|
||||||
|
</ElTableColumn>
|
||||||
<ElTableColumn
|
<ElTableColumn
|
||||||
sortable
|
sortable
|
||||||
width="100"
|
width="100"
|
||||||
@@ -108,6 +112,7 @@
|
|||||||
import { ATJ, parseCliInfo } from "@/utils";
|
import { ATJ, parseCliInfo } from "@/utils";
|
||||||
import { ElConfirmDanger } from "~/utils/element";
|
import { ElConfirmDanger } from "~/utils/element";
|
||||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||||
|
import { isNaN } from "lodash-es";
|
||||||
// enum NatType {
|
// enum NatType {
|
||||||
// // has NAT; but own a single public IP, port is not changed
|
// // has NAT; but own a single public IP, port is not changed
|
||||||
// Unknown = 0;
|
// Unknown = 0;
|
||||||
|
|||||||
+26
-14
@@ -25,7 +25,7 @@
|
|||||||
<ElLink
|
<ElLink
|
||||||
class="mr-[10px] !text-[15px]"
|
class="mr-[10px] !text-[15px]"
|
||||||
type="info"
|
type="info"
|
||||||
:underline="false"
|
underline="never"
|
||||||
@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
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<ElLink
|
<ElLink
|
||||||
class="!text-[15px]"
|
class="!text-[15px]"
|
||||||
type="info"
|
type="info"
|
||||||
:underline="false"
|
underline="never"
|
||||||
@click="open('https://r1ch.net/projects/forcebindip')"
|
@click="open('https://r1ch.net/projects/forcebindip')"
|
||||||
>
|
>
|
||||||
ForceBindIP
|
ForceBindIP
|
||||||
@@ -198,16 +198,10 @@
|
|||||||
<ElButton
|
<ElButton
|
||||||
type="warning"
|
type="warning"
|
||||||
size="small"
|
size="small"
|
||||||
|
@click.stop="handleCloseAllFireWall"
|
||||||
>
|
>
|
||||||
一键关闭防火墙
|
一键关闭防火墙
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton
|
|
||||||
@click="handleCustomFireWall"
|
|
||||||
type="danger"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
自定义防火墙策略
|
|
||||||
</ElButton>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-[10px]">
|
<div class="mb-[10px]">
|
||||||
<ElText class="!mx-[10px]">域防火墙</ElText>
|
<ElText class="!mx-[10px]">域防火墙</ElText>
|
||||||
@@ -251,10 +245,17 @@
|
|||||||
<ElButton
|
<ElButton
|
||||||
size="small"
|
size="small"
|
||||||
:disabled="data.isPing"
|
:disabled="data.isPing"
|
||||||
@click="handleTestPing"
|
@click="handleTestPing('v4')"
|
||||||
>
|
>
|
||||||
Ping一下
|
Ping一下
|
||||||
</ElButton>
|
</ElButton>
|
||||||
|
<!-- <ElButton
|
||||||
|
size="small"
|
||||||
|
:disabled="data.isPing"
|
||||||
|
@click="handleTestPing('v6')"
|
||||||
|
>
|
||||||
|
Ping一下(v6)
|
||||||
|
</ElButton> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[5px] flex-1 overflow-auto">
|
<div class="mt-[5px] flex-1 overflow-auto">
|
||||||
<ElInput
|
<ElInput
|
||||||
@@ -305,8 +306,18 @@
|
|||||||
forceBindStart: false
|
forceBindStart: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleCustomFireWall = async () => {
|
|
||||||
await open("wf.msc");
|
const handleCloseAllFireWall = async () => {
|
||||||
|
try {
|
||||||
|
const output = await Command.create("netsh", ["advfirewall", "set", "allprofiles", "state", "off"], {
|
||||||
|
encoding: "gb2312"
|
||||||
|
}).execute();
|
||||||
|
ElMessage.success("关闭成功");
|
||||||
|
await initFirewall();
|
||||||
|
} catch (err) {
|
||||||
|
ElMessage.error(`关闭失败${err}`);
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleTabsChange = async (tabPaneName: TabPaneName) => {
|
const handleTabsChange = async (tabPaneName: TabPaneName) => {
|
||||||
@@ -341,14 +352,15 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleTestPing = async () => {
|
const handleTestPing = async (type: 'v4' | 'v6' = 'v4') => {
|
||||||
// const is = isValidIP(data.pingIp);
|
// const is = isValidIP(data.pingIp);
|
||||||
if (data.pingIp) {
|
if (data.pingIp) {
|
||||||
data.pingLog = "";
|
data.pingLog = "";
|
||||||
data.isPing = true;
|
data.isPing = true;
|
||||||
|
const args = type === 'v4' ? ["-n", "1", data.pingIp] : ["-6", '-n', "1", data.pingIp]
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < data.pingNum; i++) {
|
for (let i = 0; i < data.pingNum; i++) {
|
||||||
const output = await Command.create("ping", ["-n", "1", data.pingIp], {
|
const output = await Command.create("ping", args, {
|
||||||
encoding: "gb2312"
|
encoding: "gb2312"
|
||||||
}).execute();
|
}).execute();
|
||||||
if (output.stdout) {
|
if (output.stdout) {
|
||||||
|
|||||||
Generated
+3423
-1829
File diff suppressed because it is too large
Load Diff
Generated
+596
-430
File diff suppressed because it is too large
Load Diff
+18
-16
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "easytier-game"
|
name = "easytier-game"
|
||||||
version = "1.4.1"
|
version = "1.4.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"
|
||||||
@@ -18,32 +18,34 @@ name = "app_lib"
|
|||||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2.0.5", features = [] }
|
tauri-build = { version = "2.2.0", features = [] }
|
||||||
# prost-build = "0.13.2"
|
# prost-build = "0.13.2"
|
||||||
|
|
||||||
|
[target.x86_64-pc-windows-msvc.build-dependencies]
|
||||||
|
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] } # 需要安装curl和7zip,并添加他们的路径到环境变量
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0.137"
|
serde_json = "1.0.137"
|
||||||
serde = { version = "1.0.217", features = ["derive"] }
|
serde = { version = "1.0.217", features = ["derive"] }
|
||||||
log = "0.4.25"
|
log = "0.4.26"
|
||||||
tauri = { version = "2.2.5", features = [ "protocol-asset",
|
tauri = { version = "2.5.0", features = [ "protocol-asset",
|
||||||
"tray-icon",
|
"tray-icon",
|
||||||
"image-png",
|
"image-png",
|
||||||
"image-ico",
|
"image-ico"
|
||||||
"devtools"
|
|
||||||
] }
|
] }
|
||||||
|
|
||||||
tauri-plugin-log = "2.2.1"
|
tauri-plugin-log = "2.3.1"
|
||||||
tauri-plugin-shell = "2.2.0"
|
tauri-plugin-shell = "2.2.1"
|
||||||
reqwest = { version = "0.12.12", features = ["json"] }
|
reqwest = { version = "0.12.12", features = ["json"] }
|
||||||
zip = "2.2.2"
|
zip = "2.2.3"
|
||||||
sysinfo = '0.33.1'
|
sysinfo = '0.33.1'
|
||||||
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.2.0"
|
tauri-plugin-fs = "2.2.1"
|
||||||
tauri-plugin-clipboard-manager = "2.2.1"
|
tauri-plugin-clipboard-manager = "2.2.2"
|
||||||
rand = "0.8.5"
|
rand = "0.9.0"
|
||||||
tokio = { version = "1.43.0", features = ["process"] }
|
tokio = { version = "1.43.0", features = ["process"] }
|
||||||
tauri-plugin-dialog = "2.2.0"
|
tauri-plugin-dialog = "2.2.1"
|
||||||
# prost = "0.13"
|
# prost = "0.13"
|
||||||
# prost-types = "0.13"
|
# prost-types = "0.13"
|
||||||
hashbrown = "0.15.2"
|
hashbrown = "0.15.2"
|
||||||
@@ -51,9 +53,9 @@ hashbrown = "0.15.2"
|
|||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.58.0"
|
version = "0.58.0"
|
||||||
features = ["Win32_System_TaskScheduler", "Win32_System_Power", "Win32_NetworkManagement_IpHelper", "Win32_NetworkManagement_Ndis", "Win32_Networking_WinSock"]
|
features = ["Win32_System_TaskScheduler", "Win32_System_Com", "Win32_System_Power", "Win32_NetworkManagement_IpHelper", "Win32_NetworkManagement_Ndis", "Win32_Networking_WinSock"]
|
||||||
|
|
||||||
[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.2.0"
|
tauri-plugin-cli = "2.2.0"
|
||||||
tauri-plugin-single-instance = "2.2.1"
|
tauri-plugin-single-instance = "2.2.3"
|
||||||
tauri-plugin-window-state = "2.2.1"
|
tauri-plugin-window-state = "2.2.2"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
|
thunk::thunk();
|
||||||
let mut windows = tauri_build::WindowsAttributes::new();
|
let mut windows = tauri_build::WindowsAttributes::new();
|
||||||
windows = windows.app_manifest(
|
windows = windows.app_manifest(
|
||||||
r#"
|
r#"
|
||||||
|
|||||||
@@ -4,27 +4,37 @@
|
|||||||
"tcp",
|
"tcp",
|
||||||
"udp"
|
"udp"
|
||||||
], // 协议类型
|
], // 协议类型
|
||||||
|
|
||||||
// easytier服务地址 - 可填写多个 方式1,逗号分隔,"xxxx.cn,yyyy.com" 方式2,数组 ["xxxx.cn","yyyy.com"] (默认选中第一个)
|
// easytier服务地址 - 可填写多个 方式1,逗号分隔,"xxxx.cn,yyyy.com" 方式2,数组 ["xxxx.cn","yyyy.com"] (默认选中第一个)
|
||||||
"serverUrl": "public.easytier.top:11010",
|
"serverUrl": "public.easytier.top:11010",
|
||||||
"networkName": "", // 网络名
|
"enableCustomListener": true,
|
||||||
"networkPassword": "", // 网络密码
|
"customListenerData": [
|
||||||
"hostname": "configTest", // 主机名
|
"tcp://0.0.0.0:11010",
|
||||||
"ipv4": "10.126.126.1", // IP地址(选填,下面有dhcp)
|
"udp://0.0.0.0:11010",
|
||||||
"disableIpv6": false, // 禁用ipv6
|
"tcp://[::]:11010"
|
||||||
"disbleListenner": true, // 禁用端口监听
|
],
|
||||||
|
"networkName": "", //房间名
|
||||||
|
"networkPassword": "", //房间密码
|
||||||
|
"hostname": "", //主机名
|
||||||
|
"ipv4": "", // 虚拟IP地址
|
||||||
|
"disableIpv6": false, // 禁用ipv6
|
||||||
|
"enableCustomListenerV6": true, // 启用ipv6监听
|
||||||
|
"customListenerV6Data": "udp://[::]:11010", // ipv6监听地址
|
||||||
|
"disbleListenner": false, // 禁用监听
|
||||||
"disableEncryption": false, // 禁用加密
|
"disableEncryption": false, // 禁用加密
|
||||||
|
"enablExitNode": false, // 启用出口节点
|
||||||
"noTun": false, // 禁用tun
|
"noTun": false, // 禁用tun
|
||||||
"latencyfirst": false, // 延迟优先
|
"latencyfirst": false, // 延迟优先
|
||||||
"disableUdpHolePunching": false, // 禁用udp打洞
|
"disableUdpHolePunching": false, // 禁用udp打洞
|
||||||
"disbleP2p": false, // 禁用p2p, 强制中转
|
"disbleP2p": false, // 禁用p2p 强制中转
|
||||||
"dhcp": false, // 动态分配IP
|
"dhcp": true, // 启用dhcp,动态获取IP
|
||||||
"devName": false, // 是否启用自定义网卡名
|
"devName": true, // 启用自定义网卡名
|
||||||
"devNameValue": "", // 网卡名(启用devName之后才生效)
|
"devNameValue": "etgame", // 自定义网卡名
|
||||||
"enableCustonProtocol": false, // 是否启用自定义协议
|
"enableCustomProtocol": true, // 自定义p2p时默认协议
|
||||||
"customProtocol": "tcp", // 自定义协议类型
|
"customProtocol": "tcp", // 自定义p2p时使用的协议类型
|
||||||
"enableNetCardMetric": false, // 自定义easytier每次生成的网卡跃点
|
"enableNetCardMetric": true, // 启用自定义网卡跃点
|
||||||
"netCardMetricValue": 1, // 网卡跃点数量(1-9999)
|
"netCardMetricValue": 1, // 网卡跃点
|
||||||
"enableKcpProxy": false, // 启用kcp代理
|
"enablePreventSleep": false, // 启用防止睡眠
|
||||||
"disableKcpInput": false //禁用kcp输入
|
"compression": "none", // 压缩算法
|
||||||
|
"enableKcpProxy": true, // 启用kcp代理
|
||||||
|
"disableKcpInput": false // 禁用kcp输入
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -92,13 +92,13 @@ fn generate_random_user_agent() -> String {
|
|||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:{version}) Gecko/20100101 Firefox/{version}",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:{version}) Gecko/20100101 Firefox/{version}",
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::rng();
|
||||||
let template = user_agents[rng.gen_range(0..user_agents.len())];
|
let template = user_agents[rng.random_range(0..user_agents.len())];
|
||||||
|
|
||||||
// 生成随机版本号
|
// 生成随机版本号
|
||||||
let version_major: u8 = rng.gen_range(70..90);
|
let version_major: u8 = rng.random_range(70..90);
|
||||||
let version_minor: u8 = rng.gen_range(0..10);
|
let version_minor: u8 = rng.random_range(0..10);
|
||||||
let version_patch: u8 = rng.gen_range(0..10);
|
let version_patch: u8 = rng.random_range(0..10);
|
||||||
let version = format!("{}.{}.{}", version_major, version_minor, version_patch);
|
let version = format!("{}.{}.{}", version_major, version_minor, version_patch);
|
||||||
|
|
||||||
// 替换模板中的版本号占位符
|
// 替换模板中的版本号占位符
|
||||||
|
|||||||
@@ -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.4.1",
|
"version": "1.4.4",
|
||||||
"identifier": "com.tauri.easytier-game",
|
"identifier": "com.tauri.easytier-game",
|
||||||
|
|
||||||
"build": {
|
"build": {
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"title": "easytier-game 1.4.1",
|
"title": "easytier-game 1.4.4",
|
||||||
"label": "main",
|
"label": "main",
|
||||||
"minWidth": 340,
|
"minWidth": 340,
|
||||||
"width": 340,
|
"width": 340,
|
||||||
|
|||||||
+13
-6
@@ -15,8 +15,8 @@ const store = defineStore("main", {
|
|||||||
disableIpv6: false, // 是否禁用IPv6
|
disableIpv6: false, // 是否禁用IPv6
|
||||||
port: "11010", // 监听端口号
|
port: "11010", // 监听端口号
|
||||||
enableCustomListener: true, // 是否自定义监听
|
enableCustomListener: true, // 是否自定义监听
|
||||||
customListenerV6Data: "udp://[::]:11010", //自定义ipv6监听
|
enableCustomListenerV6: true, // 是否自定义IPV6监听
|
||||||
enableCustomListenerV6: true, // 是否自定义监听
|
customListenerV6Data: "udp://[::]:11010", //自定义ipv6监
|
||||||
customListenerData: "tcp://0.0.0.0:11010\nudp://0.0.0.0:11010\ntcp://[::]:11010", // 自定义监听地址
|
customListenerData: "tcp://0.0.0.0:11010\nudp://0.0.0.0:11010\ntcp://[::]:11010", // 自定义监听地址
|
||||||
disbleListenner: false, // 是否禁用监听
|
disbleListenner: false, // 是否禁用监听
|
||||||
disableEncryption: false, // 是否禁用加密
|
disableEncryption: false, // 是否禁用加密
|
||||||
@@ -41,6 +41,7 @@ const store = defineStore("main", {
|
|||||||
compression: "none", //加密算法
|
compression: "none", //加密算法
|
||||||
enableKcpProxy: true, //启用kcp代理 默认开启
|
enableKcpProxy: true, //启用kcp代理 默认开启
|
||||||
disableKcpInput: false, //禁用kcp输入
|
disableKcpInput: false, //禁用kcp输入
|
||||||
|
bindDeviceEnable: false, //是否绑定设备
|
||||||
},
|
},
|
||||||
serverConfig: {
|
serverConfig: {
|
||||||
enableWhiteList: true, // 是否启用白名单
|
enableWhiteList: true, // 是否启用白名单
|
||||||
@@ -51,7 +52,8 @@ const store = defineStore("main", {
|
|||||||
port: "11010" // 服务器端口
|
port: "11010" // 服务器端口
|
||||||
},
|
},
|
||||||
cidrEnable: false,
|
cidrEnable: false,
|
||||||
basePeers: ["public.easytier.top:11010","public.easytier.net:11010"],
|
proxyForwardBySystem: false, // 是否通过系统内核转发子网代理数据包,禁用内置NAT
|
||||||
|
basePeers: ["public.easytier.top:11010", "public.easytier.net:11010"],
|
||||||
theme: false, //主题 false light true dark
|
theme: false, //主题 false light true dark
|
||||||
configStartEnable: false, //使用配置文件启动
|
configStartEnable: false, //使用配置文件启动
|
||||||
configPath: "", //配置文件路径
|
configPath: "", //配置文件路径
|
||||||
@@ -67,8 +69,9 @@ const store = defineStore("main", {
|
|||||||
|
|
||||||
winipBcPid: 0,
|
winipBcPid: 0,
|
||||||
winipBcStart: false,
|
winipBcStart: false,
|
||||||
|
latestTagName: "",
|
||||||
|
|
||||||
gameList: [] as Array<{name: string, exePath: string, id: string, coverImg?: string; showImg: string}>, // 游戏列表
|
gameList: [] as Array<{ name: string; exePath: string; id: string; coverImg?: string; showImg: string }> // 游戏列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
persist: {
|
persist: {
|
||||||
@@ -101,7 +104,7 @@ const store = defineStore("main", {
|
|||||||
"config.enableNetCardMetric",
|
"config.enableNetCardMetric",
|
||||||
"config.netCardMetricValue",
|
"config.netCardMetricValue",
|
||||||
"config.port",
|
"config.port",
|
||||||
|
|
||||||
"config.disbleListenner",
|
"config.disbleListenner",
|
||||||
"config.enableCustomListener",
|
"config.enableCustomListener",
|
||||||
"config.customListenerData",
|
"config.customListenerData",
|
||||||
@@ -116,6 +119,8 @@ const store = defineStore("main", {
|
|||||||
"config.enableKcpProxy",
|
"config.enableKcpProxy",
|
||||||
"config.disableKcpInput",
|
"config.disableKcpInput",
|
||||||
|
|
||||||
|
"config.bindDeviceEnable",
|
||||||
|
|
||||||
"serverConfig.autoStart",
|
"serverConfig.autoStart",
|
||||||
// 'serverConfig.enableListener',
|
// 'serverConfig.enableListener',
|
||||||
"serverConfig.enableWhiteList",
|
"serverConfig.enableWhiteList",
|
||||||
@@ -124,6 +129,7 @@ const store = defineStore("main", {
|
|||||||
"serverConfig.port",
|
"serverConfig.port",
|
||||||
|
|
||||||
"cidrEnable",
|
"cidrEnable",
|
||||||
|
"proxyForwardBySystem",
|
||||||
"basePeers",
|
"basePeers",
|
||||||
"theme",
|
"theme",
|
||||||
"configStartEnable",
|
"configStartEnable",
|
||||||
@@ -136,7 +142,8 @@ const store = defineStore("main", {
|
|||||||
"delayInjectDll",
|
"delayInjectDll",
|
||||||
"forceBindInput",
|
"forceBindInput",
|
||||||
"forceBindFile",
|
"forceBindFile",
|
||||||
|
"latestTagName",
|
||||||
|
|
||||||
"gameList"
|
"gameList"
|
||||||
]
|
]
|
||||||
// // 除了这些,其他都要存下来
|
// // 除了这些,其他都要存下来
|
||||||
|
|||||||
Reference in New Issue
Block a user