1、HTTP重定向配置业务功能提交;2、HTTP替换配置列表界面增加controller消息显示;3、修正ntc

http配置新增时的区域IP信息保存
Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
zhangwei
2018-06-29 13:56:08 +08:00
parent b30e88c3b8
commit 07550c8137
11 changed files with 2078 additions and 43 deletions

View File

@@ -370,7 +370,14 @@ public final class Constants {
public static final String BGP_IP_REGION = Configurations.getStringProperty("bgp_ip_region","bgp_ip");
public static final String KEYWORD_EXPR = Configurations.getStringProperty("keyword_expr","***and***");
//用户自定义域分隔符
public static final String USER_REGION_SPLIT = Configurations.getStringProperty("user_region_split", ";");
//用户自定义域占位符
public static final String USER_REGION_PLACEHOLDER = Configurations.getStringProperty("user_region_placeholder", ";;");
public static final String USER_REGION_SPLIT = Configurations.getStringProperty("user_region_split", ";");
//用户自定义域占位符
public static final String USER_REGION_PLACEHOLDER = Configurations.getStringProperty("user_region_placeholder", ";;");
//HTTP重定向配置域
public static final String HTTP_REDIRECT_URL_REGION = Configurations.getStringProperty("http_redirect_url_region","PXY_CTRL_HTTP_URL");
public static final String HTTP_REDIRECT_REQ_HEAD_REGION = Configurations.getStringProperty("http_redirect_req_hdr_region","PXY_CTRL_HTTP_REQ_HDR");
public static final String HTTP_REDIRECT_RES_HEAD_REGION = Configurations.getStringProperty("http_redirect_res_hdr_region","PXY_CTRL_HTTP_RES_HDR");
public static final String HTTP_REDIRECT_REQ_BODY_REGION = Configurations.getStringProperty("http_redirect_req_body_region","PXY_CTRL_HTTP_REQ_BODY");
public static final String HTTP_REDIRECT_RES_BODY_REGION = Configurations.getStringProperty("http_redirect_res_body_region","PXY_CTRL_HTTP_RES_BODY");
}

View File

