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 7be526c4b..c6c9ff342 100644
--- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java
+++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java
@@ -964,23 +964,6 @@ 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)) {
@@ -990,6 +973,24 @@ public class AppCfgService extends BaseService {
}
}
+
+ // 限速业务需要设置
+ 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";
+ }
+
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp
index 24cc0116a..48049f571 100644
--- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp
+++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp
@@ -371,9 +371,9 @@
|
|
|
- |
<%-- | --%>
|
+ |
|
|
|
@@ -402,15 +402,6 @@
${cfg.compileId } |
${cfg.cfgDesc } |
-
-
-
-
-
-
-
-
- |
<%--
@@ -426,6 +417,15 @@
|
+
+
+
+
+
+
+
+
+ |
${cfg.appCode } |
${cfg.behavCode } |
<%-- ${cfg.ratelimit } | --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp
index 87a0fed80..eecab7ec8 100644
--- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp
+++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp
@@ -14,16 +14,19 @@ $(function(){
// $("#cancel").on("click",function(){
// window.history.back();
// });
+ $(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
+ switchRateLimitType();
+ });
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
var action=$("input[name='action']:checked").val();
- switchAction(action);
- if($(".action:checked").val()==64){
- $("#ratelimit").show();
+ if(action==64){
+ $(".ratelimitAction").removeClass("hidden");
}else{
- $("#ratelimit").hide();
+ $(".ratelimitAction").addClass("hidden");
}
+ switchAction(action);
if($(this).val()==1){
$(".ipPortAdd").click();
}
@@ -31,9 +34,9 @@ $(function(){
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
if($(".action:checked").val()==64){
- $("#ratelimit").show();
+ $(".ratelimitAction").removeClass("hidden");
}else{
- $("#ratelimit").hide();
+ $(".ratelimitAction").addClass("hidden");
}
$("#cfgFrom").validate({
errorPlacement: function(error,element){
@@ -98,8 +101,8 @@ $(function(){
//if($("[name='behavCode']")&&$("[name='behavCode']").val()!=""){
// $("input[name='exprType']").val(1);
//}
- if($("input[name='ratelimit']").is(":hidden")){
- $("input[name='ratelimit']").val("");
+ if($(".ratelimitAction").is(":hidden")){
+ $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}
/* $("#appCode").val($("#specServiceIdId").val()); */
loading('onloading...');
@@ -125,6 +128,20 @@ var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
$("." + addBtnClassName).removeClass("hidden");
}
+//限流方式
+var switchRateLimitType=function(){
+ //0 丢包率 1 带宽
+ var rateLimitType=$(".ratelimitAction").find("input[name='userRegion1']:checked").val();
+ if(rateLimitType == 0){
+ $(".droprate").removeClass("hidden");
+ $(".bandwith").addClass("hidden");
+ }
+ if(rateLimitType == 1){
+ $(".droprate").addClass("hidden");
+ $(".bandwith").removeClass("hidden");
+ }
+
+}
@@ -251,18 +268,75 @@ var delContent = function(contentClassName, addBtnClassName) {
-
-
+
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp
index dae8d8a18..b036893b2 100644
--- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp
+++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp
@@ -375,8 +375,8 @@
|
|
<%-- | --%>
- <%-- | --%>
|
+ |
|
|
|
@@ -411,9 +411,17 @@
+
+
+
+
+
+
+
+
+ |
${cfg.appCode } |
<%--${cfg.behavCode } | --%>
- <%-- ${cfg.ratelimit } | --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp
index 430ad49f2..84e35dfaf 100644
--- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp
+++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp
@@ -9,23 +9,26 @@ $(function(){
/* $("#cancel").on("click",function(){
window.history.back();
}); */
+ $(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
+ switchRateLimitType();
+ });
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
var action=$("input[name='action']:checked").val();
- switchAction(action);
- if($(".action:checked").val()==64){
- $("#ratelimit").show();
+ if(action==64){
+ $(".ratelimitAction").removeClass("hidden");
}else{
- $("#ratelimit").hide();
+ $(".ratelimitAction").addClass("hidden");
}
+ switchAction(action);
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
if($(".action:checked").val()==64){
- $("#ratelimit").show();
+ $(".ratelimitAction").removeClass("hidden");
}else{
- $("#ratelimit").hide();
+ $(".ratelimitAction").addClass("hidden");
}
$("#cfgFrom").validate({
errorPlacement: function(error,element){
@@ -73,8 +76,8 @@ $(function(){
if($("[name='behavCode']")&&$("[name='behavCode']").val()!=""){
$("input[name='exprType']").val(1);
}
- if($("input[name='ratelimit']").is(":hidden")){
- $("input[name='ratelimit']").val("");
+ if($(".ratelimitAction").is(":hidden")){
+ $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}
/* $("#appCode").val($("#specServiceIdId").val()); */
loading('onloading...');
@@ -149,6 +152,21 @@ var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
$("." + addBtnClassName).removeClass("hidden");
}
+
+//限流方式
+var switchRateLimitType=function(){
+ //0 丢包率 1 带宽
+ var rateLimitType=$(".ratelimitAction").find("input[name='userRegion1']:checked").val();
+ if(rateLimitType == 0){
+ $(".droprate").removeClass("hidden");
+ $(".bandwith").addClass("hidden");
+ }
+ if(rateLimitType == 1){
+ $(".droprate").addClass("hidden");
+ $(".bandwith").removeClass("hidden");
+ }
+
+}
@@ -245,6 +263,19 @@ var delContent = function(contentClassName, addBtnClassName) {
+
@@ -282,17 +313,61 @@ var delContent = function(contentClassName, addBtnClassName) {
-
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp
index 68abb708f..d10e90709 100644
--- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp
+++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp
@@ -372,9 +372,9 @@
|
|
|
+ |
|
|
- <%-- | --%>
|
|
|
@@ -408,6 +408,15 @@
|
+
+
+
+
+
+
+
+
+ |
${cfg.appCode } |
${cfg.behavCode } |
@@ -418,7 +427,6 @@
|
- <%-- ${cfg.ratelimit } | --%>
|