Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
BIN
lib/jave-1.0.2.jar
Normal file
BIN
lib/jave-1.0.2.jar
Normal file
Binary file not shown.
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,14 +39,14 @@ public class IpAllTemplate {
|
|||||||
public void setCfgDesc(String cfgDesc) {
|
public void setCfgDesc(String cfgDesc) {
|
||||||
this.cfgDesc = cfgDesc;
|
this.cfgDesc = cfgDesc;
|
||||||
}
|
}
|
||||||
@ExcelField(title="client_ip",align=2,sort=2)
|
@ExcelField(title="client_ip",align=2,sort=11)
|
||||||
public String getSrcIpAddress() {
|
public String getSrcIpAddress() {
|
||||||
return srcIpAddress;
|
return srcIpAddress;
|
||||||
}
|
}
|
||||||
public void setSrcIpAddress(String srcIpAddress) {
|
public void setSrcIpAddress(String srcIpAddress) {
|
||||||
this.srcIpAddress = srcIpAddress;
|
this.srcIpAddress = srcIpAddress;
|
||||||
}
|
}
|
||||||
@ExcelField(title="server_ip",align=2,sort=3)
|
@ExcelField(title="server_ip",align=2,sort=12)
|
||||||
public String getDestIpAddress() {
|
public String getDestIpAddress() {
|
||||||
return destIpAddress;
|
return destIpAddress;
|
||||||
}
|
}
|
||||||
@@ -53,14 +54,14 @@ public class IpAllTemplate {
|
|||||||
this.destIpAddress = destIpAddress;
|
this.destIpAddress = destIpAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExcelField(title="client_port",align=2,sort=4)
|
@ExcelField(title="client_port",align=2,sort=13)
|
||||||
public String getSrcPort() {
|
public String getSrcPort() {
|
||||||
return srcPort;
|
return srcPort;
|
||||||
}
|
}
|
||||||
public void setSrcPort(String srcPort) {
|
public void setSrcPort(String srcPort) {
|
||||||
this.srcPort = srcPort;
|
this.srcPort = srcPort;
|
||||||
}
|
}
|
||||||
@ExcelField(title="server_port",align=2,sort=5)
|
@ExcelField(title="server_port",align=2,sort=14)
|
||||||
public String getDestPort() {
|
public String getDestPort() {
|
||||||
return destPort;
|
return destPort;
|
||||||
}
|
}
|
||||||
@@ -68,18 +69,19 @@ public class IpAllTemplate {
|
|||||||
this.destPort = destPort;
|
this.destPort = destPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExcelField(title="protocol",align=2,sort=6)
|
@ExcelField(title="protocol",align=2,sort=15)
|
||||||
public Integer getProtocol() {
|
public Integer getProtocol() {
|
||||||
return protocol;
|
return protocol;
|
||||||
}
|
}
|
||||||
public void setProtocol(Integer protocol) {
|
public void setProtocol(Integer protocol) {
|
||||||
this.protocol = protocol;
|
this.protocol = protocol;
|
||||||
}
|
}
|
||||||
@ExcelField(title="direction",align=2,sort=7)
|
@ExcelField(title="direction",align=2,sort=16)
|
||||||
public Integer getDirection() {
|
public Integer getDirection() {
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
public void setDirection(Integer direction) {
|
public void setDirection(Integer direction) {
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL IPPayload导入替换模板
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class IpPayloadTemplate extends IpAllTemplate {
|
||||||
|
|
||||||
|
private String userRegion1;
|
||||||
|
private String userRegion2;
|
||||||
|
private String userRegion3;
|
||||||
|
|
||||||
|
@ExcelField(title="replace_zone",dictType="INTERCEPT_REPLACE_ZONE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
@ExcelField(title="replaced_content",align=2,sort=2)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
public void setUserRegion2(String userRegion1) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
@ExcelField(title="replace_content",align=2,sort=2)
|
||||||
|
public String getUserRegion3() {
|
||||||
|
return userRegion3;
|
||||||
|
}
|
||||||
|
public void setUserRegion3(String userRegion1) {
|
||||||
|
this.userRegion3 = userRegion3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +1,19 @@
|
|||||||
package com.nis.domain.configuration.template;
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
* EXCEL IP导入限速模板
|
||||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
|
||||||
* @author dell
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IpRateLimitTemplate extends IpCfgTemplate {
|
public class IpRateLimitTemplate extends IpAllTemplate {
|
||||||
|
|
||||||
|
private String userRegion1;
|
||||||
@Override
|
@ExcelField(title="rate_limte",align=2,sort=2)
|
||||||
public Integer getIrType() {
|
public String getUserRegion1() {
|
||||||
// TODO Auto-generated method stub
|
return userRegion1;
|
||||||
return super.getIrType();
|
|
||||||
}
|
}
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
@Override
|
this.userRegion1 = userRegion1;
|
||||||
public Integer getDnsStrategyId() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.getDnsStrategyId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
*@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白名单配置模板
|
||||||
|
*/
|
||||||
|
public class IpWhitelistTemplate {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String cfgDesc;
|
||||||
|
private String srcIpAddress;
|
||||||
|
private String destIpAddress;
|
||||||
|
private String srcPort;
|
||||||
|
private String destPort;
|
||||||
|
|
||||||
|
@ExcelField(title="config_describe",align=2,sort=1)
|
||||||
|
public String getCfgDesc() {
|
||||||
|
return cfgDesc;
|
||||||
|
}
|
||||||
|
public void setCfgDesc(String cfgDesc) {
|
||||||
|
this.cfgDesc = cfgDesc;
|
||||||
|
}
|
||||||
|
@ExcelField(title="client_ip",align=2,sort=11)
|
||||||
|
public String getSrcIpAddress() {
|
||||||
|
return srcIpAddress;
|
||||||
|
}
|
||||||
|
public void setSrcIpAddress(String srcIpAddress) {
|
||||||
|
this.srcIpAddress = srcIpAddress;
|
||||||
|
}
|
||||||
|
@ExcelField(title="server_ip",align=2,sort=12)
|
||||||
|
public String getDestIpAddress() {
|
||||||
|
return destIpAddress;
|
||||||
|
}
|
||||||
|
public void setDestIpAddress(String destIpAddress) {
|
||||||
|
this.destIpAddress = destIpAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="client_port",align=2,sort=13)
|
||||||
|
public String getSrcPort() {
|
||||||
|
return srcPort;
|
||||||
|
}
|
||||||
|
public void setSrcPort(String srcPort) {
|
||||||
|
this.srcPort = srcPort;
|
||||||
|
}
|
||||||
|
@ExcelField(title="server_port",align=2,sort=14)
|
||||||
|
public String getDestPort() {
|
||||||
|
return destPort;
|
||||||
|
}
|
||||||
|
public void setDestPort(String destPort) {
|
||||||
|
this.destPort = destPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||||
@@ -13,7 +14,15 @@ import com.nis.domain.maat.MaatCfg.StringCfg;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GroupReuseCfg implements Serializable {
|
public class GroupReuseCfg implements Serializable {
|
||||||
|
@Expose
|
||||||
|
@SerializedName("service")
|
||||||
|
private Integer serviceId;
|
||||||
|
public Integer getServiceId() {
|
||||||
|
return serviceId;
|
||||||
|
}
|
||||||
|
public void setServiceId(Integer serviceId) {
|
||||||
|
this.serviceId = serviceId;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -258,6 +258,15 @@ public class MaatCfg implements Serializable {
|
|||||||
@Expose
|
@Expose
|
||||||
@SerializedName("opTime")
|
@SerializedName("opTime")
|
||||||
private Date auditTime;
|
private Date auditTime;
|
||||||
|
@Expose
|
||||||
|
private String userRegion;
|
||||||
|
|
||||||
|
public String getUserRegion() {
|
||||||
|
return userRegion;
|
||||||
|
}
|
||||||
|
public void setUserRegion(String userRegion) {
|
||||||
|
this.userRegion = userRegion;
|
||||||
|
}
|
||||||
public Integer getRegionId() {
|
public Integer getRegionId() {
|
||||||
return regionId;
|
return regionId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -686,4 +686,7 @@ public final class Constants {
|
|||||||
// 区域/运营商配置下发时tag值
|
// 区域/运营商配置下发时tag值
|
||||||
public static final String AREA_TAG=Configurations.getStringProperty("area_tag","location");
|
public static final String AREA_TAG=Configurations.getStringProperty("area_tag","location");
|
||||||
public static final String ISP_TAG=Configurations.getStringProperty("isp_tag","isp");
|
public static final String ISP_TAG=Configurations.getStringProperty("isp_tag","isp");
|
||||||
|
|
||||||
|
//音视频样例时长限制,单位秒
|
||||||
|
public static final int AV_DURATION_LIMIT=Configurations.getIntProperty("av_duration_limit", 120);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.nis.domain.FunctionRegionDict;
|
import com.nis.domain.FunctionRegionDict;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.SysDataDictionaryItem;
|
import com.nis.domain.SysDataDictionaryItem;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
@@ -130,7 +131,7 @@ public class ExportExcel {
|
|||||||
getFields(list,cls.getSuperclass());
|
getFields(list,cls.getSuperclass());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public String[] validRegionFieldAndSetComment(String headerStr,String commentStr,FunctionRegionDict region,Properties msgProp){
|
public String[] validRegionFieldAndSetComment(String headerStr,String commentStr,FunctionRegionDict region,FunctionServiceDict service,Properties msgProp){
|
||||||
String[] titleInfo=new String[2];
|
String[] titleInfo=new String[2];
|
||||||
if(region.getIsMaat().equals(1)){//maat
|
if(region.getIsMaat().equals(1)){//maat
|
||||||
if(region.getRegionType().equals(1)){//IP配置
|
if(region.getRegionType().equals(1)){//IP配置
|
||||||
@@ -237,21 +238,54 @@ public class ExportExcel {
|
|||||||
}
|
}
|
||||||
//导入的Protocol
|
//导入的Protocol
|
||||||
if("protocol".equals(headerStr)){
|
if("protocol".equals(headerStr)){
|
||||||
if(StringUtil.isEmpty(region.getConfigProtocol())){
|
if(service.getFunctionId().equals(5) ){
|
||||||
headerStr="";
|
|
||||||
commentStr="";
|
|
||||||
}else{
|
|
||||||
commentStr="";
|
commentStr="";
|
||||||
List<SysDataDictionaryItem> protocol=DictUtils.getDictList("PROTOCOL");
|
List<SysDataDictionaryItem> protocol=DictUtils.getDictList("PROTOCOL");
|
||||||
if(protocol !=null && protocol.size()>0){
|
if(protocol !=null && protocol.size()>0){
|
||||||
for (SysDataDictionaryItem sysDataDictionaryItem : protocol) {
|
for (SysDataDictionaryItem sysDataDictionaryItem : protocol) {
|
||||||
if((","+region.getConfigProtocol()+",").indexOf(","+sysDataDictionaryItem.getItemCode()+",") >0){
|
if(service.getAction().equals(16) && sysDataDictionaryItem.getItemCode().equals(6)){
|
||||||
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+sysDataDictionaryItem.getItemValue()+"\n";
|
||||||
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+sysDataDictionaryItem.getItemValue()+"\n";
|
}
|
||||||
}else{
|
if(service.getAction().equals(1) &&
|
||||||
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+"\n";
|
(sysDataDictionaryItem.getItemCode().equals(6)
|
||||||
}
|
|| sysDataDictionaryItem.getItemCode().equals(17)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(0) )){
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+sysDataDictionaryItem.getItemValue()+"\n";
|
||||||
|
}
|
||||||
|
if(service.getAction().equals(32) &&
|
||||||
|
(sysDataDictionaryItem.getItemCode().equals(6)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(17)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(1)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(15)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(51)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(50))){
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+sysDataDictionaryItem.getItemValue()+"\n";
|
||||||
|
}
|
||||||
|
if(service.getAction().equals(64) &&
|
||||||
|
(sysDataDictionaryItem.getItemCode().equals(6)
|
||||||
|
|| sysDataDictionaryItem.getItemCode().equals(17) )){
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+sysDataDictionaryItem.getItemValue()+"\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if(StringUtil.isEmpty(region.getConfigProtocol())){
|
||||||
|
headerStr="";
|
||||||
|
commentStr="";
|
||||||
|
}else{
|
||||||
|
commentStr="";
|
||||||
|
List<SysDataDictionaryItem> protocol=DictUtils.getDictList("PROTOCOL");
|
||||||
|
if(protocol !=null && protocol.size()>0){
|
||||||
|
for (SysDataDictionaryItem sysDataDictionaryItem : protocol) {
|
||||||
|
if((","+region.getConfigProtocol()+",").indexOf(","+sysDataDictionaryItem.getItemCode()+",") >0){
|
||||||
|
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+sysDataDictionaryItem.getItemValue()+"\n";
|
||||||
|
}else{
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+":"+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+"\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -419,7 +453,7 @@ public class ExportExcel {
|
|||||||
* @param type 导出类型(1:导出数据;2:导出模板)
|
* @param type 导出类型(1:导出数据;2:导出模板)
|
||||||
* @param groups 导入分组
|
* @param groups 导入分组
|
||||||
*/
|
*/
|
||||||
public ExportExcel(FunctionRegionDict region,Properties msgProp,String title, Class<?> cls, int type, int... groups){
|
public ExportExcel(FunctionServiceDict service,FunctionRegionDict region,Properties msgProp,String title, Class<?> cls, int type, int... groups){
|
||||||
List<Field> list=new ArrayList<Field>();
|
List<Field> list=new ArrayList<Field>();
|
||||||
// Get annotation field
|
// Get annotation field
|
||||||
//递归获取cls实体对象及父级对象的属性
|
//递归获取cls实体对象及父级对象的属性
|
||||||
@@ -496,7 +530,7 @@ public class ExportExcel {
|
|||||||
commentStr="";
|
commentStr="";
|
||||||
}else{
|
}else{
|
||||||
//判断此业务导出模板内容,设置导入提示信息
|
//判断此业务导出模板内容,设置导入提示信息
|
||||||
String[] titleInfo=validRegionFieldAndSetComment(titleStr,commentStr,region,msgProp);
|
String[] titleInfo=validRegionFieldAndSetComment(titleStr,commentStr,region,service,msgProp);
|
||||||
titleStr=titleInfo[0];
|
titleStr=titleInfo[0];
|
||||||
commentStr=titleInfo[1];
|
commentStr=titleInfo[1];
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1214,7 @@ public class ExportExcel {
|
|||||||
List<Field> list=new ArrayList<Field>();
|
List<Field> list=new ArrayList<Field>();
|
||||||
// Get annotation field
|
// Get annotation field
|
||||||
//递归获取cls实体对象及父级对象的属性
|
//递归获取cls实体对象及父级对象的属性
|
||||||
getFields(list, clsMap.get(title));
|
getFields(list, clsMap.get(title).getClass());
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
for (Field f : list){
|
for (Field f : list){
|
||||||
ExcelField ef = f.getAnnotation(ExcelField.class);
|
ExcelField ef = f.getAnnotation(ExcelField.class);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.nis.web.controller;
|
package com.nis.web.controller;
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -49,6 +50,7 @@ import com.nis.domain.configuration.RequestInfo;
|
|||||||
import com.nis.domain.configuration.StringCfgTemplate;
|
import com.nis.domain.configuration.StringCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||||
|
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||||
import com.nis.domain.log.BaseLogEntity;
|
import com.nis.domain.log.BaseLogEntity;
|
||||||
import com.nis.domain.log.SearchReport;
|
import com.nis.domain.log.SearchReport;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
@@ -614,17 +616,17 @@ public class BaseController {
|
|||||||
if(dict.getRegionType()==1){
|
if(dict.getRegionType()==1){
|
||||||
List<IpCfgTemplate> list = Lists.newArrayList();
|
List<IpCfgTemplate> list = Lists.newArrayList();
|
||||||
list.add(new IpCfgTemplate());
|
list.add(new IpCfgTemplate());
|
||||||
new ExportExcel(new FunctionRegionDict(),msgProp,null, IpCfgTemplate.class, 2).setDataList(msgProp,list,null).
|
new ExportExcel(new FunctionServiceDict(),new FunctionRegionDict(),msgProp,null, IpCfgTemplate.class, 2).setDataList(msgProp,list,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}else if(dict.getRegionType()==2){
|
}else if(dict.getRegionType()==2){
|
||||||
List<StringCfgTemplate> list = Lists.newArrayList();
|
List<StringCfgTemplate> list = Lists.newArrayList();
|
||||||
list.add(new StringCfgTemplate());
|
list.add(new StringCfgTemplate());
|
||||||
new ExportExcel(new FunctionRegionDict(),msgProp,null, StringCfgTemplate.class, 2).setDataList(msgProp,list,null).
|
new ExportExcel(new FunctionServiceDict(),new FunctionRegionDict(),msgProp,null, StringCfgTemplate.class, 2).setDataList(msgProp,list,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}else if(dict.getRegionType()==3){
|
}else if(dict.getRegionType()==3){
|
||||||
List<ComplexStringCfgTemplate> list = Lists.newArrayList();
|
List<ComplexStringCfgTemplate> list = Lists.newArrayList();
|
||||||
list.add(new ComplexStringCfgTemplate());
|
list.add(new ComplexStringCfgTemplate());
|
||||||
new ExportExcel(new FunctionRegionDict(),msgProp,null, ComplexStringCfgTemplate.class, 2).setDataList(msgProp,list,null).
|
new ExportExcel(new FunctionServiceDict(),new FunctionRegionDict(),msgProp,null, ComplexStringCfgTemplate.class, 2).setDataList(msgProp,list,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,17 +648,17 @@ public class BaseController {
|
|||||||
if(dict.getRegionType()==1){
|
if(dict.getRegionType()==1){
|
||||||
List<IpCfgTemplate> list = Lists.newArrayList();
|
List<IpCfgTemplate> list = Lists.newArrayList();
|
||||||
list.add((IpCfgTemplate)clazz.newInstance());
|
list.add((IpCfgTemplate)clazz.newInstance());
|
||||||
new ExportExcel(new FunctionRegionDict(),msgProp,null, clazz, 2).setDataList(msgProp,list,null).
|
new ExportExcel(new FunctionServiceDict(),new FunctionRegionDict(),msgProp,null, clazz, 2).setDataList(msgProp,list,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}else if(dict.getRegionType()==2){
|
}else if(dict.getRegionType()==2){
|
||||||
List<StringCfgTemplate> list = Lists.newArrayList();
|
List<StringCfgTemplate> list = Lists.newArrayList();
|
||||||
list.add(new StringCfgTemplate());
|
list.add(new StringCfgTemplate());
|
||||||
new ExportExcel(new FunctionRegionDict(),msgProp,null, clazz, 2).setDataList(msgProp,list,null).
|
new ExportExcel(new FunctionServiceDict(),new FunctionRegionDict(),msgProp,null, clazz, 2).setDataList(msgProp,list,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}else if(dict.getRegionType()==3){
|
}else if(dict.getRegionType()==3){
|
||||||
List<ComplexStringCfgTemplate> list = Lists.newArrayList();
|
List<ComplexStringCfgTemplate> list = Lists.newArrayList();
|
||||||
list.add(new ComplexStringCfgTemplate());
|
list.add(new ComplexStringCfgTemplate());
|
||||||
new ExportExcel(new FunctionRegionDict(),msgProp,null, clazz, 2).setDataList(msgProp,list,null).
|
new ExportExcel(new FunctionServiceDict(),new FunctionRegionDict(),msgProp,null, clazz, 2).setDataList(msgProp,list,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -788,53 +790,51 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BaseIpCfg> checkIpCfg(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,List<IpAllTemplate> list) throws ServiceException{
|
public List<BaseIpCfg> checkIpCfg(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,List<?> list) throws ServiceException{
|
||||||
List<BaseIpCfg> ipList=new ArrayList<BaseIpCfg>();
|
List<BaseIpCfg> ipList=new ArrayList<BaseIpCfg>();
|
||||||
Properties prop=this.getMsgProp();
|
Properties prop=this.getMsgProp();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
IpAllTemplate ipCfg=list.get(i);
|
|
||||||
IpPortCfg baseIpCfg=new IpPortCfg();
|
IpPortCfg baseIpCfg=new IpPortCfg();
|
||||||
baseIpCfg.setCfgDesc(ipCfg.getCfgDesc());
|
BeanUtils.copyProperties(list.get(i), baseIpCfg);
|
||||||
if(regionDict.getIsMaat().equals(1)){
|
|
||||||
if(regionDict.getRegionType().equals(1)){
|
if(regionDict.getRegionType().equals(1)){
|
||||||
boolean srcIpEmpty=false;
|
boolean srcIpEmpty=false;
|
||||||
boolean srcPortEmpty=false;
|
boolean srcPortEmpty=false;
|
||||||
if(StringUtil.isEmpty(ipCfg.getSrcIpAddress())){
|
if(StringUtil.isEmpty(baseIpCfg.getSrcIpAddress())){
|
||||||
srcIpEmpty=true;
|
srcIpEmpty=true;
|
||||||
}
|
}
|
||||||
if(StringUtil.isEmpty(ipCfg.getDestIpAddress())){
|
if(StringUtil.isEmpty(baseIpCfg.getDestIpAddress())){
|
||||||
if(srcIpEmpty){
|
if(srcIpEmpty){
|
||||||
baseIpCfg.setSrcIpAddress("0.0.0.0");
|
baseIpCfg.setSrcIpAddress("0.0.0.0");
|
||||||
baseIpCfg.setDestIpAddress("0.0.0.0");
|
baseIpCfg.setDestIpAddress("0.0.0.0");
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
baseIpCfg.setIpType(4);
|
baseIpCfg.setIpType(4);
|
||||||
}else{
|
}else{
|
||||||
if(ipCfg.getSrcIpAddress().indexOf(":") > -1){
|
if(baseIpCfg.getSrcIpAddress().indexOf(":") > -1){
|
||||||
if(ipCfg.getSrcIpAddress().indexOf("-") > -1){
|
if(baseIpCfg.getSrcIpAddress().indexOf("-") > -1){
|
||||||
baseIpCfg.setSrcIpAddress(ipCfg.getSrcIpAddress());
|
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||||
baseIpCfg.setDestIpAddress("::-::");
|
baseIpCfg.setDestIpAddress("::-::");
|
||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
}else if(ipCfg.getSrcIpAddress().indexOf("/") > -1){
|
}else if(baseIpCfg.getSrcIpAddress().indexOf("/") > -1){
|
||||||
baseIpCfg.setSrcIpAddress(ipCfg.getSrcIpAddress());
|
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||||
baseIpCfg.setDestIpAddress("::/128");
|
baseIpCfg.setDestIpAddress("::/128");
|
||||||
baseIpCfg.setIpPattern(1);
|
baseIpCfg.setIpPattern(1);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setSrcIpAddress(ipCfg.getSrcIpAddress());
|
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||||
baseIpCfg.setDestIpAddress("::");
|
baseIpCfg.setDestIpAddress("::");
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
}
|
}
|
||||||
baseIpCfg.setIpType(6);
|
baseIpCfg.setIpType(6);
|
||||||
}else{
|
}else{
|
||||||
if(ipCfg.getSrcIpAddress().indexOf("-") > -1){
|
if(baseIpCfg.getSrcIpAddress().indexOf("-") > -1){
|
||||||
baseIpCfg.setSrcIpAddress("0.0.0.0-"+ipCfg.getSrcIpAddress().split("-")[0].substring(0,ipCfg.getSrcIpAddress().indexOf("-")+1)+ipCfg.getSrcIpAddress().split("-")[1]);
|
baseIpCfg.setSrcIpAddress("0.0.0.0-"+baseIpCfg.getSrcIpAddress().split("-")[0].substring(0,baseIpCfg.getSrcIpAddress().indexOf("-")+1)+baseIpCfg.getSrcIpAddress().split("-")[1]);
|
||||||
baseIpCfg.setDestIpAddress("0.0.0.0-0.0.0.0");
|
baseIpCfg.setDestIpAddress("0.0.0.0-0.0.0.0");
|
||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
}else if(ipCfg.getSrcIpAddress().indexOf("/") > -1){
|
}else if(baseIpCfg.getSrcIpAddress().indexOf("/") > -1){
|
||||||
baseIpCfg.setSrcIpAddress(ipCfg.getSrcIpAddress());
|
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||||
baseIpCfg.setDestIpAddress("0.0.0.0/16");
|
baseIpCfg.setDestIpAddress("0.0.0.0/16");
|
||||||
baseIpCfg.setIpPattern(1);
|
baseIpCfg.setIpPattern(1);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setSrcIpAddress(ipCfg.getSrcIpAddress());
|
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||||
baseIpCfg.setDestIpAddress("0.0.0.0");
|
baseIpCfg.setDestIpAddress("0.0.0.0");
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
}
|
}
|
||||||
@@ -843,48 +843,50 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
if(srcIpEmpty){
|
if(srcIpEmpty){
|
||||||
if(ipCfg.getDestIpAddress().indexOf(":") > -1){
|
if(baseIpCfg.getDestIpAddress().indexOf(":") > -1){
|
||||||
if(ipCfg.getDestIpAddress().indexOf("-") > -1){
|
if(baseIpCfg.getDestIpAddress().indexOf("-") > -1){
|
||||||
baseIpCfg.setDestIpAddress(ipCfg.getDestIpAddress());
|
baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||||
baseIpCfg.setSrcIpAddress("::-::");
|
baseIpCfg.setSrcIpAddress("::-::");
|
||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
}else if(ipCfg.getDestIpAddress().indexOf("/") > -1){
|
}else if(baseIpCfg.getDestIpAddress().indexOf("/") > -1){
|
||||||
baseIpCfg.setDestIpAddress(ipCfg.getDestIpAddress());
|
baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||||
baseIpCfg.setSrcIpAddress("::/128");
|
baseIpCfg.setSrcIpAddress("::/128");
|
||||||
baseIpCfg.setIpPattern(1);
|
baseIpCfg.setIpPattern(1);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setDestIpAddress(ipCfg.getDestIpAddress());
|
baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||||
baseIpCfg.setSrcIpAddress("::");
|
baseIpCfg.setSrcIpAddress("::");
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
}
|
}
|
||||||
baseIpCfg.setIpType(6);
|
baseIpCfg.setIpType(6);
|
||||||
}else{
|
}else{
|
||||||
if(ipCfg.getDestIpAddress().indexOf("-") > -1){
|
if(baseIpCfg.getDestIpAddress().indexOf("-") > -1){
|
||||||
baseIpCfg.setDestIpAddress("0.0.0.0-"+ipCfg.getDestIpAddress().split("-")[0].substring(0,ipCfg.getDestIpAddress().indexOf("-")+1)+ipCfg.getDestIpAddress().split("-")[1]);
|
baseIpCfg.setDestIpAddress("0.0.0.0-"+baseIpCfg.getDestIpAddress().split("-")[0]
|
||||||
|
.substring(0,baseIpCfg.getDestIpAddress().indexOf("-")+1)
|
||||||
|
+baseIpCfg.getDestIpAddress().split("-")[1]);
|
||||||
baseIpCfg.setSrcIpAddress("0.0.0.0-0.0.0.0");
|
baseIpCfg.setSrcIpAddress("0.0.0.0-0.0.0.0");
|
||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
}else if(ipCfg.getDestIpAddress().indexOf("/") > -1){
|
}else if(baseIpCfg.getDestIpAddress().indexOf("/") > -1){
|
||||||
baseIpCfg.setDestIpAddress(ipCfg.getDestIpAddress());
|
baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||||
baseIpCfg.setSrcIpAddress("0.0.0.0/16");
|
baseIpCfg.setSrcIpAddress("0.0.0.0/16");
|
||||||
baseIpCfg.setIpPattern(1);
|
baseIpCfg.setIpPattern(1);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setDestIpAddress(ipCfg.getDestIpAddress());
|
baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||||
baseIpCfg.setSrcIpAddress("0.0.0.0");
|
baseIpCfg.setSrcIpAddress("0.0.0.0");
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
}
|
}
|
||||||
baseIpCfg.setIpType(4);
|
baseIpCfg.setIpType(4);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setSrcIpAddress(ipCfg.getSrcIpAddress());
|
baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress());
|
||||||
baseIpCfg.setDestIpAddress(ipCfg.getDestIpAddress());
|
baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress());
|
||||||
if(ipCfg.getSrcIpAddress().indexOf(":") > -1){
|
if(baseIpCfg.getSrcIpAddress().indexOf(":") > -1){
|
||||||
baseIpCfg.setIpType(6);
|
baseIpCfg.setIpType(6);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setIpType(4);
|
baseIpCfg.setIpType(4);
|
||||||
}
|
}
|
||||||
if(ipCfg.getSrcIpAddress().indexOf("-") > -1){
|
if(baseIpCfg.getSrcIpAddress().indexOf("-") > -1){
|
||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
}else if(ipCfg.getSrcIpAddress().indexOf("/") > -1){
|
}else if(baseIpCfg.getSrcIpAddress().indexOf("/") > -1){
|
||||||
baseIpCfg.setIpPattern(1);
|
baseIpCfg.setIpPattern(1);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
@@ -895,49 +897,49 @@ public class BaseController {
|
|||||||
//TODO 判断源IP和目的IP的值
|
//TODO 判断源IP和目的IP的值
|
||||||
//TODO 判断源IP和目的IP格式
|
//TODO 判断源IP和目的IP格式
|
||||||
|
|
||||||
if(StringUtil.isEmpty(ipCfg.getSrcPort())){
|
if(StringUtil.isEmpty(baseIpCfg.getSrcPort())){
|
||||||
srcPortEmpty=true;
|
srcPortEmpty=true;
|
||||||
}
|
}
|
||||||
if(StringUtil.isEmpty(ipCfg.getDestPort())){
|
if(StringUtil.isEmpty(baseIpCfg.getDestPort())){
|
||||||
if(srcPortEmpty){
|
if(srcPortEmpty){
|
||||||
baseIpCfg.setSrcPort("0");
|
baseIpCfg.setSrcPort("0");
|
||||||
baseIpCfg.setDestPort("0");
|
baseIpCfg.setDestPort("0");
|
||||||
baseIpCfg.setPortPattern(1);
|
baseIpCfg.setPortPattern(1);
|
||||||
}else{
|
}else{
|
||||||
if(ipCfg.getSrcPort().indexOf("/") > -1){
|
if(baseIpCfg.getSrcPort().indexOf("/") > -1){
|
||||||
baseIpCfg.setDestPort("0/0");
|
baseIpCfg.setDestPort("0/0");
|
||||||
baseIpCfg.setPortPattern(2);
|
baseIpCfg.setPortPattern(2);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setDestPort("0");
|
baseIpCfg.setDestPort("0");
|
||||||
baseIpCfg.setPortPattern(1);
|
baseIpCfg.setPortPattern(1);
|
||||||
}
|
}
|
||||||
baseIpCfg.setSrcPort(ipCfg.getSrcPort());
|
baseIpCfg.setSrcPort(baseIpCfg.getSrcPort());
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(srcPortEmpty){
|
if(srcPortEmpty){
|
||||||
if(ipCfg.getDestPort().indexOf("/") > -1){
|
if(baseIpCfg.getDestPort().indexOf("/") > -1){
|
||||||
baseIpCfg.setSrcPort("0/0");
|
baseIpCfg.setSrcPort("0/0");
|
||||||
baseIpCfg.setPortPattern(2);
|
baseIpCfg.setPortPattern(2);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setSrcPort("0");
|
baseIpCfg.setSrcPort("0");
|
||||||
baseIpCfg.setPortPattern(1);
|
baseIpCfg.setPortPattern(1);
|
||||||
}
|
}
|
||||||
baseIpCfg.setDestPort(ipCfg.getSrcPort());
|
baseIpCfg.setDestPort(baseIpCfg.getSrcPort());
|
||||||
}else{
|
}else{
|
||||||
if(ipCfg.getSrcPort().indexOf("/") > -1){
|
if(baseIpCfg.getSrcPort().indexOf("/") > -1){
|
||||||
baseIpCfg.setPortPattern(2);
|
baseIpCfg.setPortPattern(2);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setPortPattern(1);
|
baseIpCfg.setPortPattern(1);
|
||||||
}
|
}
|
||||||
baseIpCfg.setSrcPort(ipCfg.getSrcPort());
|
baseIpCfg.setSrcPort(baseIpCfg.getSrcPort());
|
||||||
baseIpCfg.setDestPort(ipCfg.getDestPort());
|
baseIpCfg.setDestPort(baseIpCfg.getDestPort());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO 判断源端口和目的端口格式
|
//TODO 判断源端口和目的端口格式
|
||||||
//TODO 判断源和目的端口的值
|
//TODO 判断源和目的端口的值
|
||||||
|
|
||||||
if(StringUtil.isEmpty(ipCfg.getProtocol())){
|
if(StringUtil.isEmpty(baseIpCfg.getProtocol())){
|
||||||
if(StringUtil.isEmpty(regionDict.getConfigProtocol())){
|
if(StringUtil.isEmpty(regionDict.getConfigProtocol())){
|
||||||
baseIpCfg.setProtocol(0);
|
baseIpCfg.setProtocol(0);
|
||||||
}else{
|
}else{
|
||||||
@@ -945,24 +947,23 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
baseIpCfg.setProtocolId(serviceDict.getProtocolId());
|
baseIpCfg.setProtocolId(serviceDict.getProtocolId());
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setProtocol(ipCfg.getProtocol());
|
baseIpCfg.setProtocol(baseIpCfg.getProtocol());
|
||||||
baseIpCfg.setProtocolId(serviceDict.getProtocolId());
|
baseIpCfg.setProtocolId(serviceDict.getProtocolId());
|
||||||
}
|
}
|
||||||
//TODO 判断Protocol的值
|
//TODO 判断Protocol的值
|
||||||
|
|
||||||
if(StringUtil.isEmpty(ipCfg.getDirection())){
|
if(StringUtil.isEmpty(baseIpCfg.getDirection())){
|
||||||
if(StringUtil.isEmpty(regionDict.getConfigDirection())){
|
if(StringUtil.isEmpty(regionDict.getConfigDirection())){
|
||||||
baseIpCfg.setDirection(0);
|
baseIpCfg.setDirection(0);
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setDirection(Integer.parseInt(regionDict.getConfigDirection().split(",")[0]));
|
baseIpCfg.setDirection(Integer.parseInt(regionDict.getConfigDirection().split(",")[0]));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
baseIpCfg.setDirection(ipCfg.getDirection());
|
baseIpCfg.setDirection(baseIpCfg.getDirection());
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO 判断Direction的值
|
//TODO 判断Direction的值
|
||||||
}
|
}
|
||||||
}
|
|
||||||
ipList.add(baseIpCfg);
|
ipList.add(baseIpCfg);
|
||||||
}
|
}
|
||||||
return ipList;
|
return ipList;
|
||||||
@@ -2159,40 +2160,48 @@ public class BaseController {
|
|||||||
ImportExcel ei = new ImportExcel(file, 0, 0);
|
ImportExcel ei = new ImportExcel(file, 0, 0);
|
||||||
|
|
||||||
FunctionRegionDict regionDict=DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
FunctionRegionDict regionDict=DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||||
|
if(regionDict.getFunctionId().equals(5) ){
|
||||||
if(regionDict.getIsMaat().equals(1)){
|
if(serviceDict.getAction().equals(64)){//ip
|
||||||
if(regionDict.getRegionType().equals(1)){
|
if(regionDict.getRegionType().equals(1)){
|
||||||
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class);
|
List<IpRateLimitTemplate> list = ei.getDataList(IpRateLimitTemplate.class);
|
||||||
ipPortCfgs=this.checkIpCfg(serviceDict,regionDict,list);
|
ipPortCfgs=this.checkIpCfg(serviceDict,regionDict,list);
|
||||||
Date date=new Date();
|
}
|
||||||
for(BaseIpCfg cfg : ipPortCfgs){
|
}else{
|
||||||
CfgIndexInfo cfgIndexInfo=new CfgIndexInfo();
|
if(regionDict.getRegionType().equals(1)){
|
||||||
cfg.setAction(serviceDict.getAction());
|
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class);
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
ipPortCfgs=this.checkIpCfg(serviceDict,regionDict,list);
|
||||||
cfg.setAuditTime(date);
|
|
||||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
|
||||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
|
||||||
cfg.setCreateTime(date);
|
|
||||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
|
||||||
cfg.setDoLog(1);
|
|
||||||
cfg.setFunctionId(regionDict.getFunctionId());
|
|
||||||
cfg.setIsAudit(0);
|
|
||||||
cfg.setIsValid(0);
|
|
||||||
cfg.setIsAreaEffective(0);
|
|
||||||
cfg.setAttribute("0");
|
|
||||||
cfg.setClassify("0");
|
|
||||||
cfg.setLable("0");
|
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0:requestId);
|
|
||||||
cfg.setServiceId(serviceDict.getServiceId());
|
|
||||||
cfg.setTableName("ip_port_cfg");
|
|
||||||
cfg.setCompileId(ipCfgService.getCompileId());
|
|
||||||
|
|
||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if(regionDict.getRegionType().equals(1)){
|
||||||
|
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class);
|
||||||
|
ipPortCfgs=this.checkIpCfg(serviceDict,regionDict,list);
|
||||||
}
|
}
|
||||||
|
Date date=new Date();
|
||||||
|
for(BaseIpCfg cfg : ipPortCfgs){
|
||||||
|
CfgIndexInfo cfgIndexInfo=new CfgIndexInfo();
|
||||||
|
cfg.setAction(serviceDict.getAction());
|
||||||
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setDoLog(1);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
cfg.setIsAudit(0);
|
||||||
|
cfg.setIsValid(0);
|
||||||
|
cfg.setIsAreaEffective(0);
|
||||||
|
cfg.setAttribute("0");
|
||||||
|
cfg.setClassify("0");
|
||||||
|
cfg.setLable("0");
|
||||||
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0:requestId);
|
||||||
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
|
cfg.setTableName("ip_port_cfg");
|
||||||
|
cfg.setCompileId(ipCfgService.getCompileId());
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
||||||
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
|
}
|
||||||
ipCfgService.saveBatch(ipPortCfgs, IpCfgDao.class);
|
ipCfgService.saveBatch(ipPortCfgs, IpCfgDao.class);
|
||||||
ipCfgService.saveCfgIndexOf(cfgIndexInfos);
|
ipCfgService.saveCfgIndexOf(cfgIndexInfos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ import com.nis.util.StringUtil;
|
|||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
|
import it.sauronsoftware.jave.AudioInfo;
|
||||||
|
import it.sauronsoftware.jave.Encoder;
|
||||||
|
import it.sauronsoftware.jave.MultimediaInfo;
|
||||||
|
import it.sauronsoftware.jave.VideoInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理音视频业务
|
* 处理音视频业务
|
||||||
* @author zhangwei
|
* @author zhangwei
|
||||||
@@ -157,11 +162,33 @@ public class AvController extends BaseController {
|
|||||||
|
|
||||||
// entity.setSrcMd5(srcMd5);
|
// entity.setSrcMd5(srcMd5);
|
||||||
// entity.setSampleMd5(sampleMd5);
|
// entity.setSampleMd5(sampleMd5);
|
||||||
|
//验证音视频文件时长
|
||||||
|
Encoder encoder = new Encoder();
|
||||||
|
String length = "";
|
||||||
|
try {
|
||||||
|
MultimediaInfo m = encoder.getInfo(uploadSrcFile);
|
||||||
|
long ls = m.getDuration()/1000;
|
||||||
|
int hour = (int) (ls/3600);
|
||||||
|
int minute = (int) (ls%3600)/60;
|
||||||
|
int second = (int) (ls-hour*3600-minute*60);
|
||||||
|
length = hour+"'"+minute+"''"+second+"'''";
|
||||||
|
logger.info(uploadSrcFile.getName()+"时长:"+length);
|
||||||
|
if(ls>0 && second>Constants.AV_DURATION_LIMIT){
|
||||||
|
addMessage(redirectAttributes,"exceeds_duration_limit");
|
||||||
|
logger.error("The duration of uploaded files exceeds the limit("+Constants.AV_DURATION_LIMIT+"s).");
|
||||||
|
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+entity.getFunctionId();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
addMessage(redirectAttributes,"save_failed");
|
||||||
|
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+entity.getFunctionId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
avCfgService.saveOrUpdateAvFileSample(entity, srcFile);
|
avCfgService.saveOrUpdateAvFileSample(entity, srcFile);
|
||||||
addMessage(redirectAttributes,"save_success");
|
addMessage(redirectAttributes,"save_success");
|
||||||
|
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("文件上传失败",e);
|
logger.error("文件上传失败",e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||||
|
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||||
import com.nis.domain.specific.ConfigGroupInfo;
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
@@ -226,32 +227,41 @@ public class IpController extends BaseController{
|
|||||||
,FunctionRegionDict regionDict
|
,FunctionRegionDict regionDict
|
||||||
,FunctionServiceDict serviceDict
|
,FunctionServiceDict serviceDict
|
||||||
,Integer requestId) throws Exception{
|
,Integer requestId) throws Exception{
|
||||||
String fileName = "test.xlsx";
|
String fileName = "template.xlsx";
|
||||||
//maat导入模板
|
|
||||||
if(regionDict.getIsMaat().equals(1)){
|
|
||||||
//ip类模板
|
//ip类模板
|
||||||
if(regionDict.getRegionType().equals(1)){
|
if(regionDict.getFunctionId().equals(5)){
|
||||||
|
if(regionDict.getRegionType().equals(1)){
|
||||||
|
if(serviceDict.getAction().equals(64)){//ip限速
|
||||||
|
List<IpRateLimitTemplate> classList=new ArrayList<IpRateLimitTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpRateLimitTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else{
|
||||||
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(regionDict.getRegionType().equals(1)){
|
||||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}
|
}
|
||||||
//str类模板
|
/*//str类模板
|
||||||
if(regionDict.getRegionType().equals(2)){
|
if(regionDict.getRegionType().equals(2)){
|
||||||
/*List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(this.getMsgProp(),null, IpAllTemplate.class, 2,regionDict);
|
ExportExcel excel=new ExportExcel(this.getMsgProp(),null, IpAllTemplate.class, 2,regionDict);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
write(request,response, fileName).dispose();*/
|
write(request,response, fileName).dispose();
|
||||||
}
|
}
|
||||||
//district类模板
|
//district类模板
|
||||||
if(regionDict.getRegionType().equals(2)){
|
if(regionDict.getRegionType().equals(2)){
|
||||||
/*ExportExcel excel=new ExportExcel(this.getMsgProp(),null, IpAllTemplate.class, 2,regionDict);
|
ExportExcel excel=new ExportExcel(this.getMsgProp(),null, IpAllTemplate.class, 2,regionDict);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
write(request,response, fileName).dispose();*/
|
write(request,response, fileName).dispose();
|
||||||
}
|
}*/
|
||||||
}else{
|
|
||||||
//非maat导入模板
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//ip配置导入
|
//ip配置导入
|
||||||
|
|||||||
@@ -758,6 +758,8 @@ public abstract class BaseService {
|
|||||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||||
cfg.setGroupId(groupId);
|
cfg.setGroupId(groupId);
|
||||||
cfg.setRegionId(Integer.parseInt(appIpCfg.getUserRegion1()));
|
cfg.setRegionId(Integer.parseInt(appIpCfg.getUserRegion1()));
|
||||||
|
String userRegion = "APP_ID=" + appIpCfg.getAppCode();
|
||||||
|
cfg.setUserRegion(userRegion);
|
||||||
}
|
}
|
||||||
cfg.setIsValid(isValid);
|
cfg.setIsValid(isValid);
|
||||||
cfg = ipConvert(cfg,baseIpCfg);
|
cfg = ipConvert(cfg,baseIpCfg);
|
||||||
|
|||||||
@@ -1161,6 +1161,8 @@ public class AppCfgService extends BaseService {
|
|||||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||||
|
/*groupReuseCfg.setUserRegion(userRegion);*/
|
||||||
|
groupReuseCfg.setServiceId(entitys.get(0).getServiceId());
|
||||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_YES,groupId));
|
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_YES,groupId));
|
||||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||||
groupReuseCfg.setStrRegionList(strRegionList);
|
groupReuseCfg.setStrRegionList(strRegionList);
|
||||||
|
|||||||
@@ -1246,3 +1246,4 @@ mail_address_monit=Mail Address Monit
|
|||||||
mail_address_reject=Mail Address Reject
|
mail_address_reject=Mail Address Reject
|
||||||
ipsec_protocol=IPSEC Protocol
|
ipsec_protocol=IPSEC Protocol
|
||||||
intercept_intensity=Intercept Related Domains
|
intercept_intensity=Intercept Related Domains
|
||||||
|
exceeds_duration_limit=File upload failure,The duration of uploaded files exceeds the limit.
|
||||||
@@ -1266,3 +1266,4 @@ mail_address_monit=Mail Address Monit
|
|||||||
mail_address_reject=Mail Address Reject
|
mail_address_reject=Mail Address Reject
|
||||||
ipsec_protocol=IPSEC Protocol
|
ipsec_protocol=IPSEC Protocol
|
||||||
intercept_intensity=Intercept Related Domains
|
intercept_intensity=Intercept Related Domains
|
||||||
|
exceeds_duration_limit=File upload failure,The duration of uploaded files exceeds the limit.
|
||||||
@@ -1240,4 +1240,4 @@ mail_address_monit=\u90AE\u4EF6\u5730\u5740\u76D1\u6D4B
|
|||||||
mail_address_reject=\u90AE\u4EF6\u5730\u5740\u7BA1\u63A7
|
mail_address_reject=\u90AE\u4EF6\u5730\u5740\u7BA1\u63A7
|
||||||
ipsec_protocol=IPSEC\u534F\u8BAE
|
ipsec_protocol=IPSEC\u534F\u8BAE
|
||||||
intercept_intensity=\u62E6\u622A\u5F3A\u5EA6
|
intercept_intensity=\u62E6\u622A\u5F3A\u5EA6
|
||||||
|
exceeds_duration_limit=\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25,\u6587\u4EF6\u65F6\u957F\u8D85\u51FA\u9650\u5236.
|
||||||
|
|||||||
@@ -529,3 +529,5 @@ area_tag=location
|
|||||||
isp_tag=isp
|
isp_tag=isp
|
||||||
mmFileDigestLog=mmFileDigestLogs
|
mmFileDigestLog=mmFileDigestLogs
|
||||||
ntcStreamMediaLog=ntcStreamMediaLogs
|
ntcStreamMediaLog=ntcStreamMediaLogs
|
||||||
|
#音视频样例限制时长,单位秒
|
||||||
|
av_duration_limit=10
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
alter table cfg_num_statistics modify column id bigint;
|
||||||
|
alter table request_num_statistics modify column id bigint;
|
||||||
|
alter table proc_exec_log modify column id bigint;
|
||||||
|
alter table sys_log modify column id bigint;
|
||||||
@@ -31,30 +31,28 @@ $(function(){
|
|||||||
</label>
|
</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<c:forEach items="${serviceList}" var="service"
|
<c:forEach items="${serviceList}" var="service"
|
||||||
varStatus="satus">
|
varStatus="satus">
|
||||||
<label class="radio-inline">
|
<c:if test="${(service.serviceId ne 37) && (service.serviceId ne 149)}">
|
||||||
<c:if test="${cfg.functionId eq service.functionId}">
|
<label class="radio-inline"> <c:if
|
||||||
<c:forEach items="${fns:getDictList('MAAT_SERVICE')}" var="serviceC">
|
test="${cfg.functionId eq service.functionId}">
|
||||||
<c:if test="${service.serviceId==serviceC.itemCode}">
|
<input type="radio" name="serviceDictId"
|
||||||
<span class="${serviceC.itemValue}">
|
|
||||||
<input type="radio" name="serviceDictId" <c:if test="${serviceList.size() eq 1}">checked</c:if>
|
|
||||||
serviceId="${service.serviceId }"
|
serviceId="${service.serviceId }"
|
||||||
functionId="${service.functionId }"
|
functionId="${service.functionId }"
|
||||||
cfgRegionCodeS="${service.regionCode }"
|
cfgRegionCodeS="${service.regionCode }"
|
||||||
protocolId="${service.protocolId }"
|
protocolId="${service.protocolId }"
|
||||||
action="${service.action }"
|
action="${service.action }"
|
||||||
value="${service.dictId }" class="required action">
|
value="${service.dictId }"
|
||||||
|
class="required action"
|
||||||
|
<c:if test="${satus.index eq 0}">checked</c:if>>
|
||||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
<c:if test="${dict.itemCode eq service.action}">
|
<c:if test="${dict.itemCode eq service.action }">
|
||||||
<spring:message code="${dict.itemValue }"/>
|
<spring:message code="${dict.itemValue }"/>
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</span>
|
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</label>
|
||||||
</c:if>
|
</c:if>
|
||||||
</label>
|
</c:forEach>
|
||||||
</c:forEach>
|
|
||||||
</div>
|
</div>
|
||||||
<div for="action"></div>
|
<div for="action"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
|||||||
<input class="form-control" type="text" name="userRegion1"
|
<input class="form-control" type="text" name="userRegion1"
|
||||||
value="${_cfg.userRegion1}">
|
value="${_cfg.userRegion1}">
|
||||||
</div>
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,10 +88,10 @@ function hiddenlevel(){
|
|||||||
var action=$("input[name='action']:checked").val();
|
var action=$("input[name='action']:checked").val();
|
||||||
if(action==16){
|
if(action==16){
|
||||||
$(".leveL").addClass("hidden");
|
$(".leveL").addClass("hidden");
|
||||||
$("input[name='level']").val(0);
|
$("select[name='level']").val(0);
|
||||||
}else {
|
}else {
|
||||||
$(".leveL").removeClass("hidden");
|
$(".leveL").removeClass("hidden");
|
||||||
$("input[name='level']").val(0);
|
$("select[name='level']").val(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -215,7 +215,12 @@ function hiddenlevel(){
|
|||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="harm_level"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="harm_level"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control required number" range="[75,99]" type="text" name="level" value="${_cfg.level }">
|
<select name="level" data-live-search="true" class="selectpicker form-control required">
|
||||||
|
<option value="0" ><spring:message code="selected"/></option>
|
||||||
|
<c:forEach items="${fns:getDictList('CONFIDENCE_INTERVAL')}" var="configdenceC">
|
||||||
|
<option value="${configdenceC.itemCode}" <c:if test="${_cfg.level==configdenceC.itemCode || (_cfg.level==null && configdenceC.itemCode eq 100)}">selected</c:if>><spring:message code="${configdenceC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div for="level"></div>
|
<div for="level"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,8 +41,9 @@
|
|||||||
<c:if test="${cfg.district==_district}">selected</c:if>>${_district }</option>
|
<c:if test="${cfg.district==_district}">selected</c:if>>${_district }</option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" name="${cfgName}.districtShowName" placeholder="<spring:message code='please_input'/> <spring:message code='custom_region'/>" class="otherValue form-control" value="${cfg.district}"/>
|
<input type="hidden" name="${cfgName}.districtShowName" placeholder="<spring:message code='please_input'/> <spring:message code='custom_region'/>" class="otherValue form-control invisibleChar" value="${cfg.district}"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div for="${cfgName}.districtShowName"></div>
|
||||||
<div for="${cfgName}.district"></div>
|
<div for="${cfgName}.district"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
$(".bandwith").find("input[name='userRegion3']").attr("disabled",true);
|
$(".bandwith").find("input[name='userRegion3']").attr("disabled",true);
|
||||||
}
|
}
|
||||||
if(rateLimitType == 1){//带宽
|
if(rateLimitType == 1){//带宽
|
||||||
$(".droprate").find("input[name='userRegion2']").attr("disabled",true);
|
$(".droprate").find("select[name='userRegion2']").attr("disabled",true);
|
||||||
}
|
}
|
||||||
}else if(action==80){//替换
|
}else if(action==80){//替换
|
||||||
$(".monitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
$(".monitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
||||||
@@ -317,7 +317,12 @@
|
|||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control required number" range="[0,1]" type="text" placeholder="0.001" name="userRegion2" value="${_cfg.userRegion2 }">
|
<select name="userRegion2" data-live-search="true" class="selectpicker form-control required">
|
||||||
|
<option value="" ><spring:message code="selected"/></option>
|
||||||
|
<c:forEach items="${fns:getDictList('RATE_LIMIT')}" var="ratelimitC">
|
||||||
|
<option value="${ratelimitC.itemCode}" <c:if test="${_cfg.userRegion2==ratelimitC.itemCode || (_cfg.userRegion2==null && ratelimitC.itemCode eq '0.001')}">selected</c:if>><spring:message code="${ratelimitC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div for="userRegion2"></div>
|
<div for="userRegion2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -375,7 +375,11 @@
|
|||||||
<c:if test="${cfg.functionId ne 212 }">
|
<c:if test="${cfg.functionId ne 212 }">
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${indexCfg.action eq 64}">
|
<c:if test="${indexCfg.action eq 64}">
|
||||||
${indexCfg.userRegion2 }
|
<c:forEach items="${fns:getDictList('RATE_LIMIT')}" var="ratelimitC">
|
||||||
|
<c:if test="${indexCfg.userRegion2==ratelimitC.itemCode}">
|
||||||
|
<spring:message code="${ratelimitC.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
</c:if>
|
</c:if>
|
||||||
</td>
|
</td>
|
||||||
<%-- <td>
|
<%-- <td>
|
||||||
|
|||||||
@@ -337,11 +337,13 @@ var processAction=function(configType,obj){
|
|||||||
var rateLimitType=$("input[name='userRegion1']:checked").val();
|
var rateLimitType=$("input[name='userRegion1']:checked").val();
|
||||||
if(rateLimitType == 0){//丢包率
|
if(rateLimitType == 0){//丢包率
|
||||||
$(".bandwith").find("input[name='userRegion3']").attr("disabled",true);
|
$(".bandwith").find("input[name='userRegion3']").attr("disabled",true);
|
||||||
$(".droprate").find("input[name='userRegion2']").removeAttr("disabled");
|
$(".droprate").find("select[name='userRegion2']").removeAttr("disabled");
|
||||||
|
$(".droprate").find("select[name='userRegion2']").selectpicker("refresh");
|
||||||
}
|
}
|
||||||
if(rateLimitType == 1){//带宽
|
if(rateLimitType == 1){//带宽
|
||||||
$(".bandwith").find("input[name='userRegion3']").removeAttr("disabled");
|
$(".bandwith").find("input[name='userRegion3']").removeAttr("disabled");
|
||||||
$(".droprate").find("input[name='userRegion2']").attr("disabled",true);
|
$(".droprate").find("select[name='userRegion2']").attr("disabled",true);
|
||||||
|
$(".droprate").find("select[name='userRegion2']").selectpicker("refresh");
|
||||||
}
|
}
|
||||||
}else if(action==1){
|
}else if(action==1){
|
||||||
//先清空,再添加
|
//先清空,再添加
|
||||||
@@ -545,7 +547,12 @@ var showHideIPSECProtocol=function(obj){
|
|||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control required number" range="[0,1]" type="text" placeholder="0.001" name="userRegion2" value="${_cfg.userRegion2 }">
|
<select name="userRegion2" data-live-search="true" class="selectpicker form-control required">
|
||||||
|
<option value="" ><spring:message code="selected"/></option>
|
||||||
|
<c:forEach items="${fns:getDictList('RATE_LIMIT')}" var="ratelimitC">
|
||||||
|
<option value="${ratelimitC.itemCode}" <c:if test="${_cfg.userRegion2==ratelimitC.itemCode || (_cfg.userRegion2==null && ratelimitC.itemCode eq '0.001')}">selected</c:if>><spring:message code="${ratelimitC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div for="userRegion2"></div>
|
<div for="userRegion2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,12 +85,17 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
<div class="theme-panel hidden-xs hidden-sm">
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
<shiro:hasPermission name="iplist:config">
|
<shiro:hasPermission name="iplist:config">
|
||||||
<button type="button" class="btn btn-primary"
|
<button type="button" class="btn btn-primary"
|
||||||
onClick="javascript:window.location='${ctx}/ntc/iplist/form?functionId=${cfg.functionId}'">
|
onClick="javascript:window.location='${ctx}/ntc/iplist/form?functionId=${cfg.functionId}'">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
<spring:message code="add"></spring:message></button>
|
<spring:message code="add"></spring:message></button>
|
||||||
|
<button type="button" class="btn btn-primary import" >
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="import"></spring:message></button>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -166,7 +171,7 @@
|
|||||||
<shiro:hasPermission name="iplist:config">
|
<shiro:hasPermission name="iplist:config">
|
||||||
<sys:delRow url="${ctx}/ntc/iplist/form" id="contentTable" label="update"></sys:delRow>
|
<sys:delRow url="${ctx}/ntc/iplist/form" id="contentTable" label="update"></sys:delRow>
|
||||||
<sys:delRow url="${ctx}/ntc/iplist/updateValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
<sys:delRow url="${ctx}/ntc/iplist/updateValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||||
<%-- <sys:delRow url="${ctx}/ntc/iplist/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/iplist/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
<sys:delRow url="${ctx}/ntc/iplist/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/iplist/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
<shiro:hasPermission name="iplist:confirm">
|
<shiro:hasPermission name="iplist:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -357,7 +362,13 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</td>
|
||||||
<td>${indexCfg.userRegion2 }</td>
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('RATE_LIMIT')}" var="ratelimitC">
|
||||||
|
<c:if test="${indexCfg.userRegion2==ratelimitC.itemCode}">
|
||||||
|
<spring:message code="${ratelimitC.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||||
|
|||||||
Reference in New Issue
Block a user