diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index c736b03c7..570f13d22 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -562,6 +562,13 @@ public class IpCfgService extends CrudService { if(map.get("numRegionList")!=null){ numRegionList.addAll(map.get("numRegionList")); } + if(Constants.SERVICE_IP_MULITIPLEX==cfg.getServiceId().intValue()){ + String region=Constants.USERREGION_IR_STRATEGY+"="+cfg.getDnsStrategyId()+Constants.USER_REGION_SPLIT + +Constants.USERREGION_IR_TYPE+"="+cfg.getIrType(); + maatCfg.setUserRegion(region); + }else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){ + maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit()); + } } } if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ @@ -630,6 +637,16 @@ public class IpCfgService extends CrudService { maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setOpAction(Constants.INSERT_ACTION); + //限速需要发Droprate=0.001 ,暂不支持Bandwidth=200kbps + if(entity.getAction().equals(Constants.RATELIMIT_ACTION)){ + if(entity.getUserRegion1().equals("0")){//丢包率 + entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2()); + maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2()); + }else if(entity.getUserRegion1().equals("1")){//带宽 + entity.setUserRegion3(StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3()); + maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+entity.getUserRegion3()); + } + } //调用服务接口下发配置数据 String json=gsonToJson(maatBean); logger.info("ip配置下发配置参数:"+json); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index baf0668e5..e55581c34 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1212,4 +1212,5 @@ stream=Stream protocol_menu=Protocol advanced=Advanced protocol_identify=Protocol Identify -MM_FILE_DIGEST=File Digest Configuration \ No newline at end of file +MM_FILE_DIGEST=File Digest Configuration +NTC_ASN_IP=ASN \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index d14105682..a10e1b41c 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1212,4 +1212,5 @@ label_app_source=APP Source packet=Packet stream=Stream protocol_menu=Protocol -protocol_identify=Protocol Identify \ No newline at end of file +protocol_identify=Protocol Identify +NTC_ASN_IP=ASN \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index b079ab5e7..cd53aae60 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1206,4 +1206,5 @@ stream=Stream protocol_menu=Protocol advanced=Advanced protocol_identify=Protocol Identify -MM_FILE_DIGEST=\u6587\u4EF6\u6458\u8981\u914D\u7F6E \ No newline at end of file +MM_FILE_DIGEST=\u6587\u4EF6\u6458\u8981\u914D\u7F6E +NTC_ASN_IP=ASN \ No newline at end of file diff --git a/src/main/resources/sql/20181011/extend_region_type.sql b/src/main/resources/sql/20181011/extend_region_type.sql new file mode 100644 index 000000000..cf8475fbb --- /dev/null +++ b/src/main/resources/sql/20181011/extend_region_type.sql @@ -0,0 +1,2 @@ +ALTER TABLE function_region_dict MODIFY COLUMN region_type INT(1) NOT NULL COMMENT '1IP类,2字符串类,3增强字符串类,4数值类,5摘要类,6回调类,7 ASN'; +UPDATE function_region_dict SET region_type=7 WHERE config_region_value='NTC_ASN_IP' AND function_id=5; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp new file mode 100644 index 000000000..030dbd4f7 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp @@ -0,0 +1,32 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + +
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index 5cdd5e4fe..60fa48ed1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -13,50 +13,29 @@ $(document) .ready( function() { - /*initCommIpVal(); - $("#cancel").on("click", function() { - window.history.back(); - });*/ - var asnRegionCode,configType; + var asnRegionCode,isAsn=0; + var regionCodes=$(".action:checked").attr("regionCode").split(","); $("input[id^='cfgRegionCode']").each(function(){ - var regionCode=$(this).val(); - if("asn"==$(this).attr("servicetype")){ + if(7==$(this).attr("regionType")){ asnRegionCode=$(this).val(); } }); - $(".configType a").on("click",function(){ - if($(this).attr("id")=="ipCfgTab"){ - configType="ip"; - $(".glyphicon-plus").first().click(); - $(".ipPortList").find(".glyphicon-remove").addClass("hidden") - hideAction(1,asnRegionCode); - }else{ - configType="asn"; - hideAction(0,asnRegionCode); + for(var ind in regionCodes){ + if(regionCodes[ind]==asnRegionCode){ + isAsn=1; + break; } - var region = ($(this).attr("for")); - if(region=="ipaddr"){ - $(".asn").addClass("hidden").addClass("disabled"); - $(".ipaddr").removeClass("hidden").removeClass("disabled"); - }else{ - $(".ipaddr").addClass("hidden").addClass("disabled"); - $(".asn").removeClass("hidden").removeClass("disabled"); - } - }); - //切换tab - if("${_cfg.cfgId}"==''){ - configType='ip'; - $("#ipCfgTab").click(); - }else if("${_cfg.userRegion4}"==""){ - configType='ip'; - $("#ipCfgTab").click(); - }else{ - configType='asn'; - $("#ansCfgTab").click(); } - if(configType!='asn'){ - $(".glyphicon-plus").first().click(); - $(".ipPortList").find(".glyphicon-remove").addClass("hidden") + //hide actions + if(isAsn==1){ + hideAction(0,asnRegionCode); + }else{ + hideAction(1,asnRegionCode); + } + + if(isAsn==0){ + $("[class~='glyphicon-plus'][class~='ipPortList']").click(); + $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click(); /*if(action==32){ $(".subscribeId").find(".glyphicon-remove").click(); $(".subscribeId").prev("h4").addClass("hidden"); @@ -73,8 +52,24 @@ $(this).addClass("hidden"); } }); - processAction(configType,$(".ipPortList")); + processAction(isAsn,$(".ipPortList")); + }else{ + $("[class~='glyphicon-plus'][class~='asn']").click(); + $("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click(); + processAction(isAsn,$(".asn")); } + $(".glyphicon-plus").on("click",function(){ + if($(this).hasClass("ipPortList")){ + isAsn=0; + hideAction(1,asnRegionCode); + $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click(); + } + if($(this).hasClass("asn")){ + isAsn=1; + hideAction(0,asnRegionCode); + $("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click(); + } + }); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); @@ -109,10 +104,10 @@ tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); } - if(configType!='asn'){ + if(isAsn==0){ changeIPVal(tabInfo); } - processAction(configType,tabInfo); + processAction(isAsn,tabInfo); /* if(tabInfo){ tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); @@ -206,7 +201,7 @@ flag=flag1; } if(flag){ - if(configType!='asn'){ + if(isAsn==0){ $("input[name='userRegion4']").attr("disabled",true); } $("input[name$='userRegion1']").attr("disabled",false); @@ -306,7 +301,7 @@ var hideAction=function(isHide,regionCode){ } var processAction=function(configType,obj){ var action=$(".action:checked").val(); - if(configType!='asn'){ + if(configType!=1){ var o=$(obj) if(o){ /*处理协议*/ @@ -429,9 +424,9 @@ var processAction=function(configType,obj){
-
+ <%--
--%> - --%>
@@ -550,19 +545,19 @@ var processAction=function(configType,obj){
--%>
- + + -

@@ -585,12 +580,10 @@ var processAction=function(configType,obj){ -
-

@@ -637,26 +630,45 @@ var processAction=function(configType,obj){ -

+
+ + +

+ + +

+ + + + ${_cfg.cfgType} + + +
+ <%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%> +
+ + +
+
+
+ + + + +
+ + + + +
-
-
-
-
- -
- -
-
-
-
-
-

<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
@@ -679,7 +691,7 @@ var processAction=function(configType,obj){
-
+ <%--
--%>