diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index 2d8c9515b..6f42d928e 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; import com.nis.domain.Page; import com.nis.domain.configuration.BaseIpCfg; @@ -58,6 +59,24 @@ public class WebsiteController extends BaseController{ public String httpForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ entity = websiteCfgService.getHttpCfg(Long.parseLong(ids)); + if(entity.getIpPortList().size()==0){ + entity.getIpPortList().add(new IpPortCfg()); + } + if(entity.getHttpUrlList().size()==0){ + entity.getHttpUrlList().add(new HttpUrlCfg()); + } + if(entity.getHttpReqHdrList().size()==0){ + entity.getHttpReqHdrList().add(new HttpReqHeadCfg()); + } + if(entity.getHttpResHdrList().size()==0){ + entity.getHttpResHdrList().add(new HttpResHeadCfg()); + } + if(entity.getHttpReqBodyList().size()==0){ + entity.getHttpReqBodyList().add(new HttpBodyCfg()); + } + if(entity.getHttpResBodyList().size()==0){ + entity.getHttpResBodyList().add(new HttpBodyCfg()); + } }else{ List ipList=new ArrayList(); ipList.add(new IpPortCfg()); @@ -88,4 +107,11 @@ public class WebsiteController extends BaseController{ websiteCfgService.saveHttpCfg(entity); return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId(); } + @RequestMapping(value = {"ajaxHttpSubList"}) + public String ajaxHttpSubList(Model model,Long cfgId,Integer index) { + CfgIndexInfo cfg = websiteCfgService.getHttpCfg(cfgId); + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + return "/cfg/website/httpSubList"; + } } diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index 904dd16af..7e0cf76bd 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -48,24 +48,6 @@ public class WebsiteCfgService extends CrudService { List httpResHdrList = websiteCfgDao.getHttpResHdrList(entity); List httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity); List httpResBodyList = websiteCfgDao.getHttpResBodyList(entity); - if(ipPortList.size()==0){ - ipPortList.add(new IpPortCfg()); - } - if(httpUrlList.size()==0){ - httpUrlList.add(new HttpUrlCfg()); - } - if(httpReqHdrList.size()==0){ - httpReqHdrList.add(new HttpReqHeadCfg()); - } - if(httpResHdrList.size()==0){ - httpResHdrList.add(new HttpResHeadCfg()); - } - if(httpReqBodyList.size()==0){ - httpReqBodyList.add(new HttpBodyCfg()); - } - if(httpResBodyList.size()==0){ - httpResBodyList.add(new HttpBodyCfg()); - } entity.setIpPortList(ipPortList); entity.setHttpReqBodyList(httpReqBodyList); entity.setHttpReqHdrList(httpReqHdrList); diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp index c43d688a6..a4167e5ab 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp @@ -55,263 +55,31 @@ var index=$(this).attr("id").replace("open",""); $("#"+openId).hide(); $("#"+closeId).show(); - var compileId=$(this).attr("compileId"); + //var compileId=$(this).attr("compileId"); var cfgId=$(this).attr("cfgId"); - var hasIp=false; - var hasAccount=false; if($("#"+openId).parent().parent().next("tr").hasClass("child")){ $("#"+openId).parent().parent().next("tr").show(); }else{ $.ajax({ type:'post', async:false, - url:'${ctx}/ntc/website/ajaxVoipAndAccountInfo', - data:{"compileId":compileId,"cfgId":cfgId}, + url:'${ctx}/ntc/website/ajaxHttpSubList', + data:{"cfgId":cfgId,"index":index}, + dataType:"html", success:function(data){ - var voipIpCfgTab=""+ - ""+ - ""+ - ""+ - ""; + var subTab=""+ + ""+ + ""+ + ""+ + ""; var html=""; html+="
"; - if(data.ip.length >0){ - hasIp=true; - html+="
"; - html+=""; - html+=""; - html+=""; - html+="
"; - } - if(data.account.length >0){ - hasAccount=true; - html+="
"; - html+=""; - html+=""; - html+=""; - html+="
"; - } - - html+="
"; - //ip信息 - if(data.ip.length >0){ - html+="
"; - $.each(data.ip,function(index,item){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - /* if(index < (data.ip.length-1) && index != 0){ - alert("下一行"); - } - html+="";*/ - }) - html+="
"; - - } - //account信息 - if(data.account.length > 0){ - html+=""; - } - - voipIpCfgTab=voipIpCfgTab+html; - voipIpCfgTab+=""; - voipIpCfgTab+=""; - $("#"+openId).parent().parent().after(voipIpCfgTab); - if(hasAccount && ! hasIp){ - switchInfo("ip",index); - } + html = html+data; + subTab=subTab+html; + subTab+=""; + subTab+=""; + $("#"+openId).parent().parent().after(subTab); + $("div[name='tabTitle"+index+"']").get(0).click(); } }); } @@ -328,31 +96,12 @@ }); function switchInfo(flag,index){ - //关闭ip信息 - if("ip" ==flag){ - $("#ipInfo"+index).hide(); - $("#downIp"+index).hide(); - $("#ipTitle"+index).css("background-color","#f6f3f3"); - $("#accountInfo"+index).show(); - $("#accountDown"+index).show(); - $("#accountUp"+index).hide(); - $("#ipUp"+index).show(); - $("#ipDown"+index).hide(); - $("#accountTitle"+index).css("background-color","#eeeeee"); - }else{ - //关闭account信息 - $("#accountInfo"+index).hide(); - $("#downAccount"+index).hide(); - $("#accountTitle"+index).css("background-color","#f6f3f3"); - $("#ipInfo"+index).show(); - $("#ipDown"+index).show(); - $("#accountUp"+index).show(); - $("#accountDown"+index).hide(); - $("#ipUp"+index).hide(); - $("#ipTitle"+index).css("background-color","#eeeeee"); - } - - + $("div[name='subCfg"+index+"']").hide(); + $("div[id='"+flag+"Info"+index+"']").show(); + $("i[name='tabFlag"+index+"']").addClass("fa-angle-double-up"); + $("i[name='tabFlag"+index+"']").removeClass("fa-angle-double-down"); + $("i[id='"+flag+index+"']").addClass("fa-angle-double-down"); + $("i[id='"+flag+index+"']").removeClass("fa-angle-double-up"); } diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp new file mode 100644 index 000000000..4e5a70cf4 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp @@ -0,0 +1,474 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + + + \ No newline at end of file