新增访问阻断页面菜单;完善劫持、策略、注入脚本、镜像文件菜单相关功能

This commit is contained in:
wangwei
2019-05-22 19:57:28 +08:00
parent a68c454559
commit 5c00167d76
37 changed files with 1807 additions and 24 deletions

View File

@@ -28,6 +28,15 @@ public class ProxyFileHijackCfgAudit {
private String path;
@Expose
private String contentName;
@Expose
private Long opUser;
public Long getOpUser() {
return opUser;
}
public void setOpUser(Long opUser) {
this.opUser = opUser;
}
public String getContentName() {
return contentName;

View File

@@ -25,6 +25,16 @@ public class ProxyFileInsertScriptCfgAudit {
private String format;
@Expose
private String path;
@Expose
private Long opUser;
public Long getOpUser() {
return opUser;
}
public void setOpUser(Long opUser) {
this.opUser = opUser;
}
public Long getId() {
return id;
}

View File

@@ -0,0 +1,63 @@
package com.nis.domain.callback;
import com.nis.domain.configuration.BaseCfg;
/**
* http代理文件策略
* @author nanfang
*
*/
public class ProxyFileResponsePageCfg extends BaseCfg<ProxyFileResponsePageCfg> {
private static final long serialVersionUID = -1989406217948847813L;
public final static String TABLE_NAME = "pxy_profile_response_pages";//对应表名
private String indexTable = "pxy_profile_response_pages";
private String fileDesc;//文件描述
private String url;//文件保存的url
private String contentType;//内容类型如text/html取字典表contentType
private String md5;//文件md5值
private Long contentLength;//文件长度
public String getIndexTable() {
return indexTable;
}
public void setIndexTable(String indexTable) {
this.indexTable = indexTable;
}
public ProxyFileResponsePageCfg() {
super();
}
public String getFileDesc() {
return fileDesc;
}
public void setFileDesc(String fileDesc) {
this.fileDesc = fileDesc;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
public String getMd5() {
return md5;
}
public void setMd5(String md5) {
this.md5 = md5;
}
}

View File

@@ -0,0 +1,106 @@
package com.nis.domain.callback;
import java.util.Date;
import com.google.gson.annotations.Expose;
public class ProxyFileResponsePageCfgAudit {
@Expose
private Long id; //compileId
@Expose
private Integer cfgId; //compileId
@Expose
private Integer action;
@Expose
private Integer service;
@Expose
private Integer isValid;
@Expose
private Date opTime;
@Expose
private String format;
@Expose
private Long contentLength;
@Expose
private String path;
@Expose
private Long profileId;
@Expose
private String profileName;
@Expose
private Long opUser;
public Long getOpUser() {
return opUser;
}
public void setOpUser(Long opUser) {
this.opUser = opUser;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getCfgId() {
return cfgId;
}
public void setCfgId(Integer cfgId) {
this.cfgId = cfgId;
}
public Integer getAction() {
return action;
}
public void setAction(Integer action) {
this.action = action;
}
public Integer getService() {
return service;
}
public void setService(Integer service) {
this.service = service;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Date getOpTime() {
return opTime;
}
public void setOpTime(Date opTime) {
this.opTime = opTime;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public Long getProfileId() {
return profileId;
}
public void setProfileId(Long profileId) {
this.profileId = profileId;
}
public String getProfileName() {
return profileName;
}
public void setProfileName(String profileName) {
this.profileName = profileName;
}
}

View File

@@ -27,6 +27,15 @@ public class ProxyFileStrategyCfgAudit {
private Long fileId;
@Expose
private String fileDesc;
@Expose
private Long opUser;
public Long getOpUser() {
return opUser;
}
public void setOpUser(Long opUser) {
this.opUser = opUser;
}
public Long getId() {
return id;
}

View File

@@ -26,6 +26,15 @@ public class ProxyFileTrafficMirrorCfgAudit {
private List<String> addrList;
@Expose
private String addrType;
@Expose
private Long opUser;
public Long getOpUser() {
return opUser;
}
public void setOpUser(Long opUser) {
this.opUser = opUser;
}
public Long getId() {
return id;
}

View File

@@ -52,6 +52,7 @@ import com.nis.domain.basics.ServiceDictInfo;
import com.nis.domain.basics.SysDictInfo;
import com.nis.domain.callback.ProxyFileHijackCfg;
import com.nis.domain.callback.ProxyFileInsertScriptCfg;
import com.nis.domain.callback.ProxyFileResponsePageCfg;
import com.nis.domain.callback.ProxyFileStrategyCfg;
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
import com.nis.domain.configuration.AppComplexFeatureCfg;
@@ -194,6 +195,7 @@ import com.nis.web.service.configuration.ManipulatPolicyService;
import com.nis.web.service.configuration.NumCfgService;
import com.nis.web.service.configuration.ProxyFileHijackService;
import com.nis.web.service.configuration.ProxyFileInsertScriptService;
import com.nis.web.service.configuration.ProxyFileResponsePageService;
import com.nis.web.service.configuration.ProxyFileStrategyService;
import com.nis.web.service.configuration.ProxyFileTrafficMirrorService;
import com.nis.web.service.configuration.PxyObjKeyringService;
@@ -315,6 +317,8 @@ public class BaseController {
@Autowired
protected ProxyFileInsertScriptService proxyFileInsertScriptService;//注入脚本文件service
@Autowired
protected ProxyFileResponsePageService proxyFileResponsePageService;//阻断访问页面
@Autowired
protected ProxyFileTrafficMirrorService proxyFileTrafficMirrorService;//注入流量镜像文件ervice
@Autowired
protected AppBuiltInFeatureService appBuiltInFeatureService;// 拦截策略service
@@ -2803,6 +2807,7 @@ public class BaseController {
ProxyFileInsertScriptCfg searFileInsertScriptCfg = new ProxyFileInsertScriptCfg();
ProxyFileTrafficMirrorCfg searFileTrafficMirrorCfg = new ProxyFileTrafficMirrorCfg();
ProxyFileStrategyCfg searFileStrategyCfg = new ProxyFileStrategyCfg();
ProxyFileResponsePageCfg searFileResponsePageCfg = new ProxyFileResponsePageCfg();
if(entity != null && (entity instanceof CfgIndexInfo)) {
BeanUtils.copyProperties(entity, auditBatchCfg);
BeanUtils.copyProperties(entity, searchCfg);
@@ -2891,6 +2896,9 @@ public class BaseController {
}if(entity != null && (entity instanceof ProxyFileStrategyCfg)){
BeanUtils.copyProperties(entity, auditBatchCfg);
BeanUtils.copyProperties(entity, searFileStrategyCfg);
}if(entity != null && (entity instanceof ProxyFileResponsePageCfg)){
BeanUtils.copyProperties(entity, auditBatchCfg);
BeanUtils.copyProperties(entity, searFileResponsePageCfg);
}
@@ -2972,6 +2980,8 @@ public class BaseController {
searFileTrafficMirrorCfg.setTableName(tableNameXml);
searFileStrategyCfg.setServiceId(Integer.valueOf(serviceIdXml));
searFileStrategyCfg.setTableName(tableNameXml);
searFileResponsePageCfg.setServiceId(Integer.valueOf(serviceIdXml));
searFileResponsePageCfg.setTableName(tableNameXml);
if("1".equals(serviceTypeXml)){//maat类配置
// 存放域配置类型 及 对应表名
@@ -3371,7 +3381,8 @@ public class BaseController {
, searFileHijackCfg
, searFileInsertScriptCfg
, searFileTrafficMirrorCfg
, searFileStrategyCfg);
, searFileStrategyCfg
, searFileResponsePageCfg);
}
}
}
@@ -3455,6 +3466,7 @@ public class BaseController {
ProxyFileInsertScriptCfg searchFileInsertScriptCfg = new ProxyFileInsertScriptCfg();
ProxyFileTrafficMirrorCfg searchFileTrafficMirrorCfg = new ProxyFileTrafficMirrorCfg();
ProxyFileStrategyCfg searchFileStrategyCfg = new ProxyFileStrategyCfg();
ProxyFileResponsePageCfg searchFileResponsePageCfg = new ProxyFileResponsePageCfg();
// 传递检索条件
if(entity != null && (entity instanceof CfgIndexInfo)) {
@@ -3537,6 +3549,9 @@ public class BaseController {
}if(entity != null && (entity instanceof ProxyFileStrategyCfg)){
BeanUtils.copyProperties(entity, searchFileStrategyCfg);
searchFileStrategyCfg.setFunctionId(functionId);
}if(entity != null && (entity instanceof ProxyFileResponsePageCfg)){
BeanUtils.copyProperties(entity, searchFileResponsePageCfg);
searchFileResponsePageCfg.setFunctionId(functionId);
}
BaseCfg batchCfg = new BaseCfg();
@@ -3812,6 +3827,19 @@ public class BaseController {
}
}
}else if("pxy_profile_response_pages".equals(tableNameXml)) {
boolean hasData = true;
while(hasData){
page.setPageNo(1);
page.setLastPage(false);
List list = proxyFileResponsePageService.findPage(page,searchFileResponsePageCfg).getList();
if(!StringUtil.isEmpty(list)){
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
}else{
hasData = false;
}
}
}else {
boolean hasData = true;
while(hasData){
@@ -3952,7 +3980,8 @@ public class BaseController {
,ProxyFileHijackCfg searFileHijackCfg
,ProxyFileInsertScriptCfg searFileInsertScriptCfg
,ProxyFileTrafficMirrorCfg searFileTrafficMirrorCfg
,ProxyFileStrategyCfg searFileStrategyCfg) {
,ProxyFileStrategyCfg searFileStrategyCfg
,ProxyFileResponsePageCfg searFileResponsePageCfg) {
ToMaatBean maatBean;
MaatCfg maatCfg;
List<MaatCfg> configCompileList;
@@ -4079,6 +4108,25 @@ public class BaseController {
notAuditList.add(cfg);
}
}
}else if(className.equals("ProxyFileResponsePageCfg")){
list = proxyFileResponsePageService.findPage(page, searFileResponsePageCfg).getList();
for(int i=0;i<list.size();i++){
ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg) list.get(i);
ids.add(cfg.getCompileId());
if(cfg.getIsValid()==1) {
cfg.setIsValid(entity.getIsValid());
cfg.setIsAudit(entity.getIsAudit());
cfg.setAuditTime(entity.getAuditTime());
cfg.setAuditorId(entity.getAuditorId());
auditList.add(cfg);
}else {
cfg.setIsValid(entity.getIsValid());
cfg.setIsAudit(entity.getIsAudit());
cfg.setAuditTime(entity.getAuditTime());
cfg.setAuditorId(entity.getAuditorId());
notAuditList.add(cfg);
}
}
}else if(className.equals("ProxyFileHijackCfg")){
list = proxyFileHijackService.findPage(page, searFileHijackCfg).getList();
for(int i=0;i<list.size();i++){

View File

@@ -0,0 +1,222 @@
/**
*@Title: ControlController.java
*@Package com.nis.web.controller.configuration.proxy
*@Description TODO
*@author dell
*@date 2018年6月22日 下午4:35:42
*@version 版本号
*/
package com.nis.web.controller.configuration.proxy;
import java.io.File;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Maps;
import com.nis.domain.Page;
import com.nis.domain.callback.ProxyFileResponsePageCfg;
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.LogUtils;
import com.nis.util.StringUtil;
import com.nis.web.controller.configuration.CommonController;
/**
* @ClassName: ControlController.java
* @Description: TODO
* @author (dell)
* @date 2018年6月22日 下午4:35:42
* @version V1.0
*/
@Controller
@RequestMapping("${adminPath}/proxy/fileResponsePage")
public class FileResponsePageController extends CommonController {
@RequestMapping(value = {"list"})
public String fileResponsePageList(ProxyFileResponsePageCfg cfg,Model model,HttpServletRequest request,HttpServletResponse response) {
Page<ProxyFileResponsePageCfg> page = proxyFileResponsePageService.findPage(new Page<ProxyFileResponsePageCfg>(request, response,"a"), cfg);
model.addAttribute("page", page);
model.addAttribute("cfg", cfg);
initPageCondition(model);
return "/cfg/proxy/fileResponsePage/list";
}
@RequestMapping(value = {"form"})
@RequiresPermissions(value={"proxy:fileResponsePage:config"})
public String fileform(Model model,HttpServletRequest request
,HttpServletResponse response
,@ModelAttribute("cfg")ProxyFileResponsePageCfg cfg
,String ids
,RedirectAttributes redirectAttributes) {
if(!StringUtil.isEmpty(ids)){
cfg = proxyFileResponsePageService.getCfgById(Long.valueOf(ids));
}
// initFormCondition(model);
initFormCondition(model, cfg);
model.addAttribute("_cfg", cfg);
return "/cfg/proxy/fileResponsePage/form";
}
/**
* 保存 文件
* 1、将文件上传到 service 接口
* 2、将文件信息及 1返回的结果 保存到数据库
* @param model
* @param request
* @param response
* @param cfgFile
* @param cfg
* @param redirectAttributes
* @return
*/
@RequiresPermissions(value={"proxy:fileResponsePage:config"})
@RequestMapping(value = {"saveOrUpdate"})
public String saveOrUpdate(Model model,HttpServletRequest request
,HttpServletResponse response,MultipartFile cfgFile,
@ModelAttribute("cfg")ProxyFileResponsePageCfg cfg,
RedirectAttributes redirectAttributes){
File file = null;
try{
if(cfgFile != null) {
String filename = cfgFile.getOriginalFilename();
String prefix = FileUtils.getPrefix(filename, false);
String suffix = FileUtils.getSuffix(filename, false);
file = File.createTempFile("file_"+ prefix, suffix);
cfgFile.transferTo(file);//复制文件
String md5 = FileUtils.getFileMD5(file);
Map<String,Object> 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("http 重定向阻断文件上传响应信息:"+JsonMapper.toJsonString(result));
String srcAccessUrl = null;
if(!StringUtil.isEmpty(result)){
ResponseData data = result.getData();
srcAccessUrl=data.getAccessUrl();
cfg.setUrl(srcAccessUrl);;
}
cfg.setMd5(md5);//文件md5值
cfg.setContentLength(file.length());//文件长度
}
proxyFileResponsePageService.saveOrUpdate(cfg);
//配置仅保存
if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
addMessage(redirectAttributes, "success", "save_success");
}else {
//配置直接生效
addMessage(redirectAttributes, "success", "audit_success");
}
addMessage(redirectAttributes,"success","save_success");
}catch(Exception e){
logger.error("信息保存失败",e);
if(e instanceof MaatConvertException) {
addMessage(redirectAttributes,"error","request_service_failed");
LogUtils.saveLog(request, null, e, null);
}else {
addMessage(redirectAttributes,"error","save_failed");
LogUtils.saveLog(request, null, e, null);
}
}finally {
if(file != null) {
file.delete();//删除临时文件
}
}
return "redirect:" + adminPath +"/proxy/fileResponsePage/list?functionId="+cfg.getFunctionId();
}
@RequestMapping(value = {"delete"})
@RequiresPermissions(value={"proxy:fileResponsePage:config"})
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileResponsePageCfg cfg,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){
try {
if (!StringUtil.isEmpty(ids)) {
proxyFileResponsePageService.update(isAudit, isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<ProxyFileResponsePageCfg> searchPage = new Page<ProxyFileResponsePageCfg>(request, response, "a");
deleteAll(searchPage, functionId, cfg);
}
} catch (Exception e) {
logger.error("配置删除失败:", e);
if (e instanceof MaatConvertException) {
addMessage(redirectAttributes, "error", "request_service_failed");
LogUtils.saveLog(request, null, e, null);
} else {
addMessage(redirectAttributes, "error", "delete_failed");
LogUtils.saveLog(request, null, e, null);
}
}
return "redirect:" + adminPath +"/proxy/fileResponsePage/list?functionId="+functionId;
}
@RequestMapping(value = {"audit"})
@RequiresPermissions(value={"proxy:fileResponsePage:confirm"})
public String audit(Model model, @ModelAttribute("cfg") ProxyFileResponsePageCfg cfg, Integer isValid, Integer isAudit,
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
HttpServletRequest request) {
if (!StringUtil.isEmpty(ids)) {
String[] idArray = ids.split(",");
for (String id : idArray) {
try {
proxyFileResponsePageService.audit(isAudit, isValid, functionId, id);
addMessage(redirectAttributes, "success", "audit_success");
} catch (MaatConvertException e) {
logger.error(e);
addMessage(redirectAttributes, "error", "request_service_failed");
LogUtils.saveLog(request, null, e, null);
} catch (Exception e) {
logger.error(e);
addMessage(redirectAttributes, "error", "audit_failed");
LogUtils.saveLog(request, null, e, null);
}
}
} else {
Page<ProxyFileResponsePageCfg> searchPage = new Page<ProxyFileResponsePageCfg>(request, response, "a");
Page<ProxyFileResponsePageCfg> auditPage = new Page<ProxyFileResponsePageCfg>(request, response, "a");
try {
BeanUtils.copyProperties(searchPage, auditPage);
auditAll(auditPage, isValid, cfg);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
logger.error("配置下发失败:", e);
if (e instanceof MaatConvertException) {
addMessage(redirectAttributes, "error", "request_service_failed");
LogUtils.saveLog(request, null, e, null);
} else {
addMessage(redirectAttributes, "error", "audit_failed");
LogUtils.saveLog(request, null, e, null);
}
}
return fileResponsePageList(cfg, model, request, response);
}
return "redirect:" + adminPath +"/proxy/fileResponsePage/list?functionId="+functionId;
}
}

View File

@@ -117,6 +117,25 @@
<if test="compileId != null">
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
<if test="index == 0">
AND a.COMPILE_ID &gt;= #{item,jdbcType=INTEGER}
</if>
<if test="index == 1">
AND a.COMPILE_ID &lt;= #{item,jdbcType=INTEGER}
</if>
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
AND a.COMPILE_ID in
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>

View File

@@ -117,6 +117,25 @@
<if test="compileId != null">
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
<if test="index == 0">
AND a.COMPILE_ID &gt;= #{item,jdbcType=INTEGER}
</if>
<if test="index == 1">
AND a.COMPILE_ID &lt;= #{item,jdbcType=INTEGER}
</if>
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
AND a.COMPILE_ID in
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>

View File

@@ -0,0 +1,25 @@
package com.nis.web.dao.configuration;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.callback.ProxyFileResponsePageCfg;
import com.nis.web.dao.MyBatisDao;
/**
* 特定协议相关配置数据处理类
* @author dell
*
*/
@MyBatisDao
public interface ProxyFileResponsePageDao {
public List<ProxyFileResponsePageCfg> findPage(ProxyFileResponsePageCfg entity) ;
public ProxyFileResponsePageCfg getCfgById(@Param("cfgId")Long cfgId);
public void insert(ProxyFileResponsePageCfg entity);
public void update(ProxyFileResponsePageCfg entity);
}

View File

@@ -0,0 +1,334 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.ProxyFileResponsePageDao" >
<resultMap id="ProxyFileResponsePageCfg" type="com.nis.domain.callback.ProxyFileResponsePageCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="file_desc" property="fileDesc" jdbcType="VARCHAR" />
<result column="url" property="url" jdbcType="VARCHAR" />
<result column="content_type" property="contentType" jdbcType="VARCHAR" />
<result column="content_length" property="contentLength" jdbcType="VARCHAR" />
<result column="md5" property="md5" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="level" property="level" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
</resultMap>
<sql id="ProxyFileResponsePageCfgColumn" >
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.cfg_type,a.cfg_region_code,
a.FILE_DESC,a.URL,a.CONTENT_TYPE,a.CONTENT_LENGTH,a.MD5
</sql>
<!-- voip条件查询列表信息 -->
<select id="findPage" resultMap="ProxyFileResponsePageCfg" parameterType="com.nis.domain.callback.ProxyFileResponsePageCfg" >
SELECT
<include refid="ProxyFileResponsePageCfgColumn" />
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
FROM pxy_profile_response_pages a
left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id
left join sys_user u on a.auditor_id=u.id
left join request_info ri on a.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="cfgId != null">
AND a.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND a.ACTION=#{action,jdbcType=INTEGER}
</if>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchValidValue != null and batchValidValue != ''">
AND a.IS_VALID in (${batchValidValue})
</when>
<otherwise>
<if test="isValid != null">
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND a.IS_VALID != -1
</if>
</otherwise>
</choose>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchAuditValue != null and batchAuditValue != ''">
<if test="isAudit != null">
AND a.IS_AUDIT in(${batchAuditValue})
</if>
</when>
<otherwise>
<if test="isAudit != null">
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
</otherwise>
</choose>
<if test="creatorName != null and creatorName != ''">
AND a.CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editorName != null and editorName != ''">
AND a.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditorName != null and auditorName != ''">
AND a.AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="serviceId != null">
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
<if test="index == 0">
AND a.COMPILE_ID &gt;= #{item,jdbcType=INTEGER}
</if>
<if test="index == 1">
AND a.COMPILE_ID &lt;= #{item,jdbcType=INTEGER}
</if>
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
AND a.COMPILE_ID in
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<if test="functionId != null">
AND a.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="fileDesc != null and fileDesc != ''">
AND a.file_desc like concat(concat('%',#{fileDesc,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc
</when>
<otherwise>
ORDER BY a.is_audit,a.CFG_ID desc
</otherwise>
</choose>
</select>
<!-- 根据Id获取ProxyFileResponsePageCfg信息 -->
<select id="getCfgById" resultMap="ProxyFileResponsePageCfg">
SELECT
<include refid="ProxyFileResponsePageCfgColumn" />
FROM pxy_profile_response_pages a
<where>
<if test="cfgId != null">
and a.CFG_ID=#{cfgId,jdbcType=INTEGER}
</if>
</where>
</select>
<insert id="insert" parameterType="com.nis.domain.callback.ProxyFileResponsePageCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into pxy_profile_response_pages (
CFG_DESC,
ACTION,
IS_VALID,
IS_AUDIT,
CREATOR_ID,
CREATE_TIME,
EDITOR_ID,
EDIT_TIME,
AUDITOR_ID,
AUDIT_TIME,
SERVICE_ID,
REQUEST_ID,
COMPILE_ID,
IS_AREA_EFFECTIVE,
CLASSIFY,
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id,
cfg_type,
cfg_region_code,
file_desc,
url,
content_type,
content_length,
md5
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},
#{isAudit,jdbcType=INTEGER},
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER},
#{fileDesc,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR},
#{contentType,jdbcType=VARCHAR},
#{contentLength,jdbcType=INTEGER},
#{md5,jdbcType=VARCHAR}
)
</insert>
<update id="update" parameterType="com.nis.domain.callback.ProxyFileResponsePageCfg" >
update pxy_profile_response_pages
<set>
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
edit_time = #{editTime,jdbcType=TIMESTAMP},
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null" >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null" >
cfg_type = #{cfgType,jdbcType=VARCHAR},
</if>
<if test="fileDesc != null" >
file_desc = #{fileDesc ,jdbcType=VARCHAR},
</if>
<if test="url != null" >
url = #{url ,jdbcType=VARCHAR},
</if>
<if test="contentType != null" >
content_type = #{contentType ,jdbcType=VARCHAR},
</if>
<if test="contentLength != null" >
content_length = #{contentLength ,jdbcType=BIGINT},
</if>
<if test="md5 != null" >
md5 = #{md5 ,jdbcType=VARCHAR},
</if>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -119,6 +119,25 @@
<if test="compileId != null">
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
<if test="index == 0">
AND a.COMPILE_ID &gt;= #{item,jdbcType=INTEGER}
</if>
<if test="index == 1">
AND a.COMPILE_ID &lt;= #{item,jdbcType=INTEGER}
</if>
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
AND a.COMPILE_ID in
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>

View File

@@ -116,6 +116,25 @@
<if test="compileId != null">
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
<if test="index == 0">
AND a.COMPILE_ID &gt;= #{item,jdbcType=INTEGER}
</if>
<if test="index == 1">
AND a.COMPILE_ID &lt;= #{item,jdbcType=INTEGER}
</if>
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
AND a.COMPILE_ID in
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>

View File

@@ -58,6 +58,8 @@ import com.nis.domain.callback.ProxyFileHijackCfg;
import com.nis.domain.callback.ProxyFileHijackCfgAudit;
import com.nis.domain.callback.ProxyFileInsertScriptCfg;
import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit;
import com.nis.domain.callback.ProxyFileResponsePageCfg;
import com.nis.domain.callback.ProxyFileResponsePageCfgAudit;
import com.nis.domain.callback.ProxyFileStrategyCfg;
import com.nis.domain.callback.ProxyFileStrategyCfgAudit;
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
@@ -3198,6 +3200,7 @@ public abstract class BaseService {
hijackTemp.setService(cfg.getServiceId());
hijackTemp.setIsValid(cfg.getIsValid());
hijackTemp.setOpTime(cfg.getAuditTime());
hijackTemp.setOpUser(UserUtils.getUser().getId());
return hijackTemp;
}
//注入脚本文件
@@ -3213,6 +3216,7 @@ public abstract class BaseService {
fileInsertScriptTemp.setService(cfg.getServiceId());
fileInsertScriptTemp.setIsValid(cfg.getIsValid());
fileInsertScriptTemp.setOpTime(cfg.getAuditTime());
fileInsertScriptTemp.setOpUser(UserUtils.getUser().getId());
return fileInsertScriptTemp;
}
//流量转发目的地址
@@ -3228,6 +3232,7 @@ public abstract class BaseService {
fileTemp.setService(cfg.getServiceId());
fileTemp.setIsValid(cfg.getIsValid());
fileTemp.setOpTime(cfg.getAuditTime());
fileTemp.setOpUser(UserUtils.getUser().getId());
return fileTemp;
}
//文件策略
@@ -3244,6 +3249,24 @@ public abstract class BaseService {
fileTemp.setFilePath(cfg.getUrl());
fileTemp.setIsValid(cfg.getIsValid());
fileTemp.setOpTime(cfg.getAuditTime());
fileTemp.setOpUser(UserUtils.getUser().getId());
return fileTemp;
}
//访问阻断页面
public static ProxyFileResponsePageCfgAudit convertCallBackProxyFileResponsePage(ProxyFileResponsePageCfg cfg) {
ProxyFileResponsePageCfgAudit fileTemp = new ProxyFileResponsePageCfgAudit();
fileTemp.setId(Long.valueOf(cfg.getCompileId()));
fileTemp.setCfgId(cfg.getCompileId());
fileTemp.setProfileId((Long.valueOf(cfg.getCompileId())));
fileTemp.setProfileName(keywordsEscape(cfg.getFileDesc()));
fileTemp.setFormat(cfg.getContentType());
fileTemp.setContentLength(cfg.getContentLength());
fileTemp.setAction(cfg.getAction());
fileTemp.setService(cfg.getServiceId());
fileTemp.setPath(cfg.getUrl());
fileTemp.setIsValid(cfg.getIsValid());
fileTemp.setOpTime(cfg.getAuditTime());
fileTemp.setOpUser(UserUtils.getUser().getId());
return fileTemp;
}

View File

@@ -17,6 +17,8 @@ import com.nis.domain.callback.ProxyFileHijackCfg;
import com.nis.domain.callback.ProxyFileHijackCfgAudit;
import com.nis.domain.callback.ProxyFileInsertScriptCfg;
import com.nis.domain.callback.ProxyFileInsertScriptCfgAudit;
import com.nis.domain.callback.ProxyFileResponsePageCfg;
import com.nis.domain.callback.ProxyFileResponsePageCfgAudit;
import com.nis.domain.callback.ProxyFileStrategyCfg;
import com.nis.domain.callback.ProxyFileStrategyCfgAudit;
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
@@ -405,12 +407,21 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
if(convertList.size() > 0) {
notAuditList = convertList;
}
}else if(entity.getServiceId().equals(646)) { // 访问阻断页面
List<ProxyFileResponsePageCfgAudit> convertList = Lists.newArrayList();
for (Object object : notAuditList) {
ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg)object;
convertList.add(BaseService.convertCallBackProxyFileResponsePage(cfg));
}
if(convertList.size() > 0) {
notAuditList = convertList;
}
}
// 格式转换 -->
//调用服务接口下发配置数据
String json=gsonToJson(notAuditList);
//logger.warn("批量下发配置参数:"+json);
logger.debug("批量下发配置参数:"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
logger.warn("批量下发响应信息:"+result.getMsg());
@@ -496,19 +507,28 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
}
}else if(entity.getServiceId().equals(608)) { // 文件策略
List<ProxyFileStrategyCfgAudit> convertList = Lists.newArrayList();
for (Object object : notAuditList) {
for (Object object : auditList) {
ProxyFileStrategyCfg cfg = (ProxyFileStrategyCfg)object;
convertList.add(BaseService.convertCallBackProxyFileStrategy(cfg));
}
if(convertList.size() > 0) {
notAuditList = convertList;
auditList = convertList;
}
}else if(entity.getServiceId().equals(646)) { // 访问阻断页面
List<ProxyFileResponsePageCfgAudit> convertList = Lists.newArrayList();
for (Object object : auditList) {
ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg)object;
convertList.add(BaseService.convertCallBackProxyFileResponsePage(cfg));
}
if(convertList.size() > 0) {
auditList = convertList;
}
}
// 格式转换 -->
//调用服务接口取消配置
String json=gsonToJson(auditList);
//logger.warn("批量下发配置参数:"+json);
logger.debug("批量下发配置参数:"+json);
if(!StringUtil.isEmpty(auditList)) {
logger.warn("批量配置取消个数:"+auditList.size());
}

View File

@@ -0,0 +1,135 @@
package com.nis.web.service.configuration;
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.beust.jcommander.internal.Lists;
import com.nis.domain.Page;
import com.nis.domain.callback.ProxyFileResponsePageCfg;
import com.nis.domain.callback.ProxyFileResponsePageCfgAudit;
import com.nis.domain.maat.ToMaatResult;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.ProxyFileResponsePageDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
@Service
public class ProxyFileResponsePageService extends BaseService{
@Autowired
protected ProxyFileResponsePageDao proxyFileDao;
/**
* 分页查询
* @param page
* @param entity
* @return
*/
public Page<ProxyFileResponsePageCfg> findPage(Page page, ProxyFileResponsePageCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
List<ProxyFileResponsePageCfg> list=proxyFileDao.findPage(entity);
page.setList(list);
return page;
}
public ProxyFileResponsePageCfg getCfgById(Long cfgId) {
return proxyFileDao.getCfgById(cfgId);
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(ProxyFileResponsePageCfg entity){
Date createTime=new Date();
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
//新增
if(entity.getCfgId()==null){
Integer compileId = ConfigServiceUtil.getId(1, 1).get(0);//获取编译id
entity.setCompileId(compileId);
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setIsValid(0);
entity.setIsAudit(0);
proxyFileDao.insert(entity);//新增
}else{
Date editTime=new Date();
entity.setIsValid(0);
entity.setIsAudit(0);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
proxyFileDao.update(entity);//更新
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()));
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void update(Integer isAudit,Integer isValid,String ids,Integer functionId){
ProxyFileResponsePageCfg entity = new ProxyFileResponsePageCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setFunctionId(functionId);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
proxyFileDao.update(entity);
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void audit(Integer isAudit,Integer isValid,Integer functionId,String ids){
Date auditTime = new Date();//审核时间
String[] idArray = ids.split(",");
for(String id : idArray) {
ProxyFileResponsePageCfg entity = proxyFileDao.getCfgById(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
proxyFileDao.update(entity);
if(isAudit == 1) {//审核通过,下发配置回调配置信息
List<ProxyFileResponsePageCfgAudit> convertList = Lists.newArrayList();
convertList.add(BaseService.convertCallBackProxyFileResponsePage(entity));
String json = gsonToJson(convertList);
logger.debug("访问阻断页面下发参数:" + json);
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
logger.debug("访问阻断页面下发响应:"+gsonToJson(result));
}else if(isAudit == 3) {//取消审核通过,将回调配置信息置为无效
List<ProxyFileResponsePageCfgAudit> convertList = Lists.newArrayList();
convertList.add(BaseService.convertCallBackProxyFileResponsePage(entity));
String json = gsonToJson(convertList);
logger.debug("访问阻断页面下发参数:" + json);
ToMaatResult result = ConfigServiceUtil.put(json,2);
logger.debug("访问阻断页面下发响应:"+gsonToJson(result));
}
}
}
/**
* 获取所有的 响应文件 策略
* @return
*/
public List<ProxyFileResponsePageCfg> getProxyFileResponsePageCfgList(ProxyFileResponsePageCfg entity){
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
List<ProxyFileResponsePageCfg> list=proxyFileDao.findPage(entity);
return list;
}
}

View File

@@ -1542,6 +1542,7 @@ mirror_addr_type=Address Type
target_name=Target Name
traffic_mirror_address=Traffic Mirror Address
content_name=Content Name
visit_response_page=Response Pages
none_profile_tip=Please Choose Profile Info!
#---------------------------pxy intercept------------------------------------
min_should_less_than_max=The min SSL version should less than the max SSL version

View File

@@ -1544,6 +1544,7 @@ mirror_addr_type=Address Type
target_name=Target Name
traffic_mirror_address=Traffic Mirror Address
content_name=Content Name
visit_response_page=Response Pages
none_profile_tip=Please Choose Profile Info!
#---------------------------pxy intercept------------------------------------
min_should_less_than_max=The min SSL version should less than the max SSL version

View File

@@ -1542,6 +1542,7 @@ mirror_addr_type=\u76EE\u6807\u6807\u8BC6\u7C7B\u578B
target_name=\u76EE\u6807\u540D\u79F0
traffic_mirror_address=\u6D41\u91CF\u8F6C\u53D1\u76EE\u7684\u5730\u5740
content_name=\u5185\u5BB9\u540D\u79F0
visit_response_page=\u8BBF\u95EE\u963B\u65AD\u9875\u9762
none_profile_tip=Please Choose Profile Info!
#---------------------------pxy intercept------------------------------------
min_should_less_than_max=\u6700\u5C0FSSL\u7248\u672C\u5E94\u5C0F\u4E8E\u6700\u5927SSL\u7248\u672C

View File

@@ -426,7 +426,7 @@
<service id="644" functionId="514" serviceType="2" tableName="pxy_profile_insert_scripts" className="ProxyFileInsertScriptCfg" desc="注入脚本文件"></service>
<service id="645" functionId="515" serviceType="2" tableName="pxy_profile_traffic_mirror" className="ProxyFileTrafficMirrorCfg" desc="流量转发目的地址"></service>
<service id="608" functionId="512" serviceType="2" tableName="proxy_file_strategy_cfg" className="ProxyFileStrategyCfg" desc="http代理文件策略"></service>
<service id="646" functionId="516" serviceType="2" tableName="pxy_profile_response_pages" className="ProxyFileResponsePageCfg" desc="访问阻断页面"></service>
<service id="656" functionId="215" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="https操控业务">
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
<serviceCfg cfgType="2" tableName="http_url_cfg" ></serviceCfg>

View File

@@ -0,0 +1,8 @@
#访问阻断页面业务表和菜单表
INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`)
VALUES (516, 0, 1, 'monit', 646, 'visit_response_page', NULL, 1, NULL, '2019-05-17 11:46:48', NULL, '2019-05-17 11:46:51', NULL, 0, 1, NULL);
INSERT INTO sys_menu (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`)
VALUES (1121, '0,1,86,717,1121,', 'visit_response_page', '访问阻断页面', 10, '/proxy/fileResponsePage/list', '', '', 1, 'proxy:fileResponsePage:config', '1', '2019-05-09 11:16:20', '1', '2019-05-09 11:16:20', '', 1, NULL, 0, 0, 516),
(1122, '0,1,150,750,1122,', 'visit_response_page', '访问阻断页面', 428, '/proxy/fileResponsePage/list', '', '', 1, 'proxy:fileResponsePage:confirm', '1', '2019-05-09 14:58:10', '1', '2019-05-09 14:58:10', '', 1, NULL, 0, 0, 516),
(1123, '0,1,151,865,1123,', 'visit_response_page', '访问阻断页面', 41, '/proxy/fileResponsePage/list', '', '', 1, 'proxy:fileResponsePage:audit', '1', '2019-05-09 14:59:54', '1', '2019-05-09 14:59:54', '', 1, NULL, 0, 0, 516);

View File

@@ -0,0 +1,36 @@
#劫持相关字典表 insert语句中的156即dictionary_id应替换为select筛选后中id字段的值
INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`)
VALUES ('劫持文件内容格式', 'CONTENT_TYPE_HIJACK', 'hijack content-type', '', '2019-05-21 00:00:00', '2019-05-21 00:00:00', 1);
SELECT * FROM sys_data_dictionary_name WHERE mark='CONTENT_TYPE_HIJACK';
INSERT into sys_data_dictionary_item(item_code,item_value,item_sort,`status`,type,dictionary_id)
VALUES('image/gif','image/gif',0,1,1,156),
('image/jpeg','image/jpeg',0,1,1,156),
('image/png','image/png',0,1,1,156),
('image/svg+xml','image/svg+xml',0,1,1,156),
('application/x-msdos-program','application/x-msdos-program',0,1,1,156),
('application/x-msdownload','application/x-msdownload',0,1,1,156),
('application/octet-stream','application/octet-stream',0,1,1,156),
('application/vnd.android.package-archive','application/vnd.android.package-archive',0,1,1,156),
('text/html','text/html',0,1,1,156);
#文件策略相关字典表 insert语句中的157即dictionary_id应替换为select筛选后中id字段的值
INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`)
VALUES('文件策略内容格式', 'CONTENT_TYPE_FILESTRATEGY', 'fileStrategy content-type', '', '2019-05-21 00:00:00', '2019-05-21 00:00:00', 1);
SELECT * FROM sys_data_dictionary_name WHERE mark='CONTENT_TYPE_FILESTRATEGY';
INSERT into sys_data_dictionary_item(item_code,item_value,item_sort,`status`,type,dictionary_id)
VALUES('template','template',0,1,1,157),
('html','html',0,1,1,157);
#注入脚本相关字典表 insert语句中的158即dictionary_id应替换为select筛选后中id字段的值
INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`)
VALUES('注入脚本文件内容格式', 'CONTENT_TYPE_INSERTSCRIPT', 'insertScript content-type', '', '2019-05-21 00:00:00', '2019-05-21 00:00:00', 1);
SELECT * FROM sys_data_dictionary_name WHERE mark='CONTENT_TYPE_INSERTSCRIPT';
INSERT into sys_data_dictionary_item(item_code,item_value,item_sort,`status`,type,dictionary_id)
VALUES('css','css',0,1,1,158),
('js','js',0,1,1,158);

View File

@@ -124,6 +124,7 @@ function isBatch(url){
|| url.indexOf("functionId=515&") > -1 //Traffic Mirror
|| url.indexOf("functionId=512&") > -1 //PXY OBJ FILE
|| url.indexOf("functionId=215&") > -1 //Proxy Manipulate
|| url.indexOf("functionId=516&") > -1 //Response Page
){
flag = true;
}

View File

@@ -152,7 +152,7 @@
<div class="col-md-6">
<select name="contentType" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('CONTENT_TYPE')}" var="dict">
<c:forEach items="${fns:getDictList('CONTENT_TYPE_HIJACK')}" var="dict">
<option value="${dict.itemCode}" <c:if test="${dict.itemCode==_cfg.contentType}">selected</c:if>>${dict.itemCode}</option>
</c:forEach>
</select>
@@ -164,7 +164,7 @@
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="content_name" /></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="contentName" value="${_cfg.contentName}">
<input class="form-control" type="text" name="contentName" value="${_cfg.contentName}">
</div>
</div>
</div>

View File

@@ -8,6 +8,8 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileIdNew}"){
$("#intype").val("${cfg.compileIdNew}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -93,6 +95,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="profile_name"></spring:message></form:option>
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
<form:option value="compileIdNew"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>

View File

@@ -150,17 +150,12 @@
<font color="red">*</font><spring:message code="format" />
</label>
<div class="col-md-6">
<%-- <select name="format" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('CONTENT_TYPE')}" var="dict">
<option value="${dict.itemCode}" <c:if test="${dict.itemCode==_cfg.format}">selected</c:if>>${dict.itemCode}</option>
</c:forEach>
</select> --%>
<select name="format" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<option value="js" <c:if test="${'js'==_cfg.format}">selected</c:if>>js</option>
<option value="css" <c:if test="${'css'==_cfg.format}">selected</c:if>>css</option>
</select>
<c:forEach items="${fns:getDictList('CONTENT_TYPE_INSERTSCRIPT')}" var="dict">
<option value="${dict.itemCode}" <c:if test="${dict.itemCode==_cfg.format}">selected</c:if>>${dict.itemCode}</option>
</c:forEach>
</select>
</div>
<div for="format"></div>
</div>

View File

@@ -8,6 +8,8 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileIdNew}"){
$("#intype").val("${cfg.compileIdNew}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -93,6 +95,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="profile_name"></spring:message></form:option>
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
<form:option value="compileIdNew"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>

View File

@@ -0,0 +1,229 @@
<%@ 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 type="text/javascript">
$(function() {
$("#urlInfo,#urlBtn").on('click',function(){
$("#cfgFile").trigger("click");
});
$("#cfgFile").on('change',function(){
$("#urlInfo").val($("#cfgFile").val());
});
$("#cfgFrom") .validate( {
submitHandler : function(form) {
loading('onloading...');
form.submit();
},
errorContainer : "#messageBox",
errorPlacement : function(error, element) {
$(element).parents(".form-group").find( "div[for='" + element.attr("name") + "']").append(error);
},
});
});
</script>
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<spring:message code="${_cfg.menuNameCode }"></spring:message>
</h3>
<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/fileResponsePage/saveOrUpdate" enctype="multipart/form-data" method="post" class="form-horizontal">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="isValid" value="${_cfg.isValid}">
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="cfgId" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<input type="hidden" id="isAdd" name="isAdd" value="${isAdd}">
<c:forEach items="${serviceList}" var="service">
<c:if test="${_cfg.functionId eq service.functionId}">
<input type="hidden" name="serviceId" value="${service.serviceId}">
<input type="hidden" name="action" value="${service.action}">
</c:if>
</c:forEach>
<div class="form-body">
<div class="row">
<div class="col-md-6 hidden">
<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" class="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
configDolog="${service.configDoLog }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<div class="col-md-6 hidden">
<div class="form-group ">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="reply_file" /></label>
<div class="col-md-6">
<input id="cfgFile" name="cfgFile" type="file" style="width: 330px; display: none" />
<div class="input-group">
<input id="urlInfo" name="urlInfo" readonly="readonly" data-msg-required="" placeholder="<spring:message code="select_file"/>" class="required form-control"
style="background-color: transparent" aria-required="true"
type="text" value="${_cfg.url }">
<div class="input-group-btn">
<a id="urlBtn" class="btn btn-default btn-search"
href="javascript:" style=""><i class="fa fa-search"></i></a>
</div>
</div>
</div>
<div for="urlInfo"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="file_desc" /></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="fileDesc" value="${_cfg.fileDesc}">
</div>
<div for="fileDesc"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">
<font color="red">*</font><spring:message code="content_type" />
</label>
<div class="col-md-6">
<select name="contentType" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('CONTENT_TYPE_FILESTRATEGY')}" var="dict">
<option value="${dict.itemCode}" <c:if test="${dict.itemCode==_cfg.contentType}">selected</c:if>>${dict.itemCode}</option>
</c:forEach>
</select>
</div>
<div for="contentType"></div>
</div>
</div>
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><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 && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<c:set var="auditPermission" value="false"></c:set>
<!-- 拥有配置新增直接生效的功能权限 -->
<shiro:hasPermission name="save:audit:permission">
<c:set var="auditPermission" value="true"></c:set>
</shiro:hasPermission>
<c:choose>
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
<button id="audit" type="submit" class="btn green">
<spring:message code="submit" />
</button>
</c:when>
<c:otherwise>
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
</c:otherwise>
</c:choose>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,409 @@
<%@ 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.fileDesc}"){
$("#intype").val("${cfg.fileDesc}");
}else if("${cfg.compileIdNew}"){
$("#intype").val("${cfg.compileIdNew}");
}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();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
$("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();
});
});
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="proxy:fileResponsePage:config">
<button type="button" class="addId btn btn-primary"
onClick="javascript:window.location='${ctx}/proxy/fileResponsePage/form?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="${cfg.menuNameCode }"></spring:message>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/fileResponsePage/list" 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="fileDesc"><spring:message code="file_desc"></spring:message></form:option>
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
<form:option value="compileIdNew"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
<div class="input-group-btn">
<form:select path="isValid" class="selectpicker select2 input-small" >
<form:option value=""><spring:message code="select"/></form:option>
<form:option value="1"><spring:message code="yes"/></form:option>
<form:option value="0"><spring:message code="no"/></form:option>
</form:select>
</div>
</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="proxy:fileResponsePage:config">
<sys:delRow url="${ctx}/proxy/fileResponsePage/form" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/proxy/fileResponsePage/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="proxy:fileResponsePage:confirm">
<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/fileResponsePage/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/proxy/fileResponsePage/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/proxy/fileResponsePage/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='letter'/></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='classification'/></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>
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<c:if
test="${cfg.functionId eq service.functionId}">
<c:set var="action" value="${service.action }"></c:set>
</c:if>
</c:forEach>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<sys:message content="${message}" type="${messageType }"/>
<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="sort-column a.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
<th class="sort-column a.cfg_desc"><spring:message code="file_desc"/></th>
<th><spring:message code="content_type"/></th>
<th><spring:message code="content_length"/></th>
<%-- <th><spring:message code="block_type"/></th> --%>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></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>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td><a href="${indexCfg.url }" target="_blank">${indexCfg.fileDesc }</a></td>
<td>${indexCfg.contentType }</td>
<td>${indexCfg.contentLength }B</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>${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 indexTable="${indexCfg.indexTable}" data-placement="right" data-original-title="<spring:message code='letter_cancel_info'/>: " class="label le-ca-fo label-warning tooltips" data-icon="&#xe01e;"> <spring:message code="cancel_approved"/></span></c:when>
</c:choose>
</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" >${page}</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -151,9 +151,9 @@
<font color="red">*</font><spring:message code="content_type" />
</label>
<div class="col-md-6">
<select name="contentType" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<select name="contentType" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('CONTENT_TYPE')}" var="dict">
<c:forEach items="${fns:getDictList('CONTENT_TYPE_FILESTRATEGY')}" var="dict">
<option value="${dict.itemCode}" <c:if test="${dict.itemCode==_cfg.contentType}">selected</c:if>>${dict.itemCode}</option>
</c:forEach>
</select>

View File

@@ -9,6 +9,8 @@
//搜索框提示语初始化
if("${cfg.fileDesc}"){
$("#intype").val("${cfg.fileDesc}");
}else if("${cfg.compileIdNew}"){
$("#intype").val("${cfg.compileIdNew}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -84,6 +86,7 @@
<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>
@@ -93,6 +96,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="fileDesc"><spring:message code="file_desc"></spring:message></form:option>
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
<form:option value="compileIdNew"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>

View File

@@ -14,7 +14,7 @@ word-break:break-all;
</style>
<script type="text/javascript">
$(function() {
var regex = /^([A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2}$/;
var regex = /^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$/;
var num = /^[1-9]*[1-9][0-9]*$/;
var tip =$.validator.messages.addrList;
jQuery.validator.addMethod("addrList",function(value,element){

View File

@@ -8,6 +8,8 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileIdNew}"){
$("#intype").val("${cfg.compileIdNew}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -94,6 +96,7 @@
<form:option value="cfgDesc"><spring:message code="profile_name"></spring:message></form:option>
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
<form:option value="addrType"><spring:message code="mirror_addr_type"></spring:message></form:option>
<form:option value="compileIdNew"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>

View File

@@ -98,7 +98,7 @@
rangeCross0:"The IP {0} must not between {1} and {2}",
rangeCross1:"The IP range {0} has intersections with {1}",
protectedCfgUnique:"Keyword already exists.",
addrList:"Please enter the legitimate targets identification list",
addrList:"Please enter a correct: MAC(aa:bb:cc:11:22:33),VLAN(1) must be exponent of 1 not greater than 4094,Multiple data separated by commas",
sslVersionCheck:"Min SSL version should smaller than Max SSL version"
});
}(jQuery));

View File

@@ -98,7 +98,7 @@
rangeCross0:"IP {0} не должен находиться между {1} и {2}",
rangeCross1:"Диапазон IP {0} имеет пересечения с {1}",
protectedCfgUnique:"Ключевое слово уже существует.",
addrList:"Please enter the legitimate targets identification list",
addrList:"Please enter a correct: MAC(aa:bb:cc:11:22:33),VLAN(1) must be exponent of 1 not greater than 4094,Multiple data separated by commas",
sslVersionCheck:"моя версия SSL должны меньше, чем версия SSL, макс"
});
}(jQuery));

View File

@@ -98,7 +98,7 @@
rangeCross0:"IP{0}不能介于{1}和{2}",
rangeCross1:"IP范围{0}和IP范围{1}有交集",
protectedCfgUnique:"关键字已存在",
addrList:"请输入合法的目标标识列表",
addrList:"请输入合法的目标标识如MAC(aa:bb:cc:11:22:33),VLAN(1)介于1-4094之间,多条数据用逗号分隔",
sslVersionCheck:"最小SSL协议版本应小于最大SSL协议版本"
});
}(jQuery));