融合代码,提交到本地

Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

Conflicts:
	src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js
	src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js
This commit is contained in:
zhangshilin
2018-04-08 17:52:28 +08:00
12 changed files with 397 additions and 312 deletions

View File

@@ -36,14 +36,14 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<select name="ipCfg[${mainTable}].ipType" class="ipType selectpicker show-tick form-control">
<select name="ipCfg[${mainTable}].ipType" class="ipType selectpicker show-tick form-control required">
<option value="" ><spring:message code="select"/></option>
<option value="4" <c:if test="${_cfg.ipCfg[mainTable].ipType==4}">selected</c:if> >V4</option>
<option value="6" <c:if test="${_cfg.ipCfg[mainTable].ipType==6}">selected</c:if>>V6</option>
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<select name="ipCfg[${otherTable.tableName}].ipType" class="ipType selectpicker show-tick form-control" title=<spring:message code="select"/>>
<select name="ipCfg[${otherTable.tableName}].ipType" class="ipType selectpicker show-tick form-control required" title=<spring:message code="select"/>>
<option value="" ><spring:message code="select"/></option>
<option value="4" <c:if test="${_cfg.ipCfg[otherTable.tableName].ipType==4}">selected</c:if> >V4</option>
<option value="6" <c:if test="${_cfg.ipCfg[otherTable.tableName].ipType==6}">selected</c:if>>V6</option>
@@ -69,10 +69,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].srcIp" value="${_cfg.ipCfg[mainTable].srcIp}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].srcIp" value="${_cfg.ipCfg[mainTable].srcIp}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].srcIp" value="${_cfg.ipCfg[otherTable.tableName].srcIp}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].srcIp" value="${_cfg.ipCfg[otherTable.tableName].srcIp}">
</c:when>
</c:choose>
</div>
@@ -92,10 +92,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].srcIpMask" value="${_cfg.ipCfg[mainTable].srcIpMask}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].srcIpMask" value="${_cfg.ipCfg[mainTable].srcIpMask}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].srcIpMask" value="${_cfg.ipCfg[otherTable.tableName].srcIpMask}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].srcIpMask" value="${_cfg.ipCfg[otherTable.tableName].srcIpMask}">
</c:when>
</c:choose>
</div>
@@ -118,10 +118,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].srcPort" value="${_cfg.ipCfg[mainTable].srcPort}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].srcPort" value="${_cfg.ipCfg[mainTable].srcPort}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].srcPort" value="${_cfg.ipCfg[otherTable.tableName].srcPort}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].srcPort" value="${_cfg.ipCfg[otherTable.tableName].srcPort}">
</c:when>
</c:choose>
</div>
@@ -141,10 +141,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].srcPortMask" value="${_cfg.ipCfg[mainTable].srcPortMask}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].srcPortMask" value="${_cfg.ipCfg[mainTable].srcPortMask}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].srcPortMask" value="${_cfg.ipCfg[otherTable.tableName].srcPortMask}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].srcPortMask" value="${_cfg.ipCfg[otherTable.tableName].srcPortMask}">
</c:when>
</c:choose>
</div>
@@ -166,10 +166,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].dstIp" value="${_cfg.ipCfg[mainTable].dstIp}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].dstIp" value="${_cfg.ipCfg[mainTable].dstIp}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].dstIp" value="${_cfg.ipCfg[otherTable.tableName].dstIp}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].dstIp" value="${_cfg.ipCfg[otherTable.tableName].dstIp}">
</c:when>
</c:choose>
</div>
@@ -189,10 +189,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].dstIpMask" value="${_cfg.ipCfg[mainTable].dstIpMask}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].dstIpMask" value="${_cfg.ipCfg[mainTable].dstIpMask}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].dstIpMask" value="${_cfg.ipCfg[otherTable.tableName].dstIpMask}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].dstIpMask" value="${_cfg.ipCfg[otherTable.tableName].dstIpMask}">
</c:when>
</c:choose>
</div>
@@ -214,10 +214,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].dstPort" value="${_cfg.ipCfg[mainTable].dstPort}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].dstPort" value="${_cfg.ipCfg[mainTable].dstPort}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].dstPort" value="${_cfg.ipCfg[otherTable.tableName].dstPort}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].dstPort" value="${_cfg.ipCfg[otherTable.tableName].dstPort}">
</c:when>
</c:choose>
</div>
@@ -237,10 +237,10 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<input class="form-control" type="text" name="ipCfg[${mainTable}].dstPortMask" value="${_cfg.ipCfg[mainTable].dstPortMask}">
<input class="form-control required" type="text" name="ipCfg[${mainTable}].dstPortMask" value="${_cfg.ipCfg[mainTable].dstPortMask}">
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<input class="form-control" type="text" name="ipCfg[${otherTable.tableName}].dstPortMask" value="${_cfg.ipCfg[otherTable.tableName].dstPortMask}">
<input class="form-control required" type="text" name="ipCfg[${otherTable.tableName}].dstPortMask" value="${_cfg.ipCfg[otherTable.tableName].dstPortMask}">
</c:when>
</c:choose>
</div>
@@ -262,14 +262,14 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<select name="ipCfg[${mainTable}].direction" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<select name="ipCfg[${mainTable}].direction" class="selectpicker show-tick form-control required" title=<spring:message code="select"/>>
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.ipCfg[mainTable].direction==0}">selected</c:if>>0</option>
<option value="1" <c:if test="${_cfg.ipCfg[mainTable].direction==1}">selected</c:if>>1</option>
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<select name="ipCfg[${otherTable.tableName}].direction" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<select name="ipCfg[${otherTable.tableName}].direction" class="selectpicker show-tick form-control required" title=<spring:message code="select"/>>
<option value="" ><spring:message code="select"/></option>
<option value="0" <c:if test="${_cfg.ipCfg[otherTable.tableName].direction==0}">selected</c:if>>0</option>
<option value="1" <c:if test="${_cfg.ipCfg[otherTable.tableName].direction==1}">selected</c:if>>1</option>
@@ -294,7 +294,7 @@
<div class="col-md-6">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<select name="ipCfg[${mainTable}].protocol" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<select name="ipCfg[${mainTable}].protocol" class="selectpicker show-tick form-control" required title=<spring:message code="select"/>>
<option value=""><spring:message code="select"/></option>
<option value="6" <c:if test="${_cfg.ipCfg[mainTable].protocol==6}">selected</c:if>>TCP</option>
<option value="17" <c:if test="${_cfg.ipCfg[mainTable].protocol==17}">selected</c:if>>UDP</option>
@@ -302,7 +302,7 @@
</select>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<select name="ipCfg[${otherTable.tableName}].protocol" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<select name="ipCfg[${otherTable.tableName}].protocol" class="selectpicker show-tick form-control required" title=<spring:message code="select"/>>
<option value="" ><spring:message code="select"/></option>
<option value="6" <c:if test="${_cfg.ipCfg[otherTable.tableName].protocol==6}">selected</c:if>>TCP</option>
<option value="17" <c:if test="${_cfg.ipCfg[otherTable.tableName].protocol==17}">selected</c:if>>UDP</option>

