fix: 服务器代理修改默认值 (#5242)

This commit is contained in:
ssongliu 2024-05-31 18:07:19 +08:00 committed by GitHub
parent 9af00cc80c
commit 869d0c73bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 8 deletions

View file

@ -215,7 +215,9 @@
v-if="mysqlStatus != 'Running' && currentDB && !loading && maskShow && currentDB?.from === 'local'" v-if="mysqlStatus != 'Running' && currentDB && !loading && maskShow && currentDB?.from === 'local'"
class="mask-prompt" class="mask-prompt"
> >
<span>{{ $t('commons.service.serviceNotStarted', ['MySQL']) }}</span> <span>
{{ $t('commons.service.serviceNotStarted', [currentDB.type === 'mysql' ? 'MySQL' : 'Mariadb']) }}
</span>
</el-card> </el-card>
<div v-if="dbOptionsLocal.length === 0 && dbOptionsRemote.length === 0"> <div v-if="dbOptionsLocal.length === 0 && dbOptionsRemote.length === 0">

View file

@ -363,7 +363,8 @@ const loadQuickCmd = async () => {
const quickInput = (val: any) => { const quickInput = (val: any) => {
if (val) { if (val) {
terminalRef.value?.sendMsg(val + '\n'); terminalRef.value?.sendMsg(val);
quickCmd.value = '';
} }
}; };

View file

@ -1,6 +1,6 @@
<template> <template>
<div v-show="settingShow" v-loading="loading"> <div v-show="settingShow" v-loading="loading">
<LayoutContent :title="'Redis ' + $t('commons.button.set')" :reload="true"> <LayoutContent :title="database + ' ' + $t('commons.button.set')" :reload="true">
<template #buttons> <template #buttons>
<el-button type="primary" :plain="activeName !== 'conf'" @click="changeTab('conf')"> <el-button type="primary" :plain="activeName !== 'conf'" @click="changeTab('conf')">
{{ $t('database.confChange') }} {{ $t('database.confChange') }}
@ -201,7 +201,7 @@ const changeTab = (val: string) => {
break; break;
case 'tuning': case 'tuning':
case 'port': case 'port':
loadform(); loadForm();
break; break;
case 'status': case 'status':
statusRef.value!.acceptParams({ status: redisStatus.value, database: database.value }); statusRef.value!.acceptParams({ status: redisStatus.value, database: database.value });
@ -288,7 +288,7 @@ const submitForm = async () => {
loading.value = true; loading.value = true;
await updateRedisConf(param) await updateRedisConf(param)
.then(() => { .then(() => {
loadform(); loadForm();
loading.value = false; loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
}) })
@ -336,7 +336,7 @@ const submitFile = async () => {
}); });
}; };
const loadform = async () => { const loadForm = async () => {
const res = await loadRedisConf(database.value); const res = await loadRedisConf(database.value);
form.name = res.data?.name; form.name = res.data?.name;
form.timeout = Number(res.data?.timeout); form.timeout = Number(res.data?.timeout);

View file

@ -25,6 +25,7 @@
</el-alert> </el-alert>
<el-form-item :label="$t('setting.proxyType')" prop="proxyType"> <el-form-item :label="$t('setting.proxyType')" prop="proxyType">
<el-select v-model="form.proxyType" clearable> <el-select v-model="form.proxyType" clearable>
<el-option value="" :label="$t('commons.button.close')" />
<el-option value="socks5" label="SOCKS5" /> <el-option value="socks5" label="SOCKS5" />
<el-option value="http" label="HTTP" /> <el-option value="http" label="HTTP" />
<el-option value="https" label="HTTPS" /> <el-option value="https" label="HTTPS" />
@ -105,8 +106,8 @@ interface DialogProps {
passwdKeep: string; passwdKeep: string;
} }
const acceptParams = (params: DialogProps): void => { const acceptParams = (params: DialogProps): void => {
form.proxyUrl = params.url || '127.0.0.1'; form.proxyUrl = params.url;
form.proxyType = params.type || 'socks5'; form.proxyType = params.type;
form.proxyPortItem = params.port ? Number(params.port) : 7890; form.proxyPortItem = params.port ? Number(params.port) : 7890;
form.proxyUser = params.user; form.proxyUser = params.user;
form.proxyPasswd = params.passwd; form.proxyPasswd = params.passwd;