From e53f71484896e25f74314370f1f369944aaeb545 Mon Sep 17 00:00:00 2001 From: duandongmei Date: Fri, 24 Aug 2018 15:36:45 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/messages/message_en.properties | 25 ++++++++++++++++--- .../messages/message_zh_CN.properties | 20 +++++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 2fdfb983c..132a5ee96 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -617,7 +617,7 @@ val_dst_ip=Server IP format is incorrect or inconsistent with IP type val_dst_mask=Server IP mask format is incorrect or inconsistent with IP type val_dst_port=Server port is empty or incorrectly formatting(0-65535) val_dst_port_mask=Server port mask format is incorrect(0-65535) -val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4EFB\u610F) +val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4efb\u610f) val_direction=Direction should be 0(bidirectional) or 1(unidirectional) #===============protocol IP Import end================= @@ -1082,7 +1082,10 @@ app_built_in_features_config=APP Built-in Features app_ssl_config=APP SSL Cert Feature PXY_INTERCEPT_PKT_BIN=Intercept Messages certificate=Certificate -app_ssl_config=APP SSL Cert Feature +do_log=Do Log +no_log=Not Do Log +all_log=Log All Logs +framework_log=Only Framework Logs file_strategy=File Strategy file_desc=File Desc @@ -1090,4 +1093,20 @@ content_type=Content Type content_length=Content Length response_file=Response File APP_SUBSCRIBE_ID=Certification Mark Configuration -reply_file=Reply File \ No newline at end of file +reply_file=Reply File +app_topic_domain_cfg=Topic Website +#=====================about app Tcp================================= +min_tcp=Minimum Session Number +max_tcp=Maximum Session Number +tcp_unit=Unit / byte +app_tcp_config=APP TCP Session Feature +app_tcp_max_min=Maximum Session Should Not Exceed 4294967295 +new=New +basic_protocol_business_type=Basic protpcol business classification +tunnel_behavior_business_type=Tunnel behavior business classification +app_business_type=Application business classification +pxy_intercept_monit_keyring=Certificate Strategy +intercept_file_strategy=Intercept Certificate Strategy +root=Root Certificate +intermediate=Intermediate Certificate +end_entity=End-entity Certificate \ 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 ce2df4ee5..4546399a2 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1024,7 +1024,7 @@ MM_AV_IP=\u97F3\u89C6\u9891IP MM_PIC_IP=\u56FE\u7247IP MM_PIC_URL=\u56FE\u7247URL MM_AV_URL=\u97F3\u89C6\u9891URL -#INLINE_IP_CB=\u4E32\u8054IP +#INLINE_IP_CB=\u4e32\u8054IP MM_VOIP_IP=VoIP IP MM_VOIP_ACCOUNT=VoIP\u8D26\u53F7 #=======================for import ip configuration================= @@ -1089,4 +1089,20 @@ content_type=\u5185\u5BB9\u7C7B\u578B content_length=\u6587\u4EF6\u957F\u5EA6 response_file=\u54CD\u5E94\u6587\u4EF6 APP_SUBSCRIBE_ID=\u8BA4\u8BC1\u6807\u8BC6\u914D\u7F6E -reply_file=\u54CD\u5E94\u6587\u4EF6 \ No newline at end of file +reply_file=\u54CD\u5E94\u6587\u4EF6 +app_topic_domain_cfg=\u4E3B\u9898\u7F51\u7AD9 +#=====================about app Tcp================================= +min_tcp=\u6700\u5C0F\u4F1A\u8BDD\u6570 +max_tcp=\u6700\u5927\u4F1A\u8BDD\u6570 +tcp_unit=\u5355\u4F4D/\u5B57\u8282 +app_tcp_config=APP TCP\u4F1A\u8BDD\u5B57\u8282\u6570\u7279\u5F81 +app_tcp_max_min=\u6700\u5927\u4F1A\u8BDD\u6570\u4E0D\u80FD\u8D85\u8FC74294967295 +new=\u65B0 +basic_protocol_business_type=\u57FA\u7840\u534F\u8BAE\u4E1A\u52A1\u7C7B\u522B +tunnel_behavior_business_type=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u4E1A\u52A1\u7C7B\u522B +app_business_type=\u793E\u4EA4\u5E94\u7528\u4E1A\u52A1\u7C7B\u522B +pxy_intercept_monit_keyring=\u8BC1\u4E66\u7B56\u7565 +intercept_file_strategy=\u62E6\u622A\u8BC1\u4E66\u7B56\u7565 +root=\u6839\u8BC1\u4E66 +intermediate=\u4E2D\u95F4\u8BC1\u4E66 +end_entity=\u5B9E\u4F53\u8BC1\u4E66 \ No newline at end of file From d16db28a1ed6d0d1534093f641321d62a34bd1d4 Mon Sep 17 00:00:00 2001 From: duandongmei Date: Fri, 24 Aug 2018 15:41:05 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=8B=A6=E6=88=AA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E5=8A=9F=E8=83=BD=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/domain/callback/ProxyObjKeyring.java | 156 +++++++ .../domain/configuration/DnsResStrategy.java | 3 +- .../domain/configuration/PxyObjKeyring.java | 89 ++++ src/main/java/com/nis/util/FileUtils.java | 16 + .../nis/web/controller/BaseController.java | 3 + .../proxy/InterceptController.java | 24 +- .../proxy/PxyObjKeyringController.java | 211 +++++++++ .../dao/configuration/PxyObjKeyringDao.java | 19 + .../dao/configuration/PxyObjKeyringDao.xml | 326 +++++++++++++ .../java/com/nis/web/service/BaseService.java | 20 + .../ProxyFileStrategyService.java | 1 + .../configuration/PxyObjKeyringService.java | 173 +++++++ .../resources/sql/add_function_region.sql | 8 +- .../resources/sql/add_function_service.sql | 4 + .../resources/sql/add_pxy_obj_keyring.sql | 31 ++ .../views/cfg/intercept/interceptForm.jsp | 10 +- .../views/cfg/intercept/interceptList.jsp | 4 +- .../views/cfg/intercept/strateagy/form.jsp | 321 +++++++++++++ .../views/cfg/intercept/strateagy/list.jsp | 428 ++++++++++++++++++ .../cfg/maintenance/dnsResStrategy/list.jsp | 2 - .../webapp/static/global/scripts/common.js | 35 +- 21 files changed, 1869 insertions(+), 15 deletions(-) create mode 100644 src/main/java/com/nis/domain/callback/ProxyObjKeyring.java create mode 100644 src/main/java/com/nis/domain/configuration/PxyObjKeyring.java create mode 100644 src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java create mode 100644 src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java create mode 100644 src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml create mode 100644 src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java create mode 100644 src/main/resources/sql/add_function_service.sql create mode 100644 src/main/resources/sql/add_pxy_obj_keyring.sql create mode 100644 src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp diff --git a/src/main/java/com/nis/domain/callback/ProxyObjKeyring.java b/src/main/java/com/nis/domain/callback/ProxyObjKeyring.java new file mode 100644 index 000000000..7e12c56d6 --- /dev/null +++ b/src/main/java/com/nis/domain/callback/ProxyObjKeyring.java @@ -0,0 +1,156 @@ +package com.nis.domain.callback; + +import java.util.Date; + +import com.google.gson.annotations.Expose; +public class ProxyObjKeyring { + @Expose + private Long id; //compileId + @Expose + private Integer cfgId; //compileId + @Expose + private Integer keyringId; + @Expose + private Integer action; + @Expose + private Integer service; + @Expose + private Integer isValid; + @Expose + private Date opTime; + @Expose + private String keyringName; + @Expose + private String keyringType; + @Expose + private String privateKeyFile; + @Expose + private String publicKeyFile; + @Expose + private Integer expireAfter; + @Expose + private String publicKeyAlgo; + @Expose + private String crl; + + + + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public void setCfgId(Integer cfgId) { + this.cfgId = cfgId; + } + public Integer getCfgId() { + return cfgId; + } + public void setKeyringId(Integer keyringId) { + this.keyringId = keyringId; + } + public Integer getKeyringId() { + return keyringId; + } + + public String getKeyringName() { + return keyringName; + } + public void setKeyringName(String keyringName) { + this.keyringName = keyringName; + } + public String getKeyringType() { + return keyringType; + } + public void setKeyringType(String keyringType) { + this.keyringType = keyringType; + } + public String getPrivateKeyFile() { + return privateKeyFile; + } + public void setPrivateKeyFile(String privateKeyFile) { + this.privateKeyFile = privateKeyFile; + } + public String getPublicKeyFile() { + return publicKeyFile; + } + public void setPublicKeyFile(String publicKeyFile) { + this.publicKeyFile = publicKeyFile; + } + public Integer getExpireAfter() { + return expireAfter; + } + public void setExpireAfter(Integer expireAfter) { + this.expireAfter = expireAfter; + } + public String getPublicKeyAlgo() { + return publicKeyAlgo; + } + public void setPublicKeyAlgo(String publicKeyAlgo) { + this.publicKeyAlgo = publicKeyAlgo; + } + public String getCrl() { + return crl; + } + public void setCrl(String crl) { + this.crl = crl; + } + /** + * action + * @return action + */ + + public Integer getAction() { + return action; + } + /** + * @param action the action to set + */ + public void setAction(Integer action) { + this.action = action; + } + /** + * isValid + * @return isValid + */ + + public Integer getIsValid() { + return isValid; + } + /** + * @param isValid the isValid to set + */ + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + /** + * opTime + * @return opTime + */ + + public Date getOpTime() { + return opTime; + } + /** + * @param opTime the opTime to set + */ + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + + /** + * service + * @return service + */ + + public Integer getService() { + return service; + } + /** + * @param service the service to set + */ + public void setService(Integer service) { + this.service = service; + } +} diff --git a/src/main/java/com/nis/domain/configuration/DnsResStrategy.java b/src/main/java/com/nis/domain/configuration/DnsResStrategy.java index 1bc76aad7..8d4a6a9af 100644 --- a/src/main/java/com/nis/domain/configuration/DnsResStrategy.java +++ b/src/main/java/com/nis/domain/configuration/DnsResStrategy.java @@ -1,12 +1,13 @@ package com.nis.domain.configuration; +import javax.net.ssl.KeyManager; + /** * dns响应策略配置 * @author dell * */ public class DnsResStrategy extends BaseCfg { - /** * */ diff --git a/src/main/java/com/nis/domain/configuration/PxyObjKeyring.java b/src/main/java/com/nis/domain/configuration/PxyObjKeyring.java new file mode 100644 index 000000000..7ce57a738 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/PxyObjKeyring.java @@ -0,0 +1,89 @@ +package com.nis.domain.configuration; + +import java.util.Date; + +/** + * 拦截证书策略 + * @author dell + * + */ +public class PxyObjKeyring extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -2720862431960415564L; + + private String keyringType; + private String privateKeyFile; + private String publicKeyFile; + private Integer expireAfter; + private String publicKeyAlgo; + private String crl; + private String issuer; + private Date notBeforeTime; + private Date notAfterTime; + private String subject; + public String getKeyringType() { + return keyringType; + } + public void setKeyringType(String keyringType) { + this.keyringType = keyringType; + } + public String getPrivateKeyFile() { + return privateKeyFile; + } + public void setPrivateKeyFile(String privateKeyFile) { + this.privateKeyFile = privateKeyFile; + } + public String getPublicKeyFile() { + return publicKeyFile; + } + public void setPublicKeyFile(String publicKeyFile) { + this.publicKeyFile = publicKeyFile; + } + public Integer getExpireAfter() { + return expireAfter; + } + public void setExpireAfter(Integer expireAfter) { + this.expireAfter = expireAfter; + } + public String getPublicKeyAlgo() { + return publicKeyAlgo; + } + public void setPublicKeyAlgo(String publicKeyAlgo) { + this.publicKeyAlgo = publicKeyAlgo; + } + public String getCrl() { + return crl; + } + public void setCrl(String crl) { + this.crl = crl; + } + public String getIssuer() { + return issuer; + } + public void setIssuer(String issuer) { + this.issuer = issuer; + } + public Date getNotAfterTime() { + return notAfterTime; + } + public Date getNotBeforeTime() { + return notBeforeTime; + } + public void setNotAfterTime(Date notAfterTime) { + this.notAfterTime = notAfterTime; + } + public void setNotBeforeTime(Date notBeforeTime) { + this.notBeforeTime = notBeforeTime; + } + public String getSubject() { + return subject; + } + public void setSubject(String subject) { + this.subject = subject; + } + + +} diff --git a/src/main/java/com/nis/util/FileUtils.java b/src/main/java/com/nis/util/FileUtils.java index a7f78a319..46adb4699 100644 --- a/src/main/java/com/nis/util/FileUtils.java +++ b/src/main/java/com/nis/util/FileUtils.java @@ -11,6 +11,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.URLEncoder; import java.security.MessageDigest; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; import java.util.Enumeration; import javax.servlet.ServletOutputStream; @@ -747,6 +749,20 @@ public class FileUtils extends org.apache.commons.io.FileUtils { } } } + /** + * 获取公钥证书 + * @param inputStream + * @return + */ + public static X509Certificate getCertificateInfo(InputStream inputStream) throws Exception{ + X509Certificate ca = null; + CertificateFactory certificateFactory = CertificateFactory + .getInstance("X.509"); + ca= (X509Certificate) certificateFactory + .generateCertificate(inputStream); + return ca; + } + /** * 计算文件MD5 * @param file diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index d1210c25d..08cd1bc25 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -85,6 +85,7 @@ 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.ProxyFileStrategyService; +import com.nis.web.service.configuration.PxyObjKeyringService; import com.nis.web.service.configuration.RequestInfoService; import com.nis.web.service.configuration.WebsiteCfgService; import com.nis.web.service.configuration.XmppCfgService; @@ -189,6 +190,8 @@ public class BaseController { protected InterceptCfgService interceptCfgService; @Autowired protected ProxyFileStrategyService proxyFileStrategyService;//代理文件策略service + @Autowired + protected PxyObjKeyringService pxyObjKeyringService;//拦截策略service /** * 管理基础路径 diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java index 561d247c0..428417107 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java @@ -27,6 +27,7 @@ import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.InterceptPktBin; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.PxyObjKeyring; import com.nis.domain.configuration.template.IpAddrTemplate; import com.nis.exceptions.MaatConvertException; import com.nis.web.controller.configuration.CommonController; @@ -46,6 +47,17 @@ public class InterceptController extends CommonController{ Page page = websiteCfgService.getWebsiteList(searchPage, cfg); model.addAttribute("page", page); initPageCondition(model,cfg); + + //获取证书信息 + List certificateList=new ArrayList(); + if(cfg.getFunctionId().equals(200)){ + certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); + } + if(cfg.getFunctionId().equals(201)){ + certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); + } + model.addAttribute("certificateList", certificateList); + return "/cfg/intercept/interceptList"; } @RequestMapping(value = {"/interceptIpForm","interceptDomainForm"}) @@ -57,9 +69,15 @@ public class InterceptController extends CommonController{ }else{ initFormCondition(model,entity); } - //TODO获取证书信息 - //List resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1); - //model.addAttribute("dnsResStrategys", resStrategys); + //获取证书信息 + List certificateList=new ArrayList(); + if(entity.getFunctionId().equals(200)){ + certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); + } + if(entity.getFunctionId().equals(201)){ + certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); + } + model.addAttribute("certificateList", certificateList); model.addAttribute("_cfg", entity); return "/cfg/intercept/interceptForm"; diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java new file mode 100644 index 000000000..a31e3418f --- /dev/null +++ b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java @@ -0,0 +1,211 @@ +package com.nis.web.controller.configuration.proxy; + +import java.io.File; +import java.io.FileInputStream; +import java.security.KeyStore; +import java.security.Principal; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +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.bind.annotation.ResponseBody; +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.basics.PolicyGroupInfo; +import com.nis.domain.configuration.PxyObjKeyring; +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.FileUtils; +import com.nis.util.JsonMapper; +import com.nis.util.StringUtil; +import com.nis.web.controller.BaseController; + +/** + * 拦截策略 + * @author ddm + * + */ +@Controller +@RequestMapping("${adminPath}/proxy/intercept/strateagy") +public class PxyObjKeyringController extends BaseController { + + @RequestMapping(value = {"/form"}) + @RequiresPermissions(value={"proxy:intercept:config"}) + public String from(Model model, + HttpServletRequest request, + HttpServletResponse response, + String ids, + @ModelAttribute("cfg")PxyObjKeyring cfg + ,RedirectAttributes redirectAttributes){ + if(cfg == null){ + cfg=new PxyObjKeyring(); + } + if(!StringUtil.isEmpty(ids)){ + cfg = pxyObjKeyringService.getPxyObjKeyring(Long.valueOf(ids),-1); + initFormCondition(model, cfg); + model.addAttribute("isAdd", false); + }else{ + initFormCondition(model, cfg); + model.addAttribute("isAdd", true); + } + + model.addAttribute("_cfg", cfg); + return "/cfg/intercept/strateagy/form"; + } + + @RequestMapping(value = {"/saveOrUpdate"}) + @RequiresPermissions(value={"proxy:intercept:config"}) + public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")PxyObjKeyring cfg, + MultipartFile privateKeyFileI, + MultipartFile publicKeyFileI, + RedirectAttributes redirectAttributes){ + File file = null; + try{ + if(publicKeyFileI != null) { + // 获取公钥信息 + X509Certificate cert=FileUtils.getCertificateInfo(publicKeyFileI.getInputStream()); + String issuer=cert.getIssuerDN().getName();//颁发者 + Date notBefore=cert.getNotBefore();//起始时间 + Date notAfter=cert.getNotAfter();//结束时间 + String subject=cert.getSubjectDN().getName();//颁发给 + cfg.setIssuer(StringUtil.isEmpty(issuer)?"":issuer.trim()); + cfg.setSubject(StringUtil.isEmpty(subject)?"":subject.trim()); + cfg.setNotBeforeTime(notBefore); + cfg.setNotAfterTime(notAfter); + } + }catch (Exception e) { + logger.error("证书信息获取失败",e); + addMessage(redirectAttributes,"save_failed"); + } + + try{ + + if(publicKeyFileI != null) { + String filename = publicKeyFileI.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_"+ prefix, suffix); + publicKeyFileI.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 publicKeyFileAccessUrl = null; + if(!StringUtil.isEmpty(result)){ + ResponseData data = result.getData(); + publicKeyFileAccessUrl=data.getAccessUrl(); + cfg.setPublicKeyFile(publicKeyFileAccessUrl);; + } + } + if(privateKeyFileI != null) { + String filename = privateKeyFileI.getOriginalFilename(); + String prefix = FileUtils.getPrefix(filename, false); + String suffix = FileUtils.getSuffix(filename, false); + file = File.createTempFile("file_"+ prefix, suffix); + privateKeyFileI.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 privateKeyFileAccessUrl = null; + if(!StringUtil.isEmpty(result)){ + ResponseData data = result.getData(); + privateKeyFileAccessUrl=data.getAccessUrl(); + cfg.setPrivateKeyFile(privateKeyFileAccessUrl);; + } + } + pxyObjKeyringService.saveOrUpdate(cfg); + + addMessage(redirectAttributes,"save_success"); + }catch(Exception e){ + e.printStackTrace(); + addMessage(redirectAttributes,"save_failed"); + } + + return "redirect:" + adminPath +"/proxy/intercept/strateagy/list?functionId="+cfg.getFunctionId(); + } + + @RequestMapping(value = {"/list"}) + public String list(Model model,HttpServletRequest request,HttpServletResponse response + ,@ModelAttribute("cfg")PxyObjKeyring entity + ,RedirectAttributes redirectAttributes){ + //查询时left join policyGroup + Page page = pxyObjKeyringService.findPage(new Page(request, response,"r"), entity); + model.addAttribute("page", page); + initPageCondition(model); + return "/cfg/intercept/strateagy/list"; + } + + @RequestMapping(value = {"/delete"}) + @RequiresPermissions(value={"proxy:intercept:config"}) + public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId + ,Model model,HttpServletRequest request + ,HttpServletResponse response + ,RedirectAttributes redirectAttributes){ + if(!StringUtil.isEmpty(ids)){ + pxyObjKeyringService.delete(isAudit,isValid,ids,functionId); + } + + return "redirect:" + adminPath +"/proxy/intercept/strateagy/list?functionId="+functionId; + } + + @RequestMapping(value = {"/audit"}) + @RequiresPermissions(value={"proxy:intercept:confirm"}) + public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId, + RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); + Date auditTime=new Date(); + for(String id :idArray){ + try { + pxyObjKeyringService.audit(isAudit,isValid,functionId,id,auditTime); + } catch (MaatConvertException e) { + addMessage(redirectAttributes, e.getMessage()); + } + } + + } + return "redirect:" + adminPath +"/proxy/intercept/strateagy/list?functionId="+functionId; + } + @ResponseBody + @RequestMapping(value = "/validCfgId") + public boolean validCfgId(Long cfgId) { + PxyObjKeyring dns=pxyObjKeyringService.getPxyObjKeyring(cfgId,null); + if(dns == null ){ + return false; + }else{ + return true; + } + } +} diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java new file mode 100644 index 000000000..198b50b3b --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.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.configuration.DnsResStrategy; +import com.nis.domain.configuration.PxyObjKeyring; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; + +@MyBatisDao +public interface PxyObjKeyringDao extends CrudDao< PxyObjKeyring> { + List findPage( PxyObjKeyring pxyObjKeyring); + List findList(@Param("cfgId")Long cfgId + ,@Param("isAudit")Integer isAudit + ,@Param("isValid")Integer isValid,@Param("cfgType")String cfgType); + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml new file mode 100644 index 000000000..bfc5eff4b --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.cfg_id,r.cfg_desc + , r.keyring_type + ,r.private_key_file + ,r.public_key_file + ,r.expire_after + , r.public_key_algo + , r.crl + , r.issuer + ,r.subject + ,r.not_before_time + ,r.not_after_time + ,r.cfg_type,r.action + ,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id + ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id + ,r.is_area_effective,r.classify,r.attribute,r.lable + ,r.area_effective_ids,r.function_id,r.cfg_region_code,r.compile_id + + + + + + + + insert into pxy_obj_keyring ( + CFG_ID, + CFG_DESC, + ACTION, + IS_VALID, + IS_AUDIT, + CREATOR_ID, + CREATE_TIME, + EDITOR_ID, + EDIT_TIME, + AUDITOR_ID, + AUDIT_TIME, + SERVICE_ID, + REQUEST_ID, + IS_AREA_EFFECTIVE, + CLASSIFY, + ATTRIBUTE, + LABLE, + AREA_EFFECTIVE_IDS, + function_id, + keyring_type, + private_key_file, + public_key_file, + expire_after, + public_key_algo, + crl, + issuer, + subject, + not_before_time, + not_after_time, + cfg_type, + compile_Id, + cfg_region_code + )values ( + #{cfgId,jdbcType=VARCHAR}, + #{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}, + #{isAreaEffective,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR}, + #{attribute,jdbcType=VARCHAR}, + #{lable,jdbcType=VARCHAR}, + #{areaEffectiveIds,jdbcType=VARCHAR}, + #{functionId,jdbcType=INTEGER}, + #{keyringType, jdbcType=VARCHAR}, + #{privateKeyFile, jdbcType=VARCHAR}, + #{publicKeyFile, jdbcType=VARCHAR}, + #{expireAfter, jdbcType=INTEGER}, + #{publicKeyAlgo, jdbcType=VARCHAR}, + #{crl, jdbcType=VARCHAR}, + #{issuer, jdbcType=VARCHAR}, + #{subject, jdbcType=VARCHAR}, + #{notBeforeTime,jdbcType=TIMESTAMP}, + #{notAfterTime,jdbcType=TIMESTAMP}, + #{cfgType,jdbcType=VARCHAR}, + #{compileId,jdbcType=INTEGER}, + #{cfgRegionCode,jdbcType=INTEGER} + ) + + + + update pxy_obj_keyring + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + compile_Id = #{compileId,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + AUDITOR_ID = #{auditorId,jdbcType=INTEGER}, + + + AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP}, + + + 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}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + keyring_type = #{keyringType,jdbcType=VARCHAR}, + + + private_key_file = #{privateKeyFile,jdbcType=VARCHAR}, + + + public_key_file = #{publicKeyFile,jdbcType=VARCHAR}, + + + expire_after = #{expireAfter,jdbcType=VARCHAR}, + + + public_key_algo = #{publicKeyAlgo,jdbcType=VARCHAR}, + + + crl = #{crl,jdbcType=VARCHAR}, + + + + + and cfg_id = #{cfgId,jdbcType=INTEGER} + + and function_id = #{functionId,jdbcType=INTEGER} + + + + + \ 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 4df642004..9d06d4119 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -30,11 +30,13 @@ import com.nis.domain.SysRole; import com.nis.domain.SysUser; import com.nis.domain.callback.InlineIp; import com.nis.domain.callback.NtcDnsResStrategy; +import com.nis.domain.callback.ProxyObjKeyring; import com.nis.domain.configuration.AreaBean; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.DnsResStrategy; +import com.nis.domain.configuration.PxyObjKeyring; import com.nis.domain.maat.MaatCfg.GroupCfg; import com.nis.domain.maat.MaatCfg.IpCfg; import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; @@ -623,6 +625,24 @@ public abstract class BaseService { } return dstIp; } + //拦截策略 + public ProxyObjKeyring convertCallBackProxyObjKeyring(PxyObjKeyring cfg){ + ProxyObjKeyring proxyObjKeyring=new ProxyObjKeyring(); + proxyObjKeyring.setId(Long.valueOf(cfg.getCompileId())); + proxyObjKeyring.setCfgId(cfg.getCompileId()); + proxyObjKeyring.setCrl(cfg.getCrl()); + proxyObjKeyring.setExpireAfter(cfg.getExpireAfter()); + proxyObjKeyring.setKeyringId(cfg.getCompileId()); + proxyObjKeyring.setKeyringName(cfg.getCfgDesc()); + proxyObjKeyring.setKeyringType(cfg.getKeyringType()); + proxyObjKeyring.setPrivateKeyFile(cfg.getPrivateKeyFile()); + proxyObjKeyring.setPublicKeyAlgo(cfg.getPublicKeyAlgo()); + proxyObjKeyring.setPublicKeyFile(cfg.getPublicKeyFile()); + proxyObjKeyring.setService(cfg.getServiceId()); + proxyObjKeyring.setIsValid(cfg.getIsValid()); + proxyObjKeyring.setOpTime(cfg.getAuditTime()); + return proxyObjKeyring; + } //ip转换为callback用ip public NtcDnsResStrategy convertCallBackDnsResStrategy(DnsResStrategy cfg){ NtcDnsResStrategy resStrategy=new NtcDnsResStrategy(); 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 6cd2e7d8c..3fb48378a 100644 --- a/src/main/java/com/nis/web/service/configuration/ProxyFileStrategyService.java +++ b/src/main/java/com/nis/web/service/configuration/ProxyFileStrategyService.java @@ -44,6 +44,7 @@ public class ProxyFileStrategyService extends BaseService{ public ProxyFileStrategyCfg getCfgById(Long cfgId) { return proxyFileDao.getCfgById(cfgId); } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdate(ProxyFileStrategyCfg entity){ Date createTime=new Date(); diff --git a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java new file mode 100644 index 000000000..0e1a8c394 --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java @@ -0,0 +1,173 @@ +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.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.PxyObjKeyringDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + + + +/** + * 拦截证书管理 + * @author dell + * + */ +@Service +public class PxyObjKeyringService extends BaseService{ + @Autowired + protected PxyObjKeyringDao pxyObjKeyringDao; + + + /** + * 查询分页数据 + * @param page 分页对象 + * @param entity + * @return + */ + public Page findPage(Page page, PxyObjKeyring entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list=pxyObjKeyringDao.findPage(entity); + page.setList(list); + return page; + } + public List findPxyObjKeyrings(Long cfgId,Integer isValid,Integer isAudit,String cfgType) { + List list=pxyObjKeyringDao.findList(cfgId,isValid,isAudit,cfgType); + return list; + } + + public PxyObjKeyring getPxyObjKeyring(Long id,Integer isValid) { + List list=pxyObjKeyringDao.findList(id,isValid,null,null); + PxyObjKeyring dnsResStrategy=null; + if(list != null && list.size()>0){ + dnsResStrategy=list.get(0); + } + return dnsResStrategy; + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdate(PxyObjKeyring entity){ + Date createTime=new Date(); + setAreaEffectiveIds(entity); + entity.setIsValid(0); + entity.setIsAudit(0); + //新增 + if(StringUtil.isEmpty(entity.getCfgId())){ + entity.initDefaultValue(); + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + //调用服务接口获取compileId + List compileIds = new ArrayList(); + try { + compileIds = ConfigServiceUtil.getId(1,1); + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){ + entity.setCompileId(compileIds.get(0)); + } + pxyObjKeyringDao.insert(entity); + //修改 + }else{ + Date editTime=new Date(); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + + pxyObjKeyringDao.update(entity); + } + } + + /** + * + * @param isAudit + * @param isValid + * @param ids compileIds + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void delete(Integer isAudit,Integer isValid,String ids,Integer functionId){ + PxyObjKeyring entity = new PxyObjKeyring(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.valueOf(id)); + entity.setFunctionId(functionId); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + pxyObjKeyringDao.update(entity); + } + } + /** + * + * @param isAudit + * @param isValid + * @param ids cfgId + * @param functionId + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){ + PxyObjKeyring cfg=new PxyObjKeyring(); + cfg.setCfgId(Long.valueOf(id)); + cfg.setIsValid(isValid); + cfg.setIsAudit(isAudit); + cfg.setEditTime(auditTime); + cfg.setEditorId(UserUtils.getUser().getId()); + cfg.setAuditorId(UserUtils.getUser().getId()); + cfg.setAuditTime(auditTime); + pxyObjKeyringDao.update(cfg); + cfg=getPxyObjKeyring(cfg.getCfgId(), null); + String json=""; + if(cfg.getIsAudit()==1){ + List resStrategyList=new ArrayList(); + ProxyObjKeyring resStrategy=convertCallBackProxyObjKeyring(cfg); + resStrategyList.add(resStrategy); + //调用服务接口下发配置数据 + json=gsonToJson(resStrategyList); + 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 resStrategyList=new ArrayList<>(); + ProxyObjKeyring ntcPxyObjKeyring=convertCallBackProxyObjKeyring(cfg); + resStrategyList.add(ntcPxyObjKeyring); + //调用服务接口取消配置 + json=gsonToJson(resStrategyList); + logger.info("拦截策略配置配置参数:"+json); + //调用服务接口取消配置 + try { + ToMaatResult result = ConfigServiceUtil.put(json, 2); + logger.info("拦截策略配置响应信息:"+result.getMsg()); + } catch (Exception e) { + e.printStackTrace(); + logger.info("拦截策略配置配置失败"); + throw e; + } + } + } +} + + \ No newline at end of file diff --git a/src/main/resources/sql/add_function_region.sql b/src/main/resources/sql/add_function_region.sql index d4e7b16f6..5ceda8b1c 100644 --- a/src/main/resources/sql/add_function_region.sql +++ b/src/main/resources/sql/add_function_region.sql @@ -16,4 +16,10 @@ VALUES INSERT INTO function_region_dict () VALUES - ('subscribe_id', '0', '0,1', '0,1,2', '0,1,2,3', 177, 8, 3, 'NTC_SUBSCRIBE_ID', '', 'HTTP SUBSCRIBE_ID配置', 1, NULL, NULL,NULL , NULL, 1, 3, '', '', '', '', '', '', 7); \ No newline at end of file + ('subscribe_id', '0', '0,1', '0,1,2', '0,1,2,3', 177, 8, 3, 'NTC_SUBSCRIBE_ID', '', 'HTTP SUBSCRIBE_ID配置', 1, NULL, NULL,NULL , NULL, 1, 3, '', '', '', '', '', '', 7); + + +INSERT INTO function_region_dict + (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `dict_id`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_ip_type`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`) +VALUES + ('', '', '', '', '', 186, 570, 1, 'PXY_OBJ_KEYRING', '', '证书策略配置', 1, NULL, NULL, NULL, NULL, 2, 6, '', '', '', '', '', '', 1); diff --git a/src/main/resources/sql/add_function_service.sql b/src/main/resources/sql/add_function_service.sql new file mode 100644 index 000000000..72912cedd --- /dev/null +++ b/src/main/resources/sql/add_function_service.sql @@ -0,0 +1,4 @@ +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`) +VALUES + (116, 570, 0, 1, 'monit', 520, 'pxy_intercept_monit_keyring', '', 1, null, null, null, null, ''); \ No newline at end of file diff --git a/src/main/resources/sql/add_pxy_obj_keyring.sql b/src/main/resources/sql/add_pxy_obj_keyring.sql new file mode 100644 index 000000000..26749b723 --- /dev/null +++ b/src/main/resources/sql/add_pxy_obj_keyring.sql @@ -0,0 +1,31 @@ +CREATE TABLE `pxy_obj_keyring` ( + `cfg_id` bigint(20) COMMENT '请求策略号', + `cfg_desc` varchar(128) COMMENT '钥匙环名称', + `cfg_type` varchar(64) COMMENT '内容类型', + `keyring_type` varchar(128) COMMENT '证书类型', + `private_key_file` varchar(1024) COMMENT '私钥文件', + `public_key_file` varchar(1024) COMMENT '公钥文件', + `expire_after` int COMMENT '默认为30天,实体证书不可设置,界面填0', + `public_key_algo` varchar(64) DEFAULT NULL COMMENT '公钥算法', + `crl` varchar(64) DEFAULT NULL COMMENT 'CRL', + `action` int(11) NOT NULL COMMENT '阻断', + `is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0', + `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过', + `creator_id` int(11) NOT NULL COMMENT '取自sys_user.id', + `create_time` datetime NOT NULL, + `editor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `edit_time` datetime DEFAULT NULL, + `auditor_id` int(11) DEFAULT NULL COMMENT '取自sys_user.id', + `audit_time` datetime DEFAULT NULL, + `service_id` int(11) NOT NULL COMMENT '参考系统业务类型管理表', + `request_id` int(11) NOT NULL COMMENT '取自request_info.id', + `is_area_effective` int(11) NOT NULL DEFAULT 0 COMMENT '0否,1是', + `classify` varchar(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔', + `attribute` varchar(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔', + `lable` varchar(128) DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔', + `area_effective_ids` varchar(1024) DEFAULT '' COMMENT '多个英文逗号分隔', + `function_id` int(11) NOT NULL, + `cfg_region_code` int(11) DEFAULT NULL, + `compile_id` int(11) NOT NULL, + PRIMARY KEY (`cfg_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp index ac1864748..0ef46a3b9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp @@ -18,6 +18,7 @@ }); $(".action").on("change", function() { + switchAction($("input[name=action]:checked").val()); //拦截根据action切换动作部分 setInterceptDefaultInfo(""); $("#serviceId").val($(this).attr("serviceId")); @@ -253,10 +254,13 @@
+ code="certificate" />
@@ -268,7 +272,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp index d782a612f..1c15a5e45 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp @@ -354,7 +354,9 @@ ${indexCfg.userRegion2 } - ${indexCfg.userRegion1 } + + ${certificate.cfgDesc} + diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp new file mode 100644 index 000000000..ba1967947 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp @@ -0,0 +1,321 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+

