PXY管控添加重定向功能

This commit is contained in:
wangxin
2018-07-06 14:47:55 +08:00
parent ac38c85b6b
commit 807b82e8c9
8 changed files with 231 additions and 10 deletions

View File

@@ -36,6 +36,17 @@ $(function(){
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
}
if($("select[name='userRegion1']")){
$("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");
}
});
}
$("#ipCfgFrom").validate({
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
@@ -194,6 +205,36 @@ $(function(){
</div>
</div>
</c:if>
<c:if test="${specialProtocol!=null and specialProtocol eq 'pxyIpControl'}">
<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:if>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>

View File

@@ -232,6 +232,10 @@
<c:if test="${specialFunctionId ne null and specialFunctionId eq 'ipratelimit'}">
<th><spring:message code="ratelimit"/></th>
</c:if>
<c:if test="${specialFunctionId ne null and specialFunctionId eq 'pxyIpControl'}">
<th><spring:message code="REDIRECT_RESPONSE_CODE"/></th>
<th><spring:message code="redirect_content"/></th>
</c:if>
<th><spring:message code="letter"/></th>
<th><spring:message code="type"/></th>
<th><spring:message code="attribute"/></th>
@@ -298,6 +302,16 @@
<c:if test="${cfg.ratelimit ne null}">${cfg.ratelimit}%</c:if>
</td>
</c:if>
<c:if test="${specialFunctionId ne null and specialFunctionId eq 'pxyIpControl'}">
<td>
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE')}" var="codeC">
<c:if test="${codeC.itemValue eq cfg.userRegion1}">
<spring:message code="${codeC.itemCode}" />
</c:if>
</c:forEach>
</td>
<td>${cfg.userRegion2 }</td>
</c:if>
<td>${cfg.requestName }</td>
<td>
<c:set var="classify"></c:set>