@@ -64,6 +64,7 @@ import com.nis.web.service.configuration.ControlPolicyService;
import com.nis.web.service.configuration.DnsIpCfgService;
import com.nis.web.service.configuration.DnsResStrategyService;
import com.nis.web.service.configuration.FileTransferCfgService;
import com.nis.web.service.configuration.HttpRedirectCfgService;
import com.nis.web.service.configuration.IpCfgService;
import com.nis.web.service.configuration.MailCfgService;
import com.nis.web.service.configuration.NumCfgService;
@@ -159,6 +160,8 @@ public class BaseController {
protected PolicyGroupInfoService policyGroupInfoService;
@Autowired
protected DnsResStrategyService dnsResStrategyService;
@Autowired
protected HttpRedirectCfgService httpRedirectCfgService;
/**
* 管理基础路径
*/

View File

@@ -0,0 +1,188 @@
package com.nis.web.controller.configuration.proxy;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.Logical;
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.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
/**
* http重定向策略
* @author zhangwei
*
*/
@Controller
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
public class HttpRedirectPolicyController extends BaseController{
@RequestMapping(value = {"list"})
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg){
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg);
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/proxy/control/httpRedirectList";
}
@RequestMapping(value = {"form"})
@RequiresPermissions(value={"control:httpRedirect:config"})
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){
if(StringUtils.isNotBlank(ids)){
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids));
HttpUrlCfg urlCfg = new HttpUrlCfg();
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
entity.setHttpUrl(urlCfg);
HttpReqHeadCfg reqHdrCfg = new HttpReqHeadCfg();
reqHdrCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
entity.setHttpReqHdr(reqHdrCfg);
HttpResHeadCfg resHdrCfg = new HttpResHeadCfg();
resHdrCfg.setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
entity.setHttpResHdr(resHdrCfg);
HttpBodyCfg reqBodyCfg = new HttpBodyCfg();
reqBodyCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
entity.setHttpReqBody(reqBodyCfg);
HttpBodyCfg resBodyCfg = new HttpBodyCfg();
resBodyCfg.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
entity.setHttpResBody(resBodyCfg);
int httpReqCfgNum = entity.getHttpUrlList().size()+
entity.getHttpReqBodyList().size()+
entity.getHttpReqHdrList().size();
int httpResCfgNum = entity.getHttpResHdrList().size()+
entity.getHttpResBodyList().size();
model.addAttribute("httpReqCfgNum", httpReqCfgNum);
model.addAttribute("httpResCfgNum", httpResCfgNum);
if(entity.getHttpUrlList().size()==0){
entity.getHttpUrlList().add(urlCfg);
}
if(entity.getHttpReqHdrList().size()==0){
entity.getHttpReqHdrList().add(reqHdrCfg);
}
if(entity.getHttpResHdrList().size()==0){
entity.getHttpResHdrList().add(resHdrCfg);
}
if(entity.getHttpReqBodyList().size()==0){
entity.getHttpReqBodyList().add(reqBodyCfg);
}
if(entity.getHttpResBodyList().size()==0){
entity.getHttpResBodyList().add(resBodyCfg);
}
initUpdateFormCondition(model,entity);
}else{
//设置http各类配置的配置域类型
HttpUrlCfg urlCfg = new HttpUrlCfg();
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
entity.setHttpUrl(urlCfg);
HttpReqHeadCfg reqHdrCfg = new HttpReqHeadCfg();
reqHdrCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
entity.setHttpReqHdr(reqHdrCfg);
HttpResHeadCfg resHdrCfg = new HttpResHeadCfg();
resHdrCfg.setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
entity.setHttpResHdr(resHdrCfg);
HttpBodyCfg reqBodyCfg = new HttpBodyCfg();
reqBodyCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
entity.setHttpReqBody(reqBodyCfg);
HttpBodyCfg resBodyCfg = new HttpBodyCfg();
resBodyCfg.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
entity.setHttpResBody(resBodyCfg);
List<HttpUrlCfg> urlList=new ArrayList<HttpUrlCfg>();
urlList.add(urlCfg);
entity.setHttpUrlList(urlList);
List<HttpReqHeadCfg> reqHdrList=new ArrayList<HttpReqHeadCfg>();
reqHdrList.add(reqHdrCfg);
entity.setHttpReqHdrList(reqHdrList);
List<HttpResHeadCfg> resHdrList=new ArrayList<HttpResHeadCfg>();
resHdrList.add(resHdrCfg);
entity.setHttpResHdrList(resHdrList);
List<HttpBodyCfg> reqBodyList=new ArrayList<HttpBodyCfg>();
reqBodyList.add(reqBodyCfg);
entity.setHttpReqBodyList(reqBodyList);
List<HttpBodyCfg> resBodyList=new ArrayList<HttpBodyCfg>();
resBodyList.add(resBodyCfg);
entity.setHttpResBodyList(resBodyList);
initFormCondition(model,entity);
}
model.addAttribute("_cfg", entity);
return "/cfg/proxy/control/httpRedirectForm";
}
@RequestMapping(value = {"saveOrUpdate"})
@RequiresPermissions(value={"control:httpRedirect:config"})
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
@ModelAttribute("cfg")CfgIndexInfo cfg){
try{
httpRedirectCfgService.saveHttpCfg(cfg);
addMessage(model,"save_success");
}catch(Exception e){
logger.error("信息保存失败",e);
e.printStackTrace();
addMessage(model,"save_failed");
}
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+cfg.getFunctionId();
}
@RequestMapping(value = {"ajaxHttpSubList"})
@RequiresPermissions(value={"control:httpRedirect:config"})
public String ajaxHttpSubList(Model model,Long cfgId,Integer index) {
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId);
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
return "/cfg/proxy/control/httpRedirectSubList";
}
@RequestMapping(value = {"delete"})
@RequiresPermissions(value={"control:httpRedirect:config"})
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){
httpRedirectCfgService.updateHttpCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+functionId;
}
@RequestMapping(value = {"audit"})
@RequiresPermissions(value={"control:httpRedirect:audit"})
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
CfgIndexInfo entity = new CfgIndexInfo();
String[] idArray = ids.split(",");
for(String id :idArray){
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
httpRedirectCfgService.auditHttpCfg(entity,isAudit);
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("http重定向配置下发失败"+e.getMessage());
addMessage(redirectAttributes, e.getMessage());
}
}
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+functionId;
}
}

View File

