流量统计详情app,协议,活跃IP增加地域查询条件,域名详情趋势图改为client

IP,app详情改为link,packet,byte三中方式排序
This commit is contained in:
zhanghongqing
2019-01-08 20:45:39 +08:00
parent 44966707be
commit 49c83525dd
8 changed files with 148 additions and 103 deletions

View File

@@ -168,12 +168,15 @@ public class DashboardController extends BaseController{
*/ */
@RequestMapping(value="ipActiveMinuteList") @RequestMapping(value="ipActiveMinuteList")
@ResponseBody @ResponseBody
public List ipActiveMinuteList(String beginDate,String endDate){ public List ipActiveMinuteList(String beginDate,String endDate,Integer entranceId){
Map<String, Object> fromJsonList = new HashMap<String, Object>(); Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList(); List list = new ArrayList();
try { try {
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_FIVEMINUTE; String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_FIVEMINUTE;
url=urlAddDate(url, beginDate, endDate); url=urlAddDate(url, beginDate, endDate);
if(entranceId!=null){
url=url+"&entranceId="+entranceId;
}
String string = HttpClientUtil.get(url); String string = HttpClientUtil.get(url);
Gson gson = new GsonBuilder().create(); Gson gson = new GsonBuilder().create();
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType()); fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
@@ -243,12 +246,15 @@ public class DashboardController extends BaseController{
*/ */
@RequestMapping(value="ajaxIpActiveList") @RequestMapping(value="ajaxIpActiveList")
@ResponseBody @ResponseBody
public List ajaxIpActiveList(String beginDate,String endDate){ public List ajaxIpActiveList(String beginDate,String endDate,Integer entranceId){
Map<String, Object> fromJsonList = new HashMap<String, Object>(); Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList(); List list = new ArrayList();
try { try {
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR; String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR;
url=urlAddDate(url, beginDate, endDate); url=urlAddDate(url, beginDate, endDate);
if(entranceId!=null){
url=url+"&entranceId="+entranceId;
}
String string = HttpClientUtil.get(url); String string = HttpClientUtil.get(url);
Gson gson = getIntGson(); Gson gson = getIntGson();
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType()); fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());

View File

@@ -49,7 +49,7 @@ import com.nis.util.StringUtil;
import com.nis.util.httpclient.HttpClientUtil; import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
import com.nis.web.dao.dashboard.codedic.CodeResult; import com.nis.web.dao.dashboard.codedic.CodeResult;
@SuppressWarnings("all")
@Controller @Controller
@RequestMapping("${adminPath}/dashboard/traffic") @RequestMapping("${adminPath}/dashboard/traffic")
public class TrafficStatisticsInfoController extends BaseController { public class TrafficStatisticsInfoController extends BaseController {
@@ -300,7 +300,7 @@ public class TrafficStatisticsInfoController extends BaseController {
*/ */
@RequestMapping(value="protocolList") @RequestMapping(value="protocolList")
@ResponseBody @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<String, Object> fromJsonList = new HashMap<String, Object>(); Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList(); List list = new ArrayList();
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_PROTOCOL_LIST; 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); String string = HttpClientUtil.get(url);
Gson gson = new GsonBuilder().create(); Gson gson = new GsonBuilder().create();
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType()); fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
@@ -378,7 +381,7 @@ public class TrafficStatisticsInfoController extends BaseController {
*/ */
@RequestMapping(value="appList") @RequestMapping(value="appList")
@ResponseBody @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<String, Object> fromJsonList = new HashMap<String, Object>(); Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList(); List list = new ArrayList();
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST; 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); String string = HttpClientUtil.get(url);
Gson gson = new GsonBuilder().create(); Gson gson = new GsonBuilder().create();
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType()); fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
@@ -477,7 +483,7 @@ public class TrafficStatisticsInfoController extends BaseController {
} }
@RequestMapping("ajaxAppTopList") @RequestMapping("ajaxAppTopList")
@ResponseBody @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<String, Object> fromJsonList = new HashMap<String, Object>(); Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList(); List list = new ArrayList();
try { try {
@@ -492,6 +498,11 @@ public class TrafficStatisticsInfoController extends BaseController {
if(entranceId!=null){ if(entranceId!=null){
url=url+"&searchEntranceId="+entranceId; url=url+"&searchEntranceId="+entranceId;
} }
if(searchQuota!=null){
url=url+"&searchQuota="+searchQuota;
}else{
url=url+"&searchQuota="+1; // 默认是按照link 排序
}
String string = HttpClientUtil.get(url); String string = HttpClientUtil.get(url);
Gson gson = new GsonBuilder().create(); Gson gson = new GsonBuilder().create();
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType()); fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());

View File

@@ -82,7 +82,7 @@
</form:form> </form:form>
</div> </div>
<div class="row"> <div class="row">
<div id="chart" style="width: 97%; height: 530px; margin-top: 20px"></div> <div id="chart" style="width: 97%; height: 450px; margin-top: 20px"></div>
<input id="total" type="hidden" /> <input id="total" type="hidden" />
<input id="sipData" type="hidden" /> <input id="sipData" type="hidden" />
<input id="dipData" type="hidden" /> <input id="dipData" type="hidden" />
@@ -91,8 +91,12 @@
<input id="beginDateh" type="hidden" value="${beginDate}" /> <input id="beginDateh" type="hidden" value="${beginDate}" />
<input id="endDateh" type="hidden" value="${endDate}" /> <input id="endDateh" type="hidden" value="${endDate}" />
</div> </div>
<div class="row"> <ul class="nav nav-tabs">
<div class="btn-group pull-right"> <li class="searchQuota active" value="1" onclick="changeOrderby(1)"><a href="javascript:void(0);"><spring:message code="link_num"/></a></li>
<li class="searchQuota" value="2" onclick="changeOrderby(2)"><a href="javascript:void(0);"><spring:message code="packet"/></a></li>
<li class="searchQuota" value="3" onclick="changeOrderby(3)"><a href="javascript:void(0);"><spring:message code="byte"/></a></li>
</ul>
<div class="btn-group pull-right" style="padding-top: 5px">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> <spring:message code="export"/> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> <spring:message code="export"/>
<span class="caret"></span> <span class="caret"></span>
</button> </button>
@@ -104,20 +108,20 @@
<button type="button" class="btn btn-default css-print" onClick="doPrint()"><i class="fa glyphicon glyphicon-print" style="top:3px;margin-right: 3px;"></i><spring:message code="print"/></button> <button type="button" class="btn btn-default css-print" onClick="doPrint()"><i class="fa glyphicon glyphicon-print" style="top:3px;margin-right: 3px;"></i><spring:message code="print"/></button>
</div> </div>
</div> </div>
</div> <br>
<div class="row"> <div class="row" style="padding-top: 5px">
<div class="table-responsive"> <div class="table-responsive">
<table id="contentTable" style="width: 100%;" <table id="contentTable" style="width: 100%;"
class="table table-striped table-bordered table-condensed text-nowrap"> class="table table-striped table-bordered table-condensed text-nowrap">
<thead> <thead>
<tr> <tr>
<th><spring:message code="ip"/></th> <th><spring:message code="client_ip"/></th>
<th><spring:message code="link_num"/></th> <th><spring:message code="link_num"/></th>
<th><spring:message code="percentage"/> (<spring:message code="link_num"/>)</th> <th><spring:message code="percentage"/> (<spring:message code="link_num"/>)</th>
<th><spring:message code="packets"/></th> <th><spring:message code="packets"/></th>
<th><spring:message code="percentage"/> (<spring:message code="packets"/>)</th> <th><spring:message code="percentage"/> (<spring:message code="packets"/>)</th>
<th><spring:message code="GByte"/></th> <th><spring:message code="bytes"/></th>
<th><spring:message code="percentage"/> (<spring:message code="GByte"/>)</th> <th><spring:message code="percentage"/> (<spring:message code="bytes"/>)</th>
</tr> </tr>
</thead> </thead>
<tbody id="tableData"></tbody> <tbody id="tableData"></tbody>
@@ -144,8 +148,9 @@
$("#endDate").val(endh); $("#endDate").val(endh);
var appType=$("#appType").val(); var appType=$("#appType").val();
var entranceId=$("#entranceId").val(); var entranceId=$("#entranceId").val();
var searchQuota=$(".searchQuota[class~='active']").val();
appTransAjax(starth,endh,appType,entranceId); appTransAjax(starth,endh,appType,entranceId);
appTop100List(starth,endh,appType,entranceId); appTop100List(starth,endh,appType,entranceId,searchQuota);
//筛选功能初始化 //筛选功能初始化
$("#resetBtn").on("click",function() { $("#resetBtn").on("click",function() {
$("select.selectpicker").each(function() { $("select.selectpicker").each(function() {
@@ -156,8 +161,16 @@
$(".Wdate").attr("value", ''); $(".Wdate").attr("value", '');
$("#searchForm")[0].reset(); $("#searchForm")[0].reset();
}); });
$(".searchQuota").on("click",function(){
$(".searchQuota").removeClass("active");
$(this).addClass("active");
})
$('.pageView').hide(); $('.pageView').hide();
}); });
// 改变排序字段
function changeOrderby(searchQuota) {
appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId").val(),searchQuota);
}
function searchList() { function searchList() {
var start = $("#beginDate").val(); var start = $("#beginDate").val();
var end = $("#endDate").val(); var end = $("#endDate").val();
@@ -168,12 +181,13 @@
} else { } else {
var appType=$("#appType").val(); var appType=$("#appType").val();
var entranceId=$("#entranceId").val(); var entranceId=$("#entranceId").val();
var searchQuota=$(".searchQuota[class~='active']").val();
appTransAjax(start,end,appType,entranceId);// 折线 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({ $.ajax({
url : "${ctx}/dashboard/traffic/ajaxAppTopList", url : "${ctx}/dashboard/traffic/ajaxAppTopList",
type : 'get', type : 'get',
@@ -182,7 +196,8 @@
"beginDate" : start, "beginDate" : start,
"endDate" : end, "endDate" : end,
"appType" : appType, "appType" : appType,
"entranceId" : entranceId "entranceId" : entranceId,
"searchQuota":searchQuota
}, },
async : true, async : true,
timeout : 50000, timeout : 50000,
@@ -233,37 +248,25 @@
}) })
$.each(fileDataS, function(index, data) { $.each(fileDataS, function(index, data) {
if (data != null) { 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 ="<tr>"; var html ="<tr>";
html += "<td class='tc'>" + data.ipAddr + "</td>"; html += "<td class='tc'>" + data.ipAddr + "</td>";
html += "<td class='tc'>" + data.logNum + "</td>"; html += "<td class='tc'>" + data.logNum + "</td>";
html += "<td class='tc'>" + uniqueper + " %</td>"; html += "<td class='tc'>" + data.logPercent + " %</td>";
// html += "<td class='tc'>" + (((data.entranceId)==1) ? "Astana":"Alamty") + "</td>"; // html += "<td class='tc'>" + (((data.entranceId)==1) ? "Astana":"Alamty") + "</td>";
html += "<td class='tc'>" + Math.round(data.pktNum*100)/100 + "</td>"; html += "<td class='tc'>" + Math.round(data.pktNum*100)/100 + "</td>";
html += "<td class='tc'>" + packper + " %</td>"; html += "<td class='tc'>" + data.pktPercent + " %</td>";
html += "<td class='tc'>" + Math.round(data.byteNum*100)/100 + "</td>"; html += "<td class='tc'>" + Math.round(data.byteNum*100)/100 + "</td>";
html += "<td class='tc'>" + gbytper + " %</td>"; html += "<td class='tc'>" + data.bytePercent + " %</td>";
html += "</tr>" html += "</tr>"
if(index==fileDataS.length-1){ if(index==fileDataS.length-1){
html+="<tr class='tr-total hidden'>" html+="<tr class='tr-total hidden'>"
html+= "<td class='tc'>"+"<spring:message code='report_total'/>"+"</td>"; html+= "<td class='tc'>"+"<spring:message code='report_total'/>"+"</td>";
html+= "<td class='tc'>"+totalunique+"</td>"; html+= "<td class='tc'>"+totalunique+"</td>";
html+= "<td class='tc'>" +"100%"+"</td>"; html+= "<td class='tc'>" +"--"+"</td>";
html+= "<td class='tc'>"+totalpkt+"</td>"; html+= "<td class='tc'>"+totalpkt+"</td>";
html+= "<td class='tc'>"+"100%"+"</td>"; html+= "<td class='tc'>"+"--"+"</td>";
html+= "<td class='tc'>"+totalbyte+"</td>"; html+= "<td class='tc'>"+totalbyte+"</td>";
html+= "<td class='tc'>"+"100%"+"</td>"; html+= "<td class='tc'>"+"--"+"</td>";
html+="</tr>" html+="</tr>"
} }
} }
@@ -459,6 +462,7 @@
var points = chart.series[0].points; var points = chart.series[0].points;
chart.tooltip.refresh(points[points.length -1]); chart.tooltip.refresh(points[points.length -1]);
} }
var timer=null;
// 局点信息 // 局点信息
function showActionTransChart(sipResult,dipResult) { function showActionTransChart(sipResult,dipResult) {
var nowDate=new Date(); var nowDate=new Date();
@@ -526,7 +530,8 @@
title : { title : {
text : null text : null
}, },
min:0 min:0,
allowDecimals:false
}, },
tooltip: { tooltip: {
dateTimeLabelFormats: { dateTimeLabelFormats: {
@@ -540,7 +545,7 @@
year: '%Y-%m-%d %H:%M:%S' year: '%Y-%m-%d %H:%M:%S'
} }
}, },
credits : {//是否有highcharts水印 credits : {//是否有水印
enabled : false enabled : false
}, },
plotOptions : { plotOptions : {
@@ -555,13 +560,8 @@
} }
} }
}, },
// legend: {
// layout: 'vertical',
// align: 'right',
// verticalAlign: 'middle'
// },
series: [{ series: [{
name: 'Client IP', name: '<spring:message code="client_ip"/>',
data: (function () { data: (function () {
var data = []; var data = [];
if(sipResult!=null&&sipResult.length>0){ if(sipResult!=null&&sipResult.length>0){
@@ -584,7 +584,7 @@
}()) }())
}, },
{ {
name: 'Server IP', name: '<spring:message code="server_ip"/>',
data: (function () { data: (function () {
var data = []; var data = [];
if(dipResult!=null&&dipResult.length>0){ if(dipResult!=null&&dipResult.length>0){
@@ -607,43 +607,28 @@
}()) }())
}] }]
}); });
var timer=null;
var series=[]; var series = chart.series[0];
var series1=[]; var series1 = chart.series[1];
series = chart.series[0];
series1 = chart.series[1];
window.clearInterval(timer); window.clearInterval(timer);
if(sipResult!=null&&sipResult.length>0){ if(sipResult!=null&&sipResult.length>0){
}else{
num=0;
window.clearInterval(timer);
}
var temp =num;
timer=setInterval(function() { timer=setInterval(function() {
var d =sipResult[num]; var d =sipResult[num];
if(typeof d!='undefined'&&d!=null){
series.addPoint([d[0], d[1]], true, true); series.addPoint([d[0], d[1]], true, true);
}else{
num=0;
window.clearInterval(timer);
return
}
var t =dipResult[num]; var t =dipResult[num];
if(typeof t!='undefined'&&t!=null){
series1.addPoint([t[0], t[1]], true, true); series1.addPoint([t[0], t[1]], true, true);
}else{ num=num+1;
num=0;
clearInterval(timer);
return
}
num=num+1
if(num==sipResult.length){ if(num==sipResult.length){
num=0; num=0;
clearInterval(timer); window.clearInterval(timer);
return return
} }
},3000); },3000);
}else{
num=0;
window.clearInterval(timer);
}
} }
(function(H) { (function(H) {
H.Chart.prototype.downloadXLS = function() { H.Chart.prototype.downloadXLS = function() {

View File

@@ -69,8 +69,20 @@
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
</div> </div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<span class="selectpicker form-control" ><spring:message code="area_id"/></span>
</div>
<select id="entranceId" name="entranceId" class="selectpicker form-control" width="100px" data-live-search="true" data-live-search-placeholder="search">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="dict" >
<option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"></spring:message></option>
</c:forEach>
</select>
</div>
</div>
<div class="pull-left"> <div class="pull-left">
<button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button> <button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button> <button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
@@ -130,7 +142,8 @@ $(document).ready(function(){
var endh=$("#endDateh").val(); var endh=$("#endDateh").val();
$("#beginDate").val(starth); $("#beginDate").val(starth);
$("#endDate").val(endh); $("#endDate").val(endh);
ajaxAppList(starth,endh); var entranceId=$("#entranceId").val();
ajaxAppList(starth,endh,entranceId);
//筛选功能初始化 //筛选功能初始化
$("#resetBtn").on("click",function(){ $("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){ $("select.selectpicker").each(function(){
@@ -152,20 +165,21 @@ function searchList(){
var end=$("#endDate").val(); var end=$("#endDate").val();
$("#beginDateh").val(start); $("#beginDateh").val(start);
$("#endDateh").val(end); $("#endDateh").val(end);
var entranceId = $("#entranceId").val();
if(start==''||end==''||end==null||start==null){ if(start==''||end==''||end==null||start==null){
window.location.reload(); window.location.reload();
}else{ }else{
ajaxAppList(start,end); ajaxAppList(start,end,entranceId);
} }
} }
function ajaxAppList(start,end){ function ajaxAppList(start,end,entranceId){
var appType=$("#appType").val(); var appType=$("#appType").val();
loading(); loading();
$.ajax({ $.ajax({
url: '${ctx}/dashboard/traffic/appList', url: '${ctx}/dashboard/traffic/appList',
type: 'get', type: 'get',
dataType: "json", dataType: "json",
data:{"beginDate":start,"endDate":end,"appType":appType}, data:{"beginDate":start,"endDate":end,"appType":appType,"entranceId":entranceId},
async:true, async:true,
timeout:50000, timeout:50000,
traditional:true, traditional:true,
@@ -484,7 +498,7 @@ function protocolTypeChart(rs){
}, },
} }
}, },
credits:{//是否有highcharts水印 credits:{//是否有水印
enabled:false enabled:false
}, },
tooltip: { tooltip: {

View File

@@ -72,7 +72,7 @@ $(document).ready(function(){
})*/ })*/
total=rs[0].sum; total=rs[0].sum;
series.push({ series.push({
name: 'unique', name: '<spring:message code="client_ip"/>',
data: rs[0].result, data: rs[0].result,
marker: { marker: {
enabled: false enabled: false
@@ -80,7 +80,7 @@ $(document).ready(function(){
}); });
}else{ }else{
series.push({ series.push({
name: 'unique', name: '<spring:message code="client_ip"/>',
data: [] data: []
}); });
} }

View File

@@ -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)"/> 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)"/>
</div> </div>
</div> </div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<span class="selectpicker form-control" ><spring:message code="area_id"/></span>
</div>
<select id="entranceId" name="entranceId" class="selectpicker form-control" width="100px" data-live-search="true" data-live-search-placeholder="search">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="dict" >
<option value="${dict.itemCode}" <c:if test="${dict.itemCode==1}">selected</c:if>><spring:message code="${dict.itemValue}"></spring:message></option>
</c:forEach>
</select>
</div>
</div>
<div class="pull-left"> <div class="pull-left">
<button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button> <button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button> <button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
@@ -61,7 +73,6 @@
<sys:message content="${message}" type="${messageType }"/> <sys:message content="${message}" type="${messageType }"/>
<h3 class="page-title"> <h3 class="page-title">
<spring:message code="traffic_ipactive_hour_max"></spring:message> <spring:message code="traffic_ipactive_hour_max"></spring:message>
</h3>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> <spring:message code="export"/> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> <spring:message code="export"/>
<span class="caret"></span> <span class="caret"></span>
@@ -74,8 +85,7 @@
<button type="button" class="btn btn-default css-print" onClick="doPrint()"><i class="fa glyphicon glyphicon-print" style="top:3px;margin-right: 3px;"></i><spring:message code="print"/></button> <button type="button" class="btn btn-default css-print" onClick="doPrint()"><i class="fa glyphicon glyphicon-print" style="top:3px;margin-right: 3px;"></i><spring:message code="print"/></button>
</div> </div>
</div> </div>
<br> </h3>
<br>
<div class="" align="center"> <div class="" align="center">
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap"> <table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead> <thead>
@@ -124,8 +134,9 @@ $(document).ready(function(){
var endh=$("#endDateh").val(); var endh=$("#endDateh").val();
$("#beginDate").val(starth); $("#beginDate").val(starth);
$("#endDate").val(endh); $("#endDate").val(endh);
ipActiveMinuteList(starth,endh); var entranceId=$("#entranceId").val();
ipActiveOneHourList(starth,endh); ipActiveMinuteList(starth,endh,entranceId);
ipActiveOneHourList(starth,endh,entranceId);
//筛选功能初始化 //筛选功能初始化
$("#resetBtn").on("click",function(){ $("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){ $("select.selectpicker").each(function(){
@@ -186,7 +197,7 @@ $(".export-btn").click(function(){
if(!data[i]){ if(!data[i]){
data[i] = new Array(); 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(); var title= data.shift();
@@ -204,12 +215,13 @@ function searchList(){
var end=$("#endDate").val(); var end=$("#endDate").val();
$("#beginDateh").val(start); $("#beginDateh").val(start);
$("#endDateh").val(end); $("#endDateh").val(end);
var entranceId=$("#entranceId").val();
loading(); loading();
if(start==''||end==''||end==null||start==null){ if(start==''||end==''||end==null||start==null){
window.location.reload(); window.location.reload();
}else{ }else{
ipActiveMinuteList(start,end); ipActiveMinuteList(start,end,entranceId);
ipActiveOneHourList(start,end); ipActiveOneHourList(start,end,entranceId);
} }
} }
@@ -295,10 +307,10 @@ function showIpActiveChart(xData,series){
}, },
yAxis: { yAxis: {
title: { title: {
text: 'Link Numbers' text: 'Link Times'
} }
}, },
credits:{//是否有highcharts水印 credits:{//是否有水印
enabled:false enabled:false
}, },
legend: { legend: {
@@ -310,13 +322,13 @@ function showIpActiveChart(xData,series){
}); });
} }
//活跃IP一小时间隔五分钟统计 //活跃IP一小时间隔五分钟统计
function ipActiveMinuteList(beginDate,endDate){ function ipActiveMinuteList(beginDate,endDate,entranceId){
loading(); loading();
$.ajax({ $.ajax({
url: '${ctx}/dashboard/ipActiveMinuteList', url: '${ctx}/dashboard/ipActiveMinuteList',
type : "get", type : "get",
dataType:"json", dataType:"json",
data:{"beginDate":beginDate,"endDate":endDate}, data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId},
async:true, async:true,
timeout:50000, timeout:50000,
success:function (rs) { success:function (rs) {
@@ -355,14 +367,14 @@ function showIpActiveChart(xData,series){
}); });
} }
//活跃IP一小时统计 //活跃IP一小时统计
function ipActiveOneHourList(beginDate,endDate){ function ipActiveOneHourList(beginDate,endDate,entranceId){
$("#tbodyData").html(""); $("#tbodyData").html("");
loading(); loading();
$.ajax({ $.ajax({
url: '${ctx}/dashboard/ajaxIpActiveList', url: '${ctx}/dashboard/ajaxIpActiveList',
type : "get" , type : "get" ,
dataType:"json", dataType:"json",
data:{"beginDate":beginDate,"endDate":endDate}, data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId},
async:true, async:true,
timeout:50000, timeout:50000,
success:function (data) { success:function (data) {

View File

@@ -58,7 +58,19 @@
</select> </select>
</div> </div>
</div> </div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<span class="selectpicker form-control" ><spring:message code="area_id"/></span>
</div>
<select id="entranceId" name="entranceId" class="selectpicker form-control" width="100px" data-live-search="true" data-live-search-placeholder="search">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="dict" >
<option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"></spring:message></option>
</c:forEach>
</select>
</div>
</div>
<div class="pull-left"> <div class="pull-left">
<button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button> <button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button> <button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
@@ -117,7 +129,8 @@ $(document).ready(function(){
var endh=$("#endDateh").val(); var endh=$("#endDateh").val();
$("#beginDate").val(starth); $("#beginDate").val(starth);
$("#endDate").val(endh); $("#endDate").val(endh);
ajaxProtocolList(starth,endh); var entranceId=$("#entranceId").val();
ajaxProtocolList(starth,endh,entranceId);
//筛选功能初始化 //筛选功能初始化
$("#resetBtn").on("click",function(){ $("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){ $("select.selectpicker").each(function(){
@@ -138,22 +151,23 @@ function searchList(){
loading(); loading();
var start=$("#beginDate").val(); var start=$("#beginDate").val();
var end=$("#endDate").val(); var end=$("#endDate").val();
var entranceId=$("#entranceId").val();
$("#beginDateh").val(start); $("#beginDateh").val(start);
$("#endDateh").val(end); $("#endDateh").val(end);
if(start==''||end==''||end==null||start==null){ if(start==''||end==''||end==null||start==null){
window.location.reload(); window.location.reload();
}else{ }else{
ajaxProtocolList(start,end); ajaxProtocolList(start,end,entranceId);
} }
} }
function ajaxProtocolList(start,end){ function ajaxProtocolList(start,end,entranceId){
var protoType=$("#protoType").val(); var protoType=$("#protoType").val();
loading(); loading();
$.ajax({ $.ajax({
url: '${ctx}/dashboard/traffic/protocolList', url: '${ctx}/dashboard/traffic/protocolList',
type: 'get', type: 'get',
dataType: "json", dataType: "json",
data:{"beginDate":start,"endDate":end,"protoType":protoType}, data:{"beginDate":start,"endDate":end,"protoType":protoType,"entranceId":entranceId},
async:true, async:true,
timeout:50000, timeout:50000,
traditional:true, traditional:true,
@@ -469,7 +483,7 @@ function protocolTypeChart(rs){
}, },
} }
}, },
credits:{//是否有highcharts水印 credits:{//是否有水印
enabled:false enabled:false
}, },
tooltip: { tooltip: {

View File

@@ -14,6 +14,9 @@
</head> </head>
<style type="text/css"> <style type="text/css">
@page { size: landscape; } @page { size: landscape; }
.input-medium {
width: 170px !important;
}
</style> </style>
<body> <body>
@@ -77,7 +80,7 @@
<div class="pull-left"> <div class="pull-left">
<div class="input-group"> <div class="input-group">
<div class="input-group-btn"> <div class="input-group-btn">
<span class="selectpicker form-control" ><spring:message code="entrance_id"/></span> <span class="selectpicker form-control" ><spring:message code="area_id"/></span>
</div> </div>
<select id="entranceId" name="entranceId" class="selectpicker form-control" width="100px" data-live-search="true" data-live-search-placeholder="search"> <select id="entranceId" name="entranceId" class="selectpicker form-control" width="100px" data-live-search="true" data-live-search-placeholder="search">
<option value=""><spring:message code="select"/></option> <option value=""><spring:message code="select"/></option>
@@ -140,7 +143,7 @@
<th><spring:message code="trend"/></th> <th><spring:message code="trend"/></th>
<th><spring:message code="domain_name"/></th> <th><spring:message code="domain_name"/></th>
<th><spring:message code="unique_num"/></th> <th><spring:message code="unique_num"/></th>
<th><spring:message code="entrance_id"/></th> <th><spring:message code="area_id"/></th>
<th><spring:message code="packets"/></th> <th><spring:message code="packets"/></th>
<th><spring:message code="percentage"/> (<spring:message code="packets"/>)</th> <th><spring:message code="percentage"/> (<spring:message code="packets"/>)</th>
<th><spring:message code="GByte"/></th> <th><spring:message code="GByte"/></th>
@@ -217,7 +220,7 @@
"entranceId" : entranceId "entranceId" : entranceId
}, },
async : true, async : true,
timeout : 40000, timeout : 50000,
traditional:true, traditional:true,
success : function(data) { success : function(data) {
if (data != null && data.length > 0 && data[0].error != null) { if (data != null && data.length > 0 && data[0].error != null) {