(1)细化IPV4掩码范围验证的提示
(2)IP不能为xxxx的提示前方加入空格 (3)DNS响应策略导入模板,导入功能提交
This commit is contained in:
@@ -32,7 +32,19 @@ public class DnsResStrategy extends BaseCfg<DnsResStrategy> {
|
|||||||
private String group1Name;
|
private String group1Name;
|
||||||
@ExcelField(title="min_ttl",sort=4)
|
@ExcelField(title="min_ttl",sort=4)
|
||||||
private String miTtlmax;
|
private String miTtlmax;
|
||||||
|
//仅作导入使用
|
||||||
|
private String ttl;
|
||||||
|
|
||||||
|
public String getTtl() {
|
||||||
|
return ttl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setTtl(String ttl) {
|
||||||
|
this.ttl = ttl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initDefaultValue() {
|
public void initDefaultValue() {
|
||||||
this.resGroup2Id=0;
|
this.resGroup2Id=0;
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
public class DnsResStrategyTemplate {
|
||||||
|
@ExcelField(title="policy_name",align=2,sort=1)
|
||||||
|
private String cfgDesc;
|
||||||
|
@ExcelField(title="group",align=2,sort=2)
|
||||||
|
private Integer resGroup1Id;
|
||||||
|
@ExcelField(title="res_group_num",align=2,sort=3)
|
||||||
|
private Integer resGroup1Num;
|
||||||
|
@ExcelField(title="min_ttl",align=2,sort=4)
|
||||||
|
private String ttl;
|
||||||
|
public String getCfgDesc() {
|
||||||
|
return cfgDesc;
|
||||||
|
}
|
||||||
|
public void setCfgDesc(String cfgDesc) {
|
||||||
|
this.cfgDesc = cfgDesc;
|
||||||
|
}
|
||||||
|
public Integer getResGroup1Id() {
|
||||||
|
return resGroup1Id;
|
||||||
|
}
|
||||||
|
public void setResGroup1Id(Integer resGroup1Id) {
|
||||||
|
this.resGroup1Id = resGroup1Id;
|
||||||
|
}
|
||||||
|
public Integer getResGroup1Num() {
|
||||||
|
return resGroup1Num;
|
||||||
|
}
|
||||||
|
public void setResGroup1Num(Integer resGroup1Num) {
|
||||||
|
this.resGroup1Num = resGroup1Num;
|
||||||
|
}
|
||||||
|
public String getTtl() {
|
||||||
|
return ttl;
|
||||||
|
}
|
||||||
|
public void setTtl(String ttl) {
|
||||||
|
this.ttl = ttl;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,6 +60,7 @@ public final class Constants {
|
|||||||
* IP验证正则
|
* IP验证正则
|
||||||
*/
|
*/
|
||||||
public static final String IPV4_IP_SUBNET_REGEXP=Configurations.getStringProperty("ipv4_ip_subnet_regexp", "*");
|
public static final String IPV4_IP_SUBNET_REGEXP=Configurations.getStringProperty("ipv4_ip_subnet_regexp", "*");
|
||||||
|
public static final String IPV4_IP_SUBNET_REGEXP_ORIGINAL=Configurations.getStringProperty("ipv4_ip_subnet_regexp_original", "*");
|
||||||
public static final String IPV6_IP_SUBNET_REGEXP=Configurations.getStringProperty("ipv6_ip_subnet_regexp", "*");
|
public static final String IPV6_IP_SUBNET_REGEXP=Configurations.getStringProperty("ipv6_ip_subnet_regexp", "*");
|
||||||
public static final String IPV4_IP_RANGE_REGEXP=Configurations.getStringProperty("ipv4_ip_range_regexp", "*");
|
public static final String IPV4_IP_RANGE_REGEXP=Configurations.getStringProperty("ipv4_ip_range_regexp", "*");
|
||||||
//0.0.0.1-2这种格式
|
//0.0.0.1-2这种格式
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.nis.util.excel;
|
package com.nis.util.excel;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -16,7 +15,6 @@ import java.util.Collections;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
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;
|
||||||
@@ -29,7 +27,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
import org.apache.poi.ss.usermodel.Comment;
|
import org.apache.poi.ss.usermodel.Comment;
|
||||||
import org.apache.poi.ss.usermodel.DataFormat;
|
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
import org.apache.poi.ss.usermodel.Font;
|
||||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
@@ -41,7 +38,6 @@ 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.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.nis.domain.FunctionRegionDict;
|
import com.nis.domain.FunctionRegionDict;
|
||||||
@@ -56,15 +52,10 @@ import com.nis.util.DictUtils;
|
|||||||
import com.nis.util.Encodes;
|
import com.nis.util.Encodes;
|
||||||
import com.nis.util.Reflections;
|
import com.nis.util.Reflections;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.dao.FunctionServiceDictDao;
|
|
||||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||||
import com.nis.web.dao.configuration.DnsResStrategyDao;
|
import com.nis.web.dao.configuration.DnsResStrategyDao;
|
||||||
import com.nis.web.service.SpringContextHolder;
|
import com.nis.web.service.SpringContextHolder;
|
||||||
import com.nis.web.service.configuration.DnsResStrategyService;
|
|
||||||
import com.sun.xml.internal.rngom.ast.builder.CommentList;
|
|
||||||
|
|
||||||
import sun.util.logging.resources.logging;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出Excel文件(导出“XLSX”格式,支持大数据量导出 @see org.apache.poi.ss.SpreadsheetVersion)
|
* 导出Excel文件(导出“XLSX”格式,支持大数据量导出 @see org.apache.poi.ss.SpreadsheetVersion)
|
||||||
@@ -262,35 +253,36 @@ public class ExportExcel {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
if("policy_name".equals(headerStr)){
|
if("policy_name".equals(headerStr)){
|
||||||
|
if(region.getFunctionId().intValue()!=400) {//400 policy_name为DNS响应策略
|
||||||
if(service.getAction().equals(1)){
|
if(service.getAction().equals(1)){
|
||||||
headerStr="";
|
headerStr="";
|
||||||
commentStr="";
|
commentStr="";
|
||||||
}else{
|
}else{
|
||||||
List<DnsResStrategy> resStrategys=dnsResStrategyDao.findList(null, 1,1);
|
List<DnsResStrategy> resStrategys=dnsResStrategyDao.findList(null, 1,1);
|
||||||
commentStr=commentStr+"0"+"("+msgProp.getProperty("no_strategy")+")\n";
|
commentStr=commentStr+"0"+"("+msgProp.getProperty("no_strategy")+")\n";
|
||||||
index++;
|
index++;
|
||||||
defaultValue="0";
|
defaultValue="0";
|
||||||
if(!StringUtil.isEmpty(resStrategys)){
|
if(!StringUtil.isEmpty(resStrategys)){
|
||||||
for (DnsResStrategy dnsResStrategy : resStrategys) {
|
for (DnsResStrategy dnsResStrategy : resStrategys) {
|
||||||
commentStr=commentStr+dnsResStrategy.getCfgId()+"("+dnsResStrategy.getCfgDesc()+")\n";
|
commentStr=commentStr+dnsResStrategy.getCfgId()+"("+dnsResStrategy.getCfgDesc()+")\n";
|
||||||
index++;
|
index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if(StringUtil.isEmpty(headerStr)){
|
||||||
if(StringUtil.isEmpty(headerStr)){
|
headerStr="";
|
||||||
headerStr="";
|
commentStr="";
|
||||||
commentStr="";
|
}else{
|
||||||
}else{
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
|
||||||
index++;
|
|
||||||
index++;
|
|
||||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
|
||||||
index++;
|
|
||||||
if(!StringUtil.isEmpty(defaultValue)){
|
|
||||||
//2、默认值说明
|
|
||||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
|
||||||
index++;
|
index++;
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
if(!StringUtil.isEmpty(defaultValue)){
|
||||||
|
//2、默认值说明
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1157,6 +1149,31 @@ public class ExportExcel {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if(region.getRegionType().equals(6)) {
|
||||||
|
if(region.getFunctionId().equals(400)) {
|
||||||
|
if("group".equals(headerStr)){
|
||||||
|
commentStr="";
|
||||||
|
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(1);
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
for (PolicyGroupInfo policyGroupInfo : list) {
|
||||||
|
commentStr=commentStr+policyGroupInfo.getGroupId()+"("+policyGroupInfo.getGroupName()+")\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("res_group_num".equals(headerStr)) {
|
||||||
|
commentStr=msgProp.getProperty("input_integer")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("min_ttl".equals(headerStr)) {
|
||||||
|
commentStr="1-2";
|
||||||
|
index++;
|
||||||
|
commentStr=msgProp.getProperty("example_tip")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
titleInfo[0]=headerStr;
|
titleInfo[0]=headerStr;
|
||||||
titleInfo[1]=commentStr;
|
titleInfo[1]=commentStr;
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
|||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsIpTemplate;
|
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
||||||
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.IpPayloadTemplate;
|
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||||
@@ -79,6 +80,7 @@ import com.nis.util.DateUtils;
|
|||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.JsonMapper;
|
import com.nis.util.JsonMapper;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
import com.nis.util.excel.ExportExcel;
|
import com.nis.util.excel.ExportExcel;
|
||||||
import com.nis.util.excel.ImportExcel;
|
import com.nis.util.excel.ImportExcel;
|
||||||
import com.nis.web.dao.configuration.IpCfgDao;
|
import com.nis.web.dao.configuration.IpCfgDao;
|
||||||
@@ -1064,7 +1066,7 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
return stringList;
|
return stringList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ComplexkeywordCfg> checkComplexStringCfg(FunctionServiceDict serviceDict, FunctionRegionDict regionDict,
|
public List<ComplexkeywordCfg> checkComplexStringCfg(FunctionServiceDict serviceDict, FunctionRegionDict regionDict,
|
||||||
List<?> list) throws ServiceException {
|
List<?> list) throws ServiceException {
|
||||||
List<ComplexkeywordCfg> stringList = new ArrayList<ComplexkeywordCfg>();
|
List<ComplexkeywordCfg> stringList = new ArrayList<ComplexkeywordCfg>();
|
||||||
@@ -1622,7 +1624,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
if (baseIpCfg.getSrcIpAddress()
|
if (baseIpCfg.getSrcIpAddress()
|
||||||
.startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
.startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||||
errInfo.append(prop.getProperty("client_ip")
|
errInfo.append(prop.getProperty("client_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1634,7 +1636,7 @@ public class BaseController {
|
|||||||
if (baseIpCfg.getSrcIpAddress()
|
if (baseIpCfg.getSrcIpAddress()
|
||||||
.startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
.startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||||
errInfo.append(
|
errInfo.append(
|
||||||
prop.getProperty("client_ip")
|
prop.getProperty("client_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1644,7 +1646,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
|
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
|
||||||
errInfo.append(prop.getProperty("client_ip") + String.format(
|
errInfo.append(prop.getProperty("client_ip")+" " + String.format(
|
||||||
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
|
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1657,7 +1659,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
if (baseIpCfg.getSrcIpAddress()
|
if (baseIpCfg.getSrcIpAddress()
|
||||||
.startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
.startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||||
errInfo.append(prop.getProperty("client_ip")
|
errInfo.append(prop.getProperty("client_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1669,7 +1671,7 @@ public class BaseController {
|
|||||||
if (baseIpCfg.getSrcIpAddress()
|
if (baseIpCfg.getSrcIpAddress()
|
||||||
.startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
.startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||||
errInfo.append(
|
errInfo.append(
|
||||||
prop.getProperty("client_ip")
|
prop.getProperty("client_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1679,7 +1681,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
|
if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
|
||||||
errInfo.append(prop.getProperty("client_ip") + String.format(
|
errInfo.append(prop.getProperty("client_ip")+" " + String.format(
|
||||||
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
|
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1727,7 +1729,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
if (baseIpCfg.getDestIpAddress()
|
if (baseIpCfg.getDestIpAddress()
|
||||||
.startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
.startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||||
errInfo.append(prop.getProperty("server_ip")
|
errInfo.append(prop.getProperty("server_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1739,7 +1741,7 @@ public class BaseController {
|
|||||||
if (baseIpCfg.getDestIpAddress()
|
if (baseIpCfg.getDestIpAddress()
|
||||||
.startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
.startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||||
errInfo.append(
|
errInfo.append(
|
||||||
prop.getProperty("server_ip")
|
prop.getProperty("server_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1749,7 +1751,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE);
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
|
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) {
|
||||||
errInfo.append(prop.getProperty("server_ip") + String.format(
|
errInfo.append(prop.getProperty("server_ip")+" " + String.format(
|
||||||
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
|
prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE) + ";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1764,7 +1766,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setIpPattern(2);
|
baseIpCfg.setIpPattern(2);
|
||||||
if (baseIpCfg.getDestIpAddress()
|
if (baseIpCfg.getDestIpAddress()
|
||||||
.startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
.startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) {
|
||||||
errInfo.append(prop.getProperty("server_ip")
|
errInfo.append(prop.getProperty("server_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1776,7 +1778,7 @@ public class BaseController {
|
|||||||
if (baseIpCfg.getDestIpAddress()
|
if (baseIpCfg.getDestIpAddress()
|
||||||
.startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
.startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) {
|
||||||
errInfo.append(
|
errInfo.append(
|
||||||
prop.getProperty("server_ip")
|
prop.getProperty("server_ip")+" "
|
||||||
+ String.format(prop.getProperty("can_not_be"),
|
+ String.format(prop.getProperty("can_not_be"),
|
||||||
Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])
|
||||||
+ ";");
|
+ ";");
|
||||||
@@ -1786,7 +1788,7 @@ public class BaseController {
|
|||||||
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE);
|
||||||
baseIpCfg.setIpPattern(3);
|
baseIpCfg.setIpPattern(3);
|
||||||
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
|
if (baseIpCfg.getDestIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) {
|
||||||
errInfo.append(prop.getProperty("server_ip") + String.format(
|
errInfo.append(prop.getProperty("server_ip")+" " + String.format(
|
||||||
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
|
prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE) + ";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1924,7 +1926,85 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
return ipList;
|
return ipList;
|
||||||
}
|
}
|
||||||
|
public List<DnsResStrategy> checkDnsResStrategyCfg(FunctionServiceDict serviceDict, FunctionRegionDict regionDict, List<?> list)
|
||||||
|
throws ServiceException {
|
||||||
|
List<DnsResStrategy> dnsResStrategies=Lists.newArrayList();
|
||||||
|
Properties prop = this.getMsgProp();
|
||||||
|
StringBuffer errTip = new StringBuffer();
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
StringBuffer errInfo = new StringBuffer();
|
||||||
|
DnsResStrategy dnsResStrategy=new DnsResStrategy();
|
||||||
|
BeanUtils.copyProperties(list.get(i), dnsResStrategy);
|
||||||
|
String groupName=dnsResStrategy.getCfgDesc();
|
||||||
|
if(StringUtils.isBlank(groupName)) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
prop.getProperty("policy_name")) + ";");
|
||||||
|
}
|
||||||
|
Integer resGroup1Id=dnsResStrategy.getResGroup1Id();
|
||||||
|
if(resGroup1Id==null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
prop.getProperty("group")) + ";");
|
||||||
|
}else {
|
||||||
|
PolicyGroupInfo info=policyGroupInfoService.getById(resGroup1Id);
|
||||||
|
if(info==null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("group")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer resGroup1Num=dnsResStrategy.getResGroup1Num();
|
||||||
|
if(resGroup1Num==null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
prop.getProperty("res_group_num")) + ";");
|
||||||
|
}
|
||||||
|
String ttl=dnsResStrategy.getTtl();
|
||||||
|
if(StringUtils.isBlank(ttl)) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
prop.getProperty("min_ttl")) + ";");
|
||||||
|
}else {
|
||||||
|
Pattern p=Pattern.compile("\\d+\\-\\d+");
|
||||||
|
Matcher m=p.matcher(ttl);
|
||||||
|
if(!m.matches()) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("min_ttl")) + ";");
|
||||||
|
}else {
|
||||||
|
String minTtl=ttl.split("-")[0];
|
||||||
|
String maxTtl=ttl.split("-")[1];
|
||||||
|
Integer min=null,max=null;
|
||||||
|
try {
|
||||||
|
min=Integer.parseInt(minTtl);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("min_ttl")) + ";");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
max=Integer.parseInt(maxTtl);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("min_ttl")) + ";");
|
||||||
|
}
|
||||||
|
if(min.intValue()>max.intValue())
|
||||||
|
{errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("min_ttl")) + ";");
|
||||||
|
}else {
|
||||||
|
dnsResStrategy.setMinTtl(min);
|
||||||
|
dnsResStrategy.setMaxTtl(max);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errInfo.toString().length() > 0) {//
|
||||||
|
errTip.append(String.format(prop.getProperty("line"), i + 2) + ",");
|
||||||
|
errTip.append(errInfo);
|
||||||
|
errTip.append("<br>");
|
||||||
|
}
|
||||||
|
dnsResStrategies.add(dnsResStrategy);
|
||||||
|
}
|
||||||
|
if (errTip.toString().length() > 0) {
|
||||||
|
throw new ServiceException(errTip.toString());
|
||||||
|
}
|
||||||
|
return dnsResStrategies;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 协议与端口验证规则
|
* 协议与端口验证规则
|
||||||
*
|
*
|
||||||
@@ -2261,6 +2341,7 @@ public class BaseController {
|
|||||||
throws ServiceException {
|
throws ServiceException {
|
||||||
Properties prop = this.getMsgProp();
|
Properties prop = this.getMsgProp();
|
||||||
String matchType = "";
|
String matchType = "";
|
||||||
|
Pattern ipv4IpSubnetOriginalRegexp = Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP_ORIGINAL);
|
||||||
Pattern ipv4IpSubnetRegexp = Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP);
|
Pattern ipv4IpSubnetRegexp = Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP);
|
||||||
Pattern ipv6IpSubnetRegexp = Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP);
|
Pattern ipv6IpSubnetRegexp = Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP);
|
||||||
Pattern ipv4IpRangeRegexp = Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP);
|
Pattern ipv4IpRangeRegexp = Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP);
|
||||||
@@ -2291,9 +2372,14 @@ public class BaseController {
|
|||||||
if (matcher.matches()) {
|
if (matcher.matches()) {
|
||||||
matchType = "IPV6_IP_RANGE";
|
matchType = "IPV6_IP_RANGE";
|
||||||
} else {
|
} else {
|
||||||
errInfo.append(
|
matcher = ipv4IpSubnetOriginalRegexp.matcher(ip);
|
||||||
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty(ipName))
|
if(matcher.matches()) {
|
||||||
+ ";");
|
errInfo.append(prop.getProperty(ipName)+" "+prop.getProperty("ipv4_mask_range_tip")+ ";");
|
||||||
|
}else {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_in_wrong_format"), prop.getProperty(ipName))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2763,68 +2849,7 @@ public class BaseController {
|
|||||||
* @exception @since
|
* @exception @since
|
||||||
* 1.0.0
|
* 1.0.0
|
||||||
*/
|
*/
|
||||||
public static String checkIP(Properties prop, String ipName, String ip, String ipType, String ipPattern) {
|
@Deprecated
|
||||||
StringBuffer msg = new StringBuffer();
|
|
||||||
if (StringUtils.isBlank(ip)) {
|
|
||||||
msg.append(String.format(prop.getProperty("can_not_null"), ipName) + ";");
|
|
||||||
} else {
|
|
||||||
if ("ipv4".equals(ipType)) {
|
|
||||||
if ("ip_subnet".equals(ipPattern)) {
|
|
||||||
Pattern pattern = Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP);
|
|
||||||
Matcher matcher = pattern.matcher(ip);
|
|
||||||
if (!matcher.matches()) {// 完全匹配
|
|
||||||
msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName) + ";");
|
|
||||||
}
|
|
||||||
} else if ("ip_range".equals(ipPattern)) {
|
|
||||||
Pattern pattern = Pattern.compile(Constants.IPV4_IP_RANGE_REGEXP);
|
|
||||||
Matcher matcher = pattern.matcher(ip);
|
|
||||||
if (!matcher.matches()) {// 完全匹配
|
|
||||||
msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName) + ";");
|
|
||||||
}
|
|
||||||
} else if ("ip".equals(ipPattern)) {
|
|
||||||
Pattern pattern = Pattern.compile(Constants.IPV4_IP_REGEXP);
|
|
||||||
Matcher matcher = pattern.matcher(ip);
|
|
||||||
if (!matcher.matches()) {// 完全匹配
|
|
||||||
msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName) + ";");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if ("ipv6".equals(ipType)) {
|
|
||||||
if ("ip_subnet".equals(ipPattern)) {
|
|
||||||
Pattern pattern = Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP);
|
|
||||||
Matcher matcher = pattern.matcher(ip);
|
|
||||||
if (!matcher.matches()) {// 完全匹配
|
|
||||||
msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName) + ";");
|
|
||||||
}
|
|
||||||
} else if ("ip_range".equals(ipPattern)) {
|
|
||||||
Pattern pattern = Pattern.compile(Constants.IPV6_IP_RANGE_REGEXP);
|
|
||||||
Matcher matcher = pattern.matcher(ip);
|
|
||||||
if (!matcher.matches()) {// 完全匹配
|
|
||||||
msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName) + ";");
|
|
||||||
}
|
|
||||||
} else if ("ip".equals(ipPattern)) {
|
|
||||||
Pattern pattern = Pattern.compile(Constants.IPV6_IP_REGEXP);
|
|
||||||
Matcher matcher = pattern.matcher(ip);
|
|
||||||
if (!matcher.matches()) {// 完全匹配
|
|
||||||
msg.append(String.format(prop.getProperty("is_in_wrong_format"), ipName) + ";");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return msg.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* checkIP(IP格式验证) (这里描述这个方法适用条件 – 可选)
|
|
||||||
*
|
|
||||||
* @param ipName
|
|
||||||
* @param ip
|
|
||||||
* @param ipType
|
|
||||||
* @param ipPattern
|
|
||||||
* @return String
|
|
||||||
* @exception @since
|
|
||||||
* 1.0.0
|
|
||||||
*/
|
|
||||||
public static String checkIP(Properties prop, String ipName, String ip, Integer ipType, Integer ipPattern) {
|
public static String checkIP(Properties prop, String ipName, String ip, Integer ipType, Integer ipPattern) {
|
||||||
StringBuffer msg = new StringBuffer();
|
StringBuffer msg = new StringBuffer();
|
||||||
if (StringUtils.isBlank(ip)) {
|
if (StringUtils.isBlank(ip)) {
|
||||||
@@ -2874,7 +2899,7 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
return msg.toString();
|
return msg.toString();
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public static String checkIp(Properties prop, String srcIpName, String srcIp, String destIpName, String destIp,
|
public static String checkIp(Properties prop, String srcIpName, String srcIp, String destIpName, String destIp,
|
||||||
Integer ipType, Integer ipPattern) {
|
Integer ipType, Integer ipPattern) {
|
||||||
StringBuffer msg = new StringBuffer();
|
StringBuffer msg = new StringBuffer();
|
||||||
@@ -3176,6 +3201,7 @@ public class BaseController {
|
|||||||
List<ComplexkeywordCfg> complexkeywordCfgs = new ArrayList<ComplexkeywordCfg>();
|
List<ComplexkeywordCfg> complexkeywordCfgs = new ArrayList<ComplexkeywordCfg>();
|
||||||
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||||
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
||||||
|
List<DnsResStrategy> dnsResStrategies=Lists.newArrayList();
|
||||||
FunctionRegionDict appRegion = null;
|
FunctionRegionDict appRegion = null;
|
||||||
if(serviceDict!=null) {
|
if(serviceDict!=null) {
|
||||||
String regionCode = serviceDict.getRegionCode();
|
String regionCode = serviceDict.getRegionCode();
|
||||||
@@ -3253,6 +3279,12 @@ public class BaseController {
|
|||||||
complexkeywordCfgs = this.checkComplexStringCfg(serviceDict, regionDict, list);
|
complexkeywordCfgs = this.checkComplexStringCfg(serviceDict, regionDict, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else if (regionDict.getRegionType().equals(6)) {// 回调类
|
||||||
|
if (regionDict.getFunctionId().equals(400)) {
|
||||||
|
List<DnsResStrategyTemplate> list = ei.getDataList(DnsResStrategyTemplate.class,
|
||||||
|
this.getMsgProp(),regionDict);
|
||||||
|
dnsResStrategies = this.checkDnsResStrategyCfg(serviceDict, regionDict, list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
String specServiceId = request.getParameter("appId");
|
String specServiceId = request.getParameter("appId");
|
||||||
@@ -3542,6 +3574,42 @@ public class BaseController {
|
|||||||
if(regionDict.getDictId().intValue()==11) {
|
if(regionDict.getDictId().intValue()==11) {
|
||||||
websiteCfgService.saveHttpResHeadCfg(complexkeywordCfgs);
|
websiteCfgService.saveHttpResHeadCfg(complexkeywordCfgs);
|
||||||
}
|
}
|
||||||
|
}else if(regionDict.getRegionType().equals(6)) {
|
||||||
|
if(regionDict.getFunctionId().equals(400)) {
|
||||||
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
compileIds = ConfigServiceUtil.getId(1,dnsResStrategies.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
int ind=0;
|
||||||
|
for(DnsResStrategy cfg:dnsResStrategies) {
|
||||||
|
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.setCompileId(compileIds.get(ind));
|
||||||
|
ind++;
|
||||||
|
}
|
||||||
|
if(dnsResStrategies.size()>0) {
|
||||||
|
dnsResStrategyService.saveDnsResStrategies(dnsResStrategies);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) {
|
if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) {
|
||||||
ipCfgService.saveCfgIndexOf(cfgIndexInfos);
|
ipCfgService.saveCfgIndexOf(cfgIndexInfos);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
|||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsIpTemplate;
|
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||||
@@ -330,6 +331,14 @@ public class IpController extends BaseController{
|
|||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(regionDict.getRegionType().equals(6)){
|
||||||
|
if(regionDict.getFunctionId().equals(400)){
|
||||||
|
List<DnsResStrategyTemplate> classList=new ArrayList<DnsResStrategyTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DnsResStrategyTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//ip配置导入
|
//ip配置导入
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ public class DnsResStrategyService extends BaseService{
|
|||||||
return dnsResStrategy;
|
return dnsResStrategy;
|
||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveDnsResStrategies(List<DnsResStrategy> cfgs) {
|
||||||
|
for(DnsResStrategy cfg: cfgs) {
|
||||||
|
saveOrUpdate(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveOrUpdate(DnsResStrategy entity){
|
public void saveOrUpdate(DnsResStrategy entity){
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
setAreaEffectiveIds(entity);
|
setAreaEffectiveIds(entity);
|
||||||
@@ -78,17 +84,19 @@ public class DnsResStrategyService extends BaseService{
|
|||||||
entity.setCreateTime(createTime);
|
entity.setCreateTime(createTime);
|
||||||
entity.setIsValid(0);
|
entity.setIsValid(0);
|
||||||
entity.setIsAudit(0);
|
entity.setIsAudit(0);
|
||||||
//调用服务接口获取compileId
|
if(entity.getCompileId()==null||entity.getCompileId().intValue()==0) {
|
||||||
List<Integer> compileIds = new ArrayList<Integer>();
|
//调用服务接口获取compileId
|
||||||
try {
|
List<Integer> compileIds = new ArrayList<Integer>();
|
||||||
compileIds = ConfigServiceUtil.getId(1,1);
|
try {
|
||||||
} catch (Exception e) {
|
compileIds = ConfigServiceUtil.getId(1,1);
|
||||||
e.printStackTrace();
|
} catch (Exception e) {
|
||||||
logger.info("获取编译ID出错");
|
e.printStackTrace();
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
logger.info("获取编译ID出错");
|
||||||
}
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
}
|
||||||
entity.setCompileId(compileIds.get(0));
|
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||||
|
entity.setCompileId(compileIds.get(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dnsResStrategyDao.insert(entity);
|
dnsResStrategyDao.insert(entity);
|
||||||
//修改
|
//修改
|
||||||
|
|||||||
@@ -1271,8 +1271,8 @@ port_mask_comment_tip=Port and port mask must between 0 and 65535
|
|||||||
multi_keywords_tip=Allow multiple keywords to be entered and multiple keywords to be replaced by line breaks.
|
multi_keywords_tip=Allow multiple keywords to be entered and multiple keywords to be replaced by line breaks.
|
||||||
visible_keyword_tip=Single keyword is not allowed to enter invisible characters.
|
visible_keyword_tip=Single keyword is not allowed to enter invisible characters.
|
||||||
single_keyword_tip=Only single key input is allowed.
|
single_keyword_tip=Only single key input is allowed.
|
||||||
ipv4_mask_range_tip=IP mask must between 16 and 32
|
ipv4_mask_range_tip=IP\u63A9\u7801\u5FC5\u987B\u4ECB\u4E8E16\u548C32\u4E4B\u95F4
|
||||||
ipv6_mask_range_tip=IP Mask must between 2 and 128
|
ipv6_mask_range_tip=IP\u63A9\u7801\u5FC5\u987B\u4ECB\u4E8E2\u548C128\u4E4B\u95F4
|
||||||
letter_cancel_info=\u53D6\u6D88\u5BA1\u6838\u6765\u51FD
|
letter_cancel_info=\u53D6\u6D88\u5BA1\u6838\u6765\u51FD
|
||||||
import_tip_excel=\u8BF7\u9009\u62E9\u6587\u4EF6\u7ED3\u5C3E\u4E3A.xls\u6216\u8005.xlsx\u7684\u6709\u6548Excel\u6587\u4EF6\u5BFC\u5165
|
import_tip_excel=\u8BF7\u9009\u62E9\u6587\u4EF6\u7ED3\u5C3E\u4E3A.xls\u6216\u8005.xlsx\u7684\u6709\u6548Excel\u6587\u4EF6\u5BFC\u5165
|
||||||
http_keyword=\u7F51\u9875\u5173\u952E\u5B57
|
http_keyword=\u7F51\u9875\u5173\u952E\u5B57
|
||||||
|
|||||||
@@ -540,4 +540,5 @@ cert_validate_file=x509
|
|||||||
#证书校验成功的关键信息
|
#证书校验成功的关键信息
|
||||||
cert_validate_success_info=Successful
|
cert_validate_success_info=Successful
|
||||||
#ipv4 range新格式0.0.0.1-2
|
#ipv4 range新格式0.0.0.1-2
|
||||||
ipv4_ip_range_regexp_new=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)-(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$
|
ipv4_ip_range_regexp_new=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)-(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$
|
||||||
|
ipv4_ip_subnet_regexp_original=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)/(3[0-2]|1[0-9]|2[0-9]|[0-9])$
|
||||||
@@ -26,4 +26,7 @@ UPDATE function_region_dict SET is_import=0,region_type=1,config_ip_port_show='3
|
|||||||
UPDATE function_service_dict SET is_import=0 WHERE function_id=633;
|
UPDATE function_service_dict SET is_import=0 WHERE function_id=633;
|
||||||
#DNS欺骗IP
|
#DNS欺骗IP
|
||||||
UPDATE function_region_dict SET is_import=1 WHERE function_id=401;
|
UPDATE function_region_dict SET is_import=1 WHERE function_id=401;
|
||||||
UPDATE function_service_dict SET is_import=1 WHERE function_id=401;
|
UPDATE function_service_dict SET is_import=1 WHERE function_id=401;
|
||||||
|
#DNS策略
|
||||||
|
UPDATE function_region_dict SET is_import=1 WHERE function_id=400;
|
||||||
|
UPDATE function_service_dict SET is_import=1 WHERE function_id=400;
|
||||||
@@ -47,6 +47,23 @@
|
|||||||
onClick="javascript:window.location='${ctx}/maintenance/dnsResStrategy/form?functionId=${cfg.functionId}'">
|
onClick="javascript:window.location='${ctx}/maintenance/dnsResStrategy/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>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:set var="regionImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:forEach items="${regionList}" var="region" >
|
||||||
|
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||||
|
<c:set var="regionImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport eq 'true' && regionImport eq 'true'}">
|
||||||
|
<button type="button" class="btn btn-primary import" >
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="import"></spring:message></button>
|
||||||
|
</c:if>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -426,6 +443,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<c:set var="importPath" value="/maintenance/dnsResStrategy/list?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user