From f30acfdbbd0853e1d37dba6d40c70dc48091ef7e Mon Sep 17 00:00:00 2001 From: wangwei Date: Tue, 21 May 2019 09:51:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=AB=E6=8C=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=81=E6=B3=A8=E5=85=A5=E8=84=9A=E6=9C=AC=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=81=E6=B5=81=E9=87=8F=E8=BD=AC=E5=8F=91=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E8=8F=9C=E5=8D=95,=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8A=AB=E6=8C=81=E8=8F=9C=E5=8D=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/callback/ProxyFileHijackCfg.java | 61 +++ .../callback/ProxyFileHijackCfgAudit.java | 105 +++++ .../callback/ProxyFileInsertScriptCfg.java | 48 ++ .../ProxyFileInsertScriptCfgAudit.java | 89 ++++ .../domain/callback/ProxyFileStrategyCfg.java | 9 + .../callback/ProxyFileStrategyCfgAudit.java | 97 ++++ .../callback/ProxyFileTrafficMirrorCfg.java | 46 ++ .../ProxyFileTrafficMirrorCfgAudit.java | 89 ++++ .../nis/web/controller/BaseController.java | 210 ++++++++- .../proxy/FileHijackController.java | 255 +++++++++++ .../proxy/FileInsertScriptController.java | 248 +++++++++++ .../proxy/FileStrategyController.java | 83 +++- .../proxy/FileTrafficMirrorController.java | 240 ++++++++++ .../dao/configuration/ProxyFileHijackDao.java | 27 ++ .../dao/configuration/ProxyFileHijackDao.xml | 313 +++++++++++++ .../ProxyFileInsertScriptDao.java | 30 ++ .../ProxyFileInsertScriptDao.xml | 307 +++++++++++++ .../configuration/ProxyFileStrategyDao.xml | 43 +- .../ProxyFileTrafficMirrorDao.java | 19 + .../ProxyFileTrafficMirrorDao.xml | 309 +++++++++++++ .../java/com/nis/web/service/BaseService.java | 72 +++ .../configuration/CommonPolicyService.java | 80 ++++ .../configuration/ProxyFileHijackService.java | 157 +++++++ .../ProxyFileInsertScriptService.java | 156 +++++++ .../ProxyFileStrategyService.java | 31 +- .../ProxyFileTrafficMirrorService.java | 151 +++++++ .../resources/messages/message_en.properties | 16 +- .../resources/messages/message_ru.properties | 15 +- .../messages/message_zh_CN.properties | 15 +- src/main/resources/service/service_config.xml | 5 +- src/main/resources/sql/20190521/add_menu.sql | 14 + src/main/webapp/WEB-INF/tags/sys/delRow.tag | 19 + .../views/cfg/proxy/fileHijack/form.jsp | 235 ++++++++++ .../views/cfg/proxy/fileHijack/list.jsp | 414 +++++++++++++++++ .../views/cfg/proxy/fileInsertScript/form.jsp | 233 ++++++++++ .../views/cfg/proxy/fileInsertScript/list.jsp | 412 +++++++++++++++++ .../views/cfg/proxy/fileStrategy/form.jsp | 107 ++++- .../cfg/proxy/fileTrafficMirror/form.jsp | 239 ++++++++++ .../cfg/proxy/fileTrafficMirror/list.jsp | 419 ++++++++++++++++++ .../1.11.0/localization/messages_en.js | 205 ++++----- .../1.11.0/localization/messages_ru.js | 205 ++++----- .../1.11.0/localization/messages_zh.js | 205 ++++----- .../webapp/static/global/scripts/common.js | 23 + 43 files changed, 5694 insertions(+), 362 deletions(-) create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileHijackCfg.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfg.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfg.java create mode 100644 src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java create mode 100644 src/main/java/com/nis/web/controller/configuration/proxy/FileHijackController.java create mode 100644 src/main/java/com/nis/web/controller/configuration/proxy/FileInsertScriptController.java create mode 100644 src/main/java/com/nis/web/controller/configuration/proxy/FileTrafficMirrorController.java create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.java create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.java create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.java create mode 100644 src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml create mode 100644 src/main/java/com/nis/web/service/configuration/ProxyFileHijackService.java create mode 100644 src/main/java/com/nis/web/service/configuration/ProxyFileInsertScriptService.java create mode 100644 src/main/java/com/nis/web/service/configuration/ProxyFileTrafficMirrorService.java create mode 100644 src/main/resources/sql/20190521/add_menu.sql create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/list.jsp diff --git a/src/main/java/com/nis/domain/callback/ProxyFileHijackCfg.java b/src/main/java/com/nis/domain/callback/ProxyFileHijackCfg.java new file mode 100644 index 000000000..3c3b1d848 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileHijackCfg.java @@ -0,0 +1,61 @@ +package com.nis.domain.callback; + +import com.nis.domain.configuration.BaseCfg; +import com.nis.util.excel.ExcelField; + +/** + * http代理劫持文件 + * @author lenovo + * + */ +public class ProxyFileHijackCfg extends BaseCfg{ + + private static final long serialVersionUID = -4600604393808056286L; + public String indexTable = "pxy_profile_hijack_files";//对应表名 + @ExcelField(title="profile_name",sort=1) + private String profileName;//名称,辅助记忆 + @ExcelField(title="content_type",sort=3) + private String contentType;//填充HTTP content-type,如“video/mp4” (exe、apk) + @ExcelField(title="path",sort=2) + private String path;//储存路径 + @ExcelField(title="content_name",sort=3) + private String contentName;//内容格式 + private int quote;//判断与其他菜单是否关联使用中 + + public String getContentName() { + return contentName; + } + public void setContentName(String contentName) { + this.contentName = contentName; + } + public int getQuote() { + return quote; + } + public void setQuote(int quote) { + this.quote = quote; + } + public String getIndexTable() { + return indexTable; + } + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + public String getContentType() { + return contentType; + } + public void setContentType(String contentType) { + this.contentType = contentType; + } + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java new file mode 100644 index 000000000..670a752bc --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileHijackCfgAudit.java @@ -0,0 +1,105 @@ +package com.nis.domain.callback; + +import java.util.Date; + +import com.google.gson.annotations.Expose; + +public class ProxyFileHijackCfgAudit { + + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Integer profileId;//compileId + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private String profileName; + @Expose + private String contentType; + @Expose + private String path; + @Expose + private String contentName; + + public String getContentName() { + return contentName; + } + + public void setContentName(String contentName) { + this.contentName = contentName; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public Long getId() { + return id; + } + + public Integer getProfileId() { + return profileId; + } + + public void setProfileId(Integer profileId) { + this.profileId = profileId; + } + + public void setId(Long id) { + this.id = id; + } + public Integer getCfgId() { + return cfgId; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } + public Integer getAction() { + return action; + } + public void setAction(Integer action) { + this.action = action; + } + public Integer getService() { + return service; + } + public void setService(Integer service) { + this.service = service; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getOpTime() { + return opTime; + } + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + public String getContentType() { + return contentType; + } + public void setContentType(String contentType) { + this.contentType = contentType; + } +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfg.java b/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfg.java new file mode 100644 index 000000000..0f8b22203 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfg.java @@ -0,0 +1,48 @@ +package com.nis.domain.callback; + +import com.nis.domain.configuration.BaseCfg; +import com.nis.util.excel.ExcelField; + +public class ProxyFileInsertScriptCfg extends BaseCfg{ + + private static final long serialVersionUID = 4705202662940705064L; + public String indexTable = "pxy_profile_insert_scripts";//对应表名 + @ExcelField(title="profile_name",sort=1) + private String profileName;//名称,辅助记忆 + @ExcelField(title="format ",sort=3) + private String format;//css/js + @ExcelField(title="path",sort=2) + private String path;//储存路径 + private int quote;//判断与其他菜单是否关联使用中 + + public int getQuote() { + return quote; + } + public void setQuote(int quote) { + this.quote = quote; + } + public String getIndexTable() { + return indexTable; + } + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + public String getFormat() { + return format; + } + public void setFormat(String format) { + this.format = format; + } + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java new file mode 100644 index 000000000..87e5a0128 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileInsertScriptCfgAudit.java @@ -0,0 +1,89 @@ +package com.nis.domain.callback; + +import java.util.Date; + +import com.google.gson.annotations.Expose; + +public class ProxyFileInsertScriptCfgAudit { + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Integer profileId;//compileId + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private String profileName; + @Expose + private String format; + @Expose + private String path; + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public Integer getCfgId() { + return cfgId; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } + public Integer getProfileId() { + return profileId; + } + public void setProfileId(Integer profileId) { + this.profileId = profileId; + } + public Integer getAction() { + return action; + } + public void setAction(Integer action) { + this.action = action; + } + public Integer getService() { + return service; + } + public void setService(Integer service) { + this.service = service; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getOpTime() { + return opTime; + } + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + public String getFormat() { + return format; + } + public void setFormat(String format) { + this.format = format; + } + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } + +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfg.java b/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfg.java index 06c6d0ad6..10f128e47 100644 --- a/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfg.java +++ b/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfg.java @@ -9,12 +9,21 @@ import com.nis.domain.configuration.BaseCfg; public class ProxyFileStrategyCfg extends BaseCfg { private static final long serialVersionUID = 4283944377949702481L; public final static String TABLE_NAME = "PROXY_FILE_STRATEGY_CFG";//对应表名 + private String indexTable = "proxy_file_strategy_cfg"; private String fileDesc;//文件描述 private String url;//文件保存的url private String contentType;//内容类型,如text/html,取字典表contentType private String md5;//文件md5值 private Long contentLength;//文件长度 + public String getIndexTable() { + return indexTable; + } + + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + public ProxyFileStrategyCfg() { super(); } diff --git a/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java new file mode 100644 index 000000000..f5b5d7144 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileStrategyCfgAudit.java @@ -0,0 +1,97 @@ +package com.nis.domain.callback; + +import java.util.Date; + +import com.google.gson.annotations.Expose; + +public class ProxyFileStrategyCfgAudit { + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private String contentType; + @Expose + private Long contentLength; + @Expose + private String filePath; + @Expose + private Long fileId; + @Expose + private String fileDesc; + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public Integer getCfgId() { + return cfgId; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } + public Integer getAction() { + return action; + } + public void setAction(Integer action) { + this.action = action; + } + public Integer getService() { + return service; + } + public void setService(Integer service) { + this.service = service; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getOpTime() { + return opTime; + } + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public String getContentType() { + return contentType; + } + public void setContentType(String contentType) { + this.contentType = contentType; + } + public Long getContentLength() { + return contentLength; + } + public void setContentLength(Long contentLength) { + this.contentLength = contentLength; + } + public String getFilePath() { + return filePath; + } + public void setFilePath(String filePath) { + this.filePath = filePath; + } + public Long getFileId() { + return fileId; + } + public void setFileId(Long fileId) { + this.fileId = fileId; + } + public String getFileDesc() { + return fileDesc; + } + public void setFileDesc(String fileDesc) { + this.fileDesc = fileDesc; + } + +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfg.java b/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfg.java new file mode 100644 index 000000000..567fa1bd0 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfg.java @@ -0,0 +1,46 @@ +package com.nis.domain.callback; + + +import java.util.Arrays; + +import com.nis.domain.configuration.BaseCfg; +import com.nis.util.excel.ExcelField; + +import antlr.collections.List; + +public class ProxyFileTrafficMirrorCfg extends BaseCfg{ + + private static final long serialVersionUID = -5895958073449509268L; + public String indexTable = "pxy_profile_traffic_mirror";//对应表名 + @ExcelField(title="profile_name",sort=1) + private String profileName;//名称,辅助记忆 + @ExcelField(title="addr_list",sort=2) + private String addrList;//目标表示列表 + @ExcelField(title="addr_type",sort=3) + private String addrType;//目标表示类型 + + public String getAddrList() { + return addrList; + } + public void setAddrList(String addrList) { + this.addrList = addrList; + } + public String getIndexTable() { + return indexTable; + } + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + public String getAddrType() { + return addrType; + } + public void setAddrType(String addrType) { + this.addrType = addrType; + } +} diff --git a/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java b/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java new file mode 100644 index 000000000..cbafbec67 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyFileTrafficMirrorCfgAudit.java @@ -0,0 +1,89 @@ +package com.nis.domain.callback; + +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.Expose; + +public class ProxyFileTrafficMirrorCfgAudit { + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Integer profileId;//compileId + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private String profileName; + @Expose + private List addrList; + @Expose + private String addrType; + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public Integer getCfgId() { + return cfgId; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } + public Integer getProfileId() { + return profileId; + } + public void setProfileId(Integer profileId) { + this.profileId = profileId; + } + public Integer getAction() { + return action; + } + public void setAction(Integer action) { + this.action = action; + } + public Integer getService() { + return service; + } + public void setService(Integer service) { + this.service = service; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getOpTime() { + return opTime; + } + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public String getProfileName() { + return profileName; + } + public void setProfileName(String profileName) { + this.profileName = profileName; + } + public String getAddrType() { + return addrType; + } + public void setAddrType(String addrType) { + this.addrType = addrType; + } + public List getAddrList() { + return addrList; + } + public void setAddrList(List addrList) { + this.addrList = addrList; + } +} diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 4b1786748..bb4d32f6d 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -19,8 +19,10 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -48,6 +50,10 @@ import com.nis.domain.basics.AsnGroupInfo; import com.nis.domain.basics.AsnIpCfg; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.basics.SysDictInfo; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.callback.ProxyFileStrategyCfg; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; import com.nis.domain.configuration.AppComplexFeatureCfg; import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppFeatureIndex; @@ -183,7 +189,10 @@ import com.nis.web.service.configuration.IpCfgService; import com.nis.web.service.configuration.IpMultiplexPoolCfgService; import com.nis.web.service.configuration.MailCfgService; import com.nis.web.service.configuration.NumCfgService; +import com.nis.web.service.configuration.ProxyFileHijackService; +import com.nis.web.service.configuration.ProxyFileInsertScriptService; import com.nis.web.service.configuration.ProxyFileStrategyService; +import com.nis.web.service.configuration.ProxyFileTrafficMirrorService; import com.nis.web.service.configuration.PxyObjKeyringService; import com.nis.web.service.configuration.PxyObjSpoofingIpPoolService; import com.nis.web.service.configuration.RequestInfoService; @@ -299,6 +308,12 @@ public class BaseController { @Autowired protected PxyObjKeyringService pxyObjKeyringService;// 拦截策略service @Autowired + protected ProxyFileHijackService proxyFileHijackService;// 劫持文件service + @Autowired + protected ProxyFileInsertScriptService proxyFileInsertScriptService;//注入脚本文件service + @Autowired + protected ProxyFileTrafficMirrorService proxyFileTrafficMirrorService;//注入流量镜像文件ervice + @Autowired protected AppBuiltInFeatureService appBuiltInFeatureService;// 拦截策略service @Autowired protected AsnIpCfgService asnIpCfgService;// asn ip service @@ -2667,6 +2682,10 @@ public class BaseController { AppFeatureIndex searchAppFeatureIndex=new AppFeatureIndex(); AppSslCertCfg searchAppSslCertCfg=new AppSslCertCfg(); AsnIpCfg searchAsnIpCfg=new AsnIpCfg(); + ProxyFileHijackCfg searFileHijackCfg = new ProxyFileHijackCfg(); + ProxyFileInsertScriptCfg searFileInsertScriptCfg = new ProxyFileInsertScriptCfg(); + ProxyFileTrafficMirrorCfg searFileTrafficMirrorCfg = new ProxyFileTrafficMirrorCfg(); + ProxyFileStrategyCfg searFileStrategyCfg = new ProxyFileStrategyCfg(); if(entity != null && (entity instanceof CfgIndexInfo)) { BeanUtils.copyProperties(entity, auditBatchCfg); BeanUtils.copyProperties(entity, searchCfg); @@ -2743,8 +2762,21 @@ public class BaseController { if(entity != null && (entity instanceof AsnIpCfg)) { BeanUtils.copyProperties(entity, auditBatchCfg); BeanUtils.copyProperties(entity, searchAsnIpCfg); + }if(entity != null && (entity instanceof ProxyFileHijackCfg)){ + BeanUtils.copyProperties(entity, auditBatchCfg); + BeanUtils.copyProperties(entity, searFileHijackCfg); + }if(entity != null && (entity instanceof ProxyFileInsertScriptCfg)){ + BeanUtils.copyProperties(entity, auditBatchCfg); + BeanUtils.copyProperties(entity, searFileInsertScriptCfg); + }if(entity != null && (entity instanceof ProxyFileTrafficMirrorCfg)){ + BeanUtils.copyProperties(entity, auditBatchCfg); + BeanUtils.copyProperties(entity, searFileTrafficMirrorCfg); + }if(entity != null && (entity instanceof ProxyFileStrategyCfg)){ + BeanUtils.copyProperties(entity, auditBatchCfg); + BeanUtils.copyProperties(entity, searFileStrategyCfg); } + auditType = (Integer)Reflections.invokeGetter(entity, "isAudit"); //全部审核通过,只查询当前条件下的所有未审核的配置 -批量审核通过/不通过 @@ -2815,6 +2847,14 @@ public class BaseController { searchAppFeatureIndex.setTableName(tableNameXml); searchAppSslCertCfg.setServiceId(Integer.valueOf(serviceIdXml)); searchAppSslCertCfg.setTableName(tableNameXml); + searFileHijackCfg.setServiceId(Integer.valueOf(serviceIdXml)); + searFileHijackCfg.setTableName(tableNameXml); + searFileInsertScriptCfg.setServiceId(Integer.valueOf(serviceIdXml)); + searFileInsertScriptCfg.setTableName(tableNameXml); + searFileTrafficMirrorCfg.setServiceId(Integer.valueOf(serviceIdXml)); + searFileTrafficMirrorCfg.setTableName(tableNameXml); + searFileStrategyCfg.setServiceId(Integer.valueOf(serviceIdXml)); + searFileStrategyCfg.setTableName(tableNameXml); if("1".equals(serviceTypeXml)){//maat类配置 // 存放域配置类型 及 对应表名 @@ -3210,7 +3250,11 @@ public class BaseController { , searchDnsResStrategy , searchDnsIpCfg , searchIpPortCfg - , searchSignSampleCfg); + , searchSignSampleCfg + , searFileHijackCfg + , searFileInsertScriptCfg + , searFileTrafficMirrorCfg + , searFileStrategyCfg); } } } @@ -3290,6 +3334,10 @@ public class BaseController { PxyObjKeyring searchObjKeyringCfg=new PxyObjKeyring(); PxyObjTrustedCaCert searchTrustedCaCertCfg=new PxyObjTrustedCaCert(); AsnIpCfg searchAsnIpCfg=new AsnIpCfg(); + ProxyFileHijackCfg searchFileHijackCfg = new ProxyFileHijackCfg(); + ProxyFileInsertScriptCfg searchFileInsertScriptCfg = new ProxyFileInsertScriptCfg(); + ProxyFileTrafficMirrorCfg searchFileTrafficMirrorCfg = new ProxyFileTrafficMirrorCfg(); + ProxyFileStrategyCfg searchFileStrategyCfg = new ProxyFileStrategyCfg(); // 传递检索条件 if(entity != null && (entity instanceof CfgIndexInfo)) { @@ -3360,6 +3408,19 @@ public class BaseController { BeanUtils.copyProperties(entity, searchAsnIpCfg); searchAsnIpCfg.setFunctionId(functionId); } + if(entity != null && (entity instanceof ProxyFileHijackCfg)){ + BeanUtils.copyProperties(entity, searchFileHijackCfg); + searchFileHijackCfg.setFunctionId(functionId); + }if(entity != null && (entity instanceof ProxyFileInsertScriptCfg)){ + BeanUtils.copyProperties(entity, searchFileInsertScriptCfg); + searchFileInsertScriptCfg.setFunctionId(functionId); + }if(entity != null && (entity instanceof ProxyFileTrafficMirrorCfg)){ + BeanUtils.copyProperties(entity, searchFileTrafficMirrorCfg); + searchFileTrafficMirrorCfg.setFunctionId(functionId); + }if(entity != null && (entity instanceof ProxyFileStrategyCfg)){ + BeanUtils.copyProperties(entity, searchFileStrategyCfg); + searchFileStrategyCfg.setFunctionId(functionId); + } BaseCfg batchCfg = new BaseCfg(); batchCfg.setIsValid(-1); @@ -3569,6 +3630,71 @@ public class BaseController { } } + }else if("pxy_profile_hijack_files".equals(tableNameXml)) { + boolean hasData = true; + while(hasData){ + page.setPageNo(1); + page.setLastPage(false); + List list = proxyFileHijackService.findPage(page, searchFileHijackCfg).getList(); + List result = new ArrayList(); + for(int i=0;i result = new ArrayList(); + for(int i=0;i configCompileList; @@ -3792,6 +3922,82 @@ public class BaseController { notAuditList.add(cfg); } } + }else if(className.equals("ProxyFileTrafficMirrorCfg")){ + list = proxyFileTrafficMirrorService.findPage(page, searFileTrafficMirrorCfg).getList(); + for(int i=0;i page = proxyFileHijackService.findPage(new Page(request, response,"a"), cfg); + model.addAttribute("page", page); + model.addAttribute("cfg", cfg); + initPageCondition(model); + return "/cfg/proxy/fileHijack/list"; + } + + @RequestMapping(value = {"form"}) + @RequiresPermissions(value={"proxy:fileHijack:config"}) + public String fileform(Model model,HttpServletRequest request + ,HttpServletResponse response + ,@ModelAttribute("cfg")ProxyFileHijackCfg cfg + ,String ids + ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + cfg = proxyFileHijackService.getCfgById(Long.valueOf(ids)); + } + //初始化各字典 + initFormCondition(model, cfg); + model.addAttribute("_cfg", cfg); + return "/cfg/proxy/fileHijack/form"; + } + + @RequiresPermissions(value={"proxy:fileHijack:config"}) + @RequestMapping(value = {"saveOrUpdate"}) + public String saveOrUpdate(Model model,HttpServletRequest request + ,HttpServletResponse response,MultipartFile cfgFile, + @ModelAttribute("cfg")ProxyFileHijackCfg cfg, + RedirectAttributes redirectAttributes){ + File file = null; + try{ + if(cfgFile != null) { + String filename = cfgFile.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_" + prefix, suffix); + cfgFile.transferTo(file);// 复制文件 + String md5 = FileUtils.getFileMD5(file); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");// 源文件存入数据中心 + srcMap.put("createTime", new Date()); + srcMap.put("key", prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); + logger.info("proxy 劫持文件 上传响应信息:" + JsonMapper.toJsonString(result)); + String path = null; + if (!StringUtil.isEmpty(result)) { + ResponseData data = result.getData(); + path = data.getAccessUrl(); + cfg.setPath(path); + } + } + proxyFileHijackService.saveOrUpdate(cfg); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } + }catch(Exception e){ + logger.error("信息保存失败",e); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes,"error","request_service_failed"); + LogUtils.saveLog(request, null, e, null); + }else { + addMessage(redirectAttributes,"error","save_failed"); + LogUtils.saveLog(request, null, e, null); + } + }finally { + if(file != null) { + file.delete();//删除临时文件 + } + } + return "redirect:" + adminPath +"/proxy/fileHijack/list?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"delete"}) + @RequiresPermissions(value={"proxy:fileStrategy:config"}) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileHijackCfg cfg, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){ + try { + if (!StringUtil.isEmpty(ids)) { + proxyFileHijackService.update(isAudit, isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); + }else { + // 批量删除 + Page searchPage = new Page(request, response, "a"); + deleteAll(searchPage, functionId, cfg); + } + } catch (Exception e) { + logger.error("配置删除失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "delete_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + return "redirect:" + adminPath +"/proxy/fileHijack/list?functionId="+functionId; + } + + @RequestMapping(value = {"audit"}) + @RequiresPermissions(value={"proxy:fileHijack:confirm"}) + public String audit(Model model, @ModelAttribute("cfg") ProxyFileHijackCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + String[] idArray = ids.split(","); + for (String id : idArray) { + try { + proxyFileHijackService.audit(isAudit, isValid, functionId, id); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (MaatConvertException e) { + logger.error(e); + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } catch (Exception e) { + logger.error(e); + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + } + + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); + + try { + BeanUtils.copyProperties(searchPage, auditPage); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + + return fileHijackList(cfg, model, request, response); + } + + return "redirect:" + adminPath +"/proxy/fileHijack/list?functionId="+functionId; + } + + @RequestMapping(value = "exportFileHijack") + public void exportPxy(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") ProxyFileHijackCfg entity, String ids, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = proxyFileHijackService.findByList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = proxyFileHijackService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + for (int i = 0; i < ipLists.size(); i++) { + ipLists.get(i).setProfileName(ipLists.get(i).getCfgDesc()); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), ProxyFileHijackCfg.class); + String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("proxyFileHijack export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + LogUtils.saveLog(request, null, e, null); + } + } +} diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/FileInsertScriptController.java b/src/main/java/com/nis/web/controller/configuration/proxy/FileInsertScriptController.java new file mode 100644 index 000000000..6535b8819 --- /dev/null +++ b/src/main/java/com/nis/web/controller/configuration/proxy/FileInsertScriptController.java @@ -0,0 +1,248 @@ +package com.nis.web.controller.configuration.proxy; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.beanutils.BeanUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import com.google.common.collect.Maps; +import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.maat.ToMaatResult.ResponseData; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; +import com.nis.util.FileUtils; +import com.nis.util.JsonMapper; +import com.nis.util.LogUtils; +import com.nis.util.StringUtil; +import com.nis.web.controller.configuration.CommonController; +@Controller +@RequestMapping("${adminPath}/proxy/fileInsertScript") +public class FileInsertScriptController extends CommonController{ + + @RequestMapping(value = {"list"}) + public String fileInsertScriptList(ProxyFileInsertScriptCfg cfg,Model model,HttpServletRequest request,HttpServletResponse response) { + Page page = proxyFileInsertScriptService.findPage(new Page(request, response,"a"), cfg); + model.addAttribute("page", page); + model.addAttribute("cfg", cfg); + initPageCondition(model); + return "/cfg/proxy/fileInsertScript/list"; + } + + @RequestMapping(value = {"form"}) + @RequiresPermissions(value={"proxy:fileInsertScript:config"}) + public String fileform(Model model,HttpServletRequest request + ,HttpServletResponse response + ,@ModelAttribute("cfg")ProxyFileInsertScriptCfg cfg + ,String ids + ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + cfg = proxyFileInsertScriptService.getCfgById(Long.valueOf(ids)); + } + initFormCondition(model, cfg); + model.addAttribute("_cfg", cfg); + return "/cfg/proxy/fileInsertScript/form"; + } + + @RequiresPermissions(value={"proxy:fileInsertScript:config"}) + @RequestMapping(value = {"saveOrUpdate"}) + public String saveOrUpdate(Model model,HttpServletRequest request + ,HttpServletResponse response,MultipartFile cfgFile, + @ModelAttribute("cfg")ProxyFileInsertScriptCfg cfg, + RedirectAttributes redirectAttributes){ + File file = null; + try{ + if(cfgFile != null) { + String filename = cfgFile.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_"+ prefix, suffix); + cfgFile.transferTo(file);//复制文件 + String md5 = FileUtils.getFileMD5(file); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");//源文件存入数据中心 + srcMap.put("createTime",new Date()); + srcMap.put("key",prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); + logger.info("注入脚本文件上传响应信息:"+JsonMapper.toJsonString(result)); + String srcAccessUrl = null; + if(!StringUtil.isEmpty(result)){ + ResponseData data = result.getData(); + srcAccessUrl=data.getAccessUrl(); + cfg.setPath(srcAccessUrl); + } + } + proxyFileInsertScriptService.saveOrUpdate(cfg); + addMessage(redirectAttributes,"success","save_success"); + }catch(Exception e){ + logger.error("信息保存失败",e); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes,"error","request_service_failed"); + LogUtils.saveLog(request, null, e, null); + }else { + addMessage(redirectAttributes,"error","save_failed"); + LogUtils.saveLog(request, null, e, null); + } + }finally { + if(file != null) { + file.delete();//删除临时文件 + } + } + return "redirect:" + adminPath +"/proxy/fileInsertScript/list?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"audit"}) + @RequiresPermissions(value={"proxy:fileInsertScript:confirm"}) + public String audit(Model model, @ModelAttribute("cfg") ProxyFileInsertScriptCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + String[] idArray = ids.split(","); + for (String id : idArray) { + try { + proxyFileInsertScriptService.audit(isAudit, isValid, functionId, id); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (MaatConvertException e) { + logger.error(e); + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } catch (Exception e) { + logger.error(e); + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + } + + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); + + try { + BeanUtils.copyProperties(searchPage, auditPage); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("批量配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + + return fileInsertScriptList(cfg, model, request, response); + } + + return "redirect:" + adminPath +"/proxy/fileInsertScript/list?functionId="+functionId; + } + + @RequestMapping(value = {"delete"}) + @RequiresPermissions(value={"proxy:fileInsertScript:config"}) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileInsertScriptCfg cfg, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){ + try { + if (!StringUtil.isEmpty(ids)) { + proxyFileInsertScriptService.delete(isAudit, isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); + }else { + // 批量删除 + Page searchPage = new Page(request, response, "a"); + deleteAll(searchPage, functionId, cfg); + } + } catch (Exception e) { + logger.error("配置删除失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "delete_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + return "redirect:" + adminPath +"/proxy/fileInsertScript/list?functionId="+functionId; + } + + @RequestMapping(value = "exportFileInsertScript") + public void exportFileHijack(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") ProxyFileInsertScriptCfg entity, String ids, RedirectAttributes redirectAttributes){ + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = proxyFileInsertScriptService.findByList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = proxyFileInsertScriptService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + for (int i = 0; i < ipLists.size(); i++) { + ipLists.get(i).setProfileName(ipLists.get(i).getCfgDesc()); + } + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), ProxyFileInsertScriptCfg.class); + String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("proxyFileInsertScript export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + LogUtils.saveLog(request, null, e, null); + } + } +} diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/FileStrategyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/FileStrategyController.java index 3cbdc2dee..dd1785c33 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/FileStrategyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/FileStrategyController.java @@ -15,6 +15,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.beanutils.BeanUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -25,6 +26,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.common.collect.Maps; import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileHijackCfg; import com.nis.domain.callback.ProxyFileStrategyCfg; import com.nis.domain.maat.ToMaatResult; import com.nis.domain.maat.ToMaatResult.ResponseData; @@ -118,6 +120,13 @@ public class FileStrategyController extends CommonController { cfg.setContentLength(file.length());//文件长度 } proxyFileStrategyService.saveOrUpdate(cfg); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } addMessage(redirectAttributes,"success","save_success"); }catch(Exception e){ logger.error("信息保存失败",e); @@ -133,27 +142,81 @@ public class FileStrategyController extends CommonController { file.delete();//删除临时文件 } } + return "redirect:" + adminPath +"/proxy/fileStrategy/list?functionId="+cfg.getFunctionId(); } @RequestMapping(value = {"delete"}) @RequiresPermissions(value={"proxy:fileStrategy:config"}) - public String delete(Integer isAudit,Integer isValid, - String ids, - Integer functionId, - RedirectAttributes redirectAttributes){ - proxyFileStrategyService.update(isAudit,isValid,ids,functionId); + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileStrategyCfg cfg, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){ + try { + if (!StringUtil.isEmpty(ids)) { + proxyFileStrategyService.update(isAudit, isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); + }else { + // 批量删除 + Page searchPage = new Page(request, response, "a"); + deleteAll(searchPage, functionId, cfg); + } + } catch (Exception e) { + logger.error("配置删除失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "delete_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } return "redirect:" + adminPath +"/proxy/fileStrategy/list?functionId="+functionId; } @RequestMapping(value = {"audit"}) @RequiresPermissions(value={"proxy:fileStrategy:confirm"}) - public String audit(Integer isAudit,Integer isValid,String ids - ,Integer functionId, RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(ids)){ - proxyFileStrategyService.audit(isAudit, isValid, functionId, ids); - addMessage(redirectAttributes,"success", "audit_success"); + public String audit(Model model, @ModelAttribute("cfg") ProxyFileStrategyCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + String[] idArray = ids.split(","); + for (String id : idArray) { + try { + proxyFileStrategyService.audit(isAudit, isValid, functionId, id); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (MaatConvertException e) { + logger.error(e); + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } catch (Exception e) { + logger.error(e); + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + } + + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); + + try { + BeanUtils.copyProperties(searchPage, auditPage); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + + return fileStrategyList(cfg, model, request, response); } return "redirect:" + adminPath +"/proxy/fileStrategy/list?functionId="+functionId; } diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/FileTrafficMirrorController.java b/src/main/java/com/nis/web/controller/configuration/proxy/FileTrafficMirrorController.java new file mode 100644 index 000000000..da859f89f --- /dev/null +++ b/src/main/java/com/nis/web/controller/configuration/proxy/FileTrafficMirrorController.java @@ -0,0 +1,240 @@ +package com.nis.web.controller.configuration.proxy; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.beanutils.BeanUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import com.google.common.collect.Maps; +import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; +import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.maat.ToMaatResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; +import com.nis.util.FileUtils; +import com.nis.util.JsonMapper; +import com.nis.util.LogUtils; +import com.nis.util.StringUtil; +import com.nis.web.controller.configuration.CommonController; + +@Controller +@RequestMapping("${adminPath}/proxy/fileTrafficMirror") +public class FileTrafficMirrorController extends CommonController { + @RequestMapping(value = {"list"}) + public String fileTrafficMirrorList(ProxyFileTrafficMirrorCfg cfg,Model model,HttpServletRequest request,HttpServletResponse response) { + Page page = proxyFileTrafficMirrorService.findPage(new Page(request, response,"a"), cfg); + model.addAttribute("page", page); + model.addAttribute("cfg", cfg); + initPageCondition(model); + return "/cfg/proxy/fileTrafficMirror/list"; + } + + @RequestMapping(value = {"form"}) + @RequiresPermissions(value={"proxy:fileTrafficMirror:config"}) + public String fileform(Model model,HttpServletRequest request + ,HttpServletResponse response + ,@ModelAttribute("cfg")ProxyFileTrafficMirrorCfg cfg + ,String ids + ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + cfg = proxyFileTrafficMirrorService.getCfgById(Long.valueOf(ids)); + } + initFormCondition(model, cfg); + model.addAttribute("_cfg", cfg); + return "/cfg/proxy/fileTrafficMirror/form"; + } + + @RequiresPermissions(value={"proxy:fileTrafficMirror:config"}) + @RequestMapping(value = {"saveOrUpdate"}) + public String saveOrUpdate(Model model,HttpServletRequest request + ,HttpServletResponse response,MultipartFile cfgFile, + @ModelAttribute("cfg")ProxyFileTrafficMirrorCfg cfg, + RedirectAttributes redirectAttributes){ + File file = null; + try{ + if(cfgFile != null) { + String filename = cfgFile.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_"+ prefix, suffix); + cfgFile.transferTo(file);//复制文件 + String md5 = FileUtils.getFileMD5(file); + Map srcMap = Maps.newHashMap(); + srcMap.put("filetype", suffix); + srcMap.put("datatype", "dbSystem");//源文件存入数据中心 + srcMap.put("createTime",new Date()); + srcMap.put("key",prefix); + srcMap.put("fileName", filename); + srcMap.put("checksum", md5); + ToMaatResult result = ConfigServiceUtil.postFileCfg(null, file, JsonMapper.toJsonString(srcMap)); + logger.info("注入脚本文件上传响应信息:"+JsonMapper.toJsonString(result)); + } + proxyFileTrafficMirrorService.saveOrUpdate(cfg); + addMessage(redirectAttributes,"success","save_success"); + }catch(Exception e){ + logger.error("信息保存失败",e); + if(e instanceof MaatConvertException) { + addMessage(redirectAttributes,"error","request_service_failed"); + LogUtils.saveLog(request, null, e, null); + }else { + addMessage(redirectAttributes,"error","save_failed"); + LogUtils.saveLog(request, null, e, null); + } + }finally { + if(file != null) { + file.delete();//删除临时文件 + } + } + return "redirect:" + adminPath +"/proxy/fileTrafficMirror/list?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"audit"}) + @RequiresPermissions(value={"proxy:fileTrafficMirror:confirm"}) + public String audit(Model model, @ModelAttribute("cfg") ProxyFileTrafficMirrorCfg cfg, Integer isValid, Integer isAudit, + String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response, + HttpServletRequest request) { + if (!StringUtil.isEmpty(ids)) { + String[] idArray = ids.split(","); + for (String id : idArray) { + try { + proxyFileTrafficMirrorService.audit(isAudit, isValid, functionId, id); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (MaatConvertException e) { + logger.error(e); + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } catch (Exception e) { + logger.error(e); + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + } + + } else { + Page searchPage = new Page(request, response, "a"); + Page auditPage = new Page(request, response, "a"); + + try { + BeanUtils.copyProperties(searchPage, auditPage); + auditAll(auditPage, isValid, cfg); + addMessage(redirectAttributes, "success", "audit_success"); + } catch (Exception e) { + logger.error("批量配置下发失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "audit_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + + return fileTrafficMirrorList(cfg, model, request, response); + } + + return "redirect:" + adminPath +"/proxy/fileTrafficMirror/list?functionId="+functionId; + } + + @RequestMapping(value = {"delete"}) + @RequiresPermissions(value={"proxy:fileTrafficMirror:config"}) + public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileTrafficMirrorCfg cfg, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){ + try { + if (!StringUtil.isEmpty(ids)) { + proxyFileTrafficMirrorService.delete(isAudit, isValid, ids, functionId); + addMessage(redirectAttributes, "success", "delete_success"); + }else { + // 批量删除 + Page searchPage = new Page(request, response, "d"); + deleteAll(searchPage, functionId, cfg); + } + } catch (Exception e) { + logger.error("配置删除失败:", e); + if (e instanceof MaatConvertException) { + addMessage(redirectAttributes, "error", "request_service_failed"); + LogUtils.saveLog(request, null, e, null); + } else { + addMessage(redirectAttributes, "error", "delete_failed"); + LogUtils.saveLog(request, null, e, null); + } + + } + return "redirect:" + adminPath +"/proxy/fileTrafficMirror/list?functionId="+functionId; + } + + @RequestMapping(value = "exportFileTrafficMirror") + public void exportFileHijack(Model model, HttpServletRequest request, HttpServletResponse response, + @ModelAttribute("cfg") ProxyFileTrafficMirrorCfg entity, String ids, RedirectAttributes redirectAttributes){ + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + List ipLists = new ArrayList(); + // 导出选中记录 + if (!StringUtil.isEmpty(ids)) { + ipLists = proxyFileTrafficMirrorService.findByList(ids); + } else { + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo = new Page(request, response, "r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = proxyFileTrafficMirrorService.findPage(pageInfo, entity); + ipLists = page.getList(); + } + + titleList.add(entity.getMenuNameCode()); + classMap.put(entity.getMenuNameCode(), ProxyFileTrafficMirrorCfg.class); + String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + + // 时间过滤 + if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) { + cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) { + cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport; + } + if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) { + cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport; + } + if (!StringUtil.isEmpty(entity.gethColumns())) { + cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport; + } + + noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport); + dataMap.put(entity.getMenuNameCode(), ipLists); + + String timeRange = initTimeMap(entity); + noExportMap.put("timeRange", timeRange); + if ("csv".equals(entity.getExType())) { + this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList, + classMap, dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("proxyFileTrafficMirror export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + LogUtils.saveLog(request, null, e, null); + } + } +} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.java b/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.java new file mode 100644 index 000000000..a3bbdc050 --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.java @@ -0,0 +1,27 @@ +package com.nis.web.dao.configuration; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; +/** + * 劫持文件处理 + * @author lenovo + * + */ +@MyBatisDao +public interface ProxyFileHijackDao extends CrudDao{ + + public List findPage(ProxyFileHijackCfg entity) ; + + public ProxyFileHijackCfg getCfgById(@Param("cfgId")Long cfgId); + + public int insert(ProxyFileHijackCfg entity); + + public int update(ProxyFileHijackCfg entity); + + List findByList(@Param("ids")String ids); +} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml new file mode 100644 index 000000000..5886a2b8b --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileHijackDao.xml @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a.CFG_ID,a.CFG_DESC,a.ACTION,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_type,a.cfg_region_code, + a.CONTENT_TYPE,a.CONTENT_NAME,a.PATH,a.CANCEL_REQUEST_ID + + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into PXY_PROFILE_HIJACK_FILES ( + 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, + cfg_type, + cfg_region_code, + + path, + content_type, + content_name + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + #{isValid,jdbcType=INTEGER}, + #{isAudit,jdbcType=INTEGER}, + #{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}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + + #{path,jdbcType=VARCHAR}, + #{contentType,jdbcType=VARCHAR}, + #{contentName,jdbcType=VARCHAR} + ) + + + + + update PXY_PROFILE_HIJACK_FILES + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, + + + cfg_type = #{cfgType,jdbcType=VARCHAR}, + + + path = #{path,jdbcType=VARCHAR}, + + + content_type = #{contentType,jdbcType=VARCHAR}, + + + content_name = #{contentName,jdbcType=VARCHAR}, + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.java b/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.java new file mode 100644 index 000000000..21495dc5a --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.java @@ -0,0 +1,30 @@ +package com.nis.web.dao.configuration; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; + +/** + * 注入脚本文件 + * @author lenovo + * + */ +@MyBatisDao +public interface ProxyFileInsertScriptDao extends CrudDao { + + public List findPage(ProxyFileInsertScriptCfg entity); + + public ProxyFileInsertScriptCfg getCfgById(@Param("cfgId")Long cfgId); + + public int insert(ProxyFileInsertScriptCfg entity); + + public int update(ProxyFileInsertScriptCfg entity); + + List findByList(@Param("ids")String ids); +} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml new file mode 100644 index 000000000..285c51c48 --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileInsertScriptDao.xml @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a.CFG_ID,a.CFG_DESC,a.ACTION,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_type,a.cfg_region_code, + a.FORMAT,a.PATH,a.cancel_request_id + + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into PXY_PROFILE_INSERT_SCRIPTS ( + 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, + cfg_type, + cfg_region_code, + + path, + format + )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}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + + #{path,jdbcType=VARCHAR}, + #{format,jdbcType=VARCHAR} + ) + + + + + update PXY_PROFILE_INSERT_SCRIPTS + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, + + + cfg_type = #{cfgType,jdbcType=VARCHAR}, + + + path = #{path ,jdbcType=VARCHAR}, + + + format = #{format ,jdbcType=VARCHAR}, + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml index 1b64e30fb..90757616b 100644 --- a/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileStrategyDao.xml @@ -74,15 +74,33 @@ AND a.ACTION=#{action,jdbcType=INTEGER} - - AND a.IS_VALID=#{isValid,jdbcType=INTEGER} - - - AND a.IS_VALID != -1 - - - AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER} - + + + + AND a.IS_VALID in (${batchValidValue}) + + + + AND a.IS_VALID=#{isValid,jdbcType=INTEGER} + + + AND a.IS_VALID != -1 + + + + + + + + AND a.IS_AUDIT in(${batchAuditValue}) + + + + + AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER} + + + AND a.CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%') @@ -148,6 +166,9 @@ + + SELECT LAST_INSERT_ID() + insert into proxy_file_strategy_cfg ( CFG_DESC, ACTION, @@ -179,8 +200,8 @@ )values ( #{cfgDesc,jdbcType=VARCHAR}, #{action,jdbcType=INTEGER}, - 0, - 0, + #{isValid,jdbcType=INTEGER}, + #{isAudit,jdbcType=INTEGER}, #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{editorId,jdbcType=INTEGER}, diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.java b/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.java new file mode 100644 index 000000000..274e7c59f --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.java @@ -0,0 +1,19 @@ +package com.nis.web.dao.configuration; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface ProxyFileTrafficMirrorDao extends CrudDao{ + + public List findPage(ProxyFileTrafficMirrorCfg entity) ; + + public ProxyFileTrafficMirrorCfg getCfgById(@Param("cfgId")Long cfgId); + + List findByList(@Param("ids")String ids); +} diff --git a/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml b/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml new file mode 100644 index 000000000..097267bd0 --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/ProxyFileTrafficMirrorDao.xml @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a.CFG_ID,a.CFG_DESC,a.ACTION,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_type,a.cfg_region_code, + a.ADDR_LIST,a.ADDR_TYPE,a.CANCEL_REQUEST_ID + + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into PXY_PROFILE_TRAFFIC_MIRROR ( + 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, + cfg_type, + cfg_region_code, + + addr_list, + addr_type + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + #{isValid,jdbcType=INTEGER}, + #{isAudit,jdbcType=INTEGER}, + #{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}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER}, + + #{addrList,jdbcType=VARCHAR}, + #{addrType,jdbcType=VARCHAR} + ) + + + + + update PXY_PROFILE_TRAFFIC_MIRROR + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, + + + cfg_type = #{cfgType,jdbcType=VARCHAR}, + + + addr_list = #{addrList,jdbcType=VARCHAR}, + + + addr_type = #{addrType,jdbcType=VARCHAR}, + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + + \ 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 453a7ba12..10a3f9914 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -9,6 +9,7 @@ import java.nio.charset.Charset; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; @@ -53,6 +54,14 @@ import com.nis.domain.basics.AsnGroupInfo; import com.nis.domain.basics.AsnIpCfg; import com.nis.domain.callback.InlineIp; import com.nis.domain.callback.NtcDnsResStrategy; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileHijackCfgAudit; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit; +import com.nis.domain.callback.ProxyFileStrategyCfg; +import com.nis.domain.callback.ProxyFileStrategyCfgAudit; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfgAudit; import com.nis.domain.callback.ProxyObjKeyring; import com.nis.domain.callback.ProxyObjTrustedCa; import com.nis.domain.configuration.AppComplexFeatureCfg; @@ -3078,5 +3087,68 @@ public abstract class BaseService { } return schedule; } + + //劫持文件 + public static ProxyFileHijackCfgAudit convertCallBackProxyFileHijack(ProxyFileHijackCfg cfg) { + ProxyFileHijackCfgAudit hijackTemp = new ProxyFileHijackCfgAudit(); + hijackTemp.setId(Long.valueOf(cfg.getCompileId())); + hijackTemp.setCfgId(cfg.getCompileId()); + hijackTemp.setProfileId(cfg.getCompileId()); + hijackTemp.setContentType(cfg.getContentType()); + hijackTemp.setContentName(keywordsEscape(cfg.getContentName())); + hijackTemp.setProfileName(keywordsEscape(cfg.getCfgDesc())); + hijackTemp.setPath(cfg.getPath()); + hijackTemp.setAction(cfg.getAction()); + hijackTemp.setService(cfg.getServiceId()); + hijackTemp.setIsValid(cfg.getIsValid()); + hijackTemp.setOpTime(cfg.getAuditTime()); + return hijackTemp; + } + //注入脚本文件 + public static ProxyFileInsertScriptCfgAudit convertCallBackProxyFileInsertScript(ProxyFileInsertScriptCfg cfg) { + ProxyFileInsertScriptCfgAudit fileInsertScriptTemp = new ProxyFileInsertScriptCfgAudit(); + fileInsertScriptTemp.setId(Long.valueOf(cfg.getCompileId())); + fileInsertScriptTemp.setCfgId(cfg.getCompileId()); + fileInsertScriptTemp.setProfileId(cfg.getCompileId()); + fileInsertScriptTemp.setFormat(cfg.getFormat()); + fileInsertScriptTemp.setProfileName(keywordsEscape(cfg.getCfgDesc())); + fileInsertScriptTemp.setPath(cfg.getPath()); + fileInsertScriptTemp.setAction(cfg.getAction()); + fileInsertScriptTemp.setService(cfg.getServiceId()); + fileInsertScriptTemp.setIsValid(cfg.getIsValid()); + fileInsertScriptTemp.setOpTime(cfg.getAuditTime()); + return fileInsertScriptTemp; + } + //流量转发目的地址 + public static ProxyFileTrafficMirrorCfgAudit convertCallBackProxyFileTrafficMirror(ProxyFileTrafficMirrorCfg cfg) { + ProxyFileTrafficMirrorCfgAudit fileTemp = new ProxyFileTrafficMirrorCfgAudit(); + fileTemp.setId(Long.valueOf(cfg.getCompileId())); + fileTemp.setCfgId(cfg.getCompileId()); + fileTemp.setProfileId(cfg.getCompileId()); + fileTemp.setProfileName(keywordsEscape(cfg.getCfgDesc())); + fileTemp.setAddrList(Arrays.asList(cfg.getAddrList().split(","))); + fileTemp.setAddrType(cfg.getAddrType()); + fileTemp.setAction(cfg.getAction()); + fileTemp.setService(cfg.getServiceId()); + fileTemp.setIsValid(cfg.getIsValid()); + fileTemp.setOpTime(cfg.getAuditTime()); + return fileTemp; + } + //文件策略 + public static ProxyFileStrategyCfgAudit convertCallBackProxyFileStrategy(ProxyFileStrategyCfg cfg) { + ProxyFileStrategyCfgAudit fileTemp = new ProxyFileStrategyCfgAudit(); + fileTemp.setId(Long.valueOf(cfg.getCompileId())); + fileTemp.setCfgId(cfg.getCompileId()); + fileTemp.setFileId(Long.valueOf(cfg.getCompileId())); + fileTemp.setFileDesc(keywordsEscape(cfg.getFileDesc())); + fileTemp.setContentType(cfg.getContentType()); + fileTemp.setContentLength(cfg.getContentLength()); + fileTemp.setAction(cfg.getAction()); + fileTemp.setService(cfg.getServiceId()); + fileTemp.setFilePath(cfg.getUrl()); + fileTemp.setIsValid(cfg.getIsValid()); + fileTemp.setOpTime(cfg.getAuditTime()); + return fileTemp; + } } diff --git a/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java b/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java index 857384b3c..959371313 100644 --- a/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java +++ b/src/main/java/com/nis/web/service/configuration/CommonPolicyService.java @@ -13,6 +13,14 @@ import com.google.common.collect.Lists; import com.nis.domain.Page; import com.nis.domain.callback.InlineIp; import com.nis.domain.callback.NtcDnsResStrategy; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileHijackCfgAudit; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit; +import com.nis.domain.callback.ProxyFileStrategyCfg; +import com.nis.domain.callback.ProxyFileStrategyCfgAudit; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfgAudit; import com.nis.domain.callback.ProxyObjKeyring; import com.nis.domain.callback.ProxyObjTrustedCa; import com.nis.domain.configuration.BaseCfg; @@ -361,6 +369,42 @@ public class CommonPolicyService extends CrudService 0) { notAuditList = convertList; } + }else if(entity.getServiceId().equals(643)) { // 劫持文件 + List convertList = Lists.newArrayList(); + for (Object object : notAuditList) { + ProxyFileHijackCfg cfg = (ProxyFileHijackCfg)object; + convertList.add(BaseService.convertCallBackProxyFileHijack(cfg)); + } + if(convertList.size() > 0) { + notAuditList = convertList; + } + }else if(entity.getServiceId().equals(644)) { // 注入脚本文件 + List convertList = Lists.newArrayList(); + for (Object object : notAuditList) { + ProxyFileInsertScriptCfg cfg = (ProxyFileInsertScriptCfg)object; + convertList.add(BaseService.convertCallBackProxyFileInsertScript(cfg)); + } + if(convertList.size() > 0) { + notAuditList = convertList; + } + }else if(entity.getServiceId().equals(645)) { // 流量转发目的地址 + List convertList = Lists.newArrayList(); + for (Object object : notAuditList) { + ProxyFileTrafficMirrorCfg cfg = (ProxyFileTrafficMirrorCfg)object; + convertList.add(BaseService.convertCallBackProxyFileTrafficMirror(cfg)); + } + if(convertList.size() > 0) { + notAuditList = convertList; + } + }else if(entity.getServiceId().equals(608)) { // 文件策略 + List convertList = Lists.newArrayList(); + for (Object object : notAuditList) { + ProxyFileStrategyCfg cfg = (ProxyFileStrategyCfg)object; + convertList.add(BaseService.convertCallBackProxyFileStrategy(cfg)); + } + if(convertList.size() > 0) { + notAuditList = convertList; + } } // 格式转换 --> @@ -423,6 +467,42 @@ public class CommonPolicyService extends CrudService 0) { auditList = convertList; } + }else if(entity.getServiceId().equals(643)) { // 劫持文件 + List convertList = Lists.newArrayList(); + for (Object object : auditList) { + ProxyFileHijackCfg cfg = (ProxyFileHijackCfg)object; + convertList.add(BaseService.convertCallBackProxyFileHijack(cfg)); + } + if(convertList.size() > 0) { + auditList = convertList; + } + }else if(entity.getServiceId().equals(644)) { // 劫持文件 + List convertList = Lists.newArrayList(); + for (Object object : auditList) { + ProxyFileInsertScriptCfg cfg = (ProxyFileInsertScriptCfg)object; + convertList.add(BaseService.convertCallBackProxyFileInsertScript(cfg)); + } + if(convertList.size() > 0) { + auditList = convertList; + } + }else if(entity.getServiceId().equals(645)) { // 流量转发目的地址 + List convertList = Lists.newArrayList(); + for (Object object : auditList) { + ProxyFileTrafficMirrorCfg cfg = (ProxyFileTrafficMirrorCfg)object; + convertList.add(BaseService.convertCallBackProxyFileTrafficMirror(cfg)); + } + if(convertList.size() > 0) { + auditList = convertList; + } + }else if(entity.getServiceId().equals(608)) { // 文件策略 + List convertList = Lists.newArrayList(); + for (Object object : notAuditList) { + ProxyFileStrategyCfg cfg = (ProxyFileStrategyCfg)object; + convertList.add(BaseService.convertCallBackProxyFileStrategy(cfg)); + } + if(convertList.size() > 0) { + notAuditList = convertList; + } } // 格式转换 --> diff --git a/src/main/java/com/nis/web/service/configuration/ProxyFileHijackService.java b/src/main/java/com/nis/web/service/configuration/ProxyFileHijackService.java new file mode 100644 index 000000000..ddf70bfde --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/ProxyFileHijackService.java @@ -0,0 +1,157 @@ +package com.nis.web.service.configuration; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.beust.jcommander.internal.Lists; +import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileHijackCfgAudit; +import com.nis.domain.callback.ProxyObjKeyring; +import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.domain.maat.ToMaatResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.StringUtil; +import com.nis.web.dao.configuration.ProxyFileHijackDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + +import jersey.repackaged.com.google.common.collect.Maps; + +@Service +public class ProxyFileHijackService extends BaseService { + + @Autowired + protected ProxyFileHijackDao proxyFileDao; + + /** + * 分页查询 + * @param page + * @param entity + * @return + */ + public Page findPage(Page page, ProxyFileHijackCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list=proxyFileDao.findPage(entity); + page.setList(list); + return page; + } + + public ProxyFileHijackCfg getCfgById(Long cfgId) { + return proxyFileDao.getCfgById(cfgId); + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdate(ProxyFileHijackCfg entity){ + Date createTime=new Date(); + setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } + entity.setIsValid(0); + entity.setIsAudit(0); + //新增 + if(StringUtil.isEmpty(entity.getCfgId())){ + entity.initDefaultValue(); + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + //调用服务接口获取compileId + try { + Integer compileId = ConfigServiceUtil.getId(1, 1).get(0);//获取编译id + entity.setCompileId(compileId); + } catch (Exception e) { + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + proxyFileDao.insert(entity); + //修改 + }else{ + Date editTime=new Date(); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + + proxyFileDao.update(entity); + } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId())); + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void update(Integer isAudit,Integer isValid,String ids,Integer functionId){ + ProxyFileHijackCfg entity = new ProxyFileHijackCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + proxyFileDao.update(entity); + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id){ + Date auditTime = new Date(); + ProxyFileHijackCfg cfg=new ProxyFileHijackCfg(); + cfg.setCfgId(Long.valueOf(id)); + cfg.setIsValid(isValid); + cfg.setIsAudit(isAudit); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(auditTime); + proxyFileDao.update(cfg); + cfg=proxyFileDao.getCfgById(cfg.getCfgId()); + String json=""; + if(cfg.getIsAudit()==1){ + List list = new ArrayList(); + ProxyFileHijackCfgAudit listConvert=convertCallBackProxyFileHijack(cfg); + list.add(listConvert); + //调用服务接口下发配置数据 + json=gsonToJson(list); + logger.info("劫持文件配置下发配置参数:"+json); + //调用服务接口下发配置 + try { + //ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + /*if(result!=null){ + logger.info("劫持文件配置下发响应信息:"+result.getMsg()); + }*/ + } catch (Exception e) { + logger.error("劫持文件配置配置下发失败",e); + throw e; + } + }else if(cfg.getIsAudit()==3){ + List list = new ArrayList(); + ProxyFileHijackCfgAudit listConvert = convertCallBackProxyFileHijack(cfg); + list.add(listConvert); + //调用服务接口取消配置 + json=gsonToJson(list); + logger.info("劫持文件配置配置参数:"+json); + //调用服务接口取消配置 + try { + /*ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("劫持文件配置响应信息:"+result.getMsg());*/ + } catch (Exception e) { + e.printStackTrace(); + logger.info("劫持文件置配置失败"); + throw e; + } + } + } + public List findByList(String ids) { + List list=proxyFileDao.findByList(ids); + return list; + } +} diff --git a/src/main/java/com/nis/web/service/configuration/ProxyFileInsertScriptService.java b/src/main/java/com/nis/web/service/configuration/ProxyFileInsertScriptService.java new file mode 100644 index 000000000..256417e60 --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/ProxyFileInsertScriptService.java @@ -0,0 +1,156 @@ +package com.nis.web.service.configuration; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileHijackCfg; +import com.nis.domain.callback.ProxyFileHijackCfgAudit; +import com.nis.domain.callback.ProxyFileInsertScriptCfg; +import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit; +import com.nis.domain.maat.ToMaatResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.StringUtil; +import com.nis.web.dao.configuration.ProxyFileInsertScriptDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + +@Service +public class ProxyFileInsertScriptService extends BaseService{ + + + @Autowired + protected ProxyFileInsertScriptDao proxyFileDao; + + /** + * 分页查询 + * @param page + * @param entity + * @return + */ + public Page findPage(Page page, ProxyFileInsertScriptCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = proxyFileDao.findPage(entity); + page.setList(list); + return page; + } + + public ProxyFileInsertScriptCfg getCfgById(Long cfgId) { + return proxyFileDao.getCfgById(cfgId); + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdate(ProxyFileInsertScriptCfg entity){ + Date createTime=new Date(); + setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } + entity.setIsValid(0); + entity.setIsAudit(0); + //新增 + if(StringUtil.isEmpty(entity.getCfgId())){ + entity.initDefaultValue(); + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + //调用服务接口获取compileId + try { + Integer compileId = ConfigServiceUtil.getId(1, 1).get(0);//获取编译id + entity.setCompileId(compileId); + } catch (Exception e) { + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + proxyFileDao.insert(entity); + //修改 + }else{ + Date editTime=new Date(); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + + proxyFileDao.update(entity); + } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId())); + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id){ + Date auditTime = new Date(); + ProxyFileInsertScriptCfg cfg=new ProxyFileInsertScriptCfg(); + cfg.setCfgId(Long.valueOf(id)); + cfg.setIsValid(isValid); + cfg.setIsAudit(isAudit); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(auditTime); + proxyFileDao.update(cfg); + cfg=proxyFileDao.getCfgById(cfg.getCfgId()); + String json=""; + if(cfg.getIsAudit()==1){ + List list = new ArrayList(); + ProxyFileInsertScriptCfgAudit listConvert=convertCallBackProxyFileInsertScript(cfg); + list.add(listConvert); + //调用服务接口下发配置数据 + json=gsonToJson(list); + logger.info("注入脚本文件配置下发配置参数:"+json); + //调用服务接口下发配置 + try { + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + if(result!=null){ + logger.info("注入脚本文件配置下发响应信息:"+result.getMsg()); + } + } catch (Exception e) { + logger.error("注入脚本文件配置配置下发失败",e); + throw e; + } + }else if(cfg.getIsAudit()==3){ + List list = new ArrayList(); + ProxyFileInsertScriptCfgAudit listConvert = convertCallBackProxyFileInsertScript(cfg); + list.add(listConvert); + //调用服务接口取消配置 + json=gsonToJson(list); + logger.info("注入脚本文件配置配置参数:"+json); + //调用服务接口取消配置 + try { + ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("注入脚本文件配置响应信息:"+result.getMsg()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("注入脚本文件配置配置失败"); + throw e; + } + } + } + + public List findByList(String ids) { + List list=proxyFileDao.findByList(ids); + return list; + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ + ProxyFileInsertScriptCfg entity = new ProxyFileInsertScriptCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + proxyFileDao.update(entity); + } + } + +} diff --git a/src/main/java/com/nis/web/service/configuration/ProxyFileStrategyService.java b/src/main/java/com/nis/web/service/configuration/ProxyFileStrategyService.java index 3cfac849c..1495d5e31 100644 --- a/src/main/java/com/nis/web/service/configuration/ProxyFileStrategyService.java +++ b/src/main/java/com/nis/web/service/configuration/ProxyFileStrategyService.java @@ -12,8 +12,10 @@ import org.springframework.transaction.annotation.Transactional; import com.beust.jcommander.internal.Lists; import com.nis.domain.Page; import com.nis.domain.callback.ProxyFileStrategyCfg; +import com.nis.domain.callback.ProxyFileStrategyCfgAudit; import com.nis.domain.maat.ToMaatResult; import com.nis.util.ConfigServiceUtil; +import com.nis.util.StringUtil; import com.nis.web.dao.configuration.ProxyFileStrategyDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; @@ -49,7 +51,13 @@ public class ProxyFileStrategyService extends BaseService{ public void saveOrUpdate(ProxyFileStrategyCfg entity){ Date createTime=new Date(); //设置区域运营商信息 - setAreaEffectiveIds(entity); + setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } + entity.setIsValid(0); + entity.setIsAudit(0); //新增 if(entity.getCfgId()==null){ Integer compileId = ConfigServiceUtil.getId(1, 1).get(0);//获取编译id @@ -67,6 +75,11 @@ public class ProxyFileStrategyService extends BaseService{ entity.setEditTime(editTime); proxyFileDao.update(entity);//更新 } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId())); + } } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) @@ -96,7 +109,9 @@ public class ProxyFileStrategyService extends BaseService{ entity.setAuditTime(auditTime); proxyFileDao.update(entity); if(isAudit == 1) {//审核通过,下发配置回调配置信息 - Map params = Maps.newHashMap(); + List convertList = Lists.newArrayList(); + convertList.add(BaseService.convertCallBackProxyFileStrategy(entity)); + /*Map params = Maps.newHashMap(); params.put("fileId", entity.getCompileId());//文件ID params.put("service", entity.getServiceId());//业务ID params.put("fileDesc", entity.getFileDesc());//文件描述 @@ -106,20 +121,22 @@ public class ProxyFileStrategyService extends BaseService{ params.put("isValid", 1);//有效标志,有效 params.put("opTime", new Date()); List list = Lists.newArrayList(); - list.add(params); - String json = gsonToJson(list); + list.add(params);*/ + String json = gsonToJson(convertList); logger.debug("params:" + json); ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); logger.debug("响应:"+gsonToJson(result)); }else if(isAudit == 3) {//取消审核通过,将回调配置信息置为无效 - Map params = Maps.newHashMap(); + List convertList = Lists.newArrayList(); + convertList.add(BaseService.convertCallBackProxyFileStrategy(entity)); + /*Map params = Maps.newHashMap(); params.put("fileId", entity.getCompileId());//文件ID params.put("service", entity.getServiceId());//业务ID params.put("isValid", 0);//有效标志,无效 params.put("opTime", new Date()); List list = Lists.newArrayList(); - list.add(params); - String json = gsonToJson(list); + list.add(params);*/ + String json = gsonToJson(convertList); logger.debug("params:" + json); ToMaatResult result = ConfigServiceUtil.put(json,2); logger.debug("响应:"+gsonToJson(result)); diff --git a/src/main/java/com/nis/web/service/configuration/ProxyFileTrafficMirrorService.java b/src/main/java/com/nis/web/service/configuration/ProxyFileTrafficMirrorService.java new file mode 100644 index 000000000..6d1c6512d --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/ProxyFileTrafficMirrorService.java @@ -0,0 +1,151 @@ +package com.nis.web.service.configuration; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.nis.domain.Page; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfg; +import com.nis.domain.callback.ProxyFileTrafficMirrorCfgAudit; +import com.nis.domain.maat.ToMaatResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.StringUtil; +import com.nis.web.dao.configuration.ProxyFileTrafficMirrorDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + +@Service +public class ProxyFileTrafficMirrorService extends BaseService{ + @Autowired + protected ProxyFileTrafficMirrorDao proxyFileDao; + + /** + * 分页查询 + * @param page + * @param entity + * @return + */ + public Page findPage(Page page, ProxyFileTrafficMirrorCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = proxyFileDao.findPage(entity); + page.setList(list); + return page; + } + + public ProxyFileTrafficMirrorCfg getCfgById(Long cfgId) { + return proxyFileDao.getCfgById(cfgId); + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdate(ProxyFileTrafficMirrorCfg entity){ + Date createTime=new Date(); + setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } + entity.setIsValid(0); + entity.setIsAudit(0); + //新增 + if(StringUtil.isEmpty(entity.getCfgId())){ + entity.initDefaultValue(); + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + //调用服务接口获取compileId + try { + Integer compileId = ConfigServiceUtil.getId(1, 1).get(0);//获取编译id + entity.setCompileId(compileId); + } catch (Exception e) { + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + proxyFileDao.insert(entity); + //修改 + }else{ + Date editTime=new Date(); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + + proxyFileDao.update(entity); + } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId())); + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id){ + Date auditTime = new Date(); + ProxyFileTrafficMirrorCfg cfg=new ProxyFileTrafficMirrorCfg(); + cfg.setCfgId(Long.valueOf(id)); + cfg.setIsValid(isValid); + cfg.setIsAudit(isAudit); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(auditTime); + proxyFileDao.update(cfg); + cfg=proxyFileDao.getCfgById(cfg.getCfgId()); + String json=""; + if(cfg.getIsAudit()==1){ + List list = new ArrayList(); + ProxyFileTrafficMirrorCfgAudit listConvert=convertCallBackProxyFileTrafficMirror(cfg); + list.add(listConvert); + //调用服务接口下发配置数据 + json=gsonToJson(list); + logger.info("流量镜像文件配置下发配置参数:"+json); + //调用服务接口下发配置 + try { + ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); + if(result!=null){ + logger.info("流量镜像文件配置下发响应信息:"+result.getMsg()); + } + } catch (Exception e) { + logger.error("流量镜像文件配置配置下发失败",e); + throw e; + } + }else if(cfg.getIsAudit()==3){ + List list = new ArrayList(); + ProxyFileTrafficMirrorCfgAudit listConvert = convertCallBackProxyFileTrafficMirror(cfg); + list.add(listConvert); + //调用服务接口取消配置 + json=gsonToJson(list); + logger.info("流量镜像文件配置配置参数:"+json); + //调用服务接口取消配置 + try { + ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("流量镜像文件配置响应信息:"+result.getMsg()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("流量镜像文件配置配置失败"); + throw e; + } + } + } + + public List findByList(String ids) { + List list=proxyFileDao.findByList(ids); + return list; + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ + ProxyFileTrafficMirrorCfg entity = new ProxyFileTrafficMirrorCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + proxyFileDao.update(entity); + } + } +} diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 1bc42a14f..f6caba27c 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1527,4 +1527,18 @@ url_group_manage=URL Group Manage range_cross=Found intersections between Server IP address and Client IP address app_ip_correlation=APP IP Correlation public_private_file_error=Public-private key mismatch -https_url_format_tip=URL(http[s]://xxx.xx) \ No newline at end of file +https_url_format_tip=URL(http[s]://xxx.xx) +hijack_file_strategy=Hijack File +profile_name=Profile Name +file_insert_script=File Insert Script +disk_path=disk_path +format=Format +file_quote_disable_delete=File quote Disable Delete +target_type=Target Type +vlan=VLAN +mac=MAC +mirror_addr_list=Address List +mirror_addr_type=Address Type +target_name=Target Name +traffic_mirror_address=Traffic Mirror Address +content_name=Content Name \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 7d0b0e017..8107afebc 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1530,4 +1530,17 @@ url_group_manage=URL Group Manage range_cross=\u041d\u0430\u0439\u0434\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 ip-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 ip-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 app_ip_correlation=\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f ip-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 public_private_file_error=\u041d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e-\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430. -https_url_format_tip=URL(http[s]://xxx.xx) \ No newline at end of file +https_url_format_tip=URL(http[s]://xxx.xx) +hijack_file_strategy=\u0417\u0430\u0445\u0432\u0430\u0442 \u0444\u0430\u0439\u043B +profile_name=Profile Name +file_insert_script=File Insert Script +disk_path=disk_path +format=Format +file_quote_disable_delete=File quote Disable Delete +mac=MAC +vlan=VLAN +mirror_addr_list=Address List +mirror_addr_type=Address Type +target_name=Target Name +traffic_mirror_address=Traffic Mirror Address +content_name=Content Name \ 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 48545390e..28a391d5c 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1528,4 +1528,17 @@ url_group_manage=URL \u5206\u7ec4 \u7ba1\u7406 range_cross=\u6E90IP\u4E0E\u76EE\u7684IP\u8303\u56F4\u6709\u4EA4\u53C9 app_ip_correlation=APP\u5173\u8054\u7279\u5F81IP\u914D\u7F6E public_private_file_error=\u516C\u79C1\u94A5\u8BC1\u4E66\u4E0D\u5339\u914D -https_url_format_tip=URL(http[s]://xxx.xx) \ No newline at end of file +https_url_format_tip=URL(http[s]://xxx.xx) +hijack_file_strategy=\u52AB\u6301\u6587\u4EF6 +profile_name=\u6587\u4EF6\u540D\u79F0 +file_insert_script=\u6CE8\u5165\u811A\u672C\u6587\u4EF6 +disk_path=\u50A8\u5B58\u8DEF\u5F84 +format=\u683C\u5F0F +file_quote_disable_delete=\u6587\u4EF6\u88AB\u5F15\u7528 \u4E0D\u53EF\u5220\u9664 +vlan=\u865A\u62DF\u5C40\u57DF\u7F51 +mac=MAC\u5730\u5740 +mirror_addr_list=\u76EE\u6807\u6807\u8BC6\u5217\u8868 +mirror_addr_type=\u76EE\u6807\u6807\u8BC6\u7C7B\u578B +target_name=\u76EE\u6807\u540D\u79F0 +traffic_mirror_address=\u6D41\u91CF\u8F6C\u53D1\u76EE\u7684\u5730\u5740 +content_name=\u5185\u5BB9\u540D\u79F0 \ 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 117c7d22f..e2aaab6ff 100644 --- a/src/main/resources/service/service_config.xml +++ b/src/main/resources/service/service_config.xml @@ -421,6 +421,9 @@ - + + + + \ No newline at end of file diff --git a/src/main/resources/sql/20190521/add_menu.sql b/src/main/resources/sql/20190521/add_menu.sql new file mode 100644 index 000000000..c1b1ad570 --- /dev/null +++ b/src/main/resources/sql/20190521/add_menu.sql @@ -0,0 +1,14 @@ +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1256, 1121, '0,1,86,717,1121,', 'hijack_file_strategy', 'ٳļ', 4, '/proxy/fileHijack/list', '', '', 1, 'proxy:fileHijack:config', '1', '2019-05-09 11:16:20', '1', '2019-05-09 11:16:20', '', 1, NULL, 0, 0, 513); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1257, 1122, '0,1,150,750,1122,', 'hijack_file_strategy', 'ٳļ', 422, '/proxy/fileHijack/list', '', '', 1, 'proxy:fileHijack:confirm', '1', '2019-05-09 14:58:10', '1', '2019-05-09 14:58:10', '', 1, NULL, 0, 0, 513); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1258, 1123, '0,1,151,865,1123,', 'hijack_file_strategy', 'ٳļ', 35, '/proxy/fileHijack/list', '', '', 1, 'proxy:fileHijack:audit', '1', '2019-05-09 14:59:54', '1', '2019-05-09 14:59:54', '', 1, NULL, 0, 0, 513); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1260, 1121, '0,1,86,717,1121,', 'file_insert_script', 'עűļ', 4, '/proxy/fileInsertScript/list', '', '', 1, 'proxy:fileInsertScript:config', '1', '2019-05-09 16:03:58', '1', '2019-05-09 16:03:58', '', 1, NULL, 0, 0, 514); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1261, 1122, '0,1,150,750,1122,', 'file_insert_script', 'עűļ', 424, '/proxy/fileInsertScript/list', '', '', 1, 'proxy:fileInsertScript:confirm', '1', '2019-05-09 16:06:17', '1', '2019-05-09 16:06:17', '', 1, NULL, 0, 0, 514); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1262, 1123, '0,1,151,865,1123,', 'file_insert_script', 'עűļ', 37, '/proxy/fileInsertScript/list', '', '', 1, 'proxy:fileInsertScript:audit', '1', '2019-05-09 16:07:13', '1', '2019-05-09 16:07:13', '', 1, NULL, 0, 0, 514); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1263, 1121, '0,1,86,717,1121,', 'traffic_mirror_address', 'תĿĵַ', 8, '/proxy/fileTrafficMirror/list', '', '', 1, 'proxy:fileTrafficMirror:config', '1', '2019-05-09 16:03:58', '1', '2019-05-09 16:03:58', '', 1, NULL, 0, 0, 515); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1264, 1122, '0,1,150,750,1122,', 'traffic_mirror_address', 'תĿĵַ', 426, '/proxy/fileTrafficMirror/list', '', '', 1, 'proxy:fileTrafficMirror:confirm', '1', '2019-05-09 16:06:17', '1', '2019-05-09 16:06:17', '', 1, NULL, 0, 0, 515); +INSERT INTO sys_menu (`id`, `parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES (1265, 1123, '0,1,151,865,1123,', 'traffic_mirror_address', 'תĿĵַ', 39, '/proxy/fileTrafficMirror/list', '', '', 1, 'proxy:fileTrafficMirror:audit', '1', '2019-05-09 16:07:13', '1', '2019-05-09 16:07:13', '', 1, NULL, 0, 0, 515); + +INSERT INTO function_service_dict (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES (166, 513, 0, 1, 'monit', 643, 'hijack_file_strategy', '', 1, NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', 0, 1, ''); +INSERT INTO function_service_dict (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES (167, 514, 0, 1, 'monit', 644, 'file_insert_script', '', 1, NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', 0, 1, ''); +INSERT INTO function_service_dict (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES (168, 515, 0, 1, 'monit', 645, 'file_traffic_mirror', NULL, 1, NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', NULL, 0, 1, NULL); +INSERT INTO function_service_dict (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES (169, 512, 0, 1, 'monit', 608, 'file_strategy', NULL, 1, NULL, '2019-05-17 11:46:48', NULL, '2019-05-17 11:46:51', NULL, 0, 1, NULL); diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index f13dbc840..5335e9779 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -119,6 +119,10 @@ function isBatch(url){ || url.indexOf("functionId=570&") > -1 //Key Ring || url.indexOf("functionId=571&") > -1 //Trusted Certificate || url.indexOf("functionId=600&") > -1 //Trusted Certificate + || url.indexOf("functionId=513&") > -1 //FileHijack + || url.indexOf("functionId=514&") > -1 //File Insert Script + || url.indexOf("functionId=515&") > -1 //Traffic Mirror + || url.indexOf("functionId=512&") > -1 //PXY OBJ FILE ){ flag = true; } @@ -133,6 +137,9 @@ function del(url){ if(validateIsDelete(checkboxes)){ top.$.jBox.tip("", ""); return; + }else if(validateIsDeleteOfQuote(checkboxes)){ + top.$.jBox.tip("", ""); + return; }else{ var serviceGroupIds=[],ids=[],canDel=true; $(checkboxes).filter(":checked").each(function(){ @@ -592,6 +599,18 @@ function validateIsDelete(checkboxes){ }); return flag; } +//验证文件是否其他菜单有引用且非删除状态 +function validateIsDeleteOfQuote(checkboxes){ + var flag = false; + $(checkboxes).filter(":checked").each(function(){ + if($(this).attr("quoteStatus") != -1 && $(this).attr("quoteStatus") != 0 + && "undefined" != typeof $(this).attr("quoteStatus")){ //可删除的条件 + flag = true; + return; + } + }); + return flag; +} //验证选择的配置,是否有审核通过的 function validatePass(checkboxes){ var flag = false; diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp new file mode 100644 index 000000000..01a9ec143 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp @@ -0,0 +1,235 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ +

+ +

+ +
+
+
+
+
+ + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + +
+
+ +
+ +
+
+
+ +
+ +
+ " class="required form-control" + style="background-color: transparent" aria-required="true" + type="text" value="${_cfg.path}"> +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> +
+
+
+
+
+
+ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp new file mode 100644 index 000000000..266825569 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/list.jsp @@ -0,0 +1,414 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ + +

+ +

+ +
+
+
+
+ + + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ +
+
+ + + + + + +
+ + +
+ + + + + + + + + + + +
+
+
+
+ + + +
+
+ + + + + +
+ + +
+ + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${indexCfg.compileId }${indexCfg.cfgDesc} + ${fn:substring(indexCfg.path,0,20) } + ${indexCfg.contentType }${indexCfg.contentName } + + + + + + + ${indexCfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + ${indexCfg.creatorName }${indexCfg.editorName }${indexCfg.auditorName }
+
${page}
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp new file mode 100644 index 000000000..22f735ab2 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp @@ -0,0 +1,233 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ +

+ +

+ +
+
+
+
+
+ + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + +
+
+ +
+ +
+
+
+ +
+ +
+ " class="required form-control" + style="background-color: transparent" aria-required="true" + type="text" value="${_cfg.path}"> +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ <%-- --%> + +
+
+
+
+ + +
+ <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> +
+
+
+
+
+
+ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp new file mode 100644 index 000000000..5d773da16 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/list.jsp @@ -0,0 +1,412 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ + +

+ +

+ +
+
+
+
+ + + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ +
+
+ + + + + + +
+ + +
+ + + + + + + + + + + +
+
+
+
+ + + +
+
+ + + + + +
+ + +
+ + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${indexCfg.compileId }${indexCfg.cfgDesc} + ${fn:substring(indexCfg.path,0,20) } + ${indexCfg.format } + + + + + + + ${indexCfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + ${indexCfg.creatorName }${indexCfg.editorName }${indexCfg.auditorName }
+
${page}
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp index 44da57b4a..8b25c03f9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp @@ -10,11 +10,6 @@ $("#cfgFile").trigger("click"); }); - /* $(".action").on("change",function(){ - $("#serviceId").val($(this).attr("serviceId")); - }); - $("#serviceId").val($(".action:checked").attr("serviceId"));//初始化*/ - $("#cfgFile").on('change',function(){ $("#urlInfo").val($("#cfgFile").val()); }); @@ -58,11 +53,68 @@
- - + + + + + + + + + + + +
-
+
+ +
+ +
-
+
@@ -135,24 +187,35 @@
- <%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
-
-
- - -
-
-
-
+
+
+ + + + + + + + + + + + + + +
+
+
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp new file mode 100644 index 000000000..a7d05a433 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileTrafficMirror/form.jsp @@ -0,0 +1,239 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + +
+ +

+ +

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

+ +

+ +
+
+
+
+ + + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ +
+
+ + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + +
+
+
+
+ + + +
+
+ + + + + +
+ + +
+ + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ +
+ + + + + + + +
+ +
+ +
+ +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${indexCfg.compileId }${indexCfg.cfgDesc}${indexCfg.addrType } + ${fn:substring(indexCfg.addrList,0,20) } + + + + + + + + ${indexCfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + ${indexCfg.creatorName }${indexCfg.editorName }${indexCfg.auditorName }
+
${page}
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index e23cb3c51..583510610 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -1,102 +1,103 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: EN (England, 英文 (YingWen), 鸟语) - */ -(function ($) { - $.extend($.validator.messages, { - required: "This field is required.", - remote: "Please fix this field.", - email: "Please enter a valid email address.", - url: "Please enter a valid URL.", - date: "Please enter a valid date.", - dateISO: "Please enter a valid date (ISO).", - number: "Please enter a valid number.", - digits: "Please enter only digits.", - creditcard: "Please enter a valid credit card number.", - equalTo: "Please enter the same value again.", - accept: "Please enter the string with a valid suffix", - maxlength: $.validator.format("Please enter no more than {0} characters."), - minlength: $.validator.format("Please enter at least {0} characters."), - rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), - range: $.validator.format("Please enter a value between {0} and {1}."), - max: $.validator.format("Please enter a value less than or equal to {0}."), - min: $.validator.format("Please enter a value greater than or equal to {0}."), - noBlankSpace:"can not be space", - ip:"Please enter a correct IP address", - ipCheck:"Please enter a correct IP address", - ipMask:"Please enter a correct IP/mask", - ipPart:"Invalid IP part", - //ipv6MaskPart:"Mask must be exponent of 2,not greater than 128", - ipv6MaskPart:"Mask must between 2 and 128", - //ipMaskRange:"IP mask must between 0 and 32", - ipMaskRange:"IP mask must between 16 and 32", - srcIpNotEqDestIp:"Client IP ", - destIpNotEqDestIp:" and Server IP ", - IpNotEqDestIp:" can't be the same", - srcIpIsNotValue:"Client IP can't be ", - destIpIsNotValue:"Server IP can't be ", - ipRange:"Wrong IP format", - ipRange1:"start IP should smaller than end IP", - portCheck:"Please enter a correct port", - notStartZero:"Please enter a valid Integer", - portRange:"Port must between 0 and 65535", - portMaskRange:"Port and mask must between 0 and 65535.The correct pattern is \"port/mask\".", - chooseAreaOrIsp:"The region and the oprater must choose one", - areaControl:"Action drop and loop do not need area control", - ip_type: "IP type", - ip_pattern: "IP Pattern", - area: "Area", - isp: "ISP", - close_info: "Close", - client_ip: "Client IP", - ipv4: "IPv4", - ipv6: "IPv6", - over6: "4over6", - over4: "6over4", - ipv4v6:"Please enter a correct IPv4(0.0.0.0) or IPv6(::)", - all: "All", - ip_subnet: "IP/Subnet mask", - ip_range: "IP Range", - timeout:"Timeout", - areaIpPrefix:"Forbiden value: ", - domainCheck:"Please enter a valid domain.", - checkParent:"Configuration Type must match it's parent.", - specServiceCodeCheck:"Protocol No is repeat.", - compareDate:"The end time should not be earlier than the start time.", - hexCheck:"Please enter the HEX format character", - invisibleChar:"Please enter the visible character", - hasInvisibleChar:"The tag {0} has invisible character", - haveInvisibleChar:"The tags {0} have invisible character", - httpCheck:"Please enter a correct url(http[s]://xxx.xx)", - crlCheck:"Please enter a correct crl(http://xxx.xx.crl)", - failed:"Failed", - go_back:"Return", - log_5_minutes:"Log For The Last Five Minutes", - log_1_hour:"Log For The Last Hour", - input:"Please Enter ", - protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0", - protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0", - netAddress:"The class C type of IP addresses must has the same network number bit field", - addrPoolUnique:"Address Pool already exists.", - asnNoUnique:"ASN already exists.", - asnMustExists:"ASN Must exists in ASN Group.", - orgMustExists:"ASN organization Must exists in ASN Group and have an approved ASN IP", - areaUnique:"Area already exists.", - config_sync_tip:"The system is being maintained and temporarily inaccessible.", - ipMaskSole:"IP already exists.", - noStrategyCheck:"No effective spoofing IP configuration", - keywordLength:"Please enter a value between 4 and 1024 characters long.", - arbitrary:"Arbitrarily", - log_trend:"Log Trend", - info:"Prompt", - protect_warn:"Policy with relax precondition may consume too much resources.Use with cautions!", - log_no_data:"This hour no data", - expireTip:"Start time and end time interval is at least 1 minute", - compareTip:"Start time should be at least two minutes earlier than current time.", - compileIdCheck:"Please enter the correct query format", - compileIdCheckNum:"The number of queries should not be greater than 200", - rangeCross0:"The IP {0} must not between {1} and {2}", - rangeCross1:"The IP range {0} has intersections with {1}", - protectedCfgUnique:"Keyword already exists." - }); -}(jQuery)); +/* + * Translated default messages for the jQuery validation plugin. + * Locale: EN (England, 英文 (YingWen), 鸟语) + */ +(function ($) { + $.extend($.validator.messages, { + required: "This field is required.", + remote: "Please fix this field.", + email: "Please enter a valid email address.", + url: "Please enter a valid URL.", + date: "Please enter a valid date.", + dateISO: "Please enter a valid date (ISO).", + number: "Please enter a valid number.", + digits: "Please enter only digits.", + creditcard: "Please enter a valid credit card number.", + equalTo: "Please enter the same value again.", + accept: "Please enter the string with a valid suffix", + maxlength: $.validator.format("Please enter no more than {0} characters."), + minlength: $.validator.format("Please enter at least {0} characters."), + rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), + range: $.validator.format("Please enter a value between {0} and {1}."), + max: $.validator.format("Please enter a value less than or equal to {0}."), + min: $.validator.format("Please enter a value greater than or equal to {0}."), + noBlankSpace:"can not be space", + ip:"Please enter a correct IP address", + ipCheck:"Please enter a correct IP address", + ipMask:"Please enter a correct IP/mask", + ipPart:"Invalid IP part", + //ipv6MaskPart:"Mask must be exponent of 2,not greater than 128", + ipv6MaskPart:"Mask must between 2 and 128", + //ipMaskRange:"IP mask must between 0 and 32", + ipMaskRange:"IP mask must between 16 and 32", + srcIpNotEqDestIp:"Client IP ", + destIpNotEqDestIp:" and Server IP ", + IpNotEqDestIp:" can't be the same", + srcIpIsNotValue:"Client IP can't be ", + destIpIsNotValue:"Server IP can't be ", + ipRange:"Wrong IP format", + ipRange1:"start IP should smaller than end IP", + portCheck:"Please enter a correct port", + notStartZero:"Please enter a valid Integer", + portRange:"Port must between 0 and 65535", + portMaskRange:"Port and mask must between 0 and 65535.The correct pattern is \"port/mask\".", + chooseAreaOrIsp:"The region and the oprater must choose one", + areaControl:"Action drop and loop do not need area control", + ip_type: "IP type", + ip_pattern: "IP Pattern", + area: "Area", + isp: "ISP", + close_info: "Close", + client_ip: "Client IP", + ipv4: "IPv4", + ipv6: "IPv6", + over6: "4over6", + over4: "6over4", + ipv4v6:"Please enter a correct IPv4(0.0.0.0) or IPv6(::)", + all: "All", + ip_subnet: "IP/Subnet mask", + ip_range: "IP Range", + timeout:"Timeout", + areaIpPrefix:"Forbiden value: ", + domainCheck:"Please enter a valid domain.", + checkParent:"Configuration Type must match it's parent.", + specServiceCodeCheck:"Protocol No is repeat.", + compareDate:"The end time should not be earlier than the start time.", + hexCheck:"Please enter the HEX format character", + invisibleChar:"Please enter the visible character", + hasInvisibleChar:"The tag {0} has invisible character", + haveInvisibleChar:"The tags {0} have invisible character", + httpCheck:"Please enter a correct url(http[s]://xxx.xx)", + crlCheck:"Please enter a correct crl(http://xxx.xx.crl)", + failed:"Failed", + go_back:"Return", + log_5_minutes:"Log For The Last Five Minutes", + log_1_hour:"Log For The Last Hour", + input:"Please Enter ", + protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0", + protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0", + netAddress:"The class C type of IP addresses must has the same network number bit field", + addrPoolUnique:"Address Pool already exists.", + asnNoUnique:"ASN already exists.", + asnMustExists:"ASN Must exists in ASN Group.", + orgMustExists:"ASN organization Must exists in ASN Group and have an approved ASN IP", + areaUnique:"Area already exists.", + config_sync_tip:"The system is being maintained and temporarily inaccessible.", + ipMaskSole:"IP already exists.", + noStrategyCheck:"No effective spoofing IP configuration", + keywordLength:"Please enter a value between 4 and 1024 characters long.", + arbitrary:"Arbitrarily", + log_trend:"Log Trend", + info:"Prompt", + protect_warn:"Policy with relax precondition may consume too much resources.Use with cautions!", + log_no_data:"This hour no data", + expireTip:"Start time and end time interval is at least 1 minute", + compareTip:"Start time should be at least two minutes earlier than current time.", + compileIdCheck:"Please enter the correct query format", + compileIdCheckNum:"The number of queries should not be greater than 200", + rangeCross0:"The IP {0} must not between {1} and {2}", + rangeCross1:"The IP range {0} has intersections with {1}", + protectedCfgUnique:"Keyword already exists.", + addrList:"Please enter the legitimate targets identification list" + }); +}(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 2db45be29..bdca13c3f 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -1,102 +1,103 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: RU (Russian; Русский Язык) - */ -(function ($) { - $.extend($.validator.messages, { - required: "Это поле является обязательным.", - remote: "Пожалуйста, исправьте это поле.", - email: "Введите действующий адрес эл. почты.", - url: "Введите действительный URL.", - date: "Введите действительную дату.", - dateISO: "Введите действительную дату (ISO).", - number: "Введите действительный номер", - digits: "Введите только целое число.", - creditcard: "Введите действительный номер кредитной карты.", - equalTo: "Введите такое же значение ещё раз.", - accept: "Введите строку с действительным суффиксом", - maxlength: $.validator.format("Введите не больше {0} символов длинной."), - minlength: $.validator.format("Введите не менее {0} символов длинной."), - rangelength: $.validator.format("Введите между {0} и {1} символов длинной."), - range: $.validator.format("Введите значение от {0} до {1}."), - max: $.validator.format("Введите значение, меньшее или равно {0}."), - min: $.validator.format("Введите значение больше или равно {0}."), - noBlankSpace:"Не может быть пробелом", - ip:"Введите правильный IP-адрес", - ipCheck:"Введите правильный IP-адрес", - ipMask:"Введите правильный IP/маску", - ipPart:"Недопустимая часть IP", - //ipv6MaskPart:"Mаска-показатель степени 2, небольше 128", - ipv6MaskPart:"Маска должна быть между 2 и 128", - //ipMaskRange:"Маска IP между 0 и 32", - ipMaskRange:"Маска IP должна между 16 и 32", - srcIpNotEqDestIp:"IP-адрес клиента", - destIpNotEqDestIp:"и IP-адрес сервера", - IpNotEqDestIp:"Не может быть одинаковым", - srcIpIsNotValue:"IP-адрес клиента не может быть", - destIpIsNotValue:"IP-адрес сервера не может быть", - ipRange:"Неверный IP-формат", - ipRange1:"Начальный IP должен быть меньше конечного IP", - portCheck: "Введите  правильный  порт.", - notStartZero:"Введите действительное целое число", - portRange:"Порт должен между 0 и 65535", - portMaskRange:"Порт и маска должны быть между 0 и 65535. Правильный шаблон -«порт/маска».", - chooseAreaOrIsp:"Регион или оператор должны выбрать один", - areaControl:"Падению и циклу не нужно управление зоны", - ip_type: "IP Тип", - ip_pattern: "IP Формат", - area: "Район", - isp: "ISP", - close_info: "Выключить", - client_ip: "Клиент IP", - ipv4: "IPv4", - ipv6: "IPv6", - over6: "4over6", - over4: "6over4", - ipv4v6:"Введите правильный IPv4 (0.0.0.0) или IPv6 (::)", - all: "Все", - ip_subnet: "IP/Маска Подсети", - ip_range: "IP Диапазон", - timeout:"Тайм-аут", - areaIpPrefix:"Запрещенное значение:", - domainCheck:"Введите действительный домен.", - checkParent:"Тип конфигурации должен совпадать с родительским типом.", - specServiceCodeCheck:"Номер протокола повторяется.", - compareDate:"Время окончания не должно быть раньше времени начала.", - hexCheck:"Введите символ шестнадцатеричного формата", - invisibleChar:"Введите видимый символ", - hasInvisibleChar:"Тег {0} включает невидимый символ", - haveInvisibleChar:"Теги {0} включают невидимый символ", - httpCheck:"Введите правильный URL(http[s]://xxx.xx)", - crlCheck:"Введите правильный CRL(http://xxx.xx.crl)", - failed:"Неудачно", - go_back:"Назад", - log_5_minutes:"Журнал за последние пять минут", - log_1_hour:"Журнал За последний час", - input:"Введите, пожалуйста ", - protocolPort:"Если порт больше 0, необходимо выбрать протокол TCP или протокол UDP", - protocolPort1:"Только при выборе протокола TCP или протокола UDP порт может быть больше 0", - netAddress:"Тип IP-адресов класса C должен иметь один и тот же номер сети бит поля.", - addrPoolUnique:"Address Pool уже существует.", - asnNoUnique:"ASN уже существует.", - asnMustExists:"Номер ASN должен существовать в ASN группе.", - orgMustExists:"Организация ASN должна существовать в ASN группе и включаться в себя утвержденный ASN IP-адрес.", - areaUnique:"Регион уже существует.", - config_sync_tip:"Система находится под техническим обслуживанием и временно недоступна.", - ipMaskSole:"IP уже существует.", - noStrategyCheck:"Нет актированной конфигурации IP-спуфинг.", - keywordLength:"Введите между 4 и 1024 символов длинной.", - arbitrary:"Любой", - log_trend:"Журнал Тенденция", - info:"Инфо", - protect_warn:"Политика с широким предварительным условием может потреблять слишком много ресурсов.Использовать осторожно!", - log_no_data:"Нет данных за этот час", - expireTip:"Интервал времени начала и окончания не менее 1 минуты", - compareTip:"Время начала не должно быть меньше текущего времени плюс 2 минуты.", - compileIdCheck:"Пожалуйста, введите правильный формат запроса", - compileIdCheckNum:"Количество запросов не должно превышать 200", - rangeCross0:"IP {0} не должен находиться между {1} и {2}", - rangeCross1:"Диапазон IP {0} имеет пересечения с {1}", - protectedCfgUnique:"Ключевое слово уже существует." - }); -}(jQuery)); +/* + * Translated default messages for the jQuery validation plugin. + * Locale: RU (Russian; Русский Язык) + */ +(function ($) { + $.extend($.validator.messages, { + required: "Это поле является обязательным.", + remote: "Пожалуйста, исправьте это поле.", + email: "Введите действующий адрес эл. почты.", + url: "Введите действительный URL.", + date: "Введите действительную дату.", + dateISO: "Введите действительную дату (ISO).", + number: "Введите действительный номер", + digits: "Введите только целое число.", + creditcard: "Введите действительный номер кредитной карты.", + equalTo: "Введите такое же значение ещё раз.", + accept: "Введите строку с действительным суффиксом", + maxlength: $.validator.format("Введите не больше {0} символов длинной."), + minlength: $.validator.format("Введите не менее {0} символов длинной."), + rangelength: $.validator.format("Введите между {0} и {1} символов длинной."), + range: $.validator.format("Введите значение от {0} до {1}."), + max: $.validator.format("Введите значение, меньшее или равно {0}."), + min: $.validator.format("Введите значение больше или равно {0}."), + noBlankSpace:"Не может быть пробелом", + ip:"Введите правильный IP-адрес", + ipCheck:"Введите правильный IP-адрес", + ipMask:"Введите правильный IP/маску", + ipPart:"Недопустимая часть IP", + //ipv6MaskPart:"Mаска-показатель степени 2, небольше 128", + ipv6MaskPart:"Маска должна быть между 2 и 128", + //ipMaskRange:"Маска IP между 0 и 32", + ipMaskRange:"Маска IP должна между 16 и 32", + srcIpNotEqDestIp:"IP-адрес клиента", + destIpNotEqDestIp:"и IP-адрес сервера", + IpNotEqDestIp:"Не может быть одинаковым", + srcIpIsNotValue:"IP-адрес клиента не может быть", + destIpIsNotValue:"IP-адрес сервера не может быть", + ipRange:"Неверный IP-формат", + ipRange1:"Начальный IP должен быть меньше конечного IP", + portCheck: "Введите  правильный  порт.", + notStartZero:"Введите действительное целое число", + portRange:"Порт должен между 0 и 65535", + portMaskRange:"Порт и маска должны быть между 0 и 65535. Правильный шаблон -«порт/маска».", + chooseAreaOrIsp:"Регион или оператор должны выбрать один", + areaControl:"Падению и циклу не нужно управление зоны", + ip_type: "IP Тип", + ip_pattern: "IP Формат", + area: "Район", + isp: "ISP", + close_info: "Выключить", + client_ip: "Клиент IP", + ipv4: "IPv4", + ipv6: "IPv6", + over6: "4over6", + over4: "6over4", + ipv4v6:"Введите правильный IPv4 (0.0.0.0) или IPv6 (::)", + all: "Все", + ip_subnet: "IP/Маска Подсети", + ip_range: "IP Диапазон", + timeout:"Тайм-аут", + areaIpPrefix:"Запрещенное значение:", + domainCheck:"Введите действительный домен.", + checkParent:"Тип конфигурации должен совпадать с родительским типом.", + specServiceCodeCheck:"Номер протокола повторяется.", + compareDate:"Время окончания не должно быть раньше времени начала.", + hexCheck:"Введите символ шестнадцатеричного формата", + invisibleChar:"Введите видимый символ", + hasInvisibleChar:"Тег {0} включает невидимый символ", + haveInvisibleChar:"Теги {0} включают невидимый символ", + httpCheck:"Введите правильный URL(http[s]://xxx.xx)", + crlCheck:"Введите правильный CRL(http://xxx.xx.crl)", + failed:"Неудачно", + go_back:"Назад", + log_5_minutes:"Журнал за последние пять минут", + log_1_hour:"Журнал За последний час", + input:"Введите, пожалуйста ", + protocolPort:"Если порт больше 0, необходимо выбрать протокол TCP или протокол UDP", + protocolPort1:"Только при выборе протокола TCP или протокола UDP порт может быть больше 0", + netAddress:"Тип IP-адресов класса C должен иметь один и тот же номер сети бит поля.", + addrPoolUnique:"Address Pool уже существует.", + asnNoUnique:"ASN уже существует.", + asnMustExists:"Номер ASN должен существовать в ASN группе.", + orgMustExists:"Организация ASN должна существовать в ASN группе и включаться в себя утвержденный ASN IP-адрес.", + areaUnique:"Регион уже существует.", + config_sync_tip:"Система находится под техническим обслуживанием и временно недоступна.", + ipMaskSole:"IP уже существует.", + noStrategyCheck:"Нет актированной конфигурации IP-спуфинг.", + keywordLength:"Введите между 4 и 1024 символов длинной.", + arbitrary:"Любой", + log_trend:"Журнал Тенденция", + info:"Инфо", + protect_warn:"Политика с широким предварительным условием может потреблять слишком много ресурсов.Использовать осторожно!", + log_no_data:"Нет данных за этот час", + expireTip:"Интервал времени начала и окончания не менее 1 минуты", + compareTip:"Время начала не должно быть меньше текущего времени плюс 2 минуты.", + compileIdCheck:"Пожалуйста, введите правильный формат запроса", + compileIdCheckNum:"Количество запросов не должно превышать 200", + rangeCross0:"IP {0} не должен находиться между {1} и {2}", + rangeCross1:"Диапазон IP {0} имеет пересечения с {1}", + protectedCfgUnique:"Ключевое слово уже существует.", + addrList:"Please enter the legitimate targets identification list" + }); +}(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index 33fea7f15..7a53b8a5a 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -1,102 +1,103 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) - */ -(function ($) { - $.extend($.validator.messages, { - required: "必填信息", - remote: "请修正该信息", - email: "请输入正确格式的电子邮件", - url: "请输入有效的网址", - date: "请输入有效的日期", - dateISO: "请输入有效的日期 (ISO).", - number: "请输入有效的数字", - digits: "只能输入整数", - creditcard: "请输入有效的信用卡号", - equalTo: "请再次输入相同的值", - accept: "请输入拥有合法后缀名的字符串", - maxlength: $.validator.format("请输入一个长度最多是 {0} 的字符串"), - minlength: $.validator.format("请输入一个长度最少是 {0} 的字符串"), - rangelength: $.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"), - range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), - max: $.validator.format("请输入一个最大为 {0} 的值"), - min: $.validator.format("请输入一个最小为 {0} 的值"), - noBlankSpace:"不能为空格", - ip:"请填写正确的IP地址", - ipCheck:"请填写正确的IP地址", - ipMask:"请填写正确的IP地址/掩码", - ipPart:"IP部分格式错误", - //ipv6MaskPart:"掩码为不大于128的2的指数幂", - ipv6MaskPart:"掩码介于2到128", - //ipMaskRange:"IP掩码介于0到32", - ipMaskRange:"IP掩码介于16到32", - srcIpNotEqDestIp:"源IP ", - destIpNotEqDestIp:" 与目的IP ", - IpNotEqDestIp:" 不能相同", - srcIpIsNotValue:"源IP不能为 ", - destIpIsNotValue:"目的IP不能为", - ipRange:"IP范围格式错误", - ipRange1:"起始IP值应小于结束IP值", - portCheck:"请填写正确的端口", - notStartZero:"请填写正确的数值", - portRange:"端口应小于65536,非0数字不能以0开头", - portMaskRange:"端口以及掩码范围0-65535,非0数字不能以0开头。格式为\"端口/掩码\"", - chooseAreaOrIsp:"区域和运营商必选一个", - areaControl:"丢弃和回流动作不能区域管控", - ip_type: "ip类型", - ip_pattern: "ip格式", - area: "区域", - isp: "运营商", - close_info: "关闭", - client_ip: "源IP", - ipv4: "IPv4", - ipv6: "IPv6", - over6: "4over6", - over4: "6over4", - ipv4v6:"请输入合法的IP地址如IPv4(0.0.0.0)或IPv6(::)", - all: "全部", - ip_subnet: "IP/子网掩码", - ip_range: "IP范围", - timeout:"超时", - areaIpPrefix:"禁止使用的值: ", - domainCheck:"请输入有效的域名", - checkParent:"配置类型必须与上级配置一致!", - specServiceCodeCheck:"协议号重复", - compareDate:"结束时间不能早于开始时间", - hexCheck:"请输入十六进制字符", - invisibleChar:"请输入可见字符", - hasInvisibleChar:"标签{0}包含不可见字符", - haveInvisibleChar:"标签{0}包含不可见字符", - httpCheck:"请输入正确的URL(http[s]://xxx.xx)", - crlCheck:"请输入正确的CRL(http://xxx.xx.crl)", - failed:"获取失败", - go_back:"返回", - log_5_minutes:"5分钟日志量", - log_1_hour:"1小时日志量", - input:"请输入 ", - protocolPort:"端口大于0时必须选择TCP协议或者UDP协议", - protocolPort1:"只有tcp,udp协议端口号可以不为0", - netAddress:"C类IP地址网络位必须相同", - addrPoolUnique:"地址池已存在", - asnNoUnique:"ASN号已存在", - asnMustExists:"ASN号必须存在于ASN组中", - orgMustExists:"ASN组织 必须存在于ASN组中并且包含已审核ASN IP", - areaUnique:"该区域已存在", - config_sync_tip:"系统正在维护中,暂时不可访问!", - ipMaskSole:"IP已存在", - noStrategyCheck:"策略组下无有效的欺骗IP配置", - keywordLength:"请输入一个长度介于4 和1024 之间的字符串", - arbitrary:"任意", - log_trend:"日志趋势", - info:"提示", - protect_warn:"该策略执行条件过于宽泛,会消耗较多的计算资源。慎用!", - log_no_data:"本小时无数据", - expireTip:"开始时间结束时间间隔至少为1分钟", - compareTip:"开始时间不能小于当前时间加上2分钟 ", - compileIdCheck:"请输入正确的查询格式", - compileIdCheckNum:"查询个数不能大于200", - rangeCross0:"IP{0}不能介于{1}和{2}", - rangeCross1:"IP范围{0}和IP范围{1}有交集", - protectedCfgUnique:"关键字已存在" - }); -}(jQuery)); +/* + * Translated default messages for the jQuery validation plugin. + * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) + */ +(function ($) { + $.extend($.validator.messages, { + required: "必填信息", + remote: "请修正该信息", + email: "请输入正确格式的电子邮件", + url: "请输入有效的网址", + date: "请输入有效的日期", + dateISO: "请输入有效的日期 (ISO).", + number: "请输入有效的数字", + digits: "只能输入整数", + creditcard: "请输入有效的信用卡号", + equalTo: "请再次输入相同的值", + accept: "请输入拥有合法后缀名的字符串", + maxlength: $.validator.format("请输入一个长度最多是 {0} 的字符串"), + minlength: $.validator.format("请输入一个长度最少是 {0} 的字符串"), + rangelength: $.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"), + range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), + max: $.validator.format("请输入一个最大为 {0} 的值"), + min: $.validator.format("请输入一个最小为 {0} 的值"), + noBlankSpace:"不能为空格", + ip:"请填写正确的IP地址", + ipCheck:"请填写正确的IP地址", + ipMask:"请填写正确的IP地址/掩码", + ipPart:"IP部分格式错误", + //ipv6MaskPart:"掩码为不大于128的2的指数幂", + ipv6MaskPart:"掩码介于2到128", + //ipMaskRange:"IP掩码介于0到32", + ipMaskRange:"IP掩码介于16到32", + srcIpNotEqDestIp:"源IP ", + destIpNotEqDestIp:" 与目的IP ", + IpNotEqDestIp:" 不能相同", + srcIpIsNotValue:"源IP不能为 ", + destIpIsNotValue:"目的IP不能为", + ipRange:"IP范围格式错误", + ipRange1:"起始IP值应小于结束IP值", + portCheck:"请填写正确的端口", + notStartZero:"请填写正确的数值", + portRange:"端口应小于65536,非0数字不能以0开头", + portMaskRange:"端口以及掩码范围0-65535,非0数字不能以0开头。格式为\"端口/掩码\"", + chooseAreaOrIsp:"区域和运营商必选一个", + areaControl:"丢弃和回流动作不能区域管控", + ip_type: "ip类型", + ip_pattern: "ip格式", + area: "区域", + isp: "运营商", + close_info: "关闭", + client_ip: "源IP", + ipv4: "IPv4", + ipv6: "IPv6", + over6: "4over6", + over4: "6over4", + ipv4v6:"请输入合法的IP地址如IPv4(0.0.0.0)或IPv6(::)", + all: "全部", + ip_subnet: "IP/子网掩码", + ip_range: "IP范围", + timeout:"超时", + areaIpPrefix:"禁止使用的值: ", + domainCheck:"请输入有效的域名", + checkParent:"配置类型必须与上级配置一致!", + specServiceCodeCheck:"协议号重复", + compareDate:"结束时间不能早于开始时间", + hexCheck:"请输入十六进制字符", + invisibleChar:"请输入可见字符", + hasInvisibleChar:"标签{0}包含不可见字符", + haveInvisibleChar:"标签{0}包含不可见字符", + httpCheck:"请输入正确的URL(http[s]://xxx.xx)", + crlCheck:"请输入正确的CRL(http://xxx.xx.crl)", + failed:"获取失败", + go_back:"返回", + log_5_minutes:"5分钟日志量", + log_1_hour:"1小时日志量", + input:"请输入 ", + protocolPort:"端口大于0时必须选择TCP协议或者UDP协议", + protocolPort1:"只有tcp,udp协议端口号可以不为0", + netAddress:"C类IP地址网络位必须相同", + addrPoolUnique:"地址池已存在", + asnNoUnique:"ASN号已存在", + asnMustExists:"ASN号必须存在于ASN组中", + orgMustExists:"ASN组织 必须存在于ASN组中并且包含已审核ASN IP", + areaUnique:"该区域已存在", + config_sync_tip:"系统正在维护中,暂时不可访问!", + ipMaskSole:"IP已存在", + noStrategyCheck:"策略组下无有效的欺骗IP配置", + keywordLength:"请输入一个长度介于4 和1024 之间的字符串", + arbitrary:"任意", + log_trend:"日志趋势", + info:"提示", + protect_warn:"该策略执行条件过于宽泛,会消耗较多的计算资源。慎用!", + log_no_data:"本小时无数据", + expireTip:"开始时间结束时间间隔至少为1分钟", + compareTip:"开始时间不能小于当前时间加上2分钟 ", + compileIdCheck:"请输入正确的查询格式", + compileIdCheckNum:"查询个数不能大于200", + rangeCross0:"IP{0}不能介于{1}和{2}", + rangeCross1:"IP范围{0}和IP范围{1}有交集", + protectedCfgUnique:"关键字已存在", + addrList:"请输入合法的目标标识列表" + }); +}(jQuery)); diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 6efe13a93..f0bf8b85e 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -677,12 +677,19 @@ $(function(){ $("#actionSelect").find("option[value='']").remove(); } $("#isValid").selectpicker("hide");// 隐藏下拉框 + $("#addrType").selectpicker("hide");// 隐藏下拉框 }else if($("#seltype").val() == "isValid"){ $("#intype").hide();// 隐藏输入框 $("#actionSelect").selectpicker("hide");// 隐藏下拉框 + $("#addrType").selectpicker("hide");// 隐藏下拉框 + }else if($("#seltype").val() == "addrType"){ + $("#intype").hide();// 隐藏输入框 + $("#actionSelect").selectpicker("hide");// 隐藏下拉框 + $("#isValid").selectpicker("hide");// 隐藏下拉框 }else{ $("#actionSelect").selectpicker("hide");// 隐藏下拉框 $("#isValid").selectpicker("hide");// 隐藏下拉框 + $("#addrType").selectpicker("hide");// 隐藏下拉框 } // 改变 $("#seltype").on("change",function() { @@ -697,6 +704,8 @@ $(function(){ $("#actionSelect").selectpicker("show");// 显示下拉框 $("#isValid").find("option:first").attr("selected",true);// 清空action条件 $("#isValid").selectpicker("hide");// 隐藏下拉框 + $("#addrType").find("option:first").attr("selected",true);// 清空action条件 + $("#addrType").selectpicker("hide");// 隐藏下拉框 }else if($(this).val() == "isValid"){ $("#intype").hide();// 隐藏输入框 $("#intype").val("");// 清空input条件 @@ -705,6 +714,18 @@ $(function(){ $("#isValid").selectpicker("show");// 显示下拉框 $("#actionSelect").find("option:first").attr("selected",true);// 清空action条件 $("#actionSelect").selectpicker("hide");// 隐藏下拉框 + $("#addrType").find("option:first").attr("selected",true);// 清空action条件 + $("#addrType").selectpicker("hide");// 隐藏下拉框 + }else if($(this).val() == "addrType"){ + $("#intype").hide();// 隐藏输入框 + $("#intype").val("");// 清空input条件 + $("#addrType").find("option").removeAttr("selected",false); + $("#addrType").selectpicker("refresh"); + $("#addrType").selectpicker("show");// 显示下拉框 + $("#actionSelect").find("option:first").attr("selected",true);// 清空action条件 + $("#actionSelect").selectpicker("hide");// 隐藏下拉框 + $("#isValid").find("option:first").attr("selected",true);// 清空action条件 + $("#isValid").selectpicker("hide");// 隐藏下拉框 }else{ $("#intype").show(); // 显示输入框 $("#intype").val("");// 清空input条件 @@ -712,6 +733,8 @@ $(function(){ $("#actionSelect").selectpicker("hide");// 隐藏下拉框 $("#isValid").find("option:first").attr("selected",true);// 清空action条件 $("#isValid").selectpicker("hide");// 隐藏下拉框 + $("#addrType").find("option:first").attr("selected",true);// 清空action条件 + $("#addrType").selectpicker("hide");// 隐藏下拉框 } });