diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java index ae0a71ad5..1b129a304 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java @@ -21,6 +21,7 @@ import com.nis.domain.configuration.HttpBodyCfg; import com.nis.domain.configuration.HttpReqHeadCfg; import com.nis.domain.configuration.HttpResHeadCfg; import com.nis.domain.configuration.HttpUrlCfg; +import com.nis.domain.configuration.IpPortCfg; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.web.controller.BaseController; @@ -63,15 +64,10 @@ public class HttpRedirectPolicyController extends BaseController{ HttpBodyCfg resBodyCfg = new HttpBodyCfg(); resBodyCfg.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION); entity.setHttpResBody(resBodyCfg); + IpPortCfg ipPortCfg = new IpPortCfg(); + ipPortCfg.setCfgType(Constants.HTTP_REDIRECT_IP_REGION); + entity.setIpPort(ipPortCfg); - int httpReqCfgNum = entity.getHttpUrlList().size()+ - entity.getHttpReqBodyList().size()+ - entity.getHttpReqHdrList().size(); - int httpResCfgNum = entity.getHttpResHdrList().size()+ - entity.getHttpResBodyList().size(); - model.addAttribute("httpReqCfgNum", httpReqCfgNum); - model.addAttribute("httpResCfgNum", httpResCfgNum); - if(entity.getHttpUrlList().size()==0){ entity.getHttpUrlList().add(urlCfg); } @@ -87,6 +83,9 @@ public class HttpRedirectPolicyController extends BaseController{ if(entity.getHttpResBodyList().size()==0){ entity.getHttpResBodyList().add(resBodyCfg); } + if(entity.getIpPortList().size()==0){ + entity.getIpPortList().add(ipPortCfg); + } initUpdateFormCondition(model,entity); }else{ //设置http各类配置的配置域类型 @@ -105,6 +104,9 @@ public class HttpRedirectPolicyController extends BaseController{ HttpBodyCfg resBodyCfg = new HttpBodyCfg(); resBodyCfg.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION); entity.setHttpResBody(resBodyCfg); + IpPortCfg ipPortCfg = new IpPortCfg(); + ipPortCfg.setCfgType(Constants.HTTP_IP_REGION); + entity.setIpPort(ipPortCfg); List urlList=new ArrayList(); urlList.add(urlCfg); @@ -121,6 +123,10 @@ public class HttpRedirectPolicyController extends BaseController{ List resBodyList=new ArrayList(); resBodyList.add(resBodyCfg); entity.setHttpResBodyList(resBodyList); + + List ipPortList=new ArrayList(); + ipPortList.add(ipPortCfg); + entity.setIpPortList(ipPortList); initFormCondition(model,entity); } diff --git a/src/main/java/com/nis/web/service/configuration/HttpRedirectCfgService.java b/src/main/java/com/nis/web/service/configuration/HttpRedirectCfgService.java index 6d6b6259a..f5e64f96f 100644 --- a/src/main/java/com/nis/web/service/configuration/HttpRedirectCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/HttpRedirectCfgService.java @@ -73,6 +73,7 @@ public class HttpRedirectCfgService extends CrudService httpUrlList = websiteCfgDao.getHttpUrlList(entity); List httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity); List httpResHdrList = websiteCfgDao.getHttpResHdrList(entity); + List ipPortCfgList = websiteCfgDao.getIpPortList(entity); entity.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION); List httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity); entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION); @@ -82,6 +83,7 @@ public class HttpRedirectCfgService extends CrudService0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + websiteCfgDao.updateCfgValid(cfg); + } if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ HttpUrlCfg cfg = new HttpUrlCfg(); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); @@ -284,6 +305,20 @@ public class HttpRedirectCfgService extends CrudService0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + websiteCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + ipRegionList=map.get("dstList"); + if(map.get("numRegionList")!=null){ + numRegionList.addAll(map.get("numRegionList")); + } + } + } if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ HttpUrlCfg cfg = new HttpUrlCfg(); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); @@ -367,7 +402,8 @@ public class HttpRedirectCfgService extends CrudService +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +

+ + +

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +

+ + +

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +

+ + +

+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp index 148871021..c0b6d9f55 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp @@ -169,7 +169,7 @@ $(function(){
+ diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp index 338ee7c2c..c1712a8bb 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp @@ -22,47 +22,6 @@ }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); - if($("#cfgId").val()!=""){ - if($("#httpReqCfgNum").val()>0){ - $("a[for='httpReqCfg']").parent().addClass("active"); - $("a[for='httpResCfg']").parent().removeClass("active"); - $(".httpResCfg").addClass("hidden").addClass("disabled"); - $(".httpReqCfg").removeClass("hidden").removeClass( - "disabled"); - } - if($("#httpResCfgNum").val()>0){ - $("a[for='httpResCfg']").parent().addClass("active"); - $("a[for='httpReqCfg']").parent().removeClass("active"); - $(".httpReqCfg").addClass("hidden").addClass("disabled"); - $(".httpResCfg").removeClass("hidden").removeClass( - "disabled"); - } - }else{ - $(".httpResCfg").addClass("hidden").addClass("disabled"); - $(".httpReqCfg").removeClass("hidden").removeClass( - "disabled"); - } - $(".configType").on("click", function() { - var region = ($(this).find("a").attr("for")); - if(region=="httpReqCfg"){ - $(".httpResCfg").addClass("hidden").addClass("disabled"); - $(".httpReqCfg").removeClass("hidden").removeClass( - "disabled"); - }else{ - $(".httpReqCfg").addClass("hidden").addClass("disabled"); - $(".httpResCfg").removeClass("hidden").removeClass( - "disabled"); - } - - }); - $("select[name='userRegion1']").on("change",function(){ - var code = $(this).val(); - if(code.indexOf("30")==0){//以30开头的应答码需要输入URL地址 - $("input[name='userRegion2']").addClass("url"); - }else{ - $("input[name='userRegion2']").removeClass("url"); - } - }); $("#cfgFrom").validate( { @@ -86,12 +45,6 @@ return; } } - if(!$(".httpResCfg").hasClass("hidden")){ - if($(".httpResCfg").find(".boxSolid").length==$(".httpResCfg").find(".boxSolid.hidden").length){ - top.$.jBox.tip("", ""); - return; - } - } //代表所有区域都隐藏了,提示必须增加个区域信息 if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){ if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click(); @@ -134,18 +87,12 @@ var addContent = function(obj, contentClassName) { $("." + contentClassName + "0").removeClass("hidden").removeClass( "disabled"); - /* $("."+contentClassName+"0").find("input,select").each(function(){ - $(this).removeAttr("disabled"); - }); */ $(obj).addClass("hidden"); } //业务窗口关闭 var delContent = function(contentClassName, addBtnClassName) { $("." + contentClassName).addClass("hidden").addClass("disabled"); - /* $("."+contentClassName).find("input,select").each(function(){ - $(this).attr("disabled","true"); - }); */ $("." + addBtnClassName).removeClass("hidden"); } @@ -155,7 +102,11 @@

- + + + + +

@@ -180,261 +131,208 @@ - -
-
-
-
- -
- - - - -
-
-
-
- -
- -
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
- -
- -
-
-
-
-
- - - -
- -

- - -

- - - -
hidden disabled " > - <%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%> -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
- - - - - -
- -

- - -

- - <%-- --%> - - -
hidden disabled " > - <%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%> -
-
-
- -
- - -
- -

- - -

- - <%-- --%> - - -
hidden disabled " > - <%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%> -
-
-
- -
- - -
- -

- - -

- - <%-- --%> - - -
hidden disabled " > - <%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%> -
-
-
-
-
- - - -
- -

- - -

- - <%-- --%> - - -
hidden disabled "> - <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> -
-
-
- -
- - -
- -

- - -

- <%-- --%> - - -
hidden disabled "> - - <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> -
-
-
- -
-
- - <%@include file="/WEB-INF/include/form/areaInfo.jsp"%> -
- <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> -
-
-
-
-
- - -
-
-
-
-
+ + +
+
+
+
+
+ <%@include file="/WEB-INF/views/cfg/actionRegionForm.jsp"%> +
+ + + +
+ +

+ + +

+ + + +
hidden disabled " > + <%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%> +
+ +
+
+ +
+ + + + +
+ +

+ + +

+ + <%-- --%> + + +
hidden disabled " > + <%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%>
+
+
+ +
+ + +
+ +

+ + +

+ + <%-- --%> + + +
hidden disabled " > + <%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%> +
+
+
+ +
+ + +
+ +

+ + +

+ + <%-- --%> + + +
hidden disabled " > + <%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%> +
+
+
+
+
+ + + +
+ +

+ + +

+ + <%-- --%> + + +
hidden disabled "> + <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> +
+
+
+ +
+ + +
+ +

+ + +

+ <%-- --%> + + +
hidden disabled "> + + <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> +
+
+
+ +
+
+
+ <%@include file="/WEB-INF/include/form/areaInfo.jsp"%> +
+ <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> +
+
+
+
+
+ +
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp index f8e5ff899..7d4bf2613 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp @@ -251,7 +251,12 @@

- + + + + + +

@@ -453,6 +458,13 @@
+ + + + + @@ -464,8 +476,20 @@ - - + + + + + + + + + + + + + + @@ -497,14 +521,40 @@ - - - - - - - - ${indexCfg.userRegion2 } + + + + + + + + + + + ${indexCfg.userRegion2 } + + + + + + + + + + ${indexCfg.userRegion2 } + + + + + + + + + + ${indexCfg.userRegion2 } + ${indexCfg.userRegion3 } + + diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp index 4d9ee0ff2..75837244e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp @@ -39,7 +39,6 @@