View File

@@ -115,7 +115,12 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
if(v=="ok"){
window.location = url+"?ids="+ids;
if(url.indexOf("?")>0){
window.location = url+"&ids="+ids;
}else{
window.location = url+"?ids="+ids;
}
//$("#searchForm").submit();
}
},{buttonsFocus:1});

View File

@@ -24,6 +24,14 @@
$("#keywords").attr("value",'');
$("#searchForm")[0].reset();
});
//全选及取消
$("#checkAll").change(function(){
if($("#checkAll").prop("checked")){
$("input.i-checks").prop("checked",true);
}else{
$("input.i-checks").prop("checked",false);
}
});
});
//查询
function page(n,s){
@@ -32,6 +40,24 @@
$("#searchForm").submit();
return false;
}
//修改配置
function updateCfg(){
var cked = $('tbody tr td input.i-checks:checkbox:checked');
if(cked.val()==1){
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
return;
}else if(cked.val()==3){
top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
return;
}
if(cked.length==1){
window.location = "${ctx}/cfg/app/updateForm?serviceId="+$("#serviceId").val()+"&action="+
$("#action").val()+"&cfgId="+cked.attr("id")+"&cfgName="+$("#cfgName").val();
}else{
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
return;
}
}
</script>
</head>
<body>
@@ -114,6 +140,41 @@
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<c:if test="${audit==0}">
<shiro:hasPermission name="cfg:edit">
<button type="button" class="btn btn-default" onclick="updateCfg()">
<i class="fa fa-edit"></i> <spring:message code="edit"/> </button>
</shiro:hasPermission>
<shiro:hasPermission name="cfg:delete">
<sys:delRow url="${ctx}/cfg/app/deleteCfg?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}" id="contentTable" label="delete"></sys:delRow>
<%-- <button type="button" class="btn btn-default" onclick="deleteCfg()">
<i class="fa fa-remove"></i> <spring:message code="delete"/> </button> --%>
</shiro:hasPermission>
</c:if>
<c:if test="${audit==1}">
<shiro:hasPermission name="cfg:audit">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/cfg/app/auditCfg?serviceId=${serviceId}&action=${action}&auditState=1&cfgName=${cfgName}" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/cfg/app/auditCfg?serviceId=${serviceId}&action=${action}&auditState=2&cfgName=${cfgName}" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/cfg/app/auditCfg?serviceId=${serviceId}&action=${action}&auditState=3&cfgName=${cfgName}" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
<%-- <shiro:hasPermission name="cfg:audit">
<button type="button" class="btn btn-default" onclick="auditCfg(1)">
<i class="fa fa-check"></i> <spring:message code="approved"/> </button>
<button type="button" class="btn btn-default" onclick="auditCfg(2)">
<i class="fa fa-remove"></i> <spring:message code="unapproved"/> </button>
<button type="button" class="btn btn-default" onclick="auditCfg(3)">
<i class="fa fa-undo"></i> <spring:message code="cancel"/> </button>
</shiro:hasPermission> --%>
</c:if>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
@@ -249,6 +310,7 @@
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th><spring:message code="config_describe"/></th>
<th><spring:message code="protocol_id"/></th>
<th><spring:message code="protocol_name"/></th>
@@ -278,6 +340,9 @@
<tbody>
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td>
<input type="checkbox" class="i-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appId }</td>
<td>${cfg.appName }</td>
@@ -364,7 +429,7 @@
<li><a href="${ctx}/cfg/app/updateForm?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
</shiro:hasPermission>
<shiro:hasPermission name="cfg:delete">
<li><a href="${ctx}/cfg/app/deleteCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
<li><a href="${ctx}/cfg/app/deleteCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&ids=${cfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</shiro:hasPermission>
</c:when>
</c:choose>
@@ -372,16 +437,16 @@
<c:if test="${audit==1}">
<c:choose>
<c:when test="${cfg.isAudit eq '1'}">
<shiro:hasPermission name="cfg:audit:cancel">
<li><a href="${ctx}/cfg/app/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&cfgId=${cfg.cfgId}&isAudit=3&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="cancel"></spring:message></a></li>
<shiro:hasPermission name="cfg:audit">
<li><a href="${ctx}/cfg/app/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&ids=${cfg.cfgId}&auditState=3&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="cancel"></spring:message></a></li>
</shiro:hasPermission>
</c:when>
<c:when test="${cfg.isAudit eq '0'}">
<shiro:hasPermission name="cfg:audit:valid">
<li><a href="${ctx}/cfg/app/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&cfgId=${cfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<shiro:hasPermission name="cfg:audit">
<li><a href="${ctx}/cfg/app/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&ids=${cfg.cfgId}&auditState=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
</shiro:hasPermission>
<shiro:hasPermission name="cfg:audit:invalid">
<li><a href="${ctx}/cfg/app/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&cfgId=${cfg.cfgId}&isAudit=2&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="unapproved"></spring:message></a></li>
<shiro:hasPermission name="cfg:audit">
<li><a href="${ctx}/cfg/app/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&compileId=${cfg.compileId}&ids=${cfg.cfgId}&auditState=2&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="unapproved"></spring:message></a></li>
</shiro:hasPermission>
</c:when>
</c:choose>

