Merge branch 'develop_no_common_group' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop_no_common_group

This commit is contained in:
段冬梅
2019-04-19 18:33:01 +08:00
110 changed files with 3653 additions and 3258 deletions

View File

@@ -20,12 +20,14 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=6) @ExcelField(title="ip_type",dictType="IP_TYPE",sort=6)
@SerializedName("ipType") @SerializedName("ipType")
private Integer ipType; private Integer ipType;
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=8) private Integer srcIpPattern;
private Integer ipPattern; @ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=8)
private Integer destIpPattern;
private String srcIpAddress; private String srcIpAddress;
@ExcelField(title="ip",sort=7) @ExcelField(title="ip",sort=7)
private String destIpAddress; private String destIpAddress;
private Integer portPattern; private Integer srcPortPattern;
private Integer destPortPattern;
private String srcPort; private String srcPort;
private String destPort; private String destPort;
//@ExcelField(title="group",sort=2) //@ExcelField(title="group",sort=2)
@@ -117,11 +119,30 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
public void setIpType(Integer ipType) { public void setIpType(Integer ipType) {
this.ipType = ipType; this.ipType = ipType;
} }
public Integer getIpPattern() {
return ipPattern; public Integer getSrcIpPattern() {
return srcIpPattern;
} }
public void setIpPattern(Integer ipPattern) { public void setSrcIpPattern(Integer srcIpPattern) {
this.ipPattern = ipPattern; 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;
} }
public String getSrcIpAddress() { public String getSrcIpAddress() {
return srcIpAddress; return srcIpAddress;
@@ -135,12 +156,6 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
public void setDestIpAddress(String destIpAddress) { public void setDestIpAddress(String destIpAddress) {
this.destIpAddress = destIpAddress; this.destIpAddress = destIpAddress;
} }
public Integer getPortPattern() {
return portPattern;
}
public void setPortPattern(Integer portPattern) {
this.portPattern = portPattern;
}
public String getSrcPort() { public String getSrcPort() {
return srcPort; return srcPort;
} }
@@ -176,9 +191,10 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
} }
@Override @Override
public String toString() { public String toString() {
return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", ipPattern=" return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", srcIpPattern="
+ ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", portPattern=" + srcIpPattern + ", destIpPattern="+ destIpPattern+ ", srcIpAddress=" + srcIpAddress + ", destIpAddress="
+ portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName + destIpAddress + ", srcPortPattern="+ srcPortPattern+", destPortPattern="+ destPortPattern + ", srcPort="
+ srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
+ ", asnIpGroup=" + asnIpGroup + ", direction=" + direction + ", protocol=" + protocol + ", protocolId=" + ", asnIpGroup=" + asnIpGroup + ", direction=" + direction + ", protocol=" + protocol + ", protocolId="
+ protocolId + ", compileId=" + compileId + ", isValid=" + isValid + ", userRegion1=" + userRegion1 + protocolId + ", compileId=" + compileId + ", isValid=" + isValid + ", userRegion1=" + userRegion1
+ ", userRegion2=" + userRegion2 + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4 + ", userRegion2=" + userRegion2 + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4

View File

@@ -1,8 +1,6 @@
package com.nis.domain.configuration; package com.nis.domain.configuration;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField; 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) @ExcelField(title="ip_type",dictType="IP_TYPE",sort=3)
@SerializedName("ipType") @SerializedName("ipType")
protected Integer ipType; protected Integer ipType;
protected Integer ipPattern; protected Integer srcIpPattern;
protected Integer destIpPattern;
protected String srcIpAddress; protected String srcIpAddress;
@ExcelField(title="server_ip",sort=4) @ExcelField(title="server_ip",sort=4)
protected String destIpAddress; protected String destIpAddress;
protected Integer portPattern; protected Integer srcPortPattern;
protected Integer destPortPattern;
protected String srcPort; protected String srcPort;
@ExcelField(title="server_port",sort=5) @ExcelField(title="server_port",sort=5)
protected String destPort; protected String destPort;
@@ -121,34 +121,7 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
// this.protocolId = protocolId; // 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 * srcIpAddress
@@ -158,6 +131,30 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
public String getSrcIpAddress() { public String getSrcIpAddress() {
return srcIpAddress; 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 * @param srcIpAddress the srcIpAddress to set
*/ */
@@ -257,16 +254,10 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
public String toString() { public String toString() {
return "AppIpCfg [compileId=" + compileId + ", ratelimit=" + ratelimit + ", appCode=" + appCode + ", behavCode=" return "AppIpCfg [compileId=" + compileId + ", ratelimit=" + ratelimit + ", appCode=" + appCode + ", behavCode="
+ behavCode + ", specServiceId=" + specServiceId + ", appName=" + appName + ", ipType=" + ipType + behavCode + ", specServiceId=" + specServiceId + ", appName=" + appName + ", ipType=" + ipType
+ ", ipPattern=" + ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", srcIpPattern=" + srcIpPattern + ", destIpPattern=" + destIpPattern + ", srcIpAddress="
+ ", portPattern=" + portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", direction=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", srcPortPattern=" + srcPortPattern
+ direction + ", protocol=" + protocol + ", userRegion1=" + userRegion1 + ", userRegion2=" + userRegion2 + ", destPortPattern=" + destPortPattern + ", srcPort=" + srcPort + ", destPort=" + destPort
+ ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4 + ", userRegion5=" + userRegion5 + ", direction=" + direction + ", protocol=" + protocol + "]";
+ ", 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 + "]";
} }
} }

View File

