|
|
|
@ -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)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|