mirror of https://github.com/1Panel-dev/1Panel
feat: 修改流量限制按钮
parent
0f739b4afa
commit
29c8a2180f
|
@ -920,6 +920,7 @@ export default {
|
|||
indexFolder: '静态网站root目录',
|
||||
logFoler: '网站日志',
|
||||
sslFolder: '网站证书',
|
||||
enableOrNot: '是否启用',
|
||||
},
|
||||
nginx: {
|
||||
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
:loading="loading"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="enable" @change="changeEnable">
|
||||
{{ $t('website.limtHelper') }}
|
||||
</el-checkbox>
|
||||
<el-form-item prop="enable" :label="$t('website.enableOrNot')">
|
||||
<el-switch v-model="enable" @change="changeEnable"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('website.limit')">
|
||||
<el-select v-model="ruleKey" @change="changeRule(ruleKey)">
|
||||
|
@ -38,7 +36,8 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button type="primary" @click="submit(limitForm)" :loading="loading">
|
||||
{{ $t('commons.button.save') }}
|
||||
<span v-if="enable">{{ $t('commons.button.save') }}</span>
|
||||
<span v-else>{{ $t('commons.button.saveAndEnable') }}</span>
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -146,6 +145,9 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
},
|
||||
];
|
||||
req.params = params;
|
||||
if (req.operate === 'add') {
|
||||
enable.value = true;
|
||||
}
|
||||
UpdateNginxConfig(req)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
|
@ -163,6 +165,7 @@ const changeEnable = () => {
|
|||
} else {
|
||||
req.operate = 'add';
|
||||
}
|
||||
submit(limitForm.value);
|
||||
};
|
||||
|
||||
const changeRule = (key: string) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-col :span="14" :offset="1">
|
||||
<br />
|
||||
<el-descriptions :column="1" border v-loading="loading">
|
||||
<el-descriptions-item :label="$t('website.siteAlias')">{{ website.alias }}</el-descriptions-item>
|
||||
|
|
Loading…
Reference in New Issue