From 75060d9a09ac693072882a12f609f2de71be19df Mon Sep 17 00:00:00 2001 From: wangxin Date: Fri, 28 Sep 2018 19:34:04 +0800 Subject: [PATCH 01/11] =?UTF-8?q?ip=E9=85=8D=E7=BD=AEform=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E8=B0=83=E6=95=B4action=E4=B8=8E=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/20180928/extend_ip_region.sql | 16 ++++++ .../WEB-INF/views/cfg/ipaddr/ipForm.jsp | 56 ++++++++++++++++--- 2 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 src/main/resources/sql/20180928/extend_ip_region.sql diff --git a/src/main/resources/sql/20180928/extend_ip_region.sql b/src/main/resources/sql/20180928/extend_ip_region.sql new file mode 100644 index 000000000..aa8809328 --- /dev/null +++ b/src/main/resources/sql/20180928/extend_ip_region.sql @@ -0,0 +1,16 @@ +UPDATE function_service_dict SET region_code=1 WHERE function_id=5 AND region_code='1,3'; +UPDATE function_service_dict SET region_code=2 WHERE function_id=5 AND region_code='2,3'; +UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=1; +UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=96; +#service_id需要定义出来之后进行替换 +INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) VALUES(5,0,64,'ratelimit',1234,'ip_ratelimit','ip地址限速',1,1); + +#根据PROTOCOL字典查出的值替换63 +SELECT id FROM sys_data_dictionary_name WHERE mark= 'PROTOCOL'; +INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(8,'IPSEC','IPSEC',0,1,1,63); +INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(15,'IPSEC','IPSEC',0,1,1,63); + +UPDATE function_region_dict SET is_valid=0 WHERE function_id=5 AND config_region_value ='NTC_SUBSCRIBE_ID'; +UPDATE function_region_dict SET config_protocol='0,6,17,1,8,15' WHERE function_id=5 AND config_region_value ='INLINE_IP_CB'; + +update function_region_dict set config_ip_type='4,6' where region_type=1 and config_ip_type like '%,46,64,10%'; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index 60d7c3bba..9a869607f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -20,10 +20,10 @@ $(".glyphicon-plus").first().click(); $(".ipPortList").find(".glyphicon-remove").addClass("hidden") var action=$(".action:checked").val(); - if(action==32||action==96){ - $(".subscribeId").find(".glyphicon-remove").click(); + /*if(action==32){ + $(".subscribeId").find(".glyphicon-remove").click(); $(".subscribeId").prev("h4").addClass("hidden"); - } + }*/ var regionCodes=$(".action:checked").attr("regionCode").split(","); $("h4[class*='ipPortListTitle']").each(function(){ var has=false; @@ -36,6 +36,7 @@ $(this).html(""); } }); + processAction($(".ipPortList")); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); @@ -57,16 +58,17 @@ $(this).find(".ipPortTitle").html(i18nCode); }); var tabInfo=$(".ipPortList"); - if(tabInfo){ + processAction(tabInfo); + /* if(tabInfo){ tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); //丢弃回流没有subscribeId - if($(this).val()==32||$(this).val()==96){ + if($(this).val()==32||$(this).val()==96){ $(".subscribeId").find(".glyphicon-remove").click(); $(".subscribeId").prev("h4").addClass("hidden"); }else{ $(".subscribeId").prev("h4").removeClass("hidden"); - } + } //处理ICMP if($(this).val()==32){ $.ipcommon.protocol.each(function(){ @@ -80,7 +82,7 @@ tabInfo.find("select[name$='protocol']").selectpicker("refresh"); } - } + } */ }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); @@ -101,10 +103,10 @@ subscribeId=1; } //代表所有业务都隐藏了,提示必须增加一种业务数据 - if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){ + /* if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){ 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(); @@ -183,6 +185,42 @@ }); */ $("." + addBtnClassName).removeClass("hidden"); } +var processAction=function(obj){ + var o=$(obj) + if(o){ + var action=$(".action:checked").val(); + /*处理协议*/ + var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value"); + //先清空,再添加 + o.find("select[name$='protocol']").empty(); + if(action==32){ + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==8||$(this).attr("value")==15){ + o.find("select[name$='protocol']").append($(this)); + } + }) + }else if(action==16){ + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6){ + o.find("select[name$='protocol']").append($(this)); + } + }) + }else if(action==64){ + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){ + o.find("select[name$='protocol']").append($(this)); + } + }) + } + o.find("select[name$='protocol']").selectpicker("refresh"); + //切换后如果没找到选项,选任意协议 + if(o.find("select[name$='protocol'] option[value='"+selectedProtocol+"']").length>0){ + o.find("select[name$='protocol']").selectpicker("val",selectedProtocol); + }else{ + o.find("select[name$='protocol']").selectpicker("val",0); + } + } +} From a38093347f258460b3219e7717ef0a44a00a0078 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Fri, 28 Sep 2018 20:20:51 +0800 Subject: [PATCH 02/11] =?UTF-8?q?1=E3=80=81voip=E5=90=88=E5=B9=B6=EF=BC=8C?= =?UTF-8?q?2=E3=80=81subscribeId=E6=96=B0=E5=A2=9E=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ntc/AvContentController.java | 116 +++--- .../configuration/AvContentCfgService.java | 68 ++-- .../WEB-INF/views/cfg/av/voip/voipForm.jsp | 75 +++- .../{voipAccountForm.jsp => voipForm.jsp.bak} | 97 +++-- .../WEB-INF/views/cfg/av/voip/voipList.jsp | 359 ++---------------- .../{voipAccountList.jsp => voipList.jsp.bak} | 356 ++++++++--------- .../WEB-INF/views/cfg/av/voip/voipSubList.jsp | 331 ++++++++++++++++ .../WEB-INF/views/cfg/whitelist/ipForm.jsp | 27 +- 8 files changed, 777 insertions(+), 652 deletions(-) rename src/main/webapp/WEB-INF/views/cfg/av/voip/{voipAccountForm.jsp => voipForm.jsp.bak} (80%) rename src/main/webapp/WEB-INF/views/cfg/av/voip/{voipAccountList.jsp => voipList.jsp.bak} (81%) create mode 100644 src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java index 24e519955..5f5a86ee5 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java @@ -3,7 +3,6 @@ package com.nis.web.controller.configuration.ntc; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; @@ -13,7 +12,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; @@ -22,27 +20,22 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; -import com.nis.domain.SysUser; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.basics.SysDictInfo; import com.nis.domain.configuration.AreaBean; import com.nis.domain.configuration.AreaIpCfg; -import com.nis.domain.configuration.AvContIpCfg; import com.nis.domain.configuration.AvVoipAccountCfg; import com.nis.domain.configuration.CfgIndexInfo; -import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.exceptions.MaatConvertException; import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; -import com.nis.util.Configurations; import com.nis.util.Constants; import com.nis.util.DateUtils; import com.nis.util.StringUtil; import com.nis.util.excel.ExportExcel; import com.nis.web.controller.BaseController; -import com.nis.web.security.UserUtils; /** * 处理音视频文本业务 @@ -55,11 +48,11 @@ public class AvContentController extends BaseController { /*****************************voip业务***************/ //音视频VOIP IP配置新增界面 @RequestMapping(value = {"/voipForm"}) - @RequiresPermissions(value={"avVoipIp:config"}) + @RequiresPermissions(value={"avVoip:config"}) public String voipFrom(Model model,HttpServletRequest request ,HttpServletResponse response ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(compileIds)){ - cfg.setCompileId(Integer.parseInt(compileIds)); + if(!StringUtil.isEmpty(ids)){ + cfg.setCfgId(Long.parseLong(ids)); cfg = avContentCfgService.getCfgIndexInfo(cfg); initUpdateFormCondition(model, cfg); }else{ @@ -70,7 +63,7 @@ public class AvContentController extends BaseController { return "/cfg/av/voip/voipForm"; } //音视频VOIP Account配置新增界面 - @RequestMapping(value = {"/voipAccountForm"}) +/* @RequestMapping(value = {"/voipAccountForm"}) @RequiresPermissions(value={"avVoipAccount:config"}) public String voipAccountForm(Model model,HttpServletRequest request ,HttpServletResponse response ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ @@ -85,7 +78,7 @@ public class AvContentController extends BaseController { model.addAttribute("_cfg", cfg); return "/cfg/av/voip/voipAccountForm"; - } + }*/ //保存voip ip信息 @RequestMapping(value = {"/saveVoip"}) @@ -97,18 +90,18 @@ public class AvContentController extends BaseController { }catch(Exception e){ if(e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("voip IP信息保存失败",e); + logger.error("voip 信息保存失败",e); addMessage(redirectAttributes,"request_service_failed"); }else { e.printStackTrace(); - logger.error("voip IP信息保存失败",e); + logger.error("voip 信息保存失败",e); addMessage(redirectAttributes,"save_failed"); } } return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId(); } //保存voip Account信息 - @RequestMapping(value = {"/saveAccountVoip"}) +/* @RequestMapping(value = {"/saveAccountVoip"}) public String saveAccountVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ try{ @@ -126,12 +119,10 @@ public class AvContentController extends BaseController { } } return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); - } - //视频文本VOIP IP配置列表 + }*/ + //视频文本VOIP 配置列表 @RequestMapping(value = {"/voipList"}) - public String voipCfgList(Model model,HttpServletRequest request - ,HttpServletResponse response - ,@ModelAttribute("cfg")CfgIndexInfo entity + public String voipCfgList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){ if(entity.getVoipIp()== null){ entity.setVoipIp(new AvVoipIpCfg()); @@ -148,7 +139,7 @@ public class AvContentController extends BaseController { return "/cfg/av/voip/voipList"; } //视频文本VOIP Account配置列表 - @RequestMapping(value = {"/voipAccountList"}) +/* @RequestMapping(value = {"/voipAccountList"}) public String voipCfgAccountList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){ if(entity.getVoipAccount()== null){ @@ -161,12 +152,12 @@ public class AvContentController extends BaseController { model.addAttribute("page", page); initPageCondition(model,entity); return "/cfg/av/voip/voipAccountList"; - } + }*/ //修改VOIP IP配置状态 @RequestMapping(value = {"/updateAvVoipValid"}) - @RequiresPermissions(value={"avVoipIp:config"}) + @RequiresPermissions(value={"avVoip:config"}) public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId ,RedirectAttributes redirectAttributes ) { @@ -175,18 +166,18 @@ public class AvContentController extends BaseController { } catch (Exception e) { if(e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("voip IP信息审核失败",e); + logger.error("voip 信息审核失败",e); addMessage(redirectAttributes,"request_service_failed"); }else { e.printStackTrace(); - logger.error("voip IP信息审核失败",e); + logger.error("voip 信息审核失败",e); addMessage(redirectAttributes,"audit_failed"); } } return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; } //修改VOIP account配置状态 - @RequestMapping(value = {"/updateAvVoipAccountValid"}) +/* @RequestMapping(value = {"/updateAvVoipAccountValid"}) @RequiresPermissions(value={"avVoipAccount:config"}) public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId ,RedirectAttributes redirectAttributes @@ -205,15 +196,13 @@ public class AvContentController extends BaseController { } } return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; - } + }*/ //修改VOIP IP配置审核状态 @RequestMapping(value = {"/auditAvVoip"}) - @RequiresPermissions(value={"avVoipIp:confirm"}) - public String auditVoip(Integer isAudit,Integer isValid,String ids - ,String compileIds,Integer functionId - ,RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(compileIds)){ - String[] idArray = compileIds.split(","); + @RequiresPermissions(value={"avVoip:confirm"}) + public String auditVoip(Integer isAudit,Integer isValid,String ids ,String compileIds,Integer functionId ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); Date auditTime=new Date(); for(String id :idArray){ try { @@ -221,7 +210,7 @@ public class AvContentController extends BaseController { } catch (MaatConvertException e) { if(e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("VOIP配置下发失败:"+e.getMessage());; + logger.error("VOIP配置下发失败:"+e.getMessage());; addMessage(redirectAttributes,"request_service_failed"); }else { e.printStackTrace(); @@ -236,7 +225,7 @@ public class AvContentController extends BaseController { return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; } //修改VOIP IP配置审核状态 - @RequestMapping(value = {"/auditAvVoipAccount"}) +/* @RequestMapping(value = {"/auditAvVoipAccount"}) @RequiresPermissions(value={"avVoipAccount:confirm"}) public String auditVoipAccount(Integer isAudit,Integer isValid,String ids ,String compileIds,Integer functionId @@ -262,14 +251,14 @@ public class AvContentController extends BaseController { } return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; - } + }*/ /** * 账号account * 根据索引表信息异步获取子表信息 * @return */ - @ResponseBody + /*@ResponseBody @RequestMapping(value = "ajaxVoipAccountInfo") public Map getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) { Map voipAndAccountInfoMap=new HashMap(); @@ -282,25 +271,50 @@ public class AvContentController extends BaseController { voipAndAccountInfoMap.put("account", voipAccountCfgList); voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); return voipAndAccountInfoMap; - } + }*/ /** * 根据索引表信息异步获取子表信息 * @return */ - @ResponseBody - @RequestMapping(value = "ajaxVoipIpInfo") - public Map getVoipIpInfo(CfgIndexInfo cfgIndexInfo) { - Map voipAndAccountInfoMap=new HashMap(); + @RequestMapping(value = {"/ajaxVoipIpInfo"}) + public String getVoipIpInfo(Model model,Long cfgId,Integer index) { + CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); + cfgIndexInfo.setCfgId(cfgId); + CfgIndexInfo cfg = avContentCfgService.getCfgIndexInfo(cfgIndexInfo); + List tabList = new ArrayList(); //获取voipIpCfg信息 - List voipIpCfgList=new ArrayList(); - List ntcSubscribeIdCfgList=new ArrayList(); - - voipIpCfgList = avContentCfgService.getVoipIpCfgList(cfgIndexInfo); - ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo); - - voipAndAccountInfoMap.put("ip", voipIpCfgList); - voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); - return voipAndAccountInfoMap; + if(cfg.getVoipIps()!=null){ + String cfgType = null; + for(AvVoipIpCfg ip:cfg.getVoipIps()){ + if(!ip.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",ip.getCfgType()}); + cfgType = ip.getCfgType(); + } + } + } + if(cfg.getVoipAccounts()!=null){ + String cfgType = null; + for(AvVoipAccountCfg account:cfg.getVoipAccounts()){ + if(account!=null&&!account.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",account.getCfgType()}); + cfgType = account.getCfgType(); + } + } + } + //查询关键字 + if(cfg.getNtcSubscribeIdCfgList()!=null){ + String cfgType = null; + for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ + if(!ntc.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",ntc.getCfgType()}); + cfgType = ntc.getCfgType(); + } + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/av/voip/voipSubList"; } /*****************************voip业务***************/ diff --git a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java index 5bc029af1..dbd11cde5 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -78,13 +78,13 @@ public class AvContentCfgService extends BaseService{ * @param entity * @return */ - public Page findAccountPage(Page page, CfgIndexInfo entity) { + /*public Page findAccountPage(Page page, CfgIndexInfo entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); entity.setPage(page); List list=avContentCfgDao.findAccountList(entity); page.setList(list); return page; - } + }*/ /** * 根据索引表信息获取voipIpCfg信息 * @param entity @@ -116,20 +116,16 @@ public class AvContentCfgService extends BaseService{ */ public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity) { CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity); - List ntcSubscribeList=getSubscribeIdCfgList(entity); - if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){ - ntcSubscribeList.add(new NtcSubscribeIdCfg()); - } - List voipIps=getVoipIpCfgList(entity); - if(voipIps ==null || voipIps.size() <=0){ - voipIps.add(new AvVoipIpCfg()); - } + List ntcSubscribeList=getSubscribeIdCfgList(cfg); + List voipIps=getVoipIpCfgList(cfg); + List voipAccounts=getVoipAccountCfgList(cfg); cfg.setNtcSubscribeIdCfgList(ntcSubscribeList); cfg.setVoipIps(voipIps); + cfg.setVoipAccounts(voipAccounts); return cfg; } - public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) { +/* public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) { CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity); List voipAccounts=new ArrayList<>(); voipAccounts=getVoipAccountCfgList(entity); @@ -145,7 +141,7 @@ public class AvContentCfgService extends BaseService{ cfg.setNtcSubscribeIdCfgList(ntcSubscribeList); return cfg; - } + }*/ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAvVoip(CfgIndexInfo entity){ @@ -178,6 +174,12 @@ public class AvContentCfgService extends BaseService{ } } } + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){ + entity.setVoipAccount(voipAccount); + avContentCfgDao.insertAvVoipAccountCfg(entity); + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -199,6 +201,7 @@ public class AvContentCfgService extends BaseService{ //无效子配置后,再新增子配置 avContentCfgDao.deleteAvVoipIp(entity); stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); + avContentCfgDao.deleteAvVoipAccountCfg(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -219,6 +222,12 @@ public class AvContentCfgService extends BaseService{ } } } + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) { + entity.setVoipAccount(voipAccount); + avContentCfgDao.insertAvVoipAccountCfg(entity); + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -230,7 +239,7 @@ public class AvContentCfgService extends BaseService{ } } - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + /*@Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAvVoipAccount(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); @@ -311,7 +320,7 @@ public class AvContentCfgService extends BaseService{ } } } - } + }*/ /** @@ -333,6 +342,7 @@ public class AvContentCfgService extends BaseService{ entity.setEditTime(new Date()); avContentCfgDao.updateAvVoipIp(entity); avContentCfgDao.updateAvVoipKeywordCfgt(entity); + avContentCfgDao.updateAvVoipAccount(entity); avContentCfgDao.updateCfgIndexInfo(entity); AreaIpCfg areaIpCfg=new AreaIpCfg(); BeanUtils.copyProperties(entity, areaIpCfg); @@ -345,7 +355,7 @@ public class AvContentCfgService extends BaseService{ * @param isValid * @param ids compileIds */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) +/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void updateAvVoipAccountValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){ String[] idArray = compileIds.split(","); for(String id :idArray){ @@ -363,7 +373,7 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg); areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg); } - } + }*/ /** * * @param isAudit @@ -372,16 +382,17 @@ public class AvContentCfgService extends BaseService{ * @param functionId */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){ + public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){ CfgIndexInfo entity = new CfgIndexInfo(); List list = new ArrayList(); List voipIpList = new ArrayList(); List ntcList = new ArrayList(); + List accountList = new ArrayList(); List areaIpCfgList = new ArrayList(); CfgIndexInfo searchCfg=new CfgIndexInfo(); - searchCfg.setCompileId(Integer.parseInt(compileId)); + searchCfg.setCfgId(Long.parseLong(id)); entity = avContentCfgDao.getCfgIndexInfo(searchCfg); entity.setIsAudit(isAudit); @@ -390,6 +401,7 @@ public class AvContentCfgService extends BaseService{ entity.setAuditTime(auditTime); avContentCfgDao.updateAvVoipIp(entity); + avContentCfgDao.updateAvVoipAccount(entity); avContentCfgDao.updateAvVoipKeywordCfgt(entity); avContentCfgDao.updateCfgIndexInfo(entity); @@ -398,6 +410,7 @@ public class AvContentCfgService extends BaseService{ areaIpCfgDao.updateAreaIpCfg(areaIpCfg); voipIpList=avContentCfgDao.findVoipIpCfgList(entity); + accountList=avContentCfgDao.findVoipAccountCfgList(entity); ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); @@ -423,6 +436,11 @@ public class AvContentCfgService extends BaseService{ groupRelationList=ntcMap.get("groupList"); strRegionList=ntcMap.get("dstList"); } + if(!StringUtil.isEmpty(accountList)){ + Map accountMap = cfgConvert(strRegionList,accountList,2,entity,groupRelationList); + groupRelationList=accountMap.get("groupList"); + strRegionList=accountMap.get("dstList"); + } if(!StringUtil.isEmpty(areaIpCfgList)){ Map areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); groupRelationList=areaMap.get("groupList"); @@ -452,10 +470,10 @@ public class AvContentCfgService extends BaseService{ maatBean.setOpAction(Constants.INSERT_ACTION); //调用服务接口下发配置数据 String json=gsonToJson(maatBean); - logger.info("voip IP配置下发配置参数:"+json); + logger.info("voip 配置下发配置参数:"+json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); - logger.info("voip IP配置下发响应信息:"+result.getMsg()); + logger.info("voip 配置下发响应信息:"+result.getMsg()); }else if(isAudit==3){ maatCfg.setCompileId(entity.getCompileId()); @@ -469,15 +487,15 @@ public class AvContentCfgService extends BaseService{ maatBean.setOpAction(Constants.UPDATE_ACTION); //调用服务接口取消配置 String json=gsonToJson(maatBean); - logger.info("voip IP配置下发配置参数:"+json); + logger.info("voip 配置下发配置参数:"+json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.put(json,1); - logger.info("voip IP配置取消配置响应信息:"+result.getMsg()); + logger.info("voip 配置取消配置响应信息:"+result.getMsg()); } } - /********************************voip业务*********************************/ + /********************************voip account业务*********************************/ /** * * @param isAudit @@ -485,7 +503,7 @@ public class AvContentCfgService extends BaseService{ * @param ids 编译Id * @param functionId */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) +/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void auditAvVoipAccount(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){ CfgIndexInfo entity = new CfgIndexInfo(); @@ -591,7 +609,7 @@ public class AvContentCfgService extends BaseService{ } - } + }*/ /********************************voip业务*********************************/ diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp index 991995a81..f0e433c1f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp @@ -37,17 +37,27 @@ } }, submitHandler : function(form) { - var flag = true; - var subscribeId=0; //存在隐藏的subscribeId,不算进域配置 - if($(".boxSolid.hidden").hasClass("subscribeId")){ - subscribeId=1; - } - //代表所有业务都隐藏了,提示必须增加一种业务数据 - if(($(".boxSolid").length - 1) == ($(".boxSolid.hidden").length - subscribeId)){ - top.$.jBox.tip("", ""); - return; + if($(".boxSolid[class~='subscribeId']").length>0){ + if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } + } + if(!$(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length) + 1){ + top.$.jBox.tip("", ""); + return; + } + } + //代表所有业务都隐藏了,提示必须增加一种业务数据 + }else{ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } } //代表所有区域都隐藏了,提示必须增加个区域信息 if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){ @@ -134,7 +144,7 @@

