Merge branch 'develop'

This commit is contained in:
刘嘉伟 2024-01-29 20:53:36 +08:00
commit ee9e7909a4
4 changed files with 52 additions and 16 deletions

View File

@ -78,6 +78,9 @@ transport.tls.keyFile = "${config.tlsConfigKeyFile}"
transport.tls.trustedCaFile = "${config.tlsConfigTrustedCaFile}" transport.tls.trustedCaFile = "${config.tlsConfigTrustedCaFile}"
transport.tls.serverName = "${config.tlsConfigServerName}" transport.tls.serverName = "${config.tlsConfigServerName}"
` : ""} ` : ""}
${config.proxyConfigEnable ? `
transport.proxyURL = "${config.proxyConfigProxyUrl}"
` : ""}
${proxyToml.join("")} ${proxyToml.join("")}
@ -161,7 +164,7 @@ export const reloadFrpcProcess = () => {
/** /**
* frpc子进程 * frpc子进程
*/ */
export const stopFrpcProcess = (callback?:() => void) => { export const stopFrpcProcess = (callback?: () => void) => {
if (frpcProcess) { if (frpcProcess) {
treeKill(frpcProcess.pid, (error: Error) => { treeKill(frpcProcess.pid, (error: Error) => {
if (error) { if (error) {

View File

@ -20,6 +20,8 @@ export type Config = {
tlsConfigKeyFile: string; tlsConfigKeyFile: string;
tlsConfigTrustedCaFile: string; tlsConfigTrustedCaFile: string;
tlsConfigServerName: string; tlsConfigServerName: string;
proxyConfigEnable: boolean;
proxyConfigProxyUrl: string;
}; };
/** /**

View File

@ -1,6 +1,6 @@
{ {
"name": "Frpc-Desktop", "name": "Frpc-Desktop",
"version": "1.0.1", "version": "1.0.2",
"main": "dist-electron/main/index.js", "main": "dist-electron/main/index.js",
"description": "一个frpc桌面客户端", "description": "一个frpc桌面客户端",
"author": "刘嘉伟 <8473136@qq.com>", "author": "刘嘉伟 <8473136@qq.com>",
@ -24,7 +24,7 @@
"build:electron": "npm run build && electron-builder", "build:electron": "npm run build && electron-builder",
"build:electron:mac": "npm run build && electron-builder --mac --x64 --arm64", "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: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", "preview": "vite preview",
"electron:generate-icons": "electron-icon-builder --input=./public/logo.png --output=build --flatten" "electron:generate-icons": "electron-icon-builder --input=./public/logo.png --output=build --flatten"
}, },

View File

@ -24,7 +24,8 @@ type Config = {
tlsConfigKeyFile: string; tlsConfigKeyFile: string;
tlsConfigTrustedCaFile: string; tlsConfigTrustedCaFile: string;
tlsConfigServerName: string; tlsConfigServerName: string;
proxyConfigEnable: boolean;
proxyConfigProxyUrl: string;
}; };
type Version = { type Version = {
@ -45,6 +46,8 @@ const formData = ref<Config>({
tlsConfigKeyFile: "", tlsConfigKeyFile: "",
tlsConfigTrustedCaFile: "", tlsConfigTrustedCaFile: "",
tlsConfigServerName: "", tlsConfigServerName: "",
proxyConfigEnable: false,
proxyConfigProxyUrl: ""
}); });
const loading = ref(1); const loading = ref(1);
@ -70,7 +73,16 @@ const rules = reactive<FormRules>({
tlsConfigCertFile: [{required: true, message: "请选择TLS证书文件", trigger: "change"}], tlsConfigCertFile: [{required: true, message: "请选择TLS证书文件", trigger: "change"}],
tlsConfigKeyFile: [{required: true, message: "请选择TLS密钥文件", trigger: "change"}], tlsConfigKeyFile: [{required: true, message: "请选择TLS密钥文件", trigger: "change"}],
tlsConfigTrustedCaFile: [{required: true, message: "请选择CA证书文件", 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<Array<Version>>([]); const versions = ref<Array<Version>>([]);
@ -177,21 +189,21 @@ onUnmounted(() => {
<Icon class="mr-1" icon="material-symbols:refresh-rounded"/> <Icon class="mr-1" icon="material-symbols:refresh-rounded"/>
手动刷新 手动刷新
</el-link> </el-link>
<!-- <el-button type="text" @click="handleLoadVersions">--> <!-- <el-button type="text" @click="handleLoadVersions">-->
<!-- <Icon class="mr-1" icon="material-symbols:refresh-rounded"/>--> <!-- <Icon class="mr-1" icon="material-symbols:refresh-rounded"/>-->
<!-- 手动刷新--> <!-- 手动刷新-->
<!-- </el-button>--> <!-- </el-button>-->
<el-link class="ml-2" type="primary" @click="$router.replace({ name: 'Download' })"> <el-link class="ml-2" type="primary" @click="$router.replace({ name: 'Download' })">
<Icon class="mr-1" icon="material-symbols:download-2"/> <Icon class="mr-1" icon="material-symbols:download-2"/>
点击这里去下载 点击这里去下载
</el-link> </el-link>
<!-- <el-button--> <!-- <el-button-->
<!-- type="text"--> <!-- type="text"-->
<!-- @click="$router.replace({ name: 'Download' })"--> <!-- @click="$router.replace({ name: 'Download' })"-->
<!-- >--> <!-- >-->
<!-- <Icon class="mr-1" icon="material-symbols:download-2"/>--> <!-- <Icon class="mr-1" icon="material-symbols:download-2"/>-->
<!-- 点击这里去下载--> <!-- 点击这里去下载-->
<!-- </el-button>--> <!-- </el-button>-->
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -292,6 +304,25 @@ onUnmounted(() => {
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
<el-col :span="24">
<div class="h2">代理</div>
</el-col>
<el-col :span="24">
<el-form-item label="是否启动代理:" prop="proxyConfigEnable">
<el-switch active-text=""
inline-prompt
inactive-text="关"
v-model="formData.proxyConfigEnable"/>
</el-form-item>
</el-col>
<template v-if="formData.proxyConfigEnable">
<el-col :span="24">
<el-form-item label="代理地址:" prop="proxyConfigProxyUrl">
<el-input v-model="formData.proxyConfigProxyUrl"
placeholder="http://user:pwd@192.168.1.128:8080"/>
</el-form-item>
</el-col>
</template>
<el-col :span="24"> <el-col :span="24">
<div class="h2">日志配置</div> <div class="h2">日志配置</div>
</el-col> </el-col>