366 lines
25 KiB
Plaintext
366 lines
25 KiB
Plaintext
|
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||
|
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var defaultIpInfo;
|
||
|
|
$(function(){
|
||
|
|
//$("select[name$='protocol']").parents(".form-group").addClass("hidden");
|
||
|
|
// $("select[name$='direction']").parents(".form-group").addClass("hidden");
|
||
|
|
defaultIpInfo=$(".ipInfo").clone();
|
||
|
|
$(".ipAdd").click();
|
||
|
|
$("#cfgFrom").validate({
|
||
|
|
errorPlacement: function(error,element){
|
||
|
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||
|
|
},
|
||
|
|
submitHandler: function(form){
|
||
|
|
loading('onloading...');
|
||
|
|
form.submit();
|
||
|
|
},
|
||
|
|
errorContainer: "#messageBox",
|
||
|
|
});
|
||
|
|
});
|
||
|
|
//业务窗口打开
|
||
|
|
var addContent = function(obj, contentClassName) {
|
||
|
|
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
||
|
|
if(showDiv.hasClass("hidden")){
|
||
|
|
$(showDiv).removeClass("hidden").removeClass("disabled");
|
||
|
|
}else{
|
||
|
|
var additional=defaultIpInfo.clone();
|
||
|
|
additional.removeClass("hidden").removeClass("disabled");
|
||
|
|
showDiv.after(additional);
|
||
|
|
}
|
||
|
|
var index=0;
|
||
|
|
$("."+contentClassName).each(function(){
|
||
|
|
reSort($(this),index);
|
||
|
|
index++;
|
||
|
|
});
|
||
|
|
$(".selectpicker").selectpicker("render");
|
||
|
|
//$(obj).addClass("hidden");
|
||
|
|
$("select[name$='ipType']").on("change",function(){
|
||
|
|
switchIpInfo(this);
|
||
|
|
});
|
||
|
|
$("select[name$='IpPattern']").on("change",function(){
|
||
|
|
switchIpInfo(this);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
//业务窗口关闭
|
||
|
|
var delContent = function(obj,contentClassName) {
|
||
|
|
if($("."+contentClassName).length==1){
|
||
|
|
top.$.jBox.tip("<spring:message code='one_more'/>");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
$(obj).parents("."+contentClassName).remove();
|
||
|
|
var index=0;
|
||
|
|
$("."+contentClassName).each(function(){
|
||
|
|
reSort($(this),index);
|
||
|
|
index++;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
var reSort=function(obj,index){
|
||
|
|
$(obj).find("input,select").each(function(){
|
||
|
|
var name=$(this).attr("name");
|
||
|
|
if(name.indexOf("ipCommGroupCfgList[")>-1){
|
||
|
|
var namePrefix="ipCommGroupCfgList[";
|
||
|
|
var nameSubfix=name.substring(name.indexOf("]"));
|
||
|
|
var nameNew=namePrefix+index+nameSubfix;
|
||
|
|
if(nameNew!=name){
|
||
|
|
$(this).attr("name",nameNew);
|
||
|
|
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
|
||
|
|
<div class="page-content">
|
||
|
|
|
||
|
|
<h3 class="page-title">
|
||
|
|
<spring:message code="ip_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="add"></spring:message>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="portlet-body form">
|
||
|
|
<!-- BEGIN FORM-->
|
||
|
|
<form id="cfgFrom" action="${ctx}/basics/ip/save" method="post" class="form-horizontal">
|
||
|
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||
|
|
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||
|
|
<input type="hidden" id="compileId" name="compileId" value="0">
|
||
|
|
<input type="hidden" id="requestId" name="requestId" value="0">
|
||
|
|
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||
|
|
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||
|
|
<c:forEach items="${serviceList}" var="service">
|
||
|
|
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||
|
|
<input type="hidden" id="action" name="action" value="${service.action}">
|
||
|
|
</c:forEach>
|
||
|
|
<!-- 配置域类型 -->
|
||
|
|
<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">
|
||
|
|
<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="ip_group"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<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="ipGroupInfo">
|
||
|
|
<option value="${ipGroupInfo.groupId}"
|
||
|
|
<c:if test="${_cfg.userRegion3 eq ipGroupInfo.groupId }">
|
||
|
|
selected
|
||
|
|
</c:if>
|
||
|
|
>${ipGroupInfo.groupName}</option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="userRegion3"></div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<h4 class="form-section">
|
||
|
|
<spring:message code="ip_group_configuration" />
|
||
|
|
<small> <span
|
||
|
|
class="glyphicon glyphicon-plus ipAdd"
|
||
|
|
onClick="addContent(this,'ipInfo')" title="add"></span></small>
|
||
|
|
</h4>
|
||
|
|
<div class="row ipInfo boxSolid hidden disabled">
|
||
|
|
<input type="hidden" name="ipCommGroupCfgList[0].protocolId" value="0">
|
||
|
|
<div class="row">
|
||
|
|
<div class="pull-right">
|
||
|
|
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||
|
|
onClick="delContent(this,'ipInfo');" />
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="row protocol">
|
||
|
|
<div class="col-md-6">
|
||
|
|
<div class="form-group ">
|
||
|
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||
|
|
<spring:message code="protocol" /></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].protocol"
|
||
|
|
class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||
|
|
<option value="${protocolC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].protocol==protocolC.itemCode || (_cfg.ipCommGroupCfgList[0].protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].protocol"></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="direction" /></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].direction"
|
||
|
|
class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||
|
|
<option value="${directionC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].direction==directionC.itemCode || (_cfg.ipCommGroupCfgList[0].direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].direction"></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="ip_type"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].ipType" class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||
|
|
<option value="${ipTypeC.itemCode}"
|
||
|
|
<c:if test="${_cfg.ipCommGroupCfgList[0].ipType==ipTypeC.itemCode
|
||
|
|
|| (_cfg.ipCommGroupCfgList[0].ipType==null && ipTypeC.itemCode==4)}">
|
||
|
|
selected
|
||
|
|
</c:if>
|
||
|
|
>
|
||
|
|
<spring:message code="${ipTypeC.itemValue}"/>
|
||
|
|
</option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].ipType"></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="src_ip_pattern"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].srcIpPattern" class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||
|
|
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].srcIpPattern==ipPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].srcIpPattern"></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="client_ip"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<input class="form-control required ipCheck" type="text" name="ipCommGroupCfgList[0].srcIpAddress" value="${_cfg.ipCommGroupCfgList[0].srcIpAddress}">
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].srcIpAddress"></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="src_port_pattern"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].srcPortPattern" class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||
|
|
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].srcPortPattern==portPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].srcPortPattern"></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="client_port"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<input class="form-control required portCheck" type="text" name="ipCommGroupCfgList[0].srcPort" value="${_cfg.ipCommGroupCfgList[0].srcPort}">
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].srcPort"></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="dest_ip_pattern"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].destIpPattern" class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||
|
|
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].destIpPattern==ipPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].destIpPattern"></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="server_ip"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<input class="form-control required ipCheck" type="text" name="ipCommGroupCfgList[0].destIpAddress" value="${_cfg.ipCommGroupCfgList[0].destIpAddress}">
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].destIpAddress"></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="dest_port_pattern"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<select name="ipCommGroupCfgList[0].destPortPattern" class="selectpicker show-tick form-control required">
|
||
|
|
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||
|
|
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].destPortPattern==portPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||
|
|
</c:forEach>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].destPortPattern"></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="server_port"/></label>
|
||
|
|
<div class="col-md-6">
|
||
|
|
<input class="form-control required portCheck" type="text" name="ipCommGroupCfgList[0].destPort" value="${_cfg.ipCommGroupCfgList[0].destPort}">
|
||
|
|
</div>
|
||
|
|
<div for="ipCommGroupCfgList[0].destPort"></div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<%-- <div class="row">
|
||
|
|
<button type="button" class="btn btn-red-hollow center-block"
|
||
|
|
onClick="more(this);" data-click-times="0">
|
||
|
|
<spring:message code="show_more" />
|
||
|
|
</button>
|
||
|
|
</div> --%>
|
||
|
|
</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">
|
||
|
|
<c:set var="auditPermission" value="false"></c:set>
|
||
|
|
<!-- 拥有配置新增直接生效的功能权限 -->
|
||
|
|
<shiro:hasPermission name="save:audit:permission">
|
||
|
|
<c:set var="auditPermission" value="true"></c:set>
|
||
|
|
</shiro:hasPermission>
|
||
|
|
<c:choose>
|
||
|
|
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||
|
|
<button id="audit" type="submit" class="btn green">
|
||
|
|
<spring:message code="submit" />
|
||
|
|
</button>
|
||
|
|
</c:when>
|
||
|
|
<c:otherwise>
|
||
|
|
<button id="save" type="submit" class="btn green">
|
||
|
|
<spring:message code="submit" />
|
||
|
|
</button>
|
||
|
|
</c:otherwise>
|
||
|
|
</c:choose>
|
||
|
|
<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>
|