(1)调整ip配置界面
(2)ip配置界面ip限速加入用户自定义域
This commit is contained in:
@@ -562,6 +562,13 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
if(map.get("numRegionList")!=null){
|
if(map.get("numRegionList")!=null){
|
||||||
numRegionList.addAll(map.get("numRegionList"));
|
numRegionList.addAll(map.get("numRegionList"));
|
||||||
}
|
}
|
||||||
|
if(Constants.SERVICE_IP_MULITIPLEX==cfg.getServiceId().intValue()){
|
||||||
|
String region=Constants.USERREGION_IR_STRATEGY+"="+cfg.getDnsStrategyId()+Constants.USER_REGION_SPLIT
|
||||||
|
+Constants.USERREGION_IR_TYPE+"="+cfg.getIrType();
|
||||||
|
maatCfg.setUserRegion(region);
|
||||||
|
}else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){
|
||||||
|
maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
||||||
@@ -630,6 +637,16 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
|
//限速需要发Droprate=0.001 ,暂不支持Bandwidth=200kbps
|
||||||
|
if(entity.getAction().equals(Constants.RATELIMIT_ACTION)){
|
||||||
|
if(entity.getUserRegion1().equals("0")){//丢包率
|
||||||
|
entity.setUserRegion2(StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2());
|
||||||
|
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+entity.getUserRegion2());
|
||||||
|
}else if(entity.getUserRegion1().equals("1")){//带宽
|
||||||
|
entity.setUserRegion3(StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3());
|
||||||
|
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+entity.getUserRegion3());
|
||||||
|
}
|
||||||
|
}
|
||||||
//调用服务接口下发配置数据
|
//调用服务接口下发配置数据
|
||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("ip配置下发配置参数:"+json);
|
logger.info("ip配置下发配置参数:"+json);
|
||||||
|
|||||||
@@ -1212,4 +1212,5 @@ stream=Stream
|
|||||||
protocol_menu=Protocol
|
protocol_menu=Protocol
|
||||||
advanced=Advanced
|
advanced=Advanced
|
||||||
protocol_identify=Protocol Identify
|
protocol_identify=Protocol Identify
|
||||||
MM_FILE_DIGEST=File Digest Configuration
|
MM_FILE_DIGEST=File Digest Configuration
|
||||||
|
NTC_ASN_IP=ASN
|
||||||
@@ -1212,4 +1212,5 @@ label_app_source=APP Source
|
|||||||
packet=Packet
|
packet=Packet
|
||||||
stream=Stream
|
stream=Stream
|
||||||
protocol_menu=Protocol
|
protocol_menu=Protocol
|
||||||
protocol_identify=Protocol Identify
|
protocol_identify=Protocol Identify
|
||||||
|
NTC_ASN_IP=ASN
|
||||||
@@ -1206,4 +1206,5 @@ stream=Stream
|
|||||||
protocol_menu=Protocol
|
protocol_menu=Protocol
|
||||||
advanced=Advanced
|
advanced=Advanced
|
||||||
protocol_identify=Protocol Identify
|
protocol_identify=Protocol Identify
|
||||||
MM_FILE_DIGEST=\u6587\u4EF6\u6458\u8981\u914D\u7F6E
|
MM_FILE_DIGEST=\u6587\u4EF6\u6458\u8981\u914D\u7F6E
|
||||||
|
NTC_ASN_IP=ASN
|
||||||
2
src/main/resources/sql/20181011/extend_region_type.sql
Normal file
2
src/main/resources/sql/20181011/extend_region_type.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE function_region_dict MODIFY COLUMN region_type INT(1) NOT NULL COMMENT '1IP类,2字符串类,3增强字符串类,4数值类,5摘要类,6回调类,7 ASN';
|
||||||
|
UPDATE function_region_dict SET region_type=7 WHERE config_region_value='NTC_ASN_IP' AND function_id=5;
|
||||||
32
src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp
Normal file
32
src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<div class="row">
|
||||||
|
<div class="pull-right">
|
||||||
|
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||||
|
onClick="delContent('${tabName}${status.index}','${tabName}Add');" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<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="group"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="userRegion4" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||||
|
<option value="${policyGroup.groupId}" <c:if test="${asn==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
</html>
|
||||||
@@ -13,50 +13,29 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
/*initCommIpVal();
|
var asnRegionCode,isAsn=0;
|
||||||
$("#cancel").on("click", function() {
|
var regionCodes=$(".action:checked").attr("regionCode").split(",");
|
||||||
window.history.back();
|
|
||||||
});*/
|
|
||||||
var asnRegionCode,configType;
|
|
||||||
$("input[id^='cfgRegionCode']").each(function(){
|
$("input[id^='cfgRegionCode']").each(function(){
|
||||||
var regionCode=$(this).val();
|
if(7==$(this).attr("regionType")){
|
||||||
if("asn"==$(this).attr("servicetype")){
|
|
||||||
asnRegionCode=$(this).val();
|
asnRegionCode=$(this).val();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".configType a").on("click",function(){
|
for(var ind in regionCodes){
|
||||||
if($(this).attr("id")=="ipCfgTab"){
|
if(regionCodes[ind]==asnRegionCode){
|
||||||
configType="ip";
|
isAsn=1;
|
||||||
$(".glyphicon-plus").first().click();
|
break;
|
||||||
$(".ipPortList").find(".glyphicon-remove").addClass("hidden")
|
|
||||||
hideAction(1,asnRegionCode);
|
|
||||||
}else{
|
|
||||||
configType="asn";
|
|
||||||
hideAction(0,asnRegionCode);
|
|
||||||
}
|
}
|
||||||
var region = ($(this).attr("for"));
|
|
||||||
if(region=="ipaddr"){
|
|
||||||
$(".asn").addClass("hidden").addClass("disabled");
|
|
||||||
$(".ipaddr").removeClass("hidden").removeClass("disabled");
|
|
||||||
}else{
|
|
||||||
$(".ipaddr").addClass("hidden").addClass("disabled");
|
|
||||||
$(".asn").removeClass("hidden").removeClass("disabled");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//切换tab
|
|
||||||
if("${_cfg.cfgId}"==''){
|
|
||||||
configType='ip';
|
|
||||||
$("#ipCfgTab").click();
|
|
||||||
}else if("${_cfg.userRegion4}"==""){
|
|
||||||
configType='ip';
|
|
||||||
$("#ipCfgTab").click();
|
|
||||||
}else{
|
|
||||||
configType='asn';
|
|
||||||
$("#ansCfgTab").click();
|
|
||||||
}
|
}
|
||||||
if(configType!='asn'){
|
//hide actions
|
||||||
$(".glyphicon-plus").first().click();
|
if(isAsn==1){
|
||||||
$(".ipPortList").find(".glyphicon-remove").addClass("hidden")
|
hideAction(0,asnRegionCode);
|
||||||
|
}else{
|
||||||
|
hideAction(1,asnRegionCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isAsn==0){
|
||||||
|
$("[class~='glyphicon-plus'][class~='ipPortList']").click();
|
||||||
|
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();
|
||||||
/*if(action==32){
|
/*if(action==32){
|
||||||
$(".subscribeId").find(".glyphicon-remove").click();
|
$(".subscribeId").find(".glyphicon-remove").click();
|
||||||
$(".subscribeId").prev("h4").addClass("hidden");
|
$(".subscribeId").prev("h4").addClass("hidden");
|
||||||
@@ -73,8 +52,24 @@
|
|||||||
$(this).addClass("hidden");
|
$(this).addClass("hidden");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
processAction(configType,$(".ipPortList"));
|
processAction(isAsn,$(".ipPortList"));
|
||||||
|
}else{
|
||||||
|
$("[class~='glyphicon-plus'][class~='asn']").click();
|
||||||
|
$("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click();
|
||||||
|
processAction(isAsn,$(".asn"));
|
||||||
}
|
}
|
||||||
|
$(".glyphicon-plus").on("click",function(){
|
||||||
|
if($(this).hasClass("ipPortList")){
|
||||||
|
isAsn=0;
|
||||||
|
hideAction(1,asnRegionCode);
|
||||||
|
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();
|
||||||
|
}
|
||||||
|
if($(this).hasClass("asn")){
|
||||||
|
isAsn=1;
|
||||||
|
hideAction(0,asnRegionCode);
|
||||||
|
$("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
@@ -109,10 +104,10 @@
|
|||||||
tabInfo.find("[name$='cfgType']").val(cfgType);
|
tabInfo.find("[name$='cfgType']").val(cfgType);
|
||||||
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
|
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
|
||||||
}
|
}
|
||||||
if(configType!='asn'){
|
if(isAsn==0){
|
||||||
changeIPVal(tabInfo);
|
changeIPVal(tabInfo);
|
||||||
}
|
}
|
||||||
processAction(configType,tabInfo);
|
processAction(isAsn,tabInfo);
|
||||||
/* if(tabInfo){
|
/* if(tabInfo){
|
||||||
tabInfo.find("[name$='cfgType']").val(cfgType);
|
tabInfo.find("[name$='cfgType']").val(cfgType);
|
||||||
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
|
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
|
||||||
@@ -206,7 +201,7 @@
|
|||||||
flag=flag1;
|
flag=flag1;
|
||||||
}
|
}
|
||||||
if(flag){
|
if(flag){
|
||||||
if(configType!='asn'){
|
if(isAsn==0){
|
||||||
$("input[name='userRegion4']").attr("disabled",true);
|
$("input[name='userRegion4']").attr("disabled",true);
|
||||||
}
|
}
|
||||||
$("input[name$='userRegion1']").attr("disabled",false);
|
$("input[name$='userRegion1']").attr("disabled",false);
|
||||||
@@ -306,7 +301,7 @@ var hideAction=function(isHide,regionCode){
|
|||||||
}
|
}
|
||||||
var processAction=function(configType,obj){
|
var processAction=function(configType,obj){
|
||||||
var action=$(".action:checked").val();
|
var action=$(".action:checked").val();
|
||||||
if(configType!='asn'){
|
if(configType!=1){
|
||||||
var o=$(obj)
|
var o=$(obj)
|
||||||
if(o){
|
if(o){
|
||||||
/*处理协议*/
|
/*处理协议*/
|
||||||
@@ -429,9 +424,9 @@ var processAction=function(configType,obj){
|
|||||||
<div class="portlet-body flip-scroll">
|
<div class="portlet-body flip-scroll">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div class="tabbable tabbable-custom tabs-left">
|
<%-- <div class="tabbable tabbable-custom tabs-left"> --%>
|
||||||
<!-- Only required for left/right tabs -->
|
<!-- Only required for left/right tabs -->
|
||||||
<ul class="nav nav-tabs tabs-left">
|
<%-- <ul class="nav nav-tabs tabs-left">
|
||||||
<li class="configType"><a href="#ip_tab" id="ipCfgTab"
|
<li class="configType"><a href="#ip_tab" id="ipCfgTab"
|
||||||
data-toggle="tab" for="ipaddr"
|
data-toggle="tab" for="ipaddr"
|
||||||
data_dldk="<spring:message code="IP"/>"><spring:message
|
data_dldk="<spring:message code="IP"/>"><spring:message
|
||||||
@@ -439,7 +434,7 @@ var processAction=function(configType,obj){
|
|||||||
<li class="configType"><a href="#asn_tab" data-toggle="tab" for="asn" id="ansCfgTab"
|
<li class="configType"><a href="#asn_tab" data-toggle="tab" for="asn" id="ansCfgTab"
|
||||||
data_dldk="<spring:message code="ASN"/>"><spring:message
|
data_dldk="<spring:message code="ASN"/>"><spring:message
|
||||||
code="ASN" /></a></li>
|
code="ASN" /></a></li>
|
||||||
</ul>
|
</ul> --%>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -550,19 +545,19 @@ var processAction=function(configType,obj){
|
|||||||
</div> --%>
|
</div> --%>
|
||||||
</div>
|
</div>
|
||||||
<!-- dolog end-->
|
<!-- dolog end-->
|
||||||
<c:set var="ipCfgIndex" value="0"></c:set>
|
<c:set var="ipCfgIndex" value="0"></c:set>
|
||||||
<c:set var="strCfgIndex" value="0"></c:set>
|
<c:set var="strCfgIndex" value="0"></c:set>
|
||||||
<c:set var="subscribeIdIndex" value="0"></c:set>
|
<c:set var="subscribeIdIndex" value="0"></c:set>
|
||||||
|
<c:set var="asnIndex" value="0"></c:set>
|
||||||
<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 }">
|
||||||
<c:if test="${ipCfgIndex==0}">
|
<c:if test="${ipCfgIndex==0}">
|
||||||
<div class="ipaddr">
|
|
||||||
<!--ip info-->
|
<!--ip info-->
|
||||||
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
||||||
<h4 class="form-section ipPortListTitle${region.configRegionCode}">
|
<h4 class="form-section ipPortListTitle${region.configRegionCode}">
|
||||||
<span class="ipPortTitle"><spring:message code="${region.configRegionValue}" /></span>
|
<span class="ipPortTitle"><spring:message code="${region.configRegionValue}" /></span>
|
||||||
<small> <span
|
<small> <span
|
||||||
class="glyphicon glyphicon-plus ${tabName}Add"
|
class="glyphicon glyphicon-plus ipPortList ${tabName}Add"
|
||||||
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
</h4>
|
</h4>
|
||||||
<c:set var="cfgName" value="ipPortList[${ipCfgIndex}]"></c:set>
|
<c:set var="cfgName" value="ipPortList[${ipCfgIndex}]"></c:set>
|
||||||
@@ -585,12 +580,10 @@ var processAction=function(configType,obj){
|
|||||||
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
|
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</div>
|
|
||||||
</c:if>
|
</c:if>
|
||||||
<!--/ip info-->
|
<!--/ip info-->
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${region.regionType eq 2 }">
|
<c:if test="${region.regionType eq 2 }">
|
||||||
<div class="ipaddr">
|
|
||||||
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
||||||
<h4 class="form-section">
|
<h4 class="form-section">
|
||||||
<spring:message code="${region.configRegionValue}" />
|
<spring:message code="${region.configRegionValue}" />
|
||||||
@@ -637,26 +630,45 @@ var processAction=function(configType,obj){
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</div>
|
</c:if>
|
||||||
|
<c:if test="${region.regionType eq 7 }">
|
||||||
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="${region.configRegionValue}" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus asn ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${fn:length(fn:split(_cfg.userRegion4,','))>0}">
|
||||||
|
<c:set var="isBreak" value="false" ></c:set>
|
||||||
|
<c:forEach items="${fn:split(_cfg.userRegion4,',')}" var="asn">${_cfg.cfgType}
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${!isBreak}">
|
||||||
|
<div class="row boxSolid asn ${tabName}${status.index}">
|
||||||
|
<%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
<c:set var="isBreak" value="true" ></c:set>
|
||||||
|
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
||||||
|
</c:when>
|
||||||
|
</c:choose>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${!isBreak}">
|
||||||
|
<div class="row boxSolid asn ${tabName}${status.index} hidden disabled">
|
||||||
|
<%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<div class="row boxSolid asn ${tabName}${status.index} hidden disabled">
|
||||||
|
<%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
<div class="asn">
|
|
||||||
<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="group"/></label>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<select name="userRegion4" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
|
||||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
|
||||||
<option value="${policyGroup.groupId}" <c:if test="${_cfg.userRegion1==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
|
||||||
</c:forEach>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div for="userRegion4"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
<br>
|
||||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
||||||
<br>
|
<br>
|
||||||
@@ -679,7 +691,7 @@ var processAction=function(configType,obj){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<%-- </div> --%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user