- +

@@ -228,6 +238,7 @@ + @@ -260,7 +271,49 @@ + + + +

+ + +

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

@@ -269,7 +322,6 @@ onClick="addContent(this,'${tabName}')" title="add">

- <%-- --%> @@ -299,6 +351,7 @@
+

<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp.bak similarity index 80% rename from src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp rename to src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp.bak index c85a72805..991995a81 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp.bak @@ -14,25 +14,28 @@ .ready( function() { $(".glyphicon-plus").first().click(); + /* $("#cancel").on("click", function() { + window.history.back(); + });*/ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); var action=$("input[name='action']:checked").val(); switchAction(action); - }); + }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); $("#cfgFrom").validate( { errorPlacement : function(error, element) { - if($(element).parents().hasClass("tagsinput")){ - $(element).parents(".col-md-6").next("div").append(error); - }else{ - $(element).parents(".form-group").find( - "div[for='" - + element.attr("name") - + "']").append(error); - } - }, + if($(element).parents().hasClass("tagsinput")){ + $(element).parents(".col-md-6").next("div").append(error); + }else{ + $(element).parents(".form-group").find( + "div[for='" + + element.attr("name") + + "']").append(error); + } + }, submitHandler : function(form) { var flag = true; @@ -131,7 +134,7 @@

- +

@@ -149,7 +152,7 @@
-
@@ -158,6 +161,8 @@ value="${_cfg.serviceId}">
+ +
@@ -169,25 +174,24 @@
+
- +
- @@ -195,8 +199,9 @@
+
- +
@@ -214,56 +219,48 @@ +
- + + - - + +

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

@@ -272,6 +269,7 @@ onClick="addContent(this,'${tabName}')" title="add">

+ <%-- --%> @@ -301,7 +299,6 @@
-

<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp index 477eb2d81..2d5d4618a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp @@ -3,9 +3,6 @@ <spring:message code="${cfgName}"></spring:message> - - - @@ -27,6 +24,8 @@ $("#intype").val("${cfg.cfgDesc}"); }else if("${cfg.voipIp.srcIpAddress}"){ $("#intype").val("${cfg.voipIp.srcIpAddress}"); + }else if("${cfg.voipAccount.cfgKeywords}"){ + $("#intype").val("${cfg.voipAccount.cfgKeywords}"); }else if("${cfg.compileId}"){ $("#intype").val("${cfg.compileId}"); }else if("${cfg.voipIp.srcPort}"){ @@ -64,10 +63,8 @@ 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 hasSubscribe=false; if($("#"+openId).parent().parent().next("tr").hasClass("child")){ $("#"+openId).parent().parent().next("tr").show(); }else{ @@ -75,305 +72,22 @@ type:'post', async:false, url:'${ctx}/ntc/av/ajaxVoipIpInfo', - data:{"compileId":compileId,"cfgId":cfgId}, + data:{"cfgId":cfgId,"index":index}, + dataType:"html", success:function(data){ - var voipIpCfgTab=""+ - ""+ - ""+ - ""+ - ""; + var subTab=""+ + ""+ + ""+ + ""+ + ""; var html=""; html+="
"; - if(data.subscribe.length >0){ - hasSubscribe=true; - html+="
"; - html+=""; - html+=""; - html+=""; - html+="
"; - } - if(data.ip.length >0){ - hasIp=true; - html+="
"; - html+=""; - html+=""; - html+=""; - html+="
"; - } - - html+="
"; - //subscribe信息 - if(data.subscribe.length > 0){ - html+="
"; - $.each(data.subscribe,function(index,item){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+="
"; - html+="
"; - html+="
"; - - if(item.isHexbin==0){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - } - if(item.isHexbin==1){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - } - if(item.isHexbin==2){ - 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+="
"; - } - //ip信息 - if(data.ip.length >0){ - html+=""; - - } - - voipIpCfgTab=voipIpCfgTab+html; - voipIpCfgTab+=""; - voipIpCfgTab+=""; - $("#"+openId).parent().parent().after(voipIpCfgTab); - if(hasSubscribe && ! hasIp){ - switchInfo("ip",index); - } - if(hasIp && ! hasSubscribe){ - switchInfo("subscribe",index); - } + html = html+data; + subTab=subTab+html; + subTab+=""; + subTab+=""; + $("#"+openId).parent().parent().after(subTab); + $("div[name='tabTitle"+index+"']").eq(0).click(); } }); } @@ -389,41 +103,13 @@ }); }); - function switchInfo(flag,index){ - //关闭ip信息 - if("ip" ==flag){ - $("#ipInfo"+index).hide(); - $("#downIp"+index).hide(); - $("#ipTitle"+index).removeClass("badge-info"); - $("#subscribeInfo"+index).show(); - $("#subscribeDown"+index).show(); - $("#subscribeUp"+index).hide(); - $("#ipUp"+index).show(); - $("#ipDown"+index).hide(); - $("#subscribeTitle"+index).addClass("badge-info"); - }else{ - //关闭subscribe信息 - $("#subscribeInfo"+index).hide(); - $("#downsubscribe"+index).hide(); - $("#subscribeTitle"+index).removeClass("badge-info"); - $("#ipInfo"+index).show(); - $("#ipDown"+index).show(); - $("#subscribeUp"+index).show(); - $("#subscribeDown"+index).hide(); - $("#ipUp"+index).hide(); - $("#ipTitle"+index).addClass("badge-info"); - } - - - } -

- +

@@ -470,6 +156,7 @@ + @@ -500,12 +187,12 @@
- + <%-- --%> - +
-
+ @@ -682,7 +369,7 @@ diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp.bak similarity index 81% rename from src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountList.jsp rename to src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp.bak index 16564cdaa..bd48b17b4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp.bak @@ -25,12 +25,14 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); - }else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){ - $("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}"); + }else if("${cfg.voipIp.srcIpAddress}"){ + $("#intype").val("${cfg.voipIp.srcIpAddress}"); }else if("${cfg.compileId}"){ $("#intype").val("${cfg.compileId}"); - }else if("${cfg.voipAccount.cfgKeywords}"){ - $("#intype").val("${cfg.voipAccount.cfgKeywords}"); + }else if("${cfg.voipIp.srcPort}"){ + $("#intype").val("${cfg.voipIp.srcPort}"); + }else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){ + $("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -64,15 +66,15 @@ $("#"+closeId).show(); var compileId=$(this).attr("compileId"); var cfgId=$(this).attr("cfgId"); + var hasIp=false; var hasSubscribe=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/av/ajaxVoipAccountInfo', + url:'${ctx}/ntc/av/ajaxVoipIpInfo', data:{"compileId":compileId,"cfgId":cfgId}, success:function(data){ var voipIpCfgTab=""+ @@ -82,77 +84,38 @@ ""; voipIpCfgTab+=""; $("#"+openId).parent().parent().after(voipIpCfgTab); - if(hasSubscribe && ! hasAccount){ - switchInfo("account",index); + if(hasSubscribe && ! hasIp){ + switchInfo("ip",index); } - if(hasAccount && ! hasSubscribe){ + if(hasIp && ! hasSubscribe){ switchInfo("subscribe",index); } } @@ -375,30 +390,28 @@ }); function switchInfo(flag,index){ - - if("account" ==flag){ - //关闭account信息 - $("#accountInfo"+index).hide(); - $("#downAccount"+index).hide(); - $("#accountTitle"+index).removeClass("badge-info"); + //关闭ip信息 + if("ip" ==flag){ + $("#ipInfo"+index).hide(); + $("#downIp"+index).hide(); + $("#ipTitle"+index).removeClass("badge-info"); $("#subscribeInfo"+index).show(); $("#subscribeDown"+index).show(); - $("#accountUp"+index).show(); - $("#accountDown"+index).hide(); $("#subscribeUp"+index).hide(); + $("#ipUp"+index).show(); + $("#ipDown"+index).hide(); $("#subscribeTitle"+index).addClass("badge-info"); - }else{ - //关闭subscribe信息 + //关闭subscribe信息 $("#subscribeInfo"+index).hide(); $("#downsubscribe"+index).hide(); $("#subscribeTitle"+index).removeClass("badge-info"); - $("#accountInfo"+index).show(); - $("#accountDown"+index).show(); + $("#ipInfo"+index).show(); + $("#ipDown"+index).show(); $("#subscribeUp"+index).show(); $("#subscribeDown"+index).hide(); - $("#accountUp"+index).hide(); - $("#accountTitle"+index).addClass("badge-info"); + $("#ipUp"+index).hide(); + $("#ipTitle"+index).addClass("badge-info"); } @@ -410,23 +423,23 @@

- +

- + @@ -455,7 +468,8 @@ - + + @@ -486,21 +500,21 @@
- - - + + + <%-- --%> - +
@@ -637,8 +651,8 @@
-
+
- + ${indexCfg.compileId } ${indexCfg.cfgDesc }
"; var html=""; html+="
"; - /* 订阅关键字 */ if(data.subscribe.length >0){ hasSubscribe=true; - html+="
"; + html+="
"; html+=""; html+=""; html+=""; html+="
"; } - - if(data.account.length >0){ - hasAccount=true; - html+="
"; - html+=""; - html+=""; - html+=""; + if(data.ip.length >0){ + hasIp=true; + html+="
"; + html+=""; + html+=""; + html+=""; html+="
"; } - html+="
"; //subscribe信息 if(data.subscribe.length > 0){ - html+="
"; + html+="
"; $.each(data.subscribe,function(index,item){ - //console.log(item.cfgKeywords); html+="
"; html+="
"; html+="
"; - html+="
"; html+="
"; html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; + if(item.isHexbin==0){ html+="
"; html+="
"; @@ -219,26 +182,7 @@ html+="
"; html+="
"; } - /* if(index < (data.ip.length-1) && index != 0){ - alert("下一行"); - } - html+="";*/ - }) - html+="
"; - } - //account信息 - if(data.account.length > 0){ - html+=""; } + //ip信息 + if(data.ip.length >0){ + html+=""; + + } voipIpCfgTab=voipIpCfgTab+html; voipIpCfgTab+="
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp new file mode 100644 index 000000000..56f7bcc3a --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp @@ -0,0 +1,331 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + + +
+ + +
+
+ + + + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index f8bfe7d8a..607927741 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -40,15 +40,26 @@ submitHandler : function(form) { //loading('onloading...'); var flag = true; - var subscribeId=0; //存在隐藏的subscribeId,不算进域配置 - if($(".boxSolid.hidden").hasClass("subscribeId")){ - subscribeId=1; - } - //代表所有业务都隐藏了,提示必须增加一种业务数据 - if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){ - top.$.jBox.tip("", ""); - return; + if($(".boxSolid[class~='subscribeId']").length>0){ + if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } + } + if(!$(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length) + 1){ + top.$.jBox.tip("", ""); + return; + } + } + //代表所有业务都隐藏了,提示必须增加一种业务数据 + }else{ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } } //代表所有区域都隐藏了,提示必须增加个区域信息 if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){ From 760764914374ae45711f29e28f25e184e441ebc1 Mon Sep 17 00:00:00 2001 From: wangxin Date: Sat, 29 Sep 2018 09:09:17 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=9B=B4=E6=94=B9ip=E5=9C=B0=E5=9D=80=20?= =?UTF-8?q?ratelimit=20service=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/20180928/extend_ip_region.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/sql/20180928/extend_ip_region.sql b/src/main/resources/sql/20180928/extend_ip_region.sql index aa8809328..7e79981ff 100644 --- a/src/main/resources/sql/20180928/extend_ip_region.sql +++ b/src/main/resources/sql/20180928/extend_ip_region.sql @@ -2,8 +2,8 @@ UPDATE function_service_dict SET region_code=1 WHERE function_id=5 AND region_co UPDATE function_service_dict SET region_code=2 WHERE function_id=5 AND region_code='2,3'; UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=1; UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=96; -#service_id需要定义出来之后进行替换 -INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) VALUES(5,0,64,'ratelimit',1234,'ip_ratelimit','ip地址限速',1,1); + +INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) VALUES(5,0,64,'ratelimit',1057,'ip_ratelimit','ip地址限速',1,1); #根据PROTOCOL字典查出的值替换63 SELECT id FROM sys_data_dictionary_name WHERE mark= 'PROTOCOL'; From 04d8fb24381ddf9c5c7a56948d5e7fe230e18e7e Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sat, 29 Sep 2018 10:31:42 +0800 Subject: [PATCH 04/11] =?UTF-8?q?voip=20ip=E5=92=8Cvoipaccount=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BF=AE=E6=94=B9sql,?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/20180928/update_voip.sql | 5 +++++ src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp | 1 + 2 files changed, 6 insertions(+) create mode 100644 src/main/resources/sql/20180928/update_voip.sql diff --git a/src/main/resources/sql/20180928/update_voip.sql b/src/main/resources/sql/20180928/update_voip.sql new file mode 100644 index 000000000..9b8726f81 --- /dev/null +++ b/src/main/resources/sql/20180928/update_voip.sql @@ -0,0 +1,5 @@ + #voip ip跟voip account 合二为一 +update sys_menu set href = "/ntc/av/voipList" where id = 831; +update function_service_dict set service_name='av_voip_monit' where dict_id=17 +update function_service_dict set service_name='av_voip_reject' where dict_id=16 +update function_region_dict set config_region_value='MM_SUBSCRIBE_ID',function_id=24,config_region_code=2 where dict_id=208 diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp index f0e433c1f..dc5cff0d9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp @@ -146,6 +146,7 @@

+
From 7292839ea5cfd2b052c9ebefe693acbe991045bd Mon Sep 17 00:00:00 2001 From: leijun Date: Sat, 29 Sep 2018 14:56:08 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E8=B0=83=E6=95=B4=EF=BC=8C=E8=A1=A8=E5=A4=B4?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/static/global/plugins/bootstrap/css/bootstrap.css | 1 - src/main/webapp/static/global/scripts/common.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/static/global/plugins/bootstrap/css/bootstrap.css b/src/main/webapp/static/global/plugins/bootstrap/css/bootstrap.css index 2c36da4fa..3d5b41284 100644 --- a/src/main/webapp/static/global/plugins/bootstrap/css/bootstrap.css +++ b/src/main/webapp/static/global/plugins/bootstrap/css/bootstrap.css @@ -1543,7 +1543,6 @@ pre { clear: both; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { - position: relative; min-height: 1px; /* padding-left: 15px; padding-right: 15px; */ diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 9c2a95215..245088acf 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -1283,7 +1283,7 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){ var title=""; if(data.areaIsps.length > 0){ title=$.validator.messages.area;//+" "+$.validator.messages.isp; - html+="
"; + html+="
"; html+=""; html+="";/* + "";*/ @@ -1302,7 +1302,7 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){ } if(data.areaIps.length > 0){ title=$.validator.messages.area+" ip"; - html+="
"+$.validator.messages.area+""+$.validator.messages.isp+"
"; + html+="
"; html+=""; html+="" + "" + From 0e87242c67046fd3fe10c9bf58b895f6bbf491fd Mon Sep 17 00:00:00 2001 From: leijun Date: Sat, 29 Sep 2018 20:48:12 +0800 Subject: [PATCH 06/11] =?UTF-8?q?IP=E5=A4=8D=E7=94=A8=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=B1=A0=E9=85=8D=E7=BD=AE=20=E6=8B=86=E5=88=86=E4=B8=BA?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=AD=90=E8=8F=9C=E5=8D=95=EF=BC=9ASNAT?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=B1=A0=E7=AE=A1=E7=90=86=E5=92=8CDNAT?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=B1=A0=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/IpMultiplexPoolCfg.java | 11 +- .../IpMultiplexPoolCfgController.java | 89 +++- .../configuration/IpMultiplexPoolCfgDao.xml | 12 +- .../WEB-INF/views/cfg/mail/mailForm.jsp | 5 +- .../cfg/maintenance/ipMultiplexPool/form.jsp | 97 ++-- .../cfg/maintenance/ipMultiplexPool/list.jsp | 32 +- .../maintenance/ipMultiplexPool/snatform.jsp | 236 ++++++++++ .../maintenance/ipMultiplexPool/snatlist.jsp | 442 ++++++++++++++++++ 8 files changed, 842 insertions(+), 82 deletions(-) create mode 100644 src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatform.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp diff --git a/src/main/java/com/nis/domain/configuration/IpMultiplexPoolCfg.java b/src/main/java/com/nis/domain/configuration/IpMultiplexPoolCfg.java index c9ecc9109..f8cb08dbd 100644 --- a/src/main/java/com/nis/domain/configuration/IpMultiplexPoolCfg.java +++ b/src/main/java/com/nis/domain/configuration/IpMultiplexPoolCfg.java @@ -27,7 +27,7 @@ public class IpMultiplexPoolCfg extends BaseCfg { private Integer protocol; @Expose @SerializedName("ip") - private String srcIpAddress; + private String destIpAddress; @Expose private String port; @Expose @@ -58,11 +58,12 @@ public class IpMultiplexPoolCfg extends BaseCfg { this.protocol = protocol; } - public String getSrcIpAddress() { - return srcIpAddress; + + public String getDestIpAddress() { + return destIpAddress; } - public void setSrcIpAddress(String srcIpAddress) { - this.srcIpAddress = srcIpAddress; + public void setDestIpAddress(String destIpAddress) { + this.destIpAddress = destIpAddress; } public String getPort() { return port; diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java index 735e5e833..247052d35 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/IpMultiplexPoolCfgController.java @@ -47,9 +47,8 @@ public class IpMultiplexPoolCfgController extends BaseController { } //查询ip复用地址池配置的policyGroup列表 - List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(2); + List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(3); model.addAttribute("policyGroups", policyGroups); - model.addAttribute("_cfg", cfg); return "/cfg/maintenance/ipMultiplexPool/form"; } @@ -92,7 +91,6 @@ public class IpMultiplexPoolCfgController extends BaseController { }catch(Exception e){ addMessage(redirectAttributes,"delete_failed"); } - return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId; } @@ -125,4 +123,89 @@ public class IpMultiplexPoolCfgController extends BaseController { return true; } } + + @RequestMapping(value = {"/snatlist"}) + public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ + //查询时left join policyGroup + Page page = ipMultiplexPoolCfgService.findPage(new Page(request, response,"r"), entity); + model.addAttribute("page", page); + initPageCondition(model,entity); + return "/cfg/maintenance/ipMultiplexPool/snatlist"; + } + + @RequestMapping(value = {"/snatform"}) + @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) + public String snatfrom(Model model, + HttpServletRequest request, + HttpServletResponse response, + String ids, + @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ + if(cfg == null){ + cfg=new IpMultiplexPoolCfg(); + } + if(!StringUtil.isEmpty(ids)){ + cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null); + initFormCondition(model, cfg); + }else{ + initFormCondition(model, cfg); + } + + //查询ip复用地址池配置的policyGroup列表 + List policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(2); + model.addAttribute("policyGroups", policyGroups); + model.addAttribute("_cfg", cfg); + return "/cfg/maintenance/ipMultiplexPool/snatform"; + } + + @RequestMapping(value = {"/snatsaveOrUpdate"}) + @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) + public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes, + @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ + try{ + + ipMultiplexPoolCfgService.saveOrUpdate(cfg); + + addMessage(redirectAttributes,"save_success"); + }catch(Exception e){ + e.printStackTrace(); + addMessage(redirectAttributes,"save_failed"); + } + + return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"/snataudit"}) + @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) + public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); + Date auditTime=new Date(); + for(String id :idArray){ + try { + ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("SNAT地址池管理配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + + } + return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; + } + @RequestMapping(value = {"/snatdelete"}) + @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) + public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes + ,HttpServletRequest request,HttpServletResponse response){ + try{ + if(!StringUtil.isEmpty(ids)){ + ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); + } + addMessage(redirectAttributes,"delete_success"); + }catch(Exception e){ + addMessage(redirectAttributes,"delete_failed"); + } + return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; + } + } diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexPoolCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpMultiplexPoolCfgDao.xml index a911869d3..3ac925b99 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexPoolCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexPoolCfgDao.xml @@ -7,7 +7,7 @@ - + @@ -72,8 +72,8 @@ AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') - - AND r.ip like concat(concat('%',#{srcIpAddress,jdbcType=VARCHAR}),'%') + + AND r.ip like concat(concat('%',#{destIpAddress,jdbcType=VARCHAR}),'%') AND a.group_name like concat(concat('%',#{groupName,jdbcType=VARCHAR}),'%') @@ -204,7 +204,7 @@ #{functionId,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER}, - #{srcIpAddress,jdbcType=VARCHAR}, + #{destIpAddress,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}, #{direction,jdbcType=INTEGER}, #{userRegion,jdbcType=VARCHAR}, @@ -277,8 +277,8 @@ protocol = #{protocol,jdbcType=INTEGER}, - - ip = #{srcIpAddress,jdbcType=VARCHAR}, + + ip = #{destIpAddress,jdbcType=VARCHAR}, port = #{port,jdbcType=VARCHAR}, diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp index f7642e389..078e9201a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp @@ -134,9 +134,10 @@
-

