diff --git a/src/main/java/com/nis/web/controller/dashboard/DashboardController.java b/src/main/java/com/nis/web/controller/dashboard/DashboardController.java index df57ed452..62eab0f26 100644 --- a/src/main/java/com/nis/web/controller/dashboard/DashboardController.java +++ b/src/main/java/com/nis/web/controller/dashboard/DashboardController.java @@ -168,12 +168,15 @@ public class DashboardController extends BaseController{ */ @RequestMapping(value="ipActiveMinuteList") @ResponseBody - public List ipActiveMinuteList(String beginDate,String endDate){ + public List ipActiveMinuteList(String beginDate,String endDate,Integer entranceId){ Map fromJsonList = new HashMap(); List list = new ArrayList(); try { String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_FIVEMINUTE; url=urlAddDate(url, beginDate, endDate); + if(entranceId!=null){ + url=url+"&entranceId="+entranceId; + } String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); @@ -243,12 +246,15 @@ public class DashboardController extends BaseController{ */ @RequestMapping(value="ajaxIpActiveList") @ResponseBody - public List ajaxIpActiveList(String beginDate,String endDate){ + public List ajaxIpActiveList(String beginDate,String endDate,Integer entranceId){ Map fromJsonList = new HashMap(); List list = new ArrayList(); try { String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR; url=urlAddDate(url, beginDate, endDate); + if(entranceId!=null){ + url=url+"&entranceId="+entranceId; + } String string = HttpClientUtil.get(url); Gson gson = getIntGson(); fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index 913d240e2..96cbdc1ed 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -49,7 +49,7 @@ import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.dao.dashboard.codedic.CodeResult; - +@SuppressWarnings("all") @Controller @RequestMapping("${adminPath}/dashboard/traffic") public class TrafficStatisticsInfoController extends BaseController { @@ -300,7 +300,7 @@ public class TrafficStatisticsInfoController extends BaseController { */ @RequestMapping(value="protocolList") @ResponseBody - public List protocolList(Model model,Integer[] protoType,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){ + public List protocolList(Model model,Integer entranceId,Integer[] protoType,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){ Map fromJsonList = new HashMap(); List list = new ArrayList(); String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_PROTOCOL_LIST; @@ -313,6 +313,9 @@ public class TrafficStatisticsInfoController extends BaseController { } } } + if(entranceId!=null){ + url=url+"&entranceId="+entranceId; + } String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); @@ -378,7 +381,7 @@ public class TrafficStatisticsInfoController extends BaseController { */ @RequestMapping(value="appList") @ResponseBody - public List appList(@RequestParam(value="appType",required=false)Integer[] appType,@RequestParam(value="beginDate",required=false)String beginDate,@RequestParam(value="endDate",required=false)String endDate){ + public List appList(Integer entranceId,@RequestParam(value="appType",required=false)Integer[] appType,@RequestParam(value="beginDate",required=false)String beginDate,@RequestParam(value="endDate",required=false)String endDate){ Map fromJsonList = new HashMap(); List list = new ArrayList(); String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST; @@ -391,6 +394,9 @@ public class TrafficStatisticsInfoController extends BaseController { } } } + if(entranceId!=null){ + url=url+"&entranceId="+entranceId; + } String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); @@ -477,7 +483,7 @@ public class TrafficStatisticsInfoController extends BaseController { } @RequestMapping("ajaxAppTopList") @ResponseBody - public List ajaxAppTopList(String beginDate,String endDate,Integer appType,Integer entranceId,Model model){ + public List ajaxAppTopList(String beginDate,String endDate,Integer appType,Integer entranceId,Integer searchQuota,Model model){ Map fromJsonList = new HashMap(); List list = new ArrayList(); try { @@ -492,6 +498,11 @@ public class TrafficStatisticsInfoController extends BaseController { if(entranceId!=null){ url=url+"&searchEntranceId="+entranceId; } + if(searchQuota!=null){ + url=url+"&searchQuota="+searchQuota; + }else{ + url=url+"&searchQuota="+1; // 默认是按照link 排序 + } String string = HttpClientUtil.get(url); Gson gson = new GsonBuilder().create(); fromJsonList = gson.fromJson(string, new TypeToken>(){}.getType()); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp index 354c3b9a4..bc9747f9e 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTrendList.jsp @@ -82,7 +82,7 @@
-
+
@@ -91,8 +91,12 @@
-
-
+ +
@@ -104,20 +108,20 @@
-
-
+
+
- + - - + + @@ -144,8 +148,9 @@ $("#endDate").val(endh); var appType=$("#appType").val(); var entranceId=$("#entranceId").val(); + var searchQuota=$(".searchQuota[class~='active']").val(); appTransAjax(starth,endh,appType,entranceId); - appTop100List(starth,endh,appType,entranceId); + appTop100List(starth,endh,appType,entranceId,searchQuota); //筛选功能初始化 $("#resetBtn").on("click",function() { $("select.selectpicker").each(function() { @@ -156,8 +161,16 @@ $(".Wdate").attr("value", ''); $("#searchForm")[0].reset(); }); + $(".searchQuota").on("click",function(){ + $(".searchQuota").removeClass("active"); + $(this).addClass("active"); + }) $('.pageView').hide(); }); + // 改变排序字段 + function changeOrderby(searchQuota) { + appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId").val(),searchQuota); + } function searchList() { var start = $("#beginDate").val(); var end = $("#endDate").val(); @@ -168,12 +181,13 @@ } else { var appType=$("#appType").val(); var entranceId=$("#entranceId").val(); + var searchQuota=$(".searchQuota[class~='active']").val(); appTransAjax(start,end,appType,entranceId);// 折线 - appTop100List(start,end,appType,entranceId);// 列表 + appTop100List(start,end,appType,entranceId,searchQuota);// 列表 } } // 列表 - function appTop100List(start,end,appType,entranceId){ + function appTop100List(start,end,appType,entranceId,searchQuota){ $.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTopList", type : 'get', @@ -182,7 +196,8 @@ "beginDate" : start, "endDate" : end, "appType" : appType, - "entranceId" : entranceId + "entranceId" : entranceId, + "searchQuota":searchQuota }, async : true, timeout : 50000, @@ -233,37 +248,25 @@ }) $.each(fileDataS, function(index, data) { if (data != null) { - var uniqueper=0; - var packper=0; - var gbytper=0; - if(totalunique!=null&&totalunique!=0 ){ - uniqueper=((data.logNum/totalunique)*100).toFixed(2); - } - if(totalpkt!=null&&totalpkt!=0 ){ - packper=((data.pktNum/totalpkt)*100).toFixed(2); - } - if(totalbyte!=null&&totalbyte!=0 ){ - gbytper=((data.byteNum/(totalbyte))*100).toFixed(2); - } var html =""; html += ""; html += ""; - html += ""; + html += ""; // html += ""; html += ""; - html += ""; + html += ""; html += ""; - html += ""; + html += ""; html += "" if(index==fileDataS.length-1){ html+="" html+= ""; html+= ""; - html+= ""; + html+= ""; html+= ""; - html+= ""; + html+= ""; html+= ""; - html+= ""; + html+= ""; html+="" } } @@ -459,6 +462,7 @@ var points = chart.series[0].points; chart.tooltip.refresh(points[points.length -1]); } + var timer=null; // 局点信息 function showActionTransChart(sipResult,dipResult) { var nowDate=new Date(); @@ -526,7 +530,8 @@ title : { text : null }, - min:0 + min:0, + allowDecimals:false }, tooltip: { dateTimeLabelFormats: { @@ -540,7 +545,7 @@ year: '%Y-%m-%d %H:%M:%S' } }, - credits : {//是否有highcharts水印 + credits : {//是否有水印 enabled : false }, plotOptions : { @@ -555,13 +560,8 @@ } } }, - // legend: { - // layout: 'vertical', - // align: 'right', - // verticalAlign: 'middle' - // }, series: [{ - name: 'Client IP', + name: '', data: (function () { var data = []; if(sipResult!=null&&sipResult.length>0){ @@ -584,7 +584,7 @@ }()) }, { - name: 'Server IP', + name: '', data: (function () { var data = []; if(dipResult!=null&&dipResult.length>0){ @@ -607,43 +607,28 @@ }()) }] }); - var timer=null; - var series=[]; - var series1=[]; - series = chart.series[0]; - series1 = chart.series[1]; + + var series = chart.series[0]; + var series1 = chart.series[1]; window.clearInterval(timer); if(sipResult!=null&&sipResult.length>0){ - }else{ - num=0; - window.clearInterval(timer); - } - var temp =num; timer=setInterval(function() { var d =sipResult[num]; - if(typeof d!='undefined'&&d!=null){ series.addPoint([d[0], d[1]], true, true); - }else{ - num=0; - window.clearInterval(timer); - return - } var t =dipResult[num]; - if(typeof t!='undefined'&&t!=null){ series1.addPoint([t[0], t[1]], true, true); - }else{ - num=0; - clearInterval(timer); - return - } - num=num+1 + num=num+1; if(num==sipResult.length){ num=0; - clearInterval(timer); + window.clearInterval(timer); return } },3000); + }else{ + num=0; + window.clearInterval(timer); + } } (function(H) { H.Chart.prototype.downloadXLS = function() { diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 53f34d2d7..9f8f21808 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -69,8 +69,20 @@ - - + +
+
+
+ +
+ +
+
@@ -130,7 +142,8 @@ $(document).ready(function(){ var endh=$("#endDateh").val(); $("#beginDate").val(starth); $("#endDate").val(endh); - ajaxAppList(starth,endh); + var entranceId=$("#entranceId").val(); + ajaxAppList(starth,endh,entranceId); //筛选功能初始化 $("#resetBtn").on("click",function(){ $("select.selectpicker").each(function(){ @@ -152,20 +165,21 @@ function searchList(){ var end=$("#endDate").val(); $("#beginDateh").val(start); $("#endDateh").val(end); + var entranceId = $("#entranceId").val(); if(start==''||end==''||end==null||start==null){ window.location.reload(); }else{ - ajaxAppList(start,end); + ajaxAppList(start,end,entranceId); } } -function ajaxAppList(start,end){ +function ajaxAppList(start,end,entranceId){ var appType=$("#appType").val(); loading(); $.ajax({ url: '${ctx}/dashboard/traffic/appList', type: 'get', dataType: "json", - data:{"beginDate":start,"endDate":end,"appType":appType}, + data:{"beginDate":start,"endDate":end,"appType":appType,"entranceId":entranceId}, async:true, timeout:50000, traditional:true, @@ -484,7 +498,7 @@ function protocolTypeChart(rs){ }, } }, - credits:{//是否有highcharts水印 + credits:{//是否有水印 enabled:false }, tooltip: { diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index d191b4df7..8a5a0fdc9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -72,7 +72,7 @@ $(document).ready(function(){ })*/ total=rs[0].sum; series.push({ - name: 'unique', + name: '', data: rs[0].result, marker: { enabled: false @@ -80,7 +80,7 @@ $(document).ready(function(){ }); }else{ series.push({ - name: 'unique', + name: '', data: [] }); } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index eb6bd6c39..fe7090a1d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -42,7 +42,19 @@ value="" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#beginDate','#endDate',7,'d','yyyy-MM-dd hh:mm:ss',false)"/>
- +
+
+
+ +
+ +
+
@@ -61,7 +73,6 @@

-

-
-
+
() () () ()
" + data.ipAddr + "" + data.logNum + "" + uniqueper + " %" + data.logPercent + " %" + (((data.entranceId)==1) ? "Astana":"Alamty") + "" + Math.round(data.pktNum*100)/100 + "" + packper + " %" + data.pktPercent + " %" + Math.round(data.byteNum*100)/100 + "" + gbytper + " %" + data.bytePercent + " %
@@ -124,8 +134,9 @@ $(document).ready(function(){ var endh=$("#endDateh").val(); $("#beginDate").val(starth); $("#endDate").val(endh); - ipActiveMinuteList(starth,endh); - ipActiveOneHourList(starth,endh); + var entranceId=$("#entranceId").val(); + ipActiveMinuteList(starth,endh,entranceId); + ipActiveOneHourList(starth,endh,entranceId); //筛选功能初始化 $("#resetBtn").on("click",function(){ $("select.selectpicker").each(function(){ @@ -186,7 +197,7 @@ $(".export-btn").click(function(){ if(!data[i]){ data[i] = new Array(); } - data[i][j] = mytable.rows[i].cells[j].innerHTML; + data[i][j] = mytable.rows[i].cells[j].innerText; } } var title= data.shift(); @@ -204,12 +215,13 @@ function searchList(){ var end=$("#endDate").val(); $("#beginDateh").val(start); $("#endDateh").val(end); + var entranceId=$("#entranceId").val(); loading(); if(start==''||end==''||end==null||start==null){ window.location.reload(); }else{ - ipActiveMinuteList(start,end); - ipActiveOneHourList(start,end); + ipActiveMinuteList(start,end,entranceId); + ipActiveOneHourList(start,end,entranceId); } } @@ -295,10 +307,10 @@ function showIpActiveChart(xData,series){ }, yAxis: { title: { - text: 'Link Numbers' + text: 'Link Times' } }, - credits:{//是否有highcharts水印 + credits:{//是否有水印 enabled:false }, legend: { @@ -310,13 +322,13 @@ function showIpActiveChart(xData,series){ }); } //活跃IP一小时间隔五分钟统计 - function ipActiveMinuteList(beginDate,endDate){ + function ipActiveMinuteList(beginDate,endDate,entranceId){ loading(); $.ajax({ url: '${ctx}/dashboard/ipActiveMinuteList', type : "get", dataType:"json", - data:{"beginDate":beginDate,"endDate":endDate}, + data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId}, async:true, timeout:50000, success:function (rs) { @@ -355,14 +367,14 @@ function showIpActiveChart(xData,series){ }); } //活跃IP一小时统计 - function ipActiveOneHourList(beginDate,endDate){ - $("#tbodyData").html(""); + function ipActiveOneHourList(beginDate,endDate,entranceId){ + $("#tbodyData").html(""); loading(); $.ajax({ url: '${ctx}/dashboard/ajaxIpActiveList', type : "get" , dataType:"json", - data:{"beginDate":beginDate,"endDate":endDate}, + data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId}, async:true, timeout:50000, success:function (data) { diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 483c2e788..72c1e5e4b 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -58,7 +58,19 @@ - +
+
+
+ +
+ +
+
@@ -117,7 +129,8 @@ $(document).ready(function(){ var endh=$("#endDateh").val(); $("#beginDate").val(starth); $("#endDate").val(endh); - ajaxProtocolList(starth,endh); + var entranceId=$("#entranceId").val(); + ajaxProtocolList(starth,endh,entranceId); //筛选功能初始化 $("#resetBtn").on("click",function(){ $("select.selectpicker").each(function(){ @@ -138,22 +151,23 @@ function searchList(){ loading(); var start=$("#beginDate").val(); var end=$("#endDate").val(); + var entranceId=$("#entranceId").val(); $("#beginDateh").val(start); $("#endDateh").val(end); if(start==''||end==''||end==null||start==null){ window.location.reload(); }else{ - ajaxProtocolList(start,end); + ajaxProtocolList(start,end,entranceId); } } -function ajaxProtocolList(start,end){ +function ajaxProtocolList(start,end,entranceId){ var protoType=$("#protoType").val(); loading(); $.ajax({ url: '${ctx}/dashboard/traffic/protocolList', type: 'get', dataType: "json", - data:{"beginDate":start,"endDate":end,"protoType":protoType}, + data:{"beginDate":start,"endDate":end,"protoType":protoType,"entranceId":entranceId}, async:true, timeout:50000, traditional:true, @@ -469,7 +483,7 @@ function protocolTypeChart(rs){ }, } }, - credits:{//是否有highcharts水印 + credits:{//是否有水印 enabled:false }, tooltip: { diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 249ef3afb..54d542844 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -14,6 +14,9 @@ @@ -77,7 +80,7 @@
- +
- + @@ -217,7 +220,7 @@ "entranceId" : entranceId }, async : true, - timeout : 40000, + timeout : 50000, traditional:true, success : function(data) { if (data != null && data.length > 0 && data[0].error != null) {
()