From 9898bd5548d6f8e7749e274138b258ee4cfe7cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Sat, 20 Jan 2024 11:24:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:sparkles:=20=E5=A2=9E=E5=8A=A0=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/api/frpc.ts | 5 +++- electron/storage/config.ts | 2 ++ src/views/config/index.vue | 57 +++++++++++++++++++++++++++++--------- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/electron/api/frpc.ts b/electron/api/frpc.ts index 09cbbda..a3fe7cb 100644 --- a/electron/api/frpc.ts +++ b/electron/api/frpc.ts @@ -78,6 +78,9 @@ transport.tls.keyFile = "${config.tlsConfigKeyFile}" transport.tls.trustedCaFile = "${config.tlsConfigTrustedCaFile}" transport.tls.serverName = "${config.tlsConfigServerName}" ` : ""} +${config.proxyConfigEnable ? ` +transport.proxyURL = "${config.proxyConfigProxyUrl}" +` : ""} ${proxyToml.join("")} @@ -161,7 +164,7 @@ export const reloadFrpcProcess = () => { /** * 停止frpc子进程 */ -export const stopFrpcProcess = (callback?:() => void) => { +export const stopFrpcProcess = (callback?: () => void) => { if (frpcProcess) { treeKill(frpcProcess.pid, (error: Error) => { if (error) { diff --git a/electron/storage/config.ts b/electron/storage/config.ts index 9e486d0..de91af5 100644 --- a/electron/storage/config.ts +++ b/electron/storage/config.ts @@ -20,6 +20,8 @@ export type Config = { tlsConfigKeyFile: string; tlsConfigTrustedCaFile: string; tlsConfigServerName: string; + proxyConfigEnable: boolean; + proxyConfigProxyUrl: string; }; /** diff --git a/src/views/config/index.vue b/src/views/config/index.vue index 10efac1..531b89d 100644 --- a/src/views/config/index.vue +++ b/src/views/config/index.vue @@ -24,7 +24,8 @@ type Config = { tlsConfigKeyFile: string; tlsConfigTrustedCaFile: string; tlsConfigServerName: string; - + proxyConfigEnable: boolean; + proxyConfigProxyUrl: string; }; type Version = { @@ -45,6 +46,8 @@ const formData = ref({ tlsConfigKeyFile: "", tlsConfigTrustedCaFile: "", tlsConfigServerName: "", + proxyConfigEnable: false, + proxyConfigProxyUrl: "" }); const loading = ref(1); @@ -70,7 +73,16 @@ const rules = reactive({ tlsConfigCertFile: [{required: true, message: "请选择TLS证书文件", trigger: "change"}], tlsConfigKeyFile: [{required: true, message: "请选择TLS密钥文件", trigger: "change"}], tlsConfigTrustedCaFile: [{required: true, message: "请选择CA证书文件", trigger: "change"}], - tlsConfigServerName: [{required: true, message: "请输入TLS Server名称", trigger: "blur"}] + tlsConfigServerName: [{required: true, message: "请输入TLS Server名称", trigger: "blur"}], + proxyConfigEnable: [{required: true, message: "请选择代理状态", trigger: "change"}], + proxyConfigProxyUrl: [ + {required: true, message: "请输入代理地址", trigger: "change"}, + { + pattern: /^https?\:\/\/(\w+:\w+@)?([a-zA-Z0-9.-]+)(:\d+)?$/, + message: "请输入正确的代理地址", + trigger: "blur" + } + ], }); const versions = ref>([]); @@ -177,21 +189,21 @@ onUnmounted(() => { 手动刷新 - - - - + + + + 点击这里去下载 - - - - - - - + + + + + + + @@ -292,6 +304,25 @@ onUnmounted(() => { + +
代理
+
+ + + + + +
日志配置
From 70eb890b08bdb03b64897cded473f7a14d12e527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Mon, 29 Jan 2024 20:53:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:sparkles:=20=E5=8D=87=E7=BA=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 11650e8..fdad2f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Frpc-Desktop", - "version": "1.0.1", + "version": "1.0.2", "main": "dist-electron/main/index.js", "description": "一个frpc桌面客户端", "author": "刘嘉伟 <8473136@qq.com>", @@ -24,7 +24,7 @@ "build:electron": "npm run build && electron-builder", "build:electron:mac": "npm run build && electron-builder --mac --x64 --arm64", "build:electron:win": "npm run build && electron-builder --win --arm64 --x64 --ia32", - "build:electron:linux": "npm run build && electron-builder --linux --arm64 --x64 --ia32", + "build:electron:linux": "npm run build && electron-builder --linux --arm64 --x64", "preview": "vite preview", "electron:generate-icons": "electron-icon-builder --input=./public/logo.png --output=build --flatten" },