+ <%--

-

+ --%> +
diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/form.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/form.jsp index e40be5c15..b9ae7b36f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/form.jsp @@ -5,8 +5,8 @@ <spring:message code="${cfgName}"></spring:message> + + + +
+<%--

+ +

--%> +
+
+
+
+
+ + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ + <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp new file mode 100644 index 000000000..590a881bb --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist.jsp @@ -0,0 +1,442 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ + +

+ +

+ +
+
+
+
+ + + + + + + + + + +
+
+ + + + + + + <%-- --%> + +
+ +
+ +
+
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+ +
+
+
+ + + +
+
+ + + + + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + +
+
+ +
+
"+$.validator.messages.ip_type+""+$.validator.messages.ip_pattern+"
+ + + + <%-- --%> + + + + + <%-- --%> + <%-- + --%> + <%-- + --%> + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + <%-- --%> + <%-- + --%> + <%-- + --%> + + + + + + + + <%-- --%> + + + + + + + + + + + + +
${cfg.compileId} + + ${fns:abbr(cfg.cfgDesc,20)} + + + + ${fns:abbr(cfg.groupName,20)} + + ${fns:abbr(cfg.destIpAddress, 42)}${cfg.port } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + ${cfg.areaEffectiveIds } + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+
+
+
+
+ + + \ No newline at end of file From 5e2efc3e5a9f1665dd6ceaaac344a331427399b6 Mon Sep 17 00:00:00 2001 From: leijun Date: Sat, 29 Sep 2018 20:50:55 +0800 Subject: [PATCH 07/11] =?UTF-8?q?IP=E5=A4=8D=E7=94=A8=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=B1=A0=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_en.properties | 10 ++++++++-- src/main/resources/messages/message_zh_CN.properties | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index c110bc780..55db99cda 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -804,7 +804,7 @@ NTC_HTTP_RES_BODY=Response Body Configuration NTC_UNIVERSAL_IP=IP Configuration NTC_BGP_AS=AS Configuration NTC_DNS_REGION=Keyword Configuration -WHITE_LIST_DOMAIN=Domain White List +WHITE_LIST_DOMAIN=URL Configuration av_voip_account=VoIP Account Configuration av_cont_ip=Content IP Configuration NTC_SSL_SNI=SNI Keyword Configuration @@ -901,6 +901,7 @@ av_voip_ip_reject=Multimedia VoIP Control av_voip_ip_monit=Multimedia VoIP Monitoring website_http_reject=Website Http Control website_http_monit=Website Http Monitoring +website_http_whitelist=Website Http White List domain_white_whitelist=Global Domain Name White List av_content_ip_reject=Multimedia Content IP Control av_content_ip_monit=Multimedia Content IP Monitoring @@ -1171,4 +1172,9 @@ percentage=Percentage APP_SSL=APP SSL Feature APP_IP_RANGE=APP IP RANGE APP_DK=APP DK Feature -MM_SUBSCRIBE_ID=Subscribe ID \ No newline at end of file +MM_SUBSCRIBE_ID=Subscribe ID +mail_note=Note\uff1aIdentifiable Protocols Include SMTP\u3001POP3\u3001IMAP\u3002 +av_content_url_note=Note\uff1aIdentifiable Protocols Include RTSP\u3001TRMP\u3001MMS\u3002 +protocol_note=Note:Recognizable Protocols Include SIP,RTCP,RTP\u3002 +snat_multiplex=SNAT Address Pool +dnat_multiplex=DNAT Address Pool \ 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 006093d6c..5871d08fd 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -802,7 +802,7 @@ NTC_HTTP_RES_BODY=\u5E94\u7B54\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E NTC_UNIVERSAL_IP=IP\u914D\u7F6E NTC_BGP_AS=AS\u914D\u7F6E NTC_DNS_REGION=\u5173\u952E\u5B57\u914D\u7F6E -WHITE_LIST_DOMAIN=\u57DF\u540D\u767D\u540D\u5355 +WHITE_LIST_DOMAIN=URL\u914D\u7F6E av_voip_account=VoIP\u8D26\u53F7\u914D\u7F6E av_cont_ip=\u5185\u5BB9IP\u914D\u7F6E NTC_SSL_SNI=SNI\u5173\u952E\u5B57\u914D\u7F6E @@ -1168,4 +1168,9 @@ percentage=\u767E\u5206\u6BD4 APP_SSL=APP SSL\u7279\u5F81 APP_IP_RANGE=APP IP RANGE APP_DK=APP DK\u7279\u5F81 -MM_SUBSCRIBE_ID=\u8D26\u53F7 \ No newline at end of file +MM_SUBSCRIBE_ID=\u8D26\u53F7 +mail_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62ECSMTP\u3001POP3\u3001IMAP\u3002 +av_content_url_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62ECRTSP\u3001TRMP\u3001MMS\u3002 +protocol_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62ECSIP\u3001RTCP\u3001RTP\u3002 +snat_multiplex=SNAT\u5730\u5740\u6C60\u7BA1\u7406 +dnat_multiplex=DNAT\u5730\u5740\u6C60\u7BA1\u7406 \ No newline at end of file From 9db2e73d0443fac0735326522bbe480f11a01266 Mon Sep 17 00:00:00 2001 From: leijun Date: Sat, 29 Sep 2018 21:12:47 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=8E=BB=E9=99=A4title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/20180929/update_avAudio.sql | 3 +++ src/main/resources/sql/20180929/update_http_url.sql | 8 ++++++++ src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/basics/sysDictForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/basics/taskInfoForm.jsp | 4 ++-- .../WEB-INF/views/cfg/app/appBuiltinFeatureFileForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp | 6 +++--- src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp | 4 ++-- .../WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp | 4 ++-- .../WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/appCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/av/contIp/contIpForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp | 7 +++---- src/main/webapp/WEB-INF/views/cfg/av/fileSampleForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/av/picUrl/picUrlForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/av/signSampleForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp | 4 ++-- .../WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp | 4 ++-- .../WEB-INF/views/cfg/fileTransfer/fileDigestForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/fileTransfer/ftpForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/fileTransfer/p2pForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/ipBlockForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/ipCfgDemoForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/ipWhiteForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/ipsec/ipForm.jsp | 4 ++-- .../WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp | 4 ++-- .../WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp | 4 ++-- .../WEB-INF/views/cfg/proxy/control/httpRedirectForm.jsp | 4 ++-- .../views/cfg/proxy/control/httpReqReplaceForm.jsp | 4 ++-- .../views/cfg/proxy/control/httpResReplaceForm.jsp | 4 ++-- .../webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp | 4 ++-- 51 files changed, 111 insertions(+), 101 deletions(-) create mode 100644 src/main/resources/sql/20180929/update_avAudio.sql create mode 100644 src/main/resources/sql/20180929/update_http_url.sql diff --git a/src/main/resources/sql/20180929/update_avAudio.sql b/src/main/resources/sql/20180929/update_avAudio.sql new file mode 100644 index 000000000..9fecb6875 --- /dev/null +++ b/src/main/resources/sql/20180929/update_avAudio.sql @@ -0,0 +1,3 @@ +#音视频添加action白名单置位无效 +update function_service_dict set is_valid='0' where dict_id='130'; +update function_service_dict set is_valid='0' where dict_id='131'; \ No newline at end of file diff --git a/src/main/resources/sql/20180929/update_http_url.sql b/src/main/resources/sql/20180929/update_http_url.sql new file mode 100644 index 000000000..69ca58431 --- /dev/null +++ b/src/main/resources/sql/20180929/update_http_url.sql @@ -0,0 +1,8 @@ +INSERT INTO `function_service_dict` ( `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) VALUES ( '6', '4', '16', 'reject', '17', 'website_http_reject', NULL, '1', NULL, NULL, NULL, NULL, '1,2,3,4,5,6'); +INSERT INTO `function_service_dict` ( `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) VALUES ( '6', '4', '1', 'monit', '129', 'website_http_monit', NULL, '1', NULL, NULL, NULL, NULL, '1,2,3,4,5,6'); + +update function_region_dict set function_id='6' , config_service_type='http_url' where dict_id='15'; + +#ip复用地址池 +INSERT INTO `function_service_dict` ( `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) VALUES ( '633', '0', '96', 'loop', '832', 'ip_reuse_adress_pool_loop', NULL, '1', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `function_region_dict` (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_ip_type`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`) VALUES (NULL, NULL, NULL, NULL, NULL, '633', '1', 'IR_STATIC_IP_POOL_CB', NULL, 'IP复用地址池配置', '1', NULL, NULL, NULL, NULL, '2', '2', '4,6', '1,2,3', '1,2', '0', '0', '1', '1'); diff --git a/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp b/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp index b3bf7c6c4..e3b32bea6 100644 --- a/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp @@ -153,7 +153,7 @@ label.errorShow {
-