@@ -0,0 +1,434 @@
package com.nis.web.service.configuration;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import com.nis.domain.Page;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.AvFileSampleCfg;
import com.nis.domain.configuration.AvSignSampleCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.DnsDomainCfg;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.SslKeywordCfg;
import com.nis.domain.maat.MaatCfg;
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
import com.nis.domain.maat.ToMaatBean;
import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.maat.MaatCfg.DigestCfg;
import com.nis.domain.maat.MaatCfg.GroupCfg;
import com.nis.domain.maat.MaatCfg.IpCfg;
import com.nis.domain.maat.MaatCfg.StringCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.IpUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.dao.configuration.WebsiteCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
import com.nis.web.service.CrudService;
/**
* 网站相关配置事务类
* @author dell
*
*/
@Service
public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
@Autowired
protected WebsiteCfgDao websiteCfgDao;
@Autowired
protected AreaIpCfgDao areaIpCfgDao;
public CfgIndexInfo getHttpCfg(Long cfgId){
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
List<HttpReqHeadCfg> httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity);
List<HttpResHeadCfg> httpResHdrList = websiteCfgDao.getHttpResHdrList(entity);
entity.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
entity.setHttpReqBodyList(httpReqBodyList);
entity.setHttpReqHdrList(httpReqHdrList);
entity.setHttpResBodyList(httpResBodyList);
entity.setHttpResHdrList(httpResHdrList);
entity.setHttpUrlList(httpUrlList);
return entity;
}
public Page<CfgIndexInfo> getHttpRedirectList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
List<CfgIndexInfo> list = websiteCfgDao.getWebsiteList(entity);
page.setList(list);
return page;
}
public void saveHttpCfg(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
websiteCfgDao.saveCfgIndex(entity);
if(entity.getHttpUrlList()!=null){
for(HttpUrlCfg cfg:entity.getHttpUrlList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
websiteCfgDao.saveHttpUrlCfg(cfg);
}
}
if(entity.getHttpReqHdrList()!=null){
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpReqHdrCfg(cfg);
}
}
if(entity.getHttpResHdrList()!=null){
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpResHdrCfg(cfg);
}
}
if(entity.getHttpReqBodyList()!=null){
for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
websiteCfgDao.saveHttpBodyCfg(cfg);
}
}
if(entity.getHttpResBodyList()!=null){
for(HttpBodyCfg cfg:entity.getHttpResBodyList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
websiteCfgDao.saveHttpBodyCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
}else{
websiteCfgDao.updateCfgIndex(entity);
//无效子配置后,再新增子配置
websiteCfgDao.deleteHttpUrlCfg(entity);
websiteCfgDao.deleteHttpReqHdrCfg(entity);
websiteCfgDao.deleteHttpResHdrCfg(entity);
websiteCfgDao.deleteHttpBodyCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getHttpUrlList()!=null){
for(HttpUrlCfg cfg:entity.getHttpUrlList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
websiteCfgDao.saveHttpUrlCfg(cfg);
}
}
if(entity.getHttpReqHdrList()!=null){
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpReqHdrCfg(cfg);
}
}
if(entity.getHttpResHdrList()!=null){
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
cfg.setDistrict(cfg.getDistrictShowName());
}
websiteCfgDao.saveHttpResHdrCfg(cfg);
}
}
if(entity.getHttpReqBodyList()!=null){
for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
websiteCfgDao.saveHttpBodyCfg(cfg);
}
}
if(entity.getHttpResBodyList()!=null){
for(HttpBodyCfg cfg:entity.getHttpResBodyList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
websiteCfgDao.saveHttpBodyCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
public void updateHttpCfgValid(Integer isValid,String ids,Integer functionId){
CfgIndexInfo entity = new CfgIndexInfo();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
entity.setTableName(CfgIndexInfo.getTablename());
entity.setFunctionId(functionId);
websiteCfgDao.updateCfgValid(entity);
//查询子配置
entity = this.getHttpCfg(Long.parseLong(id));
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
HttpUrlCfg cfg = new HttpUrlCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpUrlCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
HttpReqHeadCfg cfg = new HttpReqHeadCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpReqHeadCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
HttpResHeadCfg cfg = new HttpResHeadCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpResHeadCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
if((entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0) ||
(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0)){
HttpBodyCfg cfg = new HttpBodyCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpBodyCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
}
}
public void auditHttpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
//修改数据库审核状态信息
entity.setTableName(CfgIndexInfo.getTablename());
websiteCfgDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
//查询子配置并修改审核状态
entity = this.getHttpCfg(entity.getCfgId());
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
HttpUrlCfg cfg = new HttpUrlCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpUrlCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
HttpReqHeadCfg cfg = new HttpReqHeadCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpReqHeadCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpReqHdrList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
HttpResHeadCfg cfg = new HttpResHeadCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpResHeadCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpResHdrList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
if((entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0) ||
(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0)){
HttpBodyCfg cfg = new HttpBodyCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(HttpBodyCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
if(entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpReqBodyList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
if(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0){
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpResBodyList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//判断http配置是否需要设置自定义域参数
String actionValue = DictUtils.getDictCode("SERVICE_ACTION", "action_monit");
String userRegion = "";
//只有监测业务,并且头域的匹配区域不匹配字典中的信息时需要设置
if(!actionValue.equals("默认") && entity.getAction().equals(Integer.parseInt(actionValue))){
//请求头域
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpReqHdrList()){
String dictValue = DictUtils.getDictCode("REQUEST_HEADER_DISTRICT", head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
}
}
}
}
//应答头域
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpResHdrList()){
String dictValue = DictUtils.getDictCode("RESPONSE_HEADER_DISTRICT", head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
}
}
}
}
maatCfg.setUserRegion(userRegion);
}
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("http配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("http配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("http配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("http配置取消配置响应信息"+result.getMsg());
}
}
}

