proxy intercept ip功能完成
http\dns\ssl\mail dolog添加
This commit is contained in:
@@ -15,8 +15,8 @@ package com.nis.domain.configuration;
|
|||||||
* @date 2018年2月5日 下午3:34:14
|
* @date 2018年2月5日 下午3:34:14
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class InterceptPktBin extends ComplexkeywordCfg {
|
public class InterceptPktBin extends BaseStringCfg<InterceptPktBin> {
|
||||||
private static final String tableName="pxy_intercept_pkt_bin";
|
private static final String tableName="intercept_pkt_bin";
|
||||||
/**
|
/**
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -126,6 +126,11 @@ public final class Constants {
|
|||||||
public static final int ACTION_HMD = 8;
|
public static final int ACTION_HMD = 8;
|
||||||
public static final Integer DROP_ACTION = Configurations.getIntProperty("drop_action",32);
|
public static final Integer DROP_ACTION = Configurations.getIntProperty("drop_action",32);
|
||||||
public static final Integer LOOP_ACTION = Configurations.getIntProperty("loop_action",96);
|
public static final Integer LOOP_ACTION = Configurations.getIntProperty("loop_action",96);
|
||||||
|
public static final Integer RATELIMIT_ACTION = Configurations.getIntProperty("ratelimit_action",64);
|
||||||
|
public static final Integer REPLACE_ACTION = Configurations.getIntProperty("replace_action",80);
|
||||||
|
public static final Integer MONIT_ACTION = Configurations.getIntProperty("monit_action",1);
|
||||||
|
public static final Integer REJECT_ACTION = Configurations.getIntProperty("reject_action",16);
|
||||||
|
public static final Integer WHITELIST_ACTION = Configurations.getIntProperty("reject_action",128);
|
||||||
public static final int CFG_PAGE = 0;
|
public static final int CFG_PAGE = 0;
|
||||||
public static final int AUDIT_PAGE = 1;
|
public static final int AUDIT_PAGE = 1;
|
||||||
public static final String DEFAULT_CAPTCHA_PARAM = "captcha";
|
public static final String DEFAULT_CAPTCHA_PARAM = "captcha";
|
||||||
@@ -569,6 +574,10 @@ public final class Constants {
|
|||||||
//P2P自定义域参数
|
//P2P自定义域参数
|
||||||
public static String P2P_IP_TYPE_USER_REGION_KEY=Configurations.getStringProperty("p2p_ip_type_user_region_key", "P2P_IP_TYPE");
|
public static String P2P_IP_TYPE_USER_REGION_KEY=Configurations.getStringProperty("p2p_ip_type_user_region_key", "P2P_IP_TYPE");
|
||||||
public static String P2P_HASH_TYPE_USER_REGION_KEY=Configurations.getStringProperty("p2p_hash_type_user_region_key", "P2P_HASH_TYPE");
|
public static String P2P_HASH_TYPE_USER_REGION_KEY=Configurations.getStringProperty("p2p_hash_type_user_region_key", "P2P_HASH_TYPE");
|
||||||
|
//PROXY INTERCEPT IP自定义域参数
|
||||||
|
public static String INTERCEPT_IP_MONIT_USER_REGION_KEY=Configurations.getStringProperty("keyring_id", "keyring_id");
|
||||||
|
public static String INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY=Configurations.getStringProperty("Droprate", "Droprate");
|
||||||
|
public static String INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY=Configurations.getStringProperty("Bandwidth", "Bandwidth");
|
||||||
|
|
||||||
//大屏统计分析查询接口URL
|
//大屏统计分析查询接口URL
|
||||||
public static final String DASHBOARD_URL = Configurations.getStringProperty("dashboardUrl","dashboardUrl");
|
public static final String DASHBOARD_URL = Configurations.getStringProperty("dashboardUrl","dashboardUrl");
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.nis.web.controller.configuration.proxy;
|
package com.nis.web.controller.configuration.proxy;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -18,12 +20,17 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.DnsResStrategy;
|
import com.nis.domain.configuration.DnsResStrategy;
|
||||||
import com.nis.domain.configuration.HttpUrlCfg;
|
import com.nis.domain.configuration.HttpUrlCfg;
|
||||||
|
import com.nis.domain.configuration.InterceptPktBin;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.template.IpAddrTemplate;
|
import com.nis.domain.configuration.template.IpAddrTemplate;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.web.controller.configuration.CommonController;
|
import com.nis.web.controller.configuration.CommonController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP相关配置控制类
|
* IP相关配置控制类
|
||||||
@@ -35,21 +42,13 @@ import com.nis.web.controller.configuration.CommonController;
|
|||||||
public class InterceptController extends CommonController{
|
public class InterceptController extends CommonController{
|
||||||
@RequestMapping(value = {"/ip/list"})
|
@RequestMapping(value = {"/ip/list"})
|
||||||
// @RequiresPermissions(value={"website:dns:config"})
|
// @RequiresPermissions(value={"website:dns:config"})
|
||||||
public String dnsList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model,cfg);
|
||||||
return "/cfg/intercept/interceptIpList";
|
return "/cfg/intercept/interceptIpList";
|
||||||
}
|
}
|
||||||
/*@RequestMapping(value = {"/ip/list"})
|
|
||||||
// @RequiresPermissions(value={"intercept:ip:config","intercept:ip:confirm"},logical=Logical.OR)
|
|
||||||
public String ipList(String cfgName,Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
|
||||||
this._ipList(cfgName,model, cfg, request, response);
|
|
||||||
model.addAttribute("urlPrefix","/proxy/intercept/ip");
|
|
||||||
model.addAttribute("requiresPermissionPrefix","intercept:ip");
|
|
||||||
return "/cfg/common/ipList";
|
|
||||||
}*/
|
|
||||||
@RequestMapping(value = {"/domain/list"})
|
@RequestMapping(value = {"/domain/list"})
|
||||||
// @RequiresPermissions(value={"intercept:domain:config","intercept:domain:confirm"},logical=Logical.OR)
|
// @RequiresPermissions(value={"intercept:domain:config","intercept:domain:confirm"},logical=Logical.OR)
|
||||||
public String domainList(String cfgName,Model model,@ModelAttribute("cfg")HttpUrlCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String domainList(String cfgName,Model model,@ModelAttribute("cfg")HttpUrlCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||||
@@ -61,7 +60,7 @@ public class InterceptController extends CommonController{
|
|||||||
|
|
||||||
@RequestMapping(value = {"/interceptIpForm"})
|
@RequestMapping(value = {"/interceptIpForm"})
|
||||||
@RequiresPermissions(value={"intercept:ip:config"})
|
@RequiresPermissions(value={"intercept:ip:config"})
|
||||||
public String dnsForm(Model model,String ids,CfgIndexInfo entity) {
|
public String interceptIpForm(Model model,String ids,CfgIndexInfo entity) {
|
||||||
if(StringUtils.isNotBlank(ids)){
|
if(StringUtils.isNotBlank(ids)){
|
||||||
entity = interceptCfgService.getInterceptIpCfg(Long.parseLong(ids));
|
entity = interceptCfgService.getInterceptIpCfg(Long.parseLong(ids));
|
||||||
initUpdateFormCondition(model,entity);
|
initUpdateFormCondition(model,entity);
|
||||||
@@ -75,14 +74,6 @@ public class InterceptController extends CommonController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/intercept/interceptIpForm";
|
return "/cfg/intercept/interceptIpForm";
|
||||||
}
|
}
|
||||||
/*@RequestMapping(value = {"/ip/form"})
|
|
||||||
@RequiresPermissions(value={"intercept:ip:config"})
|
|
||||||
public String ipForm(String cfgName,Model model,String ids,Integer functionId,BaseIpCfg entity) {
|
|
||||||
this._ipForm(cfgName,model, ids, functionId, entity);
|
|
||||||
model.addAttribute("urlPrefix","/proxy/intercept/ip");
|
|
||||||
model.addAttribute("requiresPermissionPrefix","intercept:ip");
|
|
||||||
return "/cfg/common/ipForm";
|
|
||||||
}*/
|
|
||||||
@RequestMapping(value = {"/domain/form"})
|
@RequestMapping(value = {"/domain/form"})
|
||||||
@RequiresPermissions(value={"intercept:domain:config"})
|
@RequiresPermissions(value={"intercept:domain:config"})
|
||||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,HttpUrlCfg entity) {
|
public String domainForm(String cfgName,Model model,String ids,Integer functionId,HttpUrlCfg entity) {
|
||||||
@@ -91,29 +82,87 @@ public class InterceptController extends CommonController{
|
|||||||
model.addAttribute("requiresPermissionPrefix","intercept:domain");
|
model.addAttribute("requiresPermissionPrefix","intercept:domain");
|
||||||
return "/cfg/common/domainForm";
|
return "/cfg/common/domainForm";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"saveOrUpdate"})
|
@RequestMapping(value = {"/ip/saveOrUpdate"})
|
||||||
public String saveInterceptIpCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes,Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||||
interceptCfgService.saveInterceptIpCfg(entity);
|
try {
|
||||||
|
interceptCfgService.saveInterceptIpCfg(entity);
|
||||||
|
addMessage(redirectAttributes,"save_success");
|
||||||
|
} catch (Exception e) {
|
||||||
|
addMessage(redirectAttributes,"save_failed");
|
||||||
|
}
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+entity.getFunctionId();
|
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
/*@RequestMapping(value = {"/ip/saveOrUpdate"})
|
|
||||||
public String saveOrUpdateIp(String cfgName,RedirectAttributes model, IpPortCfg cfg) {
|
@RequestMapping(value = {"ajaxInterceptIpSubList"})
|
||||||
this._saveOrUpdateIp(cfgName,model, cfg);
|
public String ajaxInterceptIpSubList(Model model,Long cfgId,Integer index) {
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
CfgIndexInfo cfg = interceptCfgService.getInterceptIpCfg(cfgId);
|
||||||
}*/
|
List<String[]> tabList = new ArrayList();
|
||||||
|
if(cfg.getIpPortList()!=null){
|
||||||
|
String cfgType = null;
|
||||||
|
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||||
|
if(!ip.getCfgType().equals(cfgType)){
|
||||||
|
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||||
|
cfgType = ip.getCfgType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(cfg.getInterceptPktBinList()!=null){
|
||||||
|
String cfgType = null;
|
||||||
|
for(BaseStringCfg keyword:cfg.getInterceptPktBinList()){
|
||||||
|
if(!keyword.getCfgType().equals(cfgType)){
|
||||||
|
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||||
|
cfgType = keyword.getCfgType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
model.addAttribute("index", index);
|
||||||
|
model.addAttribute("tabList", tabList);
|
||||||
|
return "/cfg/intercept/interceptIpSubList";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"auditInterceptIpCfg"})
|
||||||
|
@RequiresPermissions(value={"intercept:ip:confirm"})
|
||||||
|
public String auditInterceptIpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||||
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
for(String id :idArray){
|
||||||
|
entity = interceptCfgService.getInterceptIpCfg(Long.parseLong(id));
|
||||||
|
entity.setIsAudit(isAudit);
|
||||||
|
entity.setIsValid(isValid);
|
||||||
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setAuditTime(new Date());
|
||||||
|
entity.setFunctionId(functionId);
|
||||||
|
try {
|
||||||
|
interceptCfgService.auditInterceptIpCfg(entity,isAudit);
|
||||||
|
addMessage(redirectAttributes,"audit_success");
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
logger.error("intercept ip audit failed",e);
|
||||||
|
addMessage(redirectAttributes,"audit_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"updateInterceptIpValid"})
|
||||||
|
@RequiresPermissions(value={"intercept:ip:config"})
|
||||||
|
public String updateInterceptIpValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
|
interceptCfgService.updatInterceptValid(isValid,ids,functionId);
|
||||||
|
addMessage(redirectAttributes,"delete_success");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("intercept ip delete failed",e);
|
||||||
|
addMessage(redirectAttributes,"delete_failed");
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/domain/saveOrUpdate"})
|
@RequestMapping(value = {"/domain/saveOrUpdate"})
|
||||||
public String saveOrUpdateDomain(String cfgName,RedirectAttributes model, HttpUrlCfg cfg) {
|
public String saveOrUpdateDomain(String cfgName,RedirectAttributes model, HttpUrlCfg cfg) {
|
||||||
this._saveOrUpdateDomain(cfgName, model, cfg);
|
this._saveOrUpdateDomain(cfgName, model, cfg);
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/domain/list?functionId="+cfg.getFunctionId();
|
return "redirect:" + adminPath +"/proxy/intercept/domain/list?functionId="+cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/ip/delete"})
|
|
||||||
@RequiresPermissions("intercept:ip:config")
|
|
||||||
public String deleteIp(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
|
||||||
this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
|
||||||
model.addAttribute("urlPrefix","/proxy/intercept/ip");
|
|
||||||
model.addAttribute("requiresPermissionPrefix","intercept:ip");
|
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
|
||||||
}
|
|
||||||
@RequestMapping(value = {"/domain/delete"})
|
@RequestMapping(value = {"/domain/delete"})
|
||||||
@RequiresPermissions("intercept:domain:config")
|
@RequiresPermissions("intercept:domain:config")
|
||||||
public String deleteDomain(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
public String deleteDomain(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
||||||
@@ -122,14 +171,6 @@ public class InterceptController extends CommonController{
|
|||||||
model.addAttribute("requiresPermissionPrefix","intercept:domain");
|
model.addAttribute("requiresPermissionPrefix","intercept:domain");
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/domain/list?functionId="+functionId;
|
return "redirect:" + adminPath +"/proxy/intercept/domain/list?functionId="+functionId;
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/ip/audit"})
|
|
||||||
@RequiresPermissions("intercept:ip:confirm")
|
|
||||||
public String auditIp(String cfgName,String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) {
|
|
||||||
this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
|
||||||
redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
|
||||||
redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip");
|
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
|
||||||
}
|
|
||||||
@RequestMapping(value = {"/domain/audit"})
|
@RequestMapping(value = {"/domain/audit"})
|
||||||
@RequiresPermissions("intercept:domain:confirm")
|
@RequiresPermissions("intercept:domain:confirm")
|
||||||
public String auditDomain(String ids,HttpUrlCfg cfg,RedirectAttributes redirectAttributes) {
|
public String auditDomain(String ids,HttpUrlCfg cfg,RedirectAttributes redirectAttributes) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import com.nis.web.dao.MyBatisDao;
|
|||||||
public interface InterceptCfgDao extends CrudDao<CfgIndexInfo>{
|
public interface InterceptCfgDao extends CrudDao<CfgIndexInfo>{
|
||||||
|
|
||||||
public List<InterceptPktBin> getInterceptPktBin(CfgIndexInfo entity);
|
public List<InterceptPktBin> getInterceptPktBin(CfgIndexInfo entity);
|
||||||
public void insertInterceptPktBin(InterceptPktBin entity);
|
public void saveInterceptPktBin(InterceptPktBin entity);
|
||||||
public void deleteInterceptPktBin(CfgIndexInfo entity);
|
public void deleteInterceptPktBin(CfgIndexInfo entity);
|
||||||
public void deleteInterceptIpCfg(CfgIndexInfo entity);
|
public void deleteInterceptIpCfg(CfgIndexInfo entity);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
a.audit_time,a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
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
|
a.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
|
||||||
</sql>
|
</sql>
|
||||||
<select id="getInterceptPktBinList" resultMap="stringCfgMap">
|
<select id="getInterceptPktBin" resultMap="stringCfgMap">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="StrCfg_Column" />
|
<include refid="StrCfg_Column" />
|
||||||
FROM intercept_pkt_bin a where compile_id=#{compileId} and function_id=#{functionId}
|
FROM intercept_pkt_bin a where compile_id=#{compileId} and function_id=#{functionId}
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
#{userRegion5,jdbcType=VARCHAR}
|
#{userRegion5,jdbcType=VARCHAR}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<delete id="deleteDnsIpCfg" >
|
<delete id="deleteInterceptIpCfg" >
|
||||||
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
||||||
</delete>
|
</delete>
|
||||||
<!-- 删除pkt bin子配置 -->
|
<!-- 删除pkt bin子配置 -->
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||||
<result column="dns_strategy_id" property="dnsStrategyId" jdbcType="INTEGER" />
|
<result column="dns_strategy_id" property="dnsStrategyId" jdbcType="INTEGER" />
|
||||||
<result column="dns_strategy_name" property="dnsStrategyName" jdbcType="VARCHAR" />
|
<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_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||||
@@ -129,7 +130,7 @@
|
|||||||
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
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.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.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.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="IpCfg_Column" >
|
<sql id="IpCfg_Column" >
|
||||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||||
@@ -405,7 +406,8 @@
|
|||||||
user_region2,
|
user_region2,
|
||||||
user_region3,
|
user_region3,
|
||||||
user_region4,
|
user_region4,
|
||||||
user_region5
|
user_region5,
|
||||||
|
do_log
|
||||||
)values (
|
)values (
|
||||||
#{cfgDesc,jdbcType=VARCHAR},
|
#{cfgDesc,jdbcType=VARCHAR},
|
||||||
#{action,jdbcType=INTEGER},
|
#{action,jdbcType=INTEGER},
|
||||||
@@ -431,7 +433,8 @@
|
|||||||
#{userRegion2,jdbcType=VARCHAR},
|
#{userRegion2,jdbcType=VARCHAR},
|
||||||
#{userRegion3,jdbcType=VARCHAR},
|
#{userRegion3,jdbcType=VARCHAR},
|
||||||
#{userRegion4,jdbcType=VARCHAR},
|
#{userRegion4,jdbcType=VARCHAR},
|
||||||
#{userRegion5,jdbcType=VARCHAR}
|
#{userRegion5,jdbcType=VARCHAR},
|
||||||
|
#{doLog,jdbcType=INTEGER}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- insert ip_port_cfg表信息 -->
|
<!-- insert ip_port_cfg表信息 -->
|
||||||
@@ -807,6 +810,9 @@
|
|||||||
<if test="action != null" >
|
<if test="action != null" >
|
||||||
action = #{action,jdbcType=INTEGER},
|
action = #{action,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="doLog != null" >
|
||||||
|
do_log = #{doLog,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
<if test="isValid != null" >
|
<if test="isValid != null" >
|
||||||
is_valid = #{isValid,jdbcType=INTEGER},
|
is_valid = #{isValid,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public void saveInterceptIpCfg(CfgIndexInfo entity){
|
public void saveInterceptIpCfg(CfgIndexInfo entity){
|
||||||
|
if(!entity.getAction().equals(Constants.REPLACE_ACTION)){
|
||||||
|
entity.setInterceptPktBinList(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
entity.setIsValid(0);
|
||||||
|
|
||||||
//设置区域运营商信息
|
//设置区域运营商信息
|
||||||
setAreaEffectiveIds(entity);
|
setAreaEffectiveIds(entity);
|
||||||
if(entity.getCfgId()==null){
|
if(entity.getCfgId()==null){
|
||||||
@@ -102,7 +108,12 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
|
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
|
||||||
if(idList!=null && idList.size()>0){
|
if(idList!=null && idList.size()>0){
|
||||||
compileId = idList.get(0);
|
compileId = idList.get(0);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
entity.setCompileId(compileId);
|
entity.setCompileId(compileId);
|
||||||
entity.setCreateTime(new Date());
|
entity.setCreateTime(new Date());
|
||||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
@@ -113,11 +124,12 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
websiteCfgDao.saveIpPortCfg(cfg);
|
websiteCfgDao.saveIpPortCfg(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(entity.getInterceptPktBinList()!=null){
|
|
||||||
|
if(entity.getInterceptPktBinList()!=null ){
|
||||||
for(InterceptPktBin cfg:entity.getInterceptPktBinList()){
|
for(InterceptPktBin cfg:entity.getInterceptPktBinList()){
|
||||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
interceptCfgDao.insertInterceptPktBin(cfg);
|
interceptCfgDao.saveInterceptPktBin(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,11 +141,7 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.info("获取编译ID出错");
|
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
@@ -160,7 +168,7 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
for(InterceptPktBin cfg:entity.getInterceptPktBinList()){
|
for(InterceptPktBin cfg:entity.getInterceptPktBinList()){
|
||||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
interceptCfgDao.insertInterceptPktBin(cfg);
|
interceptCfgDao.saveInterceptPktBin(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,13 +182,13 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**//**
|
/**
|
||||||
* dns配置删除
|
* dns配置删除
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
*//*
|
*/
|
||||||
public void updateDnsCfgValid(Integer isValid,String ids,Integer functionId){
|
public void updatInterceptValid(Integer isValid,String ids,Integer functionId){
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for(String id :idArray){
|
||||||
@@ -192,18 +200,18 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
websiteCfgDao.updateCfgValid(entity);
|
websiteCfgDao.updateCfgValid(entity);
|
||||||
//查询子配置
|
//查询子配置
|
||||||
entity = this.getDnsCfg(Long.parseLong(id));
|
entity = this.getInterceptIpCfg(Long.parseLong(id));
|
||||||
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||||
IpPortCfg cfg = new IpPortCfg();
|
IpPortCfg cfg = new IpPortCfg();
|
||||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
cfg.setTableName(IpPortCfg.getTablename());
|
cfg.setTableName(IpPortCfg.getTablename());
|
||||||
websiteCfgDao.updateCfgValid(cfg);
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
}
|
}
|
||||||
if(entity.getDomainList()!=null && entity.getDomainList().size()>0)
|
if(entity.getInterceptPktBinList()!=null && entity.getInterceptPktBinList().size()>0)
|
||||||
{
|
{
|
||||||
SslKeywordCfg cfg = new SslKeywordCfg();
|
InterceptPktBin cfg = new InterceptPktBin();
|
||||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
cfg.setTableName(DnsDomainCfg.getTablename());
|
cfg.setTableName(InterceptPktBin.getTablename());
|
||||||
websiteCfgDao.updateCfgValid(cfg);
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
}
|
}
|
||||||
//保存区域IP信息
|
//保存区域IP信息
|
||||||
@@ -217,13 +225,13 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*//**
|
/**
|
||||||
* dns配置审核
|
* dns配置审核
|
||||||
* @param entity
|
* @param entity
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @throws MaatConvertException
|
* @throws MaatConvertException
|
||||||
*//*
|
*/
|
||||||
public void auditDnsCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
|
public void auditInterceptIpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
|
||||||
//修改数据库审核状态信息
|
//修改数据库审核状态信息
|
||||||
entity.setTableName(CfgIndexInfo.getTablename());
|
entity.setTableName(CfgIndexInfo.getTablename());
|
||||||
websiteCfgDao.auditCfg(entity);
|
websiteCfgDao.auditCfg(entity);
|
||||||
@@ -239,7 +247,7 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||||
|
|
||||||
//查询子配置并修改审核状态
|
//查询子配置并修改审核状态
|
||||||
entity = this.getDnsCfg(entity.getCfgId());
|
entity = this.getInterceptIpCfg(entity.getCfgId());
|
||||||
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||||
IpPortCfg cfg = new IpPortCfg();
|
IpPortCfg cfg = new IpPortCfg();
|
||||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
@@ -254,13 +262,13 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(entity.getDomainList()!=null && entity.getDomainList().size()>0){
|
if(entity.getInterceptPktBinList()!=null && entity.getInterceptPktBinList().size()>0){
|
||||||
DnsDomainCfg cfg = new DnsDomainCfg();
|
InterceptPktBin cfg = new InterceptPktBin();
|
||||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
cfg.setTableName(DnsDomainCfg.getTablename());
|
cfg.setTableName(InterceptPktBin.getTablename());
|
||||||
websiteCfgDao.auditCfg(cfg);
|
websiteCfgDao.auditCfg(cfg);
|
||||||
if(isAudit==1){
|
if(isAudit==1){
|
||||||
Map<String,List> map = cfgConvert(strRegionList,entity.getDomainList(),2,entity,groupRelationList);
|
Map<String,List> map = cfgConvert(strRegionList,entity.getInterceptPktBinList(),2,entity,groupRelationList);
|
||||||
groupRelationList=map.get("groupList");
|
groupRelationList=map.get("groupList");
|
||||||
strRegionList=map.get("dstList");
|
strRegionList=map.get("dstList");
|
||||||
}
|
}
|
||||||
@@ -293,11 +301,41 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
maatCfg.setGroupNum(groupRelationList.size());
|
maatCfg.setGroupNum(groupRelationList.size());
|
||||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||||
maatCfg.setIsValid(entity.getIsValid());
|
maatCfg.setIsValid(entity.getIsValid());
|
||||||
// dns reject userRegion=;dnsStrategyId;
|
|
||||||
if(!StringUtil.isEmpty(entity.getDnsStrategyId())){
|
//监测需要发keyring_id
|
||||||
// maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT);
|
if(entity.getAction().equals(Constants.MONIT_ACTION)){
|
||||||
maatCfg.setUserRegion(Constants.DNS_STRATEGY_USER_REGION_KEY+"="+entity.getDnsStrategyId());
|
entity.setUserRegion1(StringUtil.isEmpty(entity.getUserRegion1()) ? "0":entity.getUserRegion1());
|
||||||
|
maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"="+entity.getUserRegion1());
|
||||||
}
|
}
|
||||||
|
//限速需要发Droprate=0.001 ,暂不支持Bandwidth=200kbps
|
||||||
|
if(entity.getAction().equals(Constants.RATELIMIT_ACTION)){
|
||||||
|
entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2());
|
||||||
|
|
||||||
|
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2());
|
||||||
|
}
|
||||||
|
String userRegion="";
|
||||||
|
//替换需要发zone
|
||||||
|
if(entity.getAction().equals(Constants.REPLACE_ACTION)){
|
||||||
|
//HTTP replace: replace type is not null ;find is not null;replace with is not null(userRegion is not null)
|
||||||
|
userRegion=Constants.REPLACE_ZONE_KEY+"="+entity.getUserRegion3();
|
||||||
|
String substitute="";
|
||||||
|
String userRegion4=StringUtil.isEmpty(entity.getUserRegion4()) ? "":entity.getUserRegion4();
|
||||||
|
substitute="/";
|
||||||
|
userRegion4 = BaseService.replaceContentEscape(userRegion4);
|
||||||
|
substitute=substitute+userRegion4;
|
||||||
|
|
||||||
|
String userRegion5=StringUtil.isEmpty(entity.getUserRegion5()) ? "":entity.getUserRegion5();
|
||||||
|
userRegion5 = BaseService.replaceContentEscape(userRegion5);
|
||||||
|
substitute=substitute+"/"+userRegion5;
|
||||||
|
|
||||||
|
userRegion=userRegion+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||||
|
maatCfg.setUserRegion(userRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtil.isEmpty(maatCfg.getUserRegion())){
|
||||||
|
maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER);
|
||||||
|
}
|
||||||
|
|
||||||
configCompileList.add(maatCfg);
|
configCompileList.add(maatCfg);
|
||||||
maatBean.setConfigCompileList(configCompileList);
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
maatBean.setAuditTime(entity.getAuditTime());
|
maatBean.setAuditTime(entity.getAuditTime());
|
||||||
@@ -306,10 +344,10 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
//调用服务接口下发配置数据
|
//调用服务接口下发配置数据
|
||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("dns配置下发配置参数:"+json);
|
logger.info("intercept IP 配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||||
logger.info("dns配置下发响应信息:"+result.getMsg());
|
logger.info("intercept IP 配置下发响应信息:"+result.getMsg());
|
||||||
|
|
||||||
}else if(isAudit==3){
|
}else if(isAudit==3){
|
||||||
maatCfg.setCompileId(entity.getCompileId());
|
maatCfg.setCompileId(entity.getCompileId());
|
||||||
@@ -323,10 +361,10 @@ public class InterceptCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
|||||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||||
//调用服务接口取消配置
|
//调用服务接口取消配置
|
||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("dns配置下发配置参数:"+json);
|
logger.info("intercept IP 配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||||
logger.info("dns配置取消配置响应信息:"+result.getMsg());
|
logger.info("intercept IP 配置取消配置响应信息:"+result.getMsg());
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -440,6 +440,10 @@ specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior
|
|||||||
specific_service_cfg_type_basic_protocol=basic_protocol
|
specific_service_cfg_type_basic_protocol=basic_protocol
|
||||||
#\u57fa\u7840\u534f\u8bae\u81ea\u5b9a\u4e49\u57df
|
#\u57fa\u7840\u534f\u8bae\u81ea\u5b9a\u4e49\u57df
|
||||||
proto_id_region=PROTO_ID
|
proto_id_region=PROTO_ID
|
||||||
|
#拦截IP自定义域key
|
||||||
|
keyring_id=keyring_id
|
||||||
|
droprate=Droprate
|
||||||
|
bandwidth=Bandwidth
|
||||||
#IP\u9ed8\u8ba4\u503c
|
#IP\u9ed8\u8ba4\u503c
|
||||||
ipv4_default_ip_value=\:\:
|
ipv4_default_ip_value=\:\:
|
||||||
ipv4_default_ip_subnet_value=0.0.0.0/32
|
ipv4_default_ip_subnet_value=0.0.0.0/32
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
<mapping path="/nis/basicprotocol/ajax*" exclue="true"/>
|
<mapping path="/nis/basicprotocol/ajax*" exclue="true"/>
|
||||||
<mapping path="/nis/encryptedtunnelbehav/ajax*" exclue="true"/>
|
<mapping path="/nis/encryptedtunnelbehav/ajax*" exclue="true"/>
|
||||||
<mapping path="/nis/ntc/av/ajax*" exclue="true"/>
|
<mapping path="/nis/ntc/av/ajax*" exclue="true"/>
|
||||||
|
<mapping path="/proxy/intercept/ajax*" exclue="true"/>
|
||||||
<!-- 对同一路径,启用多个装饰器 -->
|
<!-- 对同一路径,启用多个装饰器 -->
|
||||||
<mapping>
|
<mapping>
|
||||||
<path>/articles/*</path>
|
<path>/articles/*</path>
|
||||||
|
|||||||
@@ -197,7 +197,7 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="userRegion1"
|
<select name="userRegion1"
|
||||||
class="selectpicker show-tick form-control required">
|
class="selectpicker show-tick form-control required">
|
||||||
<c:forEach items="${fns:getDictList('REPLACE_ZONE')}" var="replaceZoneC">
|
<c:forEach items="${fns:getDictList('CONTROL_REPLACE_ZONE')}" var="replaceZoneC">
|
||||||
<option value="${replaceZoneC.itemCode}" <c:if test="${_cfg.userRegion1==replaceZoneC.itemCode || _cfg.userRegion1==null}">selected</c:if>><spring:message code="${replaceZoneC.itemValue}"/></option>
|
<option value="${replaceZoneC.itemCode}" <c:if test="${_cfg.userRegion1==replaceZoneC.itemCode || _cfg.userRegion1==null}">selected</c:if>><spring:message code="${replaceZoneC.itemValue}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -16,12 +16,6 @@
|
|||||||
$("#cancel").on("click", function() {
|
$("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});
|
||||||
setDefaultInfo();
|
|
||||||
$(".action").on("change", function() {
|
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
|
||||||
setDefaultInfo();
|
|
||||||
});
|
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate(
|
$("#cfgFrom").validate(
|
||||||
@@ -82,24 +76,25 @@
|
|||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
$("input[name$='exprType']").attr("disabled",false);
|
$("input[name$='exprType']").attr("disabled",false);
|
||||||
var action=$("input[name='action']").val();
|
var action=$("input[name='action']:checked").val();
|
||||||
if(action==1){ //监测
|
if(action==1){ //监测
|
||||||
$("input[name='userRegion2']").val("");
|
$("input[name='userRegion2']").val("");
|
||||||
$("select[name='userRegion3']").val();
|
$("select[name='userRegion3']").val("");
|
||||||
$("input[name='userRegion4']").val("");
|
$("input[name='userRegion4']").val("");
|
||||||
$("input[name='userRegion5']").val("");
|
$("input[name='userRegion5']").val("");
|
||||||
}else if(action==64){//限速
|
}else if(action==64){//限速
|
||||||
$("select[name='userRegion1']").val("");
|
$("select[name='userRegion1']").val("");
|
||||||
$("select[name='userRegion3']").val();
|
$("select[name='userRegion3']").val("");
|
||||||
$("input[name='userRegion4']").val("");
|
$("input[name='userRegion4']").val("");
|
||||||
$("input[name='userRegion5']").val("");
|
$("input[name='userRegion5']").val("");
|
||||||
}else if(action==80){//替换
|
}else if(action==80){//替换
|
||||||
$("input[name='userRegion1']").val("");
|
$("input[name='userRegion1']").val("");
|
||||||
$("input[name='userRegion2']").val("");
|
$("input[name='userRegion2']").val("");
|
||||||
}else {//白名单
|
|
||||||
$("select[name='userRegion1']").val();
|
|
||||||
$("input[name='userRegion2']").val("");
|
$("input[name='userRegion2']").val("");
|
||||||
$("select[name='userRegion3']").val();
|
}else {//白名单
|
||||||
|
$("select[name='userRegion1']").val("");
|
||||||
|
$("input[name='userRegion2']").val("");
|
||||||
|
$("select[name='userRegion3']").val("");
|
||||||
$("input[name='userRegion4']").val("");
|
$("input[name='userRegion4']").val("");
|
||||||
$("input[name='userRegion5']").val("");
|
$("input[name='userRegion5']").val("");
|
||||||
}
|
}
|
||||||
@@ -118,72 +113,7 @@
|
|||||||
}); */
|
}); */
|
||||||
|
|
||||||
});
|
});
|
||||||
var setDefaultInfo=function(){
|
|
||||||
var action=$("input[name='action']").val();
|
|
||||||
var serviceRegionType="";
|
|
||||||
var protocolNamePrefix="";
|
|
||||||
$("input[name$='configServiceType']").each(function(){
|
|
||||||
//替换动作非tcp
|
|
||||||
var serviceRegionTypeValue=$(this).val();
|
|
||||||
var serviceRegionTypeValue=$(this).attr("name");
|
|
||||||
if(serviceRegionTypeValue.indexOf(".") >-1){
|
|
||||||
serviceRegionTypeValue=serviceRegionTypeValue.substring(0,serviceRegionTypeValue.indexOf(".")+1);
|
|
||||||
}else{
|
|
||||||
serviceRegionTypeValue="";
|
|
||||||
}
|
|
||||||
if(serviceRegionType == 'intercept_ratelimit'){
|
|
||||||
serviceRegionType=serviceRegionTypeValue;
|
|
||||||
protocolNamePrefix=serviceRegionTypeValue;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(action==1){
|
|
||||||
//监测
|
|
||||||
$(".monitAction").removeClass("hidden");
|
|
||||||
$(".monitAction").find(".hidden").removeClass("hidden");
|
|
||||||
$(".monitAction").find("[disabled=disabled]").attr("disabled","");
|
|
||||||
$(".ratelimitAction").addClass("hidden");
|
|
||||||
$(".replaceAction").addClass("hidden");
|
|
||||||
if(serviceRegionType == 'intercept_ratelimit'){
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=1]").hide();
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=6]").show();
|
|
||||||
}
|
|
||||||
}else if(action==64){
|
|
||||||
//限速
|
|
||||||
$(".monitAction").addClass("hidden");
|
|
||||||
$(".ratelimitAction").removeClass("hidden");
|
|
||||||
$(".ratelimitAction").find(".hidden").removeClass("hidden");
|
|
||||||
$(".ratelimitAction").find("[disabled=disabled]").attr("disabled","");
|
|
||||||
$(".replaceAction").addClass("hidden");
|
|
||||||
if(serviceRegionType == 'intercept_ratelimit'){
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=1]").hide();
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=6]").show();
|
|
||||||
}
|
|
||||||
}else if(action==80){
|
|
||||||
//替换
|
|
||||||
$(".monitAction").addClass("hidden");
|
|
||||||
$(".ratelimitAction").addClass("hidden");
|
|
||||||
$(".replaceAction").removeClass("hidden");
|
|
||||||
$(".replaceAction").find(".hidden").removeClass("hidden");
|
|
||||||
$(".replaceAction").find("[disabled=disabled]").attr("disabled","");
|
|
||||||
if(serviceRegionType == 'intercept_ratelimit'){
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=1]").show();
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=6]").hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}else {
|
|
||||||
//白名单
|
|
||||||
$(".monitAction").hide();
|
|
||||||
$(".ratelimitAction").hide();
|
|
||||||
$(".replaceAction").hide();
|
|
||||||
if(serviceRegionType == 'intercept_ratelimit'){
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=1]").hide();
|
|
||||||
$("select[name="+protocolNamePrefix+"'protocol']").find("option[value=6]").show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//业务窗口打开
|
//业务窗口打开
|
||||||
var addContent = function(obj, contentClassName) {
|
var addContent = function(obj, contentClassName) {
|
||||||
@@ -229,7 +159,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="portlet-body form">
|
<div class="portlet-body form">
|
||||||
<!-- BEGIN FORM-->
|
<!-- BEGIN FORM-->
|
||||||
<form id="cfgFrom" action="${ctx}/ntc/website/saveDnsCfg"
|
<form id="cfgFrom" action="${ctx}/proxy/intercept/ip/saveOrUpdate"
|
||||||
method="post" class="form-horizontal">
|
method="post" class="form-horizontal">
|
||||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||||
@@ -278,9 +208,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- dolog begin-->
|
||||||
|
<div class="row doLog">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<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>
|
||||||
|
<!-- dolog end-->
|
||||||
<%-- action 为1 监测时 可以选择证书--%>
|
<%-- action 为1 监测时 可以选择证书--%>
|
||||||
<div class="row monitAction hidden">
|
<div class="row monitAction hidden">
|
||||||
<div class="col-md-6 policy">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><spring:message
|
<label class="control-label col-md-3"><spring:message
|
||||||
code="policy_name" /></label>
|
code="policy_name" /></label>
|
||||||
@@ -298,9 +252,9 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control required number" range="[0,100]" type="text" name="userRegion2">
|
<input class="form-control required number" range="[0,100]" type="text" name="userRegion2" value="${_cfg.userRegion2 }">
|
||||||
</div>
|
</div>
|
||||||
<div for="ratelimit"></div>
|
<div for="userRegion2"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -319,12 +273,13 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="userRegion3"
|
<select name="userRegion3"
|
||||||
class="selectpicker show-tick form-control required">
|
class="selectpicker show-tick form-control required">
|
||||||
<c:forEach items="${fns:getDictList('REPLACE_ZONE')}" var="replaceZoneC">
|
<option value="" ><spring:message code="selected"/></option>
|
||||||
|
<c:forEach items="${fns:getDictList('INTERCEPT_REPLACE_ZONE')}" var="replaceZoneC">
|
||||||
<option value="${replaceZoneC.itemCode}" <c:if test="${_cfg.userRegion3==replaceZoneC.itemCode || _cfg.userRegion3==null}">selected</c:if>><spring:message code="${replaceZoneC.itemValue}"/></option>
|
<option value="${replaceZoneC.itemCode}" <c:if test="${_cfg.userRegion3==replaceZoneC.itemCode || _cfg.userRegion3==null}">selected</c:if>><spring:message code="${replaceZoneC.itemValue}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div for="userRegion1"></div>
|
<div for="userRegion3"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -391,7 +346,7 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${region.regionType eq 2 }">
|
<c:if test="${region.regionType eq 2 }">
|
||||||
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
||||||
<h4 class="form-section">
|
<h4 class="form-section ${region.configServiceType }">
|
||||||
<spring:message code="${region.configRegionValue}" />
|
<spring:message code="${region.configRegionValue}" />
|
||||||
<small> <span
|
<small> <span
|
||||||
class="glyphicon glyphicon-plus ${tabName}Add"
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
@@ -402,10 +357,10 @@
|
|||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${fn:length(_cfg.interceptPktBinList)>0}">
|
<c:when test="${fn:length(_cfg.interceptPktBinList)>0}">
|
||||||
<c:set var="isBreak" value="false" ></c:set>
|
<c:set var="isBreak" value="false" ></c:set>
|
||||||
<c:forEach items="${_cfg.domainList}" var="cfg">
|
<c:forEach items="${_cfg.interceptPktBinList}" var="cfg">
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
|
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
|
||||||
<div class="row boxSolid ${tabName}${status.index}">
|
<div class="row boxSolid ${region.configServiceType }_div ${tabName}${status.index}">
|
||||||
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
<c:set var="isBreak" value="true" ></c:set>
|
<c:set var="isBreak" value="true" ></c:set>
|
||||||
@@ -414,14 +369,14 @@
|
|||||||
</c:choose>
|
</c:choose>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
<c:if test="${!isBreak}">
|
<c:if test="${!isBreak}">
|
||||||
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
<div class="row boxSolid ${region.configServiceType }_div ${tabName}${status.index} hidden disabled">
|
||||||
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
<div class="row boxSolid ${region.configServiceType }_div ${tabName}${status.index} hidden disabled">
|
||||||
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type:'post',
|
type:'post',
|
||||||
async:false,
|
async:false,
|
||||||
url:'${ctx}/ntc/website/ajaxDnsSubList',
|
url:'${ctx}/proxy/intercept/ajaxInterceptIpSubList',
|
||||||
data:{"cfgId":cfgId,"index":index},
|
data:{"cfgId":cfgId,"index":index},
|
||||||
dataType:"html",
|
dataType:"html",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<div class="row" >
|
<div class="row" >
|
||||||
<sys:message content="${message}"/>
|
<sys:message content="${message}"/>
|
||||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/intercept/interceptIpList?functionId=${cfg.functionId}" method="post" class="form-search">
|
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/intercept/ip/list?functionId=${cfg.functionId}" method="post" class="form-search">
|
||||||
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||||
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
@@ -150,8 +150,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<shiro:hasPermission name="intercept:ip:config">
|
<shiro:hasPermission name="intercept:ip:config">
|
||||||
<sys:delRow url="${ctx}/ntc/website/dnsForm" id="contentTable" label="update"></sys:delRow>
|
<sys:delRow url="${ctx}/proxy/intercept/interceptIpForm" id="contentTable" label="update"></sys:delRow>
|
||||||
<sys:delRow url="${ctx}/ntc/website/updateDnsCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
<sys:delRow url="${ctx}/proxy/intercept/updateInterceptIpValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
<shiro:hasPermission name="intercept:ip:confirm">
|
<shiro:hasPermission name="intercept:ip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -311,6 +311,7 @@
|
|||||||
<th><spring:message code="replaced_content"/></th>
|
<th><spring:message code="replaced_content"/></th>
|
||||||
<th><spring:message code="replace_content"/></th>
|
<th><spring:message code="replace_content"/></th>
|
||||||
<th><spring:message code="block_type"/></th>
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th><spring:message code="classification"/></th>
|
||||||
@@ -342,7 +343,7 @@
|
|||||||
${indexCfg.userRegion2 }
|
${indexCfg.userRegion2 }
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:forEach items="${fns:getDictList('REPLACE_ZONE')}" var="replaceZoneC">
|
<c:forEach items="${fns:getDictList('INTERCEPT_REPLACE_ZONE')}" var="replaceZoneC">
|
||||||
<c:if test="${indexCfg.userRegion3==replaceZoneC.itemCode}">
|
<c:if test="${indexCfg.userRegion3==replaceZoneC.itemCode}">
|
||||||
<spring:message code="${replaceZoneC.itemValue}"/>
|
<spring:message code="${replaceZoneC.itemValue}"/>
|
||||||
</c:if>
|
</c:if>
|
||||||
@@ -361,6 +362,13 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||||
<c:if test="${indexCfg.isAreaEffective==1}">
|
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||||
|
|||||||
@@ -120,17 +120,10 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${region[0] eq 3 }">
|
<c:if test="${region[0] eq 2 }">
|
||||||
<c:forEach items="${_cfg.domainList}" var="cfg">
|
<c:forEach items="${_cfg.interceptPktBinList}" var="cfg">
|
||||||
<c:if test="${region[1] eq cfg.cfgType }">
|
<c:if test="${region[1] eq cfg.cfgType }">
|
||||||
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
|
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="form-group">
|
|
||||||
<label><spring:message code='district' />:</label><label>${cfg.district }</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -197,6 +197,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- dolog begin-->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<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>
|
||||||
|
<!-- dolog end-->
|
||||||
<c:set var="ipCfgIndex" value="0"></c:set>
|
<c:set var="ipCfgIndex" value="0"></c:set>
|
||||||
<c:set var="complexCfgIndex" value="0"></c:set>
|
<c:set var="complexCfgIndex" value="0"></c:set>
|
||||||
<c:set var="digestCfgIndex" value="0"></c:set>
|
<c:set var="digestCfgIndex" value="0"></c:set>
|
||||||
|
|||||||
@@ -307,6 +307,7 @@
|
|||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
||||||
<th><spring:message code="block_type"/></th>
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th><spring:message code="classification"/></th>
|
||||||
@@ -338,6 +339,13 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||||
<c:if test="${indexCfg.isAreaEffective==1}">
|
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||||
|
|||||||
@@ -592,7 +592,7 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${action == 80}">
|
<c:if test="${action == 80}">
|
||||||
<td>
|
<td>
|
||||||
<c:forEach items="${fns:getDictList('REPLACE_ZONE') }" var="dict3">
|
<c:forEach items="${fns:getDictList('CONTROL_REPLACE_ZONE') }" var="dict3">
|
||||||
<c:if test="${dict3.itemCode eq indexCfg.userRegion1 }">
|
<c:if test="${dict3.itemCode eq indexCfg.userRegion1 }">
|
||||||
<spring:message code="${dict3.itemValue }"/>
|
<spring:message code="${dict3.itemValue }"/>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|||||||
@@ -190,6 +190,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<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="col-md-6 policy">
|
<div class="col-md-6 policy">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><spring:message
|
<label class="control-label col-md-3"><spring:message
|
||||||
|
|||||||
@@ -307,6 +307,7 @@
|
|||||||
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
||||||
<th><spring:message code="policy_name"/></th>
|
<th><spring:message code="policy_name"/></th>
|
||||||
<th><spring:message code="block_type"/></th>
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th><spring:message code="classification"/></th>
|
||||||
@@ -343,6 +344,13 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||||
<c:if test="${indexCfg.isAreaEffective==1}">
|
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||||
|
|||||||
@@ -258,6 +258,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- dolog begin-->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<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>
|
||||||
|
<!-- dolog end-->
|
||||||
<c:forEach items="${regionList}" var="region" varStatus="status">
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||||
<c:if test="${region.regionType eq 1 }">
|
<c:if test="${region.regionType eq 1 }">
|
||||||
<!--ip info-->
|
<!--ip info-->
|
||||||
|
|||||||
@@ -464,6 +464,7 @@
|
|||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
||||||
<th><spring:message code="block_type"/></th>
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th><spring:message code="classification"/></th>
|
||||||
@@ -495,6 +496,13 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||||
<c:if test="${indexCfg.isAreaEffective==1}">
|
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||||
|
|||||||
@@ -191,6 +191,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- dolog begin-->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<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>
|
||||||
|
<!-- dolog end-->
|
||||||
<c:set var="ipCfgIndex" value="0"></c:set>
|
<c:set var="ipCfgIndex" value="0"></c:set>
|
||||||
<c:set var="strCfgIndex" value="0"></c:set>
|
<c:set var="strCfgIndex" value="0"></c:set>
|
||||||
<c:forEach items="${regionList}" var="region" varStatus="status">
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||||
|
|||||||
@@ -306,6 +306,7 @@
|
|||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
||||||
<th><spring:message code="block_type"/></th>
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th><spring:message code="classification"/></th>
|
||||||
@@ -337,6 +338,13 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.doLog }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||||
<c:if test="${indexCfg.isAreaEffective==1}">
|
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||||
|
|||||||
@@ -63,12 +63,10 @@ $(function(){
|
|||||||
$("select[name$='portPattern']").on("change",function(){
|
$("select[name$='portPattern']").on("change",function(){
|
||||||
switchIpInfo(this);
|
switchIpInfo(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
switchAction($("input[name='action']:checked").val());
|
switchAction($("input[name='action']:checked").val());
|
||||||
//DNS REJECT 时选择dnsStrategyId
|
setInterceptDefaultInfo($("input[name='cfgId']").val());
|
||||||
$("input[name='action']").on('change',function(){
|
|
||||||
var action=$(this).val();
|
|
||||||
switchAction(action);
|
|
||||||
});
|
|
||||||
$(".glyphicon-plus").on("click",function(){
|
$(".glyphicon-plus").on("click",function(){
|
||||||
var obj=$(this).parents(".form-section").next(".container-fluid").clone();
|
var obj=$(this).parents(".form-section").next(".container-fluid").clone();
|
||||||
var len=$(this).parents("div").find(".container-fluid:visible").size();
|
var len=$(this).parents("div").find(".container-fluid:visible").size();
|
||||||
@@ -360,6 +358,23 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
|
//DNS REJECT 时选择dnsStrategyId
|
||||||
|
var action=$("input[name='action']:checked").val();
|
||||||
|
switchAction(action);
|
||||||
|
|
||||||
|
//拦截根据action切换动作部分
|
||||||
|
setInterceptDefaultInfo("");
|
||||||
|
|
||||||
|
//dolog 白名单默认不显示,不记录日志
|
||||||
|
if(action == 128 || action == 32){
|
||||||
|
$(".doLog").addClass("hidden");
|
||||||
|
$("input[name='doLog'][value=0]").prop("checked",true);
|
||||||
|
}else{
|
||||||
|
$(".doLog").removeClass("hidden");
|
||||||
|
$("input[name='doLog'][value=2]").prop("checked",true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
var actionCode=$(this).val();
|
var actionCode=$(this).val();
|
||||||
@@ -641,7 +656,83 @@ window.onload=function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var setInterceptDefaultInfo=function(cfgId){
|
||||||
|
var action=$("input[name='action']:checked").val();
|
||||||
|
var interceptRatelimitIp="";
|
||||||
|
var interceptReplacePktBin="";
|
||||||
|
var protocolNamePrefix="";
|
||||||
|
//查找当前业务中的serviceRegionType,是否存在intercept_ratelimit_ip
|
||||||
|
$("input[name$='configServiceType']").each(function(){
|
||||||
|
//替换动作非tcp
|
||||||
|
var serviceRegionTypeValue=$(this).val();
|
||||||
|
var serviceRegionTypeName=$(this).attr("name");
|
||||||
|
if(serviceRegionTypeName.indexOf(".") >-1){
|
||||||
|
serviceRegionTypeName=serviceRegionTypeName.substring(0,serviceRegionTypeName.indexOf(".")+1);
|
||||||
|
}else{
|
||||||
|
serviceRegionTypeName="";
|
||||||
|
}
|
||||||
|
if(serviceRegionTypeValue == 'intercept_ratelimit_ip'){
|
||||||
|
interceptRatelimitIp=serviceRegionTypeValue;
|
||||||
|
protocolNamePrefix=serviceRegionTypeName;
|
||||||
|
}
|
||||||
|
if(serviceRegionTypeValue == 'intercept_replace_pkt_bin'){
|
||||||
|
interceptReplacePktBin=serviceRegionTypeValue;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(action==1){
|
||||||
|
//监测
|
||||||
|
$(".monitAction").removeClass("hidden");
|
||||||
|
$(".ratelimitAction").addClass("hidden");
|
||||||
|
$(".replaceAction").addClass("hidden");
|
||||||
|
if(interceptRatelimitIp == 'intercept_ratelimit_ip'){
|
||||||
|
//TODO隐藏不可选IP 协议
|
||||||
|
}
|
||||||
|
if(interceptReplacePktBin == 'intercept_replace_pkt_bin'){
|
||||||
|
$("."+interceptReplacePktBin).addClass("hidden");
|
||||||
|
$("."+interceptReplacePktBin+"_div").addClass("hidden");
|
||||||
|
}
|
||||||
|
}else if(action==64){
|
||||||
|
//限速
|
||||||
|
$(".monitAction").addClass("hidden");
|
||||||
|
$(".ratelimitAction").removeClass("hidden");
|
||||||
|
$(".replaceAction").addClass("hidden");
|
||||||
|
if(interceptRatelimitIp == 'intercept_ratelimit_ip'){
|
||||||
|
//TODO隐藏不可选IP 协议
|
||||||
|
}
|
||||||
|
if(interceptReplacePktBin == 'intercept_replace_pkt_bin'){
|
||||||
|
$("."+interceptReplacePktBin).addClass("hidden");
|
||||||
|
$("."+interceptReplacePktBin+"_div").addClass("hidden");
|
||||||
|
}
|
||||||
|
}else if(action==80){
|
||||||
|
//替换
|
||||||
|
$(".monitAction").addClass("hidden");
|
||||||
|
$(".ratelimitAction").addClass("hidden");
|
||||||
|
$(".replaceAction").removeClass("hidden");
|
||||||
|
if(interceptRatelimitIp == 'intercept_ratelimit_ip'){
|
||||||
|
//TODO隐藏不可选IP 协议
|
||||||
|
}
|
||||||
|
if(interceptReplacePktBin == 'intercept_replace_pkt_bin' && cfgId == ""){
|
||||||
|
$("."+interceptReplacePktBin).removeClass("hidden");
|
||||||
|
$("."+interceptReplacePktBin).find("span").removeClass("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
//白名单
|
||||||
|
$(".monitAction").addClass("hidden");
|
||||||
|
$(".ratelimitAction").addClass("hidden");
|
||||||
|
$(".replaceAction").addClass("hidden");
|
||||||
|
if(interceptRatelimitIp == 'intercept_ratelimit'){
|
||||||
|
//TODO隐藏不可选IP 协议
|
||||||
|
}
|
||||||
|
if(interceptReplacePktBin == 'intercept_replace_pkt_bin'){
|
||||||
|
$("."+interceptReplacePktBin).addClass("hidden");
|
||||||
|
$("."+interceptReplacePktBin+"_div").addClass("hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//0 非十六进制 大小不敏感 1 十六进制,大小写不敏感 2非十六进制 大小写敏感
|
//0 非十六进制 大小不敏感 1 十六进制,大小写不敏感 2非十六进制 大小写敏感
|
||||||
var setIsHexBin=function(obj){
|
var setIsHexBin=function(obj){
|
||||||
var profix="";
|
var profix="";
|
||||||
|
|||||||
Reference in New Issue
Block a user