+<%--

@@ -166,7 +166,7 @@ label.errorShow { -

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/basics/sysDictForm.jsp b/src/main/webapp/WEB-INF/views/basics/sysDictForm.jsp index 72253b6ed..703203db5 100644 --- a/src/main/webapp/WEB-INF/views/basics/sysDictForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/sysDictForm.jsp @@ -110,7 +110,7 @@
-

+<%--

@@ -119,7 +119,7 @@ -

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/basics/taskInfoForm.jsp b/src/main/webapp/WEB-INF/views/basics/taskInfoForm.jsp index fe57afe01..fc87b854c 100644 --- a/src/main/webapp/WEB-INF/views/basics/taskInfoForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/taskInfoForm.jsp @@ -9,9 +9,9 @@
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appBuiltinFeatureFileForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appBuiltinFeatureFileForm.jsp index beef4be9f..df3944a5b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appBuiltinFeatureFileForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appBuiltinFeatureFileForm.jsp @@ -40,9 +40,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp index 869397931..47b656bf7 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp @@ -46,9 +46,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp index 0160005a2..da881696a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp @@ -47,9 +47,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp index b30f94274..73793adcd 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp @@ -61,14 +61,14 @@ $(function(){
-

- <%-- --%> +<%--

+ -

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp index fe0887494..26c1a8352 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp @@ -61,9 +61,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp index bad41a0ec..05acea677 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp @@ -28,9 +28,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp index 21a31a93c..b5899a909 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp @@ -98,9 +98,9 @@ var delContent = function(contentClassName, addBtnClassName) { -

+<%--

-

+ --%>
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 fa3773b2e..e727d3c10 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -167,9 +167,9 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp index 9d783717f..afcae4c79 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp @@ -61,9 +61,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp index f70f619ea..726222400 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp @@ -55,9 +55,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp index efaa37535..0229183c1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp @@ -144,9 +144,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/appCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/appCfgForm.jsp index c415a7073..df4bd98ec 100644 --- a/src/main/webapp/WEB-INF/views/cfg/appCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/appCfgForm.jsp @@ -71,9 +71,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp index 7eb70b40e..4384f3640 100644 --- a/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/asnPolicyCfgForm.jsp @@ -28,9 +28,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpForm.jsp index 53b652168..3111d220d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpForm.jsp @@ -64,9 +64,9 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp index 97b95f3c0..d0ee77f83 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp @@ -96,11 +96,10 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+<%--

-

- - + --%> +
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleForm.jsp index 296bbb996..ce8e3aa11 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleForm.jsp @@ -100,13 +100,13 @@ function hiddenlevel(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpForm.jsp index 9650982dc..b74f1512c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpForm.jsp @@ -65,9 +65,9 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlForm.jsp index 14884a22f..a3aa6ea9a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlForm.jsp @@ -88,9 +88,9 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+ <%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/signSampleForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/signSampleForm.jsp index 47d8110d9..a1e13513d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/signSampleForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/signSampleForm.jsp @@ -75,13 +75,13 @@ function hiddenlevel(){
-

+<%--

-

+ --%>
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 a309e3b42..397d8ab0c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp @@ -131,9 +131,9 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+<%--

-

+ --%>
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 75d8e2d33..76dc50ae7 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/ipForm.jsp @@ -280,9 +280,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp index f79fcfe8b..079fdf248 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp @@ -32,9 +32,9 @@ $(function(){
-

+ <%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp index 22a32567c..e61bcf5eb 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp @@ -32,9 +32,9 @@ $(function(){
-

+<%--

-

+ --%>
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 e79176b1c..54cfa394d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -155,9 +155,9 @@ var delContent = function(contentClassName, addBtnClassName) {
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestForm.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestForm.jsp index 0868ec894..dad4ecf31 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestForm.jsp @@ -99,9 +99,9 @@
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpForm.jsp index 87f763929..e3cf1fbcc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpForm.jsp @@ -128,9 +128,9 @@
-

+ <%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pForm.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pForm.jsp index 954b93242..264fcfb0e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pForm.jsp @@ -122,9 +122,9 @@
-

+<%--

-

+ --%>
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 6a9d20eec..a2714d49d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp @@ -136,7 +136,7 @@
-

+<%--

@@ -146,7 +146,7 @@ -

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp index f4de1daa8..ef853382a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp @@ -79,9 +79,9 @@ var switchKeyringType=function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipBlockForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipBlockForm.jsp index 70dff97ae..fdcc734e6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipBlockForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipBlockForm.jsp @@ -9,9 +9,9 @@
-

+
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipCfgDemoForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipCfgDemoForm.jsp index a78ef53c0..b2696dd26 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipCfgDemoForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipCfgDemoForm.jsp @@ -69,9 +69,9 @@
-

+ <%--

-

+

--%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipWhiteForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipWhiteForm.jsp index 786501b32..83f1d4f81 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipWhiteForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipWhiteForm.jsp @@ -9,9 +9,9 @@
-

+
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index 9a869607f..770c72b9e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -227,9 +227,9 @@ var processAction=function(obj){
-

+<%--

-

+

--%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/ipsec/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipsec/ipForm.jsp index 4dfdea7c2..e80887e0a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipsec/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipsec/ipForm.jsp @@ -62,9 +62,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp index 6037bd584..bd5fe9d0d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp @@ -72,9 +72,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp index bce08e4bc..04cd86dac 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp @@ -30,9 +30,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp index 81e66f99c..ce5621e6b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp @@ -180,9 +180,9 @@ $(function(){
-

+ <%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp index 025dbf91b..4d8710c33 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp @@ -116,9 +116,9 @@
-

+<%--

-

+ --%>
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 85f6082cf..78e1ded4b 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 @@ -123,13 +123,13 @@
-

+ <%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp index 937fcf997..cce735bd0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp @@ -48,9 +48,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceForm.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceForm.jsp index 16967272e..8e537d822 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceForm.jsp @@ -48,9 +48,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp index dd6292cd4..e04ff401a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp @@ -37,9 +37,9 @@
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp index 6b44b4425..99fb9d573 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp @@ -126,9 +126,9 @@
-

+ <%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp index 840e0528d..7432216c4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp @@ -169,9 +169,9 @@
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp index 54ec45d69..5bf49b0d3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp @@ -132,9 +132,9 @@
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index 607927741..43d2a8c69 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -145,9 +145,9 @@
-

+<%--

-

+ --%>
From 02257001b46002216ab53b77e15d664720812ca2 Mon Sep 17 00:00:00 2001 From: leijun Date: Sat, 29 Sep 2018 21:14:18 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=8E=BB=E9=99=A4title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp | 4 ++-- src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp b/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp index 947c17348..306e5376e 100644 --- a/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp @@ -37,9 +37,9 @@ $(function(){
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp index dc5cff0d9..a8e6863fc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp @@ -143,9 +143,9 @@
-

+<%--

-

+ --%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp b/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp index e7152f5f0..e796239b9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp @@ -56,9 +56,9 @@
-

+<%--

-

+ --%>
From a29c6367b37029f6f96520229f83623c9ce6d69b Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Sat, 29 Sep 2018 21:41:03 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E7=94=9F=E6=95=88=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=8B=E5=8F=91=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/basics/SysDictInfoService.java | 101 +++++++++++------- 1 file changed, 62 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/nis/web/service/basics/SysDictInfoService.java b/src/main/java/com/nis/web/service/basics/SysDictInfoService.java index 46bd22378..74737892e 100644 --- a/src/main/java/com/nis/web/service/basics/SysDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/SysDictInfoService.java @@ -225,78 +225,101 @@ public class SysDictInfoService extends BaseService{ // 组织区域、运营商配置下发格式 public String setEffectiveRange(String areaEffectiveIds){ EffectiveRangeCfg rangeCfg = new EffectiveRangeCfg(); - List areaIspList = new ArrayList(); + List> effectiveRangeList = new ArrayList(); List locaValueList = new ArrayList(); List ispValueList = new ArrayList(); for (String areaEffectiveId : StringUtils.split(areaEffectiveIds, ",")) { - String area = ""; + List areaIspList = new ArrayList(); + + AreaIsp area = new AreaIsp(); + area.setTag(Constants.AREA_TAG); + AreaIsp isp = new AreaIsp(); + isp.setTag(Constants.ISP_TAG); + String areaStr = ""; // 区域和运营商 if(areaEffectiveId.contains(":")) { + int index = areaEffectiveId.indexOf(":"); String areaCode = areaEffectiveId.substring(0, index); String ispCode = areaEffectiveId.substring(index+1); // 查询该区域信息及其所有父节点信息 List list = sysDictInfoDao.getEffectiveArea(areaCode); for (SysDictInfo sysDictInfo : list) { - area += sysDictInfo.getItemValue(); + areaStr += sysDictInfo.getItemValue(); while(sysDictInfo.getParent().getSysDictId() != 0) { sysDictInfo = sysDictInfoDao.getDictById(sysDictInfo.getParent().getSysDictId()); - area += "/"+sysDictInfo.getItemValue(); + areaStr += "/"+sysDictInfo.getItemValue(); } } - String areaItemValue = StringUtils.revertStr(area, "/"); + String areaItemValue = StringUtils.revertStr(areaStr, "/"); if(!locaValueList.contains(areaItemValue)) { + + locaValueList = new ArrayList(); + ispValueList = new ArrayList(); + locaValueList.add(areaItemValue); + + }else { + // 区域相同就只加运营商信息 + SysDictInfo ispStr = sysDictInfoDao.getDictByItemCode(ispCode); + if(!ispValueList.contains(ispStr.getItemValue())) { + ispValueList.add(ispStr.getItemValue()); + if(ispValueList.size() < 2) { + + isp.setValue(ispValueList); + areaIspList.add(isp); + effectiveRangeList.add(areaIspList); + } + } + continue; } // 查询运营商信息 - SysDictInfo isp = sysDictInfoDao.getDictByItemCode(ispCode); - if(!ispValueList.contains(isp.getItemValue())) { - ispValueList.add(isp.getItemValue()); + SysDictInfo ispStr = sysDictInfoDao.getDictByItemCode(ispCode); + if(!ispValueList.contains(ispStr.getItemValue())) { + ispValueList.add(ispStr.getItemValue()); } + + area.setValue(locaValueList); + isp.setValue(ispValueList); + + areaIspList.add(area); + areaIspList.add(isp); + effectiveRangeList.add(areaIspList); }else { - // 区域或运营商 + // 区域 SysDictInfo dict = sysDictInfoDao.getDictByItemCode(areaEffectiveId); - if(dict.getItemType() == 1) { - // 查询所有父节点区域信息 - area += dict.getItemValue(); - while(dict.getParent().getSysDictId() != 0) { - dict = sysDictInfoDao.getDictById(dict.getParent().getSysDictId()); - area += "/"+dict.getItemValue(); - } - String areaItemValue = StringUtils.revertStr(area, "/"); - if(!locaValueList.contains(areaItemValue)) { - locaValueList.add(areaItemValue); - } - }else { - if(!ispValueList.contains(dict.getItemValue())) { - ispValueList.add(dict.getItemValue()); - } + + // 查询所有父节点区域信息 + areaStr += dict.getItemValue(); + while(dict.getParent().getSysDictId() != 0) { + dict = sysDictInfoDao.getDictById(dict.getParent().getSysDictId()); + areaStr += "/"+dict.getItemValue(); + } + String areaItemValue = StringUtils.revertStr(areaStr, "/"); + if(!locaValueList.contains(areaItemValue)) { + locaValueList = new ArrayList(); + locaValueList.add(areaItemValue); + area.setValue(locaValueList); + areaIspList.add(area); + effectiveRangeList.add(areaIspList); } } } - if(locaValueList.size() > 0) { - AreaIsp area = new AreaIsp(); - area.setTag(Constants.AREA_TAG); - area.setValue(locaValueList); - areaIspList.add(area); - } - if(ispValueList.size() > 0) { - AreaIsp isp = new AreaIsp(); - isp.setTag(Constants.ISP_TAG); - isp.setValue(ispValueList); - areaIspList.add(isp); - } - - List> effectiveRangeList = new ArrayList(); - effectiveRangeList.add(areaIspList); rangeCfg.setEffectiveRangeList(effectiveRangeList); return gsonToJson(rangeCfg); } + public static void main(String[] args) { + SysDictInfoService service = new SysDictInfoService(); + String json = service.setEffectiveRange("7182:4,7182:5"); + + System.err.println(json); + } + } From 61b56958c63ee1d7ac32b3037981f61a65077ea6 Mon Sep 17 00:00:00 2001 From: wangxin Date: Sat, 29 Sep 2018 21:46:17 +0800 Subject: [PATCH 11/11] =?UTF-8?q?(1)ip=E5=9C=B0=E5=9D=80=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=95=B4=E4=B8=AAasn=E5=8A=9F=E8=83=BD=20(2)ip=E5=9F=9F?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8F=90=E5=88=B0=E5=8D=95=E7=8B=AC=E7=9A=84?= =?UTF-8?q?js=20ipRegion.js=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/ntc/IpController.java | 25 +- .../web/dao/configuration/AsnPolicyCfgDao.xml | 12 + .../service/configuration/IpCfgService.java | 169 ++++- .../sql/20180928/extend_ip_region.sql | 17 +- src/main/webapp/WEB-INF/include/header.jsp | 4 +- .../WEB-INF/views/cfg/ipaddr/ipForm.jsp | 664 ++++++++++++------ .../WEB-INF/views/cfg/ipaddr/ipList.jsp | 4 +- .../WEB-INF/views/cfg/ipaddr/ipSubList.jsp | 14 + .../webapp/static/global/scripts/common.js | 190 ----- .../webapp/static/global/scripts/ipRegion.js | 371 ++++++++++ 10 files changed, 1044 insertions(+), 426 deletions(-) create mode 100644 src/main/webapp/static/global/scripts/ipRegion.js diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index 3af0f780f..af6f04cae 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -20,12 +20,14 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.SysDataDictionaryItem; +import com.nis.domain.basics.PolicyGroupInfo; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.configuration.template.IpAddrTemplate; import com.nis.domain.configuration.template.IpsecTemplate; import com.nis.domain.configuration.template.TunnelIpTemplate; +import com.nis.domain.specific.ConfigGroupInfo; import com.nis.exceptions.MaatConvertException; import com.nis.util.DictUtils; import com.nis.web.controller.configuration.CommonController; @@ -57,6 +59,8 @@ public class IpController extends CommonController{ }else{ initFormCondition(model,entity); } + List policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4); + model.addAttribute("policyGroups", policyGroups); model.addAttribute("_cfg", entity); return "/cfg/ipaddr/ipForm"; } @@ -89,6 +93,9 @@ public class IpController extends CommonController{ } } } + if(StringUtils.isNotBlank(cfg.getUserRegion4())) { + tabList.add(new String[]{"3","ASN"}); + } model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); @@ -114,11 +121,21 @@ public class IpController extends CommonController{ entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - ipCfgService.auditIpCfg(entity,isAudit); - } catch (MaatConvertException e) { + if(StringUtils.isNoneBlank(entity.getUserRegion4())) { + ipCfgService.auditAsnCfg(entity, isAudit); + }else { + ipCfgService.auditIpCfg(entity,isAudit); + } + + } catch (Exception e) { e.printStackTrace(); - logger.info("ssl配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes, e.getMessage()); + logger.info("ip配置下发失败:"+e.getMessage()); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes, e.getMessage()); + }else { + addMessage(redirectAttributes, "audit_failed"); + } + } } return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId; diff --git a/src/main/java/com/nis/web/dao/configuration/AsnPolicyCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AsnPolicyCfgDao.xml index 9c0b7cb1e..acd98dc6b 100644 --- a/src/main/java/com/nis/web/dao/configuration/AsnPolicyCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AsnPolicyCfgDao.xml @@ -109,6 +109,18 @@ AND r.user_region1=#{userRegion1,jdbcType=VARCHAR} + + AND r.user_region2=#{userRegion2,jdbcType=VARCHAR} + + + AND r.user_region3=#{userRegion3,jdbcType=VARCHAR} + + + AND r.user_region4=#{userRegion4,jdbcType=VARCHAR} + + + AND r.user_region5=#{userRegion5,jdbcType=VARCHAR} + AND r.function_id=#{functionId,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index ce6b5a896..74dc68a9d 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; import com.nis.domain.FunctionRegionDict; import com.nis.domain.Page; +import com.nis.domain.basics.AsnIpCfg; import com.nis.domain.callback.InlineIp; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseIpCfg; @@ -29,15 +30,18 @@ import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; import com.nis.domain.maat.MaatCfg.StringCfg; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.specific.ConfigGroupInfo; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; import com.nis.util.Configurations; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.StringUtil; +import com.nis.web.dao.basics.AsnIpCfgDao; import com.nis.web.dao.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.IpCfgDao; import com.nis.web.dao.configuration.StringCfgDao; +import com.nis.web.dao.specific.SpecificServiceCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.CrudService; @@ -54,6 +58,10 @@ public class IpCfgService extends CrudService { protected StringCfgDao stringCfgDao; @Autowired protected AreaIpCfgDao areaIpCfgDao; + @Autowired + protected SpecificServiceCfgDao specificServiceCfgDao; + @Autowired + protected AsnIpCfgDao asnIpCfgDao; /** * * addIpCfg(新增IP类配置) @@ -344,18 +352,29 @@ public class IpCfgService extends CrudService { }else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){ maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit()); } - if(!StringUtil.isEmpty(cfg.getUserRegion1())){ - String userRegion = ""; - if(cfg.getUserRegion1().startsWith(Constants.REDIRECT_RESPONSE_CODE_STARTWITH)){ - userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+ - Constants.USER_REGION_SPLIT+ - Constants.REDIRECT_URL_KEY+"="+cfg.getUserRegion2(); - }else{ - userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+ - Constants.USER_REGION_SPLIT+ - Constants.REDIRECT_CONTENT_KEY+"="+cfg.getUserRegion2(); + //限速需要发Droprate=0.001 ,暂不支持Bandwidth=200kbps + if(cfg.getAction().equals(Constants.RATELIMIT_ACTION)){ + if(cfg.getUserRegion1().equals("0")){//丢包率 + cfg.setUserRegion2(StringUtil.isEmpty(cfg.getUserRegion2()) ? "":cfg.getUserRegion2()); + maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+cfg.getUserRegion2()); + }else if(cfg.getUserRegion1().equals("1")){//带宽 + cfg.setUserRegion3(StringUtil.isEmpty(cfg.getUserRegion3()) ? "":cfg.getUserRegion3()); + maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+cfg.getUserRegion3()); + } + }else { + if(!StringUtil.isEmpty(cfg.getUserRegion1())){ + String userRegion = ""; + if(cfg.getUserRegion1().startsWith(Constants.REDIRECT_RESPONSE_CODE_STARTWITH)){ + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+ + Constants.USER_REGION_SPLIT+ + Constants.REDIRECT_URL_KEY+"="+cfg.getUserRegion2(); + }else{ + userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+ + Constants.USER_REGION_SPLIT+ + Constants.REDIRECT_CONTENT_KEY+"="+cfg.getUserRegion2(); + } + maatCfg.setUserRegion(userRegion); } - maatCfg.setUserRegion(userRegion); } configCompileList.add(maatCfg); maatBean.setOpAction(Constants.INSERT_ACTION); @@ -656,6 +675,130 @@ public class IpCfgService extends CrudService { } } } + /** + * + * @param isAudit + * @param isValid + * @param ids cfgId + * @param functionId + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void auditAsnCfg(CfgIndexInfo entity,Integer isAudit){ + entity.setTableName(CfgIndexInfo.getTablename()); + entity.setIsAudit(isAudit); + ipCfgDao.auditCfg(entity); + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList<>(); + List groupRelationList = new ArrayList<>(); + List ipRegionList = new ArrayList<>(); + List strRegionList = new ArrayList<>(); + List numRegionList = new ArrayList<>(); + List digestRegionList = new ArrayList<>(); + List areaIpRegionList = new ArrayList<>(); + if(isAudit==Constants.AUDIT_YES) { + ConfigGroupInfo group=specificServiceCfgDao.getConfigGroupInfoByGroupId(Integer.parseInt(entity.getUserRegion4())); + if(group.getIsIssued()==1) {//复用,值下编译跟分组 + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //group + GroupCfg groupCfg=new GroupCfg(); + groupCfg.setCompileId(entity.getCompileId()); + groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); + groupCfg.setIsValid(Constants.VALID_YES); + groupCfg.setAuditTime(entity.getAuditTime()); + groupRelationList.add(groupCfg); + maatCfg.setGroupNum(groupRelationList.size()); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("ipaddr asn组复用配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("ipaddr asn组复用配置下发响应信息:"+result.getMsg()); + }else {//首次下发 + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //group + GroupCfg groupCfg=new GroupCfg(); + groupCfg.setCompileId(entity.getCompileId()); + groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4())); + groupCfg.setIsValid(Constants.VALID_YES); + groupCfg.setAuditTime(entity.getAuditTime()); + groupRelationList.add(groupCfg); + maatCfg.setGroupNum(groupRelationList.size()); + //region + //查询asn group id下所有的 ip + AsnIpCfg asnIpCfg=new AsnIpCfg(); + asnIpCfg.setAsnIpGroup(Integer.parseInt(entity.getUserRegion4())); + List allAsnIpCfgs=asnIpCfgDao.findAllList(asnIpCfg); + ipRegionList.addAll(groupReuseCfgAddRemoveConvert(allAsnIpCfgs,Constants.VALID_YES,null)); + maatCfg.setIpRegionList(ipRegionList); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("ipaddr asn配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("ipaddr asn配置下发响应信息:"+result.getMsg()); + ConfigGroupInfo info=new ConfigGroupInfo(); + info.setIsIssued(1); + info.setGroupId(Integer.parseInt(entity.getUserRegion4())); + specificServiceCfgDao.updateConfigGroupInfobyGroupId(info); + AsnIpCfg cfg=new AsnIpCfg(); + cfg.setIsValid(Constants.VALID_YES); + cfg.setAsnIpGroup(Integer.parseInt(entity.getUserRegion4())); + asnIpCfgDao.updateIssued(cfg); + } + }else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过 + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("ipaddr asn取消下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("ipaddr asn取消配置响应信息:"+result.getMsg()); + }else { + throw new RuntimeException("unknown isAudit value "+isAudit); + } + + } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void deleteIp(String ids,String compileIds,int functionId){ if(StringUtils.isNotBlank(compileIds)){ @@ -723,6 +866,10 @@ public class IpCfgService extends CrudService { List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); entity.setIpPortList(ipPortList); entity.setNtcSubscribeIdCfgList(subscribeIdList); + if(StringUtils.isNotBlank(entity.getUserRegion4())) { + ConfigGroupInfo info=specificServiceCfgDao.getConfigGroupInfoByGroupId(Integer.parseInt(entity.getUserRegion4().trim())); + entity.setAsnIpGroupName(info.getGroupName()); + } return entity; } public BaseIpCfg getIpCfgById(String tableName,long id){ diff --git a/src/main/resources/sql/20180928/extend_ip_region.sql b/src/main/resources/sql/20180928/extend_ip_region.sql index 7e79981ff..06a5de457 100644 --- a/src/main/resources/sql/20180928/extend_ip_region.sql +++ b/src/main/resources/sql/20180928/extend_ip_region.sql @@ -1,6 +1,6 @@ UPDATE function_service_dict SET region_code=1 WHERE function_id=5 AND region_code='1,3'; UPDATE function_service_dict SET region_code=2 WHERE function_id=5 AND region_code='2,3'; -UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=1; +UPDATE function_service_dict SET is_valid=1 WHERE function_id=5 AND ACTION=1; UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=96; INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) VALUES(5,0,64,'ratelimit',1057,'ip_ratelimit','ip地址限速',1,1); @@ -12,5 +12,18 @@ INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,S UPDATE function_region_dict SET is_valid=0 WHERE function_id=5 AND config_region_value ='NTC_SUBSCRIBE_ID'; UPDATE function_region_dict SET config_protocol='0,6,17,1,8,15' WHERE function_id=5 AND config_region_value ='INLINE_IP_CB'; +UPDATE function_region_dict SET config_protocol='0,6,17,1,8,15' WHERE function_id=5 AND config_region_value ='INLINE_IP_CB'; +update function_region_dict set config_ip_type='4,6' where region_type=1 and config_ip_type like '%,46,64,10%'; +UPDATE function_service_dict SET region_code=4 WHERE function_id=5 AND action_code='ratelimit'; +INSERT INTO function_region_dict (function_id,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type,config_ip_type,config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_ip_port_show,config_region_sort)VALUES(5,4,'LIMIT_IP','IP限流',1,1,1,'4,6','1,2,3','1,2','0,1','0,6,17','1,2',4); -update function_region_dict set config_ip_type='4,6' where region_type=1 and config_ip_type like '%,46,64,10%'; \ No newline at end of file + + +#asn region +INSERT INTO function_region_dict (config_service_type,function_id,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type,config_region_sort) +VALUES ('asn',5,5,'NTC_ASN_IP','asn',1,1,1,5); +# asn service +INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) +VALUES (5,0,16,'reject',37,'ans_reject','ANS_REJECT',1,5); +INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) +VALUES (5,0,1,'monit',149,'ans_monit','ANS_MONIT',1,5); \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/header.jsp b/src/main/webapp/WEB-INF/include/header.jsp index 0032e71d5..a07ee36ec 100644 --- a/src/main/webapp/WEB-INF/include/header.jsp +++ b/src/main/webapp/WEB-INF/include/header.jsp @@ -95,7 +95,7 @@ - + @@ -103,4 +103,4 @@ - \ No newline at end of file + diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index 770c72b9e..9561367e0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -17,26 +17,64 @@ $("#cancel").on("click", function() { window.history.back(); });*/ - $(".glyphicon-plus").first().click(); - $(".ipPortList").find(".glyphicon-remove").addClass("hidden") - var action=$(".action:checked").val(); - /*if(action==32){ - $(".subscribeId").find(".glyphicon-remove").click(); - $(".subscribeId").prev("h4").addClass("hidden"); - }*/ - var regionCodes=$(".action:checked").attr("regionCode").split(","); - $("h4[class*='ipPortListTitle']").each(function(){ - var has=false; - for(var ind in regionCodes){ - if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){ - has=true; - } - } - if(!has){ - $(this).html(""); + var asnRegionCode,configType; + $("input[id^='cfgRegionCode']").each(function(){ + var regionCode=$(this).val(); + if("asn"==$(this).attr("servicetype")){ + asnRegionCode=$(this).val(); } }); - processAction($(".ipPortList")); + $(".configType a").on("click",function(){ + if($(this).attr("id")=="ipCfgTab"){ + configType="ip"; + $(".glyphicon-plus").first().click(); + $(".ipPortList").find(".glyphicon-remove").addClass("hidden") + hideAction(1,asnRegionCode); + }else{ + configType="asn"; + hideAction(0,asnRegionCode); + } + var region = ($(this).attr("for")); + if(region=="ipaddr"){ + $(".asn").addClass("hidden").addClass("disabled"); + $(".ipaddr").removeClass("hidden").removeClass("disabled"); + }else{ + $(".ipaddr").addClass("hidden").addClass("disabled"); + $(".asn").removeClass("hidden").removeClass("disabled"); + } + }); + //切换tab + if("${_cfg.cfgId}"==''){ + configType='ip'; + $("#ipCfgTab").click(); + }else if("${_cfg.userRegion4}"==""){ + configType='ip'; + $("#ipCfgTab").click(); + }else{ + configType='asn'; + $("#ansCfgTab").click(); + } + if(configType!='asn'){ + $(".glyphicon-plus").first().click(); + $(".ipPortList").find(".glyphicon-remove").addClass("hidden") + /*if(action==32){ + $(".subscribeId").find(".glyphicon-remove").click(); + $(".subscribeId").prev("h4").addClass("hidden"); + }*/ + var regionCodes=$(".action:checked").attr("regionCode").split(","); + $("h4[class*='ipPortListTitle']").each(function(){ + var has=false; + for(var ind in regionCodes){ + if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){ + has=true; + } + } + if(!has){ + $(this).addClass("hidden"); + } + }); + processAction(configType,$(".ipPortList")); + } $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); @@ -57,8 +95,24 @@ $("h4[class*='ipPortListTitle']").each(function(){ $(this).find(".ipPortTitle").html(i18nCode); }); + $("input[id^='cfgRegionCode']").each(function(){ + if($(this).attr("id")!=("cfgRegionCode"+cfgRegionCode)){ + $(this).removeAttr("name"); + $("#cfgType"+$(this).val()).removeAttr("name"); + }else{ + $(this).attr("name",'cfgRegionCode'); + $("#cfgType"+$(this).val()).attr("name",'cfgType'); + } + }); var tabInfo=$(".ipPortList"); - processAction(tabInfo); + if(tabInfo){ + tabInfo.find("[name$='cfgType']").val(cfgType); + tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); + } + if(configType!='asn'){ + changeIPVal(tabInfo); + } + processAction(configType,tabInfo); /* if(tabInfo){ tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); @@ -86,6 +140,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) { @@ -145,11 +202,15 @@ flag=flag1; } if(flag){ + if(configType!='asn'){ + $("input[name='userRegion4']").attr("disabled",true); + } + $("input[name$='userRegion1']").attr("disabled",false); + $("input[name$='exprType']").attr("disabled",false); //将disable属性的元素删除 $(".disabled").each(function(){ $(this).remove(); }); - $("input[name$='exprType']").attr("disabled",false); loading('onloading...'); form.submit(); }else{ @@ -185,41 +246,126 @@ }); */ $("." + addBtnClassName).removeClass("hidden"); } -var processAction=function(obj){ - var o=$(obj) - if(o){ - var action=$(".action:checked").val(); - /*处理协议*/ - var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value"); - //先清空,再添加 - o.find("select[name$='protocol']").empty(); - if(action==32){ - $.ipcommon.protocol.each(function(){ - if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==8||$(this).attr("value")==15){ - o.find("select[name$='protocol']").append($(this)); - } - }) - }else if(action==16){ - $.ipcommon.protocol.each(function(){ - if($(this).attr("value")==0||$(this).attr("value")==6){ - o.find("select[name$='protocol']").append($(this)); - } - }) - }else if(action==64){ - $.ipcommon.protocol.each(function(){ - if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){ - o.find("select[name$='protocol']").append($(this)); - } - }) + +var hideAction=function(isHide,regionCode){ + var action=$(".action:checked").val(); + var serviceId=$(".action:checked").attr("serviceId"); + $(".action").each(function(){ + var regionCodeArr=$(this).attr("regionCode").split(','); + var has=false; + for(var code in regionCodeArr){ + if(regionCode==regionCodeArr[code]){ + has=true; + break; + } } - o.find("select[name$='protocol']").selectpicker("refresh"); - //切换后如果没找到选项,选任意协议 - if(o.find("select[name$='protocol'] option[value='"+selectedProtocol+"']").length>0){ - o.find("select[name$='protocol']").selectpicker("val",selectedProtocol); + if(has){ + if(isHide==1){ + $(this).attr("disabled","disabled"); + $(this).parent(".radio-inline").addClass("hidden"); + }else{ + $(this).removeAttr("disabled"); + $(this).parent(".radio-inline").removeClass("hidden"); + } }else{ - o.find("select[name$='protocol']").selectpicker("val",0); + if(isHide==1){ + $(this).removeAttr("disabled"); + $(this).parent(".radio-inline").removeClass("hidden"); + }else{ + $(this).attr("disabled","disabled"); + $(this).parent(".radio-inline").addClass("hidden"); + } + } + }); + if($("[class*='action'][value='"+action+"']:visible").length>0){ + $("[class*='action'][value='"+action+"']:visible").click(); + }else{ + $(".action:visible").get(0).click(); + } + var reginosNew=$(".action:checked").attr("regioncode").split(","); + $("input[id^='cfgRegionCode']").each(function(){ + var has=false; + for(var code in reginosNew){ + if($(this).val()==reginosNew[code]){ + has=true; + break; + } + } + if(has){ + $(this).attr("name","cfgRegionCode"); + $("#cfgType"+$(this).val()).attr("name","cfgType"); + }else{ + $(this).removeAttr("name"); + $("#cfgType"+$(this).val()).removeAttr("name"); + } + }); +} +var processAction=function(configType,obj){ + var action=$(".action:checked").val(); + if(configType!='asn'){ + var o=$(obj) + if(o){ + /*处理协议*/ + var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value"); + if(action==32){ + //先清空,再添加 + /* o.find("select[name$='protocol']").empty(); + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==8||$(this).attr("value")==15){ + o.find("select[name$='protocol']").append($(this)); + } + }) */ + $(".ratelimitAction").addClass("hidden"); + $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); + }else if(action==16){ + //先清空,再添加 + o.find("select[name$='protocol']").empty(); + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6){ + o.find("select[name$='protocol']").append($(this)); + } + }) + $(".ratelimitAction").addClass("hidden"); + $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); + }else if(action==64){ + //先清空,再添加 + /* o.find("select[name$='protocol']").empty(); + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){ + o.find("select[name$='protocol']").append($(this)); + } + }) */ + $(".ratelimitAction").removeClass("hidden"); + var rateLimitType=$("input[name='userRegion1']:checked").val(); + if(rateLimitType == 0){//丢包率 + $(".bandwith").find("input[name='userRegion3']").attr("disabled",true); + $(".droprate").find("input[name='userRegion2']").removeAttr("disabled"); + } + if(rateLimitType == 1){//带宽 + $(".bandwith").find("input[name='userRegion3']").removeAttr("disabled"); + $(".droprate").find("input[name='userRegion2']").attr("disabled",true); + } + }else if(action==1){ + //先清空,再添加 + o.find("select[name$='protocol']").empty(); + $.ipcommon.protocol.each(function(){ + if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){ + o.find("select[name$='protocol']").append($(this)); + } + }) + $(".ratelimitAction").addClass("hidden"); + $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); + } + o.find("select[name$='protocol']").selectpicker("refresh"); + //切换后如果没找到选项,选任意协议 + if(o.find("select[name$='protocol'] option[value='"+selectedProtocol+"']").length>0){ + o.find("select[name$='protocol']").selectpicker("val",selectedProtocol); + }else{ + o.find("select[name$='protocol']").selectpicker("val",0); + } } } + } @@ -227,7 +373,7 @@ var processAction=function(obj){
-<%--

+ <%--

--%>
@@ -270,178 +416,264 @@ var processAction=function(obj){ value="${region.configRegionCode}">
-
-
-
- -
- -
-
-
-
-
- -
- - - -
-
-
-
-
- -
-
-
- - - - - - - - - - - - -
-
-
- - - - - - - - - -

- - -

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

- - -

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

+ + +

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

+ + +

+ + + + <%-- --%> + + + + + + +
+ <%@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/ipaddr/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp index 9265f5447..c2c6b6c17 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp @@ -143,7 +143,7 @@ - + @@ -319,6 +319,7 @@ + @@ -352,6 +353,7 @@ + ${indexCfg.userRegion2 } diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp index 453374b01..213350055 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipSubList.jsp @@ -218,5 +218,19 @@ + +
+
+
+
+ + +
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 245088acf..c6683a9d8 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -1,14 +1,4 @@ $(function(){ - $.ipcommon=function(){ - return {}; - } - $.extend($.ipcommon, { - ipType:[], - ipPattern:[], - portPattern:[], - protocol:[], - direction:[] - }); $("input[name$='isCaseSenstive']").on("change",function(){ setIsHexBin(this); }); @@ -425,7 +415,6 @@ $(function(){ window.history.back(); return false; }); - initCommIpVal(); //去掉首尾空格 $("input,textarea").on("blur",function(){ var val=$(this).val(); @@ -1675,185 +1664,6 @@ var setHexCaseSenstive=function(){ }); } -/** - * ip默认选项处理 - */ -var initCommIpVal=function(){ - var action,regionCode,serviceType,ipPortShow,ipType, - ipPattern,portPattern,direction,protocol,regionType; - if($("input[name$='action']:checked").length>0){ - regionCode=$("input[name$='action']:checked").attr("regionCode"); - action=$("input[name$='action']:checked").val(); - }else{ - regionCode=$("input[name$='action']").attr("regionCode"); - action=$("input[name$='action']").val(); - } - if(regionCode){ - if(regionCode.indexOf(",")==-1){ - $("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode"); - $("#cfgType"+regionCode).attr("name","cfgType"); - }else{ - var _region=''; - var regionArr=regionCode.split(','); - $("input[name$='cfgRegionCode'][regionType='1']").each(function(){ - for(var re in regionArr){ - if($(this).val()==regionArr[re]){ - _region=regionArr[re]; - break; - } - } - }); - if(_region!=''){ - regionCode=_region; - } - } - } - if(regionCode){//IP域大于1个,根据action获取ip属性 - ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"), - ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"), - ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"), - portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"), - direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"), - protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"), - regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType"); - }else{//IP域只有一个,获取regionType为1的 - ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"), - ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"), - ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"), - portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"), - direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"), - protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"), - regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType"); - } - //ip,端口处理 - if(ipPortShow){ - if(ipPortShow.indexOf('1')>-1){//展示源IP,端口 - $("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden"); - $("input[name$='srcPort']").parents(".form-group").removeClass("hidden"); - }else{ - $("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden"); - $("input[name$='srcPort']").parents(".form-group").addClass("hidden"); - } - if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口 - $("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden"); - $("input[name$='destPort']").parents(".form-group").removeClass("hidden"); - }else{ - $("input[name$='destIpAddress']").parents(".form-group").addClass("hidden"); - $("input[name$='destPort']").parents(".form-group").addClass("hidden"); - } - } - //ip类型处理 - if(ipType){ - var arr=ipType.split(','); - $.ipcommon.ipType=$("select[name$='ipType'] option"); - $("select[name$='ipType'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.ipType=[]; - } - //ip格式处理 - if(ipPattern){ - arr=ipPattern.split(','); - $.ipcommon.ipPattern=$("select[name$='ipPattern'] option"); - $("select[name$='ipPattern'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.ipPattern=[]; - } - //端口格式处理 - if(portPattern){ - arr=portPattern.split(','); - $.ipcommon.portPattern=$("select[name$='portPattern'] option"); - $("select[name$='portPattern'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.portPattern=[]; - } - //方向处理 - if(direction){ - arr=direction.split(','); - $.ipcommon.direction=$("select[name$='direction'] option"); - $("select[name$='direction'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.direction=[]; - } - //协议处理 - if(protocol){ - arr=protocol.split(','); - $.ipcommon.protocol=$("select[name$='protocol'] option"); - $("select[name$='protocol'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.protocol=[]; - } -} - function heightDiv(type){ var hei=document.documentElement.clientHeight; diff --git a/src/main/webapp/static/global/scripts/ipRegion.js b/src/main/webapp/static/global/scripts/ipRegion.js new file mode 100644 index 000000000..5098d0c47 --- /dev/null +++ b/src/main/webapp/static/global/scripts/ipRegion.js @@ -0,0 +1,371 @@ +/** + * 处理IP域值 + */ +;(function($){ + $.extend({ + ipcommon:function(){ + return {}; + } + }); + $.extend($.ipcommon, { + ipType:[], + ipPattern:[], + portPattern:[], + protocol:[], + direction:[] + }); +})(jQuery); +$(function(){ + initCommIpVal(); +}); +window.$.ipcommon=$.ipcommon; +/** + * ip默认选项处理 + */ +var initCommIpVal=function(){ + var action,regionCode,serviceType,ipPortShow,ipType, + ipPattern,portPattern,direction,protocol,regionType; + if($("input[name$='action']:checked").length>0){ + regionCode=$("input[name$='action']:checked").attr("regionCode"); + action=$("input[name$='action']:checked").val(); + }else{ + regionCode=$("input[name$='action']").attr("regionCode"); + action=$("input[name$='action']").val(); + } + if(regionCode){ + if(regionCode.indexOf(",")==-1){ + $("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode"); + $("#cfgType"+regionCode).attr("name","cfgType"); + }else{ + var _region=''; + var regionArr=regionCode.split(','); + $("input[name$='cfgRegionCode'][regionType='1']").each(function(){ + for(var re in regionArr){ + if($(this).val()==regionArr[re]){ + _region=regionArr[re]; + break; + } + } + }); + if(_region!=''){ + regionCode=_region; + } + } + } + if(regionCode){//IP域大于1个,根据action获取ip属性 + ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"), + ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"), + ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"), + portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"), + direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"), + protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"), + regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType"); + }else{//IP域只有一个,获取regionType为1的 + ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"), + ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"), + ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"), + portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"), + direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"), + protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"), + regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType"); + } + //ip,端口处理 + if(ipPortShow){ + if(ipPortShow.indexOf('1')>-1){//展示源IP,端口 + $("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden"); + $("input[name$='srcPort']").parents(".form-group").removeClass("hidden"); + }else{ + $("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden"); + $("input[name$='srcPort']").parents(".form-group").addClass("hidden"); + } + if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口 + $("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden"); + $("input[name$='destPort']").parents(".form-group").removeClass("hidden"); + }else{ + $("input[name$='destIpAddress']").parents(".form-group").addClass("hidden"); + $("input[name$='destPort']").parents(".form-group").addClass("hidden"); + } + } + //ip类型处理 + $.ipcommon.ipType=$("select[name$='ipType'] option"); + if(ipType){ + var arr=ipType.split(','); + $("select[name$='ipType'] option").each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + if($(this).attr("disabled")){ + $(this).removeAttr("disabled") + } + break; + } + } + if(!has){ + $(this).remove(); + } + }); + } + //ip格式处理 + $.ipcommon.ipPattern=$("select[name$='ipPattern'] option"); + if(ipPattern){ + arr=ipPattern.split(','); + $("select[name$='ipPattern'] option").each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + if($(this).attr("disabled")){ + $(this).removeAttr("disabled") + } + break; + } + } + if(!has){ + $(this).remove(); + } + }); + } + //端口格式处理 + $.ipcommon.portPattern=$("select[name$='portPattern'] option"); + if(portPattern){ + arr=portPattern.split(','); + $("select[name$='portPattern'] option").each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + if($(this).attr("disabled")){ + $(this).removeAttr("disabled") + } + break; + } + } + if(!has){ + $(this).remove(); + } + }); + } + //方向处理 + $.ipcommon.direction=$("select[name$='direction'] option"); + if(direction){ + arr=direction.split(','); + $("select[name$='direction'] option").each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + if($(this).attr("disabled")){ + $(this).removeAttr("disabled") + } + break; + } + } + if(!has){ + $(this).remove(); + } + }); + } + //协议处理 + $.ipcommon.protocol=$("select[name$='protocol'] option"); + if(protocol){ + arr=protocol.split(','); + $("select[name$='protocol'] option").each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + if($(this).attr("disabled")){ + $(this).removeAttr("disabled") + } + break; + } + } + if(!has){ + $(this).remove(); + } + }); + } +} +/** + * ip切换默认值处理 + */ +var changeIPVal=function(obj){ + var action,regionCode,serviceType,ipPortShow,ipType, + ipPattern,portPattern,direction,protocol,regionType,o; + o=$(obj); + if($("input[name$='action']:checked").length>0){ + regionCode=$("input[name$='action']:checked").attr("regionCode"); + action=$("input[name$='action']:checked").val(); + }else{ + regionCode=$("input[name$='action']").attr("regionCode"); + action=$("input[name$='action']").val(); + } + if(regionCode){ + if(regionCode.indexOf(",")==-1){ + $("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode"); + $("#cfgType"+regionCode).attr("name","cfgType"); + }else{ + var _region=''; + var regionArr=regionCode.split(','); + $("input[name$='cfgRegionCode'][regionType='1']").each(function(){ + for(var re in regionArr){ + if($(this).val()==regionArr[re]){ + _region=regionArr[re]; + break; + } + } + }); + if(_region!=''){ + regionCode=_region; + } + } + } + if(regionCode){//IP域大于1个,根据action获取ip属性 + ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"), + ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"), + ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"), + portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"), + direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"), + protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"), + regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType"); + }else{//IP域只有一个,获取regionType为1的 + ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"), + ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"), + ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"), + portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"), + direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"), + protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"), + regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType"); + } + if(o){ + //ip,端口处理 + if(ipPortShow){ + if(ipPortShow.indexOf('1')>-1){//展示源IP,端口 + o.find("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden"); + o.find("input[name$='srcPort']").parents(".form-group").removeClass("hidden"); + }else{ + o.find("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden"); + o.find("input[name$='srcPort']").parents(".form-group").addClass("hidden"); + } + if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口 + o.find("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden"); + o.find("input[name$='destPort']").parents(".form-group").removeClass("hidden"); + }else{ + o.find("input[name$='destIpAddress']").parents(".form-group").addClass("hidden"); + o.find("input[name$='destPort']").parents(".form-group").addClass("hidden"); + } + } + //ip类型处理 + if(ipType){ + var arr=ipType.split(','); + var ipTypeVal=o.find("select[name$='ipType'] option:selected").attr("value"); + o.find("select[name$='ipType']").empty(); + $.ipcommon.ipType.each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + o.find("select[name$='ipType']").append($(this)); + break; + } + } + }); + o.find("select[name$='ipType']").selectpicker("refresh"); + if(o.find("select[name$='ipType'] option[value='"+ipTypeVal+"']").length>0){ + o.find("select[name$='ipType']").selectpicker("val",ipTypeVal); + }else{ + o.find("select[name$='ipType']").selectpicker("val",4); + } + + } + //ip格式处理 + if(ipPattern){ + arr=ipPattern.split(','); + var ipPatternVal=o.find("select[name$='ipPattern'] option:selected").attr("value"); + o.find("select[name$='ipPattern']").empty(); + $.ipcommon.ipPattern.each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + o.find("select[name$='ipPattern']").append($(this)); + break; + } + } + }); + o.find("select[name$='ipPattern']").selectpicker("refresh"); + if(o.find("select[name$='ipPattern'] option[value='"+ipPatternVal+"']").length>0){ + o.find("select[name$='ipPattern']").selectpicker("val",ipPatternVal); + }else{ + o.find("select[name$='ipPattern']").selectpicker("val",1); + } + } + //端口格式处理 + if(portPattern){ + arr=portPattern.split(','); + var portPatternVal=o.find("select[name$='portPattern'] option:selected").attr("value"); + o.find("select[name$='portPattern']").empty(); + $.ipcommon.portPattern.each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + o.find("select[name$='portPattern']").append($(this)); + break; + } + } + }); + o.find("select[name$='portPattern']").selectpicker("refresh"); + if(o.find("select[name$='portPattern'] option[value='"+portPatternVal+"']").length>0){ + o.find("select[name$='portPattern']").selectpicker("val",portPatternVal); + }else{ + o.find("select[name$='portPattern']").selectpicker("val",1); + } + } + //方向处理 + if(direction){ + arr=direction.split(','); + var directionVal=o.find("select[name$='direction'] option:selected").attr("value"); + o.find("select[name$='direction']").empty(); + $.ipcommon.direction.each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + o.find("select[name$='direction']").append($(this)); + break; + } + } + }); + o.find("select[name$='direction']").selectpicker("refresh"); + if(o.find("select[name$='direction'] option[value='"+directionVal+"']").length>0){ + o.find("select[name$='direction']").selectpicker("val",directionVal); + }else{ + o.find("select[name$='direction']").selectpicker("val",0); + } + } + //协议处理 + if(protocol){ + arr=protocol.split(','); + var protocolVal=o.find("select[name$='protocol'] option:selected").attr("value"); + o.find("select[name$='protocol']").empty(); + $.ipcommon.protocol.each(function(){ + var has=false; + for(var type in arr){ + if($(this).val()==arr[type]){ + has=true; + o.find("select[name$='protocol']").append($(this)); + break; + } + } + }); + o.find("select[name$='protocol']").selectpicker("refresh"); + if(o.find("select[name$='protocol'] option[value='"+protocolVal+"']").length>0){ + o.find("select[name$='protocol']").selectpicker("val",protocolVal); + }else{ + o.find("select[name$='protocol']").selectpicker("val",0); + } + } + } +} \ No newline at end of file