@@ -59,7 +59,8 @@ public class AreaIpCfg extends BaseIpCfg {
this.cfgType=Constants.AREA_REGION; this.cfgType=Constants.AREA_REGION;
this.cfgRegionCode=1; this.cfgRegionCode=1;
this.protocol=0; this.protocol=0;
this.portPattern=1; this.srcPortPattern=1;
this.destPortPattern=1;
this.srcPort="0"; this.srcPort="0";
this.destPort="0"; this.destPort="0";
this.direction=0; this.direction=0;

View File

@@ -45,14 +45,18 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
@SerializedName("ipType") @SerializedName("ipType")
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50) @ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
protected Integer ipType; protected Integer ipType;
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=51) @ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
protected Integer ipPattern; protected Integer srcIpPattern;
@ExcelField(title="client_ip",sort=53) @ExcelField(title="client_ip",sort=52)
protected String srcIpAddress; 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; protected String destIpAddress;
@ExcelField(title="port_pattern",dictType="PORT_PATTERN",sort=54) @ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
protected Integer portPattern; protected Integer srcPortPattern;
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
protected Integer destPortPattern;
@ExcelField(title="client_port",sort=55) @ExcelField(title="client_port",sort=55)
protected String srcPort; protected String srcPort;
@ExcelField(title="server_port",sort=56) @ExcelField(title="server_port",sort=56)
@@ -269,35 +273,31 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
this.protocolId = protocolId; this.protocolId = protocolId;
} }
/**
* ipPattern
* @return ipPattern
*/
public Integer getIpPattern() { public Integer getSrcIpPattern() {
return ipPattern; return srcIpPattern;
} }
/** public void setSrcIpPattern(Integer srcIpPattern) {
* @param ipPattern the ipPattern to set this.srcIpPattern = srcIpPattern;
*/
public void setIpPattern(Integer ipPattern) {
this.ipPattern = ipPattern;
} }
/** public Integer getDestIpPattern() {
* portPattern return destIpPattern;
* @return portPattern
*/
public Integer getPortPattern() {
return portPattern;
} }
/** public void setDestIpPattern(Integer destIpPattern) {
* @param portPattern the portPattern to set this.destIpPattern = destIpPattern;
*/ }
public void setPortPattern(Integer portPattern) { public Integer getSrcPortPattern() {
this.portPattern = portPattern; return srcPortPattern;
}
public void setSrcPortPattern(Integer srcPortPattern) {
this.srcPortPattern = srcPortPattern;
}
public Integer getDestPortPattern() {
return destPortPattern;
}
public void setDestPortPattern(Integer destPortPattern) {
this.destPortPattern = destPortPattern;
} }
/** /**
* srcIpAddress * srcIpAddress
* @return srcIpAddress * @return srcIpAddress

View File

@@ -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();
}
}

View File

@@ -8,7 +8,6 @@
*/ */
package com.nis.domain.configuration.template; package com.nis.domain.configuration.template;
import com.google.gson.JsonObject;
import com.nis.util.excel.ExcelField; import com.nis.util.excel.ExcelField;
/** /**

View File

@@ -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;
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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;
}
}

View File

@@ -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();
}
}

View File

@@ -30,13 +30,15 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
@Expose @Expose
private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp0表示任意 private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp0表示任意
@Expose @Expose
private Integer ipPattern; //ip格式 private Integer srcIpPattern; //ip格式
private Integer destIpPattern; //ip格式
@Expose @Expose
private String srcIpAddress; //源客户端IP地址 private String srcIpAddress; //源客户端IP地址
@Expose @Expose
private String destIpAddress; //目的服务器IP地址 private String destIpAddress; //目的服务器IP地址
@Expose @Expose
private Integer portPattern; //端口格式 private Integer srcPortPattern; //端口格式
private Integer destPortPattern; //端口格式
@Expose @Expose
private String srcPort; //源(客户端)端口 private String srcPort; //源(客户端)端口
@Expose @Expose
@@ -114,19 +116,33 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
public void setDestPort(String destPort) { public void setDestPort(String destPort) {
this.destPort = destPort; this.destPort = destPort;
} }
@ExcelField(title="ip_pattern",align=2,sort=21,fieldType=Integer.class) @ExcelField(title="src_ip_pattern",align=2,sort=21,fieldType=Integer.class)
public Integer getIpPattern() { public Integer getSrcIpPattern() {
return ipPattern; return srcIpPattern;
} }
public void setIpPattern(Integer ipPattern) { public void setSrcIpPattern(Integer srcIpPattern) {
this.ipPattern = ipPattern; this.srcIpPattern = srcIpPattern;
} }
@ExcelField(title="port_pattern",align=2,sort=40,fieldType=Integer.class) @ExcelField(title="dest_ip_pattern",align=2,sort=22,fieldType=Integer.class)
public Integer getPortPattern() { public Integer getDestIpPattern() {
return portPattern; return destIpPattern;
} }
public void setPortPattern(Integer portPattern) { public void setDestIpPattern(Integer destIpPattern) {
this.portPattern = portPattern; 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) @ExcelField(title="direction",align=2,sort=110)
public Integer getDirection() { public Integer getDirection() {

View File

@@ -395,7 +395,7 @@ public class ConfigConvertUtil {
*/ */
public static List<IpCfg> ipConvert(IpCfg dstIp, BaseIpCfg srcIp) { public static List<IpCfg> ipConvert(IpCfg dstIp, BaseIpCfg srcIp) {
List<IpCfg> ipConvertList = Lists.newArrayList(); 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.getSrcIpAddress() != null && srcIp.getSrcIpAddress().indexOf("-") > -1)
|| (srcIp.getDestIpAddress() != null && srcIp.getDestIpAddress().indexOf("-") > -1)); || (srcIp.getDestIpAddress() != null && srcIp.getDestIpAddress().indexOf("-") > -1));
if (isRange) { if (isRange) {

View File

@@ -133,6 +133,7 @@ public class ConfigServiceUtil {
result=response.readEntity(String.class); result=response.readEntity(String.class);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("request_service_failed",e);
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>"); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
} }
if(response != null && response.getStatus() == 200){ if(response != null && response.getStatus() == 200){

View File

@@ -39,6 +39,7 @@ import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFRichTextString; import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.nis.domain.FunctionRegionDict; import com.nis.domain.FunctionRegionDict;
@@ -583,25 +584,28 @@ public class ExportExcel {
commentStr=""; commentStr="";
} }
}else{ }else{
String[] ipPatterns=region.getConfigIpPattern().split(";");
if("client_ip".equals(headerStr)){ if("client_ip".equals(headerStr)){
Assert.isTrue(ipPatterns.length==2);
String srcIpPattern=ipPatterns[0];
if(((","+region.getConfigIpPortShow()+",").indexOf(",1,") > -1) ){ if(((","+region.getConfigIpPortShow()+",").indexOf(",1,") > -1) ){
commentStr=""; commentStr="";
if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){ 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"; commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"IPv4"+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE; defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+""+msgProp.getProperty("ipv4_range_tip")+""+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE; defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+""+msgProp.getProperty("ipv4_subnet_tip")+""+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE; defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
@@ -610,21 +614,21 @@ public class ExportExcel {
} }
} }
if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){ 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"; commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"IPv6"+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE; defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+""+msgProp.getProperty("ipv6_range_tip")+""+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE; defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+""+msgProp.getProperty("ipv6_subnet_tip")+""+"\n\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE; defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
@@ -673,12 +677,12 @@ public class ExportExcel {
,msgProp.getProperty("serverip"))+"\n"; ,msgProp.getProperty("serverip"))+"\n";
index++; index++;
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++;
index++; index++;
} }
//4、IP Range 开始IP和结束IP必须在同一网段 //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"; commentStr=commentStr+""+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n";
index++; index++;
index++; index++;
@@ -689,7 +693,7 @@ public class ExportExcel {
} }
//6、IPv4 Mask 掩码范围16-32 //6、IPv4 Mask 掩码范围16-32
if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){ if(((","+srcIpPattern+",").indexOf(",1,") > -1)){
if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){ if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){
commentStr=commentStr+""+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n"; commentStr=commentStr+""+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n";
index++; index++;
@@ -705,24 +709,25 @@ public class ExportExcel {
} }
if("server_ip".equals(headerStr)){ if("server_ip".equals(headerStr)){
String destIpPattern=ipPatterns[1];
if((","+region.getConfigIpPortShow()+",").indexOf(",3,") > -1){ if((","+region.getConfigIpPortShow()+",").indexOf(",3,") > -1){
commentStr=""; commentStr="";
if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){ 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"; commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"IPv4"+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE; defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+""+msgProp.getProperty("ipv4_range_tip")+""+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE; defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+""+msgProp.getProperty("ipv4_subnet_tip")+""+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE; defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
@@ -731,21 +736,21 @@ public class ExportExcel {
} }
} }
if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){ 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"; commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"IPv6"+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE; defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+""+msgProp.getProperty("ipv6_range_tip")+""+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE; defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
} }
index++; 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"; commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+""+msgProp.getProperty("ipv6_subnet_tip")+""+"\n\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE; defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
@@ -778,12 +783,12 @@ public class ExportExcel {
,msgProp.getProperty("serverip"))+"\n"; ,msgProp.getProperty("serverip"))+"\n";
index++; index++;
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++;
index++; index++;
} }
//4、IP Range 开始IP和结束IP必须在同一网段 //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"; commentStr=commentStr+""+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n";
index++; index++;
index++; index++;
@@ -794,7 +799,7 @@ public class ExportExcel {
} }
//6、IPv4 Mask 掩码范围16-32 //6、IPv4 Mask 掩码范围16-32
if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){ if(((","+destIpPattern+",").indexOf(",1,") > -1)){
if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){ if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){
commentStr=commentStr+""+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n"; commentStr=commentStr+""+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n";
index++; index++;
@@ -820,17 +825,20 @@ public class ExportExcel {
}else{ }else{
protocol=region.getConfigProtocol(); protocol=region.getConfigProtocol();
} }
String[] portPatterns=region.getConfigPortPattern().split(";");
Assert.isTrue(portPatterns.length==2);
if("client_port".equals(headerStr)){ if("client_port".equals(headerStr)){
String srcPortPattern=portPatterns[0];
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1)){ if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1)){
commentStr=""; commentStr="";
if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){ if((","+srcPortPattern+",").indexOf(",1,") > -1){
commentStr=commentStr+Constants.PORT_DEFAULT+"Port"+"\n"; commentStr=commentStr+Constants.PORT_DEFAULT+"Port"+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.PORT_DEFAULT; defaultValue=Constants.PORT_DEFAULT;
} }
index++; 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"; commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"Port/"+msgProp.getProperty("port_mask")+""+"\n\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.PORT_MASK_DEFAULT; defaultValue=Constants.PORT_MASK_DEFAULT;
@@ -856,11 +864,11 @@ public class ExportExcel {
index++; index++;
} }
//2、源端口、目的端口格式必须一致 //2、源端口、目的端口格式必须一致
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){ // if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
commentStr=commentStr+""+msgProp.getProperty("the_same_port_pattern")+"\n"; // commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
index++; // index++;
index++; // index++;
} // }
//3、端口和端口掩码范围0-65535 //3、端口和端口掩码范围0-65535
commentStr=commentStr+""+msgProp.getProperty("port_mask_comment_tip")+"\n"; commentStr=commentStr+""+msgProp.getProperty("port_mask_comment_tip")+"\n";
index++; index++;
@@ -895,16 +903,17 @@ public class ExportExcel {
} }
} }
if("server_port".equals(headerStr)){ if("server_port".equals(headerStr)){
String destPortPattern=portPatterns[1];
if((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1){ if((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1){
commentStr=""; commentStr="";
if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){ if((","+destPortPattern+",").indexOf(",1,") > -1){
commentStr=commentStr+Constants.PORT_DEFAULT+"Port"+"\n"; commentStr=commentStr+Constants.PORT_DEFAULT+"Port"+"\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.PORT_DEFAULT; defaultValue=Constants.PORT_DEFAULT;
} }
index++; 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"; commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"Port/"+msgProp.getProperty("port_mask")+""+"\n\n";
if(StringUtil.isEmpty(defaultValue)){ if(StringUtil.isEmpty(defaultValue)){
defaultValue=Constants.PORT_MASK_DEFAULT; defaultValue=Constants.PORT_MASK_DEFAULT;
@@ -930,11 +939,11 @@ public class ExportExcel {
index++; index++;
} }
//2、源端口、目的端口格式必须一致 //2、源端口、目的端口格式必须一致
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){ // if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
commentStr=commentStr+""+msgProp.getProperty("the_same_port_pattern")+"\n"; // commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
index++; // index++;
index++; // index++;
} // }
//3、端口和端口掩码范围0-65535 //3、端口和端口掩码范围0-65535
commentStr=commentStr+""+msgProp.getProperty("port_mask_comment_tip")+"\n"; commentStr=commentStr+""+msgProp.getProperty("port_mask_comment_tip")+"\n";
index++; index++;

View File

@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.jets3t.service.ServiceException; import org.jets3t.service.ServiceException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.util.Assert;
import com.beust.jcommander.internal.Lists; import com.beust.jcommander.internal.Lists;
import com.nis.domain.FunctionRegionDict; 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.AsnCacheUtils;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DictUtils; import com.nis.util.DictUtils;
import com.nis.util.IPUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
public class CheckIpFormatThread implements Callable<String>{ public class CheckIpFormatThread implements Callable<String>{
@@ -92,14 +94,20 @@ public class CheckIpFormatThread implements Callable<String>{
} }
boolean canIPv4 = ipType.indexOf("4") > -1; boolean canIPv4 = ipType.indexOf("4") > -1;
boolean canIPv6 = ipType.indexOf("6") > -1; boolean canIPv6 = ipType.indexOf("6") > -1;
String ipPattern = regionDict.getConfigIpPattern(); String[] ipPattern = regionDict.getConfigIpPattern().split(";");
if (StringUtils.isBlank(ipPattern)) { 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"); throw new RuntimeException("Found IP region,but ipPattern is Empty");
} }
boolean canIPFormat = ipType.indexOf("3") > -1; boolean canIPFormat = ipType.indexOf("3") > -1;
boolean canIPSubnetFormat = ipType.indexOf("1") > -1; boolean canIPSubnetFormat = ipType.indexOf("1") > -1;
boolean canIPRangeFormat = ipType.indexOf("2") > -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 protocol = regionDict.getConfigProtocol();
String direction = regionDict.getConfigDirection(); String direction = regionDict.getConfigDirection();
StringBuffer errTip = new StringBuffer(); StringBuffer errTip = new StringBuffer();
@@ -621,74 +629,40 @@ public class CheckIpFormatThread implements Callable<String>{
prop.getProperty("server_ip", "Server IP")) + ";"); prop.getProperty("server_ip", "Server IP")) + ";");
} else if (configIpPortShow.indexOf("1") > -1) { } else if (configIpPortShow.indexOf("1") > -1) {
String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), 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.startsWith("IPV6")) {
if (matchType.endsWith("RANGE")) { //设置dest ip值
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); if(destIpPattern.indexOf("3")>-1) {//优先设置IP类型因为拆分的IP较少
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());
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE); baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
baseIpCfg.setIpPattern(3); baseIpCfg.setDestIpPattern(3);
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) { }else if(destIpPattern.indexOf("1")>-1) {
errInfo.append(prop.getProperty("client_ip")+" " + String.format( baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";"); baseIpCfg.setDestIpPattern(1);
} }else {
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
baseIpCfg.setDestIpPattern(2);
} }
//设置IP类型
baseIpCfg.setIpType(6); baseIpCfg.setIpType(6);
} else { } else {
if (matchType.endsWith("RANGE")) { //设置dest ip值
this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress()); if(destIpPattern.indexOf("3")>-1) {//优先设置IP类型因为拆分的IP较少
// 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());
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
baseIpCfg.setIpPattern(3); baseIpCfg.setDestIpPattern(3);
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) { }else if(destIpPattern.indexOf("1")>-1) {
errInfo.append(prop.getProperty("client_ip")+" " + String.format( baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";"); baseIpCfg.setDestIpPattern(1);
} }else {
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
baseIpCfg.setDestIpPattern(2);
} }
baseIpCfg.setIpType(4); baseIpCfg.setIpType(4);
} }
@@ -700,166 +674,169 @@ public class CheckIpFormatThread implements Callable<String>{
prop.getProperty("client_ip", "Client IP")) + ";"); prop.getProperty("client_ip", "Client IP")) + ";");
} else if (configIpPortShow.indexOf("3") > -1) { } else if (configIpPortShow.indexOf("3") > -1) {
String matchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), 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.startsWith("IPV6")) {
if (matchType.endsWith("RANGE")) { if(srcIpPattern.indexOf("3")>-1) {
// 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());
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE); baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
baseIpCfg.setIpPattern(3); baseIpCfg.setSrcIpPattern(3);
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) { }else if(srcIpPattern.indexOf("1")>-1) {
errInfo.append(prop.getProperty("server_ip")+" " + String.format( baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE);
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";"); baseIpCfg.setSrcIpPattern(1);
} }else {
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE);
baseIpCfg.setSrcIpPattern(2);
} }
baseIpCfg.setIpType(6); baseIpCfg.setIpType(6);
} else { } else {
if (matchType.endsWith("RANGE")) { if(srcIpPattern.indexOf("3")>-1) {
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());
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
baseIpCfg.setIpPattern(3); baseIpCfg.setSrcIpPattern(3);
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) { }else if(srcIpPattern.indexOf("1")>-1) {
errInfo.append(prop.getProperty("server_ip")+" " + String.format( baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE);
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";"); baseIpCfg.setSrcIpPattern(1);
} }else {
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE);
baseIpCfg.setSrcIpPattern(2);
} }
baseIpCfg.setIpType(4); baseIpCfg.setIpType(4);
} }
} }
} else {// 全不为空 } else {// 全不为空
String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType, String srcMatchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType,
ipPattern); srcIpPattern);
String matchType1 = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType, String destMatchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType,
ipPattern); destIpPattern);
if (StringUtils.isNotBlank(matchType) && StringUtils.isNotBlank(matchType1) if (StringUtils.isNotBlank(srcMatchType) && StringUtils.isNotBlank(destMatchType)
&& !matchType.equals(matchType1)) { && ((srcMatchType.startsWith("IPV6")&&destMatchType.startsWith("IPV4"))
errInfo.append(prop.get("the_same_ip_type_pattern") + ";"); ||(srcMatchType.startsWith("IPV4")&&destMatchType.startsWith("IPV6")))) {
errInfo.append(prop.get("the_same_ip_type") + ";");
} }
// baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
// baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
if (matchType.startsWith("IPV6")) { if (srcMatchType.startsWith("IPV6")) {
baseIpCfg.setIpType(6); baseIpCfg.setIpType(6);
} else { } else {
baseIpCfg.setIpType(4); baseIpCfg.setIpType(4);
} }
if (matchType.endsWith("RANGE")) { if (srcMatchType.endsWith("RANGE")) {
if (matchType.startsWith("IPV4")) { 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()); this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress());
}
if (destMatchType.endsWith("RANGE")) {
this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress()); this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress());
} }
//验证Ip范围
if (baseIpCfg.getSrcIpAddress().split("-")[0] if(StringUtils.isEmpty(errInfo)&&(srcMatchType.endsWith("RANGE")||destMatchType.endsWith("RANGE"))) {
.equals(baseIpCfg.getDestIpAddress().split("-")[0])) { this.ValidateRangeCross(baseIpCfg.getSrcIpAddress(),baseIpCfg.getDestIpAddress(), errInfo);
errInfo.append(String.format(prop.getProperty("are_the_same"),
baseIpCfg.getSrcIpAddress().split("-")[0],
baseIpCfg.getDestIpAddress().split("-")[0]) + ";");
} }
baseIpCfg.setIpPattern(2); }
} else if (matchType.endsWith("SUBNET")) { boolean same=false;
if (baseIpCfg.getSrcIpAddress().split("/")[0] if(baseIpCfg.getSrcIpAddress().indexOf("-")>-1) {
.equals(baseIpCfg.getDestIpAddress().split("/")[0])) { if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
errInfo.append(String.format(prop.getProperty("are_the_same"), if(baseIpCfg.getSrcIpAddress().split("-")[0].equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
baseIpCfg.getSrcIpAddress().split("/")[0], same=true;
baseIpCfg.getDestIpAddress().split("/")[0]) + ";"); }
}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().indexOf("/")>-1){
} else { if(baseIpCfg.getDestIpAddress().indexOf("-")>-1) {
if (baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) { if(baseIpCfg.getSrcIpAddress().split("/")[0].equals(baseIpCfg.getDestIpAddress().split("-")[0])) {
errInfo.append(String.format(prop.getProperty("are_the_same"), same=true;
prop.getProperty("client_ip"), prop.getProperty("server_ip")) + ";"); }
}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(3); }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;
}
}
}
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的值
// TODO 判断源IP和目的IP格式 // TODO 判断源IP和目的IP格式
if (destPortEmpty) { if (srcPortEmpty) {
if (srcPortEmpty) { if(srcPortPattern.indexOf("1")>-1) {
baseIpCfg.setSrcPort("0"); baseIpCfg.setSrcPort("0");
baseIpCfg.setDestPort("0"); baseIpCfg.setSrcPortPattern(1);
baseIpCfg.setPortPattern(1); }else {
} else { baseIpCfg.setSrcPort("0/0");
if (baseIpCfg.getSrcPort().indexOf("/") > -1) { baseIpCfg.setSrcPortPattern(2);
baseIpCfg.setDestPort("0/0");
baseIpCfg.setPortPattern(2);
} else {
baseIpCfg.setDestPort("0");
baseIpCfg.setPortPattern(1);
}
baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
} }
} else { }else if(baseIpCfg.getSrcPort().indexOf("/")>-1) {
if (srcPortEmpty) { baseIpCfg.setSrcPortPattern(2);
if (baseIpCfg.getDestPort().indexOf("/") > -1) { }else {
baseIpCfg.setSrcPort("0/0"); baseIpCfg.setSrcPortPattern(1);
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());
}
baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim());
} }
// TODO 判断源端口和目的端口格式 baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim());
// TODO 判断源和目的端口的值 boolean validSrcPort = this.validPort(errInfo, baseIpCfg.getSrcPort(),
boolean validPort = this.validPort(errInfo, baseIpCfg.getSrcPort(), baseIpCfg.getDestPort(), srcPortPattern,"client_port");
portPattern); if (destPortEmpty) {
if(destPortPattern.indexOf("1")>-1) {
baseIpCfg.setDestPort("0");
baseIpCfg.setDestPortPattern(1);
}else {
baseIpCfg.setDestPort("0/0");
baseIpCfg.setDestPortPattern(2);
}
}else if(baseIpCfg.getDestPort().indexOf("/")>-1) {
baseIpCfg.setDestPortPattern(2);
}else {
baseIpCfg.setDestPortPattern(1);
}
baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim());
boolean validDestPort = this.validPort(errInfo, baseIpCfg.getSrcPort(),
srcPortPattern,"server_port");
if (baseIpCfg.getProtocol()==null) { if (baseIpCfg.getProtocol()==null) {
//packet ip reject //packet ip reject
if(regionDict.getFunctionId().equals(5)&&serviceDict!=null&&serviceDict.getServiceId().equals(16)) { 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); boolean validProtocol = this.validProtocol(errInfo, baseIpCfg.getProtocol(), protocol);
// 验证protocol与port是否符合逻辑 // 验证protocol与port是否符合逻辑
if (validProtocol && validPort) { if (validProtocol && validSrcPort&&validDestPort) {
validProtocolAndPort(errInfo, baseIpCfg.getProtocol(), baseIpCfg.getSrcPort(), validProtocolAndPort(errInfo, baseIpCfg.getProtocol(), baseIpCfg.getSrcPort(),
baseIpCfg.getDestPort()); baseIpCfg.getDestPort());
} }
@@ -1030,153 +1007,85 @@ public class CheckIpFormatThread implements Callable<String>{
* @param portPattern * @param portPattern
* @throws ServiceException * @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 { throws ServiceException {
boolean valid = true; boolean valid = true;
if (portPattern.equals("1")) { if (portPattern.equals("1")) {
try { try {
Integer srcPort = Integer.parseInt(srcPortStr); Integer srcPort = Integer.parseInt(portStr);
if (srcPort < 0 || srcPort > 65535) { if (srcPort < 0 || srcPort > 65535) {
errInfo.append(prop.getProperty("client_port") errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";"); + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false; valid = false;
} }
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty("client_port")) + ";"); errInfo.append(String.format(prop.getProperty("not_number"), prop.getProperty(portName)) + ";");
valid = false;
}
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; valid = false;
} }
} else if (portPattern.equals("2")) { } else if (portPattern.equals("2")) {
Pattern p = Constants.PORT_MASK_PATTERN; Pattern p = Constants.PORT_MASK_PATTERN;
Matcher m = p.matcher(srcPortStr); Matcher m = p.matcher(portStr);
if (!m.matches()) { if (!m.matches()) {
errInfo.append( 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; valid = false;
} }
m = p.matcher(destPortStr);
if (!m.matches()) { Integer port = Integer.parseInt(portStr.split("/")[0]);
errInfo.append( Integer portMask = Integer.parseInt(portStr.split("/")[1]);
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("server_port")) + ";");
valid = false; if (port < 0 || port > 65535) {
} errInfo.append(prop.getProperty(portName)
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) + ";"); + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false; valid = false;
} }
if (srcPortMask < 0 || srcPortMask > 65535) { if (portMask < 0 || portMask > 65535) {
errInfo.append(prop.getProperty("client_port_mask") errInfo.append(prop.getProperty(portName+"_mask")
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false;
}
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")
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";"); + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false; valid = false;
} }
} else if (portPattern.indexOf("1") > -1 && portPattern.indexOf("2") > -1) { } else if (portPattern.indexOf("1") > -1 && portPattern.indexOf("2") > -1) {
Pattern p = Constants.PORT_MASK_PATTERN; Pattern p = Constants.PORT_MASK_PATTERN;
Pattern p1 = Constants.PORT_PATTERN; Pattern p1 = Constants.PORT_PATTERN;
Matcher m = p.matcher(srcPortStr);// 源端口是端口掩码格式 Matcher m = p.matcher(portStr);// 源端口是端口掩码格式
Matcher m1 = p.matcher(destPortStr);// 目的端口是端口掩码格式 Matcher m2 = p1.matcher(portStr);// 端口是端口格式
Matcher m2 = p1.matcher(srcPortStr);// 源端口是端口格式
Matcher m3 = p1.matcher(destPortStr);// 目的端口是端口格式
if (m.matches()) { if (m.matches()) {
Integer srcPort = Integer.parseInt(srcPortStr.split("/")[0]); Integer srcPort = Integer.parseInt(portStr.split("/")[0]);
Integer srcPortMask = Integer.parseInt(srcPortStr.split("/")[1]); Integer srcPortMask = Integer.parseInt(portStr.split("/")[1]);
if (srcPort < 0 || srcPort > 65535) { if (srcPort < 0 || srcPort > 65535) {
errInfo.append(prop.getProperty("client_port") errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";"); + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false; valid = false;
} }
if (srcPortMask < 0 || srcPortMask > 65535) { if (srcPortMask < 0 || srcPortMask > 65535) {
errInfo.append(prop.getProperty("client_port_mask") errInfo.append(prop.getProperty(portName+"_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")
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";"); + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false; valid = false;
} }
} }
if (m2.matches()) { if (m2.matches()) {
try { try {
Integer srcPort = Integer.parseInt(srcPortStr); Integer srcPort = Integer.parseInt(portStr);
if (srcPort < 0 || srcPort > 65535) { if (srcPort < 0 || srcPort > 65535) {
errInfo.append(prop.getProperty("client_port") errInfo.append(prop.getProperty(portName)
+ String.format(prop.getProperty("must_between"), 0, 65535) + ";"); + String.format(prop.getProperty("must_between"), 0, 65535) + ";");
valid = false; valid = false;
} }
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
errInfo.append( errInfo.append(
String.format(prop.getProperty("not_number"), prop.getProperty("client_port")) + ";"); String.format(prop.getProperty("not_number"), prop.getProperty(portName)) + ";");
valid = false; 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()) { if (!m.matches() && !m2.matches()) {
errInfo.append( 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; valid = false;
} }
if (!m1.matches() && !m3.matches()) {
errInfo.append(
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty("server_port")) + ";");
valid = false;
}
} }
return valid; return valid;
} }
@@ -1369,7 +1278,44 @@ public class CheckIpFormatThread implements Callable<String>{
} }
return matchType; 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() { public List<Map<Long, AsnGroupInfo>> getAsnNoMaps() {
return asnNoMaps; return asnNoMaps;
} }
@@ -1382,5 +1328,4 @@ public class CheckIpFormatThread implements Callable<String>{
public void setAsnGroupInfos(Map<Long, AsnGroupInfo> asnGroupInfos) { public void setAsnGroupInfos(Map<Long, AsnGroupInfo> asnGroupInfos) {
this.asnGroupInfos = asnGroupInfos; this.asnGroupInfos = asnGroupInfos;
} }
} }

