Browse Source

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

pull/703/head v1.1.1
zhengkunwang223 2 years ago committed by GitHub
parent
commit
ad0c859b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      frontend/src/views/website/website/config/basic/limit-conn/index.vue
  2. 1
      frontend/src/views/website/website/config/basic/site-folder/index.vue

9
frontend/src/views/website/website/config/basic/limit-conn/index.vue

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

1
frontend/src/views/website/website/config/basic/site-folder/index.vue

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

Loading…
Cancel
Save