基础信息、隧道行为增加限速,Stream模块三个限速位置统一
This commit is contained in:
@@ -14,16 +14,19 @@ $(function(){
|
||||
// $("#cancel").on("click",function(){
|
||||
// window.history.back();
|
||||
// });
|
||||
$(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
|
||||
switchRateLimitType();
|
||||
});
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
var action=$("input[name='action']:checked").val();
|
||||
switchAction(action);
|
||||
if($(".action:checked").val()==64){
|
||||
$("#ratelimit").show();
|
||||
if(action==64){
|
||||
$(".ratelimitAction").removeClass("hidden");
|
||||
}else{
|
||||
$("#ratelimit").hide();
|
||||
$(".ratelimitAction").addClass("hidden");
|
||||
}
|
||||
switchAction(action);
|
||||
if($(this).val()==1){
|
||||
$(".ipPortAdd").click();
|
||||
}
|
||||
@@ -31,9 +34,9 @@ $(function(){
|
||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||
if($(".action:checked").val()==64){
|
||||
$("#ratelimit").show();
|
||||
$(".ratelimitAction").removeClass("hidden");
|
||||
}else{
|
||||
$("#ratelimit").hide();
|
||||
$(".ratelimitAction").addClass("hidden");
|
||||
}
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
@@ -98,8 +101,8 @@ $(function(){
|
||||
//if($("[name='behavCode']")&&$("[name='behavCode']").val()!=""){
|
||||
// $("input[name='exprType']").val(1);
|
||||
//}
|
||||
if($("input[name='ratelimit']").is(":hidden")){
|
||||
$("input[name='ratelimit']").val("");
|
||||
if($(".ratelimitAction").is(":hidden")){
|
||||
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
||||
}
|
||||
/* $("#appCode").val($("#specServiceIdId").val()); */
|
||||
loading('onloading...');
|
||||
@@ -125,6 +128,20 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
||||
$("." + addBtnClassName).removeClass("hidden");
|
||||
}
|
||||
//限流方式
|
||||
var switchRateLimitType=function(){
|
||||
//0 丢包率 1 带宽
|
||||
var rateLimitType=$(".ratelimitAction").find("input[name='userRegion1']:checked").val();
|
||||
if(rateLimitType == 0){
|
||||
$(".droprate").removeClass("hidden");
|
||||
$(".bandwith").addClass("hidden");
|
||||
}
|
||||
if(rateLimitType == 1){
|
||||
$(".droprate").addClass("hidden");
|
||||
$(".bandwith").removeClass("hidden");
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -251,18 +268,75 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 ratelimit" id="ratelimit">
|
||||
<div class="col-md-6 hidden">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||
<label class="control-label col-md-3">
|
||||
<input type="checkbox" name="userRegion4" class="child-checks" <%-- <c:if test="${_cfg.userRegion4 eq '1' }"> --%>checked<%-- </c:if> --%> value="1">
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required digest" range="[0,1]" type="text" name="ratelimit" value="${_cfg.ratelimit}">
|
||||
<label class="control-label">
|
||||
<spring:message code="block_by_app_server_ip"/>
|
||||
</label>
|
||||
</div>
|
||||
<div for="ratelimit"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div for="userRegion4"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ratelimitAction hidden">
|
||||
<h4 class="form-section">
|
||||
<spring:message code="action_region" />
|
||||
<small></small>
|
||||
</h4>
|
||||
<div class="col-md-6 hidden">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="limit_rate_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="userRegion1" value="0"
|
||||
<%-- <c:if test="${(userRegion1 eq 0) || (empty userRegion1)}"> --%>
|
||||
checked
|
||||
<%-- </c:if> --%>
|
||||
class="required" >
|
||||
<spring:message code="ratelimit" />
|
||||
</label>
|
||||
<%-- <label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="userRegion1" value="1"
|
||||
<c:if test="${(userRegion1 eq 1)}">
|
||||
checked
|
||||
</c:if>
|
||||
class="required" >
|
||||
<spring:message code="bandwith" />
|
||||
</label> --%>
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 droprate">
|
||||
<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">
|
||||
<select name="userRegion2" data-live-search="true" class="selectpicker form-control required">
|
||||
<option value="" ><spring:message code="selected"/></option>
|
||||
<c:forEach items="${fns:getDictList('APP_RATE_LIMIT')}" var="ratelimitC">
|
||||
<option value="${ratelimitC.itemCode}" <c:if test="${_cfg.userRegion2==ratelimitC.itemCode || (_cfg.userRegion2==null && ratelimitC.itemCode eq '0.1')}">selected</c:if>><spring:message code="${ratelimitC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion2"></div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="col-md-6 bandwith">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="bandwith"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required number" type="text" name="userRegion3" value="${_cfg.userRegion3 }">
|
||||
</div>
|
||||
<div for="userRegion3"></div>
|
||||
</div>
|
||||
</div> --%>
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 关键字 -->
|
||||
<c:set var="strCfgIndex" value="0"></c:set>
|
||||
|
||||
@@ -375,8 +375,8 @@
|
||||
<th class="sort-column r.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<%-- <th><spring:message code="behaviour_type"/></th> --%>
|
||||
<%-- <th><spring:message code="ratelimit"/></th> --%>
|
||||
<th class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="ratelimit"/></th>
|
||||
<th><spring:message code="basic_protocol"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
@@ -411,9 +411,17 @@
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.action eq 64}">
|
||||
<c:forEach items="${fns:getDictList('APP_RATE_LIMIT')}" var="ratelimitC">
|
||||
<c:if test="${cfg.userRegion2==ratelimitC.itemCode}">
|
||||
<spring:message code="${ratelimitC.itemValue}"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</td>
|
||||
<td class="appCode" id="${cfg.appCode }">${cfg.appCode }</td>
|
||||
<%--<td class="behavCode" id="${cfg.behavCode }">${cfg.behavCode }</td>--%>
|
||||
<%-- <td>${cfg.ratelimit }</td> --%>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
|
||||
Reference in New Issue
Block a user