diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java index 7a229f3e4..18e501f2b 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcPzReportController.java @@ -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 ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,Integer compileId){ + Map data=new HashMap(); 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; } } diff --git a/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp b/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp index 19caabe1e..9bef658a1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp @@ -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"); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index ed4f8afb8..609ba9ff9 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -47,6 +47,7 @@ over4: "6over4", all: "all", ip_subnet: "Subnet", - ip_range: "ip Range" + ip_range: "ip Range", + timeout:"timeout" }); }(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 2ed95ff5c..85dff78e3 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -45,6 +45,7 @@ over4: "6over4", all: "all", ip_subnet: "Subnet", - ip_range: "ip Range" + ip_range: "ip Range", + timeout:"timeout" }); }(jQuery)); \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index e8cd2707b..c0329f45c 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -49,6 +49,7 @@ all: "全部", ip_subnet: "Subnet", ip_subnet: "Subnet", - ip_range: "ip Range" + ip_range: "ip Range", + timeout:"超时" }); }(jQuery)); diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index ad5d47b6c..208d4b443 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -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);