fix: 防火墙 ip 规则取消范围输入 (#598)

This commit is contained in:
ssongliu 2023-04-12 16:32:30 +08:00 committed by GitHub
parent b2e38c320d
commit 6ff9c4335f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 6 deletions

View file

@ -1280,7 +1280,6 @@ const message = {
addressFormatError: 'Please enter a valid ip address!',
addressHelper1: 'Multiple IP please separated with ",", such as 172.16.10.11, 172.16.10.99',
addressHelper2: 'IP segment, such as 172.16.10.0/24',
addressHelper3: 'IP address range, such as 172.16.10.11-172.16.10.99',
allIP: 'All IP',
portRule: 'Port rule',
ipRule: 'IP rule',

View file

@ -1264,7 +1264,6 @@ const message = {
addressFormatError: '请输入合法的 ip 地址',
addressHelper1: '多个 IP 请用 "," 隔开172.16.10.11,172.16.10.99',
addressHelper2: 'IP 172.16.0.0/24',
addressHelper3: 'IP 范围172.16.10.10-172.16.10.19暂不支持跨网段范围',
allIP: '所有 IP',
portRule: '端口规则',
ipRule: 'IP 规则',

View file

@ -17,7 +17,6 @@
/>
<span class="input-help">{{ $t('firewall.addressHelper1') }}</span>
<span class="input-help">{{ $t('firewall.addressHelper2') }}</span>
<span class="input-help">{{ $t('firewall.addressHelper3') }}</span>
</el-form-item>
<el-form-item :label="$t('firewall.strategy')" prop="strategy">
<el-radio-group v-model="dialogData.rowData!.strategy">
@ -92,9 +91,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
dialogData.value.rowData.operation = 'add';
if (!dialogData.value.rowData) return;
let ips = [];
if (dialogData.value.rowData.address.indexOf('-') !== -1) {
ips = dialogData.value.rowData.address.split('-');
} else if (dialogData.value.rowData.address.indexOf(',') !== -1) {
if (dialogData.value.rowData.address.indexOf(',') !== -1) {
ips = dialogData.value.rowData.address.split(',');
} else if (dialogData.value.rowData.address.indexOf('/') !== -1) {
ips.push(dialogData.value.rowData.address.split('/')[0]);