178 lines
8.1 KiB
Plaintext
178 lines
8.1 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8"%>
|
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
|
<html>
|
|
<head>
|
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$("#cancel").on("click",function(){
|
|
window.history.back();
|
|
});
|
|
$(".action").on("change", function() {
|
|
$("#serviceId").val($(this).attr("serviceId"));
|
|
if($(".action:checked").val()==64){
|
|
$("#ratelimit").show();
|
|
}else{
|
|
$("#ratelimit").hide();
|
|
}
|
|
});
|
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
|
if($(".action:checked").val()==64){
|
|
$("#ratelimit").show();
|
|
}else{
|
|
$("#ratelimit").hide();
|
|
}
|
|
$("#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){
|
|
var flag = true;
|
|
$("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;
|
|
return;
|
|
}
|
|
})
|
|
if(flag){
|
|
$("input[name$='exprType']").attr("disabled",false);
|
|
$("#appCode").val($("#specServiceIdId").val());
|
|
loading('onloading...');
|
|
form.submit();
|
|
}
|
|
},
|
|
errorContainer: "#messageBox",
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="page-content">
|
|
<h3 class="page-title">
|
|
<spring:message code="app_policy_config"></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>
|
|
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
|
|
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
|
|
</div>
|
|
</div>
|
|
<div class="portlet-body form">
|
|
<!-- BEGIN FORM-->
|
|
<form id="cfgFrom" action="${ctx}/app/saveAppPolicyCfg" method="post" class="form-horizontal">
|
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
|
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
|
|
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
|
|
<input type="hidden" id="exprType" name="exprType" value="0">
|
|
<input type="hidden" id="matchMethod" name="matchMethod" value="3">
|
|
<input type="hidden" id="isHexbin" name="isHexbin" value="0">
|
|
<!-- 配置域类型 -->
|
|
<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" 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"><font color="red">*</font><spring:message code="social_app"/></label>
|
|
<div class="col-md-6">
|
|
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
|
|
labelName="parent.specServiceName"
|
|
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
|
|
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false" extId=""
|
|
cssClass="form-control required"/>
|
|
</div>
|
|
<div for="parent.specServiceName"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
<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="action"/></label>
|
|
<div class="col-md-6">
|
|
<c:forEach items="${serviceList}" var="service"
|
|
varStatus="satus">
|
|
<label class="radio-inline"> <c:if
|
|
test="${_cfg.functionId eq service.functionId}">
|
|
<input type="radio" name="action"
|
|
serviceId="${service.serviceId }"
|
|
protocolId="${service.protocolId }"
|
|
value="${service.action }" class="required action"
|
|
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
|
<c:if test="${dict.itemCode eq service.action }">
|
|
<spring:message code="${dict.itemValue }"/>
|
|
</c:if>
|
|
</c:forEach>
|
|
</c:if>
|
|
</label>
|
|
</c:forEach>
|
|
</div>
|
|
<div for="action"></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" id="ratelimit">
|
|
<div class="form-group">
|
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
|
<div class="col-md-6">
|
|
<input class="form-control required digest" range="[0,100]" type="text" name="ratelimit" value="${_cfg.ratelimit}">
|
|
</div>
|
|
<div for="ratelimit"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
|
</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> |