HTTP重定向业务增加自定义域信息

This commit is contained in:
zhangwei
2018-07-05 11:34:43 +08:00
parent 20e3c6a569
commit b2e04c317a
9 changed files with 201 additions and 48 deletions

View File

@@ -31,6 +31,11 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
protected String showName;//表在界面上展示的名称 protected String showName;//表在界面上展示的名称
protected String seltype;//选中类型,页面搜索用 protected String seltype;//选中类型,页面搜索用
protected String tableName; protected String tableName;
protected String userRegion1;
protected String userRegion2;
protected String userRegion3;
protected String userRegion4;
protected String userRegion5;
/** /**
* 编译id * 编译id
*/ */
@@ -786,4 +791,35 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
public void setAreaType(Integer areaType) { public void setAreaType(Integer areaType) {
this.areaType = areaType; this.areaType = areaType;
} }
public String getUserRegion1() {
return userRegion1;
}
public void setUserRegion1(String userRegion1) {
this.userRegion1 = userRegion1;
}
public String getUserRegion2() {
return userRegion2;
}
public void setUserRegion2(String userRegion2) {
this.userRegion2 = userRegion2;
}
public String getUserRegion3() {
return userRegion3;
}
public void setUserRegion3(String userRegion3) {
this.userRegion3 = userRegion3;
}
public String getUserRegion4() {
return userRegion4;
}
public void setUserRegion4(String userRegion4) {
this.userRegion4 = userRegion4;
}
public String getUserRegion5() {
return userRegion5;
}
public void setUserRegion5(String userRegion5) {
this.userRegion5 = userRegion5;
}
} }

View File

@@ -404,4 +404,8 @@ public final class Constants {
public static final String HTTP_REDIRECT_RES_HEAD_REGION = Configurations.getStringProperty("http_redirect_res_hdr_region","PXY_CTRL_HTTP_RES_HDR"); public static final String HTTP_REDIRECT_RES_HEAD_REGION = Configurations.getStringProperty("http_redirect_res_hdr_region","PXY_CTRL_HTTP_RES_HDR");
public static final String HTTP_REDIRECT_REQ_BODY_REGION = Configurations.getStringProperty("http_redirect_req_body_region","PXY_CTRL_HTTP_REQ_BODY"); public static final String HTTP_REDIRECT_REQ_BODY_REGION = Configurations.getStringProperty("http_redirect_req_body_region","PXY_CTRL_HTTP_REQ_BODY");
public static final String HTTP_REDIRECT_RES_BODY_REGION = Configurations.getStringProperty("http_redirect_res_body_region","PXY_CTRL_HTTP_RES_BODY"); public static final String HTTP_REDIRECT_RES_BODY_REGION = Configurations.getStringProperty("http_redirect_res_body_region","PXY_CTRL_HTTP_RES_BODY");
public static final String REDIRECT_RESPONSE_CODE_KEY = Configurations.getStringProperty("redirect_response_code_key","code");
public static final String REDIRECT_URL_KEY = Configurations.getStringProperty("redirect_url_key","url");
public static final String REDIRECT_CONTENT_KEY = Configurations.getStringProperty("redirect_content_key","content");
public static final String REDIRECT_RESPONSE_CODE_STARTWITH = Configurations.getStringProperty("redirect_response_code_startwith","30");
} }

View File

