diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 7cfcfb034..e0fb19f8b 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -2066,13 +2066,13 @@ USER_REGION2 =#{userRegion2,jdbcType=VARCHAR}, - USER_REGION1 =#{userRegion3,jdbcType=VARCHAR}, + USER_REGION3 =#{userRegion3,jdbcType=VARCHAR}, - USER_REGION1 =#{userRegion4,jdbcType=VARCHAR}, + USER_REGION4 =#{userRegion4,jdbcType=VARCHAR}, - USER_REGION1 =#{userRegion5,jdbcType=VARCHAR}, + USER_REGION5 =#{userRegion5,jdbcType=VARCHAR}, DO_LOG=#{doLog,jdbcType=INTEGER}, diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 0409f52e3..a54454572 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -964,6 +964,23 @@ public class AppCfgService extends BaseService { if (entity.getBehavCode() != null) { userRegion += Constants.USER_REGION_SPLIT + Constants.BEHAV_ID_REGION + "=" + entity.getBehavCode(); } + + // 限速业务需要设置 + if (Constants.RATELIMIT_ACTION.equals(entity.getAction())) { + entity.setUserRegion1(StringUtil.isEmpty(entity.getUserRegion1()) ? "0":entity.getUserRegion1()); + //限速 需要发Droprate=0.001 ,暂不支持Bandwidth=200kbps + if(entity.getUserRegion1().equals("0")){//丢包率 + entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2()); + userRegion+=Constants.USER_REGION_SPLIT +Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2(); + }else if(entity.getUserRegion1().equals("1")){//带宽 + entity.setUserRegion3(StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3()); + userRegion+=Constants.USER_REGION_SPLIT +Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+entity.getUserRegion3(); + } + } + //VIGNORE=1 + if(StringUtil.isEmpty(entity.getUserRegion4())){ + userRegion+=Constants.USER_REGION_SPLIT +Constants.APP_VIGNORE_USER_REGION_KEY+"=1"; + } } else if (Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) { userRegion = Constants.PROTO_ID_REGION + "=" + entity.getAppCode(); } else if (Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)) { @@ -973,14 +990,6 @@ public class AppCfgService extends BaseService { } } - // 限速业务需要设置 - String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit"); - if (!actionCode.equals("默认")) { - if (entity.getAction().equals(Integer.parseInt(actionCode))) { - userRegion += Constants.USER_REGION_SPLIT + Constants.RATE_LIMIT_REGION + "=" - + entity.getRatelimit(); - } - } maatCfg.setUserRegion(userRegion); configCompileList.add(maatCfg); maatBean.setConfigCompileList(configCompileList); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 4990fbd35..5b4a94aa6 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -65,7 +65,7 @@ mail_keyword_control=Mail Keyword Block mail_attachment_name_control=Mail Attachment Name Block mail_attachment_content_control=Mail Attachment Content Block file_transfer_control=File Transfer -ftp_address_control=FTP Url Block +ftp_address_control=FTP URL Block ftp_name_control=FTP Filename Block ftp_content_control=FTP File Content Block http_app_feature=Application HTTP Feature @@ -1311,4 +1311,5 @@ resp_body=Response Body dns_sub=DNS Security action_cache=Cache action_cache_whitelist=Cache Bypass -crl_issuer_null=Issuer of CRL file is empty \ No newline at end of file +crl_issuer_null=Issuer of CRL file is empty +block_by_app_server_ip=Block by application server ip \ 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 2c8fe0e1d..229f3651f 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1311,4 +1311,5 @@ resp_body=Response Body\u3001 dns_sub=DNS Security action_cache=\u043A\u044D\u0448 action_cache_whitelist=\u0431\u0430\u0439\u043F\u0430\u0441 \u043A\u044D\u0448\u0430 -crl_issuer_null=CRL\u6587\u4EF6\u7684\u9881\u53D1\u8005\u4E3A\u7A7A \ No newline at end of file +crl_issuer_null=CRL\u6587\u4EF6\u7684\u9881\u53D1\u8005\u4E3A\u7A7A +block_by_app_server_ip=Block by application server ip \ 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 e198ffa23..0c5ff6ebc 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1307,4 +1307,5 @@ resp_body=\u539F\u59CB\u5E94\u7B54\u4F53 dns_sub=DNS\u5B89\u5168\u673A\u5236 action_cache=\u7F13\u5B58 action_cache_whitelist=\u7F13\u5B58\u767D\u540D\u5355 -crl_issuer_null=CRL\u6587\u4EF6\u7684\u9881\u53D1\u8005\u4E3A\u7A7A \ No newline at end of file +crl_issuer_null=CRL\u6587\u4EF6\u7684\u9881\u53D1\u8005\u4E3A\u7A7A +block_by_app_server_ip=Block by application server ip \ No newline at end of file diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 2a215f0d3..3ab49dc0b 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -556,4 +556,5 @@ max_allowed_packet=1048576 #http client\u8FDE\u63A5\u6C60\u76F8\u5173\u53C2\u6570\uFF0Chttp_max_connection:\u6700\u5927\u8FDE\u63A5\u6570\uFF0Cdefault_max_perroute:\u6BCF\u4E2A\u4E3B\u673A\u5730\u5740\u7684\u5E76\u53D1\u6570\uFF0Cpoolcm_socket_timeout:socket\u8D85\u65F6\u65F6\u95F4 http_max_connection=1000 default_max_perroute=100 -poolcm_socket_timeout=3000 \ No newline at end of file +poolcm_socket_timeout=3000 +app_vignore_user_region_key=VIGNORE \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp index a68bb7b2b..a9dd52f2b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -5,13 +5,16 @@ <spring:message code="${cfgName}"></spring:message>