From 74fac2333f277b958527364d104543a9aac02b8a Mon Sep 17 00:00:00 2001 From: wangxin Date: Thu, 14 Jun 2018 17:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=A5=E5=BF=97=E6=80=BB?= =?UTF-8?q?=E9=87=8F=E8=8E=B7=E5=8F=96=EF=BC=8C=E7=94=B1=E4=BA=8E=E7=9B=AE?= =?UTF-8?q?=E5=89=8D=E6=8E=A5=E5=8F=A3=E4=B8=8D=E5=8F=AF=E7=94=A8=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E5=90=8E=E5=8F=B0=E7=9B=B4=E6=8E=A5=E9=80=A0?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E3=80=82=E8=B6=85=E6=97=B6=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E6=98=BE=E7=A4=BA=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/ntc/NtcPzReportController.java | 24 ++++++++++++++----- .../webapp/WEB-INF/views/cfg/iplist/list.jsp | 1 + .../1.11.0/localization/messages_en.js | 3 ++- .../1.11.0/localization/messages_ru.js | 3 ++- .../1.11.0/localization/messages_zh.js | 3 ++- .../webapp/static/global/scripts/common.js | 11 +++++---- 6 files changed, 32 insertions(+), 13 deletions(-) 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);