1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 解决网站目录重复的问题 (#695)

This commit is contained in:
zhengkunwang223 2023-04-18 19:19:00 +08:00 committed by GitHub
parent d660b7d315
commit ad0c859b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,7 @@
<el-form ref="limitForm" label-position="left" :model="form" :rules="rules" label-width="100px"> <el-form ref="limitForm" label-position="left" :model="form" :rules="rules" label-width="100px">
<el-form-item :label="$t('website.limit')"> <el-form-item :label="$t('website.limit')">
<el-select v-model="ruleKey" @change="changeRule(ruleKey)"> <el-select v-model="ruleKey" @change="changeRule(ruleKey)">
<el-option :label="$t('website.current')" :value="'current'"></el-option>
<el-option <el-option
v-for="(limit, index) in limitRules" v-for="(limit, index) in limitRules"
:key="index" :key="index"
@ -94,7 +95,7 @@ const search = (scopeReq: Website.NginxScopeReq) => {
loading.value = true; loading.value = true;
GetNginxConfig(scopeReq) GetNginxConfig(scopeReq)
.then((res) => { .then((res) => {
ruleKey.value = limitRules[0].key; ruleKey.value = 'current';
if (res.data) { if (res.data) {
enable.value = res.data.enable; enable.value = res.data.enable;
if (res.data.enable == false) { if (res.data.enable == false) {
@ -102,14 +103,14 @@ const search = (scopeReq: Website.NginxScopeReq) => {
} }
for (const param of res.data.params) { for (const param of res.data.params) {
if (param.name === 'limit_conn') { if (param.name === 'limit_conn') {
if (param.params[0] === 'perserver') { if (param.params[0] === 'perserver' && param.params[1]) {
form.perserver = Number(param.params[1].match(/\d+/g)); form.perserver = Number(param.params[1].match(/\d+/g));
} }
if (param.params[0] === 'perip') { if (param.params[0] === 'perip' && param.params[1]) {
form.perip = Number(param.params[1].match(/\d+/g)); form.perip = Number(param.params[1].match(/\d+/g));
} }
} }
if (param.name === 'limit_rate') { if (param.name === 'limit_rate' && param.params[0]) {
form.rate = Number(param.params[0].match(/\d+/g)); form.rate = Number(param.params[0].match(/\d+/g));
} }
} }

View File

@ -163,6 +163,7 @@ const getDirs = async () => {
loading.value = true; loading.value = true;
await GetFilesList(dirReq) await GetFilesList(dirReq)
.then((res) => { .then((res) => {
dirs.value = [];
const items = res.data.items || []; const items = res.data.items || [];
for (const item of items) { for (const item of items) {
dirs.value.push(item.name); dirs.value.push(item.name);