View File

@@ -167,8 +167,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
@@ -427,7 +426,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += ";"+"HTTP_HEADER="+head.getDistrict();
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
}
}
@@ -441,7 +440,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += ";"+"HTTP_HEADER="+head.getDistrict();
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
}
}

View File

@@ -0,0 +1,403 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<style type="text/css">
.boxSolid {
border: 1px solid #eeeeee
}
</style>
<script type="text/javascript">
$(document)
.ready(
function() {
$("#cancel").on("click", function() {
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
if($("#cfgId").val()!=""){
if($("#httpReqCfgNum").val()>0){
$("a[for='httpReqCfg']").parent().addClass("active");
$("a[for='httpResCfg']").parent().removeClass("active");
$(".httpResCfg").addClass("hidden").addClass("disabled");
$(".httpReqCfg").removeClass("hidden").removeClass(
"disabled");
}
if($("#httpResCfgNum").val()>0){
$("a[for='httpResCfg']").parent().addClass("active");
$("a[for='httpReqCfg']").parent().removeClass("active");
$(".httpReqCfg").addClass("hidden").addClass("disabled");
$(".httpResCfg").removeClass("hidden").removeClass(
"disabled");
}
}else{
$(".httpResCfg").addClass("hidden").addClass("disabled");
$(".httpReqCfg").removeClass("hidden").removeClass(
"disabled");
}
$("li").on("click", function() {
var region = ($(this).find("a").attr("for"));
if(region=="httpReqCfg"){
$(".httpResCfg").addClass("hidden").addClass("disabled");
$(".httpReqCfg").removeClass("hidden").removeClass(
"disabled");
}else{
$(".httpReqCfg").addClass("hidden").addClass("disabled");
$(".httpResCfg").removeClass("hidden").removeClass(
"disabled");
}
});
$("#cfgFrom").validate(
{
errorPlacement : function(error, element) {
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find(
"div[for='"
+ element.attr("name")
+ "']").append(error);
}
},
submitHandler : function(form) {
//loading('onloading...');
var flag = true;
//代表所有业务都隐藏了,提示必须增加一种业务数据
if(!$(".httpReqCfg").hasClass("hidden")){
if($(".httpReqCfg").find(".boxSolid").length==$(".httpReqCfg").find(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
if(!$(".httpResCfg").hasClass("hidden")){
if($(".httpResCfg").find(".boxSolid").length==$(".httpResCfg").find(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
//代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
if($("#areaIp").hasClass("hidden")) $("#areaIsp").find(".glyphicon-plus").click();
top.$.jBox.tip("<spring:message code='one_more_area'/>", "<spring:message code='info'/>");
return;
}
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
return;
}
})
if(flag){
//将disable属性的元素删除
$(".disabled").each(function(){
$(this).remove();
});
$("input[name$='exprType']").attr("disabled",false);
form.submit();
}
},
errorContainer : "#messageBox",
});
//业务内容增加
/* $("span[title='add']").on("click", function() {
$(".ipPort0").removeClass("hidden");
}); */
});
//业务窗口打开
var addContent = function(obj, contentClassName) {
$("." + contentClassName + "0").removeClass("hidden").removeClass(
"disabled");
/* $("."+contentClassName+"0").find("input,select").each(function(){
$(this).removeAttr("disabled");
}); */
$(obj).addClass("hidden");
}
//业务窗口关闭
var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
/* $("."+contentClassName).find("input,select").each(function(){
$(this).attr("disabled","true");
}); */
$("." + addBtnClassName).removeClass("hidden");
}
</script>
</head>
<body>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}">
<spring:message code="add"></spring:message>
</c:if>
<c:if test="${not empty _cfg.cfgId}">
<spring:message code="edit"></spring:message>
</c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/proxy/control/httpRedirect/saveOrUpdate"
method="post" class="form-horizontal">
<input type="hidden" name="cfgId" id="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId"
value="${_cfg.serviceId}">
<input type="hidden" id="httpReqCfgNum" value="${httpReqCfgNum}">
<input type="hidden" id="httpResCfgNum" value="${httpResCfgNum}">
<div class="form-body">
<div class="portlet-body flip-scroll">
<div class="row-fluid">
<div class="span12">
<div class="tabbable tabbable-custom tabs-left">
<!-- Only required for left/right tabs -->
<ul class="nav nav-tabs tabs-left">
<li class="active"><a href="#http_req_tab"
data-toggle="tab" for="httpReqCfg"
data_dldk="<spring:message code="http_req_control"/>"><spring:message
code="http_req_control" /></a></li>
<li><a href="#http_res_tab" data-toggle="tab" for="httpResCfg"
data_dldk="<spring:message code="http_res_control"/>"><spring:message
code="http_res_control" /></a></li>
</ul>
<div class="tab-content">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc" multiple
value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || _cfg.action==null}">checked</c:if>>
<spring:message code="${service.actionCode }" />
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 1 }">
<!--ip info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpIpTab"></c:set>
<h4 class="form-section" >
<spring:message code="http_ip_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:forEach items="${_cfg.ipPortList}" var="ipPort"
varStatus="status">
<c:set var="cfgName" value="ipPortList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index}
<c:if test="${empty ipPort.cfgId}">hidden disabled </c:if>" >
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
</c:forEach>
</div>
<!--/ip info-->
</c:if>
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configRegionValue eq _cfg.httpUrl.cfgType }">
<!--url info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpUrlTab"></c:set>
<h4 class="form-section" >
<spring:message code="http_url_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpUrl.cfgType}"></c:set> --%>
<c:forEach items="${_cfg.httpUrlList}" var="strCfg"
varStatus="status">
<c:set var="cfgName" value="httpUrlList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index}
<c:if test="${empty strCfg.cfgId}">hidden disabled </c:if>" >
<%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%>
</div>
</c:forEach>
</div>
<!--/url info-->
</c:if>
<c:if test="${region.configRegionValue eq _cfg.httpReqBody.cfgType }">
<!--request body info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpReqBodyTab"></c:set>
<h4 class="form-section" >
<spring:message code="http_req_body_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpReqBody.cfgType}"></c:set> --%>
<c:forEach items="${_cfg.httpReqBodyList}" var="strCfg"
varStatus="status">
<c:set var="cfgName" value="httpReqBodyList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty strCfg.cfgId}">hidden disabled </c:if>" >
<%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%>
</div>
</c:forEach>
</div>
<!--/request body info-->
</c:if>
<c:if test="${region.configRegionValue eq _cfg.httpResBody.cfgType }">
<!--response body info-->
<div class="httpResCfg">
<c:set var="tabName" value="httpResBodyTab"></c:set>
<h4 class="form-section" >
<spring:message code="http_res_body_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpResBody.cfgType}"></c:set> --%>
<c:forEach items="${_cfg.httpResBodyList}" var="strCfg"
varStatus="status">
<c:set var="cfgName" value="httpResBodyList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty strCfg.cfgId}">hidden disabled </c:if>" >
<%@include file="/WEB-INF/views/cfg/stringCfgForm.jsp"%>
</div>
</c:forEach>
</div>
</c:if>
</c:if>
<c:if test="${region.regionType eq 3 }">
<c:if test="${region.configRegionValue eq _cfg.httpReqHdr.cfgType }">
<!--request header info-->
<div class="httpReqCfg">
<c:set var="tabName" value="httpReqHdrTab"></c:set>
<h4 class="form-section" >
<spring:message code="http_req_hdr_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpReqHdr.cfgType}"></c:set> --%>
<c:forEach items="${_cfg.httpReqHdrList}" var="complexCfg"
varStatus="status">
<c:set var="cfgName" value="httpReqHdrList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty complexCfg.cfgId}">hidden disabled </c:if>">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
</c:forEach>
</div>
<!--/request header info-->
</c:if>
<c:if test="${region.configRegionValue eq _cfg.httpResHdr.cfgType }">
<!--response header info-->
<div class="httpResCfg">
<c:set var="tabName" value="httpResHdrTab"></c:set>
<h4 class="form-section" >
<spring:message code="http_res_hdr_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpResHdr.cfgType}"></c:set> --%>
<c:forEach items="${_cfg.httpResHdrList}" var="complexCfg"
varStatus="status">
<c:set var="cfgName" value="httpResHdrList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty complexCfg.cfgId}">hidden disabled </c:if>">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
</c:forEach>
</div>
<!--/response header info-->
</c:if>
</c:if>
</c:forEach>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,597 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<script>
$(document).ready(function() {
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
$("#seltype").change(function(){
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
});
//筛选功能初始化
filterActionInit();
$("#isAudit").change(function(){
page();
});
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
$(this).selectpicker('val',$(this).find('option:first').val());
$(this).find("option").attr("selected",false);
$(this).find("option:first").attr("selected",true);
});
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){
var openId=$(this).attr("id");
var closeId=$(this).attr("id").replace("open","close");
var index=$(this).attr("id").replace("open","");
$("#"+openId).hide();
$("#"+closeId).show();
//var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
$.ajax({
type:'post',
async:false,
url:'${ctx}/proxy/control/httpRedirect/ajaxHttpSubList',
data:{"cfgId":cfgId,"index":index},
dataType:"html",
success:function(data){
var subTab="<tr class='child'>"+
"<td style='border-right: 1px solid #FFFFFF;'>"+
"<input type='checkbox' hidden='hidden'/>"+
"</td>"+
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
html = html+data;
subTab=subTab+html;
subTab+="</td>";
subTab+="</tr>";
$("#"+openId).parent().parent().after(subTab);
$("div[name='tabTitle"+index+"']").get(0).click();
}
});
}
});
$("span[id^=close]").on("click",function(){
var closeId=$(this).attr("id");
var openId=$(this).attr("id").replace("close","open");
$("#"+closeId).hide();
$("#"+openId).show();
$("#"+closeId).parent().parent().next("tr").hide();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
});
//导入文件提示框
/* function toImport(cfgRegionCode,cfgType){
$("#cfgRegionCode").val(cfgRegionCode);
$("#cfgType").val(cfgType);
$("#import_modal").modal({
backdrop:"static",
keyboard:false,
show:true
});
}
//下载模板
function downLoadXLS(){
window.location ="${ctx}/proxy/control/httpRedirect/import/template?functionId="+$("#functionId").val()+"&cfgRegionCode="+$("#cfgRegionCode").val();
}
//导入配置
function importCfg(){
if($("#serviceId").val()==""){
alert("请选择action");
return ;
}
var fileName = $(".fileupload-preview", $("#importForm1")).text();
var $error = $('.alert-error', $("#importForm1"));
if(fileName==""){
$("span",$error).html("请选择xls或者xlsx格式文件进行导入...");
$error.removeClass("hide");
$error.addClass("show");
return false;
}else if(fileName.lastIndexOf("\.")==-1||fileName.substring(fileName.lastIndexOf("\.")+1).toLowerCase()!='xls' &&fileName.substring(fileName.lastIndexOf("\.")+1).toLowerCase()!='xlsx'){
$("span",$error).html("导入的文件后缀必须为xls或者xlsx...");
$error.removeClass("hide");
$error.addClass("show");
return false;
}
$("#import_modal").modal('hide');//导入文件隐藏
$("#importForm1").submit();
} */
</script>
</head>
<body>
<div class="page-content">
<%-- <div class="modal fade" id="import_modal" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<form id="importForm1" action="${ctx}/proxy/control/httpRedirect/importHttp/"
method="post" enctype="multipart/form-data" class="form-horizontal"
onsubmit="loading('<spring:message code='loading'/>');">
<input type="hidden" id="cfgRegionCode" name="cfgRegionCode"
value="" /> <input type="hidden" id="cfgType" name="cfgType"
value="" /> <input type="hidden" id="serviceId" name="serviceId"
value=""> <input type="hidden" id="protocolId"
name="protocolId" value=""> <input type="hidden"
id="functionId" name="functionId" value="${cfg.functionId }">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
<spring:message code="import" />
</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="alert alert-error hide">
<button class="close" data-dismiss="alert"></button>
<span></span>
</div>
<div class="row">
<div class="form-group">
<label class="control-label col-md-3"> <spring:message
code="action" />
</label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action">
<spring:message code="${service.actionCode }" />
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="col-md-2 control-label" style="margin-top:5px;"><spring:message
code="chooseFile" /></label>
<div class="controls">
<div class="fileupload fileupload-new"
data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input">
<i class="fa fa-fa fa-file"></i> <span
class="fileupload-preview"></span>
</div>
<span class="btn btn-file ">
<button type="button" class="btn fileupload-new">
<spring:message code="add" />
</button>
<button type="button" class="btn fileupload-exists">
<spring:message code="edit" />
</button> <input type="file" class="default" id="uploadFile"
name="file" /> <input type="hidden" name="flag"
value="${flag }" />
</span>
<button type="button" class="btn red fileupload-exists"
data-dismiss="fileupload" style="margin-left:-1px;">
<spring:message code="remove" />
</a>
<button type="button" onclick="downLoadXLS()"
class="btn black" style="margin-left:-1px">
<spring:message code="download" />
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn red" onclick="importCfg()">
<spring:message code="ok" />
</button>
<button type="button" class="btn" data-dismiss="modal">
<spring:message code="close" />
</button>
</div>
</div>
</div>
</form>
</div> --%>
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="website:http:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/proxy/control/httpRedirect/form?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
<!-- 导入功能按钮 -->
<%-- <div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle green" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="import"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<c:forEach items="${regionList}" var="region" varStatus="status">
<li><a href="javascript:;" onClick="toImport('${region.configRegionCode}','${region.configRegionValue}');">
<i class="fa fa-upload"></i><spring:message code="${region.configRegionValue}"/></a></li>
</c:forEach>
</ul>
</div> --%>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="http_redirect_control"></spring:message>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/control/httpRedirect/list?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
callback="page();" />
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<c:set var="state"><spring:message code='state'/></c:set>
<form:select path="isAudit" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="all_states"/></form:option>
<form:option value="0"><spring:message code="created"></spring:message></form:option>
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
</form:select>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
<form:option value="voipAccount.district"><spring:message code="strong_string"/></form:option> --%>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="website:http:config">
<sys:delRow url="${ctx}/proxy/control/httpRedirect/form" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/proxy/control/httpRedirect/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="website:http:audit">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/proxy/control/httpRedirect/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/proxy/control/httpRedirect/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/proxy/control/httpRedirect/audit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div>
<!-- /搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='request_number'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='type'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="config_time"/></label>
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="edit_time"/></label>
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="audit_time"/></label>
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="type"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr>
<td>
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}">
<a href="javascript:viewAreaInfo('${ctx}','${indexCfg.areaEffectiveIds }','${indexCfg.compileId }')" >
<spring:message code="yes"/>
</a>
</c:if>
</td>
<td>${indexCfg.requestName }</td>
<td>
<c:set var="classify"></c:set>
<c:forEach items="${fn:split(indexCfg.classify,',')}" var="classifyId" varStatus="status">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="classify" value="${fl.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="classify" value="${classify},${fl.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${classify}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(classify,20)}
</a>
</td>
<td>
<c:set var="attribute"></c:set>
<c:forEach items="${fn:split(indexCfg.attribute,',')}" var="attributeId" varStatus="status">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="attribute" value="${xz.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="attribute" value="${attribute},${xz.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${attribute}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(attribute,20)}
</a>
</td>
<td>
<c:set var="lableInfo"></c:set>
<c:forEach items="${fn:split(indexCfg.lable,',')}" var="lableId" varStatus="status">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="lableInfo" value="${lable.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="lableInfo" value="${lableInfo},${lable.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${lableInfo}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(lableInfo,20)}
</a>
</td>
<td>
<c:if test="${indexCfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isValid==1}"><spring:message code="yes"/></c:if>
<c:if test="${indexCfg.isValid==-1}"><spring:message code="deleted"/></c:if>
</td>
<td>
<c:choose>
<c:when test="${indexCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
</c:choose>
</td>
<td functionId="${indexCfg.functionId}" compileId="${indexCfg.compileId}" action="${indexCfg.action}"><div class="loading-total"></div></td>
<td>${indexCfg.creatorName }</td>
<td><fmt:formatDate value="${indexCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${indexCfg.editorName }</td>
<td><fmt:formatDate value="${indexCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${indexCfg.auditorName }</td>
<td><fmt:formatDate value="${indexCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,402 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<script>
$(document).ready(function() {
//$("div[name='tabTitle"+index+"']").get(0).click();
})
</script>
<style type="text/css">
</style>
</head>
<c:if test="${fn:length(_cfg.ipPortList)>0}">
<div id="ipTitle${index}" onclick="switchSubCfgTabInfo('ip',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_ip_title' />
<i id="ip${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
<c:if test="${fn:length(_cfg.httpUrlList)>0}">
<div id="urlTitle${index}" onclick="switchSubCfgTabInfo('url',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_url_title' />
<i id="url${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
<c:if test="${fn:length(_cfg.httpReqHdrList)>0}">
<div id="reqHdrTitle${index}" onclick="switchSubCfgTabInfo('reqHdr',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_req_hdr_title' />
<i id="reqHdr${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
<c:if test="${fn:length(_cfg.httpReqBodyList)>0}">
<div id="reqBodyTitle${index}" onclick="switchSubCfgTabInfo('reqBody',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_req_body_title' />
<i id="reqBody${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
<c:if test="${fn:length(_cfg.httpResHdrList)>0}">
<div id="resHdrTitle${index}" onclick="switchSubCfgTabInfo('resHdr',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_res_hdr_title' />
<i id="resHdr${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
<c:if test="${fn:length(_cfg.httpResBodyList)>0}">
<div id="resBodyTitle${index}" onclick="switchSubCfgTabInfo('resBody',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='http_res_body_title' />
<i id="resBody${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
</div>
<c:forEach items="${_cfg.ipPortList}" var="cfg">
<div id="ipInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
<c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='client_ip'/>:</label>
<label>
${cfg.srcIpAddress}
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='direction'/>:</label>
<label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='protocol'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpUrlList}" var="cfg">
<div id="urlInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null'/></c:when>
</c:choose>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
</div>
</div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpReqHdrList}" var="cfg">
<div id="reqHdrInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='district' />:</label><label>${cfg.district }</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
</div>
</div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpReqBodyList}" var="cfg">
<div id="reqBodyInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null'/></c:when>
</c:choose>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
</div>
</div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpResHdrList}" var="cfg">
<div id="resHdrInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='district' />:</label><label>${cfg.district }</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
</div>
</div>
</div>
</c:forEach>
<c:forEach items="${_cfg.httpResBodyList}" var="cfg">
<div id="resBodyInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null'/></c:when>
</c:choose>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
</div>
</div>
</div>
</c:forEach>
</html>

