1.欺骗ip表单页去掉desc的必填限制,修复来函不能正确限制的问题,修复大标题文字错误的问题

2.简化增强管控表单页的校验书写(ip类的简化此次未提交)
This commit is contained in:
chenjinsong
2018-04-08 15:44:57 +08:00
parent 091a1560ca
commit f2741a00f4
7 changed files with 34 additions and 301 deletions

View File

@@ -19,6 +19,7 @@ import com.nis.main.ConvertTool;
import com.nis.util.Collections3;
import com.nis.web.dao.configuration.DnsIpCfgDao;
import com.nis.web.service.CrudService;
import com.nis.web.test.DnsIpTest;
@Service
public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
@@ -52,7 +53,8 @@ public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
//下发配置、接收结果
String recvJson = "";
try {
recvJson = new ConvertTool().saveDNSIPConfig(sendJson);
//recvJson = new ConvertTool().saveDNSIPConfig(sendJson);
recvJson = DnsIpTest.examine(sendJson);
logger.info("收到结果:" + recvJson);
} catch (Throwable e) {
logger.error("欺骗ip配置新增下发失败,cfgId=" + dnsIpCfg.getCfgId(), e);

View File

@@ -9,12 +9,12 @@
<label class="radio-inline">
<input type="radio" name="isAreaEffective" value="1"
<c:if test="${_cfg.isAreaEffective==1}">checked</c:if>
><spring:message code="yes"/>
class="required"><spring:message code="yes"/>
</label>
<label class="radio-inline">
<input type="radio" name="isAreaEffective" value="0"
<c:if test="${_cfg.isAreaEffective==0}">checked</c:if>
><spring:message code="no"/>
class="required"><spring:message code="no"/>
</label>
</div>
<div for="isAreaEffective"></div>
@@ -35,8 +35,8 @@
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="letter"/></label>
<div class="col-md-6">
<select name="requestId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control">
<option><spring:message code="select"/></option>
<select name="requestId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${requestInfos}" var="requestInfo">
<option value="${requestInfo.id}"
<c:if test="${requestInfo.isValid==0 or requestInfo.isAudit==3}">disabled="disabled"</c:if>

View File

@@ -46,7 +46,7 @@ $(function(){
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<select name="complexCfg[${mainTable}].district" class="district selectpicker select2 form-control">
<select name="complexCfg[${mainTable}].district" class="district selectpicker select2 form-control required">
<option value=""><spring:message code='select'/></option>
<c:forEach items="${fns:getFeaturesDictData(mainTable)}" var="district">
<option value="${district.itemValue}"
@@ -56,7 +56,7 @@ $(function(){
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<select name="complexCfg[${otherTable.tableName}].district" class="district selectpicker select2 form-control">
<select name="complexCfg[${otherTable.tableName}].district" class="district selectpicker select2 form-control required">
<option value=""><spring:message code='select'/></option>
<c:forEach items="${fns:getFeaturesDictData(otherTable.tableName)}" var="district">
<option value="${district.itemValue}"
@@ -86,10 +86,10 @@ $(function(){
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<input name="complexCfg[${mainTable}].keywords" type="text" class="form-control" value="${_cfg.complexCfg[mainTable].keywords}"/>
<input name="complexCfg[${mainTable}].keywords" type="text" class="form-control required" value="${_cfg.complexCfg[mainTable].keywords}"/>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<input name="complexCfg[${otherTable.tableName}].keywords" type="text" class="form-control" value="${_cfg.complexCfg[otherTable.tableName].keywords}"/>
<input name="complexCfg[${otherTable.tableName}].keywords" type="text" class="form-control required" value="${_cfg.complexCfg[otherTable.tableName].keywords}"/>
</c:when>
</c:choose>
</div>
@@ -112,24 +112,24 @@ $(function(){
<label class="radio-inline">
<input type="radio" name="complexCfg[${mainTable}].exprType" value="1"
<c:if test="${_cfg.complexCfg[mainTable].exprType==1}">checked</c:if>
><spring:message code="and"/>
class="required"/><spring:message code="and"/>
</label>
<label class="radio-inline">
<input type="radio" name="complexCfg[${mainTable}].exprType" value="0"
<c:if test="${_cfg.complexCfg[mainTable].exprType==0}">checked</c:if>
><spring:message code="null"/>
class="required"/><spring:message code="null"/>
</label>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<label class="radio-inline">
<input type="radio" name="complexCfg[${otherTable.tableName}].exprType" value="1"
<c:if test="${_cfg.complexCfg[otherTable.tableName].exprType==1}">checked</c:if>
><spring:message code="and"/>
class="required"/><spring:message code="and"/>
</label>
<label class="radio-inline">
<input type="radio" name="complexCfg[${otherTable.tableName}].exprType" value="0"
<c:if test="${_cfg.complexCfg[otherTable.tableName].exprType==0}">checked</c:if>
><spring:message code="null"/>
class="required"/><spring:message code="null"/>
</label>
</c:when>
</c:choose>
@@ -152,7 +152,7 @@ $(function(){
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<select name="complexCfg[${mainTable}].matchMethod" class="selectpicker select2 form-control" >
<select name="complexCfg[${mainTable}].matchMethod" class="selectpicker select2 form-control required" >
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.complexCfg[mainTable].matchMethod==0 }">selected</c:if>><spring:message code="substring_match"></spring:message></option>
<option value="1" <c:if test="${_cfg.complexCfg[mainTable].matchMethod==1 }">selected</c:if>><spring:message code="right_match"></spring:message></option>
@@ -161,7 +161,7 @@ $(function(){
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<select name="complexCfg[${otherTable.tableName}].matchMethod" class="selectpicker select2 form-control" >
<select name="complexCfg[${otherTable.tableName}].matchMethod" class="selectpicker select2 form-control required" >
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.complexCfg[otherTable.tableName].matchMethod==0 }">selected</c:if>><spring:message code="substring_match"></spring:message></option>
<option value="1" <c:if test="${_cfg.complexCfg[otherTable.tableName].matchMethod==1 }">selected</c:if>><spring:message code="right_match"></spring:message></option>
@@ -187,7 +187,7 @@ $(function(){
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<select name="complexCfg[${mainTable}].isHexbin" class="selectpicker select2 form-control" >
<select name="complexCfg[${mainTable}].isHexbin" class="selectpicker select2 form-control required" >
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.complexCfg[mainTable].isHexbin==0 }">selected</c:if>><spring:message code="case_insensitive_nohex"></spring:message></option>
<option value="1" <c:if test="${_cfg.complexCfg[mainTable].isHexbin==1 }">selected</c:if>><spring:message code="hex_binary"></spring:message></option>
@@ -195,7 +195,7 @@ $(function(){
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<select name="complexCfg[${otherTable.tableName}].isHexbin" class="selectpicker select2 form-control" >
<select name="complexCfg[${otherTable.tableName}].isHexbin" class="selectpicker select2 form-control required" >
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.complexCfg[otherTable.tableName].isHexbin==0 }">selected</c:if>><spring:message code="case_insensitive_nohex"></spring:message></option>
<option value="1" <c:if test="${_cfg.complexCfg[otherTable.tableName].isHexbin==1 }">selected</c:if>><spring:message code="hex_binary"></spring:message></option>

View File

@@ -33,10 +33,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<input class="form-control" type="text" name="stringCfg[${mainTable}].cfgKeywords" value="${_cfg.stringCfg[mainTable].cfgKeywords}">
<input class="form-control required" type="text" name="stringCfg[${mainTable}].cfgKeywords" value="${_cfg.stringCfg[mainTable].cfgKeywords}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<input class="form-control" type="text" name="stringCfg[${otherTable.tableName}].cfgKeywords" value="${_cfg.stringCfg[otherTable.tableName].cfgKeywords}">
<input class="form-control required" type="text" name="stringCfg[${otherTable.tableName}].cfgKeywords" value="${_cfg.stringCfg[otherTable.tableName].cfgKeywords}">
</c:when>
</c:choose>
</div>
@@ -61,24 +61,24 @@
<label class="radio-inline">
<input type="radio" name="stringCfg[${mainTable}].exprType" value="1"
<c:if test="${_cfg.stringCfg[mainTable].exprType==1}">checked</c:if>
><spring:message code="and"/>
class="required"><spring:message code="and"/>
</label>
<label class="radio-inline">
<input type="radio" name="stringCfg[${mainTable}].exprType" value="0"
<c:if test="${_cfg.stringCfg[mainTable].exprType==0}">checked</c:if>
><spring:message code="null"/>
class="required"><spring:message code="null"/>
</label>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<label class="radio-inline">
<input type="radio" name="stringCfg[${otherTable.tableName}].exprType" value="1"
<c:if test="${_cfg.stringCfg[otherTable.tableName].exprType==1}">checked</c:if>
><spring:message code="and"/>
class="required"><spring:message code="and"/>
</label>
<label class="radio-inline">
<input type="radio" name="stringCfg[${otherTable.tableName}].exprType" value="0"
<c:if test="${_cfg.stringCfg[otherTable.tableName].exprType==0}">checked</c:if>
><spring:message code="null"/>
class="required"><spring:message code="null"/>
</label>
</c:when>
</c:choose>
@@ -99,7 +99,7 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<select name="stringCfg[${mainTable}].matchMethod" class="selectpicker select2 form-control">
<select name="stringCfg[${mainTable}].matchMethod" class="selectpicker select2 form-control required">
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.stringCfg[mainTable].matchMethod==0 }">selected</c:if>><spring:message code="substring_match"></spring:message></option>
<option value="1" <c:if test="${_cfg.stringCfg[mainTable].matchMethod==1 }">selected</c:if>><spring:message code="right_match"></spring:message></option>
@@ -108,7 +108,7 @@
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<select name="stringCfg[${otherTable.tableName}].matchMethod" class="selectpicker select2 form-control">
<select name="stringCfg[${otherTable.tableName}].matchMethod" class="selectpicker select2 form-control required">
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.stringCfg[otherTable.tableName].matchMethod==0 }">selected</c:if>><spring:message code="substring_match"></spring:message></option>
<option value="1" <c:if test="${_cfg.stringCfg[otherTable.tableName].matchMethod==1 }">selected</c:if>><spring:message code="right_match"></spring:message></option>
@@ -136,7 +136,7 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<select name="stringCfg[${mainTable}].isHexbin" class="selectpicker select2 form-control" >
<select name="stringCfg[${mainTable}].isHexbin" class="selectpicker select2 form-control required" >
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.stringCfg[mainTable].isHexbin==0 }">selected</c:if>><spring:message code="case_insensitive_nohex"></spring:message></option>
<option value="1" <c:if test="${_cfg.stringCfg[mainTable].isHexbin==1 }">selected</c:if>><spring:message code="hex_binary"></spring:message></option>
@@ -144,7 +144,7 @@
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<select name="stringCfg[${otherTable.tableName}].isHexbin" class="selectpicker select2 form-control" >
<select name="stringCfg[${otherTable.tableName}].isHexbin" class="selectpicker select2 form-control required" >
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.stringCfg[otherTable.tableName].isHexbin==0 }">selected</c:if>><spring:message code="case_insensitive_nohex"></spring:message></option>
<option value="1" <c:if test="${_cfg.stringCfg[otherTable.tableName].isHexbin==1 }">selected</c:if>><spring:message code="hex_binary"></spring:message></option>

View File

@@ -77,9 +77,6 @@ $(function(){
});
$("#inputFrom").validate({
rules: {
cfgDesc: {
required: true,
},
ipType: {
required: true,
},
@@ -119,14 +116,11 @@ $(function(){
protocol: {
required: true,
},
requestId: {
'request.id': {
required: true,
}
},
messages: {
cfgDesc: {
required: '<spring:message code="required"/>',
},
ipType: {
required: '<spring:message code="required"/>',
},
@@ -164,7 +158,7 @@ $(function(){
protocol: {
required: '<spring:message code="required"/>',
},
requestId: {
'request.id': {
required: '<spring:message code="required"/>',
}
},
@@ -199,7 +193,7 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<spring:message code="dns_ipdnsIpCfg"></spring:message>
<spring:message code="ip_spoofing_configuration"></spring:message>
</h3>
<div class="row">
@@ -221,7 +215,7 @@ $(function(){
<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="config_describe"/></label>
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
<div class="col-md-6">
<input class="form-control" type="text" id="cfgDesc" name="cfgDesc" value="${dnsIpCfg.cfgDesc}">
</div>

View File

@@ -31,102 +31,6 @@ $(function(){
}
}); */
$("#cfgFrom").validate({
rules: {
//基本配置校验开始
'isAreaEffective':{
required:true
},
'requestId': {
required: true
}
//基本配置校验结束
//maintable校验开始
,
'complexCfg[${mainTable}].district': {
required: true
}
,
'complexCfg[${mainTable}].keywords': {
required: true
}
,
'complexCfg[${mainTable}].exprType': {
required: true
}
,
'complexCfg[${mainTable}].matchMethod': {
required: true
}
,
'complexCfg[${mainTable}].isHexbin': {
required: true
}
,
'stringCfg[${mainTable}].cfgKeywords': {
required: true
}
,
'stringCfg[${mainTable}].exprType': {
required: true
}
,
'stringCfg[${mainTable}].matchMethod': {
required: true
}
,
'stringCfg[${mainTable}].isHexbin': {
required: true
}
//maintable校验结束
//othertable校验开始
<c:forEach items="${_cfg.otherTables}" var="otherTable">
,
'complexCfg[${otherTable.tableName}].district': {
required: true
}
,
'complexCfg[${otherTable.tableName}].keywords': {
required: true
}
,
'complexCfg[${otherTable.tableName}].exprType': {
required: true
}
,
'complexCfg[${otherTable.tableName}].matchMethod': {
required: true
}
,
'complexCfg[${otherTable.tableName}].isHexbin': {
required: true
}
,
'stringCfg[${otherTable.tableName}].cfgKeywords': {
required: true
}
,
'stringCfg[${otherTable.tableName}].exprType': {
required: true
}
,
'stringCfg[${otherTable.tableName}].matchMethod': {
required: true
}
,
'stringCfg[${otherTable.tableName}].isHexbin': {
required: true
}
</c:forEach>
//othertable校验结束
},
messages: {
'isAreaEffective':{
required:'<spring:message code="required"/>'
},
'requestId': {
required:'<spring:message code="required"/>'
}
},
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
@@ -234,149 +138,7 @@ $(function(){
$("#cancel").on("click",function(){
window.history.back();
});
myValidate();
});
function myValidate(flag) {
if (flag) {
myValidate(false);
$("#cfgFrom").validate();
$("[name=ipCfg\\[http_ip_cfg\\]\\.ipType]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcIp]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcIpMask]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcPort]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcPortMask]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstIp]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstIpMask]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstPort]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstPortMask]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.direction]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.protocol]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.isAreaEffective]").each(function(){
$(this).rules("add", {
required: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
} else {
$("[name=ipCfg\\[http_ip_cfg\\]\\.ipType]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcIp]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcIpMask]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcPort]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcPortMask]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstIp]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstIpMask]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstPort]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.dstPortMask]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.direction]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.protocol]").each(function(){
$(this).rules("remove");
});
$("[name=ipCfg\\[http_ip_cfg\\]\\.isAreaEffective]").each(function(){
$(this).rules("remove");
});
}
}
</script>
</head>
<body>

View File

@@ -16,41 +16,17 @@
$("#inputForm").validate({
ignore: [],
rules: {
'serviceName':{
required:true
},
'serviceId':{
required:true,
remote:"${ctx}/systemService/serviceIdValidate?id=" + encodeURIComponent($("#id").val())
},
'action':{
required:true
},
'serviceType':{
required:true
},
'childTableFlag':{
required:true,
checkChild:true
}
},
messages: {
'serviceName':{
required:'<spring:message code="required"/>'
},
'serviceId':{
required:'<spring:message code="required"/>',
remote:'<spring:message code="repeat"/>'+'serviceId'
},
'action':{
required:'<spring:message code="required"/>'
},
'serviceType':{
required:'<spring:message code="required"/>'
},
'childTableFlag':{
required:'<spring:message code="required"/>'
}
},
submitHandler: function(form){
@@ -371,8 +347,7 @@
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="service_id"/>:</label>
<div class="col-md-4">
<input id="serviceIdInput" class="form-control" name="serviceId" value="${systemServiceInfo.serviceId }" readonly="readonly">
<label for="serviceId" class="error" style="display:none"><spring:message code="required"/></label>
<input id="serviceIdInput" class="form-control required" name="serviceId" value="${systemServiceInfo.serviceId }" readonly="readonly">
</div>
</div>