@@ -25,6 +25,11 @@
<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="user_region1" property="userRegion1" jdbcType="VARCHAR" />
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" > <resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -123,7 +128,8 @@
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT, a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME, a.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.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
</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
@@ -392,7 +398,12 @@
LABLE, LABLE,
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id, function_id,
dns_strategy_id dns_strategy_id,
user_region1,
user_region2,
user_region3,
user_region4,
user_region5
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -413,7 +424,12 @@
#{lable,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{dnsStrategyId,jdbcType=INTEGER} #{dnsStrategyId,jdbcType=INTEGER},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
) )
</insert> </insert>
<!-- insert ip_port_cfg表信息 --> <!-- insert ip_port_cfg表信息 -->
@@ -518,7 +534,12 @@
cfg_region_code, cfg_region_code,
expr_type, expr_type,
match_method, match_method,
is_hexbin is_hexbin,
user_region1,
user_region2,
user_region3,
user_region4,
user_region5
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -545,7 +566,12 @@
#{cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER} #{isHexbin,jdbcType=INTEGER},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
) )
</insert> </insert>
@@ -580,7 +606,12 @@
cfg_region_code, cfg_region_code,
expr_type, expr_type,
match_method, match_method,
is_hexbin is_hexbin,
user_region1,
user_region2,
user_region3,
user_region4,
user_region5
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -607,7 +638,12 @@
#{cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER} #{isHexbin,jdbcType=INTEGER},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
) )
</insert> </insert>
@@ -641,7 +677,12 @@
cfg_region_code, cfg_region_code,
expr_type, expr_type,
match_method, match_method,
is_hexbin is_hexbin,
user_region1,
user_region2,
user_region3,
user_region4,
user_region5
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -667,7 +708,12 @@
#{cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER} #{isHexbin,jdbcType=INTEGER},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
) )
</insert> </insert>
<!-- insert http_url_cfg表信息 --> <!-- insert http_url_cfg表信息 -->
@@ -700,7 +746,12 @@
cfg_region_code, cfg_region_code,
expr_type, expr_type,
match_method, match_method,
is_hexbin is_hexbin,
user_region1,
user_region2,
user_region3,
user_region4,
user_region5
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -726,7 +777,12 @@
#{cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER} #{isHexbin,jdbcType=INTEGER},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
) )
</insert> </insert>
<update id="updateCfgIndex" parameterType="com.nis.domain.configuration.CfgIndexInfo" > <update id="updateCfgIndex" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
@@ -778,6 +834,21 @@
</if> </if>
<if test="functionId != null" > <if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER}, function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="userRegion1 != null and userRegion1 != ''" >
user_region1 = #{userRegion1,jdbcType=VARCHAR},
</if>
<if test="userRegion2 != null and userRegion2 != ''" >
user_region2 = #{userRegion2,jdbcType=VARCHAR},
</if>
<if test="userRegion3 != null and userRegion3 != ''" >
user_region3 = #{userRegion3,jdbcType=VARCHAR},
</if>
<if test="userRegion4 != null and userRegion4 != ''" >
user_region4 = #{userRegion4,jdbcType=VARCHAR},
</if>
<if test="userRegion5 != null and userRegion5 != ''" >
user_region5 = #{userRegion5,jdbcType=VARCHAR},
</if> </if>
dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER}, dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER},
</trim> </trim>

View File

@@ -366,40 +366,19 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
maatCfg.setIsValid(entity.getIsValid()); maatCfg.setIsValid(entity.getIsValid());
//判断http配置是否需要设置自定义域参数 //判断http配置是否需要设置自定义域参数
String actionValue = DictUtils.getDictCode("SERVICE_ACTION", "action_monit");
String userRegion = ""; String userRegion = "";
//只有监测业务,并且头域的匹配区域不匹配字典中的信息时需要设置 if(!StringUtil.isEmpty(entity.getUserRegion1())){
if(!actionValue.equals("默认") && entity.getAction().equals(Integer.parseInt(actionValue))){ if(entity.getUserRegion1().startsWith(Constants.REDIRECT_RESPONSE_CODE_STARTWITH)){
//请求头域 userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+entity.getUserRegion1()+
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){ Constants.USER_REGION_SPLIT+
for(ComplexkeywordCfg head:entity.getHttpReqHdrList()){ Constants.REDIRECT_URL_KEY+"="+entity.getUserRegion2();
String dictValue = DictUtils.getDictCode("REQUEST_HEADER_DISTRICT", head.getDistrict()); }else{
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){ userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+entity.getUserRegion1()+
if(userRegion.equals("")){ Constants.USER_REGION_SPLIT+
userRegion += "HTTP_HEADER="+head.getDistrict(); Constants.REDIRECT_CONTENT_KEY+"="+entity.getUserRegion2();
}else{
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
}
}
}
} }
//应答头域
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpResHdrList()){
String dictValue = DictUtils.getDictCode("RESPONSE_HEADER_DISTRICT", head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
}
}
}
}
maatCfg.setUserRegion(userRegion);
} }
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg); configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList); maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime()); maatBean.setAuditTime(entity.getAuditTime());

View File

@@ -816,4 +816,11 @@ id_not_valid=id\u4E3A%s\u7684%s\u65E0\u6548
num_split_by_comma=%s\u4E3A\u9017\u53F7\u5206\u9694\u7684\u6570\u5B57 num_split_by_comma=%s\u4E3A\u9017\u53F7\u5206\u9694\u7684\u6570\u5B57
no_data=\u65E0\u76F8\u5173\u6570\u636E no_data=\u65E0\u76F8\u5173\u6570\u636E
must_be=%s\u7684\u503C\u5FC5\u987B\u4E3A%s must_be=%s\u7684\u503C\u5FC5\u987B\u4E3A%s
REDIRECT_RESPONSE_CODE=\u91CD\u5B9A\u5411\u5E94\u7B54\u7801
permanet_redirect=\u6C38\u4E45\u91CD\u5B9A\u5411
temporary_redirect=\u4E34\u65F6\u91CD\u5B9A\u5411
prohibition_access=\u7981\u6B62\u8BBF\u95EE
not_allowed_method=\u4E0D\u5141\u8BB8\u6B64\u65B9\u6CD5\u8BBF\u95EE
law_prohibition_access=\u7531\u4E8E\u6CD5\u5F8B\u539F\u56E0\u4E0D\u53EF\u7528
redirect_content=\u91CD\u5B9A\u5411\u5185\u5BB9
#=============region_value,config form title================= #=============region_value,config form title=================