View File

@@ -57,6 +57,7 @@
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/control/httpReqReplace/list?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>

View File

@@ -57,6 +57,7 @@
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/control/httpResReplace/list?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>

View File

@@ -58,7 +58,7 @@
<c:forEach items="${_cfg.ipPortList}" var="cfg">
<div id="ipInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
@@ -68,7 +68,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='ip_pattern'/>:</label>
<label>
@@ -78,7 +78,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='client_ip'/>:</label>
<label>
@@ -88,7 +88,7 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='port_pattern'/>:</label>
<label>
@@ -98,24 +98,24 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='direction'/>:</label>
<label>
@@ -125,7 +125,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='protocol'/>:</label>
<label>
@@ -141,12 +141,12 @@
<c:forEach items="${_cfg.httpUrlList}" var="cfg">
<div id="urlInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
@@ -157,7 +157,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
@@ -169,7 +169,7 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
@@ -179,7 +179,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
@@ -191,17 +191,17 @@
<c:forEach items="${_cfg.httpReqHdrList}" var="cfg">
<div id="reqHdrInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='district' />:</label><label>${cfg.district }</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
@@ -214,7 +214,7 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
@@ -224,7 +224,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
@@ -234,7 +234,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
@@ -245,12 +245,12 @@
<c:forEach items="${_cfg.httpReqBodyList}" var="cfg">
<div id="reqBodyInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
@@ -261,7 +261,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
@@ -273,7 +273,7 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
@@ -283,7 +283,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
@@ -295,17 +295,17 @@
<c:forEach items="${_cfg.httpResHdrList}" var="cfg">
<div id="resHdrInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='district' />:</label><label>${cfg.district }</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
@@ -318,7 +318,7 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
@@ -328,7 +328,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
@@ -338,7 +338,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>
@@ -350,13 +350,13 @@
<c:forEach items="${_cfg.httpResBodyList}" var="cfg">
<div id="resBodyInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
@@ -367,7 +367,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
@@ -379,7 +379,7 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
@@ -389,7 +389,7 @@
</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-8">
<div class="form-group">
<label></label><label></label>
</div>