增强配置表单校验

This commit is contained in:
chenjinsong
2018-04-03 09:37:51 +08:00
parent 268ee25299
commit beded74891
6 changed files with 444 additions and 62 deletions

View File

@@ -1,7 +1,7 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<h3 class="form-section">增强字符串<spring:message code="block_config"/><small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".complexCfg" title="add"></span></small></h3>
<div class="row complexCfg collapse">
<h3 class="form-section">增强字符串<spring:message code="block_config"/><!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".complexCfg" title="add"></span></small> --></h3>
<div class="row complexCfg">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
@@ -15,7 +15,6 @@
</c:when>
</c:choose>
</div>
<div for="cfgDesc"></div>
</div>
</div>
<div class="col-md-6">
@@ -42,11 +41,18 @@
</c:choose>
<input type="hidden" name="" placeholder="请输入自定义域" class="otherValue form-control" value="${_cfg.complexCfg[mainTable].district}"/>
</div>
<div for="district"></div>
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<div for="complexCfg[${mainTable}].district"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<div for="complexCfg[${otherTable.tableName}].district"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
<div class="row complexCfg collapse">
<div class="row complexCfg">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="key_word"/></label>
@@ -60,7 +66,14 @@
</c:when>
</c:choose>
</div>
<div for="keywords"></div>
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<div for="complexCfg[${mainTable}].keywords"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<div for="complexCfg[${otherTable.tableName}].keywords"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -94,11 +107,18 @@
</c:when>
</c:choose>
</div>
<div for="isAreaEffective"></div>
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<div for="complexCfg[${mainTable}].exprType"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<div for="complexCfg[${otherTable.tableName}].exprType"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
<div class="row complexCfg collapse">
<div class="row complexCfg">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="match_method"/></label>
@@ -124,7 +144,14 @@
</c:when>
</c:choose>
</div>
<div for="matchMethod"></div>
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<div for="complexCfg[${mainTable}].matchMethod"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<div for="complexCfg[${otherTable.tableName}].matchMethod"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -150,6 +177,14 @@
</c:when>
</c:choose>
</div>
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<div for="complexCfg[${mainTable}].isHexbin"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<div for="complexCfg[${otherTable.tableName}].isHexbin"></div>
</c:when>
</c:choose>
</div>
</div>
<c:choose>

View File

@@ -1,11 +1,9 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<style>
.ipCfg-hide{
display:none;
}
</style>
<h3 class="form-section">IP<spring:message code="block_config"/><small><span class="glyphicon glyphicon-plus" data-toggle="collapse" data-target=".ipCfg" title="add"></span></small></h3>
<h3 class="form-section">IP<spring:message code="block_config"/><small><span style="margin-left:10px"><input type="checkbox" id="ipSelect"/> 可选</span><!-- <span class="glyphicon glyphicon-plus" data-toggle="collapse" data-target=".ipCfg" title="add"></span> --></small></h3>
<div class="row ipCfg collapse">
<div class="col-md-6">
<div class="form-group">
@@ -20,7 +18,6 @@
</c:when>
</c:choose>
</div>
<div for="cfgDesc"></div>
</div>
</div>
<div class="col-md-6">
@@ -44,7 +41,14 @@
</c:when>
</c:choose>
</div>
<div for="ipType"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].ipType"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].ipType"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
@@ -62,7 +66,14 @@
</c:when>
</c:choose>
</div>
<div for="srcIp"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].srcIp"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].srcIp"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -78,6 +89,14 @@
</c:when>
</c:choose>
</div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].srcIpMask"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].srcIpMask"></div>
</c:when>
</c:choose>
<div for="srcIpMask"></div>
</div>
</div>
@@ -96,7 +115,14 @@
</c:when>
</c:choose>
</div>
<div for="srcPort"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].srcPort"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].srcPort"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -112,7 +138,14 @@
</c:when>
</c:choose>
</div>
<div for="srcPortMask"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].srcPortMask"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].srcPortMask"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
@@ -130,7 +163,14 @@
</c:when>
</c:choose>
</div>
<div for="dstIp"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].dstIp"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].dstIp"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -146,7 +186,14 @@
</c:when>
</c:choose>
</div>
<div for="dstIpMask"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].dstIpMask"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].dstIpMask"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
@@ -164,7 +211,14 @@
</c:when>
</c:choose>
</div>
<div for="dstPort"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].dstPort"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].dstPort"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -180,7 +234,14 @@
</c:when>
</c:choose>
</div>
<div for="dstPortMask"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].dstPortMask"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].dstPortMask"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
@@ -207,7 +268,14 @@
</c:choose>
<%-- <input class="form-control" type="text" name="direction" value="${_cfg.ipCfg.direction}"> --%>
</div>
<div for="direction"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].direction"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].direction"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -233,7 +301,14 @@
</c:when>
</c:choose>
</div>
<div for="protocol"></div>
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<div for="ipCfg[${mainTable}].protocol"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<div for="ipCfg[${otherTable.tableName}].protocol"></div>
</c:when>
</c:choose>
</div>
</div>
<c:choose>

View File

@@ -1,7 +1,7 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<h3 class="form-section">字符串<spring:message code="block_config"/><small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".stringCfg" title="add"></span></small></h3>
<div class="row stringCfg collapse">
<h3 class="form-section">字符串<spring:message code="block_config"/><!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".stringCfg" title="add"></span></small> --></h3>
<div class="row stringCfg">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
@@ -15,7 +15,6 @@
</c:when>
</c:choose>
</div>
<div for="cfgDesc"></div>
</div>
</div>
<div class="col-md-6">
@@ -31,11 +30,18 @@
</c:when>
</c:choose>
</div>
<div for="cfgKeywords"></div>
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<div for="stringCfg[${mainTable}].cfgKeywords"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<div for="stringCfg[${otherTable.tableName}].cfgKeywords"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
<div class="row stringCfg collapse">
<div class="row stringCfg">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="expression_type"/></label>
@@ -66,9 +72,15 @@
</label>
</c:when>
</c:choose>
</div>
<div for="exprType"></div>
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<div for="stringCfg[${mainTable}].exprType"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<div for="stringCfg[${otherTable.tableName}].exprType"></div>
</c:when>
</c:choose>
</div>
</div>
<div class="col-md-6">
@@ -96,11 +108,18 @@
</c:when>
</c:choose>
</div>
<div for="matchMethod"></div>
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<div for="stringCfg[${mainTable}].matchMethod"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<div for="stringCfg[${otherTable.tableName}].matchMethod"></div>
</c:when>
</c:choose>
</div>
</div>
</div>
<div class="row stringCfg collapse">
<div class="row stringCfg">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="whether_hexbinary"/></label>
@@ -124,7 +143,14 @@
</c:when>
</c:choose>
</div>
<div for="isHexbin"></div>
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<div for="stringCfg[${mainTable}].isHexbin"></div>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<div for="stringCfg[${otherTable.tableName}].isHexbin"></div>
</c:when>
</c:choose>
</div>
</div>
<c:choose>

View File

@@ -43,7 +43,7 @@
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-validation/1.11.0/jquery.validate.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-validation/1.14.0/jquery.validate.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-jbox/2.3/jquery.jBox-2.3.src.js" type="text/javascript"></script>