View File

@@ -304,8 +304,13 @@ userregion_replace_res_key_value=http_res_body
userregion_replace_regex_key=regex userregion_replace_regex_key=regex
#IP相关验证正则 #IP相关验证正则
ipv4_ip_subnet_regexp=^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}/(3[0-2]|[1-2][0-9]|[0-9])$ ipv4_ip_subnet_regexp=^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}/(3[0-2]|[1-2][0-9]|[0-9])$
ipv6_ip_subnet_regexp=^\\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)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0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*$
#重定向业务自定义域相关参数
redirect_response_code_key=code
redirect_url_key=url
redirect_content_key=content
redirect_response_code_startwith=30

View File

@@ -109,6 +109,7 @@
<sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/form" id="contentTable" label="update"></sys:delRow> <sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/form" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow> <sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission> </shiro:hasPermission>
<shiro:hasPermission name="ip:mulitiplex:pool:audit">
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message> <i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
@@ -120,6 +121,7 @@
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/audit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li> <li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/audit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul> </ul>
</div> </div>
</shiro:hasPermission>
<a class="btn btn-icon-only btn-default setfields tooltips" <a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;"> data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i> <i class="icon-wrench"></i>

View File

@@ -55,6 +55,15 @@
} }
}); });
$("select[name='userRegion1']").on("change",function(){
var code = $(this).val();
if(code.indexOf("30")==0){//以30开头的应答码需要输入URL地址
$("input[name='userRegion2']").addClass("url");
}else{
$("input[name='userRegion2']").removeClass("url");
}
});
$("#cfgFrom").validate( $("#cfgFrom").validate(
{ {
errorPlacement : function(error, element) { errorPlacement : function(error, element) {
@@ -68,8 +77,8 @@
} }
}, },
submitHandler : function(form) { submitHandler : function(form) {
loading('onloading...');
var flag = true; var flag = true;
//代表所有业务都隐藏了,提示必须增加一种业务数据 //代表所有业务都隐藏了,提示必须增加一种业务数据
if(!$(".httpReqCfg").hasClass("hidden")){ if(!$(".httpReqCfg").hasClass("hidden")){
if($(".httpReqCfg").find(".boxSolid").length==$(".httpReqCfg").find(".boxSolid.hidden").length){ if($(".httpReqCfg").find(".boxSolid").length==$(".httpReqCfg").find(".boxSolid.hidden").length){
@@ -99,13 +108,15 @@
flag = false; flag = false;
return; return;
} }
}) });
if(flag){ if(flag){
//将disable属性的元素删除 //将disable属性的元素删除
$(".disabled").each(function(){ $(".disabled").each(function(){
$(this).remove(); $(this).remove();
}); });
$("input[name$='exprType']").attr("disabled",false); $("input[name$='exprType']").attr("disabled",false);
loading('onloading...');
form.submit(); form.submit();
} }
@@ -201,7 +212,7 @@
<label class="control-label col-md-3"><spring:message <label class="control-label col-md-3"><spring:message
code="config_describe" /></label> code="config_describe" /></label>
<div class="col-md-6"> <div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc" multiple <input class="form-control" type="text" name="cfgDesc"
value="${_cfg.cfgDesc}"> value="${_cfg.cfgDesc}">
</div> </div>
</div> </div>
@@ -233,6 +244,34 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="REDIRECT_RESPONSE_CODE" /></label>
<div class="col-md-6">
<select name="userRegion1"
class="selectpicker select2 form-control required">
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE')}" var="responseCode">
<option value="${responseCode.itemValue}" <c:if test="${_cfg.userRegion1==responseCode.itemValue}">selected</c:if>><spring:message code="${responseCode.itemCode}"/></option>
</c:forEach>
</select>
</div>
<div for="userRegion1"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="redirect_content" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="userRegion2"
value="${_cfg.userRegion2}">
</div>
<div for="userRegion2"></div>
</div>
</div>
</div>
<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-->

View File

@@ -464,6 +464,8 @@
<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="REDIRECT_RESPONSE_CODE"/></th>
<th><spring:message code="redirect_content"/></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="type"/></th> <th><spring:message code="type"/></th>
@@ -495,6 +497,14 @@
</c:if> </c:if>
</c:forEach> </c:forEach>
</td> </td>
<td>
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE') }" var="dict">
<c:if test="${dict.itemValue eq indexCfg.userRegion1 }">
<spring:message code="${dict.itemCode }"/>
</c:if>
</c:forEach>
</td>
<td>${indexCfg.userRegion2 }</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}">