除APP feature和ASN IP外的业务增加批量配置取消功能;

修复ddos新增bug;
This commit is contained in:
段冬梅
2019-03-05 17:42:12 +08:00
parent c348697e3b
commit b87f99c852
8 changed files with 70 additions and 15 deletions

View File

@@ -451,6 +451,7 @@ public class ConfigServiceUtil {
JSONObject resObject = JSONObject.fromObject(result);
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
}else{
logger.info("获取文件摘要响应结果"+result);
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
}
} catch (Exception e) {

View File

@@ -3276,6 +3276,7 @@ public class BaseController {
|| baseCfg.getFunctionId().equals(3)) { //IP WHITELIST
pageResult=ipCfgService.getIpCfgList(searchPage,searchCfg);
}else if(baseCfg.getFunctionId().equals(212) //IP Payload
|| baseCfg.getFunctionId().equals(214) //IP Replace
|| baseCfg.getFunctionId().equals(7) //DNS
|| baseCfg.getFunctionId().equals(8)//HTTP ADVANCED
|| baseCfg.getFunctionId().equals(635) //HTTP 关键字
@@ -3393,7 +3394,7 @@ public class BaseController {
cfg.setAuditTime(entity.getAuditTime());
newList.add(BaseService.convertCallBackProxyObjKeyring(cfg));
ids.add(cfg.getCompileId());
newList.add(cfg);
/*newList.add(cfg);*/
}
}else if(className.equals("PxyObjTrustedCaCert")){
list = pxyObjKeyringService.findTrustedCertPage(page,searchTrustedCaCertCfg).getList();

View File

@@ -193,6 +193,9 @@
</select>
<insert id="insert" parameterType="com.nis.domain.configuration.DdosIpCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into ddos_ip_cfg (
CFG_DESC,
ACTION,

View File

@@ -2636,6 +2636,8 @@ public abstract class BaseService {
}
}
}
long start=System.currentTimeMillis();
long end=System.currentTimeMillis();
if (send) {
if(configCompileList.size() > 0) {
ToMaatBean maatBean = new ToMaatBean();
@@ -2644,6 +2646,7 @@ public abstract class BaseService {
maatBean.setCreatorName(UserUtils.getUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
start=System.currentTimeMillis();
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
@@ -2652,8 +2655,11 @@ public abstract class BaseService {
logger.info("IP 配置下发配置参数:" + json);
}
// 调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("IP 配置下发响应信息:" + result.getMsg());
end=System.currentTimeMillis();
logger.info("IP 配置下发配置耗时:" + (end-start));
}else {
//调用服务接口下发配置数据
String json=gsonToJson(callbackIpList);
@@ -2743,6 +2749,8 @@ public abstract class BaseService {
}
}
long start=System.currentTimeMillis();
long end=System.currentTimeMillis();
if (send && configCompileList.size() > 0) {
ToMaatBean maatBean = new ToMaatBean();
maatBean.setConfigCompileList(configCompileList);
@@ -2750,6 +2758,7 @@ public abstract class BaseService {
maatBean.setCreatorName(UserUtils.getUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
start=System.currentTimeMillis();
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
@@ -2760,6 +2769,8 @@ public abstract class BaseService {
// 调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("字符串配置下发响应信息:" + result.getMsg());
end=System.currentTimeMillis();
logger.info("字符串配置下发配置耗时:" + (end-start));
}
batchSqlSession.commit();

View File

@@ -1498,4 +1498,5 @@ is_schduler=Scheduler
v4_num=IPv4 Number
v6_num=IPv6 Number
always=Permanent
schedule=Scheduler
schedule=Scheduler
cancel_all=Cancel all configurations!

View File

@@ -1503,4 +1503,5 @@ validate_error=Unexpected error occurred while validating
v4_num=IPv4 Number
v6_num=IPv6 Number
always=\u041F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u043E
schedule=Scheduler
schedule=Scheduler
cancel_all=Cancel all configurations!

View File

@@ -1495,4 +1495,5 @@ validate_error=\u9A8C\u8BC1\u65F6\u53D1\u751F\u610F\u5916\u9519\u8BEF
v4_num=IPv4 Number
v6_num=IPv6 Number
always=\u957F\u671F
schedule=Scheduler
schedule=Scheduler
cancel_all=Cancel all configurations!

View File

@@ -247,19 +247,55 @@ function cancelPassOpt(url){
}
}else{
url=url+"&"
//批量下发待测试
if(url.indexOf("functionId=6") > -1 //http url
|| url.indexOf("functionId=5") > -1 //dns
|| url.indexOf("functionId=7") > -1 //dns
|| url.indexOf("functionId=37") > -1 //mail address
|| url.indexOf("functionId=35") > -1 //mail advanced
|| url.indexOf("functionId=210") > -1 //https monitor
|| url.indexOf("functionId=207") > -1 //mail block
|| url.indexOf("functionId=208") > -1 //mail redirect
|| url.indexOf("functionId=209") > -1 //mail replace
|| url.indexOf("functionId=211") > -1 //mail whitelist
if( url.indexOf("functionId=3&") > -1 //ip whitelist
|| url.indexOf("functionId=5&") > -1 //ip
|| url.indexOf("functionId=212&") > -1 //ip
|| url.indexOf("functionId=214&") > -1 //ip
|| url.indexOf("functionId=6&") > -1 //http url
|| url.indexOf("functionId=7&") > -1 //dns
|| url.indexOf("functionId=37&") > -1 //mail address
|| url.indexOf("functionId=35&") > -1 //mail advanced
|| url.indexOf("functionId=210&") > -1 //https monitor
|| url.indexOf("functionId=207&") > -1 //https block
|| url.indexOf("functionId=208&") > -1 //https redirect
|| url.indexOf("functionId=209&") > -1 //https replace
|| url.indexOf("functionId=211&") > -1 //https whitelist
|| url.indexOf("functionId=407&") > -1 //Protocol Identify
|| url.indexOf("functionId=63&") > -1 //App Identify
|| url.indexOf("functionId=408&") > -1 //Behavior Identify
|| url.indexOf("functionId=61&") > -1 //BGP
|| url.indexOf("functionId=34&") > -1 //SSL
|| url.indexOf("functionId=635&") > -1 //Website Keyword
|| url.indexOf("functionId=8&") > -1 //HTTP Advanced
|| url.indexOf("functionId=51&") > -1 //FTP
|| url.indexOf("functionId=510&") > -1 //P2P
|| url.indexOf("functionId=22&") > -1 //Streaming media
|| url.indexOf("functionId=24&") > -1 //VoIP
|| url.indexOf("functionId=52&") > -1 //File Digest
|| url.indexOf("functionId=28&") > -1 //Audio Sample
|| url.indexOf("functionId=29&") > -1 //Video Sample
|| url.indexOf("functionId=30&") > -1 //Picture Sample
|| url.indexOf("functionId=31&") > -1 //VoIP Voice Sample
|| url.indexOf("functionId=630&") > -1 //Speaker Recognization
|| url.indexOf("functionId=631&") > -1 //Logo Detection
|| url.indexOf("functionId=632&") > -1 //Face Recognization
|| url.indexOf("functionId=301&") > -1 //DDOS
|| url.indexOf("functionId=200&") > -1 //Intercept Policy
|| url.indexOf("functionId=210&") > -1 //HTTPS monitor
|| url.indexOf("functionId=207&") > -1 //HTTPS block
|| url.indexOf("functionId=208&") > -1 //HTTPS Redirect
|| url.indexOf("functionId=209&") > -1 //HTTPS Replace
|| url.indexOf("functionId=211&") > -1 //whitelist
|| url.indexOf("functionId=213&") > -1 //Cache
|| url.indexOf("functionId=560&") > -1 //Focused Website
|| url.indexOf("functionId=400&") > -1 //DNS Response Profiles
|| url.indexOf("functionId=401&") > -1 //Spoofing IP
|| url.indexOf("functionId=570&") > -1 //Key Ring
|| url.indexOf("functionId=571&") > -1 //Trusted Certificate
){
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='cancle_all'/>",function(v,h,f){
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='cancel_all'/>",function(v,h,f){
if(v=="ok"){
$("#searchForm").attr("action",url);
page();