控制策略修改userregion默认值为0
DNS响应策略:所属组:不能为空 IP欺骗:所属组:可以选择缺省组 ip复用地址池:所属组:非空不能选0组 Dns:策略,默认选择无策略 修改HTTP管控,当没有选择时,响应内容可空
This commit is contained in:
@@ -52,10 +52,10 @@
|
|||||||
<include refid="columns"></include>
|
<include refid="columns"></include>
|
||||||
<trim prefix="," prefixOverrides=",">
|
<trim prefix="," prefixOverrides=",">
|
||||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||||
,ri.request_title as requestName,dns.cfg_Desc as dns_strategy_name
|
,ri.request_title as requestName,dns.group_name as dns_strategy_name
|
||||||
</trim>
|
</trim>
|
||||||
from dns_ip_cfg r
|
from dns_ip_cfg r
|
||||||
left join dns_res_strategy dns on dns.cfg_Id=r.dns_strategy_id
|
left join policy_group_info dns on dns.group_id=r.dns_strategy_id
|
||||||
left join sys_user s on r.creator_id=s.id
|
left join sys_user s on r.creator_id=s.id
|
||||||
left join sys_user e on r.editor_id=e.id
|
left join sys_user e on r.editor_id=e.id
|
||||||
left join sys_user u on r.auditor_id=u.id
|
left join sys_user u on r.auditor_id=u.id
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dnsStrategyName != null and dnsStrategyName != ''">
|
<if test="dnsStrategyName != null and dnsStrategyName != ''">
|
||||||
AND dns.cfg_desc like concat(concat('%',#{dnsStrategyName,jdbcType=VARCHAR}),'%')
|
AND dns.group_name like concat(concat('%',#{dnsStrategyName,jdbcType=VARCHAR}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="cfgRegionCode != null">
|
<if test="cfgRegionCode != null">
|
||||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||||
|
|||||||
@@ -419,13 +419,14 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
|||||||
if(entity.getAction().equals(16)){
|
if(entity.getAction().equals(16)){
|
||||||
if(!StringUtil.isEmpty(entity.getUserRegion1())){
|
if(!StringUtil.isEmpty(entity.getUserRegion1())){
|
||||||
userRegion=Constants.REDIRECT_RESPONSE_CODE_KEY+"="+entity.getUserRegion1();
|
userRegion=Constants.REDIRECT_RESPONSE_CODE_KEY+"="+entity.getUserRegion1();
|
||||||
}
|
|
||||||
if(!StringUtil.isEmpty(entity.getUserRegion2())){
|
if(!StringUtil.isEmpty(entity.getUserRegion2())){
|
||||||
userRegion=userRegion+";"+Constants.REDIRECT_CONTENT_KEY+"="+entity.getUserRegion2();
|
userRegion=userRegion+";"+Constants.REDIRECT_CONTENT_KEY+"="+entity.getUserRegion2();
|
||||||
}else{
|
}else{
|
||||||
userRegion="";
|
userRegion="";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//HTTP redirect
|
//HTTP redirect
|
||||||
if(entity.getAction().equals(48)){
|
if(entity.getAction().equals(48)){
|
||||||
if(!StringUtil.isEmpty(entity.getUserRegion1())){
|
if(!StringUtil.isEmpty(entity.getUserRegion1())){
|
||||||
@@ -460,7 +461,9 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
|||||||
userRegion=userRegion+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
userRegion=userRegion+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(StringUtil.isEmpty(userRegion)){
|
||||||
|
userRegion=Constants.USER_REGION_PLACEHOLDER;
|
||||||
|
}
|
||||||
maatCfg.setUserRegion(userRegion);
|
maatCfg.setUserRegion(userRegion);
|
||||||
configCompileList.add(maatCfg);
|
configCompileList.add(maatCfg);
|
||||||
maatBean.setConfigCompileList(configCompileList);
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
|
|||||||
@@ -770,6 +770,8 @@ replace_content=Replace Content
|
|||||||
all_types=All Type
|
all_types=All Type
|
||||||
group_type=Group Type
|
group_type=Group Type
|
||||||
group_name=Group Name
|
group_name=Group Name
|
||||||
|
default_group=Default Group
|
||||||
|
group=Group
|
||||||
policy_group_manage=Policy Group Management
|
policy_group_manage=Policy Group Management
|
||||||
#===========policy_group_manage end =============
|
#===========policy_group_manage end =============
|
||||||
#=============about manipulation=========
|
#=============about manipulation=========
|
||||||
@@ -781,6 +783,7 @@ domain_ratelimit=Domain Ratelimit
|
|||||||
ratelimit=Limit Rate
|
ratelimit=Limit Rate
|
||||||
ir_type=Reuse type
|
ir_type=Reuse type
|
||||||
dns_strategy_id=DNS Policy ID
|
dns_strategy_id=DNS Policy ID
|
||||||
|
no_strategy=No Strategy
|
||||||
#=============about manipulation=========
|
#=============about manipulation=========
|
||||||
#=============about app config===========
|
#=============about app config===========
|
||||||
domain=Domain
|
domain=Domain
|
||||||
|
|||||||
@@ -772,6 +772,8 @@ replace_content=\u66FF\u6362\u5185\u5BB9
|
|||||||
all_types=\u6240\u6709\u7C7B\u578B
|
all_types=\u6240\u6709\u7C7B\u578B
|
||||||
group_type=\u5206\u7EC4\u7C7B\u578B
|
group_type=\u5206\u7EC4\u7C7B\u578B
|
||||||
group_name=\u5206\u7EC4\u540D\u79F0
|
group_name=\u5206\u7EC4\u540D\u79F0
|
||||||
|
default_group=\u7F3A\u7701\u7EC4
|
||||||
|
group=\u6240\u5C5E\u7EC4
|
||||||
policy_group_manage=\u7B56\u7565\u5206\u7EC4\u7BA1\u7406
|
policy_group_manage=\u7B56\u7565\u5206\u7EC4\u7BA1\u7406
|
||||||
#===========policy_group_manage end =============
|
#===========policy_group_manage end =============
|
||||||
#=============about manipulation=========
|
#=============about manipulation=========
|
||||||
@@ -783,6 +785,7 @@ domain_ratelimit=\u57DF\u540D\u9650\u6D41
|
|||||||
ratelimit=\u9650\u901F\u6BD4\u4F8B
|
ratelimit=\u9650\u901F\u6BD4\u4F8B
|
||||||
ir_type=\u590D\u7528\u7C7B\u578B
|
ir_type=\u590D\u7528\u7C7B\u578B
|
||||||
dns_strategy_id=dns\u7B56\u7565id
|
dns_strategy_id=dns\u7B56\u7565id
|
||||||
|
no_strategy=\u65E0\u7B56\u7565
|
||||||
#=============about manipulation=========
|
#=============about manipulation=========
|
||||||
#=============about app config===========
|
#=============about app config===========
|
||||||
domain=\u57DF\u540D
|
domain=\u57DF\u540D
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
--update policy_group_info auto_increament start with 101
|
||||||
|
alter table policy_group_info auto_increment=101;
|
||||||
@@ -16,14 +16,15 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3">
|
||||||
<spring:message code="response_code" />
|
<spring:message code="response_code" />
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="userRegion1"
|
<select name="userRegion1"
|
||||||
class="selectpicker show-tick form-control">
|
class="selectpicker show-tick form-control">
|
||||||
|
<option value="" <c:if test="${empty _cfg.userRegion1}">selected</c:if>><spring:message code="select"/></option>
|
||||||
<c:forEach items="${fns:getDictList('RESPONSE_CODE')}" var="responseCodeC">
|
<c:forEach items="${fns:getDictList('RESPONSE_CODE')}" var="responseCodeC">
|
||||||
<option value="${responseCodeC.itemCode}" <c:if test="${_cfg.userRegion1==responseCodeC.itemCode || (_cfg.userRegion1==null && redirectResponseCodeC.itemCode==1)}">selected</c:if>><spring:message code="${responseCodeC.itemValue}"/></option>
|
<option value="${responseCodeC.itemCode}" <c:if test="${_cfg.userRegion1 eq responseCodeC.itemCode}">selected</c:if>><spring:message code="${responseCodeC.itemValue}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,10 +33,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3">
|
||||||
|
<font color="red" class="userRegion2">*</font>
|
||||||
<spring:message code="response_content" /></label>
|
<spring:message code="response_content" /></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control" type="text"
|
<input class="form-control required" type="text"
|
||||||
name="userRegion2"
|
name="userRegion2"
|
||||||
value="${_cfg.userRegion2 }">
|
value="${_cfg.userRegion2 }">
|
||||||
</div>
|
</div>
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="userRegion1"
|
<select name="userRegion1"
|
||||||
class="selectpicker show-tick form-control">
|
class="selectpicker show-tick form-control required">
|
||||||
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE')}" var="redirectResponseCodeC">
|
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE')}" var="redirectResponseCodeC">
|
||||||
<option value="${redirectResponseCodeC.itemCode}" <c:if test="${_cfg.userRegion1==redirectResponseCodeC.itemCode || (_cfg.userRegion1==null && redirectResponseCodeC.itemCode==1)}">selected</c:if>><spring:message code="${redirectResponseCodeC.itemValue}"/></option>
|
<option value="${redirectResponseCodeC.itemCode}" <c:if test="${_cfg.userRegion1==redirectResponseCodeC.itemCode || (_cfg.userRegion1==null && redirectResponseCodeC.itemCode==1)}">selected</c:if>><spring:message code="${redirectResponseCodeC.itemValue}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
@@ -71,7 +73,7 @@
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
<spring:message code="redirect_url" /></label>
|
<spring:message code="redirect_url" /></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control url" type="text"
|
<input class="form-control url required" type="text"
|
||||||
name="userRegion2"
|
name="userRegion2"
|
||||||
value="${_cfg.userRegion2 }">
|
value="${_cfg.userRegion2 }">
|
||||||
</div>
|
</div>
|
||||||
@@ -93,7 +95,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="userRegion1"
|
<select name="userRegion1"
|
||||||
class="selectpicker show-tick form-control">
|
class="selectpicker show-tick form-control required">
|
||||||
<c:forEach items="${fns:getDictList('REPLACE_ZONE')}" var="replaceZoneC">
|
<c:forEach items="${fns:getDictList('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>
|
||||||
@@ -109,7 +111,7 @@
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
<spring:message code="replaced_content" /></label>
|
<spring:message code="replaced_content" /></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control" type="text"
|
<input class="form-control required" type="text"
|
||||||
name="userRegion2"
|
name="userRegion2"
|
||||||
value="${_cfg.userRegion2 }">
|
value="${_cfg.userRegion2 }">
|
||||||
</div>
|
</div>
|
||||||
@@ -121,7 +123,7 @@
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
<spring:message code="replace_content" /></label>
|
<spring:message code="replace_content" /></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control" type="text"
|
<input class="form-control required" type="text"
|
||||||
name="userRegion3"
|
name="userRegion3"
|
||||||
value="${_cfg.userRegion3 }">
|
value="${_cfg.userRegion3 }">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ $(function(){
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_name"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="resGroup1Id" class="selectpicker show-tick form-control required">
|
<select name="resGroup1Id" class="selectpicker show-tick form-control required">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||||
<form:option value="cfgDesc"><spring:message code="policy_name"></spring:message></form:option>
|
<form:option value="cfgDesc"><spring:message code="policy_name"></spring:message></form:option>
|
||||||
<form:option value="group1Name"><spring:message code="group_name"></spring:message></form:option>
|
<form:option value="group1Name"><spring:message code="group"></spring:message></form:option>
|
||||||
</form:select>
|
</form:select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
<%-- <th><spring:message code="seq"/></th> --%>
|
<%-- <th><spring:message code="seq"/></th> --%>
|
||||||
<th><spring:message code="policy_number"/></th>
|
<th><spring:message code="policy_number"/></th>
|
||||||
<th><spring:message code="policy_name"/></th>
|
<th><spring:message code="policy_name"/></th>
|
||||||
<th><spring:message code="group_name"/></th>
|
<th><spring:message code="group"/></th>
|
||||||
<th><spring:message code="res_group_num"/></th>
|
<th><spring:message code="res_group_num"/></th>
|
||||||
<th><spring:message code="min_ttl"/></th>
|
<th><spring:message code="min_ttl"/></th>
|
||||||
<th><spring:message code="max_ttl"/></th>
|
<th><spring:message code="max_ttl"/></th>
|
||||||
|
|||||||
@@ -76,16 +76,18 @@ $(function(){
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><spring:message code="group_name"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="policyGroup" class="selectpicker show-tick form-control">
|
<select name="policyGroup" class="selectpicker show-tick form-control required">
|
||||||
<option value="0"><spring:message code="select"/></option>
|
<option value="" <c:if test="${empty _cfg.policyGroup }">selected</c:if>><spring:message code="select"/></option>
|
||||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||||
<option value="${policyGroup.groupId}" <c:if test="${_cfg.policyGroup==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
<option value="${policyGroup.groupId}" <c:if test="${_cfg.policyGroup==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div for="policyGroup"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 hidden">
|
<div class="col-md-6 hidden">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -13,6 +13,13 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
|
var action=$(".action").val();
|
||||||
|
if(action == 16){
|
||||||
|
userRegionSwitch($("select[name=userRegion1]").val());
|
||||||
|
$("select[name=userRegion1]").on("change", function() {
|
||||||
|
userRegionSwitch($(this).val());
|
||||||
|
});
|
||||||
|
}
|
||||||
$("#cancel").on("click", function() {
|
$("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});
|
||||||
@@ -95,6 +102,17 @@
|
|||||||
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
||||||
$("." + addBtnClassName).removeClass("hidden");
|
$("." + addBtnClassName).removeClass("hidden");
|
||||||
}
|
}
|
||||||
|
function userRegionSwitch(userRegion1){
|
||||||
|
if(userRegion1 == null || userRegion1 == ''){
|
||||||
|
$("input[name=userRegion2]").removeClass("required");
|
||||||
|
$("font[class=userRegion2]").addClass("hidden");
|
||||||
|
$("div[for=userRegion2]").addClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(".userRegion2").removeClass("hidden");
|
||||||
|
$("input[name=userRegion2]").addClass("required");
|
||||||
|
$("div[for=userRegion2]").removeClass("hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
code="policy_name" /></label>
|
code="policy_name" /></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="dnsStrategyId" class="selectpicker show-tick form-control">
|
<select name="dnsStrategyId" class="selectpicker show-tick form-control">
|
||||||
<option value="0" ><spring:message code="select"/></option>
|
<option value="0" ><spring:message code="no_strategy"/></option>
|
||||||
<c:forEach items="${dnsResStrategys }" var="dnsStrategy">
|
<c:forEach items="${dnsResStrategys }" var="dnsStrategy">
|
||||||
<option value="${dnsStrategy.cfgId}" <c:if test="${_cfg.dnsStrategyId==dnsStrategy.cfgId }">selected</c:if>><spring:message code="${dnsStrategy.cfgDesc}"/></option>
|
<option value="${dnsStrategy.cfgId}" <c:if test="${_cfg.dnsStrategyId==dnsStrategy.cfgId }">selected</c:if>><spring:message code="${dnsStrategy.cfgDesc}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -331,7 +331,11 @@
|
|||||||
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
|
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
|
||||||
</td>
|
</td>
|
||||||
<td>${indexCfg.cfgDesc }</td>
|
<td>${indexCfg.cfgDesc }</td>
|
||||||
<td>${indexCfg.dnsStrategyName }</td>
|
<td>${indexCfg.dnsStrategyName }
|
||||||
|
<c:if test="${empty indexCfg.dnsStrategyName && indexCfg.action==16}">
|
||||||
|
<spring:message code="no_strategy"/>
|
||||||
|
</c:if>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
<c:if test="${dict.itemCode eq indexCfg.action }">
|
<c:if test="${dict.itemCode eq indexCfg.action }">
|
||||||
|
|||||||
Reference in New Issue
Block a user