mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 17:13:30 +08:00
feat: 限制 WAF 空值提交
This commit is contained in:
parent
0d22ae6dc3
commit
d72bb22db7
3 changed files with 19 additions and 7 deletions
|
@ -1068,7 +1068,7 @@ export default {
|
|||
notSecurity: '(not safe)',
|
||||
encryptHelper:
|
||||
"Let's Encrypt has a frequency limit for issuing certificates, but it is sufficient to meet normal needs. Too frequent operations will cause issuance failure. For specific restrictions, please see <a target='_blank' href='https://letsencrypt.org/zh-cn/docs /rate-limits/'>official document</a> ",
|
||||
ipValue: 'IP value',
|
||||
ipValue: 'Value',
|
||||
ext: 'file extension',
|
||||
wafInputHelper: 'Input data by line, one line',
|
||||
data: 'data',
|
||||
|
|
|
@ -1072,7 +1072,7 @@ export default {
|
|||
notSecurity: '(不安全)',
|
||||
encryptHelper:
|
||||
"Let's Encrypt 签发证书有频率限制,但足以满足正常需求,过于频繁操作会导致签发失败。具体限制请看 <a target=“_blank” href='https://letsencrypt.org/zh-cn/docs/rate-limits/'>官方文档</a> ",
|
||||
ipValue: 'IP值',
|
||||
ipValue: '值',
|
||||
ext: '文件扩展名',
|
||||
wafInputHelper: '按行输入数据,一行一个',
|
||||
data: '数据',
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{{ $t('commons.button.add') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<el-table-column label="IP" prop="ip"></el-table-column>
|
||||
<el-table-column :label="$t('website.ipValue')" prop="ip"></el-table-column>
|
||||
<el-table-column :label="$t('commons.table.operate')">
|
||||
<template #default="{ $index }">
|
||||
<el-button link type="primary" @click="removeIp($index)">
|
||||
|
@ -116,18 +116,30 @@ const openCreate = () => {
|
|||
if (ipArray.length == 0) {
|
||||
return;
|
||||
}
|
||||
let newIpArray = [];
|
||||
ipArray.forEach((ip: string) => {
|
||||
const newIp = ip.replace(/(^\s*)|(\s*$)/g, '');
|
||||
if (newIp != '') {
|
||||
newIpArray.push(newIp);
|
||||
}
|
||||
});
|
||||
if (newIpArray.length == 0) {
|
||||
return;
|
||||
}
|
||||
if (req.value.rule.indexOf('ip') > -1) {
|
||||
for (const id in ipArray) {
|
||||
if (checkIp(ipArray[id])) {
|
||||
for (const id in newIpArray) {
|
||||
if (checkIp(newIpArray[id])) {
|
||||
MsgError(i18n.global.t('commons.rule.ipErr', [ipArray[id]]));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
data.value.forEach((d) => {
|
||||
ipArray.push(d.ip);
|
||||
newIpArray.push(d.ip);
|
||||
});
|
||||
submit(ipArray);
|
||||
if (newIpArray.length > 0) {
|
||||
submit(newIpArray);
|
||||
}
|
||||
};
|
||||
|
||||
const submit = async (ipList: string[]) => {
|
||||
|
|
Loading…
Reference in a new issue