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:
@@ -65,6 +65,7 @@
|
||||
invisibleChar:"Please enter the visible character",
|
||||
hasInvisibleChar:"The tag {0} has invisible character",
|
||||
haveInvisibleChar:"The tags {0} have invisible character",
|
||||
httpCheck:"Please enter a correct url(http[s]://xxx.xx)"
|
||||
httpCheck:"Please enter a correct url(http[s]://xxx.xx)",
|
||||
failed:"Failed"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
invisibleChar:"请输入可见字符",
|
||||
hasInvisibleChar:"标签{0}包含不可见字符",
|
||||
haveInvisibleChar:"标签{0}包含不可见字符",
|
||||
httpCheck:"请输入正确的url(http[s]://xxx.xx)"
|
||||
httpCheck:"请输入正确的url(http[s]://xxx.xx)",
|
||||
failed:"获取失败"
|
||||
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
$(function(){
|
||||
//扩展jquery,增加全局函数
|
||||
$.ipcommon=function(){
|
||||
return {};
|
||||
}
|
||||
$.extend($.ipcommon, {
|
||||
ipType:[],
|
||||
ipPattern:[],
|
||||
portPattern:[],
|
||||
protocol:[],
|
||||
direction:[]
|
||||
|
||||
});
|
||||
$("select[name$='isHexbin']").each(function(){
|
||||
setIsHexBin(this);
|
||||
});
|
||||
@@ -16,9 +28,18 @@ $(function(){
|
||||
var text="";
|
||||
if($(element).find(".tooltips").length > 0){
|
||||
text=$(element).find(".tooltips").attr("data-original-title").trim();
|
||||
|
||||
}else{
|
||||
text=$(element).text().trim()
|
||||
}
|
||||
//增加换行
|
||||
var count = Math.floor(text.length/34);
|
||||
for(var i=1;i<=count;i++){
|
||||
text=text.substring(0,i*34-1)+"\n"+text.substring(i*34-1);
|
||||
}
|
||||
//特殊字符转义
|
||||
text=text.replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];});
|
||||
|
||||
html+="<div class='row col-md-12'>";
|
||||
html+="<div class='col-md-4'><label>"+$(".table tr th").eq(index).text().trim()+":</label></div>";
|
||||
html+="<div class='col-md-6'><label>"+text+"</label></div>";
|
||||
@@ -336,28 +357,8 @@ $(function(){
|
||||
$("input[name$='exprType']:checked").each(function(){
|
||||
setDefaultMatchMethod(this);
|
||||
});
|
||||
/*
|
||||
*配置展示日志总数,审核通过才会调用接口查询日志总量
|
||||
必须放在是否审核一列之后
|
||||
并且是否审核一列的span标签需配置data-audit="xxxx"属性
|
||||
xxxx可用值为created,approved,unapproved,cancel
|
||||
td需要配置属性有,functionId,compileId,action
|
||||
*/
|
||||
$("td[compileId]").each(function(){
|
||||
var audit=$(this).prev().find("span").data("audit");
|
||||
if(audit == "approved"){
|
||||
var data={};
|
||||
data.date=new Date();
|
||||
data.compileId=$(this).attr("compileId");
|
||||
data.action=$(this).attr("action");
|
||||
data.functionId=$(this).attr("functionId");
|
||||
data.audit=$(this).attr("audit");
|
||||
data.obj=$(this)
|
||||
GetLogTotal(data);
|
||||
}else{
|
||||
$(this).html("0");
|
||||
}
|
||||
});
|
||||
//获取配置日志总数
|
||||
getTotalLog();
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
@@ -418,7 +419,7 @@ $(function(){
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('<spring:message code="onloading"/>');
|
||||
loading('onloading');
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
@@ -435,7 +436,31 @@ $(function(){
|
||||
initCommIpVal();
|
||||
});
|
||||
window.onload=function(){
|
||||
//日志查询IP类型增加格式提示
|
||||
// 配置id的搜索下拉框选择切换
|
||||
if ($("#searchForm #seltype").val() == 'compileId') {
|
||||
$("#searchForm #intype").addClass("number");
|
||||
} else {
|
||||
$("#searchForm #intype").removeClass("number");
|
||||
}
|
||||
// reset时去掉number
|
||||
$("#resetBtn").on("click", function() {
|
||||
if ($("#searchForm #seltype").val() == 'compileId') {
|
||||
$("#searchForm #intype").addClass("number");
|
||||
} else {
|
||||
$("#searchForm #intype").removeClass("number");
|
||||
}
|
||||
});
|
||||
// 切换时为compileId加上number
|
||||
$("#searchForm #seltype").on("change", function() {
|
||||
if ($("#searchForm #seltype").val() == 'compileId') {
|
||||
$("#searchForm #intype").addClass("number");
|
||||
} else {
|
||||
$("#searchForm #intype").removeClass("number");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 日志查询IP类型增加格式提示
|
||||
$("#searchForm [name='capIp']").attr("placeholder","IPv4 0.0.0.0 or IPv6 ::");
|
||||
$("#searchForm [name='sIp']").attr("placeholder","IPv4 0.0.0.0 or IPv6 ::");
|
||||
$("#searchForm [name='dIp']").attr("placeholder","IPv4 0.0.0.0 or IPv6 ::");
|
||||
@@ -684,8 +709,12 @@ var switchAction=function(action){
|
||||
$(".doLog").addClass("hidden");
|
||||
$("input[name=doLog][value=0]").prop("checked",true);
|
||||
}else{
|
||||
$(".doLog").removeClass("hidden");
|
||||
$("input[name=doLog][value=2]").prop("checked",true);
|
||||
//如果表单非修改时,选中默认值
|
||||
if(!$("input[name='compileId']").val()){
|
||||
$(".doLog").removeClass("hidden");
|
||||
$("input[name=doLog][value=2]").prop("checked",true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//ipType、ipPattern、portPattern选项变化时调用此方法,添加默认值
|
||||
@@ -1116,32 +1145,84 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
var GetLogTotal=function(data){
|
||||
var getTotalLog=function(){
|
||||
/*
|
||||
td需要配置属性有,audit,functionId,compileId,action
|
||||
*/
|
||||
var data={};
|
||||
data.date=new Date();
|
||||
data.compileIds=[];
|
||||
data.actions=[];
|
||||
data.objs=[];
|
||||
$("td[compileId]").each(function(){
|
||||
var audit=$(this).attr("audit");
|
||||
var compileId=$(this).attr("compileId");
|
||||
var action=$(this).attr("action");
|
||||
var functionId=$(this).attr("functionId");
|
||||
if(audit&&compileId&&action&&functionId){
|
||||
if(audit == 1){
|
||||
var has=false;
|
||||
for(var i=0;i<data.actions.length;i++){
|
||||
if(data.actions[i]==$(this).attr("action")){
|
||||
has=true;
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
data.actions.push($(this).attr("action"));
|
||||
}
|
||||
data.compileIds.push($(this).attr("compileId"));
|
||||
data.functionId=$(this).attr("functionId");
|
||||
data.objs.push($(this));
|
||||
}else{
|
||||
$(this).html("0");
|
||||
}
|
||||
}else{
|
||||
$(this).html("0");
|
||||
}
|
||||
});
|
||||
if(data.compileIds.length>0){
|
||||
GetLogTotal(data);
|
||||
}
|
||||
|
||||
}
|
||||
var GetLogTotal=function(_data){
|
||||
var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4);
|
||||
var timeStamp=0;
|
||||
if(data.date){
|
||||
timeStamp=data.date.valueOf();
|
||||
if(_data.date){
|
||||
timeStamp=_data.date.valueOf();
|
||||
}else{
|
||||
timeStamp=(new Date()).valueOf();
|
||||
}
|
||||
var totalTr=$(data.obj);
|
||||
var totalTrs=$(_data.objs);
|
||||
var timeout=$.validator.messages.timeout;
|
||||
var failed=$.validator.messages.failed;
|
||||
var request=$.ajax({
|
||||
type:'post',
|
||||
timeout:10000,//超时时间设置,查询接口时间过长超时
|
||||
url:pathName+'/report/ajaxGetLogTotal',
|
||||
data:{"endTime":timeStamp,"action":data.action,"functionId":data.functionId,"compileId":data.compileId},
|
||||
data:{"endTime":timeStamp,"actions":_data.actions.join(','),"functionId":_data.functionId,"compileIds":_data.compileIds.join(',')},
|
||||
dataType:'json',
|
||||
async:true,
|
||||
success:function(data,textStatus){//处理返回结果
|
||||
if(textStatus=="success"){
|
||||
totalTr.html(data.sum);
|
||||
totalTrs.each(function(){
|
||||
for(var i=0;i<data.length;i++){
|
||||
if($(this).attr("compileId")==data[i].compileId){
|
||||
$(this).html(data[i].sum);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
complete:function(XMLHttpRequest,status){//超时设置
|
||||
if(status=="timeout"){
|
||||
totalTr.html(timeout);
|
||||
totalTrs.each(function(){
|
||||
$(this).html(timeout);
|
||||
})
|
||||
}else if(status !="success"){
|
||||
totalTrs.each(function(){
|
||||
$(this).html(failed);
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1384,6 +1465,7 @@ var initCommIpVal=function(){
|
||||
//ip类型处理
|
||||
if(ipType){
|
||||
var arr=ipType.split(',');
|
||||
$.ipcommon.ipType=$("select[name$='ipPattern'] option");
|
||||
$("select[name$='ipType'] option").each(function(){
|
||||
var has=false;
|
||||
for(var type in arr){
|
||||
@@ -1396,13 +1478,14 @@ var initCommIpVal=function(){
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
$(this).attr("disabled",true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
//ip格式处理
|
||||
if(ipPattern){
|
||||
arr=ipPattern.split(',');
|
||||
$.ipcommon.ipPattern=$("select[name$='ipPattern'] option");
|
||||
$("select[name$='ipPattern'] option").each(function(){
|
||||
var has=false;
|
||||
for(var type in arr){
|
||||
@@ -1415,13 +1498,16 @@ var initCommIpVal=function(){
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
$(this).attr("disabled",true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.ipcommon.ipPattern=[];
|
||||
}
|
||||
//端口格式处理
|
||||
if(portPattern){
|
||||
arr=portPattern.split(',');
|
||||
$.ipcommon.portPattern=$("select[name$='portPattern'] option");
|
||||
$("select[name$='portPattern'] option").each(function(){
|
||||
var has=false;
|
||||
for(var type in arr){
|
||||
@@ -1434,13 +1520,16 @@ var initCommIpVal=function(){
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
$(this).attr("disabled",true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.ipcommon.portPattern=[];
|
||||
}
|
||||
//方向处理
|
||||
if(direction){
|
||||
arr=direction.split(',');
|
||||
$.ipcommon.direction=$("select[name$='direction'] option");
|
||||
$("select[name$='direction'] option").each(function(){
|
||||
var has=false;
|
||||
for(var type in arr){
|
||||
@@ -1453,13 +1542,16 @@ var initCommIpVal=function(){
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
$(this).attr("disabled",true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.ipcommon.direction=[];
|
||||
}
|
||||
//协议处理
|
||||
if(protocol){
|
||||
arr=protocol.split(',');
|
||||
$.ipcommon.protocol=$("select[name$='protocol'] option");
|
||||
$("select[name$='protocol'] option").each(function(){
|
||||
var has=false;
|
||||
for(var type in arr){
|
||||
@@ -1472,8 +1564,10 @@ var initCommIpVal=function(){
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
$(this).attr("disabled",true);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.ipcommon.protocol=[];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user