diff options
| author | 段冬梅 <[email protected]> | 2019-04-19 18:33:01 +0800 |
|---|---|---|
| committer | 段冬梅 <[email protected]> | 2019-04-19 18:33:01 +0800 |
| commit | 1191db5fbe94b2ba85f89cc48581b50a7d223472 (patch) | |
| tree | f5b148bb5da7730510bc9116fb111f91827d2c52 | |
| parent | 5b63b0237eb6aa926ebc26de4143635be9d2fee4 (diff) | |
| parent | 99c3c8c84f1688f88ac11ea298e35fb1f7e0e3ff (diff) | |
Merge branch 'develop_no_common_group' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop_no_common_group
110 files changed, 3384 insertions, 2989 deletions
diff --git a/src/main/java/com/nis/domain/basics/AsnIpCfg.java b/src/main/java/com/nis/domain/basics/AsnIpCfg.java index 9517669d0..df1946a46 100644 --- a/src/main/java/com/nis/domain/basics/AsnIpCfg.java +++ b/src/main/java/com/nis/domain/basics/AsnIpCfg.java @@ -20,12 +20,14 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> { @ExcelField(title="ip_type",dictType="IP_TYPE",sort=6)
@SerializedName("ipType")
private Integer ipType;
- @ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=8)
- private Integer ipPattern;
+ private Integer srcIpPattern;
+ @ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=8)
+ private Integer destIpPattern;
private String srcIpAddress;
@ExcelField(title="ip",sort=7)
private String destIpAddress;
- private Integer portPattern;
+ private Integer srcPortPattern;
+ private Integer destPortPattern;
private String srcPort;
private String destPort;
//@ExcelField(title="group",sort=2)
@@ -117,11 +119,30 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> { public void setIpType(Integer ipType) {
this.ipType = ipType;
}
- public Integer getIpPattern() {
- return ipPattern;
+
+ public Integer getSrcIpPattern() {
+ return srcIpPattern;
+ }
+ public void setSrcIpPattern(Integer srcIpPattern) {
+ this.srcIpPattern = srcIpPattern;
+ }
+ public Integer getDestIpPattern() {
+ return destIpPattern;
+ }
+ public void setDestIpPattern(Integer destIpPattern) {
+ this.destIpPattern = destIpPattern;
+ }
+ public Integer getSrcPortPattern() {
+ return srcPortPattern;
}
- public void setIpPattern(Integer ipPattern) {
- this.ipPattern = ipPattern;
+ public void setSrcPortPattern(Integer srcPortPattern) {
+ this.srcPortPattern = srcPortPattern;
+ }
+ public Integer getDestPortPattern() {
+ return destPortPattern;
+ }
+ public void setDestPortPattern(Integer destPortPattern) {
+ this.destPortPattern = destPortPattern;
}
public String getSrcIpAddress() {
return srcIpAddress;
@@ -135,12 +156,6 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> { public void setDestIpAddress(String destIpAddress) {
this.destIpAddress = destIpAddress;
}
- public Integer getPortPattern() {
- return portPattern;
- }
- public void setPortPattern(Integer portPattern) {
- this.portPattern = portPattern;
- }
public String getSrcPort() {
return srcPort;
}
@@ -176,9 +191,10 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> { }
@Override
public String toString() {
- return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", ipPattern="
- + ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", portPattern="
- + portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
+ return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", srcIpPattern="
+ + srcIpPattern + ", destIpPattern="+ destIpPattern+ ", srcIpAddress=" + srcIpAddress + ", destIpAddress="
+ + destIpAddress + ", srcPortPattern="+ srcPortPattern+", destPortPattern="+ destPortPattern + ", srcPort="
+ + srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
+ ", asnIpGroup=" + asnIpGroup + ", direction=" + direction + ", protocol=" + protocol + ", protocolId="
+ protocolId + ", compileId=" + compileId + ", isValid=" + isValid + ", userRegion1=" + userRegion1
+ ", userRegion2=" + userRegion2 + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4
diff --git a/src/main/java/com/nis/domain/configuration/AppIpCfg.java b/src/main/java/com/nis/domain/configuration/AppIpCfg.java index b106635e4..dc1b79b82 100644 --- a/src/main/java/com/nis/domain/configuration/AppIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppIpCfg.java @@ -1,8 +1,6 @@ package com.nis.domain.configuration;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField;
@@ -34,11 +32,13 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> { @ExcelField(title="ip_type",dictType="IP_TYPE",sort=3)
@SerializedName("ipType")
protected Integer ipType;
- protected Integer ipPattern;
+ protected Integer srcIpPattern;
+ protected Integer destIpPattern;
protected String srcIpAddress;
@ExcelField(title="server_ip",sort=4)
protected String destIpAddress;
- protected Integer portPattern;
+ protected Integer srcPortPattern;
+ protected Integer destPortPattern;
protected String srcPort;
@ExcelField(title="server_port",sort=5)
protected String destPort;
@@ -121,34 +121,7 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> { // this.protocolId = protocolId;
// }
- /**
- * ipPattern
- * @return ipPattern
- */
- public Integer getIpPattern() {
- return ipPattern;
- }
- /**
- * @param ipPattern the ipPattern to set
- */
- public void setIpPattern(Integer ipPattern) {
- this.ipPattern = ipPattern;
- }
- /**
- * portPattern
- * @return portPattern
- */
-
- public Integer getPortPattern() {
- return portPattern;
- }
- /**
- * @param portPattern the portPattern to set
- */
- public void setPortPattern(Integer portPattern) {
- this.portPattern = portPattern;
- }
/**
* srcIpAddress
@@ -158,6 +131,30 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> { public String getSrcIpAddress() {
return srcIpAddress;
}
+ public Integer getSrcIpPattern() {
+ return srcIpPattern;
+ }
+ public void setSrcIpPattern(Integer srcIpPattern) {
+ this.srcIpPattern = srcIpPattern;
+ }
+ public Integer getDestIpPattern() {
+ return destIpPattern;
+ }
+ public void setDestIpPattern(Integer destIpPattern) {
+ this.destIpPattern = destIpPattern;
+ }
+ public Integer getSrcPortPattern() {
+ return srcPortPattern;
+ }
+ public void setSrcPortPattern(Integer srcPortPattern) {
+ this.srcPortPattern = srcPortPattern;
+ }
+ public Integer getDestPortPattern() {
+ return destPortPattern;
+ }
+ public void setDestPortPattern(Integer destPortPattern) {
+ this.destPortPattern = destPortPattern;
+ }
/**
* @param srcIpAddress the srcIpAddress to set
*/
@@ -257,16 +254,10 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> { public String toString() {
return "AppIpCfg [compileId=" + compileId + ", ratelimit=" + ratelimit + ", appCode=" + appCode + ", behavCode="
+ behavCode + ", specServiceId=" + specServiceId + ", appName=" + appName + ", ipType=" + ipType
- + ", ipPattern=" + ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress
- + ", portPattern=" + portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", direction="
- + direction + ", protocol=" + protocol + ", userRegion1=" + userRegion1 + ", userRegion2=" + userRegion2
- + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4 + ", userRegion5=" + userRegion5
- + ", cfgId=" + cfgId + ", cfgDesc=" + cfgDesc + ", action=" + action + ", isValid=" + isValid
- + ", isAudit=" + isAudit + ", creatorId=" + creatorId + ", createTime=" + createTime + ", editorId="
- + editorId + ", editTime=" + editTime + ", auditorId=" + auditorId + ", auditTime=" + auditTime
- + ", serviceId=" + serviceId + ", requestId=" + requestId + ", cancelRequestId=" + cancelRequestId
- + ", isAreaEffective=" + isAreaEffective + ", classify=" + classify + ", attribute=" + attribute
- + ", lable=" + lable + ", areaEffectiveIds=" + areaEffectiveIds + ", cfgRegionCode=" + cfgRegionCode
- + ", cfgType=" + cfgType + ", functionId=" + functionId + ", doLog=" + doLog + "]";
+ + ", srcIpPattern=" + srcIpPattern + ", destIpPattern=" + destIpPattern + ", srcIpAddress="
+ + srcIpAddress + ", destIpAddress=" + destIpAddress + ", srcPortPattern=" + srcPortPattern
+ + ", destPortPattern=" + destPortPattern + ", srcPort=" + srcPort + ", destPort=" + destPort
+ + ", direction=" + direction + ", protocol=" + protocol + "]";
}
+
}
diff --git a/src/main/java/com/nis/domain/configuration/AreaIpCfg.java b/src/main/java/com/nis/domain/configuration/AreaIpCfg.java index cf8951dcd..0816abd98 100644 --- a/src/main/java/com/nis/domain/configuration/AreaIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/AreaIpCfg.java @@ -59,7 +59,8 @@ public class AreaIpCfg extends BaseIpCfg { this.cfgType=Constants.AREA_REGION;
this.cfgRegionCode=1;
this.protocol=0;
- this.portPattern=1;
+ this.srcPortPattern=1;
+ this.destPortPattern=1;
this.srcPort="0";
this.destPort="0";
this.direction=0;
diff --git a/src/main/java/com/nis/domain/configuration/BaseIpCfg.java b/src/main/java/com/nis/domain/configuration/BaseIpCfg.java index a43e094ba..43f0de7c6 100644 --- a/src/main/java/com/nis/domain/configuration/BaseIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/BaseIpCfg.java @@ -45,14 +45,18 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> { @SerializedName("ipType")
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
protected Integer ipType;
- @ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=51)
- protected Integer ipPattern;
- @ExcelField(title="client_ip",sort=53)
+ @ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
+ protected Integer srcIpPattern;
+ @ExcelField(title="client_ip",sort=52)
protected String srcIpAddress;
- @ExcelField(title="server_ip",sort=52)
+ @ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
+ protected Integer destIpPattern;
+ @ExcelField(title="server_ip",sort=54)
protected String destIpAddress;
- @ExcelField(title="port_pattern",dictType="PORT_PATTERN",sort=54)
- protected Integer portPattern;
+ @ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
+ protected Integer srcPortPattern;
+ @ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
+ protected Integer destPortPattern;
@ExcelField(title="client_port",sort=55)
protected String srcPort;
@ExcelField(title="server_port",sort=56)
@@ -269,35 +273,31 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> { this.protocolId = protocolId;
}
- /**
- * ipPattern
- * @return ipPattern
- */
- public Integer getIpPattern() {
- return ipPattern;
+ public Integer getSrcIpPattern() {
+ return srcIpPattern;
}
- /**
- * @param ipPattern the ipPattern to set
- */
- public void setIpPattern(Integer ipPattern) {
- this.ipPattern = ipPattern;
+ public void setSrcIpPattern(Integer srcIpPattern) {
+ this.srcIpPattern = srcIpPattern;
}
- /**
- * portPattern
- * @return portPattern
- */
-
- public Integer getPortPattern() {
- return portPattern;
+ public Integer getDestIpPattern() {
+ return destIpPattern;
}
- /**
- * @param portPattern the portPattern to set
- */
- public void setPortPattern(Integer portPattern) {
- this.portPattern = portPattern;
+ public void setDestIpPattern(Integer destIpPattern) {
+ this.destIpPattern = destIpPattern;
+ }
+ public Integer getSrcPortPattern() {
+ return srcPortPattern;
+ }
+ public void setSrcPortPattern(Integer srcPortPattern) {
+ this.srcPortPattern = srcPortPattern;
+ }
+ public Integer getDestPortPattern() {
+ return destPortPattern;
+ }
+ public void setDestPortPattern(Integer destPortPattern) {
+ this.destPortPattern = destPortPattern;
}
-
/**
* srcIpAddress
* @return srcIpAddress
diff --git a/src/main/java/com/nis/domain/configuration/template/IpAddrTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpAddrTemplate.java deleted file mode 100644 index 148755b30..000000000 --- a/src/main/java/com/nis/domain/configuration/template/IpAddrTemplate.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.nis.domain.configuration.template;
-
-/**
- * wx 将部分字段的标题改变,或者不需要的字段隐藏
- * 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
- * @author dell
- *
- */
-@Deprecated
-public class IpAddrTemplate extends IpCfgTemplate {
-
-
- @Override
- public Integer getIrType() {
- // TODO Auto-generated method stub
- return super.getIrType();
- }
-
- @Override
- public Integer getDnsStrategyId() {
- // TODO Auto-generated method stub
- return super.getDnsStrategyId();
- }
-
- @Override
- public String getRatelimit() {
- // TODO Auto-generated method stub
- return super.getRatelimit();
- }
-
-}
diff --git a/src/main/java/com/nis/domain/configuration/template/IpAllTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpAllTemplate.java index 860577947..66e4263f2 100644 --- a/src/main/java/com/nis/domain/configuration/template/IpAllTemplate.java +++ b/src/main/java/com/nis/domain/configuration/template/IpAllTemplate.java @@ -8,7 +8,6 @@ */
package com.nis.domain.configuration.template;
-import com.google.gson.JsonObject;
import com.nis.util.excel.ExcelField;
/**
diff --git a/src/main/java/com/nis/domain/configuration/template/IpCfgTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpCfgTemplate.java deleted file mode 100644 index 06b94dfe2..000000000 --- a/src/main/java/com/nis/domain/configuration/template/IpCfgTemplate.java +++ /dev/null @@ -1,310 +0,0 @@ -/**
- *@Title: BaseStringConfig.java
- *@Package com.nis.domain.restful
- *@Description TODO
- *@author dell
- *@date 2018年2月5日 下午5:26:02
- *@version 版本号
- */
-package com.nis.domain.configuration.template;
-
-import com.nis.util.excel.ExcelField;
-
-/**
- * @Description: excel导入IP类配置
- */
-@Deprecated
-public class IpCfgTemplate {
-
- /**
- * @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
- *
- * @since 1.0.0
- */
-
-
-
- private Long cfgId;
- private Integer ipType;//1
- private Integer ipPattern;//2
- private String srcIpAddress; //3
- private String destIpAddress; //4
- private Integer portPattern; //5
- private String srcPort; //6
- private String destPort;//7
- private Integer protocol;//8
- protected Integer direction;//9
- private String cfgDesc;//10
- private Integer requestId;//11
- private String requestName;//12
- private Integer isAreaEffective;//13
- private String classify;//14
- private String attribute;//15
- private String lable;//16
- private String classifyName;//17
- private String attributeName;//18
- private String lableName;//19
- private String areaEffectiveIds;//20
- private String ratelimit;//21
- private Integer dnsStrategyId;//22
- private Integer irType;//23
- private String userRegion1;//77
- private String userRegion2;//78
- private String userRegion3;//79
- private String userRegion4;//80
- private String userRegion5;//81
-
- /**
- * userRegion1
- * @return userRegion1
- */
-// @ExcelField(title="userregion1",align=2,sort=77)
- public String getUserRegion1() {
- return userRegion1;
- }
- /**
- * @param userRegion1 the userRegion1 to set
- */
- public void setUserRegion1(String userRegion1) {
- this.userRegion1 = userRegion1;
- }
- /**
- * userRegion2
- * @return userRegion2
- */
-// @ExcelField(title="userregion2",align=2,sort=78)
- public String getUserRegion2() {
- return userRegion2;
- }
- /**
- * @param userRegion2 the userRegion2 to set
- */
- public void setUserRegion2(String userRegion2) {
- this.userRegion2 = userRegion2;
- }
- /**
- * userRegion3
- * @return userRegion3
- */
-// @ExcelField(title="userregion3",align=2,sort=79)
- public String getUserRegion3() {
- return userRegion3;
- }
- /**
- * @param userRegion3 the userRegion3 to set
- */
- public void setUserRegion3(String userRegion3) {
- this.userRegion3 = userRegion3;
- }
- /**
- * userRegion4
- * @return userRegion4
- */
-// @ExcelField(title="userregion4",align=2,sort=80)
- public String getUserRegion4() {
- return userRegion4;
- }
- /**
- * @param userRegion4 the userRegion4 to set
- */
- public void setUserRegion4(String userRegion4) {
- this.userRegion4 = userRegion4;
- }
- /**
- * userRegion5
- * @return userRegion5
- */
-// @ExcelField(title="userregion5",align=2,sort=81)
- public String getUserRegion5() {
- return userRegion5;
- }
- /**
- * @param userRegion5 the userRegion5 to set
- */
- public void setUserRegion5(String userRegion5) {
- this.userRegion5 = userRegion5;
- }
- /**
- * ratelimit
- * @return ratelimit
- */
- @ExcelField(title="ratelimit",align=2,sort=74)
- public String getRatelimit() {
- return ratelimit;
- }
- /**
- * @param ratelimit the ratelimit to set
- */
- public void setRatelimit(String ratelimit) {
- this.ratelimit = ratelimit;
- }
- /**
- * irType
- * @return irType
- */
- @ExcelField(title="ir_type",align=2,sort=76)
- public Integer getIrType() {
- return irType;
- }
- /**
- * @param irType the irType to set
- */
- public void setIrType(Integer irType) {
- this.irType = irType;
- }
- /**
- * dnsStrategyId
- * @return dnsStrategyId
- */
- @ExcelField(title="dns_strategy_id",align=2,sort=75)
- public Integer getDnsStrategyId() {
- return dnsStrategyId;
- }
- /**
- * @param dnsStrategyId the dnsStrategyId to set
- */
- public void setDnsStrategyId(Integer dnsStrategyId) {
- this.dnsStrategyId = dnsStrategyId;
- }
- @ExcelField(title="ip_type",align=2,sort=1)
- public Integer getIpType() {
- return ipType;
- }
- public void setIpType(Integer ipType) {
- this.ipType = ipType;
- }
- @ExcelField(title="ip_pattern",align=2,sort=2)
- public Integer getIpPattern() {
- return ipPattern;
- }
- public void setIpPattern(Integer ipPattern) {
- this.ipPattern = ipPattern;
- }
- @ExcelField(title="client_ip",align=2,sort=3)
- public String getSrcIpAddress() {
- return srcIpAddress;
- }
- public void setSrcIpAddress(String srcIpAddress) {
- this.srcIpAddress = srcIpAddress;
- }
- @ExcelField(title="server_ip",align=2,sort=4)
- public String getDestIpAddress() {
- return destIpAddress;
- }
- public void setDestIpAddress(String destIpAddress) {
- this.destIpAddress = destIpAddress;
- }
- @ExcelField(title="port_pattern",align=2,sort=5)
- public Integer getPortPattern() {
- return portPattern;
- }
- public void setPortPattern(Integer portPattern) {
- this.portPattern = portPattern;
- }
- @ExcelField(title="client_port",align=2,sort=6)
- public String getSrcPort() {
- return srcPort;
- }
- public void setSrcPort(String srcPort) {
- this.srcPort = srcPort;
- }
- @ExcelField(title="server_port",align=2,sort=7)
- public String getDestPort() {
- return destPort;
- }
- public void setDestPort(String destPort) {
- this.destPort = destPort;
- }
- public Long getCfgId() {
- return cfgId;
- }
- public void setCfgId(Long cfgId) {
- this.cfgId = cfgId;
- }
- @ExcelField(title="direction",align=2,sort=8)
- public Integer getDirection() {
- return direction;
- }
- public void setDirection(Integer direction) {
- this.direction = direction;
- }
- @ExcelField(title="config_describe",align=2,sort=11)
- public String getCfgDesc() {
- return cfgDesc;
- }
- public void setCfgDesc(String cfgDesc) {
- this.cfgDesc = cfgDesc;
- }
- @ExcelField(title="letter",align=2,sort=13)
- public Integer getRequestId() {
- return requestId;
- }
- public void setRequestId(Integer requestId) {
- this.requestId = requestId;
- }
- public String getRequestName() {
- return requestName;
- }
- public void setRequestName(String requestName) {
- this.requestName = requestName;
- }
- public Integer getIsAreaEffective() {
- return isAreaEffective;
- }
- public void setIsAreaEffective(Integer isAreaEffective) {
- this.isAreaEffective = isAreaEffective;
- }
- @ExcelField(title="classification",align=2,sort=71)
- public String getClassify() {
- return classify;
- }
- public void setClassify(String classify) {
- this.classify = classify;
- }
- @ExcelField(title="attribute",align=2,sort=72)
- public String getAttribute() {
- return attribute;
- }
- public void setAttribute(String attribute) {
- this.attribute = attribute;
- }
- @ExcelField(title="label",align=2,sort=73)
- public String getLable() {
- return lable;
- }
- public void setLable(String lable) {
- this.lable = lable;
- }
- public String getClassifyName() {
- return classifyName;
- }
- public void setClassifyName(String classifyName) {
- this.classifyName = classifyName;
- }
- public String getAttributeName() {
- return attributeName;
- }
- public void setAttributeName(String attributeName) {
- this.attributeName = attributeName;
- }
- public String getLableName() {
- return lableName;
- }
- public void setLableName(String lableName) {
- this.lableName = lableName;
- }
-// @ExcelField(title="area_effective",align=2,sort=70)
- public String getAreaEffectiveIds() {
- return areaEffectiveIds;
- }
- public void setAreaEffectiveIds(String areaEffectiveIds) {
- this.areaEffectiveIds = areaEffectiveIds;
- }
- @ExcelField(title="protocol",align=2,sort=9)
- public Integer getProtocol() {
- return protocol;
- }
- public void setProtocol(Integer protocol) {
- this.protocol = protocol;
- }
-}
diff --git a/src/main/java/com/nis/domain/configuration/template/IpMultiplexPolicyTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpMultiplexPolicyTemplate.java deleted file mode 100644 index 543019390..000000000 --- a/src/main/java/com/nis/domain/configuration/template/IpMultiplexPolicyTemplate.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.nis.domain.configuration.template;
-
-import com.nis.util.excel.ExcelField;
-/**
- * wx 将部分字段的标题改变,或者不需要的字段隐藏
- * 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
- * @author dell
- *
- */
-@Deprecated
-public class IpMultiplexPolicyTemplate extends IpCfgTemplate {
- @Override
- @ExcelField(title="IP",align=2,sort=3)
- public String getSrcIpAddress() {
- return super.getSrcIpAddress();
- }
- @ExcelField(title="port",align=2,sort=6)
- @Override
- public String getSrcPort() {
- // TODO Auto-generated method stub
- return super.getSrcPort();
- }
-
- @Override
- @ExcelField(title="group_name",align=2,sort=75)
- public Integer getDnsStrategyId() {
- // TODO Auto-generated method stub
- return super.getDnsStrategyId();
- }
-
- @Override
- public String getRatelimit() {
- // TODO Auto-generated method stub
- return super.getRatelimit();
- }
- @Override
- public String getDestPort() {
- // TODO Auto-generated method stub
- return super.getDestPort();
- }
- @Override
- public String getDestIpAddress() {
- // TODO Auto-generated method stub
- return super.getDestIpAddress();
- }
-
-}
diff --git a/src/main/java/com/nis/domain/configuration/template/IpsecTemplate.java b/src/main/java/com/nis/domain/configuration/template/IpsecTemplate.java deleted file mode 100644 index 5805e99ad..000000000 --- a/src/main/java/com/nis/domain/configuration/template/IpsecTemplate.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.nis.domain.configuration.template;
-
-/**
- * wx 将部分字段的标题改变,或者不需要的字段隐藏
- * 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
- * @author dell
- *
- */
-@Deprecated
-public class IpsecTemplate extends IpCfgTemplate {
-
-
- @Override
- public Integer getIrType() {
- // TODO Auto-generated method stub
- return super.getIrType();
- }
-
- @Override
- public Integer getDnsStrategyId() {
- // TODO Auto-generated method stub
- return super.getDnsStrategyId();
- }
-
- @Override
- public String getRatelimit() {
- // TODO Auto-generated method stub
- return super.getRatelimit();
- }
-
-}
diff --git a/src/main/java/com/nis/domain/configuration/template/TunnelIpTemplate.java b/src/main/java/com/nis/domain/configuration/template/TunnelIpTemplate.java deleted file mode 100644 index c2cde9b73..000000000 --- a/src/main/java/com/nis/domain/configuration/template/TunnelIpTemplate.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.nis.domain.configuration.template;
-
-/**
- * wx 将部分字段的标题改变,或者不需要的字段隐藏
- * 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
- * @author dell
- *
- */
-@Deprecated
-public class TunnelIpTemplate extends IpCfgTemplate {
-
-
- @Override
- public Integer getIrType() {
- // TODO Auto-generated method stub
- return super.getIrType();
- }
-
- @Override
- public Integer getDnsStrategyId() {
- // TODO Auto-generated method stub
- return super.getDnsStrategyId();
- }
-
- @Override
- public String getRatelimit() {
- // TODO Auto-generated method stub
- return super.getRatelimit();
- }
-
- @Override
- public Integer getProtocol() {
- // TODO Auto-generated method stub
- return 0;
- }
-
-}
diff --git a/src/main/java/com/nis/domain/configuration/template/WhiteListIpTemplate.java b/src/main/java/com/nis/domain/configuration/template/WhiteListIpTemplate.java deleted file mode 100644 index 63167ab56..000000000 --- a/src/main/java/com/nis/domain/configuration/template/WhiteListIpTemplate.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.nis.domain.configuration.template;
-
-/**
- * wx 将部分字段的标题改变,或者不需要的字段隐藏
- * 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
- * @author dell
- *
- */
-@Deprecated
-public class WhiteListIpTemplate extends IpCfgTemplate {
-
- @Override
- public Integer getDirection() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public Integer getProtocol() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public Integer getIrType() {
- // TODO Auto-generated method stub
- return super.getIrType();
- }
-
- @Override
- public Integer getDnsStrategyId() {
- // TODO Auto-generated method stub
- return super.getDnsStrategyId();
- }
-
- @Override
- public Integer getRequestId() {
- // TODO Auto-generated method stub
- return super.getRequestId();
- }
-
- @Override
- public String getClassify() {
- // TODO Auto-generated method stub
- return super.getClassify();
- }
-
- @Override
- public String getAttribute() {
- // TODO Auto-generated method stub
- return super.getAttribute();
- }
-
- @Override
- public String getLable() {
- // TODO Auto-generated method stub
- return super.getLable();
- }
-
- @Override
- public String getRatelimit() {
- // TODO Auto-generated method stub
- return super.getRatelimit();
- }
-
-}
diff --git a/src/main/java/com/nis/domain/specific/SpecificServiceHostCfg.java b/src/main/java/com/nis/domain/specific/SpecificServiceHostCfg.java index b775736b0..b957e7548 100644 --- a/src/main/java/com/nis/domain/specific/SpecificServiceHostCfg.java +++ b/src/main/java/com/nis/domain/specific/SpecificServiceHostCfg.java @@ -30,13 +30,15 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{ @Expose
private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp,0表示任意
@Expose
- private Integer ipPattern; //ip格式
+ private Integer srcIpPattern; //ip格式
+ private Integer destIpPattern; //ip格式
@Expose
private String srcIpAddress; //源(客户端)IP地址
@Expose
private String destIpAddress; //目的(服务器)IP地址
@Expose
- private Integer portPattern; //端口格式
+ private Integer srcPortPattern; //端口格式
+ private Integer destPortPattern; //端口格式
@Expose
private String srcPort; //源(客户端)端口
@Expose
@@ -114,19 +116,33 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{ public void setDestPort(String destPort) {
this.destPort = destPort;
}
- @ExcelField(title="ip_pattern",align=2,sort=21,fieldType=Integer.class)
- public Integer getIpPattern() {
- return ipPattern;
+ @ExcelField(title="src_ip_pattern",align=2,sort=21,fieldType=Integer.class)
+ public Integer getSrcIpPattern() {
+ return srcIpPattern;
}
- public void setIpPattern(Integer ipPattern) {
- this.ipPattern = ipPattern;
+ public void setSrcIpPattern(Integer srcIpPattern) {
+ this.srcIpPattern = srcIpPattern;
}
- @ExcelField(title="port_pattern",align=2,sort=40,fieldType=Integer.class)
- public Integer getPortPattern() {
- return portPattern;
+ @ExcelField(title="dest_ip_pattern",align=2,sort=22,fieldType=Integer.class)
+ public Integer getDestIpPattern() {
+ return destIpPattern;
}
- public void setPortPattern(Integer portPattern) {
- this.portPattern = portPattern;
+ public void setDestIpPattern(Integer destIpPattern) {
+ this.destIpPattern = destIpPattern;
+ }
+ @ExcelField(title="src_port_pattern",align=2,sort=40,fieldType=Integer.class)
+ public Integer getSrcPortPattern() {
+ return srcPortPattern;
+ }
+ public void setSrcPortPattern(Integer srcPortPattern) {
+ this.srcPortPattern = srcPortPattern;
+ }
+ @ExcelField(title="dest_port_pattern",align=2,sort=41,fieldType=Integer.class)
+ public Integer getDestPortPattern() {
+ return destPortPattern;
+ }
+ public void setDestPortPattern(Integer destPortPattern) {
+ this.destPortPattern = destPortPattern;
}
@ExcelField(title="direction",align=2,sort=110)
public Integer getDirection() {
diff --git a/src/main/java/com/nis/util/ConfigConvertUtil.java b/src/main/java/com/nis/util/ConfigConvertUtil.java index c39e733ea..9bdb0d5fc 100644 --- a/src/main/java/com/nis/util/ConfigConvertUtil.java +++ b/src/main/java/com/nis/util/ConfigConvertUtil.java @@ -395,7 +395,7 @@ public class ConfigConvertUtil { */
public static List<IpCfg> ipConvert(IpCfg dstIp, BaseIpCfg srcIp) {
List<IpCfg> ipConvertList = Lists.newArrayList();
- boolean isRange = ((srcIp.getIpPattern() != null && srcIp.getIpPattern() == 2)
+ boolean isRange = (((srcIp.getSrcIpPattern() != null && srcIp.getSrcIpPattern() == 2)||(srcIp.getDestIpPattern()) != null && srcIp.getDestIpPattern() == 2)
|| (srcIp.getSrcIpAddress() != null && srcIp.getSrcIpAddress().indexOf("-") > -1)
|| (srcIp.getDestIpAddress() != null && srcIp.getDestIpAddress().indexOf("-") > -1));
if (isRange) {
diff --git a/src/main/java/com/nis/util/ConfigServiceUtil.java b/src/main/java/com/nis/util/ConfigServiceUtil.java index 7ad8c9b30..961e68aac 100644 --- a/src/main/java/com/nis/util/ConfigServiceUtil.java +++ b/src/main/java/com/nis/util/ConfigServiceUtil.java @@ -133,6 +133,7 @@ public class ConfigServiceUtil { result=response.readEntity(String.class);
}
} catch (Exception e) {
+ logger.error("request_service_failed",e);
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
if(response != null && response.getStatus() == 200){
diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 78e925289..f4a1ac786 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -39,6 +39,7 @@ import org.apache.poi.xssf.usermodel.XSSFClientAnchor; import org.apache.poi.xssf.usermodel.XSSFRichTextString; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.util.Assert; import com.google.common.collect.Lists; import com.nis.domain.FunctionRegionDict; @@ -583,25 +584,28 @@ public class ExportExcel { commentStr=""; } }else{ + String[] ipPatterns=region.getConfigIpPattern().split(";"); if("client_ip".equals(headerStr)){ + Assert.isTrue(ipPatterns.length==2); + String srcIpPattern=ipPatterns[0]; if(((","+region.getConfigIpPortShow()+",").indexOf(",1,") > -1) ){ commentStr=""; if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){ - if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){ + if((","+srcIpPattern+",").indexOf(",3,") > -1){ commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV4_DEFAULT_IP_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){ + if((","+srcIpPattern+",").indexOf(",2,") > -1){ commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){ + if((","+srcIpPattern+",").indexOf(",1,") > -1){ commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE; @@ -610,21 +614,21 @@ public class ExportExcel { } } if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){ - if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){ + if((","+srcIpPattern+",").indexOf(",3,") > -1){ commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV6_DEFAULT_IP_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){ + if((","+srcIpPattern+",").indexOf(",2,") > -1){ commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){ + if((","+srcIpPattern+",").indexOf(",1,") > -1){ commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE; @@ -673,12 +677,12 @@ public class ExportExcel { ,msgProp.getProperty("serverip"))+"\n"; index++; index++; - commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type_pattern"))+"\n"; + commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type"))+"\n"; index++; index++; } //4、IP Range 开始IP和结束IP必须在同一网段 - if(((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1)){ + if(((","+srcIpPattern+",").indexOf(",2,") > -1)){ commentStr=commentStr+"▶"+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n"; index++; index++; @@ -689,7 +693,7 @@ public class ExportExcel { } //6、IPv4 Mask 掩码范围16-32 - if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){ + if(((","+srcIpPattern+",").indexOf(",1,") > -1)){ if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){ commentStr=commentStr+"▶"+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n"; index++; @@ -705,24 +709,25 @@ public class ExportExcel { } if("server_ip".equals(headerStr)){ + String destIpPattern=ipPatterns[1]; if((","+region.getConfigIpPortShow()+",").indexOf(",3,") > -1){ commentStr=""; if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){ - if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){ + if((","+destIpPattern+",").indexOf(",3,") > -1){ commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV4_DEFAULT_IP_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){ + if((","+destIpPattern+",").indexOf(",2,") > -1){ commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){ + if((","+destIpPattern+",").indexOf(",1,") > -1){ commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE; @@ -731,21 +736,21 @@ public class ExportExcel { } } if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){ - if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){ + if((","+destIpPattern+",").indexOf(",3,") > -1){ commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV6_DEFAULT_IP_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){ + if((","+destIpPattern+",").indexOf(",2,") > -1){ commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE; } index++; } - if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){ + if((","+destIpPattern+",").indexOf(",1,") > -1){ commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE; @@ -778,12 +783,12 @@ public class ExportExcel { ,msgProp.getProperty("serverip"))+"\n"; index++; index++; - commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type_pattern"))+"\n"; + commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type"))+"\n"; index++; index++; } //4、IP Range 开始IP和结束IP必须在同一网段 - if(((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1)){ + if(((","+destIpPattern+",").indexOf(",2,") > -1)){ commentStr=commentStr+"▶"+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n"; index++; index++; @@ -794,7 +799,7 @@ public class ExportExcel { } //6、IPv4 Mask 掩码范围16-32 - if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){ + if(((","+destIpPattern+",").indexOf(",1,") > -1)){ if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){ commentStr=commentStr+"▶"+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n"; index++; @@ -820,17 +825,20 @@ public class ExportExcel { }else{ protocol=region.getConfigProtocol(); } + String[] portPatterns=region.getConfigPortPattern().split(";"); + Assert.isTrue(portPatterns.length==2); if("client_port".equals(headerStr)){ + String srcPortPattern=portPatterns[0]; if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1)){ commentStr=""; - if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){ + if((","+srcPortPattern+",").indexOf(",1,") > -1){ commentStr=commentStr+Constants.PORT_DEFAULT+"(Port)"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.PORT_DEFAULT; } index++; } - if((","+region.getConfigPortPattern()+",").indexOf(",2,") > -1){ + if((","+srcPortPattern+",").indexOf(",2,") > -1){ commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"(Port/"+msgProp.getProperty("port_mask")+")"+"\n\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.PORT_MASK_DEFAULT; @@ -856,11 +864,11 @@ public class ExportExcel { index++; } //2、源端口、目的端口格式必须一致 - if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){ - commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n"; - index++; - index++; - } +// if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){ +// commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n"; +// index++; +// index++; +// } //3、端口和端口掩码范围0-65535 commentStr=commentStr+"▶"+msgProp.getProperty("port_mask_comment_tip")+"\n"; index++; @@ -895,16 +903,17 @@ public class ExportExcel { } } if("server_port".equals(headerStr)){ + String destPortPattern=portPatterns[1]; if((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1){ commentStr=""; - if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){ + if((","+destPortPattern+",").indexOf(",1,") > -1){ commentStr=commentStr+Constants.PORT_DEFAULT+"(Port)"+"\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.PORT_DEFAULT; } index++; } - if((","+region.getConfigPortPattern()+",").indexOf(",2,") > -1){ + if((","+destPortPattern+",").indexOf(",2,") > -1){ commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"(Port/"+msgProp.getProperty("port_mask")+")"+"\n\n"; if(StringUtil.isEmpty(defaultValue)){ defaultValue=Constants.PORT_MASK_DEFAULT; @@ -930,11 +939,11 @@ public class ExportExcel { index++; } //2、源端口、目的端口格式必须一致 - if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){ - commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n"; - index++; - index++; - } +// if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){ +// commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n"; +// index++; +// index++; +// } //3、端口和端口掩码范围0-65535 commentStr=commentStr+"▶"+msgProp.getProperty("port_mask_comment_tip")+"\n"; index++; diff --git a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java index 7fc55e9ec..954bf972a 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger;
import org.jets3t.service.ServiceException;
import org.springframework.beans.BeanUtils;
+import org.springframework.util.Assert;
import com.beust.jcommander.internal.Lists;
import com.nis.domain.FunctionRegionDict;
@@ -27,6 +28,7 @@ import com.nis.domain.configuration.template.IpRateLimitTemplate; //import com.nis.util.AsnCacheUtils;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
+import com.nis.util.IPUtil;
import com.nis.util.StringUtil;
public class CheckIpFormatThread implements Callable<String>{
@@ -92,14 +94,20 @@ public class CheckIpFormatThread implements Callable<String>{ }
boolean canIPv4 = ipType.indexOf("4") > -1;
boolean canIPv6 = ipType.indexOf("6") > -1;
- String ipPattern = regionDict.getConfigIpPattern();
- if (StringUtils.isBlank(ipPattern)) {
+ String[] ipPattern = regionDict.getConfigIpPattern().split(";");
+ Assert.isTrue(ipPattern!=null&&ipPattern.length==2);
+ String srcIpPattern = ipPattern[0];
+ String destIpPattern = ipPattern[1];
+ if (StringUtils.isBlank(srcIpPattern)||StringUtils.isBlank(destIpPattern)) {
throw new RuntimeException("Found IP region,but ipPattern is Empty");
}
boolean canIPFormat = ipType.indexOf("3") > -1;
boolean canIPSubnetFormat = ipType.indexOf("1") > -1;
boolean canIPRangeFormat = ipType.indexOf("2") > -1;
- String portPattern = regionDict.getConfigPortPattern();
+ String[] portPattern = regionDict.getConfigPortPattern().split(";");
+ Assert.isTrue(ipPattern!=null&&ipPattern.length==2);
+ String srcPortPattern=portPattern[0];
+ String destPortPattern=portPattern[1];
String protocol = regionDict.getConfigProtocol();
String direction = regionDict.getConfigDirection();
StringBuffer errTip = new StringBuffer();
@@ -621,74 +629,40 @@ public class CheckIpFormatThread implements Callable<String>{ prop.getProperty("server_ip", "Server IP")) + ";");
} else if (configIpPortShow.indexOf("1") > -1) {
String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(),
- ipType, ipPattern);
+ ipType, srcIpPattern);
+ //设置源IP pattern
+ if (matchType.endsWith("RANGE")) {
+ baseIpCfg.setSrcIpPattern(2);
+ } else if (matchType.endsWith("SUBNET")) {
+ baseIpCfg.setSrcIpPattern(1);
+ }else {
+ baseIpCfg.setSrcIpPattern(3);
+ }
if (matchType.startsWith("IPV6")) {
- if (matchType.endsWith("RANGE")) {
- // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
- baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
- baseIpCfg.setIpPattern(2);
- if (baseIpCfg.getSrcIpAddress()
- .startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
- errInfo.append(prop.getProperty("client_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
- + ";");
- }
- } else if (matchType.endsWith("SUBNET")) {
- // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
- baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
- baseIpCfg.setIpPattern(1);
- if (baseIpCfg.getSrcIpAddress()
- .startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
- errInfo.append(
- prop.getProperty("client_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
- + ";");
- }
- } else {
- // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
+ //设置dest ip值
+ if(destIpPattern.indexOf("3")>-1) {//优先设置IP类型,因为拆分的IP较少
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
- baseIpCfg.setIpPattern(3);
- if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
- errInfo.append(prop.getProperty("client_ip")+" " + String.format(
- prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
- }
+ baseIpCfg.setDestIpPattern(3);
+ }else if(destIpPattern.indexOf("1")>-1) {
+ baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
+ baseIpCfg.setDestIpPattern(1);
+ }else {
+ baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
+ baseIpCfg.setDestIpPattern(2);
}
+ //设置IP类型
baseIpCfg.setIpType(6);
} else {
- if (matchType.endsWith("RANGE")) {
- this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress());
- // baseIpCfg.setSrcIpAddress("0.0.0.0-"+baseIpCfg.getSrcIpAddress().split("-")[0].substring(0,baseIpCfg.getSrcIpAddress().indexOf("-")+1)+baseIpCfg.getSrcIpAddress().split("-")[1]);
- baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
- baseIpCfg.setIpPattern(2);
- if (baseIpCfg.getSrcIpAddress()
- .startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
- errInfo.append(prop.getProperty("client_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
- + ";");
- }
- } else if (matchType.endsWith("SUBNET")) {
- // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
- baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
- baseIpCfg.setIpPattern(1);
- if (baseIpCfg.getSrcIpAddress()
- .startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
- errInfo.append(
- prop.getProperty("client_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
- + ";");
- }
- } else {
- baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
+ //设置dest ip值
+ if(destIpPattern.indexOf("3")>-1) {//优先设置IP类型,因为拆分的IP较少
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
- baseIpCfg.setIpPattern(3);
- if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
- errInfo.append(prop.getProperty("client_ip")+" " + String.format(
- prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
- }
+ baseIpCfg.setDestIpPattern(3);
+ }else if(destIpPattern.indexOf("1")>-1) {
+ baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
+ baseIpCfg.setDestIpPattern(1);
+ }else {
+ baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
+ baseIpCfg.setDestIpPattern(2);
}
baseIpCfg.setIpType(4);
}
@@ -700,166 +674,169 @@ public class CheckIpFormatThread implements Callable<String>{ prop.getProperty("client_ip", "Client IP")) + ";");
} else if (configIpPortShow.indexOf("3") > -1) {
String matchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(),
- ipType, ipPattern);
+ ipType, destIpPattern);
+ if (matchType.endsWith("RANGE")) {
+ baseIpCfg.setDestIpPattern(2);
+ } else if (matchType.endsWith("SUBNET")) {
+ baseIpCfg.setDestIpPattern(1);
+ }else {
+ baseIpCfg.setDestIpPattern(3);
+ }
if (matchType.startsWith("IPV6")) {
- if (matchType.endsWith("RANGE")) {
- // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
- baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
- baseIpCfg.setIpPattern(2);
- if (baseIpCfg.getDestIpAddress()
- .startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
- errInfo.append(prop.getProperty("server_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
- + ";");
- }
- } else if (matchType.endsWith("SUBNET")) {
- // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
- baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
- baseIpCfg.setIpPattern(1);
- if (baseIpCfg.getDestIpAddress()
- .startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
- errInfo.append(
- prop.getProperty("server_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
- + ";");
- }
- } else {
- // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
+ if(srcIpPattern.indexOf("3")>-1) {
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
- baseIpCfg.setIpPattern(3);
- if (baseIpCfg.getDestIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
- errInfo.append(prop.getProperty("server_ip")+" " + String.format(
- prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
- }
+ baseIpCfg.setSrcIpPattern(3);
+ }else if(srcIpPattern.indexOf("1")>-1) {
+ baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
+ baseIpCfg.setSrcIpPattern(1);
+ }else {
+ baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
+ baseIpCfg.setSrcIpPattern(2);
}
baseIpCfg.setIpType(6);
} else {
- if (matchType.endsWith("RANGE")) {
- this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress());
- // baseIpCfg.setDestIpAddress("0.0.0.0-"+baseIpCfg.getDestIpAddress().split("-")[0]
- // .substring(0,baseIpCfg.getDestIpAddress().indexOf("-")+1)
- // +baseIpCfg.getDestIpAddress().split("-")[1]);
- baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
- baseIpCfg.setIpPattern(2);
- if (baseIpCfg.getDestIpAddress()
- .startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
- errInfo.append(prop.getProperty("server_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
- + ";");
- }
- } else if (matchType.endsWith("SUBNET")) {
- // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
- baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
- baseIpCfg.setIpPattern(1);
- if (baseIpCfg.getDestIpAddress()
- .startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
- errInfo.append(
- prop.getProperty("server_ip")+" "
- + String.format(prop.getProperty("can_not_be"),
- Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
- + ";");
- }
- } else {
- // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
+ if(srcIpPattern.indexOf("3")>-1) {
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
- baseIpCfg.setIpPattern(3);
- if (baseIpCfg.getDestIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
- errInfo.append(prop.getProperty("server_ip")+" " + String.format(
- prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
- }
+ baseIpCfg.setSrcIpPattern(3);
+ }else if(srcIpPattern.indexOf("1")>-1) {
+ baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
+ baseIpCfg.setSrcIpPattern(1);
+ }else {
+ baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
+ baseIpCfg.setSrcIpPattern(2);
}
baseIpCfg.setIpType(4);
}
}
} else {// 全不为空
- String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType,
- ipPattern);
- String matchType1 = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType,
- ipPattern);
- if (StringUtils.isNotBlank(matchType) && StringUtils.isNotBlank(matchType1)
- && !matchType.equals(matchType1)) {
- errInfo.append(prop.get("the_same_ip_type_pattern") + ";");
+ String srcMatchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType,
+ srcIpPattern);
+ String destMatchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType,
+ destIpPattern);
+ if (StringUtils.isNotBlank(srcMatchType) && StringUtils.isNotBlank(destMatchType)
+ && ((srcMatchType.startsWith("IPV6")&&destMatchType.startsWith("IPV4"))
+ ||(srcMatchType.startsWith("IPV4")&&destMatchType.startsWith("IPV6")))) {
+ errInfo.append(prop.get("the_same_ip_type") + ";");
}
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
- if (matchType.startsWith("IPV6")) {
+ if (srcMatchType.startsWith("IPV6")) {
baseIpCfg.setIpType(6);
} else {
baseIpCfg.setIpType(4);
}
- if (matchType.endsWith("RANGE")) {
- if (matchType.startsWith("IPV4")) {
+ if (srcMatchType.endsWith("RANGE")) {
+ baseIpCfg.setSrcIpPattern(2);
+ }else if(srcMatchType.endsWith("SUBNET")) {
+ baseIpCfg.setSrcIpPattern(1);
+ }else {
+ baseIpCfg.setSrcIpPattern(3);
+ }
+ if (destMatchType.endsWith("RANGE")) {
+ baseIpCfg.setDestIpPattern(2);
+ }else if(destMatchType.endsWith("SUBNET")) {
+ baseIpCfg.setDestIpPattern(1);
+ }else {
+ baseIpCfg.setDestIpPattern(3);
+ }
+ if(baseIpCfg.getIpType().equals(4)) {
+ if (srcMatchType.endsWith("RANGE")) {
this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress());
+ }
+ if (destMatchType.endsWith("RANGE")) {
this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress());
}
-
- if (baseIpCfg.getSrcIpAddress().split("-")[0]
- .equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
- errInfo.append(String.format(prop.getProperty("are_the_same"),
- baseIpCfg.getSrcIpAddress().split("-")[0],
- baseIpCfg.getDestIpAddress().split("-")[0]) + ";");
+ //验证Ip范围
+ if(StringUtils.isEmpty(errInfo)&&(srcMatchType.endsWith("RANGE")||destMatchType.endsWith("RANGE"))) {
+ this.ValidateRangeCross(baseIpCfg.getSrcIpAddress(),baseIpCfg.getDestIpAddress(), errInfo);
}
- baseIpCfg.setIpPattern(2);
- } else if (matchType.endsWith("SUBNET")) {
- if (baseIpCfg.getSrcIpAddress().split("/")[0]
- .equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
- errInfo.append(String.format(prop.getProperty("are_the_same"),
- baseIpCfg.getSrcIpAddress().split("/")[0],
- baseIpCfg.getDestIpAddress().split("/")[0]) + ";");
+ }
+ boolean same=false;
+ if(baseIpCfg.getSrcIpAddress().indexOf("-")>-1) {
+ if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
+ if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
+ same=true;
+ }
+ }else if(baseIpCfg.getDestIpAddress().indexOf("/")>-1) {
+ if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
+ same=true;
+ }
+ }else {
+ if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress())) {
+ same=true;
+ }
}
- baseIpCfg.setIpPattern(1);
- } else {
- if (baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) {
- errInfo.append(String.format(prop.getProperty("are_the_same"),
- prop.getProperty("client_ip"), prop.getProperty("server_ip")) + ";");
+ }else if(baseIpCfg.getSrcIpAddress().indexOf("/")>-1){
+ if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
+ if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
+ same=true;
+ }
+ }else if(baseIpCfg.getDestIpAddress().indexOf("/")>-1) {
+ if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
+ same=true;
+ }
+ }else {
+ if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress())) {
+ same=true;
+ }
+ }
+ }else {
+ if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
+ if(baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
+ same=true;
+ }
+ }else if(baseIpCfg.getDestIpAddress().indexOf("/")>-1) {
+ if(baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress().split("/")[0])) {
+ same=true;
+ }
+ }else {
+ if(baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) {
+ same=true;
+ }
}
- baseIpCfg.setIpPattern(3);
+ }
+ if(same) {
+ errInfo.append(String.format(prop.getProperty("are_the_same"),
+ baseIpCfg.getSrcIpAddress().split("-")[0],
+ baseIpCfg.getDestIpAddress().split("-")[0]) + ";");
}
}
// TODO 判断源IP和目的IP的值
// TODO 判断源IP和目的IP格式
- if (destPortEmpty) {
- if (srcPortEmpty) {
+ if (srcPortEmpty) {
+ if(srcPortPattern.indexOf("1")>-1) {
baseIpCfg.setSrcPort("0");
- baseIpCfg.setDestPort("0");
- baseIpCfg.setPortPattern(1);
- } else {
- if (baseIpCfg.getSrcPort().indexOf("/") > -1) {
- baseIpCfg.setDestPort("0/0");
- baseIpCfg.setPortPattern(2);
- } else {
- baseIpCfg.setDestPort("0");
- baseIpCfg.setPortPattern(1);
- }
- baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
+ baseIpCfg.setSrcPortPattern(1);
+ }else {
+ baseIpCfg.setSrcPort("0/0");
+ baseIpCfg.setSrcPortPattern(2);
}
- } else {
- if (srcPortEmpty) {
- if (baseIpCfg.getDestPort().indexOf("/") > -1) {
- baseIpCfg.setSrcPort("0/0");
- baseIpCfg.setPortPattern(2);
- } else {
- baseIpCfg.setSrcPort("0");
- baseIpCfg.setPortPattern(1);
- }
- } else {
- if (baseIpCfg.getSrcPort().indexOf("/") > -1) {
- baseIpCfg.setPortPattern(2);
- } else {
- baseIpCfg.setPortPattern(1);
- }
- baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
+ }else if(baseIpCfg.getSrcPort().indexOf("/")>-1) {
+ baseIpCfg.setSrcPortPattern(2);
+ }else {
+ baseIpCfg.setSrcPortPattern(1);
+ }
+ baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
+ boolean validSrcPort = this.validPort(errInfo, baseIpCfg.getSrcPort(),
+ srcPortPattern,"client_port");
+ if (destPortEmpty) {
+ if(destPortPattern.indexOf("1")>-1) {
+ baseIpCfg.setDestPort("0");
+ baseIpCfg.setDestPortPattern(1);
+ }else {
+ baseIpCfg.setDestPort("0/0");
+ baseIpCfg.setDestPortPattern(2);
}
- baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim());
+ }else if(baseIpCfg.getDestPort().indexOf("/")>-1) {
+ baseIpCfg.setDestPortPattern(2);
+ }else {
+ baseIpCfg.setDestPortPattern(1);
}
- // TODO 判断源端口和目的端口格式
- // TODO 判断源和目的端口的值
- boolean validPort = this.validPort(errInfo, baseIpCfg.getSrcPort(), baseIpCfg.getDestPort(),
- portPattern);
+ baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim());
+ boolean validDestPort = this.validPort(errInfo, baseIpCfg.getSrcPort(),
+ srcPortPattern,"server_port");
+
if (baseIpCfg.getProtocol()==null) {
//packet ip reject
if(regionDict.getFunctionId().equals(5)&&serviceDict!=null&&serviceDict.getServiceId().equals(16)) {
@@ -901,7 +878,7 @@ public class CheckIpFormatThread implements Callable<String>{ }
boolean validProtocol = this.validProtocol(errInfo, baseIpCfg.getProtocol(), protocol);
// 验证protocol与port是否符合逻辑
- if (validProtocol && validPort) {
+ if (validProtocol && validSrcPort&&validDestPort) {
validProtocolAndPort(errInfo, baseIpCfg.getProtocol(), baseIpCfg.getSrcPort(),
baseIpCfg.getDestPort());
}
@@ -1030,153 +1007,85 @@ public class CheckIpFormatThread implements Callable<String>{ * @param portPattern
* @throws ServiceException
*/
- public boolean validPort(StringBuffer errInfo, String srcPortStr, String destPortStr, String portPattern)
+ public boolean validPort(StringBuffer errInfo, String portStr, String portPattern,String portName)
throws ServiceException {
boolean valid = true;
if (portPattern.equals("1")) {
try {
- Integer srcPort = Integer.parseInt(srcPortStr);
+ Integer srcPort = Integer.parseInt(portStr);
if (srcPort < 0 || srcPort > 65535) {
- errInfo.append(prop.getProperty("client_port")
- + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
- valid = false;
- }
- } catch (Exception e) {
- // TODO: handle exception
- errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("client_port")) + ";");
- valid = false;
- }
- try {
- Integer destPort = Integer.parseInt(destPortStr);
- if (destPort < 0 || destPort > 65535) {
- errInfo.append(prop.getProperty("server_port")
+ errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
} catch (Exception e) {
// TODO: handle exception
- errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("server_port")) + ";");
+ errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty(portName)) + ";");
valid = false;
}
+
} else if (portPattern.equals("2")) {
Pattern p = Constants.PORT_MASK_PATTERN;
- Matcher m = p.matcher(srcPortStr);
+ Matcher m = p.matcher(portStr);
if (!m.matches()) {
errInfo.append(
- String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("client_port")) + ";");
+ String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty(portName)) + ";");
valid = false;
}
- m = p.matcher(destPortStr);
- if (!m.matches()) {
- errInfo.append(
- String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("server_port")) + ";");
- valid = false;
- }
- Integer srcPort = Integer.parseInt(srcPortStr.split("/")[0]);
- Integer srcPortMask = Integer.parseInt(srcPortStr.split("/")[1]);
- Integer destPort = Integer.parseInt(destPortStr.split("/")[0]);
- Integer destPortMask = Integer.parseInt(destPortStr.split("/")[1]);
- if (srcPort < 0 || srcPort > 65535) {
- errInfo.append(prop.getProperty("client_port")
- + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
- valid = false;
- }
- if (srcPortMask < 0 || srcPortMask > 65535) {
- errInfo.append(prop.getProperty("client_port_mask")
- + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
- valid = false;
- }
- if (destPort < 0 || destPort > 65535) {
- errInfo.append(prop.getProperty("server_port")
+
+ Integer port = Integer.parseInt(portStr.split("/")[0]);
+ Integer portMask = Integer.parseInt(portStr.split("/")[1]);
+
+ if (port < 0 || port > 65535) {
+ errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
- if (destPortMask < 0 || destPortMask > 65535) {
- errInfo.append(prop.getProperty("server_port_mask")
+ if (portMask < 0 || portMask > 65535) {
+ errInfo.append(prop.getProperty(portName+"_mask")
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
+
} else if (portPattern.indexOf("1") > -1 && portPattern.indexOf("2") > -1) {
Pattern p = Constants.PORT_MASK_PATTERN;
Pattern p1 = Constants.PORT_PATTERN;
- Matcher m = p.matcher(srcPortStr);// 源端口是端口掩码格式
- Matcher m1 = p.matcher(destPortStr);// 目的端口是端口掩码格式
- Matcher m2 = p1.matcher(srcPortStr);// 源端口是端口格式
- Matcher m3 = p1.matcher(destPortStr);// 目的端口是端口格式
+ Matcher m = p.matcher(portStr);// 源端口是端口掩码格式
+ Matcher m2 = p1.matcher(portStr);// 源端口是端口格式
if (m.matches()) {
- Integer srcPort = Integer.parseInt(srcPortStr.split("/")[0]);
- Integer srcPortMask = Integer.parseInt(srcPortStr.split("/")[1]);
+ Integer srcPort = Integer.parseInt(portStr.split("/")[0]);
+ Integer srcPortMask = Integer.parseInt(portStr.split("/")[1]);
if (srcPort < 0 || srcPort > 65535) {
- errInfo.append(prop.getProperty("client_port")
+ errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
if (srcPortMask < 0 || srcPortMask > 65535) {
- errInfo.append(prop.getProperty("client_port_mask")
- + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
- valid = false;
- }
- }
- if (m1.matches()) {
- Integer destPort = Integer.parseInt(destPortStr.split("/")[0]);
- Integer destPortMask = Integer.parseInt(destPortStr.split("/")[1]);
-
- if (destPort < 0 || destPort > 65535) {
- errInfo.append(prop.getProperty("server_port")
- + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
- valid = false;
- }
- if (destPortMask < 0 || destPortMask > 65535) {
- errInfo.append(prop.getProperty("server_port_mask")
+ errInfo.append(prop.getProperty(portName+"_mask")
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
}
if (m2.matches()) {
try {
- Integer srcPort = Integer.parseInt(srcPortStr);
+ Integer srcPort = Integer.parseInt(portStr);
if (srcPort < 0 || srcPort > 65535) {
- errInfo.append(prop.getProperty("client_port")
+ errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
} catch (Exception e) {
// TODO: handle exception
errInfo.append(
- String.format(prop.getProperty("not_number"), prop.getProperty("client_port")) + ";");
+ String.format(prop.getProperty("not_number"), prop.getProperty(portName)) + ";");
valid = false;
}
}
- if (m3.matches()) {
- try {
- Integer destPort = Integer.parseInt(destPortStr);
- if (destPort < 0 || destPort > 65535) {
- errInfo.append(prop.getProperty("server_port")
- + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
- valid = false;
- }
- } catch (Exception e) {
- // TODO: handle exception
- errInfo.append(
- String.format(prop.getProperty("not_number"), prop.getProperty("server_port")) + ";");
- valid = false;
- }
- }
- if ((m.matches() && m3.matches()) || (m2.matches() && m1.matches())) {
- errInfo.append(prop.getProperty("the_same_port_pattern") + ";");
- valid = false;
- }
if (!m.matches() && !m2.matches()) {
errInfo.append(
- String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("client_port")) + ";");
- valid = false;
- }
- if (!m1.matches() && !m3.matches()) {
- errInfo.append(
- String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("server_port")) + ";");
+ String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty(portName)) + ";");
valid = false;
}
-
}
return valid;
}
@@ -1369,7 +1278,44 @@ public class CheckIpFormatThread implements Callable<String>{ }
return matchType;
}
-
+ public void ValidateRangeCross(String srcIp,String destIp,StringBuffer errInfo) {
+ long srcStart=0l,srcEnd=0,srcNum=0l,destStart=0l,destEnd=0l,destNum=0l;
+ if(srcIp.indexOf("-")>-1) {
+ String[] srcArr=srcIp.split("\\-");
+ srcStart=IPUtil.getIpHostDesimal(srcArr[0]);
+ srcEnd=IPUtil.getIpHostDesimal(srcArr[1]);
+ }else if(srcIp.indexOf("/")>-1) {
+ srcNum=IPUtil.getIpHostDesimal(srcIp.split("/")[0]);
+ }else {
+ srcNum=IPUtil.getIpHostDesimal(srcIp);
+ }
+ if(destIp.indexOf("-")>-1) {
+ String[] destArr=destIp.split("\\-");
+ destStart=IPUtil.getIpHostDesimal(destArr[0]);
+ destEnd=IPUtil.getIpHostDesimal(destArr[1]);
+ }else if(destIp.indexOf("/")>-1) {
+ destNum=IPUtil.getIpHostDesimal(destIp.split("/")[0]);
+ }else {
+ destNum=IPUtil.getIpHostDesimal(destIp);
+ }
+ if(srcNum==0l) {
+ if(destNum==0l) {
+ if(!(destEnd<srcStart||srcEnd<destStart)) {
+ errInfo.append(prop.getProperty("range_cross")+";");
+ }
+ }else {
+ if(destNum>=srcStart&&destNum<=srcEnd) {
+ errInfo.append(prop.getProperty("range_cross")+";");
+ }
+ }
+ }else {
+ if(destNum==0l) {
+ if(srcNum>=destStart&&srcNum<=destEnd) {
+ errInfo.append(prop.getProperty("range_cross")+";");
+ }
+ }
+ }
+ }
public List<Map<Long, AsnGroupInfo>> getAsnNoMaps() {
return asnNoMaps;
}
@@ -1382,5 +1328,4 @@ public class CheckIpFormatThread implements Callable<String>{ public void setAsnGroupInfos(Map<Long, AsnGroupInfo> asnGroupInfos) {
this.asnGroupInfos = asnGroupInfos;
}
-
}
diff --git a/src/main/java/com/nis/web/controller/basics/AsnIpController.java b/src/main/java/com/nis/web/controller/basics/AsnIpController.java index f69626e38..15511776c 100644 --- a/src/main/java/com/nis/web/controller/basics/AsnIpController.java +++ b/src/main/java/com/nis/web/controller/basics/AsnIpController.java @@ -79,15 +79,19 @@ public class AsnIpController extends BaseController{ public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
try{
asnIpCfgService.saveAsnIpCfg(cfg);
- addMessage(redirectAttributes,"success","save_success");
- }catch(Exception e){
- logger.error("信息保存失败",e);
- e.printStackTrace();
- if(e instanceof MaatConvertException) {
- addMessage(redirectAttributes,"error",e.getMessage());
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
}else {
- addMessage(redirectAttributes,"error","save_failed");
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("ASN IP配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("ASN IP配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
@@ -98,11 +102,19 @@ public class AsnIpController extends BaseController{ try{
asnIpCfgService.update(cfg);
- addMessage(redirectAttributes,"success","save_success");
- }catch(Exception e){
- logger.error("信息保存失败",e);
- e.printStackTrace();
- addMessage(redirectAttributes,"error","save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
+ }
+ } catch (MaatConvertException e) {
+ logger.error("ASN IP配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("ASN IP配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
diff --git a/src/main/java/com/nis/web/controller/basics/InnerProtectionListController.java b/src/main/java/com/nis/web/controller/basics/InnerProtectionListController.java index ae341bdf4..1b7a971ad 100644 --- a/src/main/java/com/nis/web/controller/basics/InnerProtectionListController.java +++ b/src/main/java/com/nis/web/controller/basics/InnerProtectionListController.java @@ -77,4 +77,31 @@ public class InnerProtectionListController extends BaseController{ public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){
return innerProtectionListService.ajaxGetAllInfo();
}
+
+ /**
+ * 校验配置是否已存在
+ * @param cfg
+ * @param request
+ * @param response
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = {"/checkKeywordExist"})
+ public boolean checkKeywordExist(ProtectionListInfo cfg, HttpServletRequest request, HttpServletResponse response){
+ if(!StringUtil.isEmpty(cfg.getProId())){ // 修改操作
+ ProtectionListInfo info = innerProtectionListService.getById(cfg.getProId());
+ if(info != null && info.getKeyword().equals(cfg.getKeyword()) && info.getTargetType().equals(cfg.getTargetType())){
+ return true;
+ }
+ }
+ Map<String, List<String>> map = innerProtectionListService.ajaxGetAllInfo();
+ List<String> list = map.get(cfg.getTargetType());
+ if(list != null) {
+ if(list.contains(cfg.getKeyword())) {
+ return false;
+ }
+ }
+
+ return true;
+ }
}
diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 770b397c0..9f29268e3 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -219,15 +219,19 @@ public class AppCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppPolicyCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- logger.error("saveAppPolicyCfg failed", e);
- e.printStackTrace();
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("app 协议配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("app 协议配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/app/policyCfgList?functionId=" + entity.getFunctionId();
@@ -255,12 +259,10 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
- entity.setAuditorId(UserUtils.getUser().getId());
- entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP);
try {
- appCfgService.auditAppPolicyCfg(entity, isAudit);
+ appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
e.printStackTrace();
@@ -394,15 +396,19 @@ public class AppCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppIpCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- e.printStackTrace();
- logger.error("saveAppIpCfg failed", e);
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ }catch (MaatConvertException e) {
+ logger.error("APP IP配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("APP IP配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + entity.getFunctionId();
@@ -432,10 +438,7 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppIpCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
- entity.setAuditorId(UserUtils.getUser().getId());
- entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
- entity.setTableName(AppIpCfg.getTablename());
if (dataMap.containsKey(entity.getCompileId())) {
dataMap.get(entity.getCompileId()).add(entity);
} else {
@@ -737,14 +740,19 @@ public class AppCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppDomainCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- e.printStackTrace();
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("APP域名配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("APP域名配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + entity.getFunctionId();
@@ -772,11 +780,9 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppDomainCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
- entity.setAuditorId(UserUtils.getUser().getId());
- entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
- appCfgService.auditAppDomainCfg(entity, isAudit);
+ appCfgService.auditAppDomainCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
e.printStackTrace();
@@ -1507,18 +1513,19 @@ public class AppCfgController extends BaseController { entity.setCfgKeywords(entity.getCfgKeywords());
}
appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- if (e instanceof MaatConvertException) {
- e.printStackTrace();
- logger.info("app主题网站配置下发失败:" + e.getMessage());
- ;
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- e.printStackTrace();
- logger.error("app主题网站配置下发失败", e);
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("APP主题网站配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("APP主题网站配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + entity.getFunctionId();
@@ -1546,11 +1553,9 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
- entity.setAuditorId(UserUtils.getUser().getId());
- entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
- appCfgService.auditAppTopicDomainCfg(entity, isAudit);
+ appCfgService.auditAppTopicDomainCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
logger.error("app主题网站配置下发失败", e);
diff --git a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java index d3c48eaec..bd7229327 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java @@ -142,14 +142,19 @@ public class AppFeatureCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode());
}
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- e.printStackTrace();
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("APP 特征配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("APP 特征配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId();
@@ -176,11 +181,9 @@ public class AppFeatureCfgController extends BaseController { entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
- entity.setAuditorId(UserUtils.getUser().getId());
- entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
- appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit);
+ appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (MaatConvertException e) {
e.printStackTrace();
@@ -350,7 +353,7 @@ public class AppFeatureCfgController extends BaseController { String ipPortInfoNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
+ ",config_time,editor,edit_time,auditor,audit_time"
+ ",letter,whether_area_block,classification,attribute,label"
- + ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
+ + ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,client_ip,src_ip_pattern,client_port,src_port_pattern,";
// 时间过滤
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
diff --git a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java index 1c9f6df58..f71d2711a 100644 --- a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java +++ b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java @@ -158,18 +158,22 @@ public class BasicProtocolController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppPolicyCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- e.printStackTrace();
- logger.error("基础协议信息保存失败", e);
- if (e instanceof MaatConvertException) {
- // addMessage(redirectAttributes,e.getMessage());
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else if (e instanceof CallExternalProceduresException) {
- addMessage(redirectAttributes, "error", "call_external_procedures_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("基础协议配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (CallExternalProceduresException e) {
+ logger.error("调用外部程序出错:",e);
+ addMessage(redirectAttributes, "error", "call_external_procedures_failed");
+ } catch (Exception e) {
+ logger.error("基础协议配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId();
@@ -197,12 +201,10 @@ public class BasicProtocolController extends BaseController { entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
- entity.setAuditorId(UserUtils.getUser().getId());
- entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
try {
- appCfgService.auditAppPolicyCfg(entity, isAudit);
+ appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
if (e instanceof MaatConvertException) {
diff --git a/src/main/java/com/nis/web/controller/configuration/CommonController.java b/src/main/java/com/nis/web/controller/configuration/CommonController.java index b820c8ba5..c4a004c21 100644 --- a/src/main/java/com/nis/web/controller/configuration/CommonController.java +++ b/src/main/java/com/nis/web/controller/configuration/CommonController.java @@ -8,10 +8,8 @@ */
package com.nis.web.controller.configuration;
-import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -19,38 +17,22 @@ import java.util.Properties; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.axis2.databinding.types.soapencoding.Array;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.ui.Model;
-import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-import com.nis.domain.FunctionRegionDict;
-import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page;
import com.nis.domain.basics.ServiceDictInfo;
import com.nis.domain.configuration.BaseIpCfg;
-import com.nis.domain.configuration.CfgIndexInfo;
-import com.nis.domain.configuration.HttpBodyCfg;
-import com.nis.domain.configuration.HttpReqHeadCfg;
-import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
-import com.nis.domain.configuration.template.IpAllTemplate;
-import com.nis.domain.configuration.template.IpCfgTemplate;
-import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.domain.configuration.IpPortCfg;
-import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.DateUtils;
-import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.util.excel.ExportExcel;
-import com.nis.util.excel.ImportExcel;
import com.nis.web.controller.BaseController;
-import com.nis.web.dao.configuration.IpCfgDao;
-import com.nis.web.security.UserUtils;
/**
* @ClassName: CommonController.java
@@ -288,15 +270,7 @@ public class CommonController extends BaseController { e.printStackTrace();
}
}*/
- public void _importFileTemplate(HttpServletRequest request,HttpServletResponse response,
- RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
- this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
- }
- @Deprecated
- public void _importFileTemplate(HttpServletRequest request,HttpServletResponse response,
- RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode,Class clazz) {
- this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,clazz);
- }
+
//ip配置导出
public void _exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index cc29faeaa..a39221b38 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -178,17 +178,22 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppPolicyCfg(entity);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- e.printStackTrace();
- logger.error("加密隧道信息保存失败", e);
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else if (e instanceof CallExternalProceduresException) {
- addMessage(redirectAttributes, "error", "call_external_procedures_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("加密隧道行为配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (CallExternalProceduresException e) {
+ logger.error("调用外部程序出错:",e);
+ addMessage(redirectAttributes, "error", "call_external_procedures_failed");
+ } catch (Exception e) {
+ logger.error("加密隧道行为配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId();
@@ -221,7 +226,7 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setFunctionId(functionId);
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
try {
- appCfgService.auditAppPolicyCfg(entity, isAudit);
+ appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
if (e instanceof MaatConvertException) {
diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java index 6ea10ab4e..45eb2b2f7 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java @@ -98,15 +98,19 @@ public class DnsIpCfgController extends BaseController { @ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
try {
dnsIpCfgService.saveOrUpdate(cfg);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- logger.error("信息保存失败", e);
- e.printStackTrace();
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("DNS欺骗ip配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("DNS欺骗ip配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + cfg.getFunctionId();
@@ -235,7 +239,7 @@ public class DnsIpCfgController extends BaseController { }
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
- String cfgIndexInfoNoExport = ",log_total,whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
+ String cfgIndexInfoNoExport = ",log_total,whether_area_block,client_ip,src_ip_pattern,src_port_pattern,dest_port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
// 时间过滤
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java index 2c368c953..50c9ab2fb 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java @@ -80,10 +80,18 @@ public class DnsResStrategyController extends BaseController { dnsResStrategyService.saveOrUpdate(cfg);
- addMessage(redirectAttributes, "success", "save_success");
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
+ }
} catch (MaatConvertException e) {
+ logger.error("DNS响应策略配置下发失败:",e);
addMessage(redirectAttributes, "error", "request_service_failed");
} catch (Exception e) {
+ logger.error("DNS响应策略配置保存失败:",e);
addMessage(redirectAttributes, "error", "save_failed");
}
diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java index 66c0e7462..3dd1dd5d4 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java @@ -71,15 +71,19 @@ public class DdosCfgController extends BaseController { @ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) {
try {
ddosCfgService.saveOrUpdate(cfg);
- addMessage(redirectAttributes, "success", "save_success");
- } catch (Exception e) {
- logger.error("信息保存失败", e);
- e.printStackTrace();
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
}
+ } catch (MaatConvertException e) {
+ logger.error("DDOS配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (Exception e) {
+ logger.error("DDOS配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + cfg.getFunctionId();
@@ -120,7 +124,7 @@ public class DdosCfgController extends BaseController { Date auditTime = new Date();
for (String id : idArray) {
try {
- ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime);
+ ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (MaatConvertException e) {
e.printStackTrace();
diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java index f1d8a4bca..3bec1e65d 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java @@ -40,7 +40,6 @@ import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
import com.nis.domain.configuration.IpReusePolicyCfg;
import com.nis.domain.configuration.UserManage;
-import com.nis.domain.configuration.template.IpMultiplexPolicyTemplate;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
@@ -120,26 +119,6 @@ public class IpMultiplexController extends CommonController { return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
}
- // ip配置导入
- /*
- * @RequestMapping(value = "/import", method=RequestMethod.POST) public
- * String importIp(String cfgName,RedirectAttributes redirectAttributes,
- *
- * @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
- * this._importIp(cfgName,redirectAttributes,
- * file,cfg,IpMultiplexPolicyTemplate.class);
- * redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex")
- * ; redirectAttributes.addAttribute("requiresPermissionPrefix",
- * "ip:mulitiplex"); return "redirect:" + adminPath
- * +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); }
- */
- // ip模板下载
- @RequestMapping(value = "import/template")
- public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
- RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
- this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
- IpMultiplexPolicyTemplate.class);
- }
// ip配置导出
@RequestMapping(value = "export")
diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/RatelimitController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/RatelimitController.java index bd33ae4a9..5b59c84e1 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/RatelimitController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/RatelimitController.java @@ -112,20 +112,7 @@ public class RatelimitController extends CommonController { redirectAttributes.addAttribute("requiresPermissionPrefix","domain:ratelimit");
return "redirect:" + adminPath +"/manipulation/ratelimit/domain/list?functionId="+cfg.getFunctionId();
}
- //ip配置导入
- /*@RequestMapping(value = "/ip/import", method=RequestMethod.POST)
- public String importIp(String cfgName,RedirectAttributes redirectAttributes,
- @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
- this._importIp(cfgName,redirectAttributes, file,cfg,IpRateLimitTemplate.class);
- redirectAttributes.addAttribute("urlPrefix","/manipulation/ratelimit/ip");
- redirectAttributes.addAttribute("requiresPermissionPrefix","ip:ratelimit");
- return "redirect:" + adminPath +"/manipulation/ratelimit/ip/list?functionId="+cfg.getFunctionId();
- }*/
- @RequestMapping(value = "/ip/import/template")
- public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
- RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
- this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpRateLimitTemplate.class);
- }
+
//ip配置导出
@RequestMapping(value = "/ip/export")
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index d78bbf56a..9e2a9af22 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -27,7 +27,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.FunctionRegionDict;
import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page;
-import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AsnKeywordCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
@@ -66,7 +65,6 @@ import com.nis.domain.configuration.template.SnatTemplate; import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
import com.nis.domain.configuration.template.StringAllTemplate;
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
-import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index de4ec794b..e71e3d2a5 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -14,15 +14,11 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.apache.taglibs.standard.functions.Functions;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.FunctionRegionDict;
@@ -31,10 +27,6 @@ import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.DnsResStrategy;
-import com.nis.domain.configuration.ComplexStringCfgTemplate;
-import com.nis.domain.configuration.template.IpCfgTemplate;
-import com.nis.domain.specific.ConfigGroupInfo;
-import com.nis.domain.configuration.StringCfgTemplate;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
@@ -46,7 +38,6 @@ import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
-import com.nis.util.excel.ImportExcel;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@@ -616,13 +607,6 @@ public class WebsiteController extends BaseController { return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId;
}
- @Deprecated
- // 下载导入模板
- @RequestMapping(value = "import/template")
- public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
- RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
- this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
- }
// http配置导入
/*
* @RequestMapping(value = "importHttp", method=RequestMethod.POST) public
diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/ControlController.java b/src/main/java/com/nis/web/controller/configuration/proxy/ControlController.java index 87e46265b..4076c8aac 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/ControlController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/ControlController.java @@ -120,11 +120,6 @@ public class ControlController extends CommonController { redirectAttributes.addAttribute("requiresPermissionPrefix","control:ip");
return "redirect:" + adminPath +"/proxy/control/ip/list?functionId="+cfg.getFunctionId();
}
- @RequestMapping(value = "/ip/import/template")
- public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
- RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
- this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
- }
//ip配置导出
@RequestMapping(value = "/ip/export")
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java index 879265dda..07f2fcbcc 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java @@ -238,20 +238,26 @@ public class PxyObjKeyringController extends BaseController { }
}
pxyObjKeyringService.saveOrUpdate(cfg);
- addMessage(redirectAttributes, "success", "save_success");
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
+ }
}
+ } catch (MultiPartNewException e) {
+ logger.error("证书文件上传失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
+ } catch (MaatConvertException e) {
+ logger.error("拦截策略配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
} catch (Exception e) {
- logger.error("证书上传失败", e);
- if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else if (e instanceof MultiPartNewException) {
- addMessage(redirectAttributes, "error", e.getMessage());
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
- }
+ logger.error("拦截策略配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
-
+
return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + cfg.getFunctionId();
}
@@ -641,18 +647,24 @@ public class PxyObjKeyringController extends BaseController { }
}
pxyObjKeyringService.trustedCertsaveOrUpdate(cfg);
- addMessage(redirectAttributes, "success", "save_success");
+ //配置仅保存
+ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
+ addMessage(redirectAttributes, "success", "save_success");
+ }else {
+ //配置直接生效
+ addMessage(redirectAttributes, "success", "audit_success");
+ }
}
+ } catch (MultiPartNewException e) {
+ logger.error("可信证书上传失败:",e);
+ addMessage(redirectAttributes, "error", e.getMessage());
+ } catch (MaatConvertException e) {
+ logger.error("可信证书单配置下发失败:",e);
+ addMessage(redirectAttributes, "error", "request_service_failed");
} catch (Exception e) {
- logger.error("证书上传失败", e);
- if (e instanceof MultiPartNewException) {
- addMessage(redirectAttributes, "error", e.getMessage());
- } else if (e instanceof MaatConvertException) {
- addMessage(redirectAttributes, "error", "request_service_failed");
- } else {
- addMessage(redirectAttributes, "error", "save_failed");
- }
+ logger.error("可信证书配置保存失败:",e);
+ addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId();
diff --git a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml index fdb188dd6..7fd5af05e 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml @@ -5,7 +5,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -48,7 +49,7 @@ </resultMap>
<sql id="columns">
- r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
+ r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -91,8 +92,11 @@ <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -100,8 +104,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -227,8 +234,11 @@ <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -236,8 +246,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -323,6 +336,9 @@ from asn_ip_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId}
</select>
<insert id="insert" parameterType="com.nis.domain.basics.AsnIpCfg" >
+ <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
+ SELECT LAST_INSERT_ID()
+ </selectKey>
insert into asn_ip_cfg (
CFG_DESC,
ACTION,
@@ -345,9 +361,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -388,8 +402,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -473,11 +487,17 @@ <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
- <if test="ipPattern != null" >
- ip_pattern = #{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null" >
+ src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destIpPattern != null" >
+ dest_ip_pattern =#{destIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="srcPortPattern != null" >
+ src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
</if>
- <if test="portPattern != null" >
- port_pattern = #{portPattern,jdbcType=INTEGER},
+ <if test="destPortPattern != null" >
+ dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
@@ -564,7 +584,7 @@ INSERT INTO asn_ip_cfg
(CFG_DESC,ACTION,IS_VALID,IS_AUDIT,CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,
AUDIT_TIME,SERVICE_ID,REQUEST_ID,region_id,compile_id,IS_AREA_EFFECTIVE,CLASSIFY,ATTRIBUTE,LABLE,
- AREA_EFFECTIVE_IDS,function_id,ip_type,src_ip_address,ip_pattern,port_pattern,src_port,
+ AREA_EFFECTIVE_IDS,function_id,ip_type,src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,src_port,
protocol,protocol_id,direction,dest_port,dest_ip_address,cfg_type,cfg_region_code,
asn_ip_group,user_region1,user_region2,user_region3,user_region4,user_region5,organization,country,detail)
VALUES
@@ -591,8 +611,10 @@ #{asnIp.functionId,jdbcType=INTEGER},
#{asnIp.ipType,jdbcType=INTEGER},
#{asnIp.srcIpAddress,jdbcType=VARCHAR},
- #{asnIp.ipPattern,jdbcType=INTEGER},
- #{asnIp.portPattern,jdbcType=INTEGER},
+ #{asnIp.srcIpPattern,jdbcType=INTEGER},
+ #{asnIp.destIpPattern,jdbcType=INTEGER},
+ #{asnIp.srcPortPattern,jdbcType=INTEGER},
+ #{asnIp.destPortPattern,jdbcType=INTEGER},
#{asnIp.srcPort,jdbcType=VARCHAR},
#{asnIp.protocol,jdbcType=INTEGER},
#{asnIp.protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 3cc5bd7dc..70f1a13fd 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -43,7 +43,8 @@ <result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -235,7 +236,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -394,7 +396,7 @@ r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
- r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT,
+ r.IP_TYPE, r.SRC_IP_PATTERN,r.DEST_IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.SRC_PORT_PATTERN,r.DEST_PORT_PATTERN,r.SRC_PORT,DEST_PORT,
r.DIRECTION,r.PROTOCOL,r.DO_LOG,r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
</sql>
@@ -461,7 +463,7 @@ </sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -887,8 +889,11 @@ <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -896,8 +901,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -1823,12 +1831,12 @@ CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
- IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
+ IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values (
<include refid="AppCommonCfg_Value_List" />,
- #{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
- #{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
+ #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
)
@@ -1839,12 +1847,12 @@ CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
- IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
+ IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values (
<include refid="AppCommonCfg_Value_List" />,
- #{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
- #{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
+ #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
)
@@ -1855,7 +1863,7 @@ CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
- IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
+ IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values
<foreach collection ="list" item="appIp" separator =",">
@@ -1868,9 +1876,10 @@ #{appIp.requestId,jdbcType=INTEGER},#{appIp.compileId,jdbcType=INTEGER},#{appIp.isAreaEffective,jdbcType=INTEGER},
#{appIp.classify,jdbcType=VARCHAR},#{appIp.attribute,jdbcType=VARCHAR},#{appIp.lable,jdbcType=VARCHAR},
#{appIp.areaEffectiveIds,jdbcType=VARCHAR},#{appIp.ratelimit,jdbcType=VARCHAR},#{appIp.functionId,jdbcType=INTEGER},
- #{appIp.cfgType,jdbcType=VARCHAR},#{appIp.cfgRegionCode,jdbcType=INTEGER},
- #{appIp.ipType,jdbcType=INTEGER}, #{appIp.ipPattern,jdbcType=INTEGER},#{appIp.srcIpAddress,jdbcType=VARCHAR},#{appIp.destIpAddress,jdbcType=VARCHAR},
- #{appIp.portPattern,jdbcType=INTEGER},#{appIp.srcPort,jdbcType=VARCHAR},#{appIp.destPort,jdbcType=VARCHAR},#{appIp.direction,jdbcType=INTEGER},
+ #{appIp.cfgType,jdbcType=VARCHAR},#{appIp.cfgRegionCode,jdbcType=INTEGER},#{appIp.ipType,jdbcType=INTEGER},
+ #{appIp.srcIpPattern,jdbcType=INTEGER},#{appIp.destIpPattern,jdbcType=INTEGER},#{appIp.srcIpAddress,jdbcType=VARCHAR},
+ #{appIp.destIpAddress,jdbcType=VARCHAR},#{appIp.srcPortPattern,jdbcType=INTEGER},#{appIp.destPortPattern,jdbcType=INTEGER},
+ #{appIp.srcPort,jdbcType=VARCHAR},#{appIp.destPort,jdbcType=VARCHAR},#{appIp.direction,jdbcType=INTEGER},
#{appIp.protocol,jdbcType=INTEGER},#{appIp.doLog,jdbcType=INTEGER},#{appIp.userRegion1,jdbcType=VARCHAR},#{appIp.userRegion2,jdbcType=VARCHAR}
,#{appIp.userRegion3,jdbcType=VARCHAR},#{appIp.userRegion4,jdbcType=VARCHAR},#{appIp.userRegion5,jdbcType=VARCHAR}
)
@@ -2057,9 +2066,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -2090,8 +2097,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -2294,8 +2301,11 @@ <if test="ipType != null" >
IP_TYPE = #{ipType,jdbcType=INTEGER},
</if>
- <if test="ipPattern != null">
- IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null">
+ SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destIpPattern != null">
+ DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
@@ -2303,8 +2313,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
</if>
- <if test="portPattern != null">
- PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
+ <if test="srcPortPattern != null">
+ SRC_PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destPortPattern != null">
+ DEST_PORT_PATTERN=#{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort !=''">
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
diff --git a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml index 05cfddc32..ef4eabc44 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml @@ -42,7 +42,8 @@ <result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -196,7 +197,7 @@ r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
- r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT,
+ r.IP_TYPE, r.src_ip_pattern,r.dest_ip_pattern, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.src_port_pattern,r.dest_port_pattern,r.SRC_PORT,DEST_PORT,
r.DIRECTION,r.PROTOCOL,r.DO_LOG,r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
</sql>
@@ -540,13 +541,13 @@ CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
- IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
+ IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values (
<include refid="AppCommonCfg_Value_List" />,
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},
- #{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
- #{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
+ #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
)
diff --git a/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml index 811ed51f7..ce203593a 100644 --- a/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml @@ -1,13 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.AreaIpCfgDao" >
- <resultMap id="BaseIpMap" type="com.nis.domain.configuration.AreaIpCfg" >
+ <resultMap id="AreaIpMap" type="com.nis.domain.configuration.AreaIpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -36,13 +37,13 @@ <result column="function_id" property="functionId" jdbcType="INTEGER" />
</resultMap>
<sql id="AreaIpCfg_Column_List_with_id" >
- CFG_ID,CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,
+ CFG_ID,CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,
DEST_PORT,DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID
</sql>
- <select id="getByCompileId" resultMap="BaseIpMap" >
+ <select id="getByCompileId" resultMap="AreaIpMap" >
SELECT
<include refid="AreaIpCfg_Column_List_with_id" />
FROM area_ip_cfg
@@ -76,9 +77,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -109,8 +108,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -147,9 +146,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -180,8 +177,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -255,11 +252,17 @@ <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
- <if test="ipPattern != null" >
- ip_pattern = #{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null" >
+ src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
</if>
- <if test="portPattern != null" >
- port_pattern = #{portPattern,jdbcType=INTEGER},
+ <if test="destIpPattern != null" >
+ dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="srcPortPattern != null" >
+ src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destPortPattern != null" >
+ dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml index 748d60b4f..ca2324a91 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml @@ -30,7 +30,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -94,7 +95,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -193,7 +195,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -224,7 +227,7 @@ <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
</resultMap>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -238,7 +241,7 @@ r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id,r.do_log,r.do_blacklist
</sql>
<sql id="AvVoipIp_Column" >
- r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
+ r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -252,7 +255,7 @@ r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code
</sql>
<sql id="AvContIp_Column" >
- r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
+ r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -816,8 +819,10 @@ function_id,
ip_type,
src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_pattern,
+ dest_ip_pattern,
+ src_port_pattern,
+ dest_port_pattern,
src_port,
protocol,
protocol_id,
@@ -848,8 +853,10 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},
+ #{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},
+ #{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -1053,9 +1060,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -1086,8 +1091,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -1237,11 +1242,17 @@ <if test="voipIp != null and voipIp.srcIpAddress != null and voipIp.srcIpAddress != ''" >
src_ip_address = #{voipIp.srcIpAddress,jdbcType=VARCHAR},
</if>
- <if test="voipIp != null and voipIp.ipPattern != null" >
- ip_pattern = #{voipIp.ipPattern,jdbcType=INTEGER},
+ <if test="voipIp != null and voipIp.srcIpPattern != null" >
+ src_ip_pattern = #{voipIp.srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="voipIp != null and voipIp.destIpPattern != null" >
+ dest_ip_pattern = #{voipIp.destIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="voipIp != null and voipIp.srcPortPattern != null" >
+ src_port_pattern = #{voipIp.srcPortPattern,jdbcType=INTEGER},
</if>
- <if test="voipIp != null and voipIp.portPattern != null" >
- port_pattern = #{voipIp.portPattern,jdbcType=INTEGER},
+ <if test="voipIp != null and voipIp.destPortPattern != null" >
+ dest_port_pattern = #{voipIp.destPortPattern,jdbcType=INTEGER},
</if>
<if test="voipIp != null and voipIp.srcPort != null and voipIp.srcPort != ''" >
src_port = #{voipIp.srcPort,jdbcType=VARCHAR},
@@ -1652,9 +1663,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -1686,8 +1695,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -1762,11 +1771,17 @@ <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
- <if test="ipPattern != null" >
- ip_pattern = #{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null" >
+ src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destIpPattern != null" >
+ dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="srcPortPattern != null" >
+ src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
</if>
- <if test="portPattern != null" >
- port_pattern = #{portPattern,jdbcType=INTEGER},
+ <if test="destPortPattern != null" >
+ dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
diff --git a/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml index 951507015..294ffe75b 100644 --- a/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml @@ -30,7 +30,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -162,7 +163,7 @@ a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,a.do_blacklist
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -432,9 +433,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -465,8 +464,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml b/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml index 7ef05c720..dd8949cdd 100644 --- a/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/CommonPolicyDao.xml @@ -74,7 +74,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -172,7 +173,7 @@ a.do_blacklist
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -489,9 +490,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -527,8 +526,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml index ad404a85b..52c40b82f 100644 --- a/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ConfigSynchronizationDao.xml @@ -80,7 +80,8 @@ <result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -240,7 +241,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -381,7 +383,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -701,7 +704,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -775,12 +779,12 @@ <sql id="DdosIpCfg_Column" >
a.cfg_id,a.cfg_desc,a.action,a.is_valid,a.is_audit,a.creator_id,a.audit_time,
a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
- a.area_effective_ids,a.function_id,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.area_effective_ids,a.function_id,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.pps_threadshold,
a.antiddos_protocol,a.bps_threadshold
</sql>
<sql id="IpCfg_Column" >
- a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port,
+ a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port,
a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id
</sql>
<sql id="IpCfg_AllColumn" >
@@ -788,7 +792,7 @@ a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
a.area_effective_ids,a.function_id,a.do_log,a.dns_strategy_id,a.user_region1,a.user_region2,
a.user_region3,a.user_region4,a.user_region5,
- a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port,
+ a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port,
a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type
</sql>
<sql id="IpDropCfg_Column" >
@@ -796,11 +800,11 @@ a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
a.area_effective_ids,a.function_id,a.user_region1,a.user_region2,
a.user_region3,a.user_region4,a.user_region5,
- a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port,
+ a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port,
a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type
</sql>
<sql id="AsnIpCfg_Column" >
- a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.asn_ip_group,
a.user_region1,a.region_id
</sql>
@@ -883,7 +887,7 @@ ,a.area_effective_ids,a.function_id,a.cfg_region_code,a.compile_id
</sql>
<sql id="DnsIpCfgColumns">
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -907,7 +911,7 @@ a.feature_table_type,a.app_code,a.spec_service_id,a.cfg_region_code
</sql>
<sql id="AppIpCfg_Column" >
- a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id
</sql>
@@ -928,7 +932,7 @@ a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,AREA_EFFECTIVE_IDS,a.RATELIMIT,a.FUNCTION_ID,a.CFG_TYPE,a.CFG_REGION_CODE,
- a.IP_TYPE, a.IP_PATTERN, a.SRC_IP_ADDRESS,a.DEST_IP_ADDRESS, a.PORT_PATTERN,a.SRC_PORT,DEST_PORT,
+ a.IP_TYPE, a.src_ip_pattern,a.dest_ip_pattern, a.SRC_IP_ADDRESS,a.DEST_IP_ADDRESS, a.src_port_pattern,a.dest_port_pattern,a.SRC_PORT,DEST_PORT,
a.DIRECTION,a.PROTOCOL,a.DO_LOG,a.USER_REGION1,a.USER_REGION2,a.USER_REGION3,a.USER_REGION4,a.USER_REGION5
</sql>
@@ -1629,7 +1633,7 @@ </select>
<select id="getAsnIpList" resultType="com.nis.domain.basics.AsnIpCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo">
select
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
diff --git a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml index 3ce97c1bc..7e9126cdf 100644 --- a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml @@ -5,7 +5,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -41,7 +42,7 @@ </resultMap>
<sql id="columns">
- r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
+ r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -80,8 +81,11 @@ <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -89,8 +93,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -217,9 +224,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -254,8 +259,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -332,11 +337,17 @@ <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
- <if test="ipPattern != null" >
- ip_pattern = #{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null" >
+ src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destIpPattern != null" >
+ dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="srcPortPattern != null" >
+ src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
</if>
- <if test="portPattern != null" >
- port_pattern = #{portPattern,jdbcType=INTEGER},
+ <if test="destPortPattern != null" >
+ dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml index 2146cf3f7..bc3c12fcc 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml @@ -5,7 +5,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -40,7 +41,7 @@ </resultMap>
<sql id="columns">
- r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
+ r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.src_ip_pattern,r.dest_ip_pattern,r.src_port_pattern,r.dest_port_pattern,r.src_port
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -83,8 +84,11 @@ <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -92,8 +96,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -208,6 +215,9 @@ </select>
<insert id="insert" parameterType="com.nis.domain.configuration.DnsIpCfg" >
+ <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
+ SELECT LAST_INSERT_ID()
+ </selectKey>
insert into dns_ip_cfg (
CFG_DESC,
ACTION,
@@ -229,9 +239,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -264,8 +272,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
@@ -340,11 +348,17 @@ <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
- <if test="ipPattern != null" >
- ip_pattern = #{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null" >
+ src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destIpPattern != null" >
+ dest_ip_pattern = #{destIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="srcPortPattern != null" >
+ src_port_pattern = #{srcPortPattern,jdbcType=INTEGER},
</if>
- <if test="portPattern != null" >
- port_pattern = #{portPattern,jdbcType=INTEGER},
+ <if test="destPortPattern != null" >
+ dest_port_pattern = #{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
diff --git a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml index cf3f9708c..9b9451376 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml @@ -197,6 +197,9 @@ LEFT JOIN dns_res_strategy r ON a.dns_strategy_id=r.res_group_1_id order by r.cfg_Id
</select>
<insert id="insert" parameterType="com.nis.domain.configuration.DnsResStrategy" >
+ <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
+ SELECT LAST_INSERT_ID()
+ </selectKey>
insert into dns_res_strategy (
CFG_DESC,
ACTION,
diff --git a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml index 07be2eeea..ceda6acad 100644 --- a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml @@ -35,7 +35,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -172,7 +173,7 @@ a.do_blacklist
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -453,9 +454,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -491,8 +490,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml index 06db8585e..334b6c97e 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.IpCfgDao" >
+ <!-- 基础 -->
<resultMap id="BaseIpMap" type="com.nis.domain.configuration.BaseIpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -85,7 +87,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> + <result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -116,14 +119,14 @@ <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
</resultMap>
<sql id="BaseIpCfg_Column_List_with_id" >
- CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
+ CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
</sql>
<sql id="BaseIpCfg_Column_List_with_id_name" >
- CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
+ CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
@@ -133,7 +136,8 @@ <choose>
<when test="page !=null and page.alias != null and page.alias != ''">
${page.alias}.CFG_ID as cfgId, ${page.alias}.CFG_DESC as cfgDesc,${page.alias}.CFG_REGION_CODE as cfgRegionCode,${page.alias}.CFG_TYPE as cfgType, ${page.alias}.IP_TYPE as ipType,
- ${page.alias}.IP_PATTERN as ipPattern, ${page.alias}.SRC_IP_ADDRESS as srcIpAddress, ${page.alias}.DEST_IP_ADDRESS as destIpAddress, ${page.alias}.PORT_PATTERN as portPattern,${page.alias}.SRC_PORT as srcPort,${page.alias}.DEST_PORT as destPort,
+ ${page.alias}.SRC_IP_PATTERN as srcIpPattern,${page.alias}.DEST_IP_PATTERN as destIpPattern, ${page.alias}.SRC_IP_ADDRESS as srcIpAddress, ${page.alias}.DEST_IP_ADDRESS as destIpAddress,
+ ${page.alias}.SRC_PORT_PATTERN as srcPortPattern,${page.alias}.DEST_PORT_PATTERN as destPortPattern,${page.alias}.SRC_PORT as srcPort,${page.alias}.DEST_PORT as destPort,
${page.alias}.DIRECTION as direction,${page.alias}.PROTOCOL as protocol,${page.alias}.PROTOCOL_ID as protocolId,${page.alias}.ACTION as action,${page.alias}.IS_VALID as isValid,${page.alias}.IS_AUDIT as isAudit,
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
@@ -147,7 +151,8 @@ </when>
<otherwise>
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
- r.IP_PATTERN as ipPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress, r.PORT_PATTERN as portPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
+ r.src_ip_pattern as srcIpPattern,r.dest_ip_pattern as destIpPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress,
+ r.src_port_pattern as srcPortPattern,r.dest_port_pattern as destPortPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
@@ -163,8 +168,7 @@ </sql>
<sql id="BaseIpCfg_Column_List" >
CFG_DESC,CFG_REGION_CODE,CFG_TYPE,
- IP_TYPE,IP_PATTERN,SRC_IP_ADDRESS,DEST_IP_ADDRESS,
- PORT_PATTERN,SRC_PORT,DEST_PORT,DIRECTION,
+ IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,DIRECTION,
PROTOCOL,PROTOCOL_ID,ACTION,
IS_VALID,IS_AUDIT,CREATOR_ID,
CREATE_TIME,EDITOR_ID,EDIT_TIME,
@@ -176,8 +180,8 @@ </sql>
<sql id="BaseIpCfg_Value_List" >
#{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR},
- #{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
- #{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
+ #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},#{protocolId,jdbcType=INTEGER},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
@@ -201,7 +205,7 @@ a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.do_blacklist
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -291,8 +295,11 @@ <if test="ipType != null">
AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND ${page.alias}.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND ${page.alias}.SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND ${page.alias}.DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND ${page.alias}.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -300,8 +307,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND ${page.alias}.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND ${page.alias}.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND ${page.alias}.SRC_PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND ${page.alias}.DEST_PORT_PATTERN=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND ${page.alias}.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -416,8 +426,11 @@ <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
- <if test="ipPattern != null">
- AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
+ <if test="srcIpPattern != null">
+ AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destIpPattern != null">
+ AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -425,8 +438,11 @@ <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
- <if test="portPattern != null">
- AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
+ <if test="srcPortPattern != null">
+ AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
+ </if>
+ <if test="destPortPattern != null">
+ AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -596,8 +612,11 @@ <if test="ipType != null" >
IP_TYPE = #{ipType,jdbcType=INTEGER},
</if>
- <if test="ipPattern != null">
- IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
+ <if test="srcIpPattern != null">
+ SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
+ </if>
+ <if test="destIpPattern != null">
+ DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
@@ -606,7 +625,7 @@ DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
</if>
<if test="portPattern != null">
- PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
+ PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort !=''">
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
@@ -744,7 +763,8 @@ <select id="getListByCfgIdWithName" resultMap="BaseIpMapWithUser">
select
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
- r.IP_PATTERN as ipPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress, r.PORT_PATTERN as portPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
+ r.src_ip_pattern as srcIpPattern,r.dest_ip_pattern as destIpPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress,
+ r.src_port_pattern as srcPortPattern,r.dest_port_pattern as destPortPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
@@ -927,9 +947,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -965,8 +983,10 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},
+ #{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},
+ #{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/MailCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/MailCfgDao.xml index f51a93e48..af779f182 100644 --- a/src/main/java/com/nis/web/dao/configuration/MailCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/MailCfgDao.xml @@ -29,7 +29,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -124,7 +125,7 @@ a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,a.do_blacklist
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -384,9 +385,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -417,8 +416,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml index 4fc39163f..e19d26e08 100644 --- a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml @@ -359,6 +359,9 @@ </where>
</select>
<insert id="insert" parameterType="com.nis.domain.configuration.PxyObjKeyring" >
+ <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
+ SELECT LAST_INSERT_ID()
+ </selectKey>
insert into pxy_obj_keyring (
CFG_ID,
CFG_DESC,
@@ -434,6 +437,9 @@ )
</insert>
<insert id="insertPxyObjTrustedCaCert" parameterType="com.nis.domain.configuration.PxyObjTrustedCaCert" >
+ <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
+ SELECT LAST_INSERT_ID()
+ </selectKey>
insert into pxy_obj_trusted_ca_cert (
CFG_ID,
CFG_DESC,
diff --git a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml index 91e781bbd..8aa9b44ed 100644 --- a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml @@ -39,7 +39,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -137,7 +138,7 @@ a.do_blacklist
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -567,9 +568,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -605,8 +604,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml index 3c0e87e07..be24fa94a 100644 --- a/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml @@ -29,7 +29,8 @@ <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -125,7 +126,7 @@ a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,do_log
</sql>
<sql id="IpCfg_Column" >
- a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
+ a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_port_pattern,a.src_port
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -353,9 +354,7 @@ AREA_EFFECTIVE_IDS,
function_id,
ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
protocol_id,
@@ -386,8 +385,8 @@ #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml index 0fd203dc3..6b3a6f0a5 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml @@ -7,7 +7,8 @@ <id column="host_id" property="hostId" jdbcType="INTEGER" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
- <result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
+ <result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" /> +<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -121,9 +122,7 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId} <!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
insert into specific_service_host_cfg (spec_service_id,ip_type,
- src_ip_address,
- ip_pattern,
- port_pattern,
+ src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
src_port,
protocol,
direction,
@@ -132,8 +131,8 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId} is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time)
values(#{specServiceId},#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
- #{ipPattern,jdbcType=INTEGER},
- #{portPattern,jdbcType=INTEGER},
+ #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
+ #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{direction,jdbcType=INTEGER},
@@ -146,10 +145,10 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId} update specific_service_host_cfg s set
s.spec_service_id = #{specServiceId},
s.IP_TYPE = #{ipType,jdbcType=INTEGER},
- s.IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
+ s.IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
s.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
s.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
- s.PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
+ s.PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
s.SRC_PORT=#{srcPort,jdbcType=VARCHAR},
s.DEST_PORT=#{destPort,jdbcType=VARCHAR},
s.direction = #{direction,jdbcType=INTEGER},
diff --git a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java index 4cf6f81ba..31cc6f60e 100644 --- a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java @@ -34,6 +34,7 @@ import com.nis.domain.maat.ToMaatResult; import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
+import com.nis.util.StringUtil;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.basics.AsnGroupInfoDao;
import com.nis.web.dao.basics.AsnIpCfgDao;
@@ -82,24 +83,31 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> { public void save(List<AsnIpCfg> entitys) {
logger.warn("Start to save IP,size:"+entitys.size());
long start=System.currentTimeMillis();
- SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
- SqlSession batchSqlSession = null;
- try{
- batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
- for(AsnIpCfg asnIpCfg:entitys) {
- ((AsnIpCfgDao) batchSqlSession.getMapper(AsnIpCfgDao.class)).insert(asnIpCfg);
- }
- batchSqlSession.commit();
- }finally {
- if(batchSqlSession != null){
- batchSqlSession.close();
- }
- }
+// SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
+// SqlSession batchSqlSession = null;
+// try{
+// batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
+// for(AsnIpCfg asnIpCfg:entitys) {
+// ((AsnIpCfgDao) batchSqlSession.getMapper(AsnIpCfgDao.class)).insert(asnIpCfg);
+// }
+// batchSqlSession.commit();
+ for(AsnIpCfg asnIpCfg:entitys) {
+ asnIpCfgDao.insert(asnIpCfg);
+ }
+// }finally {
+// if(batchSqlSession != null){
+// batchSqlSession.close();
+// }
+// }
long end=System.currentTimeMillis();
logger.warn("Save IP finish,cost:"+(end-start));
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void update(AsnIpCfg entity){
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
Date editTime=new Date();
entity.setEditTime(editTime);
entity.setEditorId(entity.getCurrentUser().getId());
@@ -115,6 +123,22 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> { entity.setDetail(detail);
entity.setCompileId(groupInfo.getCompileId());
asnIpCfgDao.update(entity);
+ if(isValid==1) {
+ Map<Long,List<AsnIpCfg>> asnIpMap=Maps.newHashMap();
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ entity.setAuditorId(UserUtils.getUser().getId());
+ entity.setAuditTime(new Date());
+ if(asnIpMap.containsKey(Long.parseLong(entity.getUserRegion1()))) {
+ asnIpMap.get(Long.parseLong(entity.getUserRegion1())).add(entity);
+ }else {
+ List<AsnIpCfg> _asnIps=Lists.newArrayList();
+ _asnIps.add(entity);
+ asnIpMap.put(Long.parseLong(entity.getUserRegion1()), _asnIps);
+ }
+
+ auditIpBatch(asnIpMap,entity.getIsAudit());
+ }
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void processGroup(Map<Long,AsnGroupInfo> asnNoMap){
@@ -261,6 +285,10 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> { @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveAsnIpCfg(CfgIndexInfo entity) {
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
Date createTime=new Date();
//asn号
String userRegion1=entity.getUserRegion1();
@@ -308,6 +336,26 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> { }
}
this.save(entity.getAsnIpCfgs());
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+
+ Map<Long,List<AsnIpCfg>> asnIpMap=Maps.newHashMap();
+ for(AsnIpCfg asnIpCfg:entity.getAsnIpCfgs()) {
+ asnIpCfg.setIsAudit(1);
+ asnIpCfg.setIsValid(1);
+ asnIpCfg.setAuditorId(UserUtils.getUser().getId());
+ asnIpCfg.setAuditTime(new Date());
+ if(asnIpMap.containsKey(Long.parseLong(asnIpCfg.getUserRegion1()))) {
+ asnIpMap.get(Long.parseLong(asnIpCfg.getUserRegion1())).add(asnIpCfg);
+ }else {
+ List<AsnIpCfg> _asnIps=Lists.newArrayList();
+ _asnIps.add(asnIpCfg);
+ asnIpMap.put(Long.parseLong(asnIpCfg.getUserRegion1()), _asnIps);
+ }
+ }
+ auditIpBatch(asnIpMap,entity.getIsAudit());
+ }
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void delete(String ids) {
diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index b9fbdb340..5018db3cd 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -248,7 +248,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
-
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -302,7 +305,20 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
-
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ if(entity.getFunctionId() == 407){
+ entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
+ }
+ if(entity.getFunctionId() == 63){
+ entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP);
+ }
+ if(entity.getFunctionId() == 408){
+ entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
+ }
+ auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
+ }
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -356,6 +372,20 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ if(entity.getFunctionId() == 407){
+ entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
+ }
+ if(entity.getFunctionId() == 63){
+ entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP);
+ }
+ if(entity.getFunctionId() == 408){
+ entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
+ }
+ auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
+ }
}
}
@@ -363,7 +393,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppIpCfg(AppIpCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
-
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
if (entity.getCfgId() == null) {
SpecificServiceCfg specificServiceCfg=specificServiceCfgDao.getBySpecServiceId(entity.getSpecServiceId());
@@ -429,10 +462,17 @@ public class AppCfgService extends BaseService { BeanUtils.copyProperties(entity, cfg,
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective",
"areaEffectiveIds", "protocol", "portPattern", "srcPort", "destPort",
- "direction", "destIpAddress", "srcIpAddress", "ipPattern" });
+ "direction", "destIpAddress", "srcIpAddress", "srcIpPattern", "destIpPattern" });
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
+ if(isValid==1) {
+ List<AppIpCfg> entitys=new ArrayList<AppIpCfg>();
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ entitys.add(entity);
+ auditAppIpCfg(entitys, entity.getIsAudit());
+ }
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -453,10 +493,20 @@ public class AppCfgService extends BaseService { BeanUtils.copyProperties(entity, cfg,
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective", "areaEffectiveIds",
"protocol", "portPattern", "srcPort", "destPort", "direction", "destIpAddress",
- "srcIpAddress", "ipPattern" });
+ "srcIpAddress", "srcIpPattern", "destIpPattern" });
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
+ if(isValid==1) {
+ List<AppIpCfg> entitys=new ArrayList<AppIpCfg>();
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ AppIpCfg entity2 = appCfgDao.getAppIpCfg(entity.getCfgId());
+ entity2.setIsAudit(1);
+ entity2.setIsValid(1);
+ entitys.add(entity2);
+ auditAppIpCfg(entitys, entity.getIsAudit());
+ }
}
}
public void saveAppHttpCfg(List<ComplexkeywordCfg> cfgs) {
@@ -538,7 +588,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
-
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -565,6 +618,11 @@ public class AppCfgService extends BaseService { logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ auditAppDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
+ }
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -586,6 +644,11 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ auditAppDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
+ }
}
}
@@ -593,7 +656,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppTopicDomainCfg(AppTopicDomainCfg entity) throws Exception {
// 设置区域运营商信息
setAreaEffectiveIds(entity);
-
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -620,6 +686,11 @@ public class AppCfgService extends BaseService { logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
+ }
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -641,6 +712,11 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
+ }
}
}
@@ -890,7 +966,10 @@ public class AppCfgService extends BaseService { }
}
- public void auditAppPolicyCfg(AppPolicyCfg entity, Integer isAudit) {
+ public void auditAppPolicyCfg(AppPolicyCfg entity, Integer isAudit,Integer opAction) {
+ entity.setIsAudit(isAudit);
+ entity.setAuditorId(UserUtils.getUser().getId());
+ entity.setAuditTime(new Date());
String configType = entity.getConfigType();
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
@@ -1036,7 +1115,7 @@ public class AppCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
- maatBean.setOpAction(Constants.INSERT_ACTION);
+ maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app策略配置下发配置参数:" + json);
@@ -1164,6 +1243,12 @@ public class AppCfgService extends BaseService { }
}
public void auditAppIpCfg(List<AppIpCfg> entitys, Integer isAudit) {
+ for (AppIpCfg entity : entitys) {
+ entity.setTableName(AppIpCfg.getTablename());
+ entity.setIsAudit(isAudit);
+ entity.setAuditorId(UserUtils.getUser().getId());
+ entity.setAuditTime(new Date());
+ }
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
@@ -1380,7 +1465,10 @@ public class AppCfgService extends BaseService { }
}
- public void auditAppDomainCfg(AppDomainCfg entity, Integer isAudit) {
+ public void auditAppDomainCfg(AppDomainCfg entity, Integer isAudit,Integer opAction) {
+ entity.setIsAudit(isAudit);
+ entity.setAuditorId(UserUtils.getUser().getId());
+ entity.setAuditTime(new Date());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -1441,7 +1529,7 @@ public class AppCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
- maatBean.setOpAction(Constants.INSERT_ACTION);
+ maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app域名配置下发配置参数:" + json);
@@ -1469,7 +1557,10 @@ public class AppCfgService extends BaseService { }
// app主题网站配置审核
- public void auditAppTopicDomainCfg(AppTopicDomainCfg entity, Integer isAudit) {
+ public void auditAppTopicDomainCfg(AppTopicDomainCfg entity, Integer isAudit,Integer opAction) {
+ entity.setIsAudit(isAudit);
+ entity.setAuditorId(UserUtils.getUser().getId());
+ entity.setAuditTime(new Date());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -1536,7 +1627,7 @@ public class AppCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
- maatBean.setOpAction(Constants.INSERT_ACTION);
+ maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app主题网站配置下发配置参数:" + json);
diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index 3d1694ff6..61b330c5d 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -78,6 +78,10 @@ public class AppMultiFeatureCfgService extends BaseService { //新增或保存复杂特征配置
@Transactional(readOnly = false, rollbackFor = RuntimeException.class)
public void saveOrUpdateAppFeatureCfg(AppFeatureIndex entity) throws Exception {
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
if (entity.getCfgId() == null) {
Integer compileId = 0;
try {
@@ -166,6 +170,11 @@ public class AppMultiFeatureCfgService extends BaseService { logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
+ }
} else {
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
@@ -243,6 +252,11 @@ public class AppMultiFeatureCfgService extends BaseService { }
}
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
+ }
}
}
@@ -286,7 +300,11 @@ public class AppMultiFeatureCfgService extends BaseService { cfg.setCfgKeywords(keyword);
}
- public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) {
+ public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit,Integer opAction) {
+ entity.setIsAudit(isAudit);
+ entity.setAuditorId(UserUtils.getUser().getId());
+ entity.setAuditTime(new Date());
+
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -421,7 +439,7 @@ public class AppMultiFeatureCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
- maatBean.setOpAction(Constants.INSERT_ACTION);
+ maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据
String json = gsonToJson(maatBean);
logger.info("app 特征配置下发配置参数:" + json);
diff --git a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java index 27fd16fcd..1d3051623 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -255,7 +255,6 @@ public class AvContentCfgService extends BaseService{ auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
}
-
}else{
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
@@ -534,7 +533,6 @@ public class AvContentCfgService extends BaseService{ }
}
-
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
@@ -772,9 +770,11 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -812,9 +812,11 @@ public class AvContentCfgService extends BaseService{ ,"cfgType"
,"cfgId"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -829,9 +831,11 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -936,9 +940,11 @@ public class AvContentCfgService extends BaseService{ ,"cfgType"
,"cfgId"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1111,9 +1117,11 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1151,9 +1159,11 @@ public class AvContentCfgService extends BaseService{ ,"cfgType"
,"cfgId"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1168,9 +1178,11 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -1275,9 +1287,11 @@ public class AvContentCfgService extends BaseService{ ,"cfgType"
,"cfgId"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
diff --git a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java index 20e1f0736..6c6000e8e 100644 --- a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java @@ -71,10 +71,14 @@ public class DdosCfgService extends BaseService{ return ddosCfgDao.getDdosIpCfg(cfgId,compileId);
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
- public void saveOrUpdate(DdosIpCfg entity){
+ public void saveOrUpdate(DdosIpCfg entity) throws Exception{
Date createTime=new Date();
//设置区域运营商信息
setAreaEffectiveIds(entity);
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
String antiddosProtocol = entity.getAntiddosProtocol();
Long bpsThreadshold = entity.getBpsThreadshold();
Long ppsThreadshold = entity.getPpsThreadshold();
@@ -116,7 +120,11 @@ public class DdosCfgService extends BaseService{ }else {
throw new RuntimeException("Could not get compileId!");
}
-
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.INSERT_ACTION);
+ }
//修改
}else{
Date editTime=new Date();
@@ -126,6 +134,11 @@ public class DdosCfgService extends BaseService{ entity.setEditTime(editTime);
ddosCfgDao.update(entity);
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.UPDATE_ACTION);
+ }
}
}
@@ -228,7 +241,7 @@ public class DdosCfgService extends BaseService{ }*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
- public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws Exception{
+ public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime,Integer opAction) throws Exception{
DdosIpCfg entity = new DdosIpCfg();
entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId());
@@ -308,7 +321,7 @@ public class DdosCfgService extends BaseService{ maatBean.setAuditTime(auditTime);
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
- maatBean.setOpAction(Constants.INSERT_ACTION);
+ maatBean.setOpAction(opAction);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("ddos 配置下发配置参数:"+json);
diff --git a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java index a30727730..b418a1ce3 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java @@ -22,6 +22,7 @@ import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
+import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.DnsIpCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
@@ -64,6 +65,10 @@ public class DnsIpCfgService extends BaseService{ Date createTime=new Date();
//设置区域运营商信息
setAreaEffectiveIds(entity);
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
//新增
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
@@ -102,6 +107,11 @@ public class DnsIpCfgService extends BaseService{ entity.setEditTime(editTime);
dnsIpCfgDao.update(entity);
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
+ }
}
/**
@@ -140,11 +150,13 @@ public class DnsIpCfgService extends BaseService{ dnsIp.setFunctionId(401);
dnsIp.setCfgRegionCode(1);
dnsIp.setCfgType("dns_fake_ip");
- dnsIp.setIpPattern(3);
+ dnsIp.setSrcIpPattern(3);
+ dnsIp.setDestIpPattern(3);
dnsIp.setSrcIpAddress("0.0.0.0");
dnsIp.setDestPort("0");
dnsIp.setSrcPort("0");
- dnsIp.setPortPattern(1);
+ dnsIp.setSrcPortPattern(1);
+ dnsIp.setDestPortPattern(1);
dnsIp.setDnsStrategyId(0);
dnsIp.setAction(16);
dnsIp.setServiceId(64);
diff --git a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java index 42756bfa0..13a01c3c1 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java @@ -19,6 +19,7 @@ import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
+import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.DnsResStrategyDao;
import com.nis.web.dao.configuration.StringCfgDao;
@@ -86,6 +87,10 @@ public class DnsResStrategyService extends BaseService{ public void saveOrUpdate(DnsResStrategy entity){
Date createTime=new Date();
setAreaEffectiveIds(entity);
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
List<DnsResStrategy> list = new ArrayList<DnsResStrategy>();
if( entity.getCfgId()!=null && !"".equals(entity.getCfgId())){
list=dnsResStrategyDao.findList(entity.getCfgId(),null,null);
@@ -112,6 +117,11 @@ public class DnsResStrategyService extends BaseService{ }
}
dnsResStrategyDao.insert(entity);
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
+ }
//修改
}else{
Date editTime=new Date();
@@ -121,6 +131,11 @@ public class DnsResStrategyService extends BaseService{ entity.setEditTime(editTime);
dnsResStrategyDao.update(entity);
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
+ }
}
}
@@ -157,8 +172,8 @@ public class DnsResStrategyService extends BaseService{ cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit);
- cfg.setEditTime(auditTime);
- cfg.setEditorId(UserUtils.getUser().getId());
+// cfg.setEditTime(auditTime);
+// cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
dnsResStrategyDao.update(cfg);
diff --git a/src/main/java/com/nis/web/service/configuration/DomainService.java b/src/main/java/com/nis/web/service/configuration/DomainService.java index 0c5b93421..5e6791ac0 100644 --- a/src/main/java/com/nis/web/service/configuration/DomainService.java +++ b/src/main/java/com/nis/web/service/configuration/DomainService.java @@ -76,7 +76,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> { c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
- "cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
+ "cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
c.setTableName(AreaIpCfg.getTablename());
}
this.saveIpBatch(cfg.getAreaCfg());
@@ -106,7 +106,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> { c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
- "cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
+ "cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
c.setTableName(AreaIpCfg.getTablename());
c.setCreatorId(cfg.getCurrentUser().getId());
c.setCreateTime(date);
@@ -202,9 +202,11 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> { ,"cfgType"
,"cfgId"
,"ipType"
- ,"ipPattern"
+ ,"srcIpPattern"
+ ,"destIpPattern"
,"srcIpAddress"
- ,"portPattern"
+ ,"srcPortPattern"
+ ,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
diff --git a/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java b/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java index 548588aff..443aeaaa5 100644 --- a/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java +++ b/src/main/java/com/nis/web/service/configuration/IpMultiplexService.java @@ -1,14 +1,11 @@ package com.nis.web.service.configuration;
import java.util.Date;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -16,14 +13,12 @@ import org.springframework.transaction.annotation.Transactional; import com.beust.jcommander.internal.Lists;
import com.nis.domain.Page;
import com.nis.domain.configuration.BaseIpCfg;
-import com.nis.domain.configuration.DdosIpCfg;
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
import com.nis.domain.configuration.IpReusePolicyCfg;
import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
-import com.nis.util.StringUtils;
import com.nis.web.dao.configuration.IpMultiplexDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
diff --git a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java index 6f99c3755..90f070c77 100644 --- a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java +++ b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java @@ -20,6 +20,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
+import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.basics.ServiceDictInfoDao;
import com.nis.web.dao.configuration.PxyObjKeyringDao;
@@ -100,6 +101,10 @@ public class PxyObjKeyringService extends BaseService{ public void saveOrUpdate(PxyObjKeyring entity){
Date createTime=new Date();
setAreaEffectiveIds(entity);
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
entity.setIsValid(0);
entity.setIsAudit(0);
//新增
@@ -128,11 +133,21 @@ public class PxyObjKeyringService extends BaseService{ pxyObjKeyringDao.update(entity);
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
+ }
+
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
- public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity){
+ public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity) throws InterruptedException{
Date createTime=new Date();
setAreaEffectiveIds(entity);
+ int isValid=0;
+ if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
+ isValid=1;
+ }
entity.setIsValid(0);
entity.setIsAudit(0);
//新增
@@ -162,11 +177,16 @@ public class PxyObjKeyringService extends BaseService{ //修改主表cert配置时,需要修改子表crl配置信息
PxyObjTrustedCaCrl crlCfg =new PxyObjTrustedCaCrl();
BeanUtils.copyProperties(entity, crlCfg, new String[]{"cfgId","serviceId","compileId","cfgType"});
- entity=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId());
- crlCfg.setCertId(entity.getCompileId());
+ PxyObjTrustedCaCert cert=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId());
+ crlCfg.setCertId(cert.getCompileId());
pxyObjKeyringDao.updatePxyObjTrustedCaCrl(crlCfg);
}
+ if(isValid==1) {
+ entity.setIsAudit(1);
+ entity.setIsValid(1);
+ trustedCertAudit(entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date());
+ }
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void trustedCrlsaveOrUpdate(PxyObjTrustedCaCrl entity){
@@ -320,8 +340,8 @@ public class PxyObjKeyringService extends BaseService{ cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit);
- cfg.setEditTime(auditTime);
- cfg.setEditorId(UserUtils.getUser().getId());
+// cfg.setEditTime(auditTime);
+// cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
pxyObjKeyringDao.update(cfg);
@@ -402,8 +422,8 @@ public class PxyObjKeyringService extends BaseService{ cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit);
- cfg.setEditTime(auditTime);
- cfg.setEditorId(UserUtils.getUser().getId());
+// cfg.setEditTime(auditTime);
+// cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime);
//修改主表cert 配置状态
diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java index fb289b477..34cb8d3d8 100644 --- a/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java @@ -17,7 +17,6 @@ import com.nis.domain.Page; import com.nis.domain.SysUser;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.domain.specific.SpecificServiceHostCfg;
-import com.nis.util.BasicProvingUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.specific.SpecificServiceHostCfgDao;
import com.nis.web.security.UserUtils;
@@ -58,45 +57,66 @@ public class SpecificServiceHostCfgService extends BaseService{ @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) {
SysUser user = UserUtils.getUser();
- String defaultIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
+ String defaultSrcIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
+ String defaultDestIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
if(specificServiceHostCfg.getIpType().equals(4)){
- if(specificServiceHostCfg.getIpPattern()==1){
- defaultIp = "0.0.0.0/32"; //0.0.0.0表示任意
- }else if(specificServiceHostCfg.getIpPattern()==2){
- defaultIp = "0.0.0.0-0.0.0.0";
+ if(specificServiceHostCfg.getSrcIpPattern()==1){
+ defaultSrcIp = "0.0.0.0/32"; //0.0.0.0表示任意
+ }else if(specificServiceHostCfg.getSrcIpPattern()==2){
+ defaultSrcIp = "0.0.0.0-0.0.0.0";
}else{
- defaultIp = "0.0.0.0";
+ defaultSrcIp = "0.0.0.0";
+ }
+ if(specificServiceHostCfg.getDestIpPattern()==1){
+ defaultDestIp = "0.0.0.0/32"; //0.0.0.0表示任意
+ }else if(specificServiceHostCfg.getDestIpPattern()==2){
+ defaultDestIp = "0.0.0.0-0.0.0.0";
+ }else{
+ defaultDestIp = "0.0.0.0";
}
}
if(specificServiceHostCfg.getIpType().equals(6)){
- if(specificServiceHostCfg.getIpPattern()==1){
- defaultIp = "::/64";
- }else if(specificServiceHostCfg.getIpPattern()==2){
- defaultIp = "::-::";
+ if(specificServiceHostCfg.getSrcIpPattern()==1){
+ defaultSrcIp = "::/64";
+ }else if(specificServiceHostCfg.getSrcIpPattern()==2){
+ defaultSrcIp = "::-::";
+ }else{
+ defaultSrcIp = "::";
+ }
+ if(specificServiceHostCfg.getDestIpPattern()==1){
+ defaultDestIp = "::/64";
+ }else if(specificServiceHostCfg.getDestIpPattern()==2){
+ defaultDestIp = "::-::";
}else{
- defaultIp = "::";
+ defaultDestIp = "::";
}
}
- String defaultPort = "0"; //0表示任意
- if(specificServiceHostCfg.getPortPattern().equals(1)){
- defaultPort = "0";
+ String defaultSrcPort = "0"; //0表示任意
+ String defaultDestPort = "0"; //0表示任意
+ if(specificServiceHostCfg.getSrcPortPattern().equals(1)){
+ defaultSrcPort = "0";
+ }else{
+ defaultSrcPort = "0/0";
+ }
+ if(specificServiceHostCfg.getDestPortPattern().equals(1)){
+ defaultDestPort = "0";
}else{
- defaultPort = "0/0";
+ defaultDestPort = "0/0";
}
//ip地址默认 缺省0.0.0.0值表示任意
if(StringUtil.isBlank(specificServiceHostCfg.getSrcIpAddress())){
- specificServiceHostCfg.setSrcIpAddress(defaultIp);
+ specificServiceHostCfg.setSrcIpAddress(defaultSrcIp);
}
if(StringUtil.isBlank(specificServiceHostCfg.getDestIpAddress())){
- specificServiceHostCfg.setDestIpAddress(defaultIp);
+ specificServiceHostCfg.setDestIpAddress(defaultDestIp);
}
//端口掩码默认
if(StringUtil.isBlank(specificServiceHostCfg.getSrcPort())){
- specificServiceHostCfg.setSrcPort(defaultPort);
+ specificServiceHostCfg.setSrcPort(defaultSrcPort);
}
if(StringUtil.isBlank(specificServiceHostCfg.getDestPort())){
- specificServiceHostCfg.setDestPort(defaultPort);
+ specificServiceHostCfg.setDestPort(defaultDestPort);
}
//方向缺省
if(specificServiceHostCfg.getDirection()==null){
diff --git a/src/main/java/com/nis/web/test/MaatCfgConverTest.java b/src/main/java/com/nis/web/test/MaatCfgConverTest.java index 20feefe85..7be4294a2 100644 --- a/src/main/java/com/nis/web/test/MaatCfgConverTest.java +++ b/src/main/java/com/nis/web/test/MaatCfgConverTest.java @@ -31,20 +31,24 @@ public class MaatCfgConverTest { ToMaatBean maat = new ToMaatBean();
BaseStringCfg str = new BaseStringCfg();
BaseIpCfg ip = new BaseIpCfg();
- ip.setIpPattern(1);
+ ip.setSrcIpPattern(1);
+ ip.setDestIpPattern(1);
ip.setIpType(4);
ip.setSrcIpAddress("192.168.10.0/24");
- ip.setPortPattern(2);
+ ip.setSrcPortPattern(2);
+ ip.setDestPortPattern(2);
ip.setSrcPort("8080-8089");
ip.setCompileId(123);
ip.setProtocol(6);
ip.setDirection(2);
ipList.add(ip);
ip = new BaseIpCfg();
- ip.setIpPattern(2);
+ ip.setSrcIpPattern(2);
+ ip.setDestIpPattern(2);
ip.setIpType(4);
ip.setSrcIpAddress("10.0.6.0-10.0.6.100");
- ip.setPortPattern(1);
+ ip.setSrcPortPattern(1);
+ ip.setDestPortPattern(1);
ip.setSrcPort("7080/65534");
ip.setCompileId(124);
ip.setDirection(1);
@@ -67,17 +71,17 @@ public class MaatCfgConverTest { for(BaseIpCfg c:ipList){
IpCfg ipCfg = new IpCfg();
ipCfg.setRegionId(regionId);
- if(c.getIpPattern()==1){
+ if(c.getSrcIpPattern()==1){
ipCfg.setSrcIp(c.getSrcIpAddress().split("/")[0]);
ipCfg.setSrcIpMask(IpUtil.convertMask(Integer.parseInt(c.getSrcIpAddress().split("/")[1])));
- }else if(c.getIpPattern()==2){
+ }else if(c.getSrcIpPattern()==2){
ipCfg.setSrcIp(c.getSrcIpAddress().split("-")[0]);
ipCfg.setSrcIpMask(IpUtil.getMask(c.getSrcIpAddress().split("-")[0], c.getSrcIpAddress().split("-")[1]));
}
- if(c.getPortPattern()==1){
+ if(c.getSrcPortPattern()==1){
ipCfg.setSrcPort(c.getSrcPort().split("/")[0]);
ipCfg.setSrcPortMask(c.getSrcPort().split("/")[1]);
- }else if(c.getPortPattern()==2){
+ }else if(c.getSrcPortPattern()==2){
ipCfg.setSrcPort(c.getSrcPort().split("-")[0]);
Integer portMask = Integer.parseInt(c.getSrcPort().split("-")[1])-Integer.parseInt(c.getSrcPort().split("-")[0]);
ipCfg.setSrcPortMask(portMask.toString());
diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 95790c319..0c1f5055d 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1509,4 +1509,10 @@ interface_total=Interface Total service_total=Service Total
unapproved_all=UnApprove all configurations!
delete_all=Delete all configurations!
-none_file_tip=Please Choose File!
\ No newline at end of file +none_file_tip=Please Choose File!
+the_same_ip_type=Client IP and Server IP must have the same IP type
+src_ip_pattern=Client IP Pattern
+dest_ip_pattern=Server IP Pattern
+src_port_pattern=Client Port Pattern
+dest_port_pattern=Server Port Pattern
+range_cross=Found intersections between Server IP address and Client IP address
\ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 04cfc4a9e..b07e24315 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1512,4 +1512,10 @@ effective=Effective admin_user_warn=Admin User Warn
interface_total=Interface Total
service_total=Service Total
-none_file_tip=Please Choose File!
\ No newline at end of file +none_file_tip=Please Choose File!
+the_same_ip_type=IP-\u0430\u0434\u0440\u0435\u0441 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043E\u043B\u0436\u043D\u044B \u0438\u043C\u0435\u0442\u044C \u043E\u0434\u0438\u043D \u0438 \u0442\u043E\u0442 \u0436\u0435 \u0442\u0438\u043F.
+src_ip_pattern=Client IP Pattern
+dest_ip_pattern=Server IP Pattern
+src_port_pattern=Client Port Pattern
+dest_port_pattern=Server Port Pattern
+range_cross=Found intersections between Server IP address and Client IP address
\ No newline at end of file diff --git a/src/main/resources/sql/20190417/extends_ip_port_pattern.sql b/src/main/resources/sql/20190417/extends_ip_port_pattern.sql new file mode 100644 index 000000000..ee6c3d83b --- /dev/null +++ b/src/main/resources/sql/20190417/extends_ip_port_pattern.sql @@ -0,0 +1,104 @@ +--#function_region_dict 对应ip_pattern,port_pattern的字段长度拓展一倍,使用分号分隔源/目的
+ALTER TABLE function_region_dict MODIFY config_ip_pattern VARCHAR(20) COMMENT "ip的格式 1:ip掩码;2:IP范围;3:IP;使用逗号分隔,源ip与目的IP使用;分隔";
+ALTER TABLE function_region_dict MODIFY config_port_pattern VARCHAR(20) COMMENT "端口的格式,1:port;2:port_mask;使用逗号分隔,源端口与目的端口使用;分隔";
+--#各表修改ip_pattern,port_pattern
+--#app_ip_cfg
+ALTER TABLE app_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE app_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE app_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE app_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#app_ip_range_cfg
+ALTER TABLE app_ip_range_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE app_ip_range_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE app_ip_range_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE app_ip_range_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#area_ip_cfg
+ALTER TABLE area_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE area_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE area_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE area_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#asn_ip_cfg
+ALTER TABLE asn_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE asn_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE asn_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE asn_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#av_cont_ip_cfg
+ALTER TABLE av_cont_ip_cfg change ip_pattern src_ip_pattern int COMMENT '源ip格式';
+ALTER TABLE av_cont_ip_cfg add dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE av_cont_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE av_cont_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#av_pic_ip_cfg
+ALTER TABLE av_pic_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE av_pic_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE av_pic_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE av_pic_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#av_voip_ip_cfg
+ALTER TABLE av_voip_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE av_voip_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE av_voip_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE av_voip_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#ddos_ip_cfg
+ALTER TABLE ddos_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE ddos_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE ddos_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE ddos_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#dns_ip_cfg
+ALTER TABLE dns_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE dns_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE dns_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE dns_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#ip_port_cfg
+ALTER TABLE ip_port_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+ALTER TABLE ip_port_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+ALTER TABLE ip_port_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+ALTER TABLE ip_port_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#ip_reuse_ip_cfg
+--ALTER TABLE ip_reuse_ip_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+--ALTER TABLE ip_reuse_ip_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+--ALTER TABLE ip_reuse_ip_cfg CHANGE port_pattern src_port_pattern INT COMMENT '源端口格式';
+--ALTER TABLE ip_reuse_ip_cfg ADD dest_port_pattern INT COMMENT '目的端口格式';
+--#ip_reuse_policy_cfg
+--ALTER TABLE ip_reuse_policy_cfg CHANGE ip_pattern src_ip_pattern INT COMMENT '源ip格式';
+--ALTER TABLE ip_reuse_policy_cfg ADD dest_ip_pattern INT COMMENT '目的ip格式';
+--#修改字典的值
+UPDATE function_region_dict SET config_ip_pattern ="1,2,3;1,2,3" WHERE config_ip_pattern="1,2,3";
+UPDATE function_region_dict SET config_ip_pattern ="1;1" WHERE config_ip_pattern="1";
+UPDATE function_region_dict SET config_ip_pattern ="3;3" WHERE config_ip_pattern="3";
+UPDATE function_region_dict SET config_ip_pattern ="1,3;1,3" WHERE config_ip_pattern="1,3";
+
+UPDATE function_region_dict SET config_port_pattern ="1;1" WHERE config_port_pattern="1";
+UPDATE function_region_dict SET config_port_pattern ="1,2;1,2" WHERE config_port_pattern="1,2";
+-- Spoofing IP修改只显示目的IP
+UPDATE function_region_dict SET config_ip_port_show=3 WHERE function_id=401;
+--ASN IP修改只显示目的IP
+UPDATE function_region_dict SET config_ip_port_show=3 WHERE function_id=600;
+--sql 更新字段语句
+UPDATE app_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE app_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE app_ip_range_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE app_ip_range_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE area_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE area_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE asn_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE asn_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE av_cont_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE av_cont_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE av_pic_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE av_pic_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE av_voip_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE av_voip_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE ddos_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE ddos_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE dns_ip_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE dns_ip_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+
+UPDATE ip_port_cfg c SET c.dest_ip_pattern =(SELECT b.src_ip_pattern FROM ( SELECT a.src_ip_pattern,a.`cfg_id` FROM ip_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
+UPDATE ip_port_cfg c SET c.dest_port_pattern =(SELECT b.src_port_pattern FROM ( SELECT a.src_port_pattern,a.`cfg_id` FROM port_port_cfg a) b WHERE b.cfg_id=c.`cfg_id`)
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/form/dDosIpInfo.jsp b/src/main/webapp/WEB-INF/include/form/dDosIpInfo.jsp index 84db2f83b..8cc49acdf 100644 --- a/src/main/webapp/WEB-INF/include/form/dDosIpInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/dDosIpInfo.jsp @@ -10,7 +10,36 @@ <div class="row ipInfo">
<div class="row">
- <div class="col-md-6">
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
+ <div class="col-md-6">
+ <select name="protocol" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ <input type="hidden" name="protocolId" value="0">
+ </div>
+ <div for="protocol"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="direction"/></label>
+ <div class="col-md-6">
+ <select name="direction" class="selectpicker show-tick form-control required" >
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="direction"></div>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
<div class="col-md-6">
@@ -30,120 +59,106 @@ <div for="ipType"></div>
</div>
</div>
- <div class="col-md-6">
- <div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
- <div class="col-md-6">
- <select name="protocol" class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
- </c:forEach>
- </select>
- <input type="hidden" name="protocolId" value="0">
- </div>
- <div for="protocol"></div>
- </div>
- </div>
- </div>
- <div class="row">
+ </div>
+ <div class="row ipCol">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
<div class="col-md-6">
- <select name="ipPattern" class="selectpicker show-tick form-control required">
+ <select name="srcIpPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipPattern==ipPatternC.itemCode || (_cfg.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="ipPattern"></div>
+ <div for="srcIpPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
<div class="col-md-6">
- <input class="form-control required ipCheck" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
+ <input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</div>
- <div for="destIpAddress"></div>
+ <div for="srcIpAddress"></div>
</div>
</div>
</div>
- <c:choose>
- <c:when test="${_cfg.cfgId==null}">
- <div class="row hidden port">
- </c:when>
- <c:otherwise>
- <div class="row port">
- </c:otherwise>
- </c:choose>
+ <div class="row hidden ipCol">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
<div class="col-md-6">
- <select name="portPattern" class="selectpicker show-tick form-control required">
+ <select name="srcPortPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="portPattern"></div>
+ <div for="srcPortPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
<div class="col-md-6">
- <input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
+ <input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
</div>
- <div for="destPort"></div>
+ <div for="srcPort"></div>
</div>
</div>
</div>
- <c:choose>
- <c:when test="${_cfg.cfgId==null}">
- <div class="row hidden destPort">
- </c:when>
- <c:otherwise>
- <div class="row destPort">
- </c:otherwise>
- </c:choose>
-
+ <div class="row hidden ipCol">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="direction"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_ip_pattern"/></label>
<div class="col-md-6">
- <select name="direction" class="selectpicker show-tick form-control required" >
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
+ <select name="destIpPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="direction"></div>
+ <div for="destIpPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
+ <div class="col-md-6">
+ <input class="form-control required ipCheck" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
+ </div>
+ <div for="destIpAddress"></div>
</div>
</div>
</div>
- <c:if test="${_cfg.cfgId==null}">
- <div class="row">
- <button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
- </div>
- </c:if>
- <div class="row destPort">
+ <div class="row hidden ipCol">
<div class="col-md-6">
<div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
<div class="col-md-6">
- <input type="hidden" name="srcIpAddress" value="${_cfg.srcIpAddress}">
+ <select name="destPortPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
</div>
+ <div for="destPortPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
- <input type="hidden" name="srcPort" value="${_cfg.srcPort}">
+ <input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
</div>
+ <div for="destPort"></div>
</div>
</div>
</div>
+ <div class="row">
+ <button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
+ </div>
</div>
</c:if>
</c:forEach>
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp index bf30fa83b..87c613952 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp @@ -6,8 +6,8 @@ <script type="text/javascript">
var defaultIpInfo;
$(function(){
- $("input[name$='destPort']").parents(".form-group").addClass("hidden");
- $("select[name$='portPattern']").parents(".form-group").addClass("hidden");
+ //$("input[name$='destPort']").parents(".form-group").addClass("hidden");
+ //$("select[name$='portPattern']").parents(".form-group").addClass("hidden");
$("select[name$='protocol']").parents(".form-group").addClass("hidden");
$("select[name$='direction']").parents(".form-group").addClass("hidden");
defaultIpInfo=$(".ipInfo").clone();
@@ -93,7 +93,7 @@ var addContent = function(obj, contentClassName) { $("select[name$='ipType']").on("change",function(){
switchIpInfo(this);
});
- $("select[name$='ipPattern']").on("change",function(){
+ $("select[name$='IpPattern']").on("change",function(){
switchIpInfo(this);
});
}
@@ -152,6 +152,8 @@ var reSort=function(obj,index){ <input type="hidden" id="compileId" name="compileId" value="0">
<input type="hidden" id="requestId" name="requestId" value="0">
<input type="hidden" id="asnIpGroup" name="asnIpGroup" value="0">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<c:forEach items="${serviceList}" var="service">
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
<input type="hidden" id="action" name="action" value="${service.action}">
@@ -165,8 +167,10 @@ var reSort=function(obj,index){ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -263,6 +267,38 @@ var reSort=function(obj,index){ onClick="delContent(this,'ipInfo');" />
</div>
</div>
+ <div class="row protocol">
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="protocol" /></label>
+ <div class="col-md-6">
+ <select name="asnIpCfgs[0].protocol"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <option value="${protocolC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].protocol==protocolC.itemCode || (_cfg.asnIpCfgs[0].protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="asnIpCfgs[0].protocol"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="direction" /></label>
+ <div class="col-md-6">
+ <select name="asnIpCfgs[0].direction"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <option value="${directionC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].direction==directionC.itemCode || (_cfg.asnIpCfgs[0].direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="asnIpCfgs[0].direction"></div>
+ </div>
+ </div>
+ </div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
@@ -285,18 +321,18 @@ var reSort=function(obj,index){ </div>
</div>
</div>
- <div class="row ip">
+ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
<div class="col-md-6">
- <select name="asnIpCfgs[0].ipPattern" class="selectpicker show-tick form-control required">
+ <select name="asnIpCfgs[0].srcIpPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].ipPattern==ipPatternC.itemCode || (_cfg.asnIpCfgs[0].ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].srcIpPattern==ipPatternC.itemCode || (_cfg.asnIpCfgs[0].srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="asnIpCfgs[0].ipPattern"></div>
+ <div for="asnIpCfgs[0].srcIpPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -309,18 +345,18 @@ var reSort=function(obj,index){ </div>
</div>
</div>
- <div class="row port">
+ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
<div class="col-md-6">
- <select name="asnIpCfgs[0].portPattern" class="selectpicker show-tick form-control required">
+ <select name="asnIpCfgs[0].srcPortPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <option value="${portPatternC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].portPattern==portPatternC.itemCode || (_cfg.asnIpCfgs[0].portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].srcPortPattern==portPatternC.itemCode || (_cfg.asnIpCfgs[0].srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="asnIpCfgs[0].portPattern"></div>
+ <div for="asnIpCfgs[0].srcPortPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -333,7 +369,20 @@ var reSort=function(obj,index){ </div>
</div>
</div>
- <div class="row destPort">
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <div class="col-md-6">
+ <select name="asnIpCfgs[0].destIpPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].destIpPattern==ipPatternC.itemCode || (_cfg.asnIpCfgs[0].destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="asnIpCfgs[0].destIpPattern"></div>
+ </div>
+ </div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
@@ -343,7 +392,22 @@ var reSort=function(obj,index){ <div for="asnIpCfgs[0].destIpAddress"></div>
</div>
</div>
- <div class="col-md-6">
+ </div>
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
+ <div class="col-md-6">
+ <select name="asnIpCfgs[0].destPortPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].destPortPattern==portPatternC.itemCode || (_cfg.asnIpCfgs[0].destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="asnIpCfgs[0].destPortPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
@@ -353,38 +417,7 @@ var reSort=function(obj,index){ </div>
</div>
</div>
- <div class="row protocol">
- <div class="col-md-6">
- <div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="protocol" /></label>
- <div class="col-md-6">
- <select name="asnIpCfgs[0].protocol"
- class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <option value="${protocolC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].protocol==protocolC.itemCode || (_cfg.asnIpCfgs[0].protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
- </c:forEach>
- </select>
- </div>
- <div for="asnIpCfgs[0].protocol"></div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="direction" /></label>
- <div class="col-md-6">
- <select name="asnIpCfgs[0].direction"
- class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <option value="${directionC.itemCode}" <c:if test="${_cfg.asnIpCfgs[0].direction==directionC.itemCode || (_cfg.asnIpCfgs[0].direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
- </c:forEach>
- </select>
- </div>
- <div for="asnIpCfgs[0].direction"></div>
- </div>
- </div>
- </div>
+
<%-- <div class="row">
<button type="button" class="btn btn-red-hollow center-block"
onClick="more(this);" data-click-times="0">
@@ -398,7 +431,23 @@ var reSort=function(obj,index){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp index cfc5e8485..40e6c8a8c 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp @@ -5,8 +5,8 @@ <title><spring:message code="asn_ip_configuration"></spring:message></title>
<script type="text/javascript">
$(function(){
- $("input[name='destPort']").parents(".form-group").addClass("hidden");
- $("select[name='portPattern']").parents(".form-group").addClass("hidden");
+ //$("input[name='destPort']").parents(".form-group").addClass("hidden");
+ //$("select[name='portPattern']").parents(".form-group").addClass("hidden");
$("select[name='protocol']").parents(".form-group").addClass("hidden");
$("select[name='direction']").parents(".form-group").addClass("hidden");
$("#cfgFrom").validate({
@@ -97,10 +97,17 @@ $(function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
- <c:if test="${_cfg.isAudit ne 1}">
- <input type="hidden" name="isValid" value="0">
- <input type="hidden" name="isAudit" value="0">
- </c:if>
+ <c:choose>
+ <c:when test="${_cfg.isAudit ne 1}">
+ <input type="hidden" name="isValid" value="0">
+ <input type="hidden" name="isAudit" value="0">
+ </c:when>
+ <c:otherwise>
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
+ </c:otherwise>
+ </c:choose>
+ <input type="hidden" id="regionId" name="regionId" value="${_cfg.regionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
@@ -115,8 +122,10 @@ $(function(){ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -211,6 +220,38 @@ $(function(){ <!-- desc and action -->
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
<div class="row ipInfo">
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="protocol" /></label>
+ <div class="col-md-6">
+ <select name="protocol"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="protocol"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="direction" /></label>
+ <div class="col-md-6">
+ <select name="direction"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="direction"></div>
+ </div>
+ </div>
+ </div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
@@ -236,11 +277,11 @@ $(function(){ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
<div class="col-md-6">
- <select name="ipPattern" class="selectpicker show-tick form-control required">
+ <select name="srcIpPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipPattern==ipPatternC.itemCode || (_cfg.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
@@ -257,18 +298,18 @@ $(function(){ </div>
</div>
</div>
- <div class="row port">
+ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
<div class="col-md-6">
- <select name="portPattern" class="selectpicker show-tick form-control required">
+ <select name="srcPortPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="portPattern"></div>
+ <div for="srcPortPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -281,7 +322,20 @@ $(function(){ </div>
</div>
</div>
- <div class="row destPort">
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_ip_pattern"/></label>
+ <div class="col-md-6">
+ <select name="destIpPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="ipPattern"></div>
+ </div>
+ </div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
@@ -291,7 +345,22 @@ $(function(){ <div for="destIpAddress"></div>
</div>
</div>
- <div class="col-md-6">
+ </div>
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
+ <div class="col-md-6">
+ <select name="destPortPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="destportPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
@@ -301,38 +370,6 @@ $(function(){ </div>
</div>
</div>
- <div class="row protocol">
- <div class="col-md-6">
- <div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="protocol" /></label>
- <div class="col-md-6">
- <select name="protocol"
- class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
- </c:forEach>
- </select>
- </div>
- <div for="protocol"></div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="direction" /></label>
- <div class="col-md-6">
- <select name="direction"
- class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
- </c:forEach>
- </select>
- </div>
- <div for="direction"></div>
- </div>
- </div>
- </div>
<%-- <div class="row">
<button type="button" class="btn btn-red-hollow center-block"
onClick="more(this);" data-click-times="0">
@@ -347,7 +384,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp index 370919a3b..829ca4eeb 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgList.jsp @@ -338,7 +338,7 @@ <%-- <td>${cfg.destPort }</td> --%>
<td>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</td>
<%-- <td>
diff --git a/src/main/webapp/WEB-INF/views/basics/protectionInfoForm.jsp b/src/main/webapp/WEB-INF/views/basics/protectionInfoForm.jsp index 7daa83dfc..70ece9ec5 100644 --- a/src/main/webapp/WEB-INF/views/basics/protectionInfoForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/protectionInfoForm.jsp @@ -19,6 +19,26 @@ $(function(){ },
errorContainer: "#messageBox",
});
+
+ jQuery.validator.addMethod("protectedCfgUnique",function(value, element) {
+ var result = true;
+ var proId= $("[name='proId']").val();
+ var keyword = $("[name='keyword']").val();
+ var targetType = $("[name='targetType']").val();
+ var ctx=$(element).attr("ctx");
+ var url = ctx+"/basics/innerProtectionList/checkKeywordExist";
+ $.ajax({
+ type:'post',
+ async:false,
+ url: url,
+ data:{"proId":proId,"keyword":keyword,"targetType":targetType},
+ success:function(data){
+ result = data;
+ }
+ });
+
+ return result;
+ });
});
</script>
</head>
@@ -48,15 +68,6 @@ $(function(){ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="keywords"/></label>
- <div class="col-md-6">
- <input class="form-control required" type="text" name="keyword" value="${_cfg.keyword}">
- </div>
- <div for="keyword"></div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="type"/></label>
<div class="col-md-6">
<%-- <input class="form-control required" type="text" name="targetType" value="${_cfg.targetType}"> --%>
@@ -70,6 +81,15 @@ $(function(){ <div for="targetType"></div>
</div>
</div>
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="keywords"/></label>
+ <div class="col-md-6">
+ <input class="form-control protectedCfgUnique required" ctx="${ctx}" type="text" name="keyword" value="${_cfg.keyword}">
+ </div>
+ <div for="keyword"></div>
+ </div>
+ </div>
</div>
<div class="row">
<div class="col-md-6">
diff --git a/src/main/webapp/WEB-INF/views/basics/protectionInfoList.jsp b/src/main/webapp/WEB-INF/views/basics/protectionInfoList.jsp index e582b2b99..8eba1aa75 100644 --- a/src/main/webapp/WEB-INF/views/basics/protectionInfoList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/protectionInfoList.jsp @@ -216,8 +216,8 @@ <thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
- <th column="keyword" ><spring:message code="keywords"/></th>
<th column="targetType" ><spring:message code="type"/></th>
+ <th column="keyword" ><spring:message code="keywords"/></th>
<th column="desc" ><spring:message code="desc"/></th>
<th column="creator" ><spring:message code="creator"/></th>
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
@@ -230,16 +230,16 @@ <tr>
<td><input type="checkbox" class="i-checks child-checks" id="${cfg.proId}"></td>
<td>
+ <c:if test="${cfg.targetType eq 'urlCheck'}"><spring:message code="URL"/></c:if>
+ <c:if test="${cfg.targetType eq 'domainCheck'}"><spring:message code="domain"/></c:if>
+ <c:if test="${cfg.targetType eq 'keywordSign'}"><spring:message code="keywords"/></c:if>
+ </td>
+ <td>
<a href="javascript:;" data-original-title="${cfg.keyword}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(cfg.keyword,20)}
</a>
</td>
- <td>
- <c:if test="${cfg.targetType eq 'urlCheck'}"><spring:message code="URL"/></c:if>
- <c:if test="${cfg.targetType eq 'domainCheck'}"><spring:message code="domain"/></c:if>
- <c:if test="${cfg.targetType eq 'keywordSign'}"><spring:message code="keywords"/></c:if>
- </td>
<td title="${cfg.description }">${fns:abbr(cfg.description,20)}</td>
<td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp index 327b898aa..5ee8a39ba 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp @@ -66,6 +66,8 @@ $(function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
@@ -378,7 +380,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp index 5dde687e4..f0bfb7ab4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp @@ -47,6 +47,8 @@ $(function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
@@ -59,8 +61,10 @@ $(function(){ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -134,39 +138,39 @@ $(function(){ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
<div class="col-md-6">
- <select name="ipPattern" class="selectpicker show-tick form-control required">
+ <select name="srcIpPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipPattern==ipPatternC.itemCode || (_cfg.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="ipPattern"></div>
+ <div for="srcIpPattern"></div>
</div>
</div>
- <div class="col-md-6">
- <div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
<div class="col-md-6">
- <select name="portPattern" class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
- </c:forEach>
- </select>
+ <input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</div>
- <div for="portPattern"></div>
+ <div for="srcIpAddress"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
- <div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
<div class="col-md-6">
- <input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
+ <select name="srcPortPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
</div>
- <div for="srcIpAddress"></div>
+ <div for="srcPortPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -181,23 +185,51 @@ $(function(){ </div>
<div class="row">
<div class="col-md-6">
- <div class="form-group ">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_ip_pattern"/></label>
+ <div class="col-md-6">
+ <select name="destIpPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="destIpPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
</div>
<div for="destIpAddress"></div>
</div>
- </div>
- <div class="col-md-6">
- <div class="form-group ">
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
+ <div class="col-md-6">
+ <select name="destPortPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="destPortPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
</div>
<div for="destPort"></div>
</div>
- </div>
+ </div>
</div>
<div class="row">
<div class="col-md-6">
@@ -271,7 +303,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp index 37b1f681a..bafd39f07 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp @@ -177,9 +177,9 @@ var addContent = function(obj, contentClassName) { /* $("."+contentClassName+"0").find("input,select").each(function(){
$(this).removeAttr("disabled");
}); */
- $("select[name$='portPattern']").parents(".port").removeClass("hidden");
- $("input[name$='destIpAddress']").parents(".destPort").removeClass("hidden");
- $(".moreBtn").data("click-times",2);
+ //$("select[name$='PortPattern']").parents(".port").removeClass("hidden");
+ //$("input[name$='destIpAddress']").parents(".destPort").removeClass("hidden");
+ //$(".moreBtn").data("click-times",2);
$(obj).addClass("hidden");
}
@@ -260,6 +260,8 @@ function changeKeywordFormate(exprType,obj){ <input type="hidden" name="cfgId" id="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
@@ -554,9 +556,23 @@ function changeKeywordFormate(exprType,obj){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green">
- <spring:message code="submit" />
- </button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp index c216110a8..f3527d75a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -223,6 +223,8 @@ var delContent = function(contentClassName, addBtnClassName) { <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="exprType" name="exprType" value="0">
<input type="hidden" id="matchMethod" name="matchMethod" value="0">
@@ -492,7 +494,23 @@ var delContent = function(contentClassName, addBtnClassName) { <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicySubList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicySubList.jsp index bfe9d0160..8bb5b5574 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicySubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicySubList.jsp @@ -52,6 +52,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -60,14 +82,14 @@ </label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -84,10 +106,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -97,38 +119,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appSubFeatureList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appSubFeatureList.jsp index 2c94ed0fe..1a9cb8bb6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appSubFeatureList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appSubFeatureList.jsp @@ -55,6 +55,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -63,14 +85,14 @@ </label>
</div>
</div>
- </div>
- <div class="row">
+ </div>
+ <%-- <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -87,10 +109,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -100,38 +122,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div> --%>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp index 888c217cf..251b250b3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp @@ -163,6 +163,8 @@ $(function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<input type="hidden" id="domainId" name="domainId" value="">
@@ -518,7 +520,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contSubList.jsp index 530f3cc07..58c7966e9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -42,14 +64,14 @@ </label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp index d707b2fd6..f01d79e73 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp @@ -35,6 +35,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -47,10 +69,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -67,10 +89,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -84,34 +106,37 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp index ce256091d..4fc2fd86f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp @@ -177,6 +177,8 @@ var switchRateLimitType=function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
@@ -438,7 +440,23 @@ var switchRateLimitType=function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp index b2b325056..84f24fb8b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp @@ -108,6 +108,8 @@ $(function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
<!-- 配置域类型 -->
@@ -119,8 +121,10 @@ $(function(){ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -246,7 +250,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp index ffa09a39c..c30fe6d0a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp @@ -417,7 +417,7 @@ </td>
<td>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</td>
<%-- <td>${cfg.srcIpAddress }</td>
@@ -425,7 +425,7 @@ <td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td>
<td>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</td>
<td>${cfg.destPort }</td>
diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp index 16add00e9..8ed87382d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp @@ -52,6 +52,8 @@ $(function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" name="protocolId" value="0">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
@@ -64,8 +66,10 @@ $(function(){ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -150,6 +154,38 @@ $(function(){ <!-- dolog end-->
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
<div class="row ipInfo">
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="protocol" /></label>
+ <div class="col-md-6">
+ <select name="protocol"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="protocol"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="direction" /></label>
+ <div class="col-md-6">
+ <select name="direction"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="direction"></div>
+ </div>
+ </div>
+ </div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
@@ -172,18 +208,18 @@ $(function(){ </div>
</div>
</div>
- <div class="row ip">
+ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
<div class="col-md-6">
- <select name="ipPattern" class="selectpicker show-tick form-control required">
+ <select name="srcIpPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipPattern==ipPatternC.itemCode || (_cfg.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="ipPattern"></div>
+ <div for="srcIpPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -196,18 +232,18 @@ $(function(){ </div>
</div>
</div>
- <div class="row port">
+ <div class="row">
<div class="col-md-6">
<div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
<div class="col-md-6">
- <select name="portPattern" class="selectpicker show-tick form-control required">
+ <select name="srcPortPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <option value="${portPatternC.itemCode}" <c:if test="${_cfg.portPattern==portPatternC.itemCode || (_cfg.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="portPattern"></div>
+ <div for="srcPortPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -220,7 +256,20 @@ $(function(){ </div>
</div>
</div>
- <div class="row destPort">
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
+ <div class="col-md-6">
+ <select name="destIpPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="destIpPattern"></div>
+ </div>
+ </div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip"/></label>
@@ -230,7 +279,22 @@ $(function(){ <div for="destIpAddress"></div>
</div>
</div>
- <div class="col-md-6">
+ </div>
+ <div class="row">
+ <div class="col-md-6">
+ <div class="form-group">
+ <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
+ <div class="col-md-6">
+ <select name="destPortPattern" class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="destPortPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
@@ -240,38 +304,7 @@ $(function(){ </div>
</div>
</div>
- <div class="row protocol">
- <div class="col-md-6">
- <div class="form-group ">
- <label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="protocol" /></label>
- <div class="col-md-6">
- <select name="protocol"
- class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
- </c:forEach>
- </select>
- </div>
- <div for="protocol"></div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
- <label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="direction" /></label>
- <div class="col-md-6">
- <select name="direction"
- class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
- </c:forEach>
- </select>
- </div>
- <div for="direction"></div>
- </div>
- </div>
- </div>
+
<%-- <div class="row">
<button type="button" class="btn btn-red-hollow center-block"
onClick="more(this);" data-click-times="0">
@@ -286,7 +319,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp index 192f6643f..8fbda41b1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp @@ -387,7 +387,7 @@ <%-- <td>${cfg.destPort }</td> --%>
<td>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</td>
<%-- <td>
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/encrypedTunnelSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/encrypedTunnelSubList.jsp index bfe9d0160..8bb5b5574 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/encrypedTunnelSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/encrypedTunnelSubList.jsp @@ -52,6 +52,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -60,14 +82,14 @@ </label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -84,10 +106,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -97,38 +119,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp index e82e9ed12..97bec1b07 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -202,6 +202,8 @@ var switchRateLimitType=function(){ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
@@ -470,7 +472,23 @@ var switchRateLimitType=function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp index 7f9402f7e..3ad01acae 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -46,10 +68,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pSubList.jsp index a5760a3e5..22365918c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -44,10 +66,10 @@ </div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='p2p_ip_config_type'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('P2P_IP_TYPE')}" var="ipType">
+ <c:if test="${_cfg.userRegion2==ipType.itemCode}"><spring:message code="${ipType.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
@@ -56,19 +78,19 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='client_ip'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
- ${cfg.srcIpAddress}
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='client_ip'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
- </c:forEach>
+ ${cfg.srcIpAddress}
</label>
</div>
</div>
@@ -76,28 +98,36 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='server_ip'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
- </c:forEach>
+ ${cfg.destIpAddress}
</label>
</div>
</div>
@@ -105,22 +135,17 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='p2p_ip_config_type'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('P2P_IP_TYPE')}" var="ipType">
- <c:if test="${_cfg.userRegion2==ipType.itemCode}"><spring:message code="${ipType.itemValue}"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptSubList.jsp index 24c35879e..5763e7a4e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -46,10 +68,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp index f196ad5cc..82e0f8752 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp @@ -185,6 +185,8 @@ function privateFileValidate(){ <form id="cfgFrom" action="${ctx}/proxy/intercept/strateagy/saveOrUpdate" method="post" enctype="multipart/form-data" class="form-horizontal">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="cfgId" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
@@ -398,7 +400,23 @@ function privateFileValidate(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp index 3cebfb2ff..ab7d7bd0a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp @@ -93,6 +93,8 @@ function certFileValidate(){ <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
<input type="hidden" id="cfgId" name="cfgId" value="${_cfg.cfgId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="cfgType" name="cfgType" value="PXY_OBJ_TRUSTED_CA_CERT">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
@@ -214,7 +216,23 @@ function certFileValidate(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipCfgForm.jsp index 082650dcd..91ecd34f2 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipCfgForm.jsp @@ -16,8 +16,10 @@ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -52,50 +54,67 @@ </c:if>
<div class="row">
<div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="protocol" /></label>
+ <div class="col-md-6">
+ <select name="${cfgName}.protocol"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <option value="${protocolC.itemCode}" <c:if test="${ipPort.protocol==protocolC.itemCode || (ipPort.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
+ </c:forEach>
+ </select>
+ </div>
+ <div for="${cfgName}.protocol"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="ip_type" /></label>
+ <spring:message code="direction" /></label>
<div class="col-md-6">
- <select name="${cfgName}.ipType"
+ <select name="${cfgName}.direction"
class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
- <option value="${ipTypeC.itemCode}" <c:if test="${ipPort.ipType==ipTypeC.itemCode || (ipPort.ipType==null && ipTypeC.itemCode==4)}">selected</c:if>><spring:message code="${ipTypeC.itemValue}"/></option>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <option value="${directionC.itemCode}" <c:if test="${ipPort.direction==directionC.itemCode || (ipPort.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="${cfgName}.ipType"></div>
+ <div for="${cfgName}.direction"></div>
</div>
</div>
+</div>
+<div class="row">
<div class="col-md-6">
- <div class="form-group ">
+ <div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="protocol" /></label>
+ <spring:message code="ip_type" /></label>
<div class="col-md-6">
- <select name="${cfgName}.protocol"
+ <select name="${cfgName}.ipType"
class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <option value="${protocolC.itemCode}" <c:if test="${ipPort.protocol==protocolC.itemCode || (ipPort.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
+ <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
+ <option value="${ipTypeC.itemCode}" <c:if test="${ipPort.ipType==ipTypeC.itemCode || (ipPort.ipType==null && ipTypeC.itemCode==4)}">selected</c:if>><spring:message code="${ipTypeC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="${cfgName}.protocol"></div>
+ <div for="${cfgName}.ipType"></div>
</div>
</div>
</div>
-<div class="row ip">
+<div class="row ipCol">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="ip_pattern" /></label>
+ <spring:message code="src_ip_pattern" /></label>
<div class="col-md-6">
- <select name="${cfgName}.ipPattern"
+ <select name="${cfgName}.srcIpPattern"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <option value="${ipPatternC.itemCode}" <c:if test="${ipPort.ipPattern==ipPatternC.itemCode || (ipPort.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ <option value="${ipPatternC.itemCode}" <c:if test="${ipPort.srcIpPattern==ipPatternC.itemCode || (ipPort.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="${cfgName}.ipPattern"></div>
+ <div for="${cfgName}.srcIpPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -111,20 +130,20 @@ </div>
</div>
</div>
-<div class="row hidden port">
+<div class="row hidden ipCol">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="port_pattern" /></label>
+ <spring:message code="src_port_pattern" /></label>
<div class="col-md-6">
- <select name="${cfgName}.portPattern"
+ <select name="${cfgName}.srcPortPattern"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <option value="${portPatternC.itemCode}" <c:if test="${ipPort.portPattern==portPatternC.itemCode || (ipPort.portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
+ <option value="${portPatternC.itemCode}" <c:if test="${ipPort.srcPortPattern==portPatternC.itemCode || (ipPort.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="${cfgName}.portPattern"></div>
+ <div for="${cfgName}.srcPortPattern"></div>
</div>
</div>
<div class="col-md-6">
@@ -140,46 +159,62 @@ </div>
</div>
</div>
-<div class="row hidden destPort">
+<div class="row hidden ipCol">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="server_ip" /></label>
+ <spring:message code="dest_ip_pattern" /></label>
<div class="col-md-6">
- <input class="form-control required ipCheck" type="text"
- name="${cfgName}.destIpAddress"
- value="${ipPort.destIpAddress}">
+ <select name="${cfgName}.destIpPattern"
+ class="selectpicker show-tick form-control required">
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <option value="${ipPatternC.itemCode}" <c:if test="${ipPort.destIpPattern==ipPatternC.itemCode || (ipPort.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
+ </c:forEach>
+ </select>
</div>
- <div for="${cfgName}.destIpAddress"></div>
+ <div for="${cfgName}.destIpPattern"></div>
</div>
</div>
<div class="col-md-6">
- <div class="form-group ">
+ <div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="server_port" /></label>
+ <spring:message code="server_ip" /></label>
<div class="col-md-6">
- <input class="form-control required portCheck" type="text"
- name="${cfgName}.destPort"
- value="${ipPort.destPort}">
+ <input class="form-control required ipCheck" type="text"
+ name="${cfgName}.destIpAddress"
+ value="${ipPort.destIpAddress}">
</div>
- <div for="${cfgName}.destPort"></div>
+ <div for="${cfgName}.destIpAddress"></div>
</div>
</div>
+
</div>
-<div class="row hidden protocol">
+<div class="row hidden ipCol">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
- <spring:message code="direction" /></label>
+ <spring:message code="dest_port_pattern" /></label>
<div class="col-md-6">
- <select name="${cfgName}.direction"
+ <select name="${cfgName}.destPortPattern"
class="selectpicker show-tick form-control required">
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <option value="${directionC.itemCode}" <c:if test="${ipPort.direction==directionC.itemCode || (ipPort.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <option value="${portPatternC.itemCode}" <c:if test="${ipPort.destPortPattern==portPatternC.itemCode || (ipPort.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
- <div for="${cfgName}.direction"></div>
+ <div for="${cfgName}.destPortPattern"></div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ <div class="form-group ">
+ <label class="control-label col-md-3"><font color="red">*</font>
+ <spring:message code="server_port" /></label>
+ <div class="col-md-6">
+ <input class="form-control required portCheck" type="text"
+ name="${cfgName}.destPort"
+ value="${ipPort.destPort}">
+ </div>
+ <div for="${cfgName}.destPort"></div>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index f7da626d8..2528aed74 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -453,8 +453,10 @@ var showHideIPSECProtocol=function(obj){ serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
- ipPattern="${region.configIpPattern}"
- portPattern="${region.configPortPattern}"
+ srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
+ destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
+ srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
+ destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
@@ -538,12 +540,12 @@ var showHideIPSECProtocol=function(obj){ </c:forEach>
</div>
</div>
- <div class="col-md-6 doBlackList">
+ <div class="col-md-6 doBalckList">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_blacklist" /></label>
<c:forEach items="${fns:getDictList('DO_BLACKLIST') }" var="dict">
<c:choose>
- <c:when test="${not empty _cfg.doBlackList and dict.itemCode eq _cfg.doBlackList}">
+ <c:when test="${dict.itemCode eq _cfg.doBlackList and not empty_cfg.doBalckList}">
<label class="radio-inline">
<input type="radio" name="doBlackList" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp index afb4a7852..c0b5ddae1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp @@ -37,6 +37,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -45,14 +67,14 @@ </label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -69,10 +91,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -82,38 +104,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp index 3aa3b57a8..636ae6638 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp @@ -35,6 +35,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -47,10 +69,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -67,10 +89,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -84,34 +106,37 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp index 6624e839f..f953fb0e9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp @@ -91,6 +91,8 @@ $(function(){ <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
+ <input type="hidden" name="isValid" value="${_cfg.isValid}">
+ <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
@@ -222,7 +224,23 @@ $(function(){ <div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
- <button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
+ <c:set var="auditPermission" value="false"></c:set>
+ <!-- 拥有配置新增直接生效的功能权限 -->
+ <shiro:hasPermission name="save:audit:permission">
+ <c:set var="auditPermission" value="true"></c:set>
+ </shiro:hasPermission>
+ <c:choose>
+ <c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
+ <button id="audit" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:when>
+ <c:otherwise>
+ <button id="save" type="submit" class="btn green">
+ <spring:message code="submit" />
+ </button>
+ </c:otherwise>
+ </c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpSubList.jsp index 5ee04bd06..3b14042f4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -46,10 +68,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectSubList.jsp index 2d5322b46..a4188c2b8 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectSubList.jsp @@ -72,88 +72,113 @@ <c:forEach items="${_cfg.ipPortList}" var="cfg">
<div id="ipInfo${index}" class="content" name="subCfg${index}">
<div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='ip_type'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
- <c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='client_ip'/>:</label>
- <label>
- ${cfg.srcIpAddress}
- </label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='direction'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='ip_type'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
+ <c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='src_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='client_ip'/>:</label>
+ <label>
+ ${cfg.srcIpAddress}
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='src_port_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='dest_port_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ </div>
+ </div>
+ </div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpUrlList}" var="cfg">
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp index 964e0604f..e8ee1b68b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -42,14 +64,14 @@ </label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp index cdd7ca07e..8c0ecd5e5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp @@ -72,88 +72,113 @@ <c:forEach items="${_cfg.ipPortList}" var="cfg">
<div id="ipInfo${index}" class="content" name="subCfg${index}">
<div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='ip_type'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
- <c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='client_ip'/>:</label>
- <label>
- ${cfg.srcIpAddress}
- </label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='direction'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
- </div>
- </div>
- </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='ip_type'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
+ <c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='src_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='client_ip'/>:</label>
+ <label>
+ ${cfg.srcIpAddress}
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='src_port_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='dest_port_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ </div>
+ </div>
+ </div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpUrlList}" var="cfg">
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp index 67d0567fd..47594af5f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp @@ -34,6 +34,28 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4">
+ <div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
@@ -42,14 +64,14 @@ </label>
</div>
</div>
- </div>
- <div class="row">
+ </div>
+ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
- <div class="row">
+ </div>
+ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
- </div>
- <div class="row">
+ </div>
+ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index 8a75a1944..edd757fef 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -27,7 +27,7 @@ });
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
- $("select[name$='protocol']").parents(".form-group").addClass("hidden");
+ $("select[name$='protocol']").parents(".form-group").parentsUntil(".row").addClass("hidden");
//$("select[name$='direction']").parents(".form-group").addClass("hidden");
$("#cfgFrom").validate(
{
@@ -169,8 +169,6 @@ <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
- <input type="hidden" name="isValid" value="${_cfg.isValid}">
- <input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<!-- <input type="hidden" name="protocol" value="0">
<input type="hidden" name="direction" value="0"> -->
<input type="hidden" name="isAreaEffective" value="0" >
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipSubList.jsp index f25e7153d..01186a6d7 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipSubList.jsp @@ -32,6 +32,28 @@ <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
+ <div class="col-md-4 hidden">
+ <div class="form-group">
+ <label><spring:message code='protocol'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
+ <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label><spring:message code='direction'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
+ <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='ip_type'/>:</label>
@@ -42,14 +64,14 @@ </label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='ip_pattern'/>:</label>
+ <label><spring:message code='src_ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
- <c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -66,10 +88,10 @@ <div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='port_pattern'/>:</label>
+ <label><spring:message code='src_port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
- <c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
+ <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
@@ -79,38 +101,41 @@ <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
- </div>
+ </div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
+ <label><spring:message code='dest_ip_pattern'/>:</label>
+ <label>
+ <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
+ <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
+ </c:forEach>
+ </label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
+ <label><spring:message code='server_ip'/>:</label>
+ <label>
+ ${cfg.destIpAddress}
+ </label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
- <label><spring:message code='direction'/>:</label>
+ <label><spring:message code='dest_port_pattern'/>:</label>
<label>
- <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
- <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
+ <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
+ <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
- <div class="col-md-4 hidden">
+ <div class="col-md-4">
<div class="form-group">
- <label><spring:message code='protocol'/>:</label>
- <label>
- <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
- <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
- </c:forEach>
- </label>
+ <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index b46d9c9d3..997b2ca9e 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -297,66 +297,21 @@ jQuery.validator.addMethod("protocolPort",function(value, element) { return true; } }); - -//ip地址校验 -jQuery.validator.addMethod("ipCheck",function(value, element) { +/** + *将验证单独提出,源IP,目的IP分别调用该方法 + */ +var validateIpPattern= function(ipType,ipPattern,value,element){ var ipv4_ip_subnet_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\/(3[0-2]|1[6-9]|2[0-9])$/; var ipv6_ip_subnet_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))\/([2-9]|[1-9][0-9]|1[0-2][0-8])$/; var ipv4_ip_range_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)-(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/; var ipv6_ip_range_regexp= /^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))\-((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/; var ipv4_ip_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/; var ipv6_ip_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/; - var name=$(element).attr("name"); - if(value.length==0||value.trim().length==0){return true;} - var ipTypeE,ipPatternE,srcIpAddressE,destIpAddressE; - if(name.indexOf("srcIpAddress")>-1){ - srcIpAddressE=$(element); - ipTypeE=$("select[name='"+name.replace("srcIpAddress","ipType")+"']"); - ipPatternE=$("select[name='"+name.replace("srcIpAddress","ipPattern")+"']"); - destIpAddressE=$("input[name='"+name.replace("srcIpAddress","destIpAddress")+"']"); - }else if(name.indexOf("destIpAddress")>-1){ - destIpAddressE=$(element); - ipTypeE=$("select[name='"+name.replace("destIpAddress","ipType")+"']"); - ipPatternE=$("select[name='"+name.replace("destIpAddress","ipPattern")+"']"); - srcIpAddressE=$("input[name='"+name.replace("destIpAddress","srcIpAddress")+"']"); - } - var typeInt=ipTypeE.val(); - var ipPattern=ipPatternE.val(); - var srcIpAddress=srcIpAddressE.val(); - var destIpAddress=destIpAddressE.val(); - var srcIpIsHidden=srcIpAddressE.is(":hidden"); - var destIpIsHidden=destIpAddressE.is(":hidden"); var IPv4RangeDefault="0.0.0.0-0.0.0.0"; - if(ipPattern==1){//ip/掩码格式 - srcIpAddress=srcIpAddress.indexOf("/") >-1 ?srcIpAddress.split("/")[0] : srcIpAddress; - destIpAddress=destIpAddress.indexOf("/") >-1 ?destIpAddress.split("/")[0] : destIpAddress; - }else if (ipPattern==2){ - srcIpAddress=srcIpAddress.indexOf("-") >-1 ?srcIpAddress.split("-")[0] : srcIpAddress; - destIpAddress=destIpAddress.indexOf("-") >-1 ?destIpAddress.split("-")[0] : destIpAddress; - } - if(srcIpIsHidden){ - if((srcIpAddress == destIpAddress)){ - $.validator.messages.ipCheck=$.validator.messages.destIpIsNotValue+destIpAddress; - return false; - } - }else if(destIpIsHidden){ - if((srcIpAddress == destIpAddress)){ - $.validator.messages.ipCheck=$.validator.messages.srcIpIsNotValue+srcIpAddress; - return false; - } - }else{ - if((srcIpAddress == destIpAddress)){ - $.validator.messages.ipCheck=$.validator.messages.srcIpNotEqDestIp+srcIpAddress - +$.validator.messages.destIpNotEqDestIp+destIpAddress - +$.validator.messages.IpNotEqDestIp; - return false; - } - } - - if(typeInt==4){ + if(ipType==4){ if(ipPattern){ if(ipPattern==1){//ip/掩码格式 - if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ + if(jQuery.validator.prototype.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ if(ipv4_ip_subnet_regexp.test(value)){ return true; }else{ @@ -407,7 +362,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { return false; } }else if(ipPattern==3){//ip格式 - if(this.optional(element)||ipv4_ip_regexp.test(value)){ + if(jQuery.validator.prototype.optional(element)||ipv4_ip_regexp.test(value)){ return true; }else{ $.validator.messages.ipCheck=$.validator.messages.ip; @@ -415,16 +370,16 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { } } }else{//兼容原来的验证 - if(this.optional(element)||ipv4_ip_regexp.test(value)){ + if(jQuery.validator.prototype.optional(element)||ipv4_ip_regexp.test(value)){ return true; }else{ $.validator.messages.ipCheck=$.validator.messages.ip; return false; } } - }else if(typeInt==6){ + }else if(ipType==6){ if(ipPattern==1){//ip/掩码格式 - if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){ + if(jQuery.validator.prototype.optional(element)||ipv6_ip_subnet_regexp.test(value)){ return true; }else if(value.indexOf("/")==-1){ $.validator.messages.ipCheck=$.validator.messages.ipMask; @@ -462,334 +417,136 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { } return false; }else if(ipPattern==3){//ip格式 - if(this.optional(element)||ipv6_ip_regexp.test(value)){ + if(jQuery.validator.prototype.optional(element)||ipv6_ip_regexp.test(value)){ return true; }else{ $.validator.messages.ipCheck=$.validator.messages.ip; return false; } }else{//兼容原来的验证 - if(this.optional(element)||ipv6_ip_regexp.test(value)){ + if(jQuery.validator.prototype.optional(element)||ipv6_ip_regexp.test(value)){ return true; }else{ $.validator.messages.ipCheck=$.validator.messages.ip; return false; } } - }else if(typeInt==46){ - var name=$(element).attr("name"); - if(name.indexOf("srcIpAddress")>-1){ - if(ipPattern==1){//ip/掩码格式 - if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ - if(ipv4_ip_subnet_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipMaskRange; - return false; - } - }else if(RegExp.$5&&RegExp.$5>32){ - $.validator.messages.ipCheck=$.validator.messages.ipMaskRange; - return false; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - } - }else if(ipPattern==2){//ip range - //A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0 - //B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0 - //C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0 - if(ipv4_ip_range_regexp.test(value)){ - var startIp=value.split("-")[0]; - var endIp=value.split("-")[1]; - var startPart0=startIp.split(".")[0]; - var startPart1=endIp.split(".")[0]; - if(value==IPv4RangeDefault){ - return true; - } - if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) - ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) - ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP - if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 - if((startIp.split(".")[0]!=endIp.split(".")[0])|| - (startIp.split(".")[1]!=endIp.split(".")[1])|| - (startIp.split(".")[2]!=endIp.split(".")[2])){ - $.validator.messages.ipCheck=$.validator.messages.netAddress; - }else{ - return true; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange1; - return false; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange; - return false; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange; - return false; - } - }else if(ipPattern==3){//ip - if(this.optional(element)||ipv4_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } - } - }else if(name.indexOf("destIpAddress")>-1){ - if(ipPattern==1){//ip/掩码格式 - if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){ - return true; - }else if(value.indexOf("/")==-1){ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - }else{ - var ipMaskArr=value.split("/"); - if(ipMaskArr.length!=2){ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - }else{ - if(!ipv6_ip_regexp.test(ipMaskArr[0])){ - $.validator.messages.ipCheck=$.validator.messages.ipPart; - return false; - //}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ - }else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){ - $.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart; - return false; - } else{ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - } - } - } - }else if(ipPattern==2){//ip range - $.validator.messages.ipCheck=$.validator.messages.ipRange; - if(ipv6_ip_range_regexp.test(value)){ - var ipArr=value.split("-"); - var startIp=fillIp(ipArr[0]); - var endIp=fillIp(ipArr[1]); - //默认比较前64位 - var exp1=/^[0-9A-Fa-f]*:[0-9A-Fa-f]*:[0-9A-Fa-f]*:[0-9A-Fa-f]*/; - var startPre=String(startIp.match(exp1)); - var endPre=String(endIp.match(exp1)); - return startPre==endPre; - } - return false; - }else if(ipPattern==3){//ip格式 - if(this.optional(element)||ipv6_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } - }else{//兼容原来的验证 - if(this.optional(element)||ipv6_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } - } + }else{ + $.validator.messages.ipCheck=$.validator.messages.ip; + return false; + } +} +/** + * 校验IP V4范围交叉 + */ +var validateIPV4Range=function(srcIp,destIp){ + var ipv4_ip_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/; + var srcStart=0,srcEnd=0,destStart=0,destEnd=0; + if(srcIp.indexOf("-") >-1){ + if(ipv4_ip_regexp.test(srcIp.split('-')[0])){ + srcStart=ipToNumber(srcIp.split('-')[0]); } - }else if(typeInt==64){ - var name=$(element).attr("name"); - if(name.indexOf("srcIpAddress")>-1){ - if(ipPattern==1){//ip/掩码格式 - if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){ - return true; - }else if(value.indexOf("/")==-1){ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - }else{ - var ipMaskArr=value.split("/"); - if(ipMaskArr.length!=2){ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - }else{ - if(!ipv6_ip_regexp.test(ipMaskArr[0])){ - $.validator.messages.ipCheck=$.validator.messages.ipPart; - return false; - //}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ - }else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){ - $.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart; - return false; - } else{ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - } - } - } - }else if(ipPattern==2){//ip range - $.validator.messages.ipCheck=$.validator.messages.ipRange; - if(ipv6_ip_range_regexp.test(value)){ - var ipArr=value.split("-"); - var startIp=fillIp(ipArr[0]); - var endIp=fillIp(ipArr[1]); - //默认比较前64位 - var exp1=/^[0-9A-Fa-f]*:[0-9A-Fa-f]*:[0-9A-Fa-f]*:[0-9A-Fa-f]*/; - var startPre=String(startIp.match(exp1)); - var endPre=String(endIp.match(exp1)); - return startPre==endPre; - } + if(ipv4_ip_regexp.test(srcIp.split('-')[1])){ + srcEnd=ipToNumber(srcIp.split('-')[1]); + } + } + if(destIp.indexOf("-") >-1){ + if(ipv4_ip_regexp.test(destIp.split('-')[0])){ + destStart=ipToNumber(destIp.split('-')[0]); + } + if(ipv4_ip_regexp.test(destIp.split('-')[1])){ + destEnd=ipToNumber(destIp.split('-')[1]); + } + } + if(srcStart>0||srcEnd>0){ + if(destStart>0||destEnd>0){ + if(srcStart>destEnd||srcEnd<destStart){ + }else{ + var tip=$.validator.format($.validator.messages.rangeCross1); + $.validator.messages.ipCheck=tip(srcIp,destIp); return false; - }else if(ipPattern==3){//ip格式 - if(this.optional(element)||ipv6_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } - }else{//兼容原来的验证 - if(this.optional(element)||ipv6_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } } - }else if(name.indexOf("destIpAddress")>-1){ - if(ipPattern==1){//ip/掩码格式 - if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ - if(ipv4_ip_subnet_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipMaskRange; - return false; - } - }else if(RegExp.$5&&RegExp.$5>32){ - $.validator.messages.ipCheck=$.validator.messages.ipMaskRange; - return false; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - } - }else if(ipPattern==2){//ip range - //A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0 - //B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0 - //C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0 - if(ipv4_ip_range_regexp.test(value)){ - var startIp=value.split("-")[0]; - var endIp=value.split("-")[1]; - var startPart0=startIp.split(".")[0]; - var startPart1=endIp.split(".")[0]; - if(value==IPv4RangeDefault){ - return true; - } - if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) - ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) - ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP - if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 - if((startIp.split(".")[0]!=endIp.split(".")[0])|| - (startIp.split(".")[1]!=endIp.split(".")[1])|| - (startIp.split(".")[2]!=endIp.split(".")[2])){ - $.validator.messages.ipCheck=$.validator.messages.netAddress; - }else{ - return true; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange1; - return false; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange; - return false; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange; - return false; - } - }else if(ipPattern==3){//ip - if(this.optional(element)||ipv4_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } + }else if(ipv4_ip_regexp.test(destIp)){ + if(srcStart<=ipToNumber(destIp)&&ipToNumber(destIp)<=srcEnd){ + var tip=$.validator.format($.validator.messages.rangeCross0); + $.validator.messages.ipCheck=tip(destIp,srcIp.split('-')[0],srcIp.split('-')[1]); + return false; } } - }else if(typeInt==10){ - if(ipPattern){ - if(ipPattern==1){//ip/掩码格式 - if(ipv4_ip_subnet_regexp.test(value)){ - return true; - }else if(ipv6_ip_subnet_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipMask; - return false; - } - }else if(ipPattern==2){//ip range - //A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0 - //B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0 - //C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0 - if(ipv4_ip_range_regexp.test(value)){ - var startIp=value.split("-")[0]; - var endIp=value.split("-")[1]; - var startPart0=startIp.split(".")[0]; - var startPart1=endIp.split(".")[0]; - if(value==IPv4RangeDefault){ - return true; - } - if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) - ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) - ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP - if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 - if((startIp.split(".")[0]!=endIp.split(".")[0])|| - (startIp.split(".")[1]!=endIp.split(".")[1])|| - (startIp.split(".")[2]!=endIp.split(".")[2])){ - $.validator.messages.ipCheck=$.validator.messages.netAddress; - }else{ - return true; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange1; - return false; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ipRange; - return false; - } - }else if(ipv6_ip_subnet_regexp.test(value)){ - var ipArr=value.split("-"); - var startIp=fillIp(ipArr[0]); - var endIp=fillIp(ipArr[1]); - //默认比较前64位 - var exp1=/^[0-9A-Fa-f]*:[0-9A-Fa-f]*:[0-9A-Fa-f]*:[0-9A-Fa-f]*/; - var startPre=String(startIp.match(exp1)); - var endPre=String(endIp.match(exp1)); - if(startPre!=endPre){ - $.validator.messages.ipCheck=$.validator.messages.ipRange; - return false; - }else{ - return true; - } - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } - - }else if(ipPattern==3){//ip格式 - if(ipv4_ip_regexp.test(value)||ipv6_ip_regexp.test(value)){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; - return false; - } - } - }else{//兼容原来的验证 - if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){ - return true; - }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; + }else if(destStart>0||destEnd>0){ + if(ipv4_ip_regexp.test(srcIp)){ + if(destStart<=ipToNumber(srcIp)&&ipToNumber(srcIp)<=destEnd){ + var tip=$.validator.format($.validator.messages.rangeCross0); + $.validator.messages.ipCheck=tip(srcIp,destIp.split('-')[0],destIp.split('-')[1]); return false; } } + } + //$.validator.messages.ipCheck=""; + return true; +} +//ip地址校验 +jQuery.validator.addMethod("ipCheck",function(value, element) { + var name=$(element).attr("name"); + if(value.length==0||value.trim().length==0){return true;} + var ipTypeE,srcIpPatternE,descIpPatternE,srcIpAddressE,destIpAddressE; + if(name.indexOf("srcIpAddress")>-1){ + srcIpAddressE=$(element); + ipTypeE=$("select[name='"+name.replace("srcIpAddress","ipType")+"']"); + srcIpPatternE=$("select[name='"+name.replace("srcIpAddress","srcIpPattern")+"']"); + destIpPatternE=$("select[name='"+name.replace("srcIpAddress","destIpPattern")+"']"); + destIpAddressE=$("input[name='"+name.replace("srcIpAddress","destIpAddress")+"']"); + }else if(name.indexOf("destIpAddress")>-1){ + destIpAddressE=$(element); + ipTypeE=$("select[name='"+name.replace("destIpAddress","ipType")+"']"); + srcIpPatternE=$("select[name='"+name.replace("destIpAddress","srcIpPattern")+"']"); + destIpPatternE=$("select[name='"+name.replace("destIpAddress","destIpPattern")+"']"); + srcIpAddressE=$("input[name='"+name.replace("destIpAddress","srcIpAddress")+"']"); + } + var typeInt=ipTypeE.val(); + var srcIpPattern=srcIpPatternE.val(); + var destIpPattern=destIpPatternE.val(); + var srcIpAddress=srcIpAddressE.val(); + var destIpAddress=destIpAddressE.val(); + var srcIpIsHidden=srcIpAddressE.is(":hidden"); + var destIpIsHidden=destIpAddressE.is(":hidden"); + if(srcIpPattern==1){//ip/掩码格式 + srcIpAddress=srcIpAddress.indexOf("/") >-1 ?srcIpAddress.split("/")[0] : srcIpAddress; + }else if (srcIpPattern==2){ + srcIpAddress=srcIpAddress.indexOf("-") >-1 ?srcIpAddress.split("-")[0] : srcIpAddress; + } + if(destIpPattern==1){//ip/掩码格式 + destIpAddress=destIpAddress.indexOf("/") >-1 ?destIpAddress.split("/")[0] : destIpAddress; + }else if (destIpPattern==2){ + destIpAddress=destIpAddress.indexOf("-") >-1 ?destIpAddress.split("-")[0] : destIpAddress; + } + if(srcIpIsHidden){ + if((srcIpAddress == destIpAddress)){ + $.validator.messages.ipCheck=$.validator.messages.destIpIsNotValue+destIpAddress; + return false; + } + }else if(destIpIsHidden){ + if((srcIpAddress == destIpAddress)){ + $.validator.messages.ipCheck=$.validator.messages.srcIpIsNotValue+srcIpAddress; + return false; + } + }else{ + if((srcIpAddress == destIpAddress)){ + $.validator.messages.ipCheck=$.validator.messages.srcIpNotEqDestIp+srcIpAddress + +$.validator.messages.destIpNotEqDestIp+destIpAddress + +$.validator.messages.IpNotEqDestIp; + return false; + } + } + var srcValid=true,destValid=true; + if(name.indexOf("srcIpAddress")>-1){ + srcValid=validateIpPattern(typeInt,srcIpPattern,value, element); + }else{ + destValid=validateIpPattern(typeInt,destIpPattern,value, element); + } + if(srcValid&&destValid){ + return validateIPV4Range(srcIpAddressE.val().indexOf("/")>-1?srcIpAddressE.val().split('/')[0]:srcIpAddressE.val(),destIpAddressE.val().indexOf("/")>-1?destIpAddressE.val().split('/')[0]:destIpAddressE.val()); }else{ - $.validator.messages.ipCheck=$.validator.messages.ip; return false; } }, $.validator.messages.ip); @@ -817,15 +574,17 @@ jQuery.validator.addMethod("ipMask",function(value, element) { }, $.validator.messages.ipMask); jQuery.validator.addMethod("portCheck",function(value, element) { if(value.length==0||value.trim().length==0){return true;} - var typeInt=$(element).parents(".row").parent(".row").find("select[name$='portPattern']").val(); - if(typeInt==1){//port 0~65535 + var name=$(element).attr("name"); + + var portPattern=$(element).parents(".row").parent(".row").find("select[name$='"+name+"Pattern']").val(); + if(portPattern==1){//port 0~65535 if(this.optional(element)||(/^(0|[1-9][0-9]{0,4})$/.test(value)&& RegExp.$1 <=65535)){ return true; }else{ $.validator.messages.portCheck=$.validator.messages.portRange return false; } - }else if(typeInt==2){// port -mask 0~65535/0~65535 + }else if(portPattern==2){// port -mask 0~65535/0~65535 if(this.optional(element)||(/^(0|[1-9][0-9]{0,4})\/(0|[1-9][0-9]{0,4})$/.test(value) && RegExp.$1 <=65535 && RegExp.$2 <=65535)){ return true; }else{ @@ -855,9 +614,12 @@ jQuery.validator.addMethod("areaControl",function(value, element) { return true; } }); +/* jQuery.validator.addMethod("areaIp",function(value, element) { var typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val(); - var ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val(); + var name=$(element).attr(name); + var srcIpPattern=$(element).parents(".row").parent(".row").find("select[name$='srcIpPattern']").val(); + var destIpPattern=$(element).parents(".row").parent(".row").find("select[name$='destIpPattern']").val(); var msg=$.validator.messages.areaIpPrefix; if(typeInt==4){ if(ipPattern==3){ @@ -907,6 +669,7 @@ jQuery.validator.addMethod("areaIp",function(value, element) { } } }); +*/ jQuery.validator.addMethod("checkParent",function(value, element) { var parentType=$(element).attr("parent-type"); if(parentType&&parentType!=0&&parentType!=value){ diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index 7dddbf8db..46e3d35f2 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -94,6 +94,9 @@ expireTip:"Start time and end time interval is at least 1 minute", compareTip:"Start time should not be less than the current time plus 2 minutes.", compileIdCheck:"Please enter the correct query format", - compileIdCheckNum:"The number of queries should not be greater than 200" + compileIdCheckNum:"The number of queries should not be greater than 200", + rangeCross0:"The IP {0} must not between {1} and {2}", + rangeCross1:"The IP range {0} has intersections with {1}", + protectedCfgUnique:"Keyword already exists." }); }(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 35ef0523a..d02cd04fc 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -94,6 +94,9 @@ expireTip:"Start time and end time interval is at least 1 minute", compareTip:"Start time should not be less than the current time plus 2 minutes.", compileIdCheck:"Please enter the correct query format", - compileIdCheckNum:"The number of queries should not be greater than 200" + compileIdCheckNum:"The number of queries should not be greater than 200", + rangeCross0:"The IP {0} must not between {1} and {2}", + rangeCross1:"The IP range {0} has intersections with {1}", + protectedCfgUnique:"Keyword already exists." }); }(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index 814d3b2cb..12aa7df85 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -94,6 +94,9 @@ expireTip:"开始时间结束时间间隔至少为1分钟", compareTip:"开始时间不能小于当前时间加上2分钟 ", compileIdCheck:"请输入正确的查询格式", - compileIdCheckNum:"查询个数不能大于200" + compileIdCheckNum:"查询个数不能大于200", + rangeCross0:"IP{0}不能介于{1}和{2}", + rangeCross1:"IP范围{0}和IP范围{1}有交集", + protectedCfgUnique:"关键字已存在" }); }(jQuery)); diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index c0fa6743f..96e15ca3c 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -42,6 +42,7 @@ $(function(){ $("."+key).each(function(){
if(!$(this).hasClass("tags")){
this.setAttribute("onblur","protectedListWarn(this,'"+key+"')");
+ this.setAttribute("onkeypress","protectedListWarn(this,'"+key+"','keypress')");
}
protectedListWarn(this,key);
});
@@ -227,6 +228,14 @@ $(function(){ $("select[name$='portPattern']").on("change",function(){
switchIpInfo(this);
});
+ //src IP pattern dest IP pattern
+ $("select[name$='IpPattern']").on("change",function(){
+ switchIpInfo(this);
+ });
+ //src port pattern dest port pattern
+ $("select[name$='PortPattern']").on("change",function(){
+ switchIpInfo(this);
+ });
switchAction($("input[name='action']:checked").val());
@@ -249,6 +258,9 @@ $(function(){ obj.find("select[name$='ipPattern']").on("change",function(){
switchIpInfo($(this));
});
+ obj.find("select[name$='IpPattern']").on("change",function(){
+ switchIpInfo($(this));
+ });
obj.appendTo("#areaIp");
$("#areaIsp").find(".container-fluid").each(function(){
if(!$(this).hasClass("hidden")) $(this).remove();
@@ -713,13 +725,6 @@ $(function(){ $(".boxSolid:visible").each(function(){
$(this).prev("h4").find(".glyphicon-plus").addClass("hidden");
});
- //IP域修改时默认展开,不显示show more
- if($("input[name='compileId']")&&$("input[name='compileId']").val()!=0&&($(".btn-red-hollow").parents(".boxSolid").is(":visible")||$("input[name$='cfgRegionCode']").length==1)){
- $(".port").removeClass("hidden").removeClass("disabled");
- $(".destPort").removeClass("hidden").removeClass("disabled");
- $(".protocol").removeClass("hidden").removeClass("disabled");
- $(".btn-red-hollow").addClass("hidden");
- }
$("#messageBox .close").on("click",function(){
heightDiv(1);
@@ -892,52 +897,6 @@ var setDefaultMatchMethod=function (obj){ $(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").selectpicker("refresh");
}
}
-var switchIpType=function(obj){
- var type=$(obj).val();
- var row=$(obj).parents('.row');
- var ipPattern=row.siblings().find("input[name$='ipPattern']");
- var portPattern=row.siblings().find("input[name$='portPattern']");
- var srcIp=row.siblings().find("input[name$='srcIpAddress']");
- var dstIp=row.siblings().find("input[name$='destIpAddress']");
- var srcPort=row.siblings().find("input[name$='srcPort']");
- var dstPort=row.siblings().find("input[name$='destPort']");
- if(4==type){
- if(!$(srcIp).val()){
- $(srcIp).val("0.0.0.0");
- }else if($(srcIp).val()=="::"){
- $(srcIp).val("0.0.0.0");
- }
- if(!$(dstIp).val()){
- $(dstIp).val("0.0.0.0");
- }else if($(dstIp).val()=="::"){
- $(dstIp).val("0.0.0.0");
- }
- if(!$(srcPort).val()){
- $(srcPort).val("0");
- }
- if(!$(dstPort).val()){
- $(dstPort).val("0");
- }
- }
- if(6==type){
- if(!$(srcIp).val()){
- $(srcIp).val("::");
- }else if($(srcIp).val()=="0.0.0.0"){
- $(srcIp).val("::");
- }
- if(!$(dstIp).val()){
- $(dstIp).val("::");
- }else if($(dstIp).val()=="0.0.0.0"){
- $(dstIp).val("::");
- }
- if(!$(srcPort).val()){
- $(srcPort).val("0");
- }
- if(!$(dstPort).val()){
- $(dstPort).val("0");
- }
- }
-}
var switchAction=function(action){
/********************dns reject时选择策略**********************/
if(action == 16){ //reject
@@ -986,16 +945,16 @@ var switchAction=function(action){ $(".doLog").removeClass("hidden");
}*/
}
-//ipType、ipPattern、portPattern选项变化时调用此方法,添加默认值
+//ipType、srcIpPattern,destIpPattern、srcPortPattern,destPortPattern选项变化时调用此方法,添加默认值
var switchIpInfo=function(obj){
- var ipType="";
- var ipPattern="";
- var portPattern="";
+ var ipType="",srcIpPattern="",destIpPattern="",srcPortPattern="",destPortPattern="";
var row=$(obj).parents('.row').parent('.row');
ipType=row.find("select[name$='ipType']").val();
- ipPattern=row.find("select[name$='ipPattern']").val();
- portPattern=row.find("select[name$='portPattern']").val();
+ srcIpPattern=row.find("select[name$='srcIpPattern']").val();
+ destIpPattern=row.find("select[name$='destIpPattern']").val();
+ srcPortPattern=row.find("select[name$='srcPortPattern']").val();
+ destPortPattern=row.find("select[name$='destPortPattern']").val();
var srcIp=row.find("input[name$='srcIpAddress']");
var destIp=row.find("input[name$='destIpAddress']");
var srcPort=row.find("input[name$='srcPort']");
@@ -1029,25 +988,23 @@ var switchIpInfo=function(obj){ //IPv4设置默认值
if(4==ipType){
if(!$(srcIp).val()){
- if(ipPattern==1){
+ if(srcIpPattern==1){
$(srcIp).val(srcIpV4Default[0]);
- }else if(ipPattern==2){
+ }else if(srcIpPattern==2){
$(srcIp).val(srcIpV4Default[1]);
- }else if(ipPattern==3){
+ }else if(srcIpPattern==3){
$(srcIp).val(srcIpV4Default[2]);
}else{
$(srcIp).val(srcIpV4Default[2]);
}
}else{
if($.inArray($(srcIp).val(),srcIpV4Default) > -1
- || $.inArray($(srcIp).val(),destIpV4Default) > -1
- || $.inArray($(srcIp).val(),srcIpV6Default) > -1
- || $.inArray($(srcIp).val(),destIpV6Default) > -1){ //是ipV4的默认值其中一个
- if(ipPattern==1){
+ || $.inArray($(srcIp).val(),srcIpV6Default) > -1 ){ //是ipV4的默认值其中一个
+ if(srcIpPattern==1){
$(srcIp).val(srcIpV4Default[0]);
- }else if(ipPattern==2){
+ }else if(srcIpPattern==2){
$(srcIp).val(srcIpV4Default[1]);
- }else if(ipPattern==3){
+ }else if(srcIpPattern==3){
$(srcIp).val(srcIpV4Default[2]);
}else{
$(srcIp).val(srcIpV4Default[2]);
@@ -1055,25 +1012,23 @@ var switchIpInfo=function(obj){ }
}
if(!$(destIp).val()){
- if(ipPattern==1){
+ if(destIpPattern==1){
$(destIp).val(destIpV4Default[0]);
- }else if(ipPattern==2){
+ }else if(destIpPattern==2){
$(destIp).val(destIpV4Default[1]);
- }else if(ipPattern==3){
+ }else if(destIpPattern==3){
$(destIp).val(destIpV4Default[2]);
}else{
$(destIp).val(destIpV4Default[2]);
}
}else{
- if($.inArray($(destIp).val(),srcIpV4Default) > -1
- || $.inArray($(destIp).val(),destIpV4Default) > -1
- || $.inArray($(destIp).val(),srcIpV6Default) > -1
+ if($.inArray($(destIp).val(),destIpV4Default) > -1
|| $.inArray($(destIp).val(),destIpV6Default) > -1){
- if(ipPattern==1){
+ if(destIpPattern==1){
$(destIp).val(destIpV4Default[0]);
- }else if(ipPattern==2){
+ }else if(destIpPattern==2){
$(destIp).val(destIpV4Default[1]);
- }else if(ipPattern==3){
+ }else if(destIpPattern==3){
$(destIp).val(destIpV4Default[2]);
}else{
$(destIp).val(destIpV4Default[2]);
@@ -1083,25 +1038,23 @@ var switchIpInfo=function(obj){ }
if(6==ipType){
if(!$(srcIp).val()){
- if(ipPattern==1){
+ if(srcIpPattern==1){
$(srcIp).val(srcIpV6Default[0]);
- }else if(ipPattern==2){
+ }else if(srcIpPattern==2){
$(srcIp).val(srcIpV6Default[1]);
- }else if(ipPattern==3){
+ }else if(srcIpPattern==3){
$(srcIp).val(srcIpV6Default[2]);
}else{
$(srcIp).val(srcIpV6Default[2]);
}
}else{
if($.inArray($(srcIp).val(),srcIpV4Default) > -1
- || $.inArray($(srcIp).val(),destIpV4Default) > -1
- || $.inArray($(srcIp).val(),srcIpV6Default) > -1
- || $.inArray($(srcIp).val(),destIpV6Default) > -1){ //是ipV6的默认值其中一个
- if(ipPattern==1){
+ || $.inArray($(srcIp).val(),srcIpV6Default) > -1 ){ //是ipV6的默认值其中一个
+ if(srcIpPattern==1){
$(srcIp).val(srcIpV6Default[0]);
- }else if(ipPattern==2){
+ }else if(srcIpPattern==2){
$(srcIp).val(srcIpV6Default[1]);
- }else if(ipPattern==3){
+ }else if(srcIpPattern==3){
$(srcIp).val(srcIpV6Default[2]);
}else{
$(srcIp).val(srcIpV6Default[2]);
@@ -1109,25 +1062,23 @@ var switchIpInfo=function(obj){ }
}
if(!$(destIp).val()){
- if(ipPattern==1){
+ if(destIpPattern==1){
$(destIp).val(destIpV6Default[0]);
- }else if(ipPattern==2){
+ }else if(destIpPattern==2){
$(destIp).val(destIpV6Default[1]);
- }else if(ipPattern==3){
+ }else if(destIpPattern==3){
$(destIp).val(destIpV6Default[2]);
}else{
$(destIp).val(srcIpV6Default[2]);
}
}else{
- if($.inArray($(destIp).val(),srcIpV4Default) > -1
- || $.inArray($(destIp).val(),destIpV4Default) > -1
- || $.inArray($(destIp).val(),srcIpV6Default) > -1
+ if($.inArray($(destIp).val(),destIpV4Default) > -1
|| $.inArray($(destIp).val(),destIpV6Default) > -1){ //是ipV6的默认值其中一个
- if(ipPattern==1){
+ if(destIpPattern==1){
$(destIp).val(destIpV6Default[0]);
- }else if(ipPattern==2){
+ }else if(destIpPattern==2){
$(destIp).val(destIpV6Default[1]);
- }else if(ipPattern==3){
+ }else if(destIpPattern==3){
$(destIp).val(destIpV6Default[2]);
}else{
$(destIp).val(srcIpV6Default[2]);
@@ -1135,152 +1086,20 @@ var switchIpInfo=function(obj){ }
}
}
- if(46==ipType){
- if(!$(srcIp).val()){
- if(ipPattern==1){
- $(srcIp).val(srcIpV4Default[0]);
- }else if(ipPattern==2){
- $(srcIp).val(srcIpV4Default[1]);
- }else if(ipPattern==3){
- $(srcIp).val(srcIpV4Default[2]);
- }else{
- $(srcIp).val(srcIpV4Default[2]);
- }
- }else{
- if($.inArray($(srcIp).val(),srcIpV4Default) > -1
- || $.inArray($(srcIp).val(),destIpV4Default) > -1
- || $.inArray($(srcIp).val(),srcIpV6Default) > -1
- || $.inArray($(srcIp).val(),destIpV6Default) > -1){
- if(ipPattern==1){
- $(srcIp).val(srcIpV4Default[0]);
- }else if(ipPattern==2){
- $(srcIp).val(srcIpV4Default[1]);
- }else if(ipPattern==3){
- $(srcIp).val(srcIpV4Default[2]);
- }else {
- $(srcIp).val(srcIpV4Default[2]);
- }
- }
- }
- if(!$(destIp).val()){
- if(ipPattern==1){
- $(destIp).val(destIpV6Default[0]);
- }else if(ipPattern==2){
- $(destIp).val(destIpV6Default[1]);
- }else if(ipPattern==3){
- $(destIp).val(destIpV6Default[2]);
- }else{
- $(destIp).val(destIpV6Default[2]);
- }
- }else{
- if($.inArray($(destIp).val(),srcIpV4Default) > -1
- || $.inArray($(destIp).val(),destIpV4Default) > -1
- || $.inArray($(destIp).val(),srcIpV6Default) > -1
- || $.inArray($(destIp).val(),destIpV6Default) > -1){
- if(ipPattern==1){
- $(destIp).val(destIpV6Default[0]);
- }else if(ipPattern==2){
- $(destIp).val(destIpV6Default[1]);
- }else if(ipPattern==3){
- $(destIp).val(destIpV6Default[2]);
- }else{
- $(destIp).val(destIpV6Default[2]);
- }
- }
- }
- }
- if(64==ipType){
- if(!$(srcIp).val()){
- if(ipPattern==1){
- $(srcIp).val(srcIpV6Default[0]);
- }else if(ipPattern==2){
- $(srcIp).val(srcIpV6Default[1]);
- }else if(ipPattern==3){
- $(srcIp).val(srcIpV6Default[2]);
- }else{
- $(srcIp).val(srcIpV6Default[2]);
- }
- }else{
- if($.inArray($(srcIp).val(),srcIpV4Default) > -1
- || $.inArray($(srcIp).val(),destIpV4Default) > -1
- || $.inArray($(srcIp).val(),srcIpV6Default) > -1
- || $.inArray($(srcIp).val(),destIpV6Default) > -1){
- if(ipPattern==1){
- $(srcIp).val(srcIpV6Default[0]);
- }else if(ipPattern==2){
- $(srcIp).val(srcIpV6Default[1]);
- }else if(ipPattern==3){
- $(srcIp).val(srcIpV6Default[2]);
- }else{
- $(srcIp).val(srcIpV6Default[2]);
- }
- }
- }
- if(!$(destIp).val()){
- if(ipPattern==1){
- $(destIp).val(srcIpV4Default[0]);
- }else if(ipPattern==2){
- $(destIp).val(srcIpV4Default[1]);
- }else if(ipPattern==3){
- $(destIp).val(srcIpV4Default[2]);
- }else{
- $(destIp).val(srcIpV4Default[2]);
- }
- }else{
- if($.inArray($(destIp).val(),srcIpV4Default) > -1
- || $.inArray($(destIp).val(),destIpV4Default) > -1
- || $.inArray($(destIp).val(),srcIpV6Default) > -1
- || $.inArray($(destIp).val(),destIpV6Default) > -1){
- if(ipPattern==1){
- $(destIp).val(destIpV4Default[0]);
- }else if(ipPattern==2){
- $(destIp).val(destIpV4Default[1]);
- }else if(ipPattern==3){
- $(destIp).val(destIpV4Default[2]);
- }else{
- $(destIp).val(destIpV4Default[2]);
- }
- }
- }
- }
- if(10==ipType){
- if(!$(srcIp).val()){
- if(ipPattern==1){
- $(srcIp).val(srcIpV4Default[0]);
- }else if(ipPattern==2){
- $(srcIp).val(srcIpV4Default[1]);
- }else if(ipPattern==3){
- $(srcIp).val(srcIpV4Default[2]);
- }else{
- $(srcIp).val(srcIpV4Default[2]);
- }
- }
- if(!$(destIp).val()){
- if(ipPattern==1){
- $(destIp).val(destIpV4Default[0]);
- }else if(ipPattern==2){
- $(destIp).val(destIpV4Default[1]);
- }else if(ipPattern==3){
- $(destIp).val(destIpV4Default[2]);
- }else{
- $(destIp).val(destIpV4Default[2]);
- }
- }
- }
//设置源端口默认值
if(!$(srcPort).val()){
- if(portPattern==1){
+ if(srcPortPattern==1){
$(srcPort).val(portDefault[0]);
- }else if(portPattern==2){
+ }else if(srcPortPattern==2){
$(srcPort).val(portDefault[1]);
}else{
$(srcPort).val(portDefault[0]);
}
}else{
if($.inArray($(srcPort).val(),portDefault) > -1){ //是ipV4的默认值其中一个
- if(portPattern==1){
+ if(srcPortPattern==1){
$(srcPort).val(portDefault[0]);
- }else if(portPattern==2){
+ }else if(srcPortPattern==2){
$(srcPort).val(portDefault[1]);
}else{
$(srcPort).val(portDefault[0]);
@@ -1289,18 +1108,18 @@ var switchIpInfo=function(obj){ }
//设置目的端口默认值
if(!$(destPort).val()){
- if(portPattern==1){
+ if(destPortPattern==1){
$(destPort).val(portDefault[0]);
- }else if(portPattern==2){
+ }else if(destPortPattern==2){
$(destPort).val(portDefault[1]);
}else{
$(destPort).val(portDefault[0]);
}
}else{
if($.inArray($(destPort).val(),portDefault) > -1){ //是port的默认值其中一个
- if(portPattern==1){
+ if(destPortPattern==1){
$(destPort).val(portDefault[0]);
- }else if(portPattern==2){
+ }else if(destPortPattern==2){
$(destPort).val(portDefault[1]);
}else{
$(destPort).val(portDefault[0]);
@@ -1336,27 +1155,6 @@ var page=function(n,s){ return false;
}
-//show more 添加更多属性
-var more=function(obj){
- var clickTimes=$(obj).data("click-times");
- if(clickTimes==0){
- $(".port").removeClass("hidden").removeClass("disabled");
- $(obj).data("click-times",clickTimes+1);
- }
- if(clickTimes==1){
- $(".destPort").removeClass("hidden").removeClass("disabled");
- $(obj).data("click-times",clickTimes+1);
- }
- if(clickTimes==2){
- $(".protocol").removeClass("hidden").removeClass("disabled");
- $(obj).data("click-times",clickTimes+1);
- }
- var rows=$(obj).parent(".row").siblings(".row:hidden");
- if(rows.size()==0){
- $(obj).addClass("hidden");
- }
-}
-
var viewAreaInfo=function(path,areaEffectiveIds,compileId){
$.ajax({
type:'post',
@@ -1387,6 +1185,7 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){ html+="</tbody>";
html+="</table>";
}
+ /*
if(data.areaIps.length > 0){
title=$.validator.messages.area+" ip";
html+="<table class='table table-striped table-bordered table-condensed' style='margin-left: 10px; width: 96%;margin-top: 15px;'>";
@@ -1432,7 +1231,7 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){ }
html+="</tbody>";
html+="</table>";
- }
+ }*/
top.$.jBox(html,{width: $(document).width()*0.4,height: 400,title:title, buttons:false});
}
@@ -1758,13 +1557,20 @@ function addPrintTableCss(rowValue,cellValue,tableIdValue,cssName){ }
}
}
+
/**保护名单提醒**/
-function protectedListWarn(obj,tagKey){
+function protectedListWarn(obj,tagKey,flag){
+ // 值为空 或 非回车事件直接返回
+ if(($(obj).val() == '') || (flag != null && event.keyCode != 13)){
+ return false;
+ }
+
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
$.ajax({
type:'get',
url:pathName+'/basics/innerProtectionList/ajaxGetAllInfo',
dataType:"json",
+ async:false,
success:function(data){
if(data != null){
for(var key in data){
@@ -1772,6 +1578,7 @@ function protectedListWarn(obj,tagKey){ $("."+key).each(function(){
if(!$(this).hasClass("tags")){
this.setAttribute("onblur","protectedListWarn(this,'"+key+"')");
+ this.setAttribute("onkeypress","protectedListWarn(this,'"+key+"','keypress')");
}
});
}
@@ -1781,8 +1588,22 @@ function protectedListWarn(obj,tagKey){ var protectedList = data[tagKey];
if(value != "" && typeof(protectedList) != "undefined"){
if(protectedList.indexOf(value) >= 0){ // 关键字匹配则弹出提示框
- $.jBox.info($.validator.messages.protect_warn,$.validator.messages.info);
+ // 剪切事件属性,防止弹出多个提示框(回车事件会同时触发失去焦点事件)
+ var blurCopy = $(obj).attr("onblur");
+ var keypressCopy = $(obj).attr("onkeypress");
+ $(obj).attr("onblur","");
+ $(obj).attr("onkeypress","");
+
+ // 阻止表单提交
+ $.jBox.close();
+ $(obj).parents("form:first").find("button[type='submit']").attr("type","button");
+ $.jBox.info($.validator.messages.protect_warn,$.validator.messages.info, {closed:function(v,h,f){
+ $(obj).attr("onblur",blurCopy);
+ $(obj).attr("onkeypress",keypressCopy);
+ $(obj).parents("form:first").find("button[id='save']").attr("type","submit");
+ }});
$('.jbox-body .jbox-icon').css('top','55px');
+
}
}
diff --git a/src/main/webapp/static/global/scripts/ipRegion.js b/src/main/webapp/static/global/scripts/ipRegion.js index 3037d5fc4..9d8bc226a 100644 --- a/src/main/webapp/static/global/scripts/ipRegion.js +++ b/src/main/webapp/static/global/scripts/ipRegion.js @@ -9,22 +9,71 @@ });
$.extend($.ipcommon, {
ipType:[],
- ipPattern:[],
- portPattern:[],
+ srcIpPattern:[],
+ destIpPattern:[],
+ srcPortPattern:[],
+ destPortPattern:[],
protocol:[],
direction:[]
});
})(jQuery);
$(function(){
initCommIpVal();
+ //IP域修改时默认展开,不显示show more
+ if($("input[name='compileId']")&&$("input[name='compileId']").val()!=0&&($(".btn-red-hollow").parents(".boxSolid").is(":visible")||$("input[name$='cfgRegionCode']").length==1)){
+ $(".port").removeClass("hidden").removeClass("disabled");
+ $(".destPort").removeClass("hidden").removeClass("disabled");
+ $(".protocol").removeClass("hidden").removeClass("disabled");
+ $(".ipCol:hidden").removeClass("hidden").removeClass("disabled");
+ $(".btn-red-hollow").addClass("hidden");
+ }
});
window.$.ipcommon=$.ipcommon;
/**
+ * 初始化格式处理
+ */
+var processPattern=function(selector,pattern){
+ if("ipType"==selector){
+ $.ipcommon.ipType=$("select[name$='ipType'] option");
+ }else if("srcIpPattern"==selector){
+ $.ipcommon.srcIpPattern=$("select[name$='srcIpPattern'] option");
+ }else if("destIpPattern"==selector){
+ $.ipcommon.destIpPattern=$("select[name$='destIpPattern'] option");
+ }else if("srcPortPattern"==selector){
+ $.ipcommon.srcPortPattern=$("select[name$='srcPortPattern'] option");
+ }else if("destPortPattern"==selector){
+ $.ipcommon.destPortPattern=$("select[name$='destPortPattern'] option");
+ }else if("direction"==selector){
+ $.ipcommon.direction=$("select[name$='direction'] option");
+ }else if("protocol"==selector){
+ $.ipcommon.protocol=$("select[name$='protocol'] option");
+ }
+ if(pattern){
+ var arr=pattern.split(',');
+ $("select[name$='"+selector+"'] option").each(function(){
+ var has=false;
+ for(var type in arr){
+ if($(this).val()==arr[type]){
+ has=true;
+ if($(this).attr("disabled")){
+ $(this).removeAttr("disabled")
+ }
+ break;
+ }
+ }
+ if(!has){
+ $(this).remove();
+ }
+ });
+ }
+}
+/**
* ip默认选项处理
*/
var initCommIpVal=function(){
var action,regionCode,serviceType,ipPortShow,ipType,
- ipPattern,portPattern,direction,protocol,regionType;
+ srcIpPattern,destIpPattern,srcPortPattern,destPortPattern,
+ direction,protocol,regionType;
if($("input[name$='action']:checked").length>0){
regionCode=$("input[name$='action']:checked").attr("regionCode");
action=$("input[name$='action']:checked").val();
@@ -55,16 +104,20 @@ var initCommIpVal=function(){ if(regionCode){//IP域大于1个,根据action获取ip属性
ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
- ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
- portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
+ srcIpPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("srcIpPattern"),
+ destIpPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("destIpPattern"),
+ srcPortPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("srcPortPattern"),
+ destPortPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("destPortPattern"),
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
}else{//IP域只有一个,获取regionType为1的
ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"),
- ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"),
- portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"),
+ srcIpPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("srcIpPattern"),
+ destIpPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("destIpPattern"),
+ srcPortPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("srcPortPattern"),
+ destPortPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("destPortPattern"),
direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType");
@@ -73,124 +126,92 @@ var initCommIpVal=function(){ if(ipPortShow){
if(ipPortShow.indexOf('1')>-1){//展示源IP
$("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
+ $("select[name$='srcIpPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
+ $("select[name$='srcIpPattern']").parents(".form-group").addClass("hidden");
+ if(!$("input[name$='srcIpAddress']").parents(".ipCol").is(":hidden")){
+ $("input[name$='srcIpAddress']").parents(".ipCol").addClass("hidden");
+ }
}
if(ipPortShow.indexOf('2')>-1){//展示源端口
$("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
+ $("select[name$='srcPortPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='srcPort']").parents(".form-group").addClass("hidden");
+ $("select[name$='srcPortPattern']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('3')>-1){//展示目的IP
$("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
+ $("select[name$='destIpPattern']").parents(".form-group").removeClass("hidden");
+ //当源IP不展示的时候目的IP要默认展示
+ if($("input[name$='destIpAddress']").parents(".ipCol")&&ipPortShow.indexOf('1')==-1){
+ $("input[name$='destIpAddress']").parents(".ipCol").removeClass("hidden");
+ }
}else{
$("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
+ $("select[name$='destIpPattern']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('4')>-1){//展示目的端口
$("input[name$='destPort']").parents(".form-group").removeClass("hidden");
+ $("select[name$='destPortPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
+ $("select[name$='destPortPattern']").parents(".form-group").addClass("hidden");
}
}
- //ip类型处理
- $.ipcommon.ipType=$("select[name$='ipType'] option");
if(ipType){
- var arr=ipType.split(',');
- $("select[name$='ipType'] option").each(function(){
- var has=false;
- for(var type in arr){
- if($(this).val()==arr[type]){
- has=true;
- if($(this).attr("disabled")){
- $(this).removeAttr("disabled")
- }
- break;
- }
- }
- if(!has){
- $(this).remove();
- }
- });
+ processPattern("ipType",ipType);
}
- //ip格式处理
- $.ipcommon.ipPattern=$("select[name$='ipPattern'] option");
- if(ipPattern){
- arr=ipPattern.split(',');
- $("select[name$='ipPattern'] option").each(function(){
- var has=false;
- for(var type in arr){
- if($(this).val()==arr[type]){
- has=true;
- if($(this).attr("disabled")){
- $(this).removeAttr("disabled")
- }
- break;
- }
- }
- if(!has){
- $(this).remove();
- }
- });
+ if(srcIpPattern){
+ processPattern("srcIpPattern",srcIpPattern);
}
- //端口格式处理
- $.ipcommon.portPattern=$("select[name$='portPattern'] option");
- if(portPattern){
- arr=portPattern.split(',');
- $("select[name$='portPattern'] option").each(function(){
- var has=false;
- for(var type in arr){
- if($(this).val()==arr[type]){
- has=true;
- if($(this).attr("disabled")){
- $(this).removeAttr("disabled")
- }
- break;
- }
- }
- if(!has){
- $(this).remove();
- }
- });
+ if(destIpPattern){
+ processPattern("destIpPattern",destIpPattern);
+ }
+ if(srcPortPattern){
+ processPattern("srcPortPattern",srcPortPattern);
+ }
+ if(destPortPattern){
+ processPattern("destPortPattern",destPortPattern);
}
- //方向处理
- $.ipcommon.direction=$("select[name$='direction'] option");
if(direction){
- arr=direction.split(',');
- $("select[name$='direction'] option").each(function(){
- var has=false;
- for(var type in arr){
- if($(this).val()==arr[type]){
- has=true;
- if($(this).attr("disabled")){
- $(this).removeAttr("disabled")
- }
- break;
- }
- }
- if(!has){
- $(this).remove();
- }
- });
+ processPattern("direction",direction);
}
- //协议处理
- $.ipcommon.protocol=$("select[name$='protocol'] option");
if(protocol){
- arr=protocol.split(',');
- $("select[name$='protocol'] option").each(function(){
+ processPattern("protocol",protocol);
+ }
+}
+var changePattern=function(o,selector,pattern){
+ if(pattern){
+ arr=pattern.split(',');
+ var ipPatternVal=o.find("select[name$='"+selector+"'] option:selected").attr("value");
+ o.find("select[name$='"+selector+"']").empty();
+ var patterns=selector=="srcIpPattern"?$.ipcommon.srcIpPattern:
+ selector=="destIpPattern"?$.ipcommon.destIpPattern:
+ selector=="srcPortPattern"?$.ipcommon.srcPortPattern:
+ selector=="destPortPattern"?$.ipcommon.destPortPattern:[];
+ $(patterns).each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
- if($(this).attr("disabled")){
- $(this).removeAttr("disabled")
- }
+ o.find("select[name$='"+selector+"']").append($(this));
break;
}
}
- if(!has){
- $(this).remove();
- }
});
+ o.find("select[name$='"+selector+"']").selectpicker("refresh");
+ if(o.find("select[name$='"+selector+"'] option[value='"+ipPatternVal+"']").length>0){
+ o.find("select[name$='"+selector+"']").selectpicker("val",ipPatternVal);
+ }else{
+ if(o.find("select[name$='"+selector+"'] option[value=1]").length>0){
+ o.find("select[name$='"+selector+"']").selectpicker("val",1);
+ }else{
+ o.find("select[name$='"+selector+"']").get(0).selectedIndex=0;
+ o.find("select[name$='"+selector+"']").selectpicker("refresh");
+ }
+ }
}
}
/**
@@ -198,7 +219,7 @@ var initCommIpVal=function(){ */
var changeIPVal=function(obj){
var action,regionCode,serviceType,ipPortShow,ipType,
- ipPattern,portPattern,direction,protocol,regionType,o;
+ srcIpPattern,destIpPattern,srcPortPattern,destPortPattern,direction,protocol,regionType,o;
o=$(obj);
if($("input[name$='action']:checked").length>0){
regionCode=$("input[name$='action']:checked").attr("regionCode");
@@ -230,16 +251,20 @@ var changeIPVal=function(obj){ if(regionCode){//IP域大于1个,根据action获取ip属性
ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
- ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
- portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
+ srcIpPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("srcIpPattern"),
+ destIpPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("destIpPattern"),
+ srcPortPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("srcPortPattern"),
+ destPortPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("destPortPattern"),
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
}else{//IP域只有一个,获取regionType为1的
ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"),
- ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"),
- portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"),
+ srcIpPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("srcIpPattern"),
+ destIpPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("destIpPattern"),
+ srcPortPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("srcPortPattern"),
+ destPortPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("destPortPattern"),
direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType");
@@ -249,23 +274,31 @@ var changeIPVal=function(obj){ if(ipPortShow){
if(ipPortShow.indexOf('1')>-1){//展示源IP
$("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
+ $("select[name$='srcIpPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
+ $("select[name$='srcIpPattern']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('2')>-1){//展示源端口
$("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
+ $("select[name$='srcPortPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='srcPort']").parents(".form-group").addClass("hidden");
+ $("select[name$='srcPortPattern']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('3')>-1){//展示目的IP
$("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
+ $("select[name$='destIpPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
+ $("select[name$='destIpPattern']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('4')>-1){//展示目的端口
$("input[name$='destPort']").parents(".form-group").removeClass("hidden");
+ $("select[name$='destPortPattern']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
+ $("select[name$='destPortPattern']").parents(".form-group").addClass("hidden");
}
}
//ip类型处理
@@ -296,60 +329,14 @@ var changeIPVal=function(obj){ }
}
- //ip格式处理
- if(ipPattern){
- arr=ipPattern.split(',');
- var ipPatternVal=o.find("select[name$='ipPattern'] option:selected").attr("value");
- o.find("select[name$='ipPattern']").empty();
- $.ipcommon.ipPattern.each(function(){
- var has=false;
- for(var type in arr){
- if($(this).val()==arr[type]){
- has=true;
- o.find("select[name$='ipPattern']").append($(this));
- break;
- }
- }
- });
- o.find("select[name$='ipPattern']").selectpicker("refresh");
- if(o.find("select[name$='ipPattern'] option[value='"+ipPatternVal+"']").length>0){
- o.find("select[name$='ipPattern']").selectpicker("val",ipPatternVal);
- }else{
- if(o.find("select[name$='ipPattern'] option[value=1]").length>0){
- o.find("select[name$='ipPattern']").selectpicker("val",1);
- }else{
- o.find("select[name$='ipPattern']").get(0).selectedIndex=0;
- o.find("select[name$='ipPattern']").selectpicker("refresh");
- }
- }
- }
- //端口格式处理
- if(portPattern){
- arr=portPattern.split(',');
- var portPatternVal=o.find("select[name$='portPattern'] option:selected").attr("value");
- o.find("select[name$='portPattern']").empty();
- $.ipcommon.portPattern.each(function(){
- var has=false;
- for(var type in arr){
- if($(this).val()==arr[type]){
- has=true;
- o.find("select[name$='portPattern']").append($(this));
- break;
- }
- }
- });
- o.find("select[name$='portPattern']").selectpicker("refresh");
- if(o.find("select[name$='portPattern'] option[value='"+portPatternVal+"']").length>0){
- o.find("select[name$='portPattern']").selectpicker("val",portPatternVal);
- }else{
- if(o.find("select[name$='portPattern'] option[value=1]").length>0){
- o.find("select[name$='portPattern']").selectpicker("val",1);
- }else{
- o.find("select[name$='portPattern']").get(0).selectedIndex=0;
- o.find("select[name$='portPattern']").selectpicker("refresh");
- }
- }
- }
+ //源ip格式处理
+ changePattern(o,"srcIpPattern",srcIpPattern);
+ //目的ip格式处理
+ changePattern(o,"destIpPattern",destIpPattern);
+ //源端口格式处理
+ changePattern(o,"srcPortPattern",srcPortPattern);
+ //目的源端口格式处理
+ changePattern(o,"destPortPattern",destPortPattern);
//方向处理
if(direction){
arr=direction.split(',');
@@ -405,4 +392,42 @@ var changeIPVal=function(obj){ }
}
}
+}
+//show more 添加更多属性
+var more=function(obj){
+ var moreCols=$(obj).parents(".row").siblings(".ipCol").not(":hidden").last().nextAll(":hidden");
+ if(moreCols.length==0){
+ var clickTimes=$(obj).data("click-times");
+ if(clickTimes==0){
+ $(".port").removeClass("hidden").removeClass("disabled");
+ $(obj).data("click-times",clickTimes+1);
+ }
+ if(clickTimes==1){
+ $(".destPort").removeClass("hidden").removeClass("disabled");
+ $(obj).data("click-times",clickTimes+1);
+ }
+ if(clickTimes==2){
+ $(".protocol").removeClass("hidden").removeClass("disabled");
+ $(obj).data("click-times",clickTimes+1);
+ }
+ var rows=$(obj).parent(".row").siblings(".row:hidden");
+ if(rows.size()==0){
+ $(obj).addClass("hidden");
+ }
+ }else{
+ if(moreCols.length>0){
+ //$(moreCols[0]).removeClass("hidden").removeClass("disabled");
+ $(moreCols).each(function(i){
+ $(this).removeClass("hidden").removeClass("disabled");
+ if($(this).find("form-group:hidden").length>0){
+ return true;
+ }else{
+ return false;
+ }
+ });
+ if($(obj).parents(".row").siblings(".ipCol").not(":hidden").last().nextAll(":hidden").length==0){
+ $(obj).addClass("hidden");
+ }
+ }
+ }
}
\ No newline at end of file |
