diff --git a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java index 0eddc6ea2..01235948e 100644 --- a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java @@ -8,6 +8,8 @@ */ package com.nis.domain.configuration; +import java.util.List; + import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.nis.util.excel.ExcelField; @@ -38,17 +40,20 @@ public class AppPolicyCfg extends BaseCfg { @Expose @ExcelField(title="expression_type") @SerializedName("exprType") - protected Integer exprType ; + private Integer exprType ; @Expose @ExcelField(title="match_method") @SerializedName("matchMethod") - protected Integer matchMethod ; + private Integer matchMethod ; @Expose @ExcelField(title="whether_hexbinary") @SerializedName("isHexbin") - protected Integer isHexbin; + private Integer isHexbin; + + private List ipPortList; + private IpPortCfg ipPort; public Integer getExprType() { return exprType; @@ -134,5 +139,21 @@ public class AppPolicyCfg extends BaseCfg { public void setBehavCode(Integer behavCode) { this.behavCode = behavCode; } + + public List getIpPortList() { + return ipPortList; + } + + public void setIpPortList(List ipPortList) { + this.ipPortList = ipPortList; + } + + public IpPortCfg getIpPort() { + return ipPort; + } + + public void setIpPort(IpPortCfg ipPort) { + this.ipPort = ipPort; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index f20367bf1..a291e635a 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -1,6 +1,8 @@ package com.nis.web.controller.configuration; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -19,6 +21,9 @@ import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; import com.nis.web.controller.BaseController; @@ -52,6 +57,31 @@ public class AppCfgController extends BaseController { initPageCondition(model,cfg); return "/cfg/app/appPolicyCfgList"; } + /** + * 查询APP策略IP子配置 + * @param model + * @param cfgId + * @param index + * @return + */ + @RequestMapping(value = {"ajaxAppPolicyIpList"}) + public String ajaxSslSubList(Model model,Long cfgId,Integer index) { + AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId); + List tabList = new ArrayList(); + if(cfg.getIpPortList()!=null){ + String cfgType = null; + for(IpPortCfg ip:cfg.getIpPortList()){ + if(!ip.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",ip.getCfgType()}); + cfgType = ip.getCfgType(); + } + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/app/appPolicyIpList"; + } /** * 策略配置表单 * @param model diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 317336b02..f6b5214c5 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -18,6 +18,7 @@ import com.nis.domain.configuration.AppStringCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.ComplexkeywordCfg; +import com.nis.domain.configuration.IpPortCfg; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -32,8 +33,13 @@ public interface AppCfgDao { //app策略配置增删改查 public List findAppPolicyList(AppPolicyCfg entity) ; public AppPolicyCfg getAppPolicyCfg(Long cfgId) ; + public IpPortCfg getAppPolicyIpCfg(AppPolicyCfg entity) ; + public List getAppPolicyIpList(AppPolicyCfg entity); public int insertAppPolicyCfg(AppPolicyCfg entity); public int updateAppPolicyCfg(AppPolicyCfg entity); + public int insertAppPolicyIpCfg(IpPortCfg entity); + public int deleteAppPolicyIpCfg(AppPolicyCfg entity); + //app协议IP配置增删改查 public List findAppIpList(AppIpCfg entity) ; public AppIpCfg getAppIpCfg(Long cfgId) ; diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 28f60c301..9c6f412e7 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -189,6 +189,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, @@ -248,6 +283,15 @@ #{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER}, #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER} + + + a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port + ,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address + ,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id + ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id, + a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable + ,a.area_effective_ids,a.function_id,a.cfg_region_code + + + + SELECT LAST_INSERT_ID() + + insert into ip_port_cfg ( + CFG_DESC, + ACTION, + IS_VALID, + IS_AUDIT, + CREATOR_ID, + CREATE_TIME, + EDITOR_ID, + EDIT_TIME, + AUDITOR_ID, + AUDIT_TIME, + SERVICE_ID, + REQUEST_ID, + COMPILE_ID, + IS_AREA_EFFECTIVE, + CLASSIFY, + ATTRIBUTE, + LABLE, + AREA_EFFECTIVE_IDS, + function_id, + ip_type, + src_ip_address, + ip_pattern, + port_pattern, + src_port, + protocol, + protocol_id, + direction, + dest_port, + dest_ip_address, + cfg_type, + cfg_region_code + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{creatorId,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, + #{editorId,jdbcType=INTEGER}, + #{editTime,jdbcType=TIMESTAMP}, + #{auditorId,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, + #{serviceId,jdbcType=INTEGER}, + #{requestId,jdbcType=INTEGER}, + #{compileId,jdbcType=INTEGER}, + #{isAreaEffective,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR}, + #{attribute,jdbcType=VARCHAR}, + #{lable,jdbcType=VARCHAR}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{ipType,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, + #{ipPattern,jdbcType=INTEGER}, + #{portPattern,jdbcType=INTEGER}, + #{srcPort,jdbcType=VARCHAR}, + #{protocol,jdbcType=INTEGER}, + #{protocolId,jdbcType=INTEGER}, + #{direction,jdbcType=INTEGER}, + #{destPort,jdbcType=VARCHAR}, + #{destIpAddress,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER} + ) + + update app_policy_cfg @@ -1525,4 +1659,15 @@ + + + + delete from ip_port_cfg where compile_id=#{compileId} and protocol_id=21 and function_id=#{functionId} + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 8a17117a7..396f0970f 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -390,7 +390,12 @@ public abstract class BaseService { if(srcIp.getSrcIpAddress().indexOf("/")!=-1){ if(srcIp.getIpType()==4 || srcIp.getIpType()==46){//46表示源ip为ipv4,目的ip为ipv6 Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]); - dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum)); + if(srcMaskNum==0){ + dstIp.setSrcIpMask("0.0.0.0"); + }else{ + dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum)); + } + dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]); }else if(srcIp.getIpType()==6|| srcIp.getIpType()==64){//64表示源ip为ipv6,目的ip为ipv4 IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress()); @@ -413,27 +418,31 @@ public abstract class BaseService { }else{ if(srcIp.getIpType()==4|| srcIp.getIpType()==46){//46表示源ip为ipv4,目的ip为ipv6 dstIp.setSrcIp(srcIp.getSrcIpAddress()); - dstIp.setSrcIpMask("0.0.0.0"); + dstIp.setSrcIpMask("255.255.255.255"); }else if(srcIp.getIpType()==6|| srcIp.getIpType()==64){//64表示源ip为ipv6,目的ip为ipv4 dstIp.setSrcIp(srcIp.getSrcIpAddress()); - dstIp.setSrcIpMask("::"); + dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); } } }else{ if(srcIp.getIpType()==4|| srcIp.getIpType()==46){//46表示源ip为ipv4,目的ip为ipv6 dstIp.setSrcIp(srcIp.getSrcIpAddress()); - dstIp.setSrcIpMask("0.0.0.0"); + dstIp.setSrcIpMask("255.255.255.255"); }else if(srcIp.getIpType()==6|| srcIp.getIpType()==64){//64表示源ip为ipv6,目的ip为ipv4 dstIp.setSrcIp(srcIp.getSrcIpAddress()); - dstIp.setSrcIpMask("::"); + dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); } } if(srcIp.getDestIpAddress()!=null){ if(srcIp.getDestIpAddress().indexOf("/")!=-1){ if(srcIp.getIpType()==4|| srcIp.getIpType()==64){//64表示源ip为ipv6,目的ip为ipv4 Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]); - dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum)); + if(dstMaskNum==0){ + dstIp.setDstIpMask("0.0.0.0"); + }else{ + dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));; + } dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]); }else if(srcIp.getIpType()==6|| srcIp.getIpType()==46){//46表示源ip为ipv4,目的ip为ipv6 IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress()); @@ -456,20 +465,20 @@ public abstract class BaseService { }else{ if(srcIp.getIpType()==4|| srcIp.getIpType()==64){//64表示源ip为ipv6,目的ip为ipv4 dstIp.setDstIp(srcIp.getDestIpAddress()); - dstIp.setDstIpMask("0.0.0.0"); + dstIp.setDstIpMask("255.255.255.255"); }else if(srcIp.getIpType()==6|| srcIp.getIpType()==46){//46表示源ip为ipv4,目的ip为ipv6 dstIp.setDstIp(srcIp.getDestIpAddress()); - dstIp.setDstIpMask("::"); + dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); } } }else{ if(srcIp.getIpType()==4|| srcIp.getIpType()==64){//64表示源ip为ipv6,目的ip为ipv4 dstIp.setDstIp(srcIp.getDestIpAddress()); - dstIp.setDstIpMask("0.0.0.0"); + dstIp.setDstIpMask("255.255.255.255"); }else if(srcIp.getIpType()==6|| srcIp.getIpType()==46){//46表示源ip为ipv4,目的ip为ipv6 dstIp.setDstIp(srcIp.getDestIpAddress()); - dstIp.setDstIpMask("::"); + dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); } } if(srcIp.getSrcPort()!=null){ @@ -479,11 +488,11 @@ public abstract class BaseService { dstIp.setSrcPort(srcIp.getSrcPort().split("/")[0]); }else{ dstIp.setSrcPort(srcIp.getSrcPort()); - dstIp.setSrcPortMask("0"); + dstIp.setSrcPortMask("65535"); } }else{ dstIp.setSrcPort("0"); - dstIp.setSrcPortMask("0"); + dstIp.setSrcPortMask("65535"); } if(srcIp.getDestPort()!=null){ if(srcIp.getDestPort().indexOf("/")!=-1){ @@ -492,11 +501,11 @@ public abstract class BaseService { dstIp.setDstPort(srcIp.getDestPort().split("/")[0]); }else{ dstIp.setDstPort(srcIp.getDestPort()); - dstIp.setDstPortMask("0"); + dstIp.setDstPortMask("65535"); } }else{ dstIp.setDstPort("0"); - dstIp.setDstPortMask("0"); + dstIp.setDstPortMask("65535"); } return dstIp; } diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 51612bf97..9f4ee81ff 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -17,6 +17,7 @@ import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; @@ -84,7 +85,10 @@ public class AppCfgService extends BaseService { return page; } public AppPolicyCfg getAppPolicyCfg(Long cfgId){ - return appCfgDao.getAppPolicyCfg(cfgId); + AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId); + List ipPortList = appCfgDao.getAppPolicyIpList(policy); + policy.setIpPortList(ipPortList); + return policy; } public AppIpCfg getAppIpCfg(Long cfgId){ return appCfgDao.getAppIpCfg(cfgId); @@ -116,6 +120,13 @@ public class AppCfgService extends BaseService { entity.setIsValid(0); entity.setIsAudit(0); appCfgDao.insertAppPolicyCfg(entity); + //保存策略IP配置 + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + appCfgDao.insertAppPolicyIpCfg(cfg); + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -134,15 +145,25 @@ public class AppCfgService extends BaseService { entity.setEditTime(new Date()); entity.setIsValid(0); entity.setIsAudit(0); - appCfgDao.updateAppPolicyCfg(entity); + appCfgDao.updateAppPolicyCfg(entity); + appCfgDao.deleteAppPolicyIpCfg(entity); //删除旧的区域IP,新增新的区域IP AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); entity.setCreatorId(entity.getCurrentUser().getId()); + //保存策略IP配置 + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + appCfgDao.insertAppPolicyIpCfg(cfg); + } + } + //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -390,19 +411,37 @@ public class AppCfgService extends BaseService { List areaIpRegionList = new ArrayList(); entity.setTableName(AppPolicyCfg.getTablename()); appCfgDao.auditCfg(entity); + if(isAudit==1){ if(entity.getBehavCode()!=null){ entity.setCfgKeywords(entity.getAppCode()+"&"+entity.getBehavCode()); }else{ entity.setCfgKeywords(entity.getAppCode()+""); } - List list = new ArrayList(); list.add(entity); Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); groupRelationList=map.get("groupList"); strRegionList=map.get("dstList"); } + + //查询子配置并修改审核状态 + entity = this.getAppPolicyCfg(entity.getCfgId()); + if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + ipRegionList=map.get("dstList"); + if(map.get("numRegionList")!=null){ + numRegionList.addAll(map.get("numRegionList")); + } + } + } + //保存区域IP信息 List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); if(!StringUtil.isEmpty(areaIpCfgList)){ @@ -810,6 +849,15 @@ public class AppCfgService extends BaseService { entity.setTableName(AppPolicyCfg.getTablename()); entity.setFunctionId(functionId); appCfgDao.updateCfgValid(entity); + + //查询子配置 + entity = this.getAppPolicyCfg(Long.parseLong(id)); + if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); diff --git a/src/main/resources/jdbc.properties b/src/main/resources/jdbc.properties index 729e1993a..1ff053c22 100644 --- a/src/main/resources/jdbc.properties +++ b/src/main/resources/jdbc.properties @@ -6,14 +6,11 @@ jdbc.devlop.username=root jdbc.devlop.key=pR3JFt5dsGCW0nZO3TLF7Q== jdbc.devlop.password=JgW5tsiGBNAtcqCgSQIP0g== -jdbc.product.driver=oracle.jdbc.driver.OracleDriver -#jdbc.product.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.17)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVICE_NAME = ORCL)(FAILOVER_MODE =(TYPE = select)(METHOD = basic)(RETRIES = 180)(DELAY = 180)))) -jdbc.product.url=jdbc:oracle:thin:@10.0.6.212:1523:app -#jdbc.product.url=jdbc:oracle:thin:@10.174.196.20:1521:orcl -jdbc.product.username=gk_pz -#jdbc.product.username=z2_5x9pz -jdbc.product.key=3X3ZBejyxS7lkVsHVm9KTw== -jdbc.product.password=sHqDBZIUS0hYZCbC+1xN3A== +jdbc.product.driver=com.mysql.jdbc.Driver +jdbc.product.url=jdbc:mysql://10.0.6.249:3306/gwall?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull +jdbc.product.username=root +jdbc.product.key=pR3JFt5dsGCW0nZO3TLF7Q== +jdbc.product.password=JgW5tsiGBNAtcqCgSQIP0g== #jdbc.log.driver=oracle.jdbc.driver.OracleDriver #jdbc.log.url=jdbc:oracle:thin:@10.0.6.212:1523:app diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index bfd7eced1..3e4a92ebe 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -605,7 +605,7 @@ action=\u52A8\u4F5C has_prohibit_delete=\u53EA\u6709\u672A\u5BA1\u6838\u7684\u914D\u7F6E\u53EF\u5220\u9664 has_prohibit_nopass=\u53EA\u6709\u672A\u5BA1\u6838\u7684\u914D\u7F6E\u53EF\u672A\u901A\u8FC7\u5BA1\u6838 has_prohibit_pass=\u53EA\u6709\u672A\u5BA1\u6838\u7684\u914D\u7F6E\u53EF\u4EE5\u5BA1\u6838\u901A\u8FC7 -multiple_keywords_tip=\u53EF\u540C\u65F6\u8F93\u5165\u591A\u6761\u5173\u952E\u5B57\uFF0C\u8BF7\u4EE5\u82F1\u6587\u9017\u53F7\u6216\u8005\u56DE\u8F66\u952E\u9694\u5F00\u3002 +multiple_keywords_tip=\u53EF\u540C\u65F6\u8F93\u5165\u591A\u6761\u5173\u952E\u5B57\uFF0C\u8BF7\u4EE5\u56DE\u8F66\u952E\u9694\u5F00\u3002 action_drop=\u4E22\u5F03 action_reject=\u963B\u65AD action_redirect=\u91CD\u5B9A\u5411 @@ -814,4 +814,5 @@ FTP_CONTENT=\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E id_not_exists=id\u4E3A%s\u7684%s\u4E0D\u5B58\u5728 id_not_valid=id\u4E3A%s\u7684%s\u65E0\u6548 num_split_by_comma=%s\u4E3A\u9017\u53F7\u5206\u9694\u7684\u6570\u5B57 +no_data=\u65E0\u76F8\u5173\u6570\u636E #=============region_value,config form title================= \ No newline at end of file diff --git a/src/main/resources/spring-mvc.xml b/src/main/resources/spring-mvc.xml index 44371dfc5..1d7acde45 100644 --- a/src/main/resources/spring-mvc.xml +++ b/src/main/resources/spring-mvc.xml @@ -172,29 +172,29 @@ - + - + - + - + diff --git a/src/main/webapp/WEB-INF/sitemesh3.xml b/src/main/webapp/WEB-INF/sitemesh3.xml index 7fbf8fd5b..bc2cb8810 100644 --- a/src/main/webapp/WEB-INF/sitemesh3.xml +++ b/src/main/webapp/WEB-INF/sitemesh3.xml @@ -26,6 +26,7 @@ + /articles/* 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 90306b787..9d2ebd092 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -10,6 +10,7 @@ $(function(){ }); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); + $("#protocolId").val($(this).attr("protocolId")); if($(".action:checked").val()==64){ $("#ratelimit").show(); }else{ @@ -17,6 +18,7 @@ $(function(){ } }); $("#serviceId").val($(".action:checked").attr("serviceId")); + $("#protocolId").val($(".action:checked").attr("protocolId")); if($(".action:checked").val()==64){ $("#ratelimit").show(); }else{ @@ -43,6 +45,10 @@ $(function(){ } }) if(flag){ + //将disable属性的元素删除 + $(".disabled").each(function(){ + $(this).remove(); + }); $("input[name$='exprType']").attr("disabled",false); $("#appCode").val($("#specServiceIdId").val()); loading('onloading...'); @@ -52,6 +58,19 @@ $(function(){ errorContainer: "#messageBox", }); }); +//业务窗口打开 +var addContent = function(obj, contentClassName) { + var showDiv = $(obj).parent().parent().next(); + $(showDiv).removeClass("hidden").removeClass( + "disabled"); + $(obj).addClass("hidden"); +} + +//业务窗口关闭 +var delContent = function(contentClassName, addBtnClassName) { + $("." + contentClassName).addClass("hidden").addClass("disabled"); + $("." + addBtnClassName).removeClass("hidden"); +} @@ -82,75 +101,105 @@ $(function(){ - - - - - - -
-
-
-
- -
- -
-
-
-
- -
-
- -
- -
-
-
-
-
-
-
- -
- - - -
-
-
-
-
-
- -
- -
-
-
-
-
+ + + + + + +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+ +

+ + + +

+ + + + + +
+ <%@include file="/WEB-INF/views/cfg/ipCfgForm.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/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp index 3874b5b0d..795f36c5c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -32,6 +32,51 @@ $("#level").attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取策略ip相关信息 + $("span[id^=open]").click(function(){ + var openId=$(this).attr("id"); + var closeId=$(this).attr("id").replace("open","close"); + var index=$(this).attr("id").replace("open",""); + $("#"+openId).hide(); + $("#"+closeId).show(); + //var compileId=$(this).attr("compileId"); + var cfgId=$(this).attr("cfgId"); + if($("#"+openId).parent().parent().next("tr").hasClass("child")){ + $("#"+openId).parent().parent().next("tr").show(); + }else{ + $.ajax({ + type:'post', + async:false, + url:'${ctx}/app/ajaxAppPolicyIpList', + data:{"cfgId":cfgId,"index":index}, + dataType:"html", + success:function(data){ + var subTab=""+ + ""+ + ""+ + ""+ + ""; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+=""; + subTab+=""; + $("#"+openId).parent().parent().after(subTab); + $("div[name='tabTitle"+index+"']").get(0).click(); + } + }); + } + + }); + + $("span[id^=close]").on("click",function(){ + var closeId=$(this).attr("id"); + var openId=$(this).attr("id").replace("close","open"); + $("#"+closeId).hide(); + $("#"+openId).show(); + $("#"+closeId).parent().parent().next("tr").hide(); + }); }); @@ -287,6 +332,7 @@ + ${cfg.cfgDesc } diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyIpList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyIpList.jsp new file mode 100644 index 000000000..8bb0252d2 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyIpList.jsp @@ -0,0 +1,130 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+ + +
+
+
+
+
+
+ +
+
+
+
+ + + +
+ + +
+
+ + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+
+ \ No newline at end of file