diff --git a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java index c64e7de10..a29846ae2 100644 --- a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java @@ -49,7 +49,6 @@ public class AppPolicyCfg extends BaseCfg { @ExcelField(title="ratelimit",dictType="APP_RATE_LIMIT",sort=3) private String userRegion2; private String userRegion3; - @ExcelField(title="block_by_app_server_ip",dictType="SYS_YES_NO",sort=4) private String userRegion4; private String userRegion5; private String configType; diff --git a/src/main/java/com/nis/domain/configuration/UserManage.java b/src/main/java/com/nis/domain/configuration/UserManage.java index 1bceb2efe..da0163f70 100644 --- a/src/main/java/com/nis/domain/configuration/UserManage.java +++ b/src/main/java/com/nis/domain/configuration/UserManage.java @@ -50,9 +50,22 @@ public class UserManage extends BaseEntity{ private String seltype; private Integer functionId; private String isAudit; + private String cgiError; + private String errorType; - + public String getErrorType() { + return errorType; + } + public void setErrorType(String errorType) { + this.errorType = errorType; + } + public String getCgiError() { + return cgiError; + } + public void setCgiError(String cgiError) { + this.cgiError = cgiError; + } public String getUserType() { return userType; } diff --git a/src/main/java/com/nis/util/httpclient/HttpClientUtil.java b/src/main/java/com/nis/util/httpclient/HttpClientUtil.java index 77a6e6a10..2e3c58c06 100644 --- a/src/main/java/com/nis/util/httpclient/HttpClientUtil.java +++ b/src/main/java/com/nis/util/httpclient/HttpClientUtil.java @@ -400,14 +400,14 @@ public class HttpClientUtil { //获取响应结果 Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON); response= header.get(); - int status = response.getStatus(); result= response.readEntity(String.class); + //调用处理数据方法 logger.info("获取消息成功,相应内容如下: " + result); } catch (Exception e) { e.printStackTrace(); logger.error("获取消息失败,相应内容如下: " + result); logger.error("获取消息失败 ", e); - throw new MaatConvertException(":"); + throw new MaatConvertException(":"); }finally { if (response != null) { response.close(); 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 ee1f8a893..d014b9804 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -172,7 +172,7 @@ public class AppCfgController extends BaseController { @RequiresPermissions(value={"app:policy:config"}) public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { if(StringUtils.isNotBlank(ids)){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),entity.getCompileId()); + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -227,7 +227,7 @@ public class AppCfgController extends BaseController { AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),entity.getCompileId()); + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java index fb4baf22b..e6a760d3f 100644 --- a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java +++ b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java @@ -108,7 +108,7 @@ public class BasicProtocolController extends BaseController { @RequiresPermissions(value={"basicprotocol:config"}) public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { if(StringUtils.isNotBlank(ids)){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),entity.getCompileId()); + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -166,7 +166,7 @@ public class BasicProtocolController extends BaseController { AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),entity.getCompileId()); + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -255,7 +255,7 @@ public class BasicProtocolController extends BaseController { classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); classMap.put("NTC_IP", IpPortCfg.class); classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",ratelimit,block_by_app_server_ip,encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String cfgIndexInfoNoExport=",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + ",config_time,editor,edit_time,auditor,audit_time" +",letter,whether_area_block,classification,attribute,label" diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index 1006493d0..53a82614b 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -130,7 +130,7 @@ public class EncryptedTunnelBehaviorController extends BaseController { @RequiresPermissions(value={"encryptedtunnelbehav:config"}) public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) { if(StringUtils.isNotBlank(ids)){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),entity.getCompileId()); + entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -187,7 +187,7 @@ public class EncryptedTunnelBehaviorController extends BaseController { AppPolicyCfg entity = new AppPolicyCfg(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),entity.getCompileId()); + entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -293,7 +293,7 @@ public class EncryptedTunnelBehaviorController extends BaseController { classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class); classMap.put("NTC_IP", IpPortCfg.class); classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); - String cfgIndexInfoNoExport=",ratelimit,block_by_app_server_ip,social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String cfgIndexInfoNoExport=",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + ",config_time,editor,edit_time,auditor,audit_time" +",letter,whether_area_block,classification,attribute,label" diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java index 1a4fd32b5..dc5200131 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java @@ -1,9 +1,12 @@ package com.nis.web.controller.configuration.maintenance; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -20,6 +23,8 @@ import com.nis.domain.Page; import com.nis.domain.basics.IpReuseIpCfg; import com.nis.domain.configuration.UserManage; import com.nis.exceptions.MaatConvertException; +import com.nis.util.Constants; +import com.nis.util.StringUtil; import com.nis.util.StringUtils; import com.nis.web.controller.BaseController; @@ -30,11 +35,16 @@ public class UserManageController extends BaseController{ @RequestMapping(value = {"/list"}) @RequiresPermissions(value={"user:manage:view"}) public String list(Model model,HttpServletRequest request,HttpServletResponse response - ,@ModelAttribute("cfg")UserManage entity - ,RedirectAttributes redirectAttributes){ + ,@ModelAttribute("cfg")UserManage entity){ Page page = userManageService.findPage(new Page(request, response,"r"), entity); + if(!StringUtil.isEmpty(entity.getErrorType())){ + if("create".equals(entity.getErrorType())){ + Properties msgProp = getMsgProp(); + String error=msgProp.getProperty("user")+" "+entity.getCgiError()+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + model.addAttribute("message", error); + } + } model.addAttribute("page", page); -// initPageCondition(model,entity); return "/cfg/maintenance/userManage/list"; } @@ -80,18 +90,49 @@ public class UserManageController extends BaseController{ public String save(Model model,HttpServletRequest request,HttpServletResponse response ,String ids,UserManage entity ,RedirectAttributes redirectAttributes) { - try{ - userManageService.save(entity,model,request); - addMessage(redirectAttributes,"save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); - e.printStackTrace(); - addMessage(redirectAttributes,"save_failed"); - } - return "redirect:" + adminPath +"/maintenance/userManage/list"; + Date createTime=new Date(); + String errorIp=""; + String errorType=""; + if(entity.getId()==null){ + entity.setCreateTime(createTime); + entity.setCreatorId(entity.getCurrentUser().getId()); + entity.setIsValid(Constants.VALID_NO); + String[] ipArray =entity.getServerIp().split(","); + for (String ip : ipArray) { + userManageService.saveip(entity,ip,model,request); + } + UserManage oldUser=userManageService.getUserByLoginName(entity.getUserName()); + if(oldUser!=null){ + String[] ips=oldUser.getServerIp().split(","); + String erorIp =userManageService.getMessageIp(ipArray, ips); + if(!StringUtil.isEmpty(erorIp)){ + errorType="create"; + errorIp=entity.getUserName()+" "+erorIp; + } + } + }else{ + entity.setEditTime(createTime); + entity.setEditorId(entity.getCurrentUser().getId()); + String[] ipArray =entity.getServerIp().split(","); + UserManage oldUser=userManageService.getUserById(String.valueOf(entity.getId())); + int num=0; + for (String ip : ipArray) { + userManageService.updateip(entity,ip,num,model,request); + num++; + } + UserManage user=userManageService.getUserById(String.valueOf(entity.getId())); + if(user!=null){ + String[] ips=user.getServerIp().split(","); + String erorIp =userManageService.getMessageIp(ipArray, ips); + if(!StringUtil.isEmpty(erorIp)){ + errorType="create"; + errorIp=user.getUserName()+" "+erorIp; + } + } + } + return "redirect:" + adminPath +"/maintenance/userManage/list?cgiError="+errorIp+"&errorType="+errorType; } - - + /** * 验证登录名是否有效 * @param oldLoginName diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java index 6ea6f246c..d16db478d 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java @@ -20,10 +20,13 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.configuration.AvFileSampleCfg; +import com.nis.domain.configuration.AvVoipAccountCfg; import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.DdosIpCfg; import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.configuration.DdosIpCfg; import com.nis.domain.configuration.RequestInfo; import com.nis.exceptions.MaatConvertException; @@ -47,7 +50,7 @@ public class DdosCfgController extends BaseController { @RequiresPermissions(value={"ddos:ip:config"}) public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")DdosIpCfg cfg){ if(!StringUtil.isEmpty(ids)){ - cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids)); + cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids),null); initUpdateFormCondition(model, cfg); }else{ initFormCondition(model,cfg); @@ -145,5 +148,24 @@ public class DdosCfgController extends BaseController { } //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - + /** + * 根据索引表信息异步获取子表信息 + * @return + */ + @RequestMapping(value = {"/ajaxDdosInfo"}) + public String getDdosInfo(Model model,Long cfgId,Integer index,Integer compileId) { + DdosIpCfg cfg = ddosCfgService.getDdosIpCfg(cfgId, compileId); + List tabList = new ArrayList(); + //获取DdosIpCfg信息 + String cfgType = null; + if(!cfg.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",cfg.getCfgType()}); + cfgType = cfg.getCfgType(); + } + + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/ddosSubList"; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java index 8663abfd1..14870ea33 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java @@ -38,6 +38,8 @@ import com.nis.domain.Page; import com.nis.domain.configuration.AvFileSampleCfg; import com.nis.domain.configuration.AvSignSampleCfg; import com.nis.domain.configuration.AvSignSampleCfgModel; +import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.maat.ToMaatResult; @@ -116,17 +118,57 @@ public class AvController extends BaseController { //return "/cfg/av/signSampleList"; return "/cfg/av/switchSignSample"; } + // 日志获取样例获取域配置信息 + @RequestMapping(value = {"ajaxSignSampleList"}) + public String ajaxSignSampleList(Model model,Long cfgId,Integer index,Integer compileId) { + List tabList = new ArrayList(); + AvSignSampleCfg cfg = new AvSignSampleCfg(); + cfg.setCfgId(cfgId); + cfg.setCompileId(compileId); + List list = avCfgService.getSignSampleList(cfg); + if(list!=null){ + cfg=list.get(0); + } + cfg.setCfgType("5"); + String cfgType = null; + if(cfg.getCfgType()!=null){ + tabList.add(new String[]{"5",cfg.getCfgType()}); + cfgType = cfg.getCfgType(); + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/av/switchSignSampleSubList"; + } + //文件样例配置界面 @RequestMapping(value = {"/sample/fileSampleForm"}) public String fileSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvFileSampleCfg entity){ if(!StringUtil.isEmpty(ids)){ - entity = avCfgService.getAvFileSampleById(Long.parseLong(ids)); + entity = avCfgService.getAvFileSampleById(Long.parseLong(ids),null); } initFormCondition(model,entity); model.addAttribute("_cfg", entity); return "/cfg/av/fileSampleForm"; } + // 日志获取样例获取域配置信息 + @RequestMapping(value = {"ajaxfileSampleList"}) + public String ajaxAvContIpList(Model model,Long cfgId,Integer index,Integer compileId) { + AvFileSampleCfg cfg = avCfgService.getAvFileSampleById(cfgId,compileId); + List tabList = new ArrayList(); + if(cfg!=null){ + String cfgType = null; + if(!cfg.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"5",cfg.getCfgType()}); + cfgType = cfg.getCfgType(); + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/av/fileSampleSubList"; + } //标志样例配置界面 @RequestMapping(value = {"/sample/audioSignSampleForm"}) public String audioSignSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){ @@ -293,7 +335,7 @@ public class AvController extends BaseController { AvFileSampleCfg entity = new AvFileSampleCfg(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = avCfgService.getAvFileSampleById(Long.parseLong(id)); + entity = avCfgService.getAvFileSampleById(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java index bb156b0bd..30b184879 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java @@ -55,7 +55,7 @@ public class BgpCfgController extends BaseController{ @RequiresPermissions(value={"other:bgp:config"}) public String bgpForm(Model model,String ids,CfgIndexInfo entity,RedirectAttributes redirectAttributes) { if(StringUtils.isNotBlank(ids)){ - entity = bgpCfgService.getBgpCfg(Long.parseLong(ids),entity.getCompileId()); + entity = bgpCfgService.getBgpCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -134,7 +134,7 @@ public class BgpCfgController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = bgpCfgService.getBgpCfg(Long.parseLong(id),entity.getCompileId()); + entity = bgpCfgService.getBgpCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index 6d21023c4..3653a7222 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -66,7 +66,7 @@ public class FileTransferCfgController extends BaseController{ @RequiresPermissions(value={"fileTransfer:ftp:config"}) public String ftpForm(Model model,String compileIds,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids),entity.getCompileId()); + entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -163,7 +163,7 @@ public class FileTransferCfgController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = fileTransferCfgService.getFtpCfg(Long.parseLong(id),entity.getCompileId()); + entity = fileTransferCfgService.getFtpCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -203,7 +203,7 @@ public class FileTransferCfgController extends BaseController{ @RequiresPermissions(value={"fileTransfer:fileDigest:config"}) public String fileDigestForm(Model model,String ids,FileDigestCfg entity,RedirectAttributes redirectAttributes) { if(StringUtils.isNotBlank(ids)){ - entity = fileTransferCfgService.getFileDigestCfg(Long.parseLong(ids),entity.getCompileId()); + entity = fileTransferCfgService.getFileDigestCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -335,7 +335,7 @@ public class FileTransferCfgController extends BaseController{ public String p2pForm(Model model,String ids,CfgIndexInfo entity) { // 跳转操作页面(根据ids判断是新增 or 修改) if(StringUtils.isNotBlank(ids)){ - entity = fileTransferCfgService.getP2pCfg(Long.parseLong(ids),entity.getCompileId()); + entity = fileTransferCfgService.getP2pCfg(Long.parseLong(ids),null); // 添加配置域Key,用于修改页面区分各域配置 P2pHashCfg hashCfg = new P2pHashCfg(); @@ -454,7 +454,7 @@ public class FileTransferCfgController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id),entity.getCompileId()); + entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java index 91d77c812..9b464f1cf 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java @@ -61,7 +61,7 @@ public class MailCfgController extends BaseController{ @RequiresPermissions(value={"mail:config"}) public String mailForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = mailCfgService.getMailCfg(Long.parseLong(ids),entity.getCompileId()); + entity = mailCfgService.getMailCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -168,7 +168,7 @@ public class MailCfgController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = mailCfgService.getMailCfg(Long.parseLong(id),entity.getCompileId()); + entity = mailCfgService.getMailCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index 04065bd9e..baa102ba4 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -80,7 +80,7 @@ public class WebsiteController extends BaseController{ @RequiresPermissions(value={"website:http:config"}) public String httpForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = websiteCfgService.getHttpCfg(Long.parseLong(ids),entity.getCompileId()); + entity = websiteCfgService.getHttpCfg(Long.parseLong(ids),null); //设置http各类配置的配置域类型 IpPortCfg ipCfg = new IpPortCfg(); @@ -212,7 +212,7 @@ public class WebsiteController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = websiteCfgService.getHttpCfg(Long.parseLong(id),entity.getCompileId()); + entity = websiteCfgService.getHttpCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -243,7 +243,7 @@ public class WebsiteController extends BaseController{ @RequiresPermissions(value={"website:ssl:config"}) public String sslForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = websiteCfgService.getSslCfg(Long.parseLong(ids),entity.getCompileId()); + entity = websiteCfgService.getSslCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -307,7 +307,7 @@ public class WebsiteController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = websiteCfgService.getSslCfg(Long.parseLong(id),entity.getCompileId()); + entity = websiteCfgService.getSslCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -335,7 +335,7 @@ public class WebsiteController extends BaseController{ @RequiresPermissions(value={"website:dns:config"}) public String dnsForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = websiteCfgService.getDnsCfg(Long.parseLong(ids),entity.getCompileId()); + entity = websiteCfgService.getDnsCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -400,7 +400,7 @@ public class WebsiteController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = websiteCfgService.getDnsCfg(Long.parseLong(id),entity.getCompileId()); + entity = websiteCfgService.getDnsCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java index 4007e0cf0..896745dcf 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java @@ -81,7 +81,7 @@ public class WhiteListController extends CommonController{ public String ipForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids),entity.getCompileId()); + entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids),null); initUpdateFormCondition(model,entity); }else{ initFormCondition(model,entity); @@ -100,7 +100,7 @@ public class WhiteListController extends CommonController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = ipCfgService.getIpPortCfg(Long.parseLong(id),entity.getCompileId()); + entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); @@ -157,7 +157,7 @@ public class WhiteListController extends CommonController{ @RequiresPermissions(value={"whitelist:domain:config"}) public String domainForm(Model model,String ids,CfgIndexInfo entity) { if(StringUtils.isNotBlank(ids)){ - entity = domainService.getDomainCfg(Long.parseLong(ids),entity.getCompileId()); + entity = domainService.getDomainCfg(Long.parseLong(ids),null); HttpUrlCfg urlCfg = new HttpUrlCfg(); urlCfg.setCfgType(Constants.HTTP_URL_REGION); entity.setHttpUrl(urlCfg); @@ -234,7 +234,7 @@ public class WhiteListController extends CommonController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = domainService.getDomainCfg(Long.parseLong(id),entity.getCompileId()); + entity = domainService.getDomainCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java index eba86f103..74ded72b6 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java @@ -70,7 +70,7 @@ public class HttpRedirectPolicyController extends BaseController{ ,logical=Logical.OR) public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){ if(StringUtils.isNotBlank(ids)){ - entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids),entity.getCompileId()); + entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids),null); HttpUrlCfg urlCfg = new HttpUrlCfg(); urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION); @@ -227,7 +227,7 @@ public class HttpRedirectPolicyController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id),entity.getCompileId()); + entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id),null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/dao/configuration/AvCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AvCfgDao.java index e0d1fa821..cb4593bc3 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AvCfgDao.java @@ -2,6 +2,8 @@ package com.nis.web.dao.configuration; import java.util.List; +import org.apache.ibatis.annotations.Param; + import com.nis.domain.configuration.AvFileSampleCfg; import com.nis.domain.configuration.AvSignSampleCfg; import com.nis.web.dao.MyBatisDao; @@ -9,7 +11,7 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface AvCfgDao { - public AvFileSampleCfg getAvFileSampleById(Long cfgId); + public AvFileSampleCfg getAvFileSampleById(@Param("cfgId")Long cfgId,@Param("compileId")Integer compileId); public AvSignSampleCfg getAvSignSampleById(Long cfgId); public List getAvFileSampleList(AvFileSampleCfg entity); public List getAvSignSampleList(AvSignSampleCfg entity); diff --git a/src/main/java/com/nis/web/dao/configuration/AvCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AvCfgDao.xml index 061d500e6..eccc12071 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AvCfgDao.xml @@ -81,11 +81,18 @@ a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.cfg_type,a.cfg_region_code,a.LEVEL,a.do_log - SELECT FROM av_file_sample_cfg a - WHERE a.CFG_ID = #{cfgId,jdbcType=BIGINT} + + + CFG_ID = #{cfgId,jdbcType=BIGINT} + + + AND COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + diff --git a/src/main/java/com/nis/web/service/configuration/AvCfgService.java b/src/main/java/com/nis/web/service/configuration/AvCfgService.java index d7637af1b..bf93033f5 100644 --- a/src/main/java/com/nis/web/service/configuration/AvCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvCfgService.java @@ -52,8 +52,8 @@ public class AvCfgService extends BaseService{ @Autowired protected AvCfgDao avCfgDao; - public AvFileSampleCfg getAvFileSampleById(Long cfgId){ - return avCfgDao.getAvFileSampleById(cfgId); + public AvFileSampleCfg getAvFileSampleById(Long cfgId,Integer compileId){ + return avCfgDao.getAvFileSampleById(cfgId,compileId); } public AvSignSampleCfg getAvSignSampleById(Long cfgId){ return avCfgDao.getAvSignSampleById(cfgId); @@ -112,7 +112,7 @@ public class AvCfgService extends BaseService{ throw new MaatConvertException(""); } }else{ - AvFileSampleCfg oldEntity = this.getAvFileSampleById(entity.getCfgId()); + AvFileSampleCfg oldEntity = this.getAvFileSampleById(entity.getCfgId(),entity.getCompileId()); entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(new Date()); entity.setIsValid(0); diff --git a/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java b/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java index c42222527..723031c21 100644 --- a/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java +++ b/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java @@ -54,6 +54,7 @@ import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.util.DateUtils; import com.nis.util.DictUtils; +import com.nis.util.FileUtils; import com.nis.util.ServiceConfigTemplateUtil; import com.nis.util.StringUtil; import com.nis.web.dao.configuration.CommonPolicyDao; @@ -286,7 +287,7 @@ public class ConfigSynchronizationService extends BaseService{ } //批量获取regionId,groupId(相同编译下的IP类配置多条ip只获取一个组号),分组复用的域配置不需要重新获取regionId,groupId List regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size()); - List groupIds = ConfigServiceUtil.getId(2, strList.size()+complexStrList.size()+numList.size()+fileList.size()); + List groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size()); for(CfgIndexInfo cfg:list){ maatCfg = new MaatCfg(); maatCfg.initDefaultValue(); @@ -350,14 +351,15 @@ public class ConfigSynchronizationService extends BaseService{ } } if(ipList.size()>0){ - List ipGroupId = ConfigServiceUtil.getId(2,1);//多条IP只获取一个groupId +// List ipGroupId = ConfigServiceUtil.getId(2,1);//多条IP只获取一个groupId for(int index=0;index regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+compileIds.size()+complexStrList.size()+numList.size()+fileList.size()); - List groupIds = ConfigServiceUtil.getId(2, strList.size()+compileIds.size()+complexStrList.size()+numList.size()+fileList.size()); + List groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+compileIds.size()+complexStrList.size()+numList.size()+fileList.size()); for(AppPolicyCfg cfg:list){ maatCfg = new MaatCfg(); maatCfg.initDefaultValue(); @@ -661,14 +664,15 @@ public class ConfigSynchronizationService extends BaseService{ if(ipList.size()>0){ - List ipGroupId = ConfigServiceUtil.getId(2,1);//多条IP只获取一个groupId +// List ipGroupId = ConfigServiceUtil.getId(2,1);//多条IP只获取一个groupId for(int index=0;index regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size()); - List groupIds = ConfigServiceUtil.getId(2, strList.size()+complexStrList.size()+numList.size()+fileList.size()); + List groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size()); for(AppFeatureIndex cfg:list){ maatCfg = new MaatCfg(); maatCfg.initDefaultValue(); @@ -917,14 +922,15 @@ public class ConfigSynchronizationService extends BaseService{ } } if(ipList.size()>0){ - List ipGroupId = ConfigServiceUtil.getId(2,1);//多条IP只获取一个groupId +// List ipGroupId = ConfigServiceUtil.getId(2,1);//多条IP只获取一个groupId for(int index=0;index compileIds = Lists.newArrayList(); for(int i=0;i0){ + //调用服务接口下发配置数据 + String json=gsonToJson(newList); + if(isUpdateCfg) { + logger.info("配置批量下发:"+json); + //调用服务接口同步回调类配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + if(result!=null){ + logger.info("配置批量下发响应信息:"+result.getMsg()); + } + }else { +// logger.info("回调类配置同步:"+json); +// FileUtils.writeToFile("d:\\configSync\\"+entity.getServiceId()+"_"+page.getPageNo()+"_"+System.currentTimeMillis()+".txt", json, false); + //调用服务接口同步回调类配置 + JSONObject result = ConfigServiceUtil.configSync(json,2,entity.getServiceId(),entity.getTableName(),(hasData?null:"FINISHED")); +// logger.info("回调类配置同步:"+result.getMsg()); } - }else { - logger.info("回调类配置同步:"+json); - //调用服务接口同步回调类配置 - JSONObject result = ConfigServiceUtil.configSync(json,2,entity.getServiceId(),entity.getTableName(),(hasData?null:"FINISHED")); -// logger.info("回调类配置同步:"+result.getMsg()); } return hasData; diff --git a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java index 5142b5bcc..79a88acc4 100644 --- a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java @@ -62,8 +62,8 @@ public class DdosCfgService extends BaseService{ return page; } - public DdosIpCfg getDdosIpCfg(Long cfgId) { - return ddosCfgDao.getDdosIpCfg(cfgId); + public DdosIpCfg getDdosIpCfg(Long cfgId,Integer compileId) { + return ddosCfgDao.getDdosIpCfg(cfgId,compileId); } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdate(DdosIpCfg entity){ @@ -224,7 +224,7 @@ public class DdosCfgService extends BaseService{ public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws Exception{ DdosIpCfg entity = new DdosIpCfg(); - entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id)); + entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId()); List list = new ArrayList(); entity.setCfgId(Long.valueOf(id)); @@ -265,7 +265,7 @@ public class DdosCfgService extends BaseService{ List areaIpRegionList = new ArrayList(); - entity=this.getDdosIpCfg(entity.getCfgId()); + entity=this.getDdosIpCfg(entity.getCfgId(),entity.getCompileId()); if(entity.getIsAudit()==1){ List ipList=new ArrayList(); diff --git a/src/main/java/com/nis/web/service/configuration/UserManageService.java b/src/main/java/com/nis/web/service/configuration/UserManageService.java index 283902cdf..1409cafb5 100644 --- a/src/main/java/com/nis/web/service/configuration/UserManageService.java +++ b/src/main/java/com/nis/web/service/configuration/UserManageService.java @@ -1,6 +1,8 @@ package com.nis.web.service.configuration; +import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -9,20 +11,28 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.session.ExecutorType; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; import org.eclipse.jetty.util.ajax.JSON; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import com.nis.domain.Page; +import com.nis.domain.configuration.AppPolicyCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.UserManage; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.dao.configuration.AppCfgDao; +import com.nis.web.dao.configuration.IpCfgDao; import com.nis.web.dao.configuration.UserManageDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; +import com.nis.web.service.SpringContextHolder; @Service public class UserManageService extends BaseService{ @@ -45,77 +55,128 @@ public class UserManageService extends BaseService{ return userManageDao.getUserById(id); } - public void save(UserManage entity,Model model, HttpServletRequest request){ - Date createTime=new Date(); - if(entity.getId()==null){ + public static String getMessageIp(String[] oldIp,String[] ip){ + String ips=null; + for (int i = 0; i < oldIp.length; i++) { + boolean flag=true; + for (int j = 0; j < ip.length; j++) { + if(oldIp[i].equals(ip[j])){ + flag=false; + break; + } + } + if(flag){ + if(ips==null){ + ips=oldIp[i]; + }else{ + ips=ips+","+oldIp[i]; + } + } + } + return ips; + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveip(UserManage entity,String ips,Model model, HttpServletRequest request){ + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; try { - entity.setCreateTime(createTime); - entity.setCreatorId(entity.getCurrentUser().getId()); - entity.setIsValid(Constants.VALID_NO); - userManageDao.insert(entity); - //cgi接口添加 - String[] ipArray = entity.getServerIp().split(","); - for(String ip :ipArray){ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + UserManage user=userManageDao.getUserByLoginName(entity.getUserName()); + if(user==null){ + entity.setServerIp(ips); + ((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).insert(entity); + }else{ + user.setServerIp(user.getServerIp()+","+ips); + ((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(user); + } + //cgi接口添加 //循环调用接口增加 Map params = new HashMap(); - params.put("server_ip", ip); + params.put("server_ip", ips); params.put("user_name", entity.getUserName()); params.put("user_pwd", entity.getUserPwd()); - Map map=getUrl(params,Constants.NTC_IP_REUSE_USER_CREATE,request); - //返回处理 - } - } catch (MaatConvertException e) { + String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_CREATE ; + String recv = HttpClientUtil.getCGI(url, params, request); + if (StringUtils.isNotBlank(recv)) { + Map map = new HashMap(); + map = (Map) JSON.parse(recv); + String error = map.get("error"); + if (!StringUtil.isEmpty(error)) { + batchSqlSession.rollback(); + } else { + batchSqlSession.commit(); + } + } + } catch (IOException e) { e.printStackTrace(); - logger.info("获取编译ID出错"); - throw new MaatConvertException(""); - } - }else{ - try { - entity.setEditTime(createTime); - entity.setEditorId(entity.getCurrentUser().getId()); - //获取修改之前数据 - UserManage olduser=userManageDao.getUserById(String.valueOf(entity.getId())); - userManageDao.update(entity); - //cgi接口删除旧数据 - String[] ipArray = olduser.getServerIp().split(","); - for(String ip :ipArray){ - //循环调用接口删除 - Map params = new HashMap(); - params.put("server_ip", ip); - params.put("user_name", olduser.getUserName()); - Map map=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request); - //返回处理 - + } finally { + if (batchSqlSession != null) { + batchSqlSession.close(); } - if(StringUtil.isEmpty(entity.getUserName())){ - entity.setUserName(olduser.getUserName()); - } - if(StringUtil.isEmpty(entity.getUserPwd())){ - entity.setUserPwd(olduser.getUserPwd()); - } - String[] newIpArray = entity.getServerIp().split(","); - for(String newIp :newIpArray){ - //循环调用接口添加 - Map params = new HashMap(); - params.put("server_ip", newIp); - params.put("user_name", entity.getUserName()); - params.put("user_pwd", entity.getUserPwd()); - Map map=getUrl(params,Constants.NTC_IP_REUSE_USER_CREATE,request); - //返回处理 - } - }catch (Exception e) { - e.printStackTrace(); - logger.info("获取编译ID出错"); - throw new MaatConvertException(""); - } - } + } } + + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void updateip(UserManage entity,String ips,int num,Model model, HttpServletRequest request){ + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try { + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + if(num==0){ + UserManage olduser=userManageDao.getUserById(String.valueOf(entity.getId())); + //接口旧数据删除 + //cgi接口删除旧数据 + String[] ipArray = olduser.getServerIp().split(","); + for(String ip :ipArray){ + //循环调用接口删除 + Map params = new HashMap(); + params.put("server_ip", ip); + params.put("user_name", olduser.getUserName()); + Map map=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request); + //返回处理 + } + entity.setServerIp(ips); + ((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(entity); + }else{ + UserManage user=userManageDao.getUserById(String.valueOf(entity.getId())); + user.setServerIp(user.getServerIp()+","+ips); + ((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(user); + } + // cgi接口添加 + // 循环调用接口增加 + Map params = new HashMap(); + params.put("server_ip", ips); + params.put("user_name", entity.getUserName()); + params.put("user_pwd", entity.getUserPwd()); + String url = Constants.IP_REUSE_CALL_CGI_URL + Constants.NTC_IP_REUSE_USER_CREATE; + String recv = HttpClientUtil.getCGI(url, params, request); + if (StringUtils.isNotBlank(recv)) { + Map map = new HashMap(); + map = (Map) JSON.parse(recv); + String error = map.get("error"); + if (!StringUtil.isEmpty(error)) { + batchSqlSession.rollback(); + } else { + batchSqlSession.commit(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (batchSqlSession != null) { + batchSqlSession.close(); + } + } + } + + public Map getUrl(Map params,String urlType,HttpServletRequest request){ Map map=new HashMap(); try{ String url =Constants.IP_REUSE_CALL_CGI_URL+ urlType ; String recv = HttpClientUtil.getCGI(url, params, request); - logger.info("查询结果:" + recv); if (StringUtils.isNotBlank(recv)) { map=(Map)JSON.parse(recv); } @@ -134,7 +195,6 @@ public class UserManageService extends BaseService{ try{ String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_GET ; String recv = HttpClientUtil.getCGI(url, params, request); - logger.info("查询结果:" + recv); if (StringUtils.isNotBlank(recv)) { map=(Map)JSON.parse(recv); } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 470b26175..dfa7eaaa9 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1336,4 +1336,5 @@ ip_total=IP Total available_ip_total=Available IP Total address_pool_id=Address Pool ID log_to_cfg=Config -address_pool_is_used=Address pool is used and cannot perform this operation! \ No newline at end of file +address_pool_is_used=Address pool is used and cannot perform this operation! +cgi_service_failed=Request CGI server failed \ 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 b8e9adb95..9fc0bacca 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1322,16 +1322,17 @@ user_info=\u7528\u6237\u4FE1\u606F user_list=\u7528\u6237\u5217\u8868 equal_password=\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF01 outgoing_unicast_packets=\u4E0A\u4F20\u6570\u636E\u5305\u6570 -outgoing_unicast_total_size=\u4E0A\u4F20\u6570\u636E\u5305\u6570\u603B\u91CF -outgoing_broadcast_packets=\u4E0A\u4F20\u5B57\u8282\u6570 -outgoing_broadcast_total_size=\u4E0A\u4F20\u5B57\u8282\u6570\u603B\u91CF +outgoing_unicast_total_size=\u4E0A\u4F20\u5B57\u8282\u6570 +outgoing_broadcast_packets=outgoing_broadcast_packets +outgoing_broadcast_total_size=outgoing_broadcast_total_size incoming_unicast_packets=\u4E0B\u8F7D\u6570\u636E\u5305\u6570 -incoming_unicast_total_size=\u4E0B\u8F7D\u6570\u636E\u5305\u6570\u603B\u91CF -incoming_broadcast_packets=\u4E0B\u8F7D\u5B57\u8282\u6570 -incoming_broadcast_total_size=\u4E0B\u8F7D\u5B57\u8282\u6570\u603B\u91CF +incoming_unicast_total_size=\u4E0B\u8F7D\u6570\u636E\u5B57\u8282\u6570 +incoming_broadcast_packets=incoming_broadcast_packets +incoming_broadcast_total_size=incoming_broadcast_total_size address_pool=\u5730\u5740\u6C60 ip_total=IP\u603B\u6570 available_ip_total=\u53EF\u7528IP\u6570 address_pool_id=\u5730\u5740\u6C60ID -log_to_cfg=\u914D\u7F6E -address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01 \ No newline at end of file +log_to_cfg=\u914D\u7F6E +address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01 +cgi_service_failed=\u8BF7\u6C42CGI\u670D\u52A1\u63A5\u53E3\u5931\u8D25 \ No newline at end of file diff --git a/src/main/resources/service/service_config.xml b/src/main/resources/service/service_config.xml index ab5661c89..5ad3161f6 100644 --- a/src/main/resources/service/service_config.xml +++ b/src/main/resources/service/service_config.xml @@ -18,7 +18,9 @@ - + + + @@ -86,14 +88,14 @@ - + @@ -174,7 +176,7 @@ - + @@ -262,48 +264,45 @@ + - - - + - - - + diff --git a/src/main/webapp/WEB-INF/sitemesh3.xml b/src/main/webapp/WEB-INF/sitemesh3.xml index c1609b02c..0066cac72 100644 --- a/src/main/webapp/WEB-INF/sitemesh3.xml +++ b/src/main/webapp/WEB-INF/sitemesh3.xml @@ -38,6 +38,7 @@ + /articles/* 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 48049f571..25d24bc5a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -378,7 +378,7 @@ - + <%-- --%> @@ -446,7 +446,7 @@ -
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp index deda71353..75459f4e9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contIp/contIpList.jsp @@ -357,7 +357,7 @@ - + <%-- --%> @@ -500,7 +500,7 @@ -
+ <%--
--%> ${cfg.creatorName } ${cfg.editorName } diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp index e33e926a0..068286321 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp @@ -373,7 +373,7 @@ - + <%-- --%> @@ -421,7 +421,7 @@
-
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp index 4b5a87711..cac642528 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleList.jsp @@ -299,7 +299,7 @@ - + <%-- --%> @@ -350,7 +350,7 @@ -
+ <%--
--%> ${cfg.requestName } diff --git a/src/main/webapp/WEB-INF/views/cfg/av/fileSampleSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleSubList.jsp new file mode 100644 index 000000000..8e4a83d2a --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/av/fileSampleSubList.jsp @@ -0,0 +1,54 @@ +<%@ 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/av/picIp/picIpList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp index 6cd3c2e1c..c7ae209ab 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picIp/picIpList.jsp @@ -358,7 +358,7 @@ - + <%-- --%> @@ -502,7 +502,7 @@ -
+ <%--
--%> ${cfg.creatorName } ${cfg.editorName } diff --git a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp index 89ecf5279..1cbe481ff 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/picUrl/picUrlList.jsp @@ -345,7 +345,7 @@ - + <%-- --%> @@ -419,7 +419,7 @@ -
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/signSampleList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/signSampleList.jsp index 3077025b0..4d2517bb8 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/signSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/signSampleList.jsp @@ -305,7 +305,7 @@ - + <%-- --%> @@ -416,7 +416,7 @@ -
+ <%--
--%> ${cfg.creatorName } ${cfg.editorName } diff --git a/src/main/webapp/WEB-INF/views/cfg/av/switchSignSampleSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/switchSignSampleSubList.jsp new file mode 100644 index 000000000..3fea8a50f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/av/switchSignSampleSubList.jsp @@ -0,0 +1,41 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + + +
+ + +
+
+ + + + + +
+
+
+
+ + ${cfg.level} +
+
+
+ +
+
+
+
+ \ No newline at end of file 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 a9a08e8ea..e0655254d 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 @@ -365,7 +365,7 @@ - + <%-- --%> @@ -412,7 +412,7 @@
-
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp index b036893b2..d8db05b85 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp @@ -380,7 +380,7 @@ - + <%-- --%> @@ -439,7 +439,7 @@ -
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp index 322ede7f8..bd367c57a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/ipList.jsp @@ -500,7 +500,7 @@ - <%--
--%> + <%-- <%--
--%> --%> ${cfg.creatorName } ${cfg.editorName } diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp index c87e49bc7..33cec2e14 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp @@ -324,7 +324,7 @@ - + <%-- --%> @@ -383,7 +383,7 @@
-
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosSubList.jsp new file mode 100644 index 000000000..6e7ff08ef --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/ddosSubList.jsp @@ -0,0 +1,133 @@ +<%@ 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/encryptedtunnelbehav/list.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp index d10e90709..8a7f9a980 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp @@ -377,7 +377,7 @@ - + <%-- --%> @@ -434,7 +434,7 @@
-
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp index edd794a34..f249645aa 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp @@ -345,7 +345,7 @@ - + <%-- --%> @@ -391,7 +391,7 @@ -
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp index 67fc120cb..3d248887e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp @@ -359,7 +359,7 @@ - + <%-- --%> @@ -405,7 +405,7 @@ -
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp index be045b025..89fc883a1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp @@ -360,7 +360,7 @@ - + <%-- --%> @@ -407,7 +407,7 @@ -
+ <%--
--%> diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp index d1d335d30..74642ad5a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp @@ -37,7 +37,42 @@ $("#exportValue").val($("#intype").val()); } } + + + $("td[addrPoolId]").each(function(){ + var td = $(this); + var audit = $(this).attr("audit") + var addrPoolId = $(this).attr("addrPoolId"); + var timeout=$.validator.messages.timeout; + var failed=$.validator.messages.failed; + // 判断是否为审核通过状态 + if(audit == 1){ + $.ajax({ + type:'get', + timeout:10000,// 超时时间 + url:'http://192.168.11.137:8090/command/?cmd=IpNumGet&addr_pool_id='+addrPoolId, + dataType:'json', + async:true, + success:function(data){ + //alert(JSON.stringify(data)); + $(td).html(data.num); + + }, + complete:function(XMLHttpRequest,status){ + if(status=="timeout"){ + $(td).html(timeout); + }else if(status !="success"){ + $(td).html(failed); + } + } + }); + + }else { + $(td).html(0); + + } }); + }); @@ -323,7 +358,7 @@ ${cfg.ipTotal } - ${cfg.availableIpTotal } +
diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/userManage/list.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/userManage/list.jsp index 2624cce36..471f1a60f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/userManage/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/userManage/list.jsp @@ -61,9 +61,10 @@ html+=""; html+=""; html+=""; - html+=""; - html+=""; - html+=""; + html+=""; + /* html+=""; */ + html+=""; + /* html+=""; */ html+=""; html+=""; for(i=0;i" } }, + errorPlacement : function(error,element) { + /* $("#messageBox").text(""); + if (element.is(":checkbox")|| element.is(":radio")|| element.parent().is(".input-append")) { + error.appendTo(element.parent().parent()); + } else { + error.insertAfter(element); + } */ + $(element).parents(".form-group").find("div[for='"+ element.attr("name")+ "']").append(error); + }, submitHandler : function(form) { loading('onloading...'); form.submit(); }, - errorContainer : "#messageBox", - errorPlacement : function(error, - element) { - $("#messageBox") - .text( - ""); - if (element.is(":checkbox") - || element.is(":radio") - || element - .parent() - .is( - ".input-append")) { - error.appendTo(element - .parent().parent()); - } else { - error.insertAfter(element); - } - } + errorContainer : "#messageBox" }); - - }); + + }); @@ -93,6 +86,7 @@ + *
- * -
+
+ *
@@ -133,35 +127,37 @@
- * +
+ + * +
- - * - +
+ *
- * +
- + <%-- --%> @@ -405,7 +405,7 @@ - + <%-- --%> - + <%-- --%> @@ -446,7 +446,7 @@ - + <%-- --%> diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp index 5e068e4c4..c0872cd72 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpRedirectList.jsp @@ -567,7 +567,7 @@ - + <%-- --%> @@ -672,7 +672,7 @@ - + <%-- --%> - + <%-- --%> @@ -343,7 +343,7 @@ - + <%-- --%> - + <%-- --%> @@ -346,7 +346,7 @@ - + <%-- --%> - + <%-- --%> @@ -409,7 +409,7 @@ - + <%-- --%> - + <%-- --%> @@ -561,7 +561,7 @@ - + <%-- --%> - + <%-- --%> @@ -402,7 +402,7 @@ - + <%-- --%> - + <%-- --%> @@ -384,7 +384,7 @@ - + <%-- --%> "+ + ""; + 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(); + }); }); @@ -157,7 +198,6 @@ $(document).ready(function(){
-
diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp index 96aac63cb..3ae9afac9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp @@ -334,7 +334,7 @@
${indexCfg.creatorName } ${indexCfg.editorName }
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp index 65f2a2447..f9ff51600 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceList.jsp @@ -279,7 +279,7 @@
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp index a6f3264f6..4bed7fb79 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpResReplaceList.jsp @@ -281,7 +281,7 @@
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp index 7e827bdb3..b35f688b3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp @@ -358,7 +358,7 @@
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp index dc5a799b4..4edaa6a67 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp @@ -515,7 +515,7 @@
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp index b33b8126f..1962c915b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslList.jsp @@ -356,7 +356,7 @@
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp index eab35e74c..335abf99b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp @@ -337,7 +337,7 @@
diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp index 3723d44e0..6dbe6b528 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp @@ -20,7 +20,48 @@ $(document).ready(function(){ .attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/manipulation/ddos/ajaxDdosInfo', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var subTab="
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
@@ -208,6 +248,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp index 6448689c5..79574662a 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp @@ -20,7 +20,48 @@ $(document).ready(function(){ .attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxSignSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -212,6 +253,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp index d414c41b4..de827d158 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp @@ -29,6 +29,49 @@ "value", ''); $("#searchForm")[0].reset(); }); + + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -270,6 +313,7 @@ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp index f6584639a..bc9fe5f65 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleFaceList.jsp @@ -20,7 +20,48 @@ $(document).ready(function(){ .attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -212,6 +253,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp index c8446a73c..daf6f8fc1 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleLogoList.jsp @@ -20,7 +20,48 @@ $(document).ready(function(){ .attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -212,6 +253,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp index bf1aab3e6..7267767b3 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp @@ -21,6 +21,48 @@ $(document).ready(function(){ $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -211,6 +253,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp index 77ea2bfc8..6640c1565 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleSpeakerList.jsp @@ -20,7 +20,48 @@ $(document).ready(function(){ .attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -212,6 +253,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp index 9abf1b4e8..8944e56e3 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp @@ -21,6 +21,48 @@ $(document).ready(function(){ $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -212,6 +254,7 @@ $(document).ready(function(){ diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp index 44f9f59c5..123fcca2e 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp @@ -20,7 +20,48 @@ $(document).ready(function(){ .attr("value",''); $("#searchForm")[0].reset(); }); + //异步获取voip相关信息 + $("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}/ntc/av/ajaxfileSampleList', + data:{"compileId":compileId,"index":index}, + dataType:"html", + success:function(data){ + var 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(); + }); }); @@ -218,6 +259,7 @@ $(document).ready(function(){
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }
"; + var html=""; + html+="
"; + html = html+data; + subTab=subTab+html; + subTab+="
+ ${log.cfgId }