View File

@@ -182,8 +182,7 @@ $(function(){
checkIp = /\S+/;
}
return this.optional(element) || (checkIp.test(value) && (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256));
},
"请输入正确的IP!"
}
);
});
</script>

View File

@@ -40,6 +40,19 @@ $(function(){
errorContainer: "#messageBox"
});
$.validator.addMethod(
"checkIp",
function(value, element, params) {
var checkIp;
if ($("[name$=ipType]").val() == 4) {
checkIp = /((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))/;
} else {
checkIp = /\S+/;
}
return this.optional(element) || (checkIp.test(value) && (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256));
}
);
$("#ipSelect").change(function(){
if($(this).prop("checked")){
$("[name^='ipCfg']").removeProp("disabled");
@@ -56,6 +69,23 @@ $(function(){
$("[name^='ipCfg']").attr("disabled",true);
}
});
function myValidate(flag) {
if (flag) {
myValidate(false);
$("[name=ipCfg\\[http_ip_cfg\\]\\.srcIp]").each(function(){
$(this).rules("add", {
checkIp: true,
messages: {
required:'<spring:message code="required"/>'
}
});
});
} else {
}
}
$(".district").on("change",function(){
var text=$(this).find("option:selected").text().toLowerCase();
var other=$(this).parent("div").siblings(".otherValue");

View File

@@ -23,8 +23,8 @@
min: $.validator.format("Please enter a value greater than or equal to {0}."),
checkIp: $.validator.format("Please enter a correct IP address."),
noBlankSpace:"can not be space",
ipCheck:"Please enter a valid ip",
ipMask:"Please enter a valid ip mask",
ipCheck:"Please enter a correct IP address",
ipMask:"Please enter a correct IP mask",
notStartZero:"Please enter a valid Integer"
});
}(jQuery));

View File

@@ -20,6 +20,7 @@
rangelength: $.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."),
range: $.validator.format("Пожалуйста, введите число от {0} до {1}."),
max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."),
min: $.validator.format("Пожалуйста, введите число, большее или равное {0}.")
min: $.validator.format("Пожалуйста, введите число, большее или равное {0}."),
min: $.validator.format(" Пожалуйста, введите  правильный  IP - адрес.")
});
}(jQuery));

View File

@@ -20,6 +20,7 @@
rangelength: $.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),
range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
max: $.validator.format("请输入一个最大为 {0} 的值"),
min: $.validator.format("请输入一个最小为 {0} 的值"),
checkIp: $.validator.format("请输入一个合法的IP"),
noBlankSpace:"不能为空格",

View File

@@ -2,29 +2,6 @@
sysDict serviceDict
***/
.search-lable {
margin-right: 3px;
margin-left: 5px;
}
.itemType {
margin-right: 5px;
}
#itemType {
margin-right: 5px;
}
.input-medium {
margin-left: 8px;
}
.input-medium {
width: 155px !important;
}
.Wdate {
border: #c2cad8 1px solid;
height: 26px;
}
.dropdown-menu {
min-width: 50px;
}