-
{{$t('table.edit')}}
-
{{$t('table.disable')}}
-
{{$t('table.enable')}}
-
{{$t('table.ruleConfig')}}
+
+ {{$t('table.edit')}}
+ {{$t('table.disable')}}
+ {{$t('table.enable')}}
+ {{$t('table.ruleConfig')}}
-
+
更多操作
@@ -60,7 +61,7 @@
- {{$t('table.securityGroupBindPortMapping')}}
+ {{$t('table.securityGroupBindPortMapping')}}
@@ -198,7 +199,7 @@ import LinkPopover from '../../components/Link/linkPopover'
update: '编辑',
create: '新建'
},
- passTypeList: [{key: 'allow', value: 1}, {key: 'deny', value: -1}],
+ passTypeList: [{key: '允许', value: 1}, {key: '拒绝', value: 0}],
dialogPvVisible: false,
pvData: [],
rules: {
@@ -326,6 +327,7 @@ import LinkPopover from '../../components/Link/linkPopover'
},
handleUpdate(row) {
this.temp = Object.assign({}, row) // copy obj
+ this.temp.defaultPassType = row.defaultPassType == 'allow' ? 1 : 0
this.temp.timestamp = new Date(this.temp.timestamp)
this.dialogStatus = 'update'
this.dialogFormVisible = true
@@ -409,3 +411,8 @@ import LinkPopover from '../../components/Link/linkPopover'
}
}
+
\ No newline at end of file
diff --git a/neutrino-proxy-admin/src/views/system/securityRule.vue b/neutrino-proxy-admin/src/views/system/securityRule.vue
index dfeda98e..fb9c8a64 100644
--- a/neutrino-proxy-admin/src/views/system/securityRule.vue
+++ b/neutrino-proxy-admin/src/views/system/securityRule.vue
@@ -35,8 +35,8 @@
- {{scope.row.passType}}
- {{scope.row.passType}}
+ 允许
+ 拒绝
@@ -62,11 +62,10 @@
- {{$t('table.edit')}}
- {{$t('table.disable')}}
- {{$t('table.enable')}}
-
-
+ {{$t('table.edit')}}
+ {{$t('table.disable')}}
+ {{$t('table.enable')}}
+
@@ -132,7 +131,7 @@
import {fetchGroupOne, fetchRuleList, createRule, updateRule, deleteRule, enableRule, disableRule} from '@/api/securityGroup'
import waves from '@/directive/waves' // 水波纹指令
import { parseTime } from '@/utils'
-import ButtonPopover from '../../components/Button/buttonPopover'
+import LinkPopover from '../../components/Link/linkPopover'
export default {
name: 'complexTable',
@@ -140,7 +139,7 @@ import ButtonPopover from '../../components/Button/buttonPopover'
waves
},
components: {
- ButtonPopover
+ LinkPopover
},
data() {
return {
@@ -164,7 +163,7 @@ import ButtonPopover from '../../components/Button/buttonPopover'
update: '编辑',
create: '新建'
},
- passTypeList: [{key: 'allow', value: 1}, {key: 'deny', value: 0}],
+ passTypeList: [{key: '允许', value: 1}, {key: '拒绝', value: 0}],
dialogPvVisible: false,
pvData: [],
rules: {
@@ -304,6 +303,7 @@ import ButtonPopover from '../../components/Button/buttonPopover'
},
handleUpdate(row) {
this.temp = Object.assign({}, row) // copy obj
+ this.temp.passType = row.passType == 'allow' ? 1 : 0
this.temp.timestamp = new Date(this.temp.timestamp)
this.dialogStatus = 'update'
this.dialogFormVisible = true
diff --git a/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/dal/entity/PortMappingDO.java b/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/dal/entity/PortMappingDO.java
index 76abe801..b6f2af36 100644
--- a/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/dal/entity/PortMappingDO.java
+++ b/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/dal/entity/PortMappingDO.java
@@ -97,7 +97,7 @@ public class PortMappingDO {
/**
* 安全组Id
*/
- private Integer securityGroupId;
+ private Integer securityGroupId = 0; // 设置为null不生效,不知道为啥
/**
* 创建时间
diff --git a/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/service/PortMappingService.java b/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/service/PortMappingService.java
index 4bbc15ed..58c3f59e 100644
--- a/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/service/PortMappingService.java
+++ b/neutrino-proxy-server/src/main/java/org/dromara/neutrinoproxy/server/service/PortMappingService.java
@@ -187,6 +187,9 @@ public class PortMappingService implements LifecycleBean {
PortMappingDO portMappingDO = new PortMappingDO();
BeanUtil.copyProperties(req, portMappingDO);
+ if (req.getSecurityGroupId() == null) {
+ portMappingDO.setSecurityGroupId(0);
+ }
portMappingDO.setUpdateTime(new Date());
portMappingDO.setEnable(EnableStatusEnum.ENABLE.getStatus());
portMappingMapper.updateById(portMappingDO);
@@ -292,7 +295,7 @@ public class PortMappingService implements LifecycleBean {
if (mappingDO == null) {
throw new RuntimeException("指定的端口映射不存在");
}
- mappingDO.setSecurityGroupId(null);
+ mappingDO.setSecurityGroupId(0);
mappingDO.setUpdateTime(new Date());
portMappingMapper.updateById(mappingDO);
portToSecurityGroupMap.remove(mappingDO.getServerPort());