dns关键字分组配置
This commit is contained in:
234
src/main/java/com/nis/domain/configuration/DnsKeywordCfg.java
Normal file
234
src/main/java/com/nis/domain/configuration/DnsKeywordCfg.java
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
*@Title: BaseEnhancedStringConfig.java
|
||||
*@Package com.nis.domain.restful
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月5日 下午5:42:52
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.taglibs.standard.functions.Functions;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* @ClassName: BaseEnhancedStringConfig.java
|
||||
* @Description: 基础增强字符串类配置
|
||||
* @author (wx)
|
||||
* @date 2018年2月5日 下午5:42:52
|
||||
* @version V1.0
|
||||
*/
|
||||
public class DnsKeywordCfg extends BaseCfg<DnsKeywordCfg>{
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -1417089397345367232L;
|
||||
private static final String tableName="dns_domain_cfg";
|
||||
/**
|
||||
* 匹配区域
|
||||
*/
|
||||
@Expose
|
||||
@ExcelField(title="district",sort=301)
|
||||
@SerializedName("district")
|
||||
protected String district ;
|
||||
protected String districtShowName;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("keywords")
|
||||
@ExcelField(title="key_word",sort=302)
|
||||
protected String cfgKeywords;
|
||||
protected String keywordsShowName;
|
||||
/**
|
||||
* 表达式类型
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("exprType")
|
||||
@ExcelField(title="expression_type",dictType="EXPRESSION_TYPE",sort=303)
|
||||
protected Integer exprType ;
|
||||
/**
|
||||
* 匹配方式
|
||||
*/
|
||||
@Expose
|
||||
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=304)
|
||||
@SerializedName("matchMethod")
|
||||
protected Integer matchMethod ;
|
||||
|
||||
/**
|
||||
* 是否hex
|
||||
*/
|
||||
@ExcelField(title="is_hex",sort=305)
|
||||
protected Integer isHex;
|
||||
/**
|
||||
* 是否hex
|
||||
*/
|
||||
@ExcelField(title="is_case_insenstive",sort=306)
|
||||
protected Integer isCaseInsenstive;
|
||||
|
||||
/**
|
||||
* 是否hex二进制
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("isHexbin")
|
||||
protected Integer isHexbin ;
|
||||
/**
|
||||
* district
|
||||
* @return district
|
||||
*/
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
/**
|
||||
* copy属性使用
|
||||
*/
|
||||
protected Long dnsStrategyId;
|
||||
protected Integer appCode;//仅用于copy属性使用
|
||||
protected Integer behavCode;//仅用于copy属性使用
|
||||
protected Integer specServiceId;//仅用于copy属性使用
|
||||
|
||||
public Integer getAppCode() {
|
||||
return appCode;
|
||||
}
|
||||
public void setAppCode(Integer appCode) {
|
||||
this.appCode = appCode;
|
||||
}
|
||||
public Integer getBehavCode() {
|
||||
return behavCode;
|
||||
}
|
||||
public void setBehavCode(Integer behavCode) {
|
||||
this.behavCode = behavCode;
|
||||
}
|
||||
public Integer getSpecServiceId() {
|
||||
return specServiceId;
|
||||
}
|
||||
public void setSpecServiceId(Integer specServiceId) {
|
||||
this.specServiceId = specServiceId;
|
||||
}
|
||||
public Long getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
public void setDnsStrategyId(Long dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param district the district to set
|
||||
*/
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
public String getCfgKeywords() {
|
||||
// cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords);
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
public String getDistrictShowName() {
|
||||
return districtShowName;
|
||||
}
|
||||
public void setDistrictShowName(String districtShowName) {
|
||||
this.districtShowName = districtShowName;
|
||||
}
|
||||
/**
|
||||
* exprType
|
||||
* 继承此类的类会覆盖该方法写自己的缺省值
|
||||
* @return exprType
|
||||
*/
|
||||
|
||||
public Integer getExprType() {
|
||||
return this.exprType;
|
||||
}
|
||||
/**
|
||||
* @param exprType the exprType to set
|
||||
*/
|
||||
public void setExprType(Integer exprType) {
|
||||
this.exprType = exprType;
|
||||
}
|
||||
/**
|
||||
* matchMethod
|
||||
* 继承此类的类会覆盖该方法写自己的缺省值
|
||||
* @return matchMethod
|
||||
*/
|
||||
|
||||
public Integer getMatchMethod() {
|
||||
return this.matchMethod;
|
||||
}
|
||||
/**
|
||||
* @param matchMethod the matchMethod to set
|
||||
*/
|
||||
public void setMatchMethod(Integer matchMethod) {
|
||||
this.matchMethod = matchMethod;
|
||||
}
|
||||
/**
|
||||
* isHexbin
|
||||
* @return isHexbin
|
||||
*/
|
||||
|
||||
public Integer getIsHexbin() {
|
||||
return isHexbin;
|
||||
}
|
||||
/**
|
||||
* @param isHexbin the isHexbin to set
|
||||
*/
|
||||
public void setIsHexbin(Integer isHexbin) {
|
||||
this.isHexbin = isHexbin;
|
||||
}
|
||||
public Integer getIsHex() {
|
||||
return isHex;
|
||||
}
|
||||
public void setIsHex(Integer isHex) {
|
||||
this.isHex =isHex;
|
||||
}
|
||||
public Integer getIsCaseInsenstive() {
|
||||
return isCaseInsenstive;
|
||||
}
|
||||
public void setIsCaseInsenstive(Integer isCaseInsenstive) {
|
||||
this.isCaseInsenstive =isCaseInsenstive;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
||||
*/
|
||||
@Override
|
||||
public void initDefaultValue() {
|
||||
// TODO Auto-generated method stub
|
||||
super.initDefaultValue();
|
||||
this.exprType=0;
|
||||
this.isHexbin = 0 ;
|
||||
this.matchMethod=3;
|
||||
}
|
||||
|
||||
public static List<DnsKeywordCfg> replaceComplexKeyList(List<DnsKeywordCfg> list){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
DnsKeywordCfg base=(DnsKeywordCfg)list.get(i);
|
||||
base.setIsHex(base.getIsHexbin());
|
||||
// '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX',
|
||||
if(base.getIsHexbin()==2){
|
||||
base.setIsCaseInsenstive(1);
|
||||
}else{
|
||||
base.setIsCaseInsenstive(0);
|
||||
}
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
}
|
||||
@@ -156,6 +156,7 @@ import com.nis.web.service.SystemService;
|
||||
import com.nis.web.service.UserService;
|
||||
import com.nis.web.service.basics.AsnGroupInfoService;
|
||||
import com.nis.web.service.basics.AsnIpCfgService;
|
||||
import com.nis.web.service.basics.DnsKeywordCfgService;
|
||||
import com.nis.web.service.basics.IpReuseIpCfgService;
|
||||
import com.nis.web.service.basics.PolicyGroupInfoService;
|
||||
import com.nis.web.service.basics.ServiceDictInfoService;
|
||||
@@ -332,6 +333,8 @@ public class BaseController {
|
||||
protected PxyObjSpoofingIpPoolService pxyObjSpoofingIpPoolService;// 欺骗IP池
|
||||
@Autowired
|
||||
protected AsnGroupInfoService asnGroupInfoService;// asn组
|
||||
@Autowired
|
||||
protected DnsKeywordCfgService dnsKeywordCfgService;//DNS关键字分组配置
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import jersey.repackaged.com.google.common.collect.Lists;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsKeywordCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
//import com.nis.util.AsnCacheUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/dns/keyword")
|
||||
public class DnsKeywordController extends BaseController{
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")DnsKeywordCfg entity
|
||||
){
|
||||
Page<DnsKeywordCfg> page = dnsKeywordCfgService.findPage(new Page<DnsKeywordCfg>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model, entity);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
return "/basics/dnsKeywordCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg.setGroupType(12);
|
||||
initFormCondition(model,cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/dnsKeywordCfgFormAdd";
|
||||
}
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsKeywordCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = dnsKeywordCfgService.get(Long.parseLong(ids));
|
||||
cfg.setGroupType(12);
|
||||
initFormCondition(model, cfg);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("cfg", cfg);
|
||||
return "/basics/dnsKeywordCfgFormUpdate";
|
||||
}
|
||||
@RequestMapping(value = {"/save"})
|
||||
@RequiresPermissions(value={"dns:keyword:config"})
|
||||
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
dnsKeywordCfgService.saveDnsKeywordCfg(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/dns/keyword/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/update"})
|
||||
@RequiresPermissions(value={"dns:keyword:config"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DnsKeywordCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
dnsKeywordCfgService.update(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/dns/keyword/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"dns:keyword:config"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")DnsKeywordCfg cfg
|
||||
,Integer isAudit
|
||||
,Integer isValid
|
||||
,String ids
|
||||
,Integer functionId
|
||||
, HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes) {
|
||||
//选中配置审核
|
||||
/*if(!StringUtil.isEmpty(ids)) {
|
||||
List<DnsKeywordCfg> infoList=dnsKeywordCfgService.getByIds(ids);
|
||||
Map<Long,List<DnsKeywordCfg>> dnsKeywordMap=Maps.newHashMap();
|
||||
for(DnsKeywordCfg entity:infoList) {
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
if(dnsKeywordMap.containsKey(Long.parseLong(entity.getUserRegion1()))) {
|
||||
dnsKeywordMap.get(Long.parseLong(entity.getUserRegion1())).add(entity);
|
||||
}else {
|
||||
List<DnsKeywordCfg> keywords=Lists.newArrayList();
|
||||
keywords.add(entity);
|
||||
dnsKeywordMap.put(Long.parseLong(entity.getUserRegion1()), keywords);
|
||||
}
|
||||
}
|
||||
*//********************每次下发一个组的region,保证事物********************//*
|
||||
for (Long groupId : dnsKeywordMap.keySet()) {
|
||||
try {
|
||||
dnsKeywordCfgService.auditDnsKeywordBatch(dnsKeywordMap.get(groupId),groupId,isValid);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//条件下所有配置审核
|
||||
Page<AsnIpCfg> searchPage=new Page<AsnIpCfg>(request,response,"a");
|
||||
Page<AsnIpCfg> auditPage=new Page<AsnIpCfg>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
try {
|
||||
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");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response, cfg);
|
||||
}*/
|
||||
return "redirect:" + adminPath +"/basics/dns/keyword/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"dns:keyword:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
dnsKeywordCfgService.delete(ids);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/dns/keyword/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsKeywordCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
/**
|
||||
* @ClassName:DnsKeyworkCfgDao
|
||||
* @Description:TODO(这里用一句话描述这个类的作用)
|
||||
* @author zdx
|
||||
* @date 2019年2月15日 下午5:55:26
|
||||
* @version V1.0
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface DnsKeywordCfgDao extends CrudDao<DnsKeywordCfg>{
|
||||
public void saveDnsKeywordsCfg(ComplexkeywordCfg entity);
|
||||
public List<DnsKeywordCfg> findPage(DnsKeywordCfg entity);
|
||||
public List<DnsKeywordCfg> getByIds(@Param("ids")String ids);
|
||||
public void delete(@Param("ids")String ids);
|
||||
}
|
||||
340
src/main/java/com/nis/web/dao/configuration/DnsKeywordCfgDao.xml
Normal file
340
src/main/java/com/nis/web/dao/configuration/DnsKeywordCfgDao.xml
Normal file
@@ -0,0 +1,340 @@
|
||||
<?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.DnsKeywordCfgDao" >
|
||||
|
||||
<resultMap id="CfgIndexInfoMap" type="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" 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="dns_strategy_id" property="dnsStrategyId" jdbcType="INTEGER" />
|
||||
<result column="dns_strategy_name" property="dnsStrategyName" jdbcType="VARCHAR" />
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
<result column="source_compile_id" property="sourceCompileId" jdbcType="INTEGER" />
|
||||
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
||||
<result column="do_blacklist" property="doBlackList" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<resultMap id="stringCfgMap" type="com.nis.domain.configuration.BaseStringCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" 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="expr_type " property="exprType" jdbcType="INTEGER" />
|
||||
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<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="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<resultMap id="dnsKeywordCfgMap" type="com.nis.domain.configuration.DnsKeywordCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
||||
<result column="district" property="district" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" 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="expr_type " property="exprType" jdbcType="INTEGER" />
|
||||
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<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="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="configIndexColumn" >
|
||||
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.dns_strategy_id,a.user_region1,
|
||||
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.source_compile_id,a.cancel_request_id,
|
||||
a.do_blacklist
|
||||
</sql>
|
||||
<sql id="ipCfgColumn" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
||||
,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_region_code
|
||||
</sql>
|
||||
<sql id="strCfgColumn" >
|
||||
a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type,
|
||||
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.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
|
||||
</sql>
|
||||
<sql id="complexCfgColumn" >
|
||||
a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type,a.district,a.user_region1,
|
||||
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.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
|
||||
</sql>
|
||||
|
||||
<!-- dns域名查询 -->
|
||||
<select id="findPage" resultMap="dnsKeywordCfgMap" parameterType="com.nis.domain.configuration.DnsKeywordCfg">
|
||||
SELECT
|
||||
<include refid="complexCfgColumn" />
|
||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
FROM dns_domain_cfg 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
|
||||
where service_id=-2 and function_id=#{functionId}
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</select>
|
||||
<select id="get" resultMap="dnsKeywordCfgMap">
|
||||
select
|
||||
<include refid="complexCfgColumn"></include>
|
||||
from dns_domain_cfg a
|
||||
where a.cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="getByIds" resultMap="dnsKeywordCfgMap">
|
||||
select
|
||||
<include refid="complexCfgColumn"></include>
|
||||
from dns_domain_cfg a
|
||||
where a.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
<update id="updateCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},
|
||||
editor_id = #{editorId,jdbcType=INTEGER} ,
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||
<if test="isAudit !=null ">
|
||||
,is_audit = #{isAudit,jdbcType=BIGINT}
|
||||
</if>
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId !=null ">
|
||||
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId !=null ">
|
||||
AND compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
and function_id=#{functionId,jdbcType=INTEGER}
|
||||
</trim>
|
||||
</update>
|
||||
<update id="auditCfg" parameterType="com.nis.domain.configuration.BaseCfg">
|
||||
update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
audit_time = #{auditTime,jdbcType=TIMESTAMP}
|
||||
<if test="isValid != null" >
|
||||
,is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId !=null ">
|
||||
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId !=null ">
|
||||
AND compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
and function_id=#{functionId,jdbcType=INTEGER}
|
||||
</trim>
|
||||
|
||||
</update>
|
||||
<!-- insert dns_domain_cfg表信息 -->
|
||||
<insert id="saveDnsKeywordsCfg" parameterType="com.nis.domain.configuration.DnsKeywordCfg" >
|
||||
insert into dns_domain_cfg (
|
||||
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,
|
||||
district,
|
||||
cfg_keywords,
|
||||
cfg_type,
|
||||
cfg_region_code,
|
||||
expr_type,
|
||||
match_method,
|
||||
is_hexbin,
|
||||
user_region1
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
0,
|
||||
0,
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{district,jdbcType=VARCHAR},
|
||||
#{cfgKeywords,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{exprType,jdbcType=INTEGER},
|
||||
#{matchMethod,jdbcType=INTEGER},
|
||||
#{isHexbin,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<!-- 删除dns公共组域名配置 -->
|
||||
<delete id="deleteDnsDomainCfg">
|
||||
delete from dns_domain_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
||||
</delete>
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from dns_domain_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
<update id="update" parameterType="com.nis.domain.configuration.DnsKeywordCfg" >
|
||||
update dns_domain_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<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="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<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="district != null" >
|
||||
district = #{district,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''" >
|
||||
cfg_keywords = #{cfgKeywords,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgType != null" >
|
||||
cfg_type = #{cfgType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null" >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="exprType != null and exprType != ''" >
|
||||
expr_type = #{exprType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="matchMethod != null" >
|
||||
match_method = #{matchMethod,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isHexbin != null" >
|
||||
is_hexbin = #{isHexbin,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="compileId != null and compileId != ''" >
|
||||
compile_id = #{compileId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
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.google.common.collect.Maps;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsKeywordCfg;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
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.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.dao.configuration.DnsKeywordCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@Service
|
||||
public class DnsKeywordCfgService extends CrudService<CrudDao<DnsKeywordCfg>, DnsKeywordCfg> {
|
||||
@Autowired
|
||||
private AsnIpCfgDao asnIpCfgDao;
|
||||
|
||||
@Autowired
|
||||
protected DnsKeywordCfgDao dnsKeywordCfgDao;
|
||||
// @Autowired
|
||||
// private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
@Autowired
|
||||
private ConfigGroupInfoDao configGroupInfoDao;
|
||||
@Autowired
|
||||
private AsnGroupInfoDao asnGroupInfoDao;
|
||||
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<DnsKeywordCfg> findPage(Page<DnsKeywordCfg> page, DnsKeywordCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<DnsKeywordCfg> list=dnsKeywordCfgDao.findPage(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public List<AsnIpCfg> findByPage(String ids) {
|
||||
List<AsnIpCfg> list=asnIpCfgDao.findByPage(ids);
|
||||
return list;
|
||||
}
|
||||
public DnsKeywordCfg get(Long id ) {
|
||||
return dnsKeywordCfgDao.get(id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(DnsKeywordCfg entity){
|
||||
Date editTime=new Date();
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
List<DnsKeywordCfg> auditList=new ArrayList<DnsKeywordCfg>();
|
||||
/**
|
||||
* isvalid=0 and asnNo=false 直接修改
|
||||
* isvalid=0 and asnNo=true 需要下发
|
||||
* isvalid=1 需要下发asnNo下所有的域配置
|
||||
*/
|
||||
/*if(groupInfo.getIsUsed().equals(1) && entity.getIsValid().equals(Constants.VALID_NO)){
|
||||
entity.setAuditTime(editTime);
|
||||
entity.setAuditorId(entity.getCurrentUser().getId());
|
||||
entity.setIsValid(Constants.VALID_YES);
|
||||
entity.setIsAudit(Constants.AUDIT_YES);
|
||||
auditAsnIpList.add(entity);
|
||||
}
|
||||
if(groupInfo.getIsUsed().equals(1) && entity.getIsValid().equals(Constants.VALID_YES)){
|
||||
entity.setAuditTime(editTime);
|
||||
entity.setAuditorId(entity.getCurrentUser().getId());
|
||||
entity.setIsValid(Constants.VALID_YES);
|
||||
entity.setIsAudit(Constants.AUDIT_YES);
|
||||
auditAsnGroupList.add(groupInfo);
|
||||
}*/
|
||||
if(entity.getIsValid() ==1){
|
||||
entity.setAuditTime(editTime);
|
||||
entity.setAuditorId(entity.getCurrentUser().getId());
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
entity.setIsValid(Constants.VALID_YES);
|
||||
entity.setIsAudit(Constants.AUDIT_YES);
|
||||
}else{
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
entity.setIsValid(Constants.VALID_NO);
|
||||
entity.setIsAudit(Constants.VALID_NO);
|
||||
}
|
||||
dnsKeywordCfgDao.update(entity);
|
||||
//ASN下发状态时可以更改,更改之后直接下发
|
||||
if(entity.getIsValid() ==1){
|
||||
auditList.add(entity);
|
||||
// dnsKeywordRegionSendToMaat(auditList,Constants.VALID_YES,Constants.OPACTION_PUT);
|
||||
}
|
||||
//common group 新增下发 ASN IP配置
|
||||
/*if(!StringUtil.isEmpty(auditAsnIpList)){
|
||||
asnIPRegionSendToMaat(auditAsnIpList,Constants.VALID_YES,Constants.OPACTION_POST);
|
||||
}*/
|
||||
|
||||
//common group 修改已下发过的配置,全量下发 ASN NO下的所有有效配置
|
||||
/*if(entity.getIsAudit().equals(Constants.VALID_YES)){
|
||||
auditAllAsnRegionCfg(entity,auditAsnGroupList,null);
|
||||
}*/
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveDnsKeywordCfg(CfgIndexInfo entity) {
|
||||
// entity.setCompileId(compileId);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
if (!StringUtil.isEmpty(entity.getDomainList())) {
|
||||
for(ComplexkeywordCfg cfg:entity.getDomainList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
dnsKeywordCfgDao.saveDnsKeywordsCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO 注意:被策略引用并下发过的ASN NO,配置新增后直接下发【此功能暂时不做自动,asnip拥有审核功能】
|
||||
/*if(!StringUtil.isEmpty(auditAsnIpList)){
|
||||
asnIPRegionSendToMaat(auditAsnIpList,Constants.VALID_YES,Constants.OPACTION_POST);
|
||||
}*/
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(String ids) {
|
||||
List<DnsKeywordCfg> issuedList=new ArrayList<>();
|
||||
List<DnsKeywordCfg> dnsKwdCfgList= dnsKeywordCfgDao.getByIds(ids);
|
||||
for(DnsKeywordCfg entity:dnsKwdCfgList) {
|
||||
if(entity.getIsValid()==Constants.VALID_YES) {//代表下发过了
|
||||
entity.setIsValid(Constants.VALID_DEL);
|
||||
issuedList.add(entity);
|
||||
// groupId=asnIpCfg.getAsnIpGroup();
|
||||
//List result=asnIpCfgDao.findOtherIps(groupId, asnIpCfg.getCfgId().intValue());
|
||||
//if(result==null||result.size()==0) {
|
||||
// throw new RuntimeException("Cant not delete ip from asn group, there is only one ip left in the group!");
|
||||
//}
|
||||
}
|
||||
}
|
||||
dnsKeywordCfgDao.delete(ids);
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
// splitAndSend(issuedList,Constants.VALID_NO);
|
||||
if(issuedList.size() > 0){
|
||||
// dnsKeywordRegionSendToMaat(issuedList,Constants.VALID_NO,Constants.OPACTION_PUT);
|
||||
}
|
||||
}
|
||||
|
||||
public List<DnsKeywordCfg> getByIds(String ids) {
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
return dnsKeywordCfgDao.getByIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
--添加dns和url公共组的function_region和function_service字典
|
||||
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('622', '409', 'QNAME', '2', 'NTC_DNS_REGION', 'DNS域名配置', '1', '1', '3', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0', '0,1,2,3', '', '0,1,2', '0', '', '', '', '', '', '1', '1');
|
||||
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('623', '111', '', '2', 'NTC_URL_REGION', 'URL公共组域配置', '1', '1', '2', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0,1', '0,1,2,3', '', '0', '1', NULL, NULL, NULL, NULL, NULL, '2', '1');
|
||||
INSERT INTO `function_service_dict` (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('164', '409', '0', '0', '', '-2', 'NTC_DNS_REGION', NULL, '1', '1', '2019-02-15 16:48:56', NULL, NULL, '1', '1', '1', NULL);
|
||||
INSERT INTO `function_service_dict` (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('165', '111', '0', '0', '', '-1', 'NTC_URL_REGION', NULL, '1', '1', '2019-02-15 16:49:49', NULL, NULL, '1', '1', '1', NULL);
|
||||
423
src/main/webapp/WEB-INF/views/basics/dnsKeywordCfgFormAdd.jsp
Normal file
423
src/main/webapp/WEB-INF/views/basics/dnsKeywordCfgFormAdd.jsp
Normal file
@@ -0,0 +1,423 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="dns_keyword_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
var defaultStrInfo;
|
||||
$(function(){
|
||||
defaultStrInfo=$(".strInfo").clone(true);
|
||||
reSort($(defaultStrInfo),-1);
|
||||
$(".dnsKeywordAdd").click();
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
//业务窗口打开
|
||||
var addContent = function(obj, contentClassName) {
|
||||
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
||||
if(showDiv.hasClass("hidden")){
|
||||
$(showDiv).removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
}else{
|
||||
var additional=defaultStrInfo.clone(true);
|
||||
additional.removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
showDiv.after(additional);
|
||||
}
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
$(".selectpicker").selectpicker("render");
|
||||
//$(obj).addClass("hidden");
|
||||
}
|
||||
|
||||
//业务窗口关闭
|
||||
var delContent = function(obj,contentClassName) {
|
||||
if($("."+contentClassName).length==1){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>");
|
||||
return;
|
||||
}
|
||||
$(obj).parents("."+contentClassName).remove();
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
}
|
||||
var reSort=function(obj,index){
|
||||
$(obj).find("input,select").each(function(){
|
||||
var name=$(this).attr("name");
|
||||
if(name.indexOf("domainList[")>-1){
|
||||
var namePrefix="domainList[";
|
||||
var nameSubfix=name.substring(name.indexOf("]"));
|
||||
var nameNew=namePrefix+index+nameSubfix;
|
||||
if(nameNew!=name){
|
||||
$(this).attr("name",nameNew);
|
||||
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
<spring:message code="dns_keyword_group_configuration"></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>
|
||||
<spring:message code="add"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/dns/keyword/save" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="compileId" name="compileId" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="0">
|
||||
<input type="hidden" id="dnsKeywordGroup" name="dnsKeywordGroup" value="0">
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||
<input type="hidden" id="action" name="action" value="${service.action}">
|
||||
</c:forEach>
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
ipPattern="${region.configIpPattern}"
|
||||
portPattern="${region.configPortPattern}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<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" value="${_cfg.cfgDesc}">
|
||||
</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="dnsGroup"/></label>
|
||||
<div class="col-md-6">
|
||||
<%-- <select name="userRegion1" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||
</select> --%>
|
||||
<%-- <input class="form-control required digits dnsGroupMustExists" type="text" name="userRegion1" value="${_cfg.userRegion1}" ctx="${ctx}"> --%>
|
||||
<select name="userRegion1" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="dnsGroupInfo">
|
||||
<option value="${dnsGroupInfo.groupId}">${dnsGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-section">
|
||||
<spring:message code="dns_keyword_group_configuration" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus dnsKeywordAdd"
|
||||
onClick="addContent(this,'strInfo')" title="add"></span></small>
|
||||
</h4>
|
||||
<div class="row strInfo boxSolid dnsKeyword hidden disabled">
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||
onClick="delContent(this,'strInfo');" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<input type="hidden" name="domainList[0].configHex" value="${region.configHex }">
|
||||
<c:if test="${!empty region.configDistrict }">
|
||||
<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="district" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="domainList[0].district"
|
||||
class="selectpicker show-tick form-control required district">
|
||||
<c:forEach items="${fn:split(region.configDistrict,',')}"
|
||||
var="_district">
|
||||
<option value="${_district }">${_district}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input type="hidden" name="domainList[0].districtShowName" maxlength="64" placeholder="<spring:message code='please_input'/> <spring:message code='custom_region'/>" class="otherValue form-control invisibleChar" />
|
||||
</div>
|
||||
<div for="domainList[0].districtShowName"></div>
|
||||
<div for="domainList[0].district"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<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="keywords" />
|
||||
</label>
|
||||
|
||||
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||
<c:if test="${region.configMultiKeywords eq 1}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required tags <c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if> <c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>" type="text" id="tags_${tabName}${status.index}"
|
||||
name="domainList[0].cfgKeywords"
|
||||
value="${cfg.cfgKeywords}">
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 此配置的关键词不允许输入多个关键词 -->
|
||||
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
||||
<div class="col-md-6">
|
||||
|
||||
<input class="form-control required invisibleChar"
|
||||
type="text"
|
||||
name="domainList[0].cfgKeywords">
|
||||
</div>
|
||||
</c:if>
|
||||
<div for="domainList[0].cfgKeywords"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 exprType">
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="expression_type" /></label>
|
||||
<div class="col-md-6">
|
||||
<c:if test="${!empty region.configExprType}">
|
||||
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}" varStatus="stat" >
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC" >
|
||||
<c:if test="${exprTypeC.itemCode eq exprType}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="domainList[0].exprType" value="${exprType }"
|
||||
class="required"
|
||||
<c:if test="${stat.index == 0 }"> checked </c:if>
|
||||
|
||||
>
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configExprType}">
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
|
||||
<c:if test="${exprTypeC.itemCode eq 0}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="domainList[0].exprType" value="${exprTypeC.itemCode }"
|
||||
class="required" checked >
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
<div for="domainList[0].exprType"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 matchMethod">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="match_method" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="domainList[0].matchMethod"
|
||||
class="selectpicker select2 form-control required ">
|
||||
<c:if test="${!empty region.configMatchMethod}">
|
||||
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq matchMethod}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configMatchMethod}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq 0}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
selected
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</select>
|
||||
</div>
|
||||
<div for="domainList[0].matchMethod"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row <c:if test="${fn:length(fn:split(region.configHex,',')) ==1}">hidden</c:if>">
|
||||
<c:if test="${!empty region.configHex}">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
|
||||
<div class="col-md-6">
|
||||
<!-- isP2pHashCfg: P2PHash配置只能是十六进制字符 -->
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="domainList[0].isHex" value="1" class="required"
|
||||
><spring:message code="hex"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="domainList[0].isHex" value="0" class="required"
|
||||
><spring:message code="not_hex"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="domainList[0].isHex"></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="is_case_insenstive"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="domainList[0].isCaseSenstive" value="1" class="required"
|
||||
><spring:message code="case_senstive"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="domainList[0].isCaseSenstive" value="0" class="required"
|
||||
><spring:message code="case_insenstive"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="domainList[0].isCaseInsenstive"></div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configHex}">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="domainList[0].isHex" value="0" class="required" checked
|
||||
><spring:message code="not_hex"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="domainList[0].isHex"></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="is_case_insenstive"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="domainList[0].isCaseSenstive" value="0" class="required"
|
||||
checked
|
||||
><spring:message code="case_insenstive"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="domainList[0].isCaseInsenstive"></div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="row hidden">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="whether_hexbinary" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="domainList[0].isHexbin"
|
||||
class="selectpicker select2 form-control required">
|
||||
<c:if test="${!empty region.configHex}">
|
||||
<c:forEach var="isHexbin" items="${fn:split(region.configHex,',')}">
|
||||
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
|
||||
<c:if test="${isHexbinC.itemCode eq isHexbin}">
|
||||
<option value="${isHexbinC.itemCode}"
|
||||
<c:if test="${empty isHexbin && isHexbin eq 0}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${isHexbinC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configHex}">
|
||||
|
||||
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
|
||||
<c:if test="${isHexbinC.itemCode eq 0}">
|
||||
<option value="${isHexbinC.itemCode}" selected >
|
||||
<spring:message code="${isHexbinC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
|
||||
</c:if>
|
||||
</select>
|
||||
</div>
|
||||
<div for="domainList[0].isHexbin"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</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">
|
||||
<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>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
368
src/main/webapp/WEB-INF/views/basics/dnsKeywordCfgFormUpdate.jsp
Normal file
368
src/main/webapp/WEB-INF/views/basics/dnsKeywordCfgFormUpdate.jsp
Normal file
@@ -0,0 +1,368 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="dns_keyword_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
var defaultStrInfo;
|
||||
$(function(){
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="dns_keyword_group_configuration"></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>
|
||||
<spring:message code="edit"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/dns/keyword/update" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="cfgId" value="${cfg.cfgId}">
|
||||
<input type="hidden" name="regionId" value="${cfg.regionId}">
|
||||
<input type="hidden" name="compileId" value="${cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${cfg.functionId}">
|
||||
<input type="hidden" name="isValid" value="${cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${cfg.isAudit}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${cfg.serviceId}">
|
||||
<input type="hidden" id="requestId" name="requestId" value="${cfg.requestId}">
|
||||
<input type="hidden" id="dnsKeywordGroup" name="dnsKeywordGroup" value="${cfg.userRegion1}">
|
||||
<input type="hidden" id="action" name="action" value="${cfg.action}">
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
ipPattern="${region.configIpPattern}"
|
||||
portPattern="${region.configPortPattern}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<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" value="${cfg.cfgDesc}">
|
||||
</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="dnsGroup"/></label>
|
||||
<div class="col-md-6">
|
||||
<%-- <select name="userRegion1" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||
</select> --%>
|
||||
<%-- <input class="form-control required digits dnsGroupMustExists" type="text" name="userRegion1" value="${_cfg.userRegion1}" ctx="${ctx}"> --%>
|
||||
<select name="userRegion1" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="dnsGroupInfo">
|
||||
<option value="${dnsGroupInfo.groupId}" <c:if test="${cfg.userRegion1 eq dnsGroupInfo.groupId }">selected</c:if>>${dnsGroupInfo.groupName}</option>
|
||||
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<input type="hidden" name="configHex" value="${region.configHex }">
|
||||
<c:if test="${!empty region.configDistrict }">
|
||||
<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="district" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="district"
|
||||
class="selectpicker show-tick form-control required district">
|
||||
<c:forEach items="${fn:split(region.configDistrict,',')}"
|
||||
var="_district">
|
||||
<option value="${_district }" <c:if test="${cfg.district eq _district}">selected</c:if>>${_district}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="district"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<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="keywords" />
|
||||
</label>
|
||||
|
||||
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||
<c:if test="${region.configMultiKeywords eq 1}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required tags <c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if> <c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>" type="text" id="tags_${tabName}${status.index}"
|
||||
name="cfgKeywords"
|
||||
value="${cfg.cfgKeywords}">
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 此配置的关键词不允许输入多个关键词 -->
|
||||
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
||||
<div class="col-md-6">
|
||||
|
||||
<input class="form-control required invisibleChar"
|
||||
type="text"
|
||||
name="cfgKeywords" value="${cfg.cfgKeywords}">
|
||||
</div>
|
||||
</c:if>
|
||||
<div for="cfgKeywords"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 exprType">
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="expression_type" /></label>
|
||||
<div class="col-md-6">
|
||||
<c:if test="${!empty region.configExprType}">
|
||||
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}" varStatus="stat" >
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC" >
|
||||
<c:if test="${exprTypeC.itemCode eq exprType}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="exprType" value="${exprType }"
|
||||
class="required"
|
||||
<c:if test="${cfg.exprType eq exprType}"> checked </c:if>
|
||||
>
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configExprType}">
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
|
||||
<c:if test="${exprTypeC.itemCode eq 0}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="exprType" value="${exprTypeC.itemCode }"
|
||||
class="required" checked >
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
<div for="exprType"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 matchMethod">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="match_method" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="matchMethod"
|
||||
class="selectpicker select2 form-control required ">
|
||||
<c:if test="${!empty region.configMatchMethod}">
|
||||
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq matchMethod}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
<c:if test="${cfg.matchMethod eq matchMethod || (empty cfg.matchMethod && matchMethod eq 0)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configMatchMethod}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq 0}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
selected
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</select>
|
||||
</div>
|
||||
<div for="matchMethod"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row <c:if test="${fn:length(fn:split(region.configHex,',')) ==1}">hidden</c:if>">
|
||||
<c:if test="${!empty region.configHex}">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
|
||||
<div class="col-md-6">
|
||||
<!-- isP2pHashCfg: P2PHash配置只能是十六进制字符 -->
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isHex" value="1" class="required" <c:if test="${cfg.isHex eq 1 }">checked</c:if>
|
||||
><spring:message code="hex"/>
|
||||
</label>
|
||||
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isHex" value="0" class="required" <c:if test="${cfg.isHex eq 0 }">checked</c:if>
|
||||
><spring:message code="not_hex"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="isHex"></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="is_case_insenstive"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isCaseSenstive" value="1" class="required" <%-- <c:if test="${cfg.isCaseSenstive eq 1 }">checked</c:if> --%>
|
||||
><spring:message code="case_senstive"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isCaseSenstive" value="0" class="required" <%-- <c:if test="${cfg.isCaseSenstive eq 1 }">checked</c:if> --%>
|
||||
><spring:message code="case_insenstive"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="isCaseInsenstive"></div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configHex}">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isHex" value="0" class="required" checked
|
||||
><spring:message code="not_hex"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="isHex"></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="is_case_insenstive"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isCaseSenstive" value="0" class="required"
|
||||
checked
|
||||
><spring:message code="case_insenstive"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="isCaseInsenstive"></div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="row hidden">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="whether_hexbinary" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="isHexbin"
|
||||
class="selectpicker select2 form-control required">
|
||||
<c:if test="${!empty region.configHex}">
|
||||
<c:forEach var="isHexbin" items="${fn:split(region.configHex,',')}">
|
||||
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
|
||||
<c:if test="${isHexbinC.itemCode eq isHexbin}">
|
||||
<option value="${isHexbinC.itemCode}"
|
||||
<c:if test="${cfg.isHexbin eq isHexbin || (empty isHexbin && isHexbin eq 0)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${isHexbinC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configHex}">
|
||||
|
||||
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
|
||||
<c:if test="${isHexbinC.itemCode eq 0}">
|
||||
<option value="${isHexbinC.itemCode}" selected >
|
||||
<spring:message code="${isHexbinC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
|
||||
</c:if>
|
||||
</select>
|
||||
</div>
|
||||
<div for="isHexbin"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<%-- <%@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">
|
||||
<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>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
305
src/main/webapp/WEB-INF/views/basics/dnsKeywordCfgList.jsp
Normal file
305
src/main/webapp/WEB-INF/views/basics/dnsKeywordCfgList.jsp
Normal file
@@ -0,0 +1,305 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="asn_ip_configuration"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.cfgKeywords}"){
|
||||
$("#intype").val("${cfg.cfgKeywords}");
|
||||
}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",'');
|
||||
$("#description").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
|
||||
if($("#exportType").val() != null && $("#exportType").val() != ""){
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
$("#exportValue").val($("#intype").val());
|
||||
}
|
||||
}
|
||||
});
|
||||
var edit=function(url){
|
||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
if(cked.length==1){
|
||||
window.location = url+"&compileId="+cked.attr("id");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<shiro:hasPermission name="dns:keyword:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/basics/dns/keyword/addForm?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
<c:set var="regionImport" value="false"></c:set>
|
||||
<c:forEach items="${regionList}" var="region" >
|
||||
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||
<c:set var="regionImport" value="true"></c:set>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<c:if test="${regionImport eq 'true'}">
|
||||
<button type="button" class="btn btn-primary import" >
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="import"></spring:message></button>
|
||||
</c:if>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="dns_keyword_group_configuration"></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" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/dns/keyword/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="exportType" type="hidden" value="${cfg.seltype}"/>
|
||||
<input id="exportValue" type="hidden" value=""/>
|
||||
<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='group'/></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="destPort"><spring:message code="port"></spring:message></form:option> --%>
|
||||
<form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
|
||||
<form:option value="isValid"><spring:message code="valid_identifier"></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="dns:keyword:config">
|
||||
<sys:delRow url="${ctx}/basics/dns/keyword/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basics/dns/keyword/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<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="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/basics/dns/keyword/exportAsnIp?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/dns/keyword/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/dns/keyword/exportAsnIp?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/dns/keyword/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<shiro:hasPermission name="dns:keyword:config">
|
||||
<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}/basics/dns/keyword/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/dns/keyword/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/dns/keyword/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-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> </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> </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> </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>
|
||||
<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 column="config_describe" ><spring:message code="config_describe"/></th>
|
||||
<th column="keywords" ><spring:message code="keywords"/></th>
|
||||
<th class="sort-column r.user_region1" column="userregion1" ><spring:message code="dnsGroup"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th column="valid_identifier" ><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" isValid="${cfg.isValid}" value="${cfg.isAudit}"></td>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>${cfg.cfgKeywords }</td>
|
||||
<td>${cfg.userRegion1}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||
</td>
|
||||
<td>${cfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="importPath" value="/basics/dns/keyword/list?functionId=${cfg.functionId}"/>
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user