diff --git a/src/main/java/com/nis/web/service/configuration/InterceptCfgService.java b/src/main/java/com/nis/web/service/configuration/InterceptCfgService.java index 134bcae84..7ad1a07ed 100644 --- a/src/main/java/com/nis/web/service/configuration/InterceptCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/InterceptCfgService.java @@ -277,7 +277,13 @@ public class InterceptCfgService extends CrudService strRegionList=map.get("dstList"); } } + //域名信息 + boolean doaminFlag=false; + String domainUserRegion=""; if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ + doaminFlag=true; + domainUserRegion=Constants.USERREGION_DOMAIN_ID+"="+entity.getCompileId(); + domainUserRegion=domainUserRegion+";"+Constants.USERREGION_DOMAIN_STR+"="+entity.getHttpUrlList().get(0).getCfgKeywords(); HttpUrlCfg cfg = new HttpUrlCfg(); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); cfg.setTableName(HttpUrlCfg.getTablename()); @@ -324,9 +330,13 @@ public class InterceptCfgService extends CrudService } //限速需要发Droprate=0.001 ,暂不支持Bandwidth=200kbps if(entity.getAction().equals(Constants.RATELIMIT_ACTION)){ - entity.setUserRegion1(StringUtil.isEmpty(entity.getUserRegion1()) ? "":entity.getUserRegion1()); - - maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion1()); + 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 userRegion=""; //替换需要发zone @@ -347,8 +357,17 @@ public class InterceptCfgService extends CrudService maatCfg.setUserRegion(userRegion); } - if(StringUtil.isEmpty(maatCfg.getUserRegion())){ - maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER); + if(StringUtil.isEmpty(maatCfg.getUserRegion()) + || maatCfg.getUserRegion().equals(Constants.USER_REGION_PLACEHOLDER)){ + if(doaminFlag){ + maatCfg.setUserRegion(domainUserRegion); + }else{ + maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER); + } + }else{ + if(doaminFlag){ + maatCfg.setUserRegion(maatCfg.getUserRegion()+";"+domainUserRegion); + } } configCompileList.add(maatCfg); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index a61667d64..7ad6fdead 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -743,7 +743,7 @@ target_ip_protect=Anti DDOS ratelimit_config=Ratelimit ip_ratelimit=IP Ratelimit domain_ratelimit=Website Ratelimit -ratelimit=Limit Rate +ratelimit=Pocket Loss Rate ir_type=Reuse Type dns_strategy_id=DNS Policy ID no_strategy=No Strategy @@ -1123,4 +1123,6 @@ certificate_validity=Certificate Validity Period end_entity=End-entity Certificate header=Header layer=Layer -can_not_delete_issued_asn_group=Can not delete issued ASN group \ No newline at end of file +can_not_delete_issued_asn_group=Can not delete issued ASN group +bandwith=Bandwith +limit_rate_type=Limit Rate Type \ 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 a01a5c616..631ddda14 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -741,7 +741,7 @@ ratelimit_config=\u9650\u901F target_ip_protect=\u6297DDOS\u653B\u51FB ip_ratelimit=IP\u9650\u6D41 domain_ratelimit=\u57DF\u540D\u9650\u6D41 -ratelimit=\u9650\u901F\u6BD4\u4F8B +ratelimit=\u4E22\u5305\u7387 ir_type=\u590D\u7528\u7C7B\u578B dns_strategy_id=DNS\u7B56\u7565ID no_strategy=\u65E0\u7B56\u7565 @@ -1120,4 +1120,6 @@ not_after_time=\u8BC1\u4E66\u7EC8\u6B62\u65F6\u95F4 certificate_validity=\u8BC1\u4E66\u6709\u6548\u671F header=\u5173\u952E\u5B57 layer=\u5339\u914D\u533A\u57DF -can_not_delete_issued_asn_group=\u4E0D\u80FD\u5220\u9664\u5DF2\u7ECF\u4E0B\u53D1\u8FC7\u7684ASN\u5206\u7EC4 \ No newline at end of file +can_not_delete_issued_asn_group=\u4E0D\u80FD\u5220\u9664\u5DF2\u7ECF\u4E0B\u53D1\u8FC7\u7684ASN\u5206\u7EC4 +bandwith=\u5E26\u5BBD +limit_rate_type=\u9650\u901F\u65B9\u5F0F \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/form/complexInfo.jsp b/src/main/webapp/WEB-INF/include/form/complexInfo.jsp index 2cae78b96..52890078c 100644 --- a/src/main/webapp/WEB-INF/include/form/complexInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/complexInfo.jsp @@ -35,7 +35,18 @@
+ + + + + + + + + + + +
@@ -47,7 +58,9 @@
- domainCheck + " type="text" name="cfgKeywords" value="${_cfg.cfgKeywords}">
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp index acbb9c7a0..aad2fadf5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp @@ -103,7 +103,7 @@ - +
@@ -276,7 +276,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp index 7032a41d1..0c0730407 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp @@ -104,7 +104,7 @@ - +
@@ -278,7 +278,7 @@ <%-- --%> - + diff --git a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp index 62614aff7..3e0661a01 100644 --- a/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/complexCfgForm.jsp @@ -67,7 +67,19 @@
+ + + + + + + + + + + + +
@@ -81,7 +93,7 @@
domainCheck + domainCheck " type="text" name="${cfgName}.cfgKeywords" diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp index f7a1897c8..39f54cbad 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp @@ -127,7 +127,16 @@
-
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp index 156dff6c4..bcfdbec73 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp @@ -22,6 +22,9 @@ }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); + $(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){ + switchRateLimitType(); + }); $("#cfgFrom").validate( { errorPlacement : function(error, element) { @@ -87,6 +90,13 @@ }else if(action==64){//限速 $(".monitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); $(".replaceAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); + var rateLimitType=$("input[name='userRegion1']checked").val(); + if(rateLimitType == 0){//丢包率 + $(".bandwith").find("input[name='userRegion3']").attr("disabled",true); + } + if(rateLimitType == 1){//带宽 + $(".droprate").find("input[name='userRegion2']").attr("disabled",true); + } }else if(action==80){//替换 $(".monitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); @@ -257,15 +267,50 @@
<%-- action 为64 限速时 可以选择证书--%> <%--action 为80 替换时 可以选择替换动作--%>