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