View File

@@ -79,15 +79,19 @@ public class AsnIpController extends BaseController{
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){ public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
try{ try{
asnIpCfgService.saveAsnIpCfg(cfg); asnIpCfgService.saveAsnIpCfg(cfg);
addMessage(redirectAttributes,"success","save_success"); //配置仅保存
}catch(Exception e){ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
logger.error("信息保存失败",e); addMessage(redirectAttributes, "success", "save_success");
e.printStackTrace();
if(e instanceof MaatConvertException) {
addMessage(redirectAttributes,"error",e.getMessage());
}else { }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(); return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
@@ -98,11 +102,19 @@ public class AsnIpController extends BaseController{
try{ try{
asnIpCfgService.update(cfg); asnIpCfgService.update(cfg);
addMessage(redirectAttributes,"success","save_success"); //配置仅保存
}catch(Exception e){ if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
logger.error("信息保存失败",e); addMessage(redirectAttributes, "success", "save_success");
e.printStackTrace(); }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(); return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();

View File

@@ -77,4 +77,31 @@ public class InnerProtectionListController extends BaseController{
public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){ public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){
return innerProtectionListService.ajaxGetAllInfo(); 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;
}
} }

View File

@@ -219,15 +219,19 @@ public class AppCfgController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appCfgService.saveOrUpdateAppPolicyCfg(entity); appCfgService.saveOrUpdateAppPolicyCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
logger.error("saveAppPolicyCfg failed", e); addMessage(redirectAttributes, "success", "save_success");
e.printStackTrace(); }else {
if (e instanceof MaatConvertException) { //配置直接生效
addMessage(redirectAttributes, "error", "request_service_failed"); addMessage(redirectAttributes, "success", "audit_success");
} else {
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); 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 = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
entity.setIsAudit(isAudit); entity.setIsAudit(isAudit);
entity.setIsValid(isValid); entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP);
try { try {
appCfgService.auditAppPolicyCfg(entity, isAudit); appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@@ -394,15 +396,19 @@ public class AppCfgController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appCfgService.saveOrUpdateAppIpCfg(entity); appCfgService.saveOrUpdateAppIpCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
e.printStackTrace(); addMessage(redirectAttributes, "success", "save_success");
logger.error("saveAppIpCfg failed", e); }else {
if (e instanceof MaatConvertException) { //配置直接生效
addMessage(redirectAttributes, "error", "request_service_failed"); addMessage(redirectAttributes, "success", "audit_success");
} else {
addMessage(redirectAttributes, "error", "save_failed");
} }
}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(); return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + entity.getFunctionId();
@@ -432,10 +438,7 @@ public class AppCfgController extends BaseController {
entity = appCfgService.getAppIpCfg(Long.parseLong(id)); entity = appCfgService.getAppIpCfg(Long.parseLong(id));
entity.setIsAudit(isAudit); entity.setIsAudit(isAudit);
entity.setIsValid(isValid); entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
entity.setTableName(AppIpCfg.getTablename());
if (dataMap.containsKey(entity.getCompileId())) { if (dataMap.containsKey(entity.getCompileId())) {
dataMap.get(entity.getCompileId()).add(entity); dataMap.get(entity.getCompileId()).add(entity);
} else { } else {
@@ -737,14 +740,19 @@ public class AppCfgController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appCfgService.saveOrUpdateAppDomainCfg(entity); appCfgService.saveOrUpdateAppDomainCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
e.printStackTrace(); addMessage(redirectAttributes, "success", "save_success");
if (e instanceof MaatConvertException) { }else {
addMessage(redirectAttributes, "error", "request_service_failed"); //配置直接生效
} else { addMessage(redirectAttributes, "success", "audit_success");
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + entity.getFunctionId();
@@ -772,11 +780,9 @@ public class AppCfgController extends BaseController {
entity = appCfgService.getAppDomainCfg(Long.parseLong(id)); entity = appCfgService.getAppDomainCfg(Long.parseLong(id));
entity.setIsAudit(isAudit); entity.setIsAudit(isAudit);
entity.setIsValid(isValid); entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
try { try {
appCfgService.auditAppDomainCfg(entity, isAudit); appCfgService.auditAppDomainCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@@ -1507,18 +1513,19 @@ public class AppCfgController extends BaseController {
entity.setCfgKeywords(entity.getCfgKeywords()); entity.setCfgKeywords(entity.getCfgKeywords());
} }
appCfgService.saveOrUpdateAppTopicDomainCfg(entity); appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
if (e instanceof MaatConvertException) { addMessage(redirectAttributes, "success", "save_success");
e.printStackTrace(); }else {
logger.info("app主题网站配置下发失败" + e.getMessage()); //配置直接生效
; addMessage(redirectAttributes, "success", "audit_success");
addMessage(redirectAttributes, "error", "request_service_failed");
} else {
e.printStackTrace();
logger.error("app主题网站配置下发失败", e);
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + entity.getFunctionId();
@@ -1546,11 +1553,9 @@ public class AppCfgController extends BaseController {
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id)); entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id));
entity.setIsAudit(isAudit); entity.setIsAudit(isAudit);
entity.setIsValid(isValid); entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
try { try {
appCfgService.auditAppTopicDomainCfg(entity, isAudit); appCfgService.auditAppTopicDomainCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) { } catch (Exception e) {
logger.error("app主题网站配置下发失败", e); logger.error("app主题网站配置下发失败", e);

View File

@@ -142,14 +142,19 @@ public class AppFeatureCfgController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity); appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
e.printStackTrace(); addMessage(redirectAttributes, "success", "save_success");
if (e instanceof MaatConvertException) { }else {
addMessage(redirectAttributes, "error", "request_service_failed"); //配置直接生效
} else { addMessage(redirectAttributes, "success", "audit_success");
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); 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 = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id));
entity.setIsAudit(isAudit); entity.setIsAudit(isAudit);
entity.setIsValid(isValid); entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
try { try {
appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit); appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (MaatConvertException e) { } catch (MaatConvertException e) {
e.printStackTrace(); 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" String ipPortInfoNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
+ ",config_time,editor,edit_time,auditor,audit_time" + ",config_time,editor,edit_time,auditor,audit_time"
+ ",letter,whether_area_block,classification,attribute,label" + ",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) { if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {

View File

@@ -158,18 +158,22 @@ public class BasicProtocolController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appCfgService.saveOrUpdateAppPolicyCfg(entity); appCfgService.saveOrUpdateAppPolicyCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
e.printStackTrace(); addMessage(redirectAttributes, "success", "save_success");
logger.error("基础协议信息保存失败", e); }else {
if (e instanceof MaatConvertException) { //配置直接生效
// addMessage(redirectAttributes,e.getMessage()); addMessage(redirectAttributes, "success", "audit_success");
addMessage(redirectAttributes, "error", "request_service_failed");
} else if (e instanceof CallExternalProceduresException) {
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
} else {
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); 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 = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
entity.setIsAudit(isAudit); entity.setIsAudit(isAudit);
entity.setIsValid(isValid); entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
try { try {
appCfgService.auditAppPolicyCfg(entity, isAudit); appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) { } catch (Exception e) {
if (e instanceof MaatConvertException) { if (e instanceof MaatConvertException) {

View File

@@ -8,10 +8,8 @@
*/ */
package com.nis.web.controller.configuration; package com.nis.web.controller.configuration;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
@@ -19,38 +17,22 @@ import java.util.Properties;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.axis2.databinding.types.soapencoding.Array;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; 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.Page;
import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.basics.ServiceDictInfo;
import com.nis.domain.configuration.BaseIpCfg; 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.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.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DateUtils; import com.nis.util.DateUtils;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.util.excel.ExportExcel; import com.nis.util.excel.ExportExcel;
import com.nis.util.excel.ImportExcel;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.security.UserUtils;
/** /**
* @ClassName: CommonController.java * @ClassName: CommonController.java
@@ -288,15 +270,7 @@ public class CommonController extends BaseController {
e.printStackTrace(); 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配置导出 //ip配置导出
public void _exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response, public void _exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){ IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){

View File

@@ -178,17 +178,22 @@ public class EncryptedTunnelBehaviorController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appCfgService.saveOrUpdateAppPolicyCfg(entity); appCfgService.saveOrUpdateAppPolicyCfg(entity);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
e.printStackTrace(); addMessage(redirectAttributes, "success", "save_success");
logger.error("加密隧道信息保存失败", e); }else {
if (e instanceof MaatConvertException) { //配置直接生效
addMessage(redirectAttributes, "error", "request_service_failed"); addMessage(redirectAttributes, "success", "audit_success");
} else if (e instanceof CallExternalProceduresException) {
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
} else {
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId();
@@ -221,7 +226,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
try { try {
appCfgService.auditAppPolicyCfg(entity, isAudit); appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) { } catch (Exception e) {
if (e instanceof MaatConvertException) { if (e instanceof MaatConvertException) {

View File

@@ -98,15 +98,19 @@ public class DnsIpCfgController extends BaseController {
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) { @ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
try { try {
dnsIpCfgService.saveOrUpdate(cfg); dnsIpCfgService.saveOrUpdate(cfg);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
logger.error("信息保存失败", e); addMessage(redirectAttributes, "success", "save_success");
e.printStackTrace(); }else {
if (e instanceof MaatConvertException) { //配置直接生效
addMessage(redirectAttributes, "error", "request_service_failed"); addMessage(redirectAttributes, "success", "audit_success");
} else {
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + cfg.getFunctionId();
@@ -235,7 +239,7 @@ public class DnsIpCfgController extends BaseController {
} }
titleList.add(entity.getMenuNameCode()); titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class); 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) { if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {

View File

@@ -80,10 +80,18 @@ public class DnsResStrategyController extends BaseController {
dnsResStrategyService.saveOrUpdate(cfg); 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) { } catch (MaatConvertException e) {
logger.error("DNS响应策略配置下发失败",e);
addMessage(redirectAttributes, "error", "request_service_failed"); addMessage(redirectAttributes, "error", "request_service_failed");
} catch (Exception e) { } catch (Exception e) {
logger.error("DNS响应策略配置保存失败",e);
addMessage(redirectAttributes, "error", "save_failed"); addMessage(redirectAttributes, "error", "save_failed");
} }

View File

@@ -71,15 +71,19 @@ public class DdosCfgController extends BaseController {
@ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) { @ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) {
try { try {
ddosCfgService.saveOrUpdate(cfg); ddosCfgService.saveOrUpdate(cfg);
addMessage(redirectAttributes, "success", "save_success"); //配置仅保存
} catch (Exception e) { if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
logger.error("信息保存失败", e); addMessage(redirectAttributes, "success", "save_success");
e.printStackTrace(); }else {
if (e instanceof MaatConvertException) { //配置直接生效
addMessage(redirectAttributes, "error", "request_service_failed"); addMessage(redirectAttributes, "success", "audit_success");
} else {
addMessage(redirectAttributes, "error", "save_failed");
} }
} 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(); return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + cfg.getFunctionId();
@@ -120,7 +124,7 @@ public class DdosCfgController extends BaseController {
Date auditTime = new Date(); Date auditTime = new Date();
for (String id : idArray) { for (String id : idArray) {
try { try {
ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime); ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (MaatConvertException e) { } catch (MaatConvertException e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -40,7 +40,6 @@ import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.IpReuseDnatPolicyCfg; import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
import com.nis.domain.configuration.IpReusePolicyCfg; import com.nis.domain.configuration.IpReusePolicyCfg;
import com.nis.domain.configuration.UserManage; import com.nis.domain.configuration.UserManage;
import com.nis.domain.configuration.template.IpMultiplexPolicyTemplate;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants; import com.nis.util.Constants;
@@ -120,26 +119,6 @@ public class IpMultiplexController extends CommonController {
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId(); 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配置导出 // ip配置导出
@RequestMapping(value = "export") @RequestMapping(value = "export")

View File

@@ -112,20 +112,7 @@ public class RatelimitController extends CommonController {
redirectAttributes.addAttribute("requiresPermissionPrefix","domain:ratelimit"); redirectAttributes.addAttribute("requiresPermissionPrefix","domain:ratelimit");
return "redirect:" + adminPath +"/manipulation/ratelimit/domain/list?functionId="+cfg.getFunctionId(); 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配置导出 //ip配置导出
@RequestMapping(value = "/ip/export") @RequestMapping(value = "/ip/export")
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response, public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,

View File

@@ -27,7 +27,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.FunctionRegionDict; import com.nis.domain.FunctionRegionDict;
import com.nis.domain.FunctionServiceDict; import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AsnKeywordCfg; import com.nis.domain.configuration.AsnKeywordCfg;
import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg; 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.StringAllNotDoLogTemplate;
import com.nis.domain.configuration.template.StringAllTemplate; import com.nis.domain.configuration.template.StringAllTemplate;
import com.nis.domain.configuration.template.TopicWebsiteTemplate; import com.nis.domain.configuration.template.TopicWebsiteTemplate;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DictUtils; import com.nis.util.DictUtils;

View File

@@ -14,15 +14,11 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.taglibs.standard.functions.Functions;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; 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 org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.FunctionRegionDict; 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.CfgIndexInfo;
import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.DnsResStrategy; 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.HttpBodyCfg;
import com.nis.domain.configuration.HttpReqHeadCfg; import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg; import com.nis.domain.configuration.HttpResHeadCfg;
@@ -46,7 +38,6 @@ import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DictUtils; import com.nis.util.DictUtils;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.util.excel.ImportExcel;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils; import com.nis.web.security.UserUtils;
@@ -616,13 +607,6 @@ public class WebsiteController extends BaseController {
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId; 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配置导入 // http配置导入
/* /*
* @RequestMapping(value = "importHttp", method=RequestMethod.POST) public * @RequestMapping(value = "importHttp", method=RequestMethod.POST) public

View File

@@ -120,11 +120,6 @@ public class ControlController extends CommonController {
redirectAttributes.addAttribute("requiresPermissionPrefix","control:ip"); redirectAttributes.addAttribute("requiresPermissionPrefix","control:ip");
return "redirect:" + adminPath +"/proxy/control/ip/list?functionId="+cfg.getFunctionId(); 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配置导出 //ip配置导出
@RequestMapping(value = "/ip/export") @RequestMapping(value = "/ip/export")
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response, public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,

View File

@@ -238,20 +238,26 @@ public class PxyObjKeyringController extends BaseController {
} }
} }
pxyObjKeyringService.saveOrUpdate(cfg); 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) { } catch (Exception e) {
logger.error("证书上传失败", e); logger.error("拦截策略配置保存失败",e);
if (e instanceof MaatConvertException) { addMessage(redirectAttributes, "error", "save_failed");
addMessage(redirectAttributes, "error", "request_service_failed");
} else if (e instanceof MultiPartNewException) {
addMessage(redirectAttributes, "error", e.getMessage());
} else {
addMessage(redirectAttributes, "error", "save_failed");
}
} }
return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + cfg.getFunctionId(); return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + cfg.getFunctionId();
} }
@@ -641,18 +647,24 @@ public class PxyObjKeyringController extends BaseController {
} }
} }
pxyObjKeyringService.trustedCertsaveOrUpdate(cfg); 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) { } catch (Exception e) {
logger.error("证书上传失败", e); logger.error("可信证书配置保存失败",e);
if (e instanceof MultiPartNewException) { addMessage(redirectAttributes, "error", "save_failed");
addMessage(redirectAttributes, "error", e.getMessage());
} else if (e instanceof MaatConvertException) {
addMessage(redirectAttributes, "error", "request_service_failed");
} else {
addMessage(redirectAttributes, "error", "save_failed");
}
} }
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId(); return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId();

View File

@@ -5,7 +5,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -48,7 +49,7 @@
</resultMap> </resultMap>
<sql id="columns"> <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.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.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, ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -91,8 +92,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test="destIpPattern != null">
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -100,8 +104,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test="destPortPattern != null">
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -227,8 +234,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test="destIpPattern != null">
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -236,8 +246,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test="destPortPattern != null">
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} 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} from asn_ip_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId}
</select> </select>
<insert id="insert" parameterType="com.nis.domain.basics.AsnIpCfg" > <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 ( insert into asn_ip_cfg (
CFG_DESC, CFG_DESC,
ACTION, ACTION,
@@ -345,9 +361,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -388,8 +402,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -473,11 +487,17 @@
<if test="srcIpAddress != null and srcIpAddress != ''" > <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="ipPattern != null" > <if test="srcIpPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER}, src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="portPattern != null" > <if test="destIpPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER}, 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>
<if test="srcPort != null and srcPort != ''" > <if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR}, src_port = #{srcPort,jdbcType=VARCHAR},
@@ -564,7 +584,7 @@
INSERT INTO asn_ip_cfg INSERT INTO asn_ip_cfg
(CFG_DESC,ACTION,IS_VALID,IS_AUDIT,CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID, (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, 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, 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) asn_ip_group,user_region1,user_region2,user_region3,user_region4,user_region5,organization,country,detail)
VALUES VALUES
@@ -591,8 +611,10 @@
#{asnIp.functionId,jdbcType=INTEGER}, #{asnIp.functionId,jdbcType=INTEGER},
#{asnIp.ipType,jdbcType=INTEGER}, #{asnIp.ipType,jdbcType=INTEGER},
#{asnIp.srcIpAddress,jdbcType=VARCHAR}, #{asnIp.srcIpAddress,jdbcType=VARCHAR},
#{asnIp.ipPattern,jdbcType=INTEGER}, #{asnIp.srcIpPattern,jdbcType=INTEGER},
#{asnIp.portPattern,jdbcType=INTEGER}, #{asnIp.destIpPattern,jdbcType=INTEGER},
#{asnIp.srcPortPattern,jdbcType=INTEGER},
#{asnIp.destPortPattern,jdbcType=INTEGER},
#{asnIp.srcPort,jdbcType=VARCHAR}, #{asnIp.srcPort,jdbcType=VARCHAR},
#{asnIp.protocol,jdbcType=INTEGER}, #{asnIp.protocol,jdbcType=INTEGER},
#{asnIp.protocolId,jdbcType=INTEGER}, #{asnIp.protocolId,jdbcType=INTEGER},

View File

@@ -43,7 +43,8 @@
<result column="app_code" property="appCode" jdbcType="INTEGER" /> <result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" /> <result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" 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="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" /> <result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" /> <result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -235,7 +236,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" 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.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.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.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 r.DIRECTION,r.PROTOCOL,r.DO_LOG,r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
</sql> </sql>
@@ -461,7 +463,7 @@
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -887,8 +889,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test="destIpPattern != null">
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -896,8 +901,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test="destPortPattern != null">
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -1823,12 +1831,12 @@
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, 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 DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR}, #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER}, #{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} #{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,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, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, 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 DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR}, #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER}, #{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} #{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,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, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, 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 DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values )values
<foreach collection ="list" item="appIp" separator =","> <foreach collection ="list" item="appIp" separator =",">
@@ -1868,9 +1876,10 @@
#{appIp.requestId,jdbcType=INTEGER},#{appIp.compileId,jdbcType=INTEGER},#{appIp.isAreaEffective,jdbcType=INTEGER}, #{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.classify,jdbcType=VARCHAR},#{appIp.attribute,jdbcType=VARCHAR},#{appIp.lable,jdbcType=VARCHAR},
#{appIp.areaEffectiveIds,jdbcType=VARCHAR},#{appIp.ratelimit,jdbcType=VARCHAR},#{appIp.functionId,jdbcType=INTEGER}, #{appIp.areaEffectiveIds,jdbcType=VARCHAR},#{appIp.ratelimit,jdbcType=VARCHAR},#{appIp.functionId,jdbcType=INTEGER},
#{appIp.cfgType,jdbcType=VARCHAR},#{appIp.cfgRegionCode,jdbcType=INTEGER}, #{appIp.cfgType,jdbcType=VARCHAR},#{appIp.cfgRegionCode,jdbcType=INTEGER},#{appIp.ipType,jdbcType=INTEGER},
#{appIp.ipType,jdbcType=INTEGER}, #{appIp.ipPattern,jdbcType=INTEGER},#{appIp.srcIpAddress,jdbcType=VARCHAR},#{appIp.destIpAddress,jdbcType=VARCHAR}, #{appIp.srcIpPattern,jdbcType=INTEGER},#{appIp.destIpPattern,jdbcType=INTEGER},#{appIp.srcIpAddress,jdbcType=VARCHAR},
#{appIp.portPattern,jdbcType=INTEGER},#{appIp.srcPort,jdbcType=VARCHAR},#{appIp.destPort,jdbcType=VARCHAR},#{appIp.direction,jdbcType=INTEGER}, #{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.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} ,#{appIp.userRegion3,jdbcType=VARCHAR},#{appIp.userRegion4,jdbcType=VARCHAR},#{appIp.userRegion5,jdbcType=VARCHAR}
) )
@@ -2057,9 +2066,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -2090,8 +2097,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -2294,8 +2301,11 @@
<if test="ipType != null" > <if test="ipType != null" >
IP_TYPE = #{ipType,jdbcType=INTEGER}, IP_TYPE = #{ipType,jdbcType=INTEGER},
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
IP_PATTERN=#{ipPattern,jdbcType=INTEGER}, SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
</if>
<if test="destIpPattern != null">
DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}, SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
@@ -2303,8 +2313,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}, DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
PORT_PATTERN=#{portPattern,jdbcType=INTEGER}, SRC_PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},
</if>
<if test="destPortPattern != null">
DEST_PORT_PATTERN=#{destPortPattern,jdbcType=INTEGER},
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
SRC_PORT=#{srcPort,jdbcType=VARCHAR}, SRC_PORT=#{srcPort,jdbcType=VARCHAR},

View File

@@ -42,7 +42,8 @@
<result column="app_code" property="appCode" jdbcType="INTEGER" /> <result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" /> <result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" 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="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" /> <result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" /> <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.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.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.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 r.DIRECTION,r.PROTOCOL,r.DO_LOG,r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
</sql> </sql>
@@ -540,13 +541,13 @@
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, 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 DIRECTION,PROTOCOL,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}, #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR}, #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER}, #{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} #{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR}
,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR}
) )

View File

@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!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" > <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" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" /> <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" /> <result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" 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="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" /> <result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" /> <result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -36,13 +37,13 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
</resultMap> </resultMap>
<sql id="AreaIpCfg_Column_List_with_id" > <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, DEST_PORT,DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID
</sql> </sql>
<select id="getByCompileId" resultMap="BaseIpMap" > <select id="getByCompileId" resultMap="AreaIpMap" >
SELECT SELECT
<include refid="AreaIpCfg_Column_List_with_id" /> <include refid="AreaIpCfg_Column_List_with_id" />
FROM area_ip_cfg FROM area_ip_cfg
@@ -76,9 +77,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -109,8 +108,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -147,9 +146,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -180,8 +177,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -255,11 +252,17 @@
<if test="srcIpAddress != null and srcIpAddress != ''" > <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="ipPattern != null" > <if test="srcIpPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER}, src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="portPattern != null" > <if test="destIpPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER}, 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>
<if test="srcPort != null and srcPort != ''" > <if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR}, src_port = #{srcPort,jdbcType=VARCHAR},

View File

@@ -30,7 +30,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -94,7 +95,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -193,7 +195,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -224,7 +227,7 @@
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" /> <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<sql id="IpCfg_Column" > <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.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.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, ,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 r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id,r.do_log,r.do_blacklist
</sql> </sql>
<sql id="AvVoipIp_Column" > <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.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.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, ,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 r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code
</sql> </sql>
<sql id="AvContIp_Column" > <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.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.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, ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -816,8 +819,10 @@
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,
ip_pattern, src_ip_pattern,
port_pattern, dest_ip_pattern,
src_port_pattern,
dest_port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -848,8 +853,10 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{destIpPattern,jdbcType=INTEGER},
#{srcPortPattern,jdbcType=INTEGER},
#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -1053,9 +1060,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -1086,8 +1091,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -1237,11 +1242,17 @@
<if test="voipIp != null and voipIp.srcIpAddress != null and voipIp.srcIpAddress != ''" > <if test="voipIp != null and voipIp.srcIpAddress != null and voipIp.srcIpAddress != ''" >
src_ip_address = #{voipIp.srcIpAddress,jdbcType=VARCHAR}, src_ip_address = #{voipIp.srcIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="voipIp != null and voipIp.ipPattern != null" > <if test="voipIp != null and voipIp.srcIpPattern != null" >
ip_pattern = #{voipIp.ipPattern,jdbcType=INTEGER}, src_ip_pattern = #{voipIp.srcIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="voipIp != null and voipIp.portPattern != null" > <if test="voipIp != null and voipIp.destIpPattern != null" >
port_pattern = #{voipIp.portPattern,jdbcType=INTEGER}, 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.destPortPattern != null" >
dest_port_pattern = #{voipIp.destPortPattern,jdbcType=INTEGER},
</if> </if>
<if test="voipIp != null and voipIp.srcPort != null and voipIp.srcPort != ''" > <if test="voipIp != null and voipIp.srcPort != null and voipIp.srcPort != ''" >
src_port = #{voipIp.srcPort,jdbcType=VARCHAR}, src_port = #{voipIp.srcPort,jdbcType=VARCHAR},
@@ -1652,9 +1663,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -1686,8 +1695,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -1762,11 +1771,17 @@
<if test="srcIpAddress != null and srcIpAddress != ''" > <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="ipPattern != null" > <if test="srcIpPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER}, src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="portPattern != null" > <if test="destIpPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER}, 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>
<if test="srcPort != null and srcPort != ''" > <if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR}, src_port = #{srcPort,jdbcType=VARCHAR},

View File

@@ -30,7 +30,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" 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 a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,a.do_blacklist
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -432,9 +433,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -465,8 +464,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -74,7 +74,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -172,7 +173,7 @@
a.do_blacklist a.do_blacklist
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -489,9 +490,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -527,8 +526,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -80,7 +80,8 @@
<result column="app_code" property="appCode" jdbcType="INTEGER" /> <result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" /> <result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" 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="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" /> <result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" /> <result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -240,7 +241,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -381,7 +383,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -701,7 +704,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -775,12 +779,12 @@
<sql id="DdosIpCfg_Column" > <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.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.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.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 a.antiddos_protocol,a.bps_threadshold
</sql> </sql>
<sql id="IpCfg_Column" > <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 a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id
</sql> </sql>
<sql id="IpCfg_AllColumn" > <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.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.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.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 a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type
</sql> </sql>
<sql id="IpDropCfg_Column" > <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.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.area_effective_ids,a.function_id,a.user_region1,a.user_region2,
a.user_region3,a.user_region4,a.user_region5, 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 a.protocol,a.protocol_id,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type
</sql> </sql>
<sql id="AsnIpCfg_Column" > <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.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 a.user_region1,a.region_id
</sql> </sql>
@@ -883,7 +887,7 @@
,a.area_effective_ids,a.function_id,a.cfg_region_code,a.compile_id ,a.area_effective_ids,a.function_id,a.cfg_region_code,a.compile_id
</sql> </sql>
<sql id="DnsIpCfgColumns"> <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.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.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, ,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 a.feature_table_type,a.app_code,a.spec_service_id,a.cfg_region_code
</sql> </sql>
<sql id="AppIpCfg_Column" > <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 ,a.protocol,a.direction,a.dest_port,a.dest_ip_address,a.cfg_type,a.compile_id
</sql> </sql>
@@ -928,7 +932,7 @@
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME, 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.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.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 a.DIRECTION,a.PROTOCOL,a.DO_LOG,a.USER_REGION1,a.USER_REGION2,a.USER_REGION3,a.USER_REGION4,a.USER_REGION5
</sql> </sql>
@@ -1629,7 +1633,7 @@
</select> </select>
<select id="getAsnIpList" resultType="com.nis.domain.basics.AsnIpCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo"> <select id="getAsnIpList" resultType="com.nis.domain.basics.AsnIpCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo">
select 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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,

View File

@@ -5,7 +5,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -41,7 +42,7 @@
</resultMap> </resultMap>
<sql id="columns"> <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.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.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, ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -80,8 +81,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test="destIpPattern != null">
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -89,8 +93,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test="destPortPattern != null">
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -217,9 +224,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -254,8 +259,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -332,11 +337,17 @@
<if test="srcIpAddress != null and srcIpAddress != ''" > <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="ipPattern != null" > <if test="srcIpPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER}, src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="portPattern != null" > <if test="destIpPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER}, 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>
<if test="srcPort != null and srcPort != ''" > <if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR}, src_port = #{srcPort,jdbcType=VARCHAR},

View File

@@ -5,7 +5,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -40,7 +41,7 @@
</resultMap> </resultMap>
<sql id="columns"> <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.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.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, ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
@@ -83,8 +84,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test="destIpPattern != null">
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -92,8 +96,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test="destPortPattern != null">
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -208,6 +215,9 @@
</select> </select>
<insert id="insert" parameterType="com.nis.domain.configuration.DnsIpCfg" > <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 ( insert into dns_ip_cfg (
CFG_DESC, CFG_DESC,
ACTION, ACTION,
@@ -229,9 +239,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -264,8 +272,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
@@ -340,11 +348,17 @@
<if test="srcIpAddress != null and srcIpAddress != ''" > <if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="ipPattern != null" > <if test="srcIpPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER}, src_ip_pattern = #{srcIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="portPattern != null" > <if test="destIpPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER}, 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>
<if test="srcPort != null and srcPort != ''" > <if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR}, src_port = #{srcPort,jdbcType=VARCHAR},

View File

@@ -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 order by r.cfg_Id
</select> </select>
<insert id="insert" parameterType="com.nis.domain.configuration.DnsResStrategy" > <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 ( insert into dns_res_strategy (
CFG_DESC, CFG_DESC,
ACTION, ACTION,

View File

@@ -35,7 +35,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -172,7 +173,7 @@
a.do_blacklist a.do_blacklist
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -453,9 +454,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -491,8 +490,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!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" > <mapper namespace="com.nis.web.dao.configuration.IpCfgDao" >
<!-- 基础 -->
<resultMap id="BaseIpMap" type="com.nis.domain.configuration.BaseIpCfg" > <resultMap id="BaseIpMap" type="com.nis.domain.configuration.BaseIpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" /> <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" /> <result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" 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="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" /> <result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" /> <result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
@@ -85,7 +87,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -116,14 +119,14 @@
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" /> <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<sql id="BaseIpCfg_Column_List_with_id" > <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, DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, 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 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>
<sql id="BaseIpCfg_Column_List_with_id_name" > <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, DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
@@ -133,7 +136,8 @@
<choose> <choose>
<when test="page !=null and page.alias != null and page.alias != ''"> <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}.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}.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}.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, ${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> </when>
<otherwise> <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.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.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.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, 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>
<sql id="BaseIpCfg_Column_List" > <sql id="BaseIpCfg_Column_List" >
CFG_DESC,CFG_REGION_CODE,CFG_TYPE, CFG_DESC,CFG_REGION_CODE,CFG_TYPE,
IP_TYPE,IP_PATTERN,SRC_IP_ADDRESS,DEST_IP_ADDRESS, 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,
PORT_PATTERN,SRC_PORT,DEST_PORT,DIRECTION,
PROTOCOL,PROTOCOL_ID,ACTION, PROTOCOL,PROTOCOL_ID,ACTION,
IS_VALID,IS_AUDIT,CREATOR_ID, IS_VALID,IS_AUDIT,CREATOR_ID,
CREATE_TIME,EDITOR_ID,EDIT_TIME, CREATE_TIME,EDITOR_ID,EDIT_TIME,
@@ -176,8 +180,8 @@
</sql> </sql>
<sql id="BaseIpCfg_Value_List" > <sql id="BaseIpCfg_Value_List" >
#{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR},
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR}, #{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},#{protocolId,jdbcType=INTEGER},#{action,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},#{protocolId,jdbcType=INTEGER},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP}, #{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 a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.do_blacklist
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -291,8 +295,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER} AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND ${page.alias}.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} 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>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND ${page.alias}.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND ${page.alias}.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -300,8 +307,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND ${page.alias}.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND ${page.alias}.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND ${page.alias}.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} 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>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND ${page.alias}.SRC_PORT=#{srcPort,jdbcType=VARCHAR} AND ${page.alias}.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -416,8 +426,11 @@
<if test="ipType != null"> <if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER} AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER} AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test="destIpPattern != null">
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR} AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
@@ -425,8 +438,11 @@
<if test="destIpAddress != null and destIpAddress != ''"> <if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR} AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if> </if>
<if test="portPattern != null"> <if test="srcPortPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER} AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test="destPortPattern != null">
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR} AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
@@ -596,8 +612,11 @@
<if test="ipType != null" > <if test="ipType != null" >
IP_TYPE = #{ipType,jdbcType=INTEGER}, IP_TYPE = #{ipType,jdbcType=INTEGER},
</if> </if>
<if test="ipPattern != null"> <if test="srcIpPattern != null">
IP_PATTERN=#{ipPattern,jdbcType=INTEGER}, SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
</if>
<if test="destIpPattern != null">
DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
</if> </if>
<if test="srcIpAddress != null and srcIpAddress != ''"> <if test="srcIpAddress != null and srcIpAddress != ''">
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}, SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
@@ -606,7 +625,7 @@
DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}, DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
</if> </if>
<if test="portPattern != null"> <if test="portPattern != null">
PORT_PATTERN=#{portPattern,jdbcType=INTEGER}, PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
</if> </if>
<if test="srcPort != null and srcPort !=''"> <if test="srcPort != null and srcPort !=''">
SRC_PORT=#{srcPort,jdbcType=VARCHAR}, SRC_PORT=#{srcPort,jdbcType=VARCHAR},
@@ -744,7 +763,8 @@
<select id="getListByCfgIdWithName" resultMap="BaseIpMapWithUser"> <select id="getListByCfgIdWithName" resultMap="BaseIpMapWithUser">
select 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.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.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.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, 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, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -965,8 +983,10 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{destIpPattern,jdbcType=INTEGER},
#{srcPortPattern,jdbcType=INTEGER},
#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -29,7 +29,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" 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 a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,a.do_blacklist
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -384,9 +385,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -417,8 +416,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -359,6 +359,9 @@
</where> </where>
</select> </select>
<insert id="insert" parameterType="com.nis.domain.configuration.PxyObjKeyring" > <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 ( insert into pxy_obj_keyring (
CFG_ID, CFG_ID,
CFG_DESC, CFG_DESC,
@@ -434,6 +437,9 @@
) )
</insert> </insert>
<insert id="insertPxyObjTrustedCaCert" parameterType="com.nis.domain.configuration.PxyObjTrustedCaCert" > <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 ( insert into pxy_obj_trusted_ca_cert (
CFG_ID, CFG_ID,
CFG_DESC, CFG_DESC,

View File

@@ -39,7 +39,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" /> <result column="dest_port" property="destPort" jdbcType="VARCHAR" />
@@ -137,7 +138,7 @@
a.do_blacklist a.do_blacklist
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -567,9 +568,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -605,8 +604,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -29,7 +29,8 @@
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" /> <result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" 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 a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,do_log
</sql> </sql>
<sql id="IpCfg_Column" > <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.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.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, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
@@ -353,9 +354,7 @@
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
ip_type, ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
protocol_id, protocol_id,
@@ -386,8 +385,8 @@
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},

View File

@@ -7,7 +7,8 @@
<id column="host_id" property="hostId" jdbcType="INTEGER" /> <id column="host_id" property="hostId" jdbcType="INTEGER" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" /> <result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" 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="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" /> <result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" 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 id="insert" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
insert into specific_service_host_cfg (spec_service_id,ip_type, insert into specific_service_host_cfg (spec_service_id,ip_type,
src_ip_address, src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
ip_pattern,
port_pattern,
src_port, src_port,
protocol, protocol,
direction, 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) is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time)
values(#{specServiceId},#{ipType,jdbcType=INTEGER}, values(#{specServiceId},#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER}, #{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{direction,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 update specific_service_host_cfg s set
s.spec_service_id = #{specServiceId}, s.spec_service_id = #{specServiceId},
s.IP_TYPE = #{ipType,jdbcType=INTEGER}, 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.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
s.DEST_IP_ADDRESS=#{destIpAddress,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.SRC_PORT=#{srcPort,jdbcType=VARCHAR},
s.DEST_PORT=#{destPort,jdbcType=VARCHAR}, s.DEST_PORT=#{destPort,jdbcType=VARCHAR},
s.direction = #{direction,jdbcType=INTEGER}, s.direction = #{direction,jdbcType=INTEGER},

View File

@@ -34,6 +34,7 @@ import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.CrudDao; import com.nis.web.dao.CrudDao;
import com.nis.web.dao.basics.AsnGroupInfoDao; import com.nis.web.dao.basics.AsnGroupInfoDao;
import com.nis.web.dao.basics.AsnIpCfgDao; 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) { public void save(List<AsnIpCfg> entitys) {
logger.warn("Start to save IP,size:"+entitys.size()); logger.warn("Start to save IP,size:"+entitys.size());
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); // SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
SqlSession batchSqlSession = null; // SqlSession batchSqlSession = null;
try{ // try{
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); // batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
for(AsnIpCfg asnIpCfg:entitys) { // for(AsnIpCfg asnIpCfg:entitys) {
((AsnIpCfgDao) batchSqlSession.getMapper(AsnIpCfgDao.class)).insert(asnIpCfg); // ((AsnIpCfgDao) batchSqlSession.getMapper(AsnIpCfgDao.class)).insert(asnIpCfg);
} // }
batchSqlSession.commit(); // batchSqlSession.commit();
}finally { for(AsnIpCfg asnIpCfg:entitys) {
if(batchSqlSession != null){ asnIpCfgDao.insert(asnIpCfg);
batchSqlSession.close(); }
} // }finally {
} // if(batchSqlSession != null){
// batchSqlSession.close();
// }
// }
long end=System.currentTimeMillis(); long end=System.currentTimeMillis();
logger.warn("Save IP finish,cost:"+(end-start)); logger.warn("Save IP finish,cost:"+(end-start));
} }
@Transactional(readOnly=false,rollbackFor=RuntimeException.class) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void update(AsnIpCfg entity){ public void update(AsnIpCfg entity){
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
Date editTime=new Date(); Date editTime=new Date();
entity.setEditTime(editTime); entity.setEditTime(editTime);
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
@@ -115,6 +123,22 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
entity.setDetail(detail); entity.setDetail(detail);
entity.setCompileId(groupInfo.getCompileId()); entity.setCompileId(groupInfo.getCompileId());
asnIpCfgDao.update(entity); 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) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void processGroup(Map<Long,AsnGroupInfo> asnNoMap){ 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) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveAsnIpCfg(CfgIndexInfo entity) { public void saveAsnIpCfg(CfgIndexInfo entity) {
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
Date createTime=new Date(); Date createTime=new Date();
//asn号 //asn号
String userRegion1=entity.getUserRegion1(); String userRegion1=entity.getUserRegion1();
@@ -308,6 +336,26 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
} }
} }
this.save(entity.getAsnIpCfgs()); 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) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void delete(String ids) { public void delete(String ids) {

View File

@@ -248,7 +248,10 @@ public class AppCfgService extends BaseService {
public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception { public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception {
// 设置区域运营商信息 // 设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) { if (entity.getCfgId() == null) {
Integer compileId = 0; Integer compileId = 0;
try { try {
@@ -302,7 +305,20 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg); 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 { } else {
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date()); entity.setEditTime(new Date());
@@ -356,6 +372,20 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg); 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 { public void saveOrUpdateAppIpCfg(AppIpCfg entity) throws Exception {
// 设置区域运营商信息 // 设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) { if (entity.getCfgId() == null) {
SpecificServiceCfg specificServiceCfg=specificServiceCfgDao.getBySpecServiceId(entity.getSpecServiceId()); SpecificServiceCfg specificServiceCfg=specificServiceCfgDao.getBySpecServiceId(entity.getSpecServiceId());
@@ -429,10 +462,17 @@ public class AppCfgService extends BaseService {
BeanUtils.copyProperties(entity, cfg, BeanUtils.copyProperties(entity, cfg,
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective", new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective",
"areaEffectiveIds", "protocol", "portPattern", "srcPort", "destPort", "areaEffectiveIds", "protocol", "portPattern", "srcPort", "destPort",
"direction", "destIpAddress", "srcIpAddress", "ipPattern" }); "direction", "destIpAddress", "srcIpAddress", "srcIpPattern", "destIpPattern" });
areaIpCfgDao.saveAreaIpCfg(cfg); 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 { } else {
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date()); entity.setEditTime(new Date());
@@ -453,10 +493,20 @@ public class AppCfgService extends BaseService {
BeanUtils.copyProperties(entity, cfg, BeanUtils.copyProperties(entity, cfg,
new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective", "areaEffectiveIds", new String[] { "cfgRegionCode", "cfgType", "ipType", "isAreaEffective", "areaEffectiveIds",
"protocol", "portPattern", "srcPort", "destPort", "direction", "destIpAddress", "protocol", "portPattern", "srcPort", "destPort", "direction", "destIpAddress",
"srcIpAddress", "ipPattern" }); "srcIpAddress", "srcIpPattern", "destIpPattern" });
areaIpCfgDao.saveAreaIpCfg(cfg); 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) { public void saveAppHttpCfg(List<ComplexkeywordCfg> cfgs) {
@@ -538,7 +588,10 @@ public class AppCfgService extends BaseService {
public void saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception { public void saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception {
// 设置区域运营商信息 // 设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) { if (entity.getCfgId() == null) {
Integer compileId = 0; Integer compileId = 0;
try { try {
@@ -565,6 +618,11 @@ public class AppCfgService extends BaseService {
logger.info("获取编译ID出错"); logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage()); throw new MaatConvertException(e.getMessage());
} }
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else { } else {
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date()); entity.setEditTime(new Date());
@@ -586,6 +644,11 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg); 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 { public void saveOrUpdateAppTopicDomainCfg(AppTopicDomainCfg entity) throws Exception {
// 设置区域运营商信息 // 设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) { if (entity.getCfgId() == null) {
Integer compileId = 0; Integer compileId = 0;
try { try {
@@ -620,6 +686,11 @@ public class AppCfgService extends BaseService {
logger.info("获取编译ID出错"); logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage()); throw new MaatConvertException(e.getMessage());
} }
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else { } else {
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date()); entity.setEditTime(new Date());
@@ -641,6 +712,11 @@ public class AppCfgService extends BaseService {
areaIpCfgDao.saveAreaIpCfg(cfg); 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(); String configType = entity.getConfigType();
ToMaatBean maatBean = new ToMaatBean(); ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg(); MaatCfg maatCfg = new MaatCfg();
@@ -1036,7 +1115,7 @@ public class AppCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime()); maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION); maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据 // 调用服务接口下发配置数据
String json = gsonToJson(maatBean); String json = gsonToJson(maatBean);
logger.info("app策略配置下发配置参数" + json); logger.info("app策略配置下发配置参数" + json);
@@ -1164,6 +1243,12 @@ public class AppCfgService extends BaseService {
} }
} }
public void auditAppIpCfg(List<AppIpCfg> entitys, Integer isAudit) { 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(); MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList(); List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = 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(); ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg(); MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList(); List<MaatCfg> configCompileList = new ArrayList();
@@ -1441,7 +1529,7 @@ public class AppCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime()); maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION); maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据 // 调用服务接口下发配置数据
String json = gsonToJson(maatBean); String json = gsonToJson(maatBean);
logger.info("app域名配置下发配置参数" + json); logger.info("app域名配置下发配置参数" + json);
@@ -1469,7 +1557,10 @@ public class AppCfgService extends BaseService {
} }
// app主题网站配置审核 // 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(); ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg(); MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList(); List<MaatCfg> configCompileList = new ArrayList();
@@ -1536,7 +1627,7 @@ public class AppCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime()); maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION); maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据 // 调用服务接口下发配置数据
String json = gsonToJson(maatBean); String json = gsonToJson(maatBean);
logger.info("app主题网站配置下发配置参数" + json); logger.info("app主题网站配置下发配置参数" + json);

View File

@@ -78,6 +78,10 @@ public class AppMultiFeatureCfgService extends BaseService {
//新增或保存复杂特征配置 //新增或保存复杂特征配置
@Transactional(readOnly = false, rollbackFor = RuntimeException.class) @Transactional(readOnly = false, rollbackFor = RuntimeException.class)
public void saveOrUpdateAppFeatureCfg(AppFeatureIndex entity) throws Exception { public void saveOrUpdateAppFeatureCfg(AppFeatureIndex entity) throws Exception {
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if (entity.getCfgId() == null) { if (entity.getCfgId() == null) {
Integer compileId = 0; Integer compileId = 0;
try { try {
@@ -166,6 +170,11 @@ public class AppMultiFeatureCfgService extends BaseService {
logger.info("获取编译ID出错"); logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage()); throw new MaatConvertException(e.getMessage());
} }
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
}
} else { } else {
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date()); 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); 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(); ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg(); MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList(); List<MaatCfg> configCompileList = new ArrayList();
@@ -421,7 +439,7 @@ public class AppMultiFeatureCfgService extends BaseService {
maatBean.setAuditTime(entity.getAuditTime()); maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION); maatBean.setOpAction(opAction);
// 调用服务接口下发配置数据 // 调用服务接口下发配置数据
String json = gsonToJson(maatBean); String json = gsonToJson(maatBean);
logger.info("app 特征配置下发配置参数:" + json); logger.info("app 特征配置下发配置参数:" + json);

View File

@@ -255,7 +255,6 @@ public class AvContentCfgService extends BaseService{
auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION); auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
} }
}else{ }else{
entity.setEditTime(new Date()); entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
@@ -534,7 +533,6 @@ public class AvContentCfgService extends BaseService{
} }
} }
//构造提交综合服务参数格式,一条配置提交一次综合服务 //构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){ if(isAudit==1){
maatCfg.initDefaultValue(); maatCfg.initDefaultValue();
@@ -772,9 +770,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode" BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType" ,"cfgType"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -812,9 +812,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType" ,"cfgType"
,"cfgId" ,"cfgId"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -829,9 +831,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode" BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType" ,"cfgType"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -936,9 +940,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType" ,"cfgType"
,"cfgId" ,"cfgId"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -1111,9 +1117,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode" BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType" ,"cfgType"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -1151,9 +1159,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType" ,"cfgType"
,"cfgId" ,"cfgId"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -1168,9 +1178,11 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode" BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType" ,"cfgType"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"
@@ -1275,9 +1287,11 @@ public class AvContentCfgService extends BaseService{
,"cfgType" ,"cfgType"
,"cfgId" ,"cfgId"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"

View File

@@ -71,10 +71,14 @@ public class DdosCfgService extends BaseService{
return ddosCfgDao.getDdosIpCfg(cfgId,compileId); return ddosCfgDao.getDdosIpCfg(cfgId,compileId);
} }
@Transactional(readOnly=false,rollbackFor=RuntimeException.class) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(DdosIpCfg entity){ public void saveOrUpdate(DdosIpCfg entity) throws Exception{
Date createTime=new Date(); Date createTime=new Date();
//设置区域运营商信息 //设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
String antiddosProtocol = entity.getAntiddosProtocol(); String antiddosProtocol = entity.getAntiddosProtocol();
Long bpsThreadshold = entity.getBpsThreadshold(); Long bpsThreadshold = entity.getBpsThreadshold();
Long ppsThreadshold = entity.getPpsThreadshold(); Long ppsThreadshold = entity.getPpsThreadshold();
@@ -116,7 +120,11 @@ public class DdosCfgService extends BaseService{
}else { }else {
throw new RuntimeException("Could not get compileId!"); 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{ }else{
Date editTime=new Date(); Date editTime=new Date();
@@ -126,6 +134,11 @@ public class DdosCfgService extends BaseService{
entity.setEditTime(editTime); entity.setEditTime(editTime);
ddosCfgDao.update(entity); 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) @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(); DdosIpCfg entity = new DdosIpCfg();
entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId()); entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId());
@@ -308,7 +321,7 @@ public class DdosCfgService extends BaseService{
maatBean.setAuditTime(auditTime); maatBean.setAuditTime(auditTime);
maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION); maatBean.setOpAction(opAction);
//调用服务接口下发配置数据 //调用服务接口下发配置数据
String json=gsonToJson(maatBean); String json=gsonToJson(maatBean);
logger.info("ddos 配置下发配置参数:"+json); logger.info("ddos 配置下发配置参数:"+json);

View File

@@ -22,6 +22,7 @@ import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.DnsIpCfgDao; import com.nis.web.dao.configuration.DnsIpCfgDao;
import com.nis.web.security.UserUtils; import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService; import com.nis.web.service.BaseService;
@@ -64,6 +65,10 @@ public class DnsIpCfgService extends BaseService{
Date createTime=new Date(); Date createTime=new Date();
//设置区域运营商信息 //设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
//新增 //新增
if(entity.getCfgId()==null){ if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId()); entity.setCreatorId(UserUtils.getUser().getId());
@@ -102,6 +107,11 @@ public class DnsIpCfgService extends BaseService{
entity.setEditTime(editTime); entity.setEditTime(editTime);
dnsIpCfgDao.update(entity); 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.setFunctionId(401);
dnsIp.setCfgRegionCode(1); dnsIp.setCfgRegionCode(1);
dnsIp.setCfgType("dns_fake_ip"); dnsIp.setCfgType("dns_fake_ip");
dnsIp.setIpPattern(3); dnsIp.setSrcIpPattern(3);
dnsIp.setDestIpPattern(3);
dnsIp.setSrcIpAddress("0.0.0.0"); dnsIp.setSrcIpAddress("0.0.0.0");
dnsIp.setDestPort("0"); dnsIp.setDestPort("0");
dnsIp.setSrcPort("0"); dnsIp.setSrcPort("0");
dnsIp.setPortPattern(1); dnsIp.setSrcPortPattern(1);
dnsIp.setDestPortPattern(1);
dnsIp.setDnsStrategyId(0); dnsIp.setDnsStrategyId(0);
dnsIp.setAction(16); dnsIp.setAction(16);
dnsIp.setServiceId(64); dnsIp.setServiceId(64);

View File

@@ -19,6 +19,7 @@ import com.nis.domain.configuration.DnsResStrategy;
import com.nis.domain.maat.ToMaatResult; import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.DnsResStrategyDao; import com.nis.web.dao.configuration.DnsResStrategyDao;
import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.configuration.StringCfgDao;
@@ -86,6 +87,10 @@ public class DnsResStrategyService extends BaseService{
public void saveOrUpdate(DnsResStrategy entity){ public void saveOrUpdate(DnsResStrategy entity){
Date createTime=new Date(); Date createTime=new Date();
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
List<DnsResStrategy> list = new ArrayList<DnsResStrategy>(); List<DnsResStrategy> list = new ArrayList<DnsResStrategy>();
if( entity.getCfgId()!=null && !"".equals(entity.getCfgId())){ if( entity.getCfgId()!=null && !"".equals(entity.getCfgId())){
list=dnsResStrategyDao.findList(entity.getCfgId(),null,null); list=dnsResStrategyDao.findList(entity.getCfgId(),null,null);
@@ -112,6 +117,11 @@ public class DnsResStrategyService extends BaseService{
} }
} }
dnsResStrategyDao.insert(entity); 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{ }else{
Date editTime=new Date(); Date editTime=new Date();
@@ -121,6 +131,11 @@ public class DnsResStrategyService extends BaseService{
entity.setEditTime(editTime); entity.setEditTime(editTime);
dnsResStrategyDao.update(entity); 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.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid); cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit); cfg.setIsAudit(isAudit);
cfg.setEditTime(auditTime); // cfg.setEditTime(auditTime);
cfg.setEditorId(UserUtils.getUser().getId()); // cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime); cfg.setAuditTime(auditTime);
dnsResStrategyDao.update(cfg); dnsResStrategyDao.update(cfg);

View File

@@ -76,7 +76,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
c.initDefaultValue(); c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction", BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode", "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.setTableName(AreaIpCfg.getTablename());
} }
this.saveIpBatch(cfg.getAreaCfg()); this.saveIpBatch(cfg.getAreaCfg());
@@ -106,7 +106,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
c.initDefaultValue(); c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction", BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode", "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.setTableName(AreaIpCfg.getTablename());
c.setCreatorId(cfg.getCurrentUser().getId()); c.setCreatorId(cfg.getCurrentUser().getId());
c.setCreateTime(date); c.setCreateTime(date);
@@ -202,9 +202,11 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
,"cfgType" ,"cfgType"
,"cfgId" ,"cfgId"
,"ipType" ,"ipType"
,"ipPattern" ,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress" ,"srcIpAddress"
,"portPattern" ,"srcPortPattern"
,"destPortPattern"
,"srcPort" ,"srcPort"
,"destPort" ,"destPort"
,"protocol" ,"protocol"

View File

@@ -1,14 +1,11 @@
package com.nis.web.service.configuration; package com.nis.web.service.configuration;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -16,14 +13,12 @@ import org.springframework.transaction.annotation.Transactional;
import com.beust.jcommander.internal.Lists; import com.beust.jcommander.internal.Lists;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.DdosIpCfg;
import com.nis.domain.configuration.IpReuseDnatPolicyCfg; import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
import com.nis.domain.configuration.IpReusePolicyCfg; import com.nis.domain.configuration.IpReusePolicyCfg;
import com.nis.domain.maat.ToMaatResult; import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.StringUtils;
import com.nis.web.dao.configuration.IpMultiplexDao; import com.nis.web.dao.configuration.IpMultiplexDao;
import com.nis.web.security.UserUtils; import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService; import com.nis.web.service.BaseService;

View File

@@ -20,6 +20,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl;
import com.nis.domain.maat.ToMaatResult; import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.dao.basics.ServiceDictInfoDao; import com.nis.web.dao.basics.ServiceDictInfoDao;
import com.nis.web.dao.configuration.PxyObjKeyringDao; import com.nis.web.dao.configuration.PxyObjKeyringDao;
@@ -100,6 +101,10 @@ public class PxyObjKeyringService extends BaseService{
public void saveOrUpdate(PxyObjKeyring entity){ public void saveOrUpdate(PxyObjKeyring entity){
Date createTime=new Date(); Date createTime=new Date();
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0); entity.setIsValid(0);
entity.setIsAudit(0); entity.setIsAudit(0);
//新增 //新增
@@ -128,11 +133,21 @@ public class PxyObjKeyringService extends BaseService{
pxyObjKeyringDao.update(entity); 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) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity){ public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity) throws InterruptedException{
Date createTime=new Date(); Date createTime=new Date();
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0); entity.setIsValid(0);
entity.setIsAudit(0); entity.setIsAudit(0);
//新增 //新增
@@ -162,11 +177,16 @@ public class PxyObjKeyringService extends BaseService{
//修改主表cert配置时需要修改子表crl配置信息 //修改主表cert配置时需要修改子表crl配置信息
PxyObjTrustedCaCrl crlCfg =new PxyObjTrustedCaCrl(); PxyObjTrustedCaCrl crlCfg =new PxyObjTrustedCaCrl();
BeanUtils.copyProperties(entity, crlCfg, new String[]{"cfgId","serviceId","compileId","cfgType"}); BeanUtils.copyProperties(entity, crlCfg, new String[]{"cfgId","serviceId","compileId","cfgType"});
entity=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId()); PxyObjTrustedCaCert cert=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId());
crlCfg.setCertId(entity.getCompileId()); crlCfg.setCertId(cert.getCompileId());
pxyObjKeyringDao.updatePxyObjTrustedCaCrl(crlCfg); 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) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void trustedCrlsaveOrUpdate(PxyObjTrustedCaCrl entity){ public void trustedCrlsaveOrUpdate(PxyObjTrustedCaCrl entity){
@@ -320,8 +340,8 @@ public class PxyObjKeyringService extends BaseService{
cfg.setCfgId(Long.valueOf(id)); cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid); cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit); cfg.setIsAudit(isAudit);
cfg.setEditTime(auditTime); // cfg.setEditTime(auditTime);
cfg.setEditorId(UserUtils.getUser().getId()); // cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime); cfg.setAuditTime(auditTime);
pxyObjKeyringDao.update(cfg); pxyObjKeyringDao.update(cfg);
@@ -402,8 +422,8 @@ public class PxyObjKeyringService extends BaseService{
cfg.setCfgId(Long.valueOf(id)); cfg.setCfgId(Long.valueOf(id));
cfg.setIsValid(isValid); cfg.setIsValid(isValid);
cfg.setIsAudit(isAudit); cfg.setIsAudit(isAudit);
cfg.setEditTime(auditTime); // cfg.setEditTime(auditTime);
cfg.setEditorId(UserUtils.getUser().getId()); // cfg.setEditorId(UserUtils.getUser().getId());
cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditorId(UserUtils.getUser().getId());
cfg.setAuditTime(auditTime); cfg.setAuditTime(auditTime);
//修改主表cert 配置状态 //修改主表cert 配置状态

View File

@@ -17,7 +17,6 @@ import com.nis.domain.Page;
import com.nis.domain.SysUser; import com.nis.domain.SysUser;
import com.nis.domain.specific.SpecificServiceCfg; import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.domain.specific.SpecificServiceHostCfg; import com.nis.domain.specific.SpecificServiceHostCfg;
import com.nis.util.BasicProvingUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.dao.specific.SpecificServiceHostCfgDao; import com.nis.web.dao.specific.SpecificServiceHostCfgDao;
import com.nis.web.security.UserUtils; import com.nis.web.security.UserUtils;
@@ -58,45 +57,66 @@ public class SpecificServiceHostCfgService extends BaseService{
@Transactional(readOnly=false,rollbackFor=RuntimeException.class) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) { public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) {
SysUser user = UserUtils.getUser(); 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.getIpType().equals(4)){
if(specificServiceHostCfg.getIpPattern()==1){ if(specificServiceHostCfg.getSrcIpPattern()==1){
defaultIp = "0.0.0.0/32"; //0.0.0.0表示任意 defaultSrcIp = "0.0.0.0/32"; //0.0.0.0表示任意
}else if(specificServiceHostCfg.getIpPattern()==2){ }else if(specificServiceHostCfg.getSrcIpPattern()==2){
defaultIp = "0.0.0.0-0.0.0.0"; defaultSrcIp = "0.0.0.0-0.0.0.0";
}else{ }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.getIpType().equals(6)){
if(specificServiceHostCfg.getIpPattern()==1){ if(specificServiceHostCfg.getSrcIpPattern()==1){
defaultIp = "::/64"; defaultSrcIp = "::/64";
}else if(specificServiceHostCfg.getIpPattern()==2){ }else if(specificServiceHostCfg.getSrcIpPattern()==2){
defaultIp = "::-::"; defaultSrcIp = "::-::";
}else{ }else{
defaultIp = "::"; defaultSrcIp = "::";
}
if(specificServiceHostCfg.getDestIpPattern()==1){
defaultDestIp = "::/64";
}else if(specificServiceHostCfg.getDestIpPattern()==2){
defaultDestIp = "::-::";
}else{
defaultDestIp = "::";
} }
} }
String defaultPort = "0"; //0表示任意 String defaultSrcPort = "0"; //0表示任意
if(specificServiceHostCfg.getPortPattern().equals(1)){ String defaultDestPort = "0"; //0表示任意
defaultPort = "0"; if(specificServiceHostCfg.getSrcPortPattern().equals(1)){
defaultSrcPort = "0";
}else{ }else{
defaultPort = "0/0"; defaultSrcPort = "0/0";
}
if(specificServiceHostCfg.getDestPortPattern().equals(1)){
defaultDestPort = "0";
}else{
defaultDestPort = "0/0";
} }
//ip地址默认 缺省0.0.0.0值表示任意 //ip地址默认 缺省0.0.0.0值表示任意
if(StringUtil.isBlank(specificServiceHostCfg.getSrcIpAddress())){ if(StringUtil.isBlank(specificServiceHostCfg.getSrcIpAddress())){
specificServiceHostCfg.setSrcIpAddress(defaultIp); specificServiceHostCfg.setSrcIpAddress(defaultSrcIp);
} }
if(StringUtil.isBlank(specificServiceHostCfg.getDestIpAddress())){ if(StringUtil.isBlank(specificServiceHostCfg.getDestIpAddress())){
specificServiceHostCfg.setDestIpAddress(defaultIp); specificServiceHostCfg.setDestIpAddress(defaultDestIp);
} }
//端口掩码默认 //端口掩码默认
if(StringUtil.isBlank(specificServiceHostCfg.getSrcPort())){ if(StringUtil.isBlank(specificServiceHostCfg.getSrcPort())){
specificServiceHostCfg.setSrcPort(defaultPort); specificServiceHostCfg.setSrcPort(defaultSrcPort);
} }
if(StringUtil.isBlank(specificServiceHostCfg.getDestPort())){ if(StringUtil.isBlank(specificServiceHostCfg.getDestPort())){
specificServiceHostCfg.setDestPort(defaultPort); specificServiceHostCfg.setDestPort(defaultDestPort);
} }
//方向缺省 //方向缺省
if(specificServiceHostCfg.getDirection()==null){ if(specificServiceHostCfg.getDirection()==null){

View File

@@ -31,20 +31,24 @@ public class MaatCfgConverTest {
ToMaatBean maat = new ToMaatBean(); ToMaatBean maat = new ToMaatBean();
BaseStringCfg str = new BaseStringCfg(); BaseStringCfg str = new BaseStringCfg();
BaseIpCfg ip = new BaseIpCfg(); BaseIpCfg ip = new BaseIpCfg();
ip.setIpPattern(1); ip.setSrcIpPattern(1);
ip.setDestIpPattern(1);
ip.setIpType(4); ip.setIpType(4);
ip.setSrcIpAddress("192.168.10.0/24"); ip.setSrcIpAddress("192.168.10.0/24");
ip.setPortPattern(2); ip.setSrcPortPattern(2);
ip.setDestPortPattern(2);
ip.setSrcPort("8080-8089"); ip.setSrcPort("8080-8089");
ip.setCompileId(123); ip.setCompileId(123);
ip.setProtocol(6); ip.setProtocol(6);
ip.setDirection(2); ip.setDirection(2);
ipList.add(ip); ipList.add(ip);
ip = new BaseIpCfg(); ip = new BaseIpCfg();
ip.setIpPattern(2); ip.setSrcIpPattern(2);
ip.setDestIpPattern(2);
ip.setIpType(4); ip.setIpType(4);
ip.setSrcIpAddress("10.0.6.0-10.0.6.100"); ip.setSrcIpAddress("10.0.6.0-10.0.6.100");
ip.setPortPattern(1); ip.setSrcPortPattern(1);
ip.setDestPortPattern(1);
ip.setSrcPort("7080/65534"); ip.setSrcPort("7080/65534");
ip.setCompileId(124); ip.setCompileId(124);
ip.setDirection(1); ip.setDirection(1);
@@ -67,17 +71,17 @@ public class MaatCfgConverTest {
for(BaseIpCfg c:ipList){ for(BaseIpCfg c:ipList){
IpCfg ipCfg = new IpCfg(); IpCfg ipCfg = new IpCfg();
ipCfg.setRegionId(regionId); ipCfg.setRegionId(regionId);
if(c.getIpPattern()==1){ if(c.getSrcIpPattern()==1){
ipCfg.setSrcIp(c.getSrcIpAddress().split("/")[0]); ipCfg.setSrcIp(c.getSrcIpAddress().split("/")[0]);
ipCfg.setSrcIpMask(IpUtil.convertMask(Integer.parseInt(c.getSrcIpAddress().split("/")[1]))); 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.setSrcIp(c.getSrcIpAddress().split("-")[0]);
ipCfg.setSrcIpMask(IpUtil.getMask(c.getSrcIpAddress().split("-")[0], c.getSrcIpAddress().split("-")[1])); 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.setSrcPort(c.getSrcPort().split("/")[0]);
ipCfg.setSrcPortMask(c.getSrcPort().split("/")[1]); ipCfg.setSrcPortMask(c.getSrcPort().split("/")[1]);
}else if(c.getPortPattern()==2){ }else if(c.getSrcPortPattern()==2){
ipCfg.setSrcPort(c.getSrcPort().split("-")[0]); ipCfg.setSrcPort(c.getSrcPort().split("-")[0]);
Integer portMask = Integer.parseInt(c.getSrcPort().split("-")[1])-Integer.parseInt(c.getSrcPort().split("-")[0]); Integer portMask = Integer.parseInt(c.getSrcPort().split("-")[1])-Integer.parseInt(c.getSrcPort().split("-")[0]);
ipCfg.setSrcPortMask(portMask.toString()); ipCfg.setSrcPortMask(portMask.toString());

View File

@@ -1509,4 +1509,10 @@ interface_total=Interface Total
service_total=Service Total service_total=Service Total
unapproved_all=UnApprove all configurations! unapproved_all=UnApprove all configurations!
delete_all=Delete all configurations! delete_all=Delete all configurations!
none_file_tip=Please Choose 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

View File

@@ -1512,4 +1512,10 @@ effective=Effective
admin_user_warn=Admin User Warn admin_user_warn=Admin User Warn
interface_total=Interface Total interface_total=Interface Total
service_total=Service Total service_total=Service Total
none_file_tip=Please Choose 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

View File

@@ -0,0 +1,104 @@
--#function_region_dict 对应ip_patternport_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_patternport_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`)

View File

@@ -10,7 +10,36 @@
<div class="row ipInfo"> <div class="row ipInfo">
<div class="row"> <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"> <div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
<div class="col-md-6"> <div class="col-md-6">
@@ -30,33 +59,67 @@
<div for="ipType"></div> <div for="ipType"></div>
</div> </div>
</div> </div>
<div class="col-md-6"> </div>
<div class="form-group "> <div class="row ipCol">
<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 class="col-md-6"> <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="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"> <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"> <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> </c:forEach>
</select> </select>
</div> </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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</div>
<div for="srcIpAddress"></div>
</div>
</div>
</div>
<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="src_port_pattern"/></label>
<div class="col-md-6">
<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="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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
</div>
<div for="srcPort"></div>
</div>
</div>
</div>
<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_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> </div>
<div class="col-md-6"> <div class="col-md-6">
@@ -69,25 +132,18 @@
</div> </div>
</div> </div>
</div> </div>
<c:choose> <div class="row hidden ipCol">
<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="col-md-6"> <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="port_pattern"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
<div class="col-md-6"> <div class="col-md-6">
<select name="portPattern" class="selectpicker show-tick form-control required"> <select name="destPortPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
<div for="portPattern"></div> <div for="destPortPattern"></div>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@@ -100,49 +156,8 @@
</div> </div>
</div> </div>
</div> </div>
<c:choose> <div class="row">
<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="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>
<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> <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="col-md-6">
<div class="form-group">
<div class="col-md-6">
<input type="hidden" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<div class="col-md-6">
<input type="hidden" name="srcPort" value="${_cfg.srcPort}">
</div>
</div>
</div>
</div> </div>
</div> </div>
</c:if> </c:if>

View File

@@ -6,8 +6,8 @@
<script type="text/javascript"> <script type="text/javascript">
var defaultIpInfo; var defaultIpInfo;
$(function(){ $(function(){
$("input[name$='destPort']").parents(".form-group").addClass("hidden"); //$("input[name$='destPort']").parents(".form-group").addClass("hidden");
$("select[name$='portPattern']").parents(".form-group").addClass("hidden"); //$("select[name$='portPattern']").parents(".form-group").addClass("hidden");
$("select[name$='protocol']").parents(".form-group").addClass("hidden"); $("select[name$='protocol']").parents(".form-group").addClass("hidden");
$("select[name$='direction']").parents(".form-group").addClass("hidden"); $("select[name$='direction']").parents(".form-group").addClass("hidden");
defaultIpInfo=$(".ipInfo").clone(); defaultIpInfo=$(".ipInfo").clone();
@@ -93,7 +93,7 @@ var addContent = function(obj, contentClassName) {
$("select[name$='ipType']").on("change",function(){ $("select[name$='ipType']").on("change",function(){
switchIpInfo(this); switchIpInfo(this);
}); });
$("select[name$='ipPattern']").on("change",function(){ $("select[name$='IpPattern']").on("change",function(){
switchIpInfo(this); switchIpInfo(this);
}); });
} }
@@ -152,6 +152,8 @@ var reSort=function(obj,index){
<input type="hidden" id="compileId" name="compileId" value="0"> <input type="hidden" id="compileId" name="compileId" value="0">
<input type="hidden" id="requestId" name="requestId" value="0"> <input type="hidden" id="requestId" name="requestId" value="0">
<input type="hidden" id="asnIpGroup" name="asnIpGroup" 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"> <c:forEach items="${serviceList}" var="service">
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}"> <input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
<input type="hidden" id="action" name="action" value="${service.action}"> <input type="hidden" id="action" name="action" value="${service.action}">
@@ -165,8 +167,10 @@ var reSort=function(obj,index){
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -263,96 +267,6 @@ var reSort=function(obj,index){
onClick="delContent(this,'ipInfo');" /> onClick="delContent(this,'ipInfo');" />
</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">
<select name="asnIpCfgs[0].ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}"
<c:if test="${_cfg.asnIpCfgs[0].ipType==ipTypeC.itemCode
|| (_cfg.asnIpCfgs[0].ipType==null && ipTypeC.itemCode==4)}">
selected
</c:if>
>
<spring:message code="${ipTypeC.itemValue}"/>
</option>
</c:forEach>
</select>
</div>
<div for="asnIpCfgs[0].ipType"></div>
</div>
</div>
</div>
<div class="row ip">
<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].ipPattern" 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>
</c:forEach>
</select>
</div>
<div for="asnIpCfgs[0].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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="asnIpCfgs[0].srcIpAddress" value="${_cfg.asnIpCfgs[0].srcIpAddress}">
</div>
<div for="asnIpCfgs[0].srcIpAddress"></div>
</div>
</div>
</div>
<div class="row port">
<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">
<select name="asnIpCfgs[0].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.asnIpCfgs[0].portPattern==portPatternC.itemCode || (_cfg.asnIpCfgs[0].portPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="asnIpCfgs[0].portPattern"></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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="asnIpCfgs[0].srcPort" value="${_cfg.asnIpCfgs[0].srcPort}">
</div>
<div for="asnIpCfgs[0].srcPort"></div>
</div>
</div>
</div>
<div class="row destPort">
<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="asnIpCfgs[0].destIpAddress" value="${_cfg.asnIpCfgs[0].destIpAddress}">
</div>
<div for="asnIpCfgs[0].destIpAddress"></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="asnIpCfgs[0].destPort" value="${_cfg.asnIpCfgs[0].destPort}">
</div>
<div for="asnIpCfgs[0].destPort"></div>
</div>
</div>
</div>
<div class="row protocol"> <div class="row protocol">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group "> <div class="form-group ">
@@ -385,6 +299,125 @@ var reSort=function(obj,index){
</div> </div>
</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">
<select name="asnIpCfgs[0].ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}"
<c:if test="${_cfg.asnIpCfgs[0].ipType==ipTypeC.itemCode
|| (_cfg.asnIpCfgs[0].ipType==null && ipTypeC.itemCode==4)}">
selected
</c:if>
>
<spring:message code="${ipTypeC.itemValue}"/>
</option>
</c:forEach>
</select>
</div>
<div for="asnIpCfgs[0].ipType"></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="src_ip_pattern"/></label>
<div class="col-md-6">
<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].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].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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="asnIpCfgs[0].srcIpAddress" value="${_cfg.asnIpCfgs[0].srcIpAddress}">
</div>
<div for="asnIpCfgs[0].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="src_port_pattern"/></label>
<div class="col-md-6">
<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].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].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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="asnIpCfgs[0].srcPort" value="${_cfg.asnIpCfgs[0].srcPort}">
</div>
<div for="asnIpCfgs[0].srcPort"></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_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>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="asnIpCfgs[0].destIpAddress" value="${_cfg.asnIpCfgs[0].destIpAddress}">
</div>
<div for="asnIpCfgs[0].destIpAddress"></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="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">
<input class="form-control required portCheck" type="text" name="asnIpCfgs[0].destPort" value="${_cfg.asnIpCfgs[0].destPort}">
</div>
<div for="asnIpCfgs[0].destPort"></div>
</div>
</div>
</div>
<%-- <div class="row"> <%-- <div class="row">
<button type="button" class="btn btn-red-hollow center-block" <button type="button" class="btn btn-red-hollow center-block"
onClick="more(this);" data-click-times="0"> onClick="more(this);" data-click-times="0">
@@ -398,7 +431,23 @@ var reSort=function(obj,index){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -5,8 +5,8 @@
<title><spring:message code="asn_ip_configuration"></spring:message></title> <title><spring:message code="asn_ip_configuration"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("input[name='destPort']").parents(".form-group").addClass("hidden"); //$("input[name='destPort']").parents(".form-group").addClass("hidden");
$("select[name='portPattern']").parents(".form-group").addClass("hidden"); //$("select[name='portPattern']").parents(".form-group").addClass("hidden");
$("select[name='protocol']").parents(".form-group").addClass("hidden"); $("select[name='protocol']").parents(".form-group").addClass("hidden");
$("select[name='direction']").parents(".form-group").addClass("hidden"); $("select[name='direction']").parents(".form-group").addClass("hidden");
$("#cfgFrom").validate({ $("#cfgFrom").validate({
@@ -97,10 +97,17 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<c:if test="${_cfg.isAudit ne 1}"> <c:choose>
<input type="hidden" name="isValid" value="0"> <c:when test="${_cfg.isAudit ne 1}">
<input type="hidden" name="isAudit" value="0"> <input type="hidden" name="isValid" value="0">
</c:if> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0"> <input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}"> <input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
@@ -115,8 +122,10 @@ $(function(){
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -211,97 +220,7 @@ $(function(){
<!-- desc and action --> <!-- desc and action -->
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%> <%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
<div class="row ipInfo"> <div class="row ipInfo">
<div class="row"> <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">
<select name="ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('WHITELIST_IPTYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}"
<c:if test="${_cfg.ipType==ipTypeC.itemCode
|| (_cfg.ipType==null && ipTypeC.itemCode==4)}">
selected
</c:if>
>
<spring:message code="${ipTypeC.itemValue}"/>
</option>
</c:forEach>
</select>
</div>
<div for="ipType"></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_pattern"/></label>
<div class="col-md-6">
<select name="ipPattern" 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>
</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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</div>
<div for="srcIpAddress"></div>
</div>
</div>
</div>
<div class="row port">
<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">
<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>
</div>
<div for="portPattern"></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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
</div>
<div for="srcPort"></div>
</div>
</div>
</div>
<div class="row destPort">
<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 ">
<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 class="row protocol">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group "> <div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font> <label class="control-label col-md-3"><font color="red">*</font>
@@ -333,6 +252,124 @@ $(function(){
</div> </div>
</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">
<select name="ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('WHITELIST_IPTYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}"
<c:if test="${_cfg.ipType==ipTypeC.itemCode
|| (_cfg.ipType==null && ipTypeC.itemCode==4)}">
selected
</c:if>
>
<spring:message code="${ipTypeC.itemValue}"/>
</option>
</c:forEach>
</select>
</div>
<div for="ipType"></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="src_ip_pattern"/></label>
<div class="col-md-6">
<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.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>
</div>
<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">
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</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="src_port_pattern"/></label>
<div class="col-md-6">
<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="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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
</div>
<div for="srcPort"></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="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>
<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>
<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 class="row"> <%-- <div class="row">
<button type="button" class="btn btn-red-hollow center-block" <button type="button" class="btn btn-red-hollow center-block"
onClick="more(this);" data-click-times="0"> onClick="more(this);" data-click-times="0">
@@ -347,7 +384,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -338,7 +338,7 @@
<%-- <td>${cfg.destPort }</td> --%> <%-- <td>${cfg.destPort }</td> --%>
<td> <td>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</td> </td>
<%-- <td> <%-- <td>

View File

@@ -19,6 +19,26 @@ $(function(){
}, },
errorContainer: "#messageBox", 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> </script>
</head> </head>
@@ -46,15 +66,6 @@ $(function(){
<input type="hidden" name="proId" value="${_cfg.proId}"> <input type="hidden" name="proId" value="${_cfg.proId}">
<div class="form-body"> <div class="form-body">
<div class="row"> <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="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="type"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="type"/></label>
@@ -70,6 +81,15 @@ $(function(){
<div for="targetType"></div> <div for="targetType"></div>
</div> </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>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">

View File

@@ -216,8 +216,8 @@
<thead> <thead>
<tr> <tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th> <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="targetType" ><spring:message code="type"/></th>
<th column="keyword" ><spring:message code="keywords"/></th>
<th column="desc" ><spring:message code="desc"/></th> <th column="desc" ><spring:message code="desc"/></th>
<th column="creator" ><spring:message code="creator"/></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> <th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
@@ -229,17 +229,17 @@
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1"> <c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr> <tr>
<td><input type="checkbox" class="i-checks child-checks" id="${cfg.proId}"></td> <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> <td>
<a href="javascript:;" data-original-title="${cfg.keyword}" <a href="javascript:;" data-original-title="${cfg.keyword}"
class="tooltips" data-flag="false" data-html="true" data-placement="top"> class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(cfg.keyword,20)} ${fns:abbr(cfg.keyword,20)}
</a> </a>
</td> </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 title="${cfg.description }">${fns:abbr(cfg.description,20)}</td>
<td>${cfg.creatorName }</td> <td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td> <td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>

View File

@@ -66,6 +66,8 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
@@ -378,7 +380,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -47,6 +47,8 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
@@ -59,8 +61,10 @@ $(function(){
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -134,33 +138,18 @@ $(function(){
<div class="row"> <div class="row">
<div class="col-md-6"> <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="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"> <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"> <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> </c:forEach>
</select> </select>
</div> </div>
<div for="ipPattern"></div> <div for="srcIpPattern"></div>
</div> </div>
</div> </div>
<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="port_pattern"/></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>
</div>
<div for="portPattern"></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="client_ip"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
<div class="col-md-6"> <div class="col-md-6">
@@ -169,6 +158,21 @@ $(function(){
<div for="srcIpAddress"></div> <div for="srcIpAddress"></div>
</div> </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="src_port_pattern"/></label>
<div class="col-md-6">
<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="srcPortPattern"></div>
</div>
</div>
<div class="col-md-6"> <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="client_port"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
@@ -181,23 +185,51 @@ $(function(){
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <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> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
<div class="col-md-6"> <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="destIpAddress" value="${_cfg.destIpAddress}">
</div> </div>
<div for="destIpAddress"></div> <div for="destIpAddress"></div>
</div> </div>
</div> </div>
<div class="col-md-6"> </div>
<div class="form-group "> <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> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6"> <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="destPort" value="${_cfg.destPort}">
</div> </div>
<div for="destPort"></div> <div for="destPort"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@@ -271,7 +303,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -177,9 +177,9 @@ var addContent = function(obj, contentClassName) {
/* $("."+contentClassName+"0").find("input,select").each(function(){ /* $("."+contentClassName+"0").find("input,select").each(function(){
$(this).removeAttr("disabled"); $(this).removeAttr("disabled");
}); */ }); */
$("select[name$='portPattern']").parents(".port").removeClass("hidden"); //$("select[name$='PortPattern']").parents(".port").removeClass("hidden");
$("input[name$='destIpAddress']").parents(".destPort").removeClass("hidden"); //$("input[name$='destIpAddress']").parents(".destPort").removeClass("hidden");
$(".moreBtn").data("click-times",2); //$(".moreBtn").data("click-times",2);
$(obj).addClass("hidden"); $(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="cfgId" id="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> <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="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"> <c:set var="auditPermission" value="false"></c:set>
<spring:message code="submit" /> <!-- 拥有配置新增直接生效的功能权限 -->
</button> <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"> <button id="cancel" type="button" class="btn default">
<spring:message code="cancel" /> <spring:message code="cancel" />
</button> </button>

View File

@@ -223,6 +223,8 @@ var delContent = function(contentClassName, addBtnClassName) {
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="exprType" name="exprType" value="0"> <input type="hidden" id="exprType" name="exprType" value="0">
<input type="hidden" id="matchMethod" name="matchMethod" 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="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -49,6 +49,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -60,14 +82,14 @@
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -84,10 +106,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -97,38 +119,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -52,6 +52,28 @@
<c:forEach items="${region.ipRangeList}" var="cfg"> <c:forEach items="${region.ipRangeList}" var="cfg">
<c:if test="${region.regionValue eq cfg.cfgType }"> <c:if test="${region.regionValue eq cfg.cfgType }">
<div id="${region.regionValue}_${regionStatus.index}Info${index}" class="content" name="subCfg${index}"> <div id="${region.regionValue}_${regionStatus.index}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -63,14 +85,14 @@
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <%-- <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -87,10 +109,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -100,38 +122,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div> --%>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -163,6 +163,8 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%> <%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<input type="hidden" id="domainId" name="domainId" value=""> <input type="hidden" id="domainId" name="domainId" value="">
@@ -518,7 +520,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -31,6 +31,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -42,14 +64,14 @@
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -66,10 +88,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -79,38 +101,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -32,6 +32,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -47,10 +69,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -67,10 +89,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -84,34 +106,37 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -177,6 +177,8 @@ var switchRateLimitType=function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%> <%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%> <%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
@@ -438,7 +440,23 @@ var switchRateLimitType=function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -108,6 +108,8 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}"> <input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
<!-- 配置域类型 --> <!-- 配置域类型 -->
@@ -119,8 +121,10 @@ $(function(){
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -246,7 +250,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -417,7 +417,7 @@
</td> </td>
<td> <td>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</td> </td>
<%-- <td>${cfg.srcIpAddress }</td> <%-- <td>${cfg.srcIpAddress }</td>
@@ -425,7 +425,7 @@
<td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td> <td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td>
<td> <td>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</td> </td>
<td>${cfg.destPort }</td> <td>${cfg.destPort }</td>

View File

@@ -52,6 +52,8 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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" name="protocolId" value="0">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}"> <input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0"> <input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
@@ -64,8 +66,10 @@ $(function(){
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -150,97 +154,7 @@ $(function(){
<!-- dolog end--> <!-- dolog end-->
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%> <%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
<div class="row ipInfo"> <div class="row ipInfo">
<div class="row"> <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">
<select name="ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}"
<c:if test="${_cfg.ipType==ipTypeC.itemCode
|| (_cfg.ipType==null && ipTypeC.itemCode==4)}">
selected
</c:if>
>
<spring:message code="${ipTypeC.itemValue}"/>
</option>
</c:forEach>
</select>
</div>
<div for="ipType"></div>
</div>
</div>
</div>
<div class="row ip">
<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="ipPattern" 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>
</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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</div>
<div for="srcIpAddress"></div>
</div>
</div>
</div>
<div class="row port">
<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">
<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>
</div>
<div for="portPattern"></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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
</div>
<div for="srcPort"></div>
</div>
</div>
</div>
<div class="row destPort">
<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>
<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 ">
<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 class="row protocol">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group "> <div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font> <label class="control-label col-md-3"><font color="red">*</font>
@@ -272,6 +186,125 @@ $(function(){
</div> </div>
</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">
<select name="ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}"
<c:if test="${_cfg.ipType==ipTypeC.itemCode
|| (_cfg.ipType==null && ipTypeC.itemCode==4)}">
selected
</c:if>
>
<spring:message code="${ipTypeC.itemValue}"/>
</option>
</c:forEach>
</select>
</div>
<div for="ipType"></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="src_ip_pattern"/></label>
<div class="col-md-6">
<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.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
</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="src_port_pattern"/></label>
<div class="col-md-6">
<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="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="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
</div>
<div for="srcPort"></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_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>
<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>
<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 class="row"> <%-- <div class="row">
<button type="button" class="btn btn-red-hollow center-block" <button type="button" class="btn btn-red-hollow center-block"
onClick="more(this);" data-click-times="0"> onClick="more(this);" data-click-times="0">
@@ -286,7 +319,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -387,7 +387,7 @@
<%-- <td>${cfg.destPort }</td> --%> <%-- <td>${cfg.destPort }</td> --%>
<td> <td>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</td> </td>
<%-- <td> <%-- <td>

View File

@@ -49,6 +49,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -60,14 +82,14 @@
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -84,10 +106,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -97,38 +119,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -202,6 +202,8 @@ var switchRateLimitType=function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <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="serviceId" name="serviceId" value="${_cfg.serviceId}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%> <%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%> <%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
@@ -470,7 +472,23 @@ var switchRateLimitType=function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -31,6 +31,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -46,10 +68,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -66,10 +88,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -79,38 +101,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -34,63 +34,14 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_type'/>:</label> <label><spring:message code='protocol'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC"> <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if> <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<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>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='client_ip'/>:</label>
<label>
${cfg.srcIpAddress}
</label>
</div>
</div>
<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>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</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='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='direction'/>:</label>
@@ -105,10 +56,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='ip_type'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC"> <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if> <c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
@@ -124,6 +75,80 @@
</div> </div>
</div> </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> </div>
</c:if> </c:if>
</c:forEach> </c:forEach>

View File

@@ -31,6 +31,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -46,10 +68,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -66,10 +88,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -79,38 +101,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -185,6 +185,8 @@ function privateFileValidate(){
<form id="cfgFrom" action="${ctx}/proxy/intercept/strateagy/saveOrUpdate" method="post" enctype="multipart/form-data" class="form-horizontal"> <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" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}"> <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="cfgId" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0"> <input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}"> <input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
@@ -398,7 +400,23 @@ function privateFileValidate(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -93,6 +93,8 @@ function certFileValidate(){
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}"> <input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
<input type="hidden" id="cfgId" name="cfgId" value="${_cfg.cfgId}"> <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="cfgType" name="cfgType" value="PXY_OBJ_TRUSTED_CA_CERT">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0"> <input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}"> <input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
@@ -214,7 +216,23 @@ function certFileValidate(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -16,8 +16,10 @@
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -51,21 +53,6 @@
</div> </div>
</c:if> </c:if>
<div class="row"> <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">
<select name="${cfgName}.ipType"
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>
</select>
</div>
<div for="${cfgName}.ipType"></div>
</div>
</div>
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group "> <div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font> <label class="control-label col-md-3"><font color="red">*</font>
@@ -81,92 +68,6 @@
<div for="${cfgName}.protocol"></div> <div for="${cfgName}.protocol"></div>
</div> </div>
</div> </div>
</div>
<div class="row ip">
<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="${cfgName}.ipPattern"
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>
</c:forEach>
</select>
</div>
<div for="${cfgName}.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="client_ip" /></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text"
name="${cfgName}.srcIpAddress"
value="${ipPort.srcIpAddress}">
</div>
<div for="${cfgName}.srcIpAddress"></div>
</div>
</div>
</div>
<div class="row hidden port">
<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">
<select name="${cfgName}.portPattern"
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>
</c:forEach>
</select>
</div>
<div for="${cfgName}.portPattern"></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="client_port" /></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text"
name="${cfgName}.srcPort"
value="${ipPort.srcPort}">
</div>
<div for="${cfgName}.srcPort"></div>
</div>
</div>
</div>
<div class="row hidden destPort">
<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="${cfgName}.destIpAddress"
value="${ipPort.destIpAddress}">
</div>
<div for="${cfgName}.destIpAddress"></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>
<div class="row hidden protocol">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font> <label class="control-label col-md-3"><font color="red">*</font>
@@ -183,6 +84,140 @@
</div> </div>
</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">
<select name="${cfgName}.ipType"
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>
</select>
</div>
<div for="${cfgName}.ipType"></div>
</div>
</div>
</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="src_ip_pattern" /></label>
<div class="col-md-6">
<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.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}.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="client_ip" /></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text"
name="${cfgName}.srcIpAddress"
value="${ipPort.srcIpAddress}">
</div>
<div for="${cfgName}.srcIpAddress"></div>
</div>
</div>
</div>
<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="src_port_pattern" /></label>
<div class="col-md-6">
<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.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}.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="client_port" /></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text"
name="${cfgName}.srcPort"
value="${ipPort.srcPort}">
</div>
<div for="${cfgName}.srcPort"></div>
</div>
</div>
</div>
<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_ip_pattern" /></label>
<div class="col-md-6">
<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}.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="${cfgName}.destIpAddress"
value="${ipPort.destIpAddress}">
</div>
<div for="${cfgName}.destIpAddress"></div>
</div>
</div>
</div>
<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">
<select name="${cfgName}.destPortPattern"
class="selectpicker show-tick form-control required">
<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}.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>
<div class="row"> <div class="row">
<button type="button" class="btn btn-red-hollow center-block moreBtn" <button type="button" class="btn btn-red-hollow center-block moreBtn"

View File

@@ -453,8 +453,10 @@ var showHideIPSECProtocol=function(obj){
serviceType="${region.configServiceType}" serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}" ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}" ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}" srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
portPattern="${region.configPortPattern}" destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
direction="${region.configDirection}" direction="${region.configDirection}"
protocol="${region.configProtocol}" protocol="${region.configProtocol}"
regionType="${region.regionType}" regionType="${region.regionType}"
@@ -538,12 +540,12 @@ var showHideIPSECProtocol=function(obj){
</c:forEach> </c:forEach>
</div> </div>
</div> </div>
<div class="col-md-6 doBlackList"> <div class="col-md-6 doBalckList">
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_blacklist" /></label> <label class="control-label col-md-3"><spring:message code="do_blacklist" /></label>
<c:forEach items="${fns:getDictList('DO_BLACKLIST') }" var="dict"> <c:forEach items="${fns:getDictList('DO_BLACKLIST') }" var="dict">
<c:choose> <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"> <label class="radio-inline">
<input type="radio" name="doBlackList" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/> <input type="radio" name="doBlackList" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label> </label>

View File

@@ -34,6 +34,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -45,14 +67,14 @@
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -69,10 +91,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -82,38 +104,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -32,6 +32,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -47,10 +69,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -67,10 +89,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -84,34 +106,37 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -91,6 +91,8 @@ $(function(){
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}"> <input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}"> <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="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}"> <input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
@@ -222,7 +224,23 @@ $(function(){
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <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> <button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div> </div>
</div> </div>

View File

@@ -31,6 +31,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -46,10 +68,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -66,10 +88,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -79,38 +101,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

View File

@@ -72,88 +72,113 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<div id="ipInfo${index}" class="content" name="subCfg${index}"> <div id="ipInfo${index}" class="content" name="subCfg${index}">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_type'/>:</label> <label><spring:message code='protocol'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC"> <c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if> <c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
</div> <div class="col-md-4">
<div class="row"> <div class="form-group">
<div class="col-md-4"> <label><spring:message code='direction'/>:</label>
<div class="form-group"> <label>
<label><spring:message code='ip_pattern'/>:</label> <c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<label> <c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> </c:forEach>
<c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if> </label>
</c:forEach> </div>
</label> </div>
</div> </div>
</div> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='client_ip'/>:</label> <label><spring:message code='ip_type'/>:</label>
<label> <label>
${cfg.srcIpAddress} <c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
</label> <c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
</div> </c:forEach>
</div> </label>
</div> </div>
<div class="row"> </div>
<div class="col-md-4"> </div>
<div class="form-group"> <div class="row">
<label><spring:message code='port_pattern'/>:</label> <div class="col-md-4">
<label> <div class="form-group">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <label><spring:message code='src_ip_pattern'/>:</label>
<c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if> <label>
</c:forEach> <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
</label> <c:if test="${cfg.srcIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</div> </c:forEach>
</div> </label>
<div class="col-md-4"> </div>
<div class="form-group"> </div>
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <div class="col-md-4">
</div> <div class="form-group">
</div> <label><spring:message code='client_ip'/>:</label>
</div> <label>
<div class="row"> ${cfg.srcIpAddress}
<div class="col-md-4"> </label>
<div class="form-group"> </div>
<label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label> </div>
</div> </div>
</div> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label> <label><spring:message code='src_port_pattern'/>:</label>
</div> <label>
</div> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
</div> <c:if test="${cfg.srcPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
<div class="row"> </c:forEach>
<div class="col-md-4"> </label>
<div class="form-group"> </div>
<label><spring:message code='direction'/>:</label> </div>
<label> <div class="col-md-4">
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <div class="form-group">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</c:forEach> </div>
</label> </div>
</div> </div>
</div> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='dest_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC"> <c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
<c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if> <c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </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> </div>
</c:forEach> </c:forEach>
<c:forEach items="${_cfg.httpUrlList}" var="cfg"> <c:forEach items="${_cfg.httpUrlList}" var="cfg">

View File

@@ -31,6 +31,28 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg"> <c:forEach items="${_cfg.ipPortList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }"> <c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}"> <div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<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="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
@@ -42,14 +64,14 @@
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='ip_pattern'/>:</label> <label><spring:message code='src_ip_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -66,10 +88,10 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='port_pattern'/>:</label> <label><spring:message code='src_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC"> <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> </c:forEach>
</label> </label>
</div> </div>
@@ -79,38 +101,41 @@
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label> <label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <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>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='direction'/>:</label> <label><spring:message code='dest_port_pattern'/>:</label>
<label> <label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC"> <c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if> <c:if test="${cfg.destPortPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach> </c:forEach>
</label> </label>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label><spring:message code='protocol'/>:</label> <label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</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>
</div> </div>

Some files were not shown because too many files have changed in this diff Show More