+ +

+
+
+
+
+
+ + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+ checked="checked"> + checked="checked"> +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ " + class="required form-control" + style="background-color: transparent" aria-required="true" + type="text" value="${_cfg.publicKeyFile }"> + +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ " + class="required form-control" + style="background-color: transparent" aria-required="true" + type="text" value="${_cfg.privateKeyFile }"> + +
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + + +
+
+
+
+ + + <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp new file mode 100644 index 000000000..5c081a8f0 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/list.jsp @@ -0,0 +1,428 @@ +<%@ 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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + <%-- --%> + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + +
+ + + + + ${cfg.cfgDesc } + + + + + + + + ${fn:substring(cfg.privateKeyFile,0,20) } + + + + ${fn:substring(cfg.publicKeyFile,0,20) } + + ${cfg.expireAfter } + + ${fn:substring(cfg.issuer,0,20) } + + + + ${fn:substring(cfg.subject,0,20) } + + + + ${notBeforeTime } + + + ${notAfterTime } + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + ${cfg.areaEffectiveIds } + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp index 30f2d0782..f38aa4611 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/list.jsp @@ -267,7 +267,6 @@ - @@ -320,7 +319,6 @@ -
diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 701bf2f8b..2e6356f4a 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -476,7 +476,11 @@ var setInterceptDefaultInfo=function(cfgId){ $(".ratelimitAction").addClass("hidden"); $(".replaceAction").addClass("hidden"); if(interceptRatelimitIp == 'intercept_ratelimit_ip'){ - //TODO隐藏不可选IP 协议 + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=0]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=6]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=17]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=1]").attr("disabled",true); + $("select[name='"+protocolNamePrefix+"protocol']").selectpicker("refresh"); } if(interceptReplacePktBin == 'intercept_replace_pkt_bin'){ $("."+interceptReplacePktBin).addClass("hidden"); @@ -488,7 +492,11 @@ var setInterceptDefaultInfo=function(cfgId){ $(".ratelimitAction").removeClass("hidden"); $(".replaceAction").addClass("hidden"); if(interceptRatelimitIp == 'intercept_ratelimit_ip'){ - //TODO隐藏不可选IP 协议 + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=0]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=6]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=17]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=1]").attr("disabled",true); + $("select[name='"+protocolNamePrefix+"protocol']").selectpicker("refresh"); } if(interceptReplacePktBin == 'intercept_replace_pkt_bin'){ $("."+interceptReplacePktBin).addClass("hidden"); @@ -500,7 +508,11 @@ var setInterceptDefaultInfo=function(cfgId){ $(".ratelimitAction").addClass("hidden"); $(".replaceAction").removeClass("hidden"); if(interceptRatelimitIp == 'intercept_ratelimit_ip'){ - //TODO隐藏不可选IP 协议 + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=0]").attr("disabled",true); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=6]").attr("disabled",true); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=17]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=1]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").selectpicker("refresh"); } if(interceptReplacePktBin == 'intercept_replace_pkt_bin' && cfgId == ""){ $("."+interceptReplacePktBin).removeClass("hidden"); @@ -514,7 +526,11 @@ var setInterceptDefaultInfo=function(cfgId){ $(".ratelimitAction").addClass("hidden"); $(".replaceAction").addClass("hidden"); if(interceptRatelimitIp == 'intercept_ratelimit'){ - //TODO隐藏不可选IP 协议 + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=0]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=6]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=17]").removeAttr("disabled"); + $("select[name='"+protocolNamePrefix+"protocol']").find("option[value=1]").attr("disabled",true); + $("select[name='"+protocolNamePrefix+"protocol']").selectpicker("refresh"); } if(interceptReplacePktBin == 'intercept_replace_pkt_bin'){ $("."+interceptReplacePktBin).addClass("hidden"); @@ -648,6 +664,7 @@ var switchIpType=function(obj){ } } var switchAction=function(action){ + /********************dns reject时选择策略**********************/ if(action == 16){ //reject $(".policy").find("input,select,div,button").each(function(){ $(this).removeAttr("disabled"); @@ -660,6 +677,16 @@ var switchAction=function(action){ $(this).addClass("hidden"); }) } + + /*************************action切换时,隐藏白名单和drop的是否记录日志*****************************/ + //drop whitelist + if(action == 32 || action==128){ + $(".doLog").addClass("hidden"); + $("input[name=doLog][value=0]").prop("checked",true); + }else{ + $(".doLog").removeClass("hidden"); + $("input[name=doLog][value=2]").prop("checked",true); + } } //ipType、ipPattern、portPattern选项变化时调用此方法,添加默认值 var switchIpInfo=function(obj){ From ab2ca5ecc2fa885f16cd9e745957cb2cd302d069 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Fri, 24 Aug 2018 15:59:17 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=BD=91=E7=AB=99?= =?UTF-8?q?=EF=BC=8CVoIP=EF=BC=8C=E5=9F=BA=E7=A1=80=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=EF=BC=8C=E5=8A=A0=E5=AF=86=E9=9A=A7=E9=81=93=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?action=E5=88=87=E6=8D=A2=E5=A2=9E=E5=8A=A0=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0doLog=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp | 2 ++ src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp | 4 +++- src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp | 4 +++- src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp | 4 +++- .../webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp | 4 +++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp index 9caae33e5..ae74691a1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp @@ -7,6 +7,8 @@ $(function(){ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#cfgFrom").validate({ diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp index f19b72c92..1dc0c6a4b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp @@ -19,6 +19,8 @@ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); @@ -191,7 +193,7 @@
-
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp index 629e3777b..dd947a2b0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp @@ -19,6 +19,8 @@ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); @@ -193,7 +195,7 @@
-
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp index 85e95296d..53e438a70 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp @@ -17,6 +17,8 @@ $(function(){ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); if($(".action:checked").val()==64){ $("#ratelimit").show(); }else{ @@ -217,7 +219,7 @@ var delContent = function(contentClassName, addBtnClassName) {
-
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp index 0e2496d1a..0a7a2674a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -12,6 +12,8 @@ $(function(){ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); if($(".action:checked").val()==64){ $("#ratelimit").show(); }else{ @@ -252,7 +254,7 @@ var delContent = function(contentClassName, addBtnClassName) {
-
+
From d404305509580665d8dc477f3f68b170e0fceefe Mon Sep 17 00:00:00 2001 From: leijun Date: Fri, 24 Aug 2018 17:47:11 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87=E7=8A=B6=E6=80=81=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=86=8D=E6=AC=A1=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=8A=B6=E6=80=81=E6=9C=AA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E2=80=9C=E6=9C=AA=E5=AE=A1=E6=A0=B8=E2=80=9D=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E6=B2=A1=E6=9C=89=E8=AE=B0=E5=BD=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=BA=E5=91=98=E5=92=8C=E4=BF=AE=E6=94=B9=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/service/configuration/BgpCfgService.java | 4 ++++ .../com/nis/web/service/configuration/XmppCfgService.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/nis/web/service/configuration/BgpCfgService.java b/src/main/java/com/nis/web/service/configuration/BgpCfgService.java index 43820e5f7..64962d269 100644 --- a/src/main/java/com/nis/web/service/configuration/BgpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/BgpCfgService.java @@ -80,6 +80,8 @@ public class BgpCfgService extends CrudService { public void saveBgpCfg(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); + entity.setIsValid(0); + entity.setIsAudit(0); if(entity.getCfgId()==null){ Integer compileId = 0; try { @@ -142,6 +144,8 @@ public class BgpCfgService extends CrudService { } }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); bgpCfgDao.updateCfgIndex(entity); //无效子配置后,再新增子配置 bgpCfgDao.deleteIpCfg(entity); diff --git a/src/main/java/com/nis/web/service/configuration/XmppCfgService.java b/src/main/java/com/nis/web/service/configuration/XmppCfgService.java index 0c6559524..9be0fc237 100644 --- a/src/main/java/com/nis/web/service/configuration/XmppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/XmppCfgService.java @@ -72,6 +72,8 @@ public class XmppCfgService extends CrudService { public void saveXmppCfg(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); + entity.setIsValid(0); + entity.setIsAudit(0); if(entity.getCfgId()==null){ Integer compileId = 0; try { @@ -112,6 +114,8 @@ public class XmppCfgService extends CrudService { }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); xmppCfgDao.updateCfgIndex(entity); //无效子配置后,再新增子配置 xmppCfgDao.deleteXmppIpCfg(entity); From 5d2d5f2ba66ed27eb595fe194bd7817eca89837d Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Fri, 24 Aug 2018 17:52:39 +0800 Subject: [PATCH 05/10] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E9=9A=A7=E9=81=93=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BD=8D=E7=BD=AE2.=E6=9B=BF=E6=8D=A2=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E4=B8=AD=E4=B8=AD=E6=96=87=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/service/DictService.java | 2 +- .../views/cfg/encryptedtunnelbehav/form.jsp | 59 ++++++++++--------- .../webapp/WEB-INF/views/sys/dictList.jsp | 6 +- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/nis/web/service/DictService.java b/src/main/java/com/nis/web/service/DictService.java index d7cec3d74..a7439b6ea 100644 --- a/src/main/java/com/nis/web/service/DictService.java +++ b/src/main/java/com/nis/web/service/DictService.java @@ -52,7 +52,7 @@ public class DictService extends BaseService { }else {//修改 //累加修改记录 - String newRevision = "用户"+UserUtils.getUser().getName()+",在"+DateUtil.getCurrentDate(DateUtil.YYYY_MM_DD_HH24_MM_SS)+"修改!"; + String newRevision = "user:"+UserUtils.getUser().getName()+","+DateUtil.getCurrentDate(DateUtil.YYYY_MM_DD_HH24_MM_SS)+"edit"; StringBuilder revisionBuilder = new StringBuilder(newRevision); String oldRevision = sysDictName.getRevision(); if(!StringUtil.isBlank(oldRevision)){ diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp index 0a7a2674a..f0c173338 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -202,33 +202,7 @@ var delContent = function(contentClassName, addBtnClassName) {
-
-
- - -
- -
-
-
-
-
-
- -
- -
-
-
-
-
-
+
@@ -273,8 +247,37 @@ var delContent = function(contentClassName, addBtnClassName) {
+ +
+
+
+
+ + +
+ +
+
+
+
+
+
+ +
+ +
+
+
-
+
+
+
diff --git a/src/main/webapp/WEB-INF/views/sys/dictList.jsp b/src/main/webapp/WEB-INF/views/sys/dictList.jsp index 1ee5c7f8a..3e27b8900 100644 --- a/src/main/webapp/WEB-INF/views/sys/dictList.jsp +++ b/src/main/webapp/WEB-INF/views/sys/dictList.jsp @@ -109,7 +109,7 @@ html+=""; html+=""; html+=""; - html+=""; + html+=""; html+=""; html+=""; for(i=0;i:"; + html+=""; html+=""; @@ -281,7 +281,7 @@ - + From e62cace354955d58e0c54a297d0eb9975b4ca0ff Mon Sep 17 00:00:00 2001 From: wangxin Date: Fri, 24 Aug 2018 18:41:21 +0800 Subject: [PATCH 06/10] =?UTF-8?q?ip=E5=A4=8D=E7=94=A8=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E6=8F=90=E5=87=BA=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manipulation/IpMultiplexController.java | 2 +- .../cfg/manipulation/ipmulitiplex/form.jsp | 186 ++++++++++++++++++ 2 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java index fdbdae7db..04f58a69d 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/IpMultiplexController.java @@ -67,7 +67,7 @@ public class IpMultiplexController extends CommonController { } model.addAttribute("urlPrefix","/manipulation/ipmulitiplex"); model.addAttribute("requiresPermissionPrefix","ip:mulitiplex"); - return "/cfg/common/ipForm"; + return "/cfg/manipulation/ipmulitiplex/form"; } @RequestMapping(value = {"/saveOrUpdate"}) public String saveOrUpdateIp(String cfgName,RedirectAttributes model, IpPortCfg cfg) { diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp new file mode 100644 index 000000000..06464a712 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/form.jsp @@ -0,0 +1,186 @@ +<%@ 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/complexIpInfo.jsp" %> +
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ + <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ + \ No newline at end of file From 919c649e4e22d4506dd98d131e125db432f73ca7 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Fri, 24 Aug 2018 19:14:50 +0800 Subject: [PATCH 07/10] =?UTF-8?q?APP=E7=AD=96=E7=95=A5ssl=E3=80=81header?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/configuration/WebsiteCfgService.java | 2 +- src/main/resources/messages/message_en.properties | 3 +++ .../resources/messages/message_zh_CN.properties | 5 ++++- .../WEB-INF/views/cfg/app/appHeaderCfgForm.jsp | 4 ++-- .../WEB-INF/views/cfg/app/appSslCfgForm.jsp | 15 ++++++++------- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index af7332b89..79e27c9bd 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -542,7 +542,7 @@ public class WebsiteCfgService extends CrudService { } } } - if(entity.getSslList()!=null){ + if(entity.getNtcSubscribeIdCfgList()!=null){ for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index f4c220032..639f9207d 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1110,3 +1110,6 @@ intercept_file_strategy=Intercept Certificate Strategy root=Root Certificate intermediate=Intermediate Certificate end_entity=End-entity Certificate + +header=Header +layer=Layer \ 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 db9fd8987..d6cec7415 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1105,4 +1105,7 @@ pxy_intercept_monit_keyring=\u8BC1\u4E66\u7B56\u7565 intercept_file_strategy=\u62E6\u622A\u8BC1\u4E66\u7B56\u7565 root=\u6839\u8BC1\u4E66 intermediate=\u4E2D\u95F4\u8BC1\u4E66 -end_entity=\u5B9E\u4F53\u8BC1\u4E66 +end_entity=\u5B9E\u4F53\u8BC1\u4E66 + +header=\u5173\u952E\u5B57 +layer=\u5339\u914D\u533A\u57DF \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp index c9c845482..dbd704749 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp @@ -154,7 +154,7 @@ $(function(){
+
- - + + + @@ -168,7 +169,7 @@ $(function(){
- + <%-- --%> -
+
@@ -241,7 +243,7 @@ var delContent = function(contentClassName, addBtnClassName) {
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp index 0e2496d1a..6085c0699 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -12,6 +12,8 @@ $(function(){ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); if($(".action:checked").val()==64){ $("#ratelimit").show(); }else{ @@ -200,33 +202,7 @@ var delContent = function(contentClassName, addBtnClassName) {
-
-
- - -
- -
-
-
-
-
-
- -
- -
-
-
-
-
-
+
@@ -252,7 +228,7 @@ var delContent = function(contentClassName, addBtnClassName) {
-
+
@@ -271,12 +247,41 @@ var delContent = function(contentClassName, addBtnClassName) {
+ +
+
+
+
+ + +
+ +
+
+
+
+
+
+ +
+ +
+
+
-
+
+
+
- +
From 8c353a0560a3eeb92c7b9a98c61cad16be854578 Mon Sep 17 00:00:00 2001 From: leijun Date: Fri, 24 Aug 2018 20:27:27 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E9=9A=90=E8=97=8Fdo=5Flog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp index a43477c49..29e01e0f1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTcpCfgForm.jsp @@ -7,6 +7,8 @@ $(function(){ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); + var action=$("input[name='action']:checked").val(); + switchAction(action); }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#cfgFrom").validate({ @@ -158,15 +160,15 @@ $(function(){
- +
:"; html+=""+data.remark; html+="