流量统计调整为异步调用,初始化参数
This commit is contained in:
@@ -197,7 +197,7 @@
|
|||||||
url : "${ctx}/dashboard/traffic/ajaxNtcTotalReportDetail?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate,
|
url : "${ctx}/dashboard/traffic/ajaxNtcTotalReportDetail?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate,
|
||||||
type : "get",
|
type : "get",
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
async : false,
|
async : true,
|
||||||
success : function(rs) {
|
success : function(rs) {
|
||||||
var data = new Array();
|
var data = new Array();
|
||||||
var xData = new Array();
|
var xData = new Array();
|
||||||
|
|||||||
@@ -96,24 +96,7 @@ function searchList(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 局点信息
|
// 局点信息
|
||||||
function showActionTransChart(rs){
|
function showActionTransChart(xData,series){
|
||||||
var data=new Array();
|
|
||||||
var xData=new Array();
|
|
||||||
xData=rs[0].statTime;
|
|
||||||
var series=new Array();
|
|
||||||
$(rs).each(function(i, d) {
|
|
||||||
var entrance="";
|
|
||||||
if(d!=null&&d.entranceId==1){
|
|
||||||
entrance="Astana";
|
|
||||||
}
|
|
||||||
if(d!=null&&d.entranceId==2){
|
|
||||||
entrance="Alamty";
|
|
||||||
}
|
|
||||||
series.push({
|
|
||||||
name: entrance,
|
|
||||||
data: d.count
|
|
||||||
});
|
|
||||||
})
|
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
// type: 'area',
|
// type: 'area',
|
||||||
@@ -184,10 +167,37 @@ function showActionTransChart(rs){
|
|||||||
url: "${ctx}/dashboard/traffic/actionEntranceTrans?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate,
|
url: "${ctx}/dashboard/traffic/actionEntranceTrans?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate,
|
||||||
type : "get" ,
|
type : "get" ,
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
cache:false,
|
|
||||||
async:true,
|
async:true,
|
||||||
success:function (rs) {
|
success:function (rs) {
|
||||||
showActionTransChart(rs);
|
var xData=new Array();
|
||||||
|
var series=new Array();
|
||||||
|
if(rs!=null&&rs.length>0){
|
||||||
|
xData=rs[0].statTime;
|
||||||
|
$(rs).each(function(i, d) {
|
||||||
|
var entrance="";
|
||||||
|
if(d!=null&&d.entranceId==1){
|
||||||
|
entrance="Astana";
|
||||||
|
}
|
||||||
|
if(d!=null&&d.entranceId==2){
|
||||||
|
entrance="Alamty";
|
||||||
|
}
|
||||||
|
series.push({
|
||||||
|
name: entrance,
|
||||||
|
data: d.count
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
series.push({
|
||||||
|
name: "Astana",
|
||||||
|
data: []
|
||||||
|
});
|
||||||
|
series.push({
|
||||||
|
name: "Alamty",
|
||||||
|
data: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
showActionTransChart(xData,series);
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error: function(data, textStatus, errorThrown){
|
error: function(data, textStatus, errorThrown){
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ function ajaxAppList(start,end){
|
|||||||
type: 'get',
|
type: 'get',
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data:{"beginDate":start,"endDate":end,"appType":appType},
|
data:{"beginDate":start,"endDate":end,"appType":appType},
|
||||||
async:false,
|
async:true,
|
||||||
timeout:10000,
|
timeout:10000,
|
||||||
traditional:true,
|
traditional:true,
|
||||||
success:function (data){
|
success:function (data){
|
||||||
|
|||||||
@@ -54,14 +54,25 @@ $(document).ready(function(){
|
|||||||
type : "get" ,
|
type : "get" ,
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId,"domain":domain},
|
data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId,"domain":domain},
|
||||||
cache:false,
|
async:true,
|
||||||
async:false,
|
|
||||||
timeout:40000,
|
timeout:40000,
|
||||||
success:function (rs) {
|
success:function (rs) {
|
||||||
$("#tbodyData").html("");
|
$("#tbodyData").html("");
|
||||||
|
var xData=new Array();
|
||||||
|
var series=new Array();
|
||||||
if(rs!=null&&rs.length>0){
|
if(rs!=null&&rs.length>0){
|
||||||
showDomainTrans(rs);
|
xData=rs[0].statTime;
|
||||||
|
series.push({
|
||||||
|
name: 'unique',
|
||||||
|
data: rs[0].count
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
series.push({
|
||||||
|
name: 'unique',
|
||||||
|
data: []
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
showDomainTrans(xData,series);
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error: function(data, textStatus, errorThrown){
|
error: function(data, textStatus, errorThrown){
|
||||||
@@ -73,18 +84,8 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
function showDomainTrans(rs){
|
function showDomainTrans(xData,series){
|
||||||
var domainName= $("#domainName").val();
|
var domainName= $("#domainName").val();
|
||||||
var data=new Array();
|
|
||||||
var xData=new Array();
|
|
||||||
xData=rs[0].statTime;
|
|
||||||
var series=new Array();
|
|
||||||
// $(rs).each(function(i, d) {
|
|
||||||
series.push({
|
|
||||||
name: 'unique',
|
|
||||||
data: rs[0].count
|
|
||||||
});
|
|
||||||
// })
|
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
// type: 'area',
|
// type: 'area',
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ function ajaxProtocolList(start,end){
|
|||||||
type: 'get',
|
type: 'get',
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data:{"beginDate":start,"endDate":end},
|
data:{"beginDate":start,"endDate":end},
|
||||||
async:false,
|
async:true,
|
||||||
timeout:10000,
|
timeout:10000,
|
||||||
beforeSend:function(){
|
beforeSend:function(){
|
||||||
loading();
|
loading();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<!-- 搜索内容与操作按钮栏 -->
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
</form:form>
|
</form:form>
|
||||||
</div>
|
</div>
|
||||||
<div id="chart" style="width:95%;height:350px;"></div>
|
<div id="chart" style="width:95%;height:360px;margin-top: 20px"></div>
|
||||||
<input id="total" type="hidden"/>
|
<input id="total" type="hidden"/>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="portlet">
|
<div class="portlet">
|
||||||
@@ -164,22 +164,8 @@ function searchList(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showIpActiveChart(rs){
|
function showIpActiveChart(xData,series){
|
||||||
var data=new Array();
|
|
||||||
var xData=new Array();
|
|
||||||
xData=rs[0].statTime;
|
|
||||||
var series=new Array();
|
|
||||||
var total=[];
|
|
||||||
$(rs).each(function(i, d) {
|
|
||||||
total.push(
|
|
||||||
sum(d.linkNum)
|
|
||||||
)
|
|
||||||
series.push({
|
|
||||||
name: d.ipAddr,
|
|
||||||
data: d.linkNum
|
|
||||||
});
|
|
||||||
})
|
|
||||||
$("#total").val(JSON.stringify(total));
|
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
//type: 'area',
|
//type: 'area',
|
||||||
@@ -252,14 +238,31 @@ function showIpActiveChart(rs){
|
|||||||
type : "get",
|
type : "get",
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
data:{"beginDate":beginDate,"endDate":endDate},
|
data:{"beginDate":beginDate,"endDate":endDate},
|
||||||
cache:false,
|
async:true,
|
||||||
async:false,
|
timeout:50000,
|
||||||
timeout:40000,
|
|
||||||
success:function (rs) {
|
success:function (rs) {
|
||||||
$("#tbodyData").html("");
|
var total=[];
|
||||||
|
var xData=new Array();
|
||||||
|
var series=new Array();
|
||||||
if(rs!=null&&rs.length>0){
|
if(rs!=null&&rs.length>0){
|
||||||
showIpActiveChart(rs);
|
xData=rs[0].statTime;
|
||||||
|
$(rs).each(function(i, d) {
|
||||||
|
total.push(
|
||||||
|
sum(d.linkNum)
|
||||||
|
)
|
||||||
|
series.push({
|
||||||
|
name: d.ipAddr,
|
||||||
|
data: d.linkNum
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
series.push({
|
||||||
|
name: " ",
|
||||||
|
data: []
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
$("#total").val(JSON.stringify(total));
|
||||||
|
showIpActiveChart(xData,series);
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error: function(data, textStatus, errorThrown){
|
error: function(data, textStatus, errorThrown){
|
||||||
@@ -272,17 +275,16 @@ function showIpActiveChart(rs){
|
|||||||
}
|
}
|
||||||
//活跃IP一小时统计
|
//活跃IP一小时统计
|
||||||
function ipActiveOneHourList(beginDate,endDate){
|
function ipActiveOneHourList(beginDate,endDate){
|
||||||
|
$("#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},
|
||||||
cache:false,
|
async:true,
|
||||||
async:false,
|
timeout:50000,
|
||||||
timeout:40000,
|
|
||||||
success:function (data) {
|
success:function (data) {
|
||||||
$("#tbodyData").html("");
|
|
||||||
if(data!=null&&data.length>0){
|
if(data!=null&&data.length>0){
|
||||||
var totalc2sByte= 0;
|
var totalc2sByte= 0;
|
||||||
var totals2cByte= 0;
|
var totals2cByte= 0;
|
||||||
|
|||||||
@@ -104,18 +104,8 @@ function searchList(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPortActiveChart(rs){
|
function showPortActiveChart(xData,series){
|
||||||
var data=new Array();
|
|
||||||
var xData=new Array();
|
|
||||||
xData=rs[0].statTime;
|
|
||||||
var series=new Array();
|
|
||||||
var legend=new Array();
|
|
||||||
$(rs).each(function(i, d) {
|
|
||||||
series.push({
|
|
||||||
name: d.port,
|
|
||||||
data: d.sum
|
|
||||||
});
|
|
||||||
})
|
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
// type: 'area',
|
// type: 'area',
|
||||||
@@ -183,19 +173,32 @@ function showPortActiveChart(rs){
|
|||||||
//活跃IP一小时间隔五分钟统计
|
//活跃IP一小时间隔五分钟统计
|
||||||
function portActiveMinuteList(beginDate,endDate){
|
function portActiveMinuteList(beginDate,endDate){
|
||||||
loading();
|
loading();
|
||||||
|
$("#tbodyData").html("");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '${ctx}/dashboard/portActiveChart',
|
url: '${ctx}/dashboard/portActiveChart',
|
||||||
type : "get" ,
|
type : "get" ,
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
data:{"beginDate":beginDate,"endDate":endDate},
|
data:{"beginDate":beginDate,"endDate":endDate},
|
||||||
cache:false,
|
async:true,
|
||||||
async:false,
|
|
||||||
timeout:40000,
|
timeout:40000,
|
||||||
success:function (rs) {
|
success:function (rs) {
|
||||||
$("#tbodyData").html("");
|
var xData=new Array();
|
||||||
|
var series=new Array();
|
||||||
if(rs!=null&&rs.length>0){
|
if(rs!=null&&rs.length>0){
|
||||||
showPortActiveChart(rs);
|
xData=rs[0].statTime;
|
||||||
|
$(rs).each(function(i, d) {
|
||||||
|
series.push({
|
||||||
|
name: d.port,
|
||||||
|
data: d.sum
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
series.push({
|
||||||
|
name: " ",
|
||||||
|
data: []
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
showPortActiveChart(xData,series);
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error: function(data, textStatus, errorThrown){
|
error: function(data, textStatus, errorThrown){
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ function ajaxProtocolList(start,end){
|
|||||||
type: 'get',
|
type: 'get',
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data:{"beginDate":start,"endDate":end,"protoType":protoType},
|
data:{"beginDate":start,"endDate":end,"protoType":protoType},
|
||||||
async:false,
|
async:true,
|
||||||
timeout:40000,
|
timeout:40000,
|
||||||
traditional:true,
|
traditional:true,
|
||||||
beforeSend:function(){
|
beforeSend:function(){
|
||||||
|
|||||||
@@ -214,16 +214,14 @@
|
|||||||
"domain" : domain,
|
"domain" : domain,
|
||||||
"entranceId" : entranceId
|
"entranceId" : entranceId
|
||||||
},
|
},
|
||||||
async : false,
|
async : true,
|
||||||
timeout : 40000,
|
timeout : 40000,
|
||||||
traditional:true,
|
traditional:true,
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
if (data != null && data.length > 0
|
if (data != null && data.length > 0 && data[0].error != null) {
|
||||||
&& data[0].error != null) {
|
top.$.jBox.tip(
|
||||||
top.$.jBox
|
"<spring:message code='request_service_failed'/>",
|
||||||
.tip(
|
"<spring:message code='info'/>");
|
||||||
"<spring:message code='request_service_failed'/>",
|
|
||||||
"<spring:message code='info'/>");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
webTypeChart(data)
|
webTypeChart(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user