300 lines
14 KiB
Plaintext
300 lines
14 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8"%>
|
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
|
<html>
|
|
<head>
|
|
<title><spring:message code="url_group_configuration"></spring:message></title>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$("#cfgFrom").validate({
|
|
errorPlacement: function(error,element){
|
|
if($(element).parents().hasClass("tagsinput")){
|
|
$(element).parents(".col-md-6").next("div").append(error);
|
|
}else{
|
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
|
}
|
|
},
|
|
submitHandler: function(form){
|
|
/* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
|
$("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail"));
|
|
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */
|
|
var flag = true;
|
|
/* $(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
|
|
if($(this).val()==''){
|
|
$(this).parents(".form-group").find(
|
|
"div[for='"
|
|
+ $(this).attr("name")
|
|
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
|
|
flag = false;
|
|
}
|
|
}); */
|
|
$(".tagsinput:visible").each(function(){
|
|
var text='';
|
|
$(this).find(".tag").each(function(){
|
|
text+=$(this).children("span").text().trim();
|
|
});
|
|
if(text.length < 4 || text.length > 1024){
|
|
$(this).parents(".col-md-6").next("div").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.keywordLength+"</label>");
|
|
if(flag){
|
|
flag=false;
|
|
}
|
|
}
|
|
});
|
|
if(flag){
|
|
loading('onloading...');
|
|
form.submit();
|
|
}else{
|
|
return;
|
|
}
|
|
|
|
},
|
|
errorContainer: "#messageBox",
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
|
|
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
|
|
<div class="page-content">
|
|
|
|
<h3 class="page-title">
|
|
<spring:message code="url_group_configuration"></spring:message>
|
|
</h3>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="portlet box blue">
|
|
<div class="portlet-title">
|
|
<div class="caption">
|
|
<i class="fa fa-gift"></i>
|
|
<spring:message code="edit"></spring:message>
|
|
</div>
|
|
</div>
|
|
<div class="portlet-body form">
|
|
<!-- BEGIN FORM-->
|
|
<form id="cfgFrom" action="${ctx}/basics/url/update" method="post" class="form-horizontal">
|
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
|
<input type="hidden" name="regionId" value="${_cfg.regionId}">
|
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
|
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
|
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
|
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
|
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
|
|
<%-- <input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
|
<input type="hidden" id="asnIpGroup" name="asnIpGroup" value="${_cfg.asnIpGroup}"> --%>
|
|
<!-- 配置域类型 -->
|
|
<c:forEach items="${regionList}" var="region">
|
|
<c:if test="${_cfg.functionId eq region.functionId}">
|
|
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
|
<input type="hidden" name="cfgRegionCode"
|
|
isMaat="${region.isMaat}"
|
|
serviceType="${region.configServiceType}"
|
|
ipPortShow="${region.configIpPortShow}"
|
|
ipType="${region.configIpType}"
|
|
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
|
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
|
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
|
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
|
direction="${region.configDirection}"
|
|
protocol="${region.configProtocol}"
|
|
regionType="${region.regionType}"
|
|
value="${region.configRegionCode}">
|
|
</c:if>
|
|
</c:forEach>
|
|
<div class="form-body">
|
|
<!-- desc and action -->
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
|
<div class="col-md-6">
|
|
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="urlGroup"/></label>
|
|
<div class="col-md-6">
|
|
<%-- <input class="form-control required digits asnMustExists" type="text" name="${cfgName}.cfgKeywords" value="${cfg.cfgKeywords}" ctx="${ctx}"> --%>
|
|
<select name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
|
<option value="${_cfg.userRegion3}"><spring:message code="select"/></option>
|
|
<c:forEach items="${policyGroupInfos}" var="urlGroupInfo">
|
|
<option value="${urlGroupInfo.groupId}"
|
|
<c:if test="${_cfg.userRegion3 eq urlGroupInfo.serviceGroupId }">
|
|
selected
|
|
</c:if>
|
|
>${urlGroupInfo.groupName}</option>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
<div for="userRegion3"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- desc and action -->
|
|
<h4 class="form-section">
|
|
<spring:message code="http_url_title" />
|
|
<!-- <small> <span
|
|
class="glyphicon glyphicon-plus asnIpAdd"
|
|
onClick="addContent(this,'strInfo')" title="add"></span></small> -->
|
|
</h4>
|
|
<!-- <div class="row strInfo boxSolid asnIp hidden disabled"> -->
|
|
<!-- <input type="hidden" name="asnIpCfgs[0].protocolId" value="0"> -->
|
|
<!-- <div class="row">
|
|
<div class="pull-right">
|
|
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
|
onClick="delContent(this,'strInfo');" />
|
|
</div>
|
|
</div> -->
|
|
<div class=" boxSolid ">
|
|
<div class="row" style="height: 15px;"></div>
|
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
|
<%-- <c:set var="cfgName" value="urlCommGroupList[-1]"></c:set> --%>
|
|
<%-- <input type="hidden" name="${cfgName}.sourceCompileId" value="${cfg.sourceCompileId }"> --%>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label class="control-label col-md-3"><font color="red">*</font>
|
|
<spring:message code="keywords" />
|
|
</label>
|
|
<!-- 此配置的关键词可以输入多个关键词 -->
|
|
<c:if test="${region.configMultiKeywords eq 1}">
|
|
<div class="col-md-6">
|
|
<input class="form-control required tags <c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if> <c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>" type="text" id="tags_${tabName}${status.index}"
|
|
name="cfgKeywords"
|
|
value="${_cfg.cfgKeywords}">
|
|
</div>
|
|
</c:if>
|
|
<!-- 此配置的关键词不允许输入多个关键词 -->
|
|
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
|
<div class="col-md-6">
|
|
<input class="form-control required invisibleChar
|
|
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if>
|
|
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>
|
|
"
|
|
type="text"
|
|
name="cfgKeywords"
|
|
value="${_cfg.cfgKeywords}">
|
|
</div>
|
|
</c:if>
|
|
<div for="cfgKeywords"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6 exprType">
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-md-3"><font color="red">*</font>
|
|
<spring:message code="expression_type" /></label>
|
|
<div class="col-md-6">
|
|
<c:if test="${!empty region.configExprType}">
|
|
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}" varStatus="stat" >
|
|
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC" >
|
|
<c:if test="${exprTypeC.itemCode eq exprType}">
|
|
<label class="radio-inline">
|
|
<input type="radio"
|
|
name="exprType" value="${exprType }"
|
|
class="required"
|
|
<%-- <c:if test="${stat.index == 0 }"> checked </c:if> --%>
|
|
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
|
|
checked
|
|
</c:if>
|
|
>
|
|
<spring:message code="${exprTypeC.itemValue }" />
|
|
</label>
|
|
</c:if>
|
|
</c:forEach>
|
|
</c:forEach>
|
|
</c:if>
|
|
<c:if test="${empty region.configExprType}">
|
|
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
|
|
<c:if test="${exprTypeC.itemCode eq 0}">
|
|
<label class="radio-inline">
|
|
<input type="radio"
|
|
name="exprType" value="${exprTypeC.itemCode }"
|
|
class="required" checked >
|
|
<spring:message code="${exprTypeC.itemValue }" />
|
|
</label>
|
|
</c:if>
|
|
</c:forEach>
|
|
</c:if>
|
|
</div>
|
|
<div for="exprType"></div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6 matchMethod">
|
|
<div class="form-group ">
|
|
<label class="control-label col-md-3"><font color="red">*</font>
|
|
<spring:message code="match_method" /></label>
|
|
<div class="col-md-6">
|
|
<select name="matchMethod"
|
|
class="selectpicker select2 form-control required ">
|
|
<c:if test="${!empty region.configMatchMethod}">
|
|
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
|
|
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
|
<c:if test="${matchMethodC.itemCode eq matchMethod}">
|
|
<option value="${matchMethodC.itemCode}"
|
|
>
|
|
<spring:message code="${matchMethodC.itemValue}"/>
|
|
</option>
|
|
</c:if>
|
|
|
|
</c:forEach>
|
|
</c:forEach>
|
|
</c:if>
|
|
<c:if test="${empty region.configMatchMethod}">
|
|
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
|
<c:if test="${matchMethodC.itemCode eq 0}">
|
|
<option value="${matchMethodC.itemCode}"
|
|
selected
|
|
>
|
|
<spring:message code="${matchMethodC.itemValue}"/>
|
|
</option>
|
|
</c:if>
|
|
|
|
</c:forEach>
|
|
</c:if>
|
|
</select>
|
|
</div>
|
|
<div for="matchMethod"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</c:forEach>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="form-actions">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="row">
|
|
<div class="col-md-offset-3 col-md-8">
|
|
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
|
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6"> </div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<!-- END FORM-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |