提交日志总量获取,由于目前接口不可用,所以后台直接造的数据。超时直接显示超时
This commit is contained in:
@@ -9,8 +9,11 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -38,7 +41,8 @@ import com.nis.web.controller.BaseController;
|
||||
public class NtcPzReportController extends BaseController{
|
||||
@RequestMapping(value="ajaxGetLogTotal",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,Integer compileId){
|
||||
public Map<String, Object> ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,Integer compileId){
|
||||
Map<String, Object> data=new HashMap<String, Object>();
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
int interval=Constants.LOG_TIME_RANGE;
|
||||
Date endDate=new Date(endTime);
|
||||
@@ -51,10 +55,18 @@ public class NtcPzReportController extends BaseController{
|
||||
break;
|
||||
}
|
||||
}
|
||||
ReportResultLog result=ConfigServiceUtil.getReport(Constants.BUSINESSTYPE_CONFIG, String.valueOf(compileId), String.valueOf(serviceId), sdf.format(startDate), sdf.format(endDate));
|
||||
if(result.getData()!=null&&result.getData().getList()!=null){
|
||||
model.addAttribute("data", result.getData().getList());
|
||||
}
|
||||
return "success";
|
||||
// ReportResultLog result=ConfigServiceUtil.getReport(Constants.BUSINESSTYPE_CONFIG, String.valueOf(compileId), String.valueOf(serviceId), sdf.format(startDate), sdf.format(endDate));
|
||||
// if(result.getData()!=null&&result.getData().getList()!=null){
|
||||
// model.addAttribute("data", result.getData().getList());
|
||||
// }
|
||||
data.put("compileId", compileId.intValue());
|
||||
data.put("sum", 1000l);
|
||||
// try {
|
||||
// Thread.sleep(10000);
|
||||
// } catch (InterruptedException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
data.compileId=$(this).attr("compileId");
|
||||
data.action=$(this).attr("action");
|
||||
data.functionId=$(this).attr("functionId");
|
||||
data.obj=$(this)
|
||||
GetLogTotal('${ctx}',data);
|
||||
});
|
||||
//$("#loadingModal").modal("show");
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
over4: "6over4",
|
||||
all: "all",
|
||||
ip_subnet: "Subnet",
|
||||
ip_range: "ip Range"
|
||||
ip_range: "ip Range",
|
||||
timeout:"timeout"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
over4: "6over4",
|
||||
all: "all",
|
||||
ip_subnet: "Subnet",
|
||||
ip_range: "ip Range"
|
||||
ip_range: "ip Range",
|
||||
timeout:"timeout"
|
||||
});
|
||||
}(jQuery));
|
||||
@@ -49,6 +49,7 @@
|
||||
all: "全部",
|
||||
ip_subnet: "Subnet",
|
||||
ip_subnet: "Subnet",
|
||||
ip_range: "ip Range"
|
||||
ip_range: "ip Range",
|
||||
timeout:"超时"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -619,31 +619,34 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){
|
||||
}
|
||||
|
||||
var GetLogTotal=function(path,data){
|
||||
console.log(data);
|
||||
var timeStamp=0;
|
||||
if(data.date){
|
||||
timeStamp=data.date.valueOf();
|
||||
}else{
|
||||
timeStamp=(new Date()).valueOf();
|
||||
}
|
||||
$.ajax({
|
||||
var totalTr=$(data.obj);
|
||||
var timeout=$.validator.messages.timeout;
|
||||
var request=$.ajax({
|
||||
type:'post',
|
||||
timeout:10000,//超时时间设置,查询接口时间过长超时
|
||||
timeout:1000,//超时时间设置,查询接口时间过长超时
|
||||
url:path+'/logs/ajaxGetLogTotal',
|
||||
data:{"endTime":timeStamp,"action":data.action,"functionId":data.functionId,"compileId":data.compileId},
|
||||
dataType:'json',
|
||||
async:true,
|
||||
success:function(data,textStatus){//处理返回结果
|
||||
if(textStatus=="success"){
|
||||
totalTr.html(data.sum);
|
||||
}
|
||||
},
|
||||
complete:function(XMLHttpRequest,status){//超时设置
|
||||
if(status=="timeout"){
|
||||
GetLogTotal.about();
|
||||
totalTr.html(timeout);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//删除区域IP
|
||||
function delAreaIp(obj){
|
||||
var thisObj=$(obj);
|
||||
|
||||
Reference in New Issue
Block a user