✨ 增加日志的配置、优化日志页面
This commit is contained in:
parent
15332d8a0e
commit
c749a2d84a
@ -48,4 +48,4 @@
|
|||||||
[issues-shield]: https://img.shields.io/github/issues/luckjiawei/frpc-desktop.svg?style=for-the-badge
|
[issues-shield]: https://img.shields.io/github/issues/luckjiawei/frpc-desktop.svg?style=for-the-badge
|
||||||
[issues-url]: https://github.com/luckjiawei/frpc-desktop/issues
|
[issues-url]: https://github.com/luckjiawei/frpc-desktop/issues
|
||||||
[license-shield]: https://img.shields.io/github/license/luckjiawei/frpc-desktop.svg?style=for-the-badge
|
[license-shield]: https://img.shields.io/github/license/luckjiawei/frpc-desktop.svg?style=for-the-badge
|
||||||
[license-url]: https://github.com/luckjiawei/frpc-desktop/blob/master/LICENSE.txt
|
[license-url]: https://github.com/luckjiawei/frpc-desktop/blob/master/LICENSE
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { app, ipcMain } from "electron";
|
import {app, ipcMain} from "electron";
|
||||||
import { Config, getConfig } from "../storage/config";
|
import {Config, getConfig} from "../storage/config";
|
||||||
import { listProxy } from "../storage/proxy";
|
import {listProxy} from "../storage/proxy";
|
||||||
import { getVersionById } from "../storage/version";
|
import {getVersionById} from "../storage/version";
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
const { exec, spawn } = require("child_process");
|
const {exec, spawn} = require("child_process");
|
||||||
export let frpcProcess = null;
|
export let frpcProcess = null;
|
||||||
|
|
||||||
const runningCmd = {
|
const runningCmd = {
|
||||||
commandPath: null,
|
commandPath: null,
|
||||||
configPath: null
|
configPath: null
|
||||||
};
|
};
|
||||||
|
|
||||||
// const getFrpc = (config: Config) => {
|
// const getFrpc = (config: Config) => {
|
||||||
@ -27,75 +27,75 @@ const runningCmd = {
|
|||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
const getFrpcVersionWorkerPath = (
|
const getFrpcVersionWorkerPath = (
|
||||||
versionId: string,
|
versionId: string,
|
||||||
callback: (workerPath: string) => void
|
callback: (workerPath: string) => void
|
||||||
) => {
|
) => {
|
||||||
getVersionById(versionId, (err2, version) => {
|
getVersionById(versionId, (err2, version) => {
|
||||||
if (!err2) {
|
if (!err2) {
|
||||||
callback(version["frpcVersionPath"]);
|
callback(version["frpcVersionPath"]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成配置文件
|
* 生成配置文件
|
||||||
*/
|
*/
|
||||||
export const generateConfig = (
|
export const generateConfig = (
|
||||||
config: Config,
|
config: Config,
|
||||||
callback: (configPath: string) => void
|
callback: (configPath: string) => void
|
||||||
) => {
|
) => {
|
||||||
listProxy((err3, proxys) => {
|
listProxy((err3, proxys) => {
|
||||||
if (!err3) {
|
if (!err3) {
|
||||||
const proxyToml = proxys.map(m => {
|
const proxyToml = proxys.map(m => {
|
||||||
let toml = `
|
let toml = `
|
||||||
[[proxies]]
|
[[proxies]]
|
||||||
name = "${m.name}"
|
name = "${m.name}"
|
||||||
type = "${m.type}"
|
type = "${m.type}"
|
||||||
localIP = "${m.localIp}"
|
localIP = "${m.localIp}"
|
||||||
localPort = ${m.localPort}
|
localPort = ${m.localPort}
|
||||||
`;
|
`;
|
||||||
switch (m.type) {
|
switch (m.type) {
|
||||||
case "tcp":
|
case "tcp":
|
||||||
toml += `remotePort = ${m.remotePort}`;
|
toml += `remotePort = ${m.remotePort}`;
|
||||||
break;
|
break;
|
||||||
case "http":
|
case "http":
|
||||||
case "https":
|
case "https":
|
||||||
toml += `customDomains=[${m.customDomains.map(m => `"${m}"`)}]`;
|
toml += `customDomains=[${m.customDomains.map(m => `"${m}"`)}]`;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return toml;
|
return toml;
|
||||||
});
|
});
|
||||||
let toml = `
|
let toml = `
|
||||||
serverAddr = "${config.serverAddr}"
|
serverAddr = "${config.serverAddr}"
|
||||||
serverPort = ${config.serverPort}
|
serverPort = ${config.serverPort}
|
||||||
auth.method = "${config.authMethod}"
|
auth.method = "${config.authMethod}"
|
||||||
auth.token = "${config.authToken}"
|
auth.token = "${config.authToken}"
|
||||||
log.to = "frpc.log"
|
log.to = "frpc.log"
|
||||||
log.level = "debug"
|
log.level = "${config.logLevel}"
|
||||||
log.maxDays = 3
|
log.maxDays = ${config.logMaxDays}
|
||||||
webServer.addr = "127.0.0.1"
|
webServer.addr = "127.0.0.1"
|
||||||
webServer.port = 57400
|
webServer.port = 57400
|
||||||
|
|
||||||
${proxyToml}
|
${proxyToml}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// const configPath = path.join("frp.toml");
|
// const configPath = path.join("frp.toml");
|
||||||
const filename = "frp.toml";
|
const filename = "frp.toml";
|
||||||
fs.writeFile(
|
fs.writeFile(
|
||||||
path.join(app.getPath("userData"), filename), // 配置文件目录
|
path.join(app.getPath("userData"), filename), // 配置文件目录
|
||||||
toml, // 配置文件内容
|
toml, // 配置文件内容
|
||||||
{ flag: "w" },
|
{flag: "w"},
|
||||||
err => {
|
err => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
callback(filename);
|
callback(filename);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,87 +105,87 @@ ${proxyToml}
|
|||||||
* @param configPath
|
* @param configPath
|
||||||
*/
|
*/
|
||||||
const startFrpcProcess = (commandPath: string, configPath: string) => {
|
const startFrpcProcess = (commandPath: string, configPath: string) => {
|
||||||
const command = `${commandPath} -c ${configPath}`;
|
const command = `${commandPath} -c ${configPath}`;
|
||||||
frpcProcess = spawn(command, {
|
frpcProcess = spawn(command, {
|
||||||
cwd: app.getPath("userData"),
|
cwd: app.getPath("userData"),
|
||||||
shell: true
|
shell: true
|
||||||
});
|
});
|
||||||
runningCmd.commandPath = commandPath;
|
runningCmd.commandPath = commandPath;
|
||||||
runningCmd.configPath = configPath;
|
runningCmd.configPath = configPath;
|
||||||
frpcProcess.stdout.on("data", data => {
|
frpcProcess.stdout.on("data", data => {
|
||||||
console.log(`命令输出: ${data}`);
|
console.log(`命令输出: ${data}`);
|
||||||
});
|
});
|
||||||
frpcProcess.stdout.on("error", data => {
|
frpcProcess.stdout.on("error", data => {
|
||||||
console.log(`执行错误: ${data}`);
|
console.log(`执行错误: ${data}`);
|
||||||
frpcProcess.kill("SIGINT");
|
frpcProcess.kill("SIGINT");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const reloadFrpcProcess = () => {
|
export const reloadFrpcProcess = () => {
|
||||||
if (frpcProcess && !frpcProcess.killed) {
|
if (frpcProcess && !frpcProcess.killed) {
|
||||||
getConfig((err1, config) => {
|
getConfig((err1, config) => {
|
||||||
if (!err1) {
|
if (!err1) {
|
||||||
if (config) {
|
if (config) {
|
||||||
generateConfig(config, configPath => {
|
generateConfig(config, configPath => {
|
||||||
const command = `${runningCmd.commandPath} reload -c ${configPath}`;
|
const command = `${runningCmd.commandPath} reload -c ${configPath}`;
|
||||||
console.log("重启", command);
|
console.log("重启", command);
|
||||||
exec(command, {
|
exec(command, {
|
||||||
cwd: app.getPath("userData"),
|
cwd: app.getPath("userData"),
|
||||||
shell: true
|
shell: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initFrpcApi = () => {
|
export const initFrpcApi = () => {
|
||||||
ipcMain.handle("frpc.running", async (event, args) => {
|
ipcMain.handle("frpc.running", async (event, args) => {
|
||||||
if (!frpcProcess) {
|
if (!frpcProcess) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
return !frpcProcess.killed;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.on("frpc.start", async (event, args) => {
|
|
||||||
getConfig((err1, config) => {
|
|
||||||
if (!err1) {
|
|
||||||
if (config) {
|
|
||||||
getFrpcVersionWorkerPath(
|
|
||||||
config.currentVersion,
|
|
||||||
(frpcVersionPath: string) => {
|
|
||||||
generateConfig(config, configPath => {
|
|
||||||
const platform = process.platform;
|
|
||||||
if (platform === 'win32') {
|
|
||||||
startFrpcProcess(
|
|
||||||
path.join(frpcVersionPath, "frpc.exe"),
|
|
||||||
configPath
|
|
||||||
);
|
|
||||||
}else {
|
|
||||||
startFrpcProcess(
|
|
||||||
path.join(frpcVersionPath, "frpc"),
|
|
||||||
configPath
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
event.reply(
|
return !frpcProcess.killed;
|
||||||
"Home.frpc.start.error.hook",
|
|
||||||
"请先前往设置页面,修改配置后再启动"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.on("frpc.stop", () => {
|
ipcMain.on("frpc.start", async (event, args) => {
|
||||||
if (frpcProcess && !frpcProcess.killed) {
|
getConfig((err1, config) => {
|
||||||
console.log("关闭");
|
if (!err1) {
|
||||||
frpcProcess.kill();
|
if (config) {
|
||||||
}
|
getFrpcVersionWorkerPath(
|
||||||
});
|
config.currentVersion,
|
||||||
|
(frpcVersionPath: string) => {
|
||||||
|
generateConfig(config, configPath => {
|
||||||
|
const platform = process.platform;
|
||||||
|
if (platform === 'win32') {
|
||||||
|
startFrpcProcess(
|
||||||
|
path.join(frpcVersionPath, "frpc.exe"),
|
||||||
|
configPath
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
startFrpcProcess(
|
||||||
|
path.join(frpcVersionPath, "frpc"),
|
||||||
|
configPath
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
event.reply(
|
||||||
|
"Home.frpc.start.error.hook",
|
||||||
|
"请先前往设置页面,修改配置后再启动"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.on("frpc.stop", () => {
|
||||||
|
if (frpcProcess && !frpcProcess.killed) {
|
||||||
|
console.log("关闭");
|
||||||
|
frpcProcess.kill();
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,8 @@ export type Config = {
|
|||||||
serverPort: number;
|
serverPort: number;
|
||||||
authMethod: string;
|
authMethod: string;
|
||||||
authToken: string;
|
authToken: string;
|
||||||
|
logLevel: string;
|
||||||
|
logMaxDays: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineComponent, onMounted, onUnmounted, ref, reactive } from "vue";
|
import {defineComponent, onMounted, onUnmounted, reactive, ref} from "vue";
|
||||||
import { ipcRenderer } from "electron";
|
import {ipcRenderer} from "electron";
|
||||||
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
import {ElMessage, FormInstance, FormRules} from "element-plus";
|
||||||
import Breadcrumb from "@/layout/compoenets/Breadcrumb.vue";
|
import Breadcrumb from "@/layout/compoenets/Breadcrumb.vue";
|
||||||
import { useDebounceFn } from "@vueuse/core";
|
import {useDebounceFn} from "@vueuse/core";
|
||||||
import { clone } from "@/utils/clone";
|
import {clone} from "@/utils/clone";
|
||||||
import { Icon } from "@iconify/vue";
|
import {Icon} from "@iconify/vue";
|
||||||
|
|
||||||
defineComponent({
|
defineComponent({
|
||||||
name: "Config"
|
name: "Config"
|
||||||
@ -17,6 +17,8 @@ type Config = {
|
|||||||
serverPort: number;
|
serverPort: number;
|
||||||
authMethod: string;
|
authMethod: string;
|
||||||
authToken: string;
|
authToken: string;
|
||||||
|
logLevel: string;
|
||||||
|
logMaxDays: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Version = {
|
type Version = {
|
||||||
@ -29,15 +31,17 @@ const formData = ref<Config>({
|
|||||||
serverAddr: "",
|
serverAddr: "",
|
||||||
serverPort: 7000,
|
serverPort: 7000,
|
||||||
authMethod: "",
|
authMethod: "",
|
||||||
authToken: ""
|
authToken: "",
|
||||||
|
logLevel: "info",
|
||||||
|
logMaxDays: 3
|
||||||
});
|
});
|
||||||
|
|
||||||
const loading = ref(1);
|
const loading = ref(1);
|
||||||
|
|
||||||
const rules = reactive<FormRules>({
|
const rules = reactive<FormRules>({
|
||||||
currentVersion: [{ required: true, message: "请选择版本", trigger: "blur" }],
|
currentVersion: [{required: true, message: "请选择版本", trigger: "blur"}],
|
||||||
serverAddr: [
|
serverAddr: [
|
||||||
{ required: true, message: "请输入服务端地址", trigger: "blur" },
|
{required: true, message: "请输入服务端地址", trigger: "blur"},
|
||||||
{
|
{
|
||||||
pattern: /^[\w-]+(\.[\w-]+)+$/,
|
pattern: /^[\w-]+(\.[\w-]+)+$/,
|
||||||
message: "请输入正确的服务端地址",
|
message: "请输入正确的服务端地址",
|
||||||
@ -45,10 +49,12 @@ const rules = reactive<FormRules>({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
serverPort: [
|
serverPort: [
|
||||||
{ required: true, message: "请输入服务器端口", trigger: "blur" }
|
{required: true, message: "请输入服务器端口", trigger: "blur"}
|
||||||
],
|
],
|
||||||
// authMethod: [{ required: true, message: "请选择验证方式", trigger: "blur" }],
|
// authMethod: [{ required: true, message: "请选择验证方式", trigger: "blur" }],
|
||||||
authToken: [{ required: true, message: "请输入token值 ", trigger: "blur" }]
|
authToken: [{required: true, message: "请输入token值 ", trigger: "blur"}],
|
||||||
|
logLevel: [{required: true, message: "请选择日志级别 ", trigger: "blur"}],
|
||||||
|
logMaxDays: [{required: true, message: "请输入日志保留天数 ", trigger: "blur"}]
|
||||||
});
|
});
|
||||||
|
|
||||||
const versions = ref<Array<Version>>([]);
|
const versions = ref<Array<Version>>([]);
|
||||||
@ -73,7 +79,7 @@ onMounted(() => {
|
|||||||
ipcRenderer.send("config.getConfig");
|
ipcRenderer.send("config.getConfig");
|
||||||
handleLoadVersions();
|
handleLoadVersions();
|
||||||
ipcRenderer.on("Config.getConfig.hook", (event, args) => {
|
ipcRenderer.on("Config.getConfig.hook", (event, args) => {
|
||||||
const { err, data } = args;
|
const {err, data} = args;
|
||||||
if (!err) {
|
if (!err) {
|
||||||
if (data) {
|
if (data) {
|
||||||
formData.value = data;
|
formData.value = data;
|
||||||
@ -90,7 +96,7 @@ onMounted(() => {
|
|||||||
loading.value--;
|
loading.value--;
|
||||||
});
|
});
|
||||||
ipcRenderer.on("Config.versions.hook", (event, args) => {
|
ipcRenderer.on("Config.versions.hook", (event, args) => {
|
||||||
const { err, data } = args;
|
const {err, data} = args;
|
||||||
if (!err) {
|
if (!err) {
|
||||||
versions.value = data;
|
versions.value = data;
|
||||||
}
|
}
|
||||||
@ -104,100 +110,136 @@ onUnmounted(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="main">
|
||||||
<breadcrumb />
|
<breadcrumb/>
|
||||||
<div
|
<div class="app-container-breadcrumb pr-2" v-loading="loading > 0">
|
||||||
class="w-full bg-white p-4 rounded drop-shadow-lg"
|
<div
|
||||||
v-loading="loading > 0"
|
class="w-full bg-white p-4 rounded drop-shadow-lg"
|
||||||
>
|
|
||||||
<el-form
|
|
||||||
:model="formData"
|
|
||||||
:rules="rules"
|
|
||||||
label-position="right"
|
|
||||||
ref="formRef"
|
|
||||||
label-width="120"
|
|
||||||
>
|
>
|
||||||
<el-row :gutter="10">
|
<el-form
|
||||||
<el-col :span="24">
|
:model="formData"
|
||||||
<el-form-item label="选择版本:" prop="currentVersion">
|
:rules="rules"
|
||||||
<el-select
|
label-position="right"
|
||||||
v-model="formData.currentVersion"
|
ref="formRef"
|
||||||
class="w-full"
|
label-width="120"
|
||||||
clearable
|
>
|
||||||
>
|
<el-row :gutter="10">
|
||||||
<el-option
|
<el-col :span="24">
|
||||||
v-for="v in versions"
|
<el-form-item label="选择版本:" prop="currentVersion">
|
||||||
:key="v.id"
|
<el-select
|
||||||
:label="v.name"
|
v-model="formData.currentVersion"
|
||||||
:value="v.id"
|
class="w-full"
|
||||||
></el-option>
|
clearable
|
||||||
</el-select>
|
|
||||||
<div class="w-full flex justify-end">
|
|
||||||
<el-button type="text" @click="handleLoadVersions">
|
|
||||||
<Icon class="mr-1" icon="material-symbols:refresh-rounded" />
|
|
||||||
手动刷新
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
@click="$router.replace({ name: 'Download' })"
|
|
||||||
>
|
>
|
||||||
<Icon class="mr-1" icon="material-symbols:download-2" />
|
<el-option
|
||||||
点击这里去下载
|
v-for="v in versions"
|
||||||
|
:key="v.id"
|
||||||
|
:label="v.name"
|
||||||
|
:value="v.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
<div class="w-full flex justify-end">
|
||||||
|
<el-button type="text" @click="handleLoadVersions">
|
||||||
|
<Icon class="mr-1" icon="material-symbols:refresh-rounded"/>
|
||||||
|
手动刷新
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="$router.replace({ name: 'Download' })"
|
||||||
|
>
|
||||||
|
<Icon class="mr-1" icon="material-symbols:download-2"/>
|
||||||
|
点击这里去下载
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="h2">服务器配置</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="服务器地址:" prop="serverAddr">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.serverAddr"
|
||||||
|
placeholder="127.0.0.1"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="服务器端口:" prop="serverPort">
|
||||||
|
<el-input-number
|
||||||
|
placeholder="7000"
|
||||||
|
v-model="formData.serverPort"
|
||||||
|
:min="0"
|
||||||
|
:max="65535"
|
||||||
|
controls-position="right"
|
||||||
|
class="!w-full"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="验证方式:" prop="authMethod">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.authMethod"
|
||||||
|
placeholder="请选择验证方式"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option label="token" value="token"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="formData.authMethod === 'token'">
|
||||||
|
<el-form-item label="token:" prop="authToken">
|
||||||
|
<el-input
|
||||||
|
placeholder="token"
|
||||||
|
type="password"
|
||||||
|
v-model="formData.authToken"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="h2">日志配置</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="!w-full" label="日志级别:" prop="logLevel">
|
||||||
|
<el-select v-model="formData.logLevel">
|
||||||
|
<el-option label="info" value="info"/>
|
||||||
|
<el-option label="debug" value="debug"/>
|
||||||
|
<el-option label="waring" value="waring"/>
|
||||||
|
<el-option label="error" value="error"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="日志保留天数:" prop="logMaxDays">
|
||||||
|
<el-input-number class="!w-full" controls-position="right" v-model="formData.logMaxDays"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button plain type="primary" @click="handleSubmit">
|
||||||
|
<Icon class="mr-1" icon="material-symbols:save"/>
|
||||||
|
保 存
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
<el-col :span="24">
|
</el-form>
|
||||||
<el-form-item label="服务端地址:" prop="serverAddr">
|
</div>
|
||||||
<el-input
|
|
||||||
v-model="formData.serverAddr"
|
|
||||||
placeholder="127.0.0.1"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="服务端端口:" prop="serverPort">
|
|
||||||
<el-input-number
|
|
||||||
placeholder="7000"
|
|
||||||
v-model="formData.serverPort"
|
|
||||||
:min="0"
|
|
||||||
:max="65535"
|
|
||||||
controls-position="right"
|
|
||||||
></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="验证方式:" prop="authMethod">
|
|
||||||
<el-select
|
|
||||||
v-model="formData.authMethod"
|
|
||||||
placeholder="请选择验证方式"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option label="token" value="token"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" v-if="formData.authMethod === 'token'">
|
|
||||||
<el-form-item label="token:" prop="authToken">
|
|
||||||
<el-input
|
|
||||||
placeholder="token"
|
|
||||||
type="password"
|
|
||||||
v-model="formData.authToken"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item>
|
|
||||||
<el-button plain type="primary" @click="handleSubmit">
|
|
||||||
<Icon class="mr-1" icon="material-symbols:save" />
|
|
||||||
保 存
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.h2 {
|
||||||
|
color: #5A3DAA;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 6px 10px 6px 15px;
|
||||||
|
border-left: 5px solid #5A3DAA;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #EEEBF6;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user