流量统计app详情趋势统计图增加Gbps、PPS单位切换统计,导出图片增加标题与时间
(cherry picked from commit 2dd73adfbb)
This commit is contained in:
@@ -725,6 +725,9 @@ public final class Constants {
|
|||||||
public static final String TREND_TOTAL_REPORT=Configurations.getStringProperty("trendTotalReport","trendTotalReport");
|
public static final String TREND_TOTAL_REPORT=Configurations.getStringProperty("trendTotalReport","trendTotalReport");
|
||||||
public static final String TRAFFIC_APP_TREND=Configurations.getStringProperty("trafficAppTrend","trafficAppTrend");
|
public static final String TRAFFIC_APP_TREND=Configurations.getStringProperty("trafficAppTrend","trafficAppTrend");
|
||||||
public static final String APPCONN_RECORD_TOP100=Configurations.getStringProperty("appConnRecordTop100","appConnRecordTop100");
|
public static final String APPCONN_RECORD_TOP100=Configurations.getStringProperty("appConnRecordTop100","appConnRecordTop100");
|
||||||
|
public static final String TRAFFIC_APP_PPS_TREND=Configurations.getStringProperty("trafficAppPpsTrend","trafficAppPpsTrend");
|
||||||
|
public static final String TRAFFIC_APP_BPS_TREND=Configurations.getStringProperty("trafficAppBpsTrend","trafficAppBpsTrend");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* httpclient 工具超时时间设置
|
* httpclient 工具超时时间设置
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -481,11 +481,20 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
}
|
}
|
||||||
@RequestMapping("ajaxAppTrend")
|
@RequestMapping("ajaxAppTrend")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Map ajaxAppTrend(String beginDate,String endDate,Integer appType,Integer entranceId,Integer[] searchIspCode,Model model){
|
public Map ajaxAppTrend(String beginDate,String endDate,Integer appType,Integer entranceId,String searchQuotaType,Integer[] searchIspCode,Model model){
|
||||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
Map list = new HashMap();
|
Map list = new HashMap();
|
||||||
try {
|
try {
|
||||||
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_TREND;
|
//TRAFFIC_APP_PPS_TREND
|
||||||
|
String trafficApp=Constants.TRAFFIC_APP_TREND;
|
||||||
|
if("Unique Ip".equals(searchQuotaType)){
|
||||||
|
trafficApp=Constants.TRAFFIC_APP_TREND;
|
||||||
|
}else if("Gbps".equals(searchQuotaType)){
|
||||||
|
trafficApp=Constants.TRAFFIC_APP_BPS_TREND;
|
||||||
|
}else if("pps".equals(searchQuotaType)){
|
||||||
|
trafficApp=Constants.TRAFFIC_APP_PPS_TREND;
|
||||||
|
}
|
||||||
|
String url=Constants.DASHBOARD_URL+trafficApp;
|
||||||
URIBuilder uriBuilder = new URIBuilder(url);
|
URIBuilder uriBuilder = new URIBuilder(url);
|
||||||
uriBuilder.addParameter("searchStartTime",beginDate);
|
uriBuilder.addParameter("searchStartTime",beginDate);
|
||||||
uriBuilder.addParameter("searchEndTime",endDate);
|
uriBuilder.addParameter("searchEndTime",endDate);
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ mmLogoDetectionLog=v1/mmLogoDetectionLogs
|
|||||||
mmFaceRecognizationLog=v1/mmFaceRecognizationLogs
|
mmFaceRecognizationLog=v1/mmFaceRecognizationLogs
|
||||||
########################################
|
########################################
|
||||||
#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3
|
#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3
|
||||||
dashboardUrl=http://192.168.10.204:9999/galaxy-service/service/log/
|
dashboardUrl=http://192.168.11.64:8080/galaxy-service/service/log/
|
||||||
trafficIpActive=v1/trafficIpActive
|
trafficIpActive=v1/trafficIpActive
|
||||||
trafficProtocol=v1/trafficProtocol
|
trafficProtocol=v1/trafficProtocol
|
||||||
trafficApp=v1/trafficApp
|
trafficApp=v1/trafficApp
|
||||||
@@ -620,4 +620,6 @@ ntc_asn_number=NTC_ASN_NUMBER
|
|||||||
addRegionToCommonGroup=v1/addRegionToCommonGroup
|
addRegionToCommonGroup=v1/addRegionToCommonGroup
|
||||||
updateRegionToCommonGroup=v1/updateCommonGroupRegion
|
updateRegionToCommonGroup=v1/updateCommonGroupRegion
|
||||||
deleteRegionToCommonGroup=v1/delCommonGroupRegion
|
deleteRegionToCommonGroup=v1/delCommonGroupRegion
|
||||||
|
#\u6d41\u91cf\u7edf\u8ba1app\u8be6\u60c5\u8d8b\u52bf\u56feGbps.pps\u63a5\u53e3
|
||||||
|
trafficAppPpsTrend=v1/trafficAppPpsTrend
|
||||||
|
trafficAppBpsTrend=v1/trafficAppBpsTrend
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<div class="theme-panel hidden-xs hidden-sm">
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
<button type="button" class="btn btn-default"
|
<button type="button" class="btn btn-default"
|
||||||
@@ -154,12 +153,28 @@
|
|||||||
<!-- 搜索内容与操作按钮栏 -->
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
</form:form>
|
</form:form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 " id="appSelect">
|
||||||
|
<select id="unitType" class="selectpicker select2 input-small">
|
||||||
|
<option value="Unique Ip">Unique Ip</option>
|
||||||
|
<option value="Gbps">Gbps</option>
|
||||||
|
<option value="pps">pps</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row chart-realTime">
|
<div class="row chart-realTime">
|
||||||
<div id="chart-realTime" style="width: 97%; height: 430px; margin-top: 20px"></div>
|
<div id="chart-realTime" style="width: 97%; height: 430px; 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" />
|
||||||
<input id="timeData" type="hidden" />
|
<input id="timeData" type="hidden" />
|
||||||
|
<input id="c2sData" type="hidden" />
|
||||||
|
<input id="s2cData" type="hidden" />
|
||||||
|
<input id="totalData" type="hidden" />
|
||||||
<input id="appType" name="appType" type="hidden" value="${appType}" />
|
<input id="appType" name="appType" type="hidden" value="${appType}" />
|
||||||
<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}" />
|
||||||
@@ -230,10 +245,11 @@
|
|||||||
var entranceId2=$("#entranceId2").val();
|
var entranceId2=$("#entranceId2").val();
|
||||||
var isp1=$("#isp1").val();
|
var isp1=$("#isp1").val();
|
||||||
var isp2=$("#isp2").val();
|
var isp2=$("#isp2").val();
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
var searchQuota=$(".searchQuota[class~='active']").val();
|
var searchQuota=$(".searchQuota[class~='active']").val();
|
||||||
showRealTimeTransChart(appType,entranceId1,isp1);// 实时折线
|
showRealTimeTransChart(appType,entranceId1,isp1,unitType);// 实时折线
|
||||||
appTransAjax(starth,endh,appType,entranceId2,isp2);
|
appTransAjax(starth,endh,appType,entranceId2,isp2,unitType);
|
||||||
appTop100List(starth,endh,appType,entranceId2,searchQuota,isp2);
|
appTop100List(starth,endh,appType,entranceId2,searchQuota,isp2,unitType);
|
||||||
//筛选功能初始化
|
//筛选功能初始化
|
||||||
$("#resetBtn1").on("click",function() {
|
$("#resetBtn1").on("click",function() {
|
||||||
$("#searchForm1 select.selectpicker").each(function() {
|
$("#searchForm1 select.selectpicker").each(function() {
|
||||||
@@ -242,6 +258,12 @@
|
|||||||
// $(this).find("option:first").attr("selected",true);
|
// $(this).find("option:first").attr("selected",true);
|
||||||
});
|
});
|
||||||
$("#searchForm1")[0].reset();
|
$("#searchForm1")[0].reset();
|
||||||
|
$("#appSelect select.selectpicker").each(function() {
|
||||||
|
$(this).selectpicker('val',"Unique Ip");
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
$(this).find("option:first").attr("selected",true);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
//筛选功能初始化
|
//筛选功能初始化
|
||||||
$("#resetBtn2").on("click",function() {
|
$("#resetBtn2").on("click",function() {
|
||||||
@@ -251,10 +273,14 @@
|
|||||||
// $(this).find("option:first").attr("selected",true);
|
// $(this).find("option:first").attr("selected",true);
|
||||||
});
|
});
|
||||||
// $(".Wdate").attr("value", '');
|
// $(".Wdate").attr("value", '');
|
||||||
|
$("#appSelect select.selectpicker").each(function() {
|
||||||
|
$(this).selectpicker('val',"Unique Ip");
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
});
|
||||||
|
|
||||||
var deftime=(new Date().getTime())-(1000 * 60 * 60);
|
var deftime=(new Date().getTime())-(1000 * 60 * 60);
|
||||||
var defbegin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(deftime)); // 默认一小时
|
var defbegin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(deftime)); // 默认一小时
|
||||||
var defend=dateFtt("yyyy-MM-dd hh:mm:ss",new Date());
|
var defend=dateFtt("yyyy-MM-dd hh:mm:ss",new Date());
|
||||||
|
|
||||||
$("#searchForm2")[0].reset();
|
$("#searchForm2")[0].reset();
|
||||||
$("#beginDate").val(defbegin);
|
$("#beginDate").val(defbegin);
|
||||||
$("#endDate").val(defend);
|
$("#endDate").val(defend);
|
||||||
@@ -265,32 +291,82 @@
|
|||||||
})
|
})
|
||||||
$(".chart-history").addClass("hidden");
|
$(".chart-history").addClass("hidden");
|
||||||
$(".chart-realTime").removeClass("hidden");
|
$(".chart-realTime").removeClass("hidden");
|
||||||
|
|
||||||
$(".changeData").on("click",function(){
|
$(".changeData").on("click",function(){
|
||||||
|
loading();
|
||||||
$(".changeData").removeClass("active");
|
$(".changeData").removeClass("active");
|
||||||
$(this).addClass("active");
|
$(this).addClass("active");
|
||||||
|
$("#appSelect select.selectpicker").each(function() {
|
||||||
|
$(this).selectpicker('val',"Unique Ip");
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
});
|
||||||
|
|
||||||
|
var starth = $("#beginDateh").val();
|
||||||
|
var endh = $("#endDateh").val();
|
||||||
|
$("#beginDate").val(starth);
|
||||||
|
$("#endDate").val(endh);
|
||||||
|
var appType=$("#appType").val();
|
||||||
|
var entranceId1=$("#entranceId1").val();
|
||||||
|
var entranceId2=$("#entranceId2").val();
|
||||||
|
var isp1=$("#isp1").val();
|
||||||
|
var isp2=$("#isp2").val();
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
|
var searchQuota=$(".searchQuota[class~='active']").val();
|
||||||
if($(this).val()==1){
|
if($(this).val()==1){
|
||||||
|
showRealTimeTransChart(appType,entranceId1,isp1,unitType);// 实时折线
|
||||||
$(".chart-realTime").removeClass("hidden");
|
$(".chart-realTime").removeClass("hidden");
|
||||||
$(".chart-history").addClass("hidden");
|
$(".chart-history").addClass("hidden");
|
||||||
}else{
|
}else{
|
||||||
|
appTransAjax(starth,endh,appType,entranceId2,isp2,unitType);
|
||||||
$(".chart-realTime").addClass("hidden");
|
$(".chart-realTime").addClass("hidden");
|
||||||
$(".chart-history").removeClass("hidden");
|
$(".chart-history").removeClass("hidden");
|
||||||
}
|
}
|
||||||
|
/* if($(this).val()==1){
|
||||||
|
$(".chart-realTime").removeClass("hidden");
|
||||||
|
$(".chart-history").addClass("hidden");
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$(".chart-realTime").addClass("hidden");
|
||||||
|
$(".chart-history").removeClass("hidden");
|
||||||
|
|
||||||
|
} */
|
||||||
})
|
})
|
||||||
$('.pageView').hide();
|
$('.pageView').hide();
|
||||||
|
|
||||||
|
$("#unitType").on("change",function(){
|
||||||
|
loading();
|
||||||
|
var starth = $("#beginDateh").val();
|
||||||
|
var endh = $("#endDateh").val();
|
||||||
|
$("#beginDate").val(starth);
|
||||||
|
$("#endDate").val(endh);
|
||||||
|
var appType=$("#appType").val();
|
||||||
|
var entranceId1=$("#entranceId1").val();
|
||||||
|
var entranceId2=$("#entranceId2").val();
|
||||||
|
var isp1=$("#isp1").val();
|
||||||
|
var isp2=$("#isp2").val();
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
|
var searchQuota=$(".searchQuota[class~='active']").val();
|
||||||
|
showRealTimeTransChart(appType,entranceId1,isp1,unitType);// 实时折线
|
||||||
|
appTransAjax(starth,endh,appType,entranceId2,isp2,unitType);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 改变排序字段
|
// 改变排序字段
|
||||||
function changeOrderby(searchQuota) {
|
function changeOrderby(searchQuota) {
|
||||||
loading();
|
loading();
|
||||||
appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId2").val(),searchQuota,$("#isp2").val());
|
appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId2").val(),searchQuota,$("#isp2").val(),unitType=$("#unitType").val());
|
||||||
}
|
}
|
||||||
function searchList1() {
|
function searchList1() {
|
||||||
loading();
|
loading();
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
var appType=$("#appType").val();
|
var appType=$("#appType").val();
|
||||||
var entranceId1=$("#entranceId1").val();
|
var entranceId1=$("#entranceId1").val();
|
||||||
var isp1=$("#isp1").val();
|
var isp1=$("#isp1").val();
|
||||||
showRealTimeTransChart(appType,entranceId1,isp1);// 折线
|
showRealTimeTransChart(appType,entranceId1,isp1,unitType);// 折线
|
||||||
}
|
}
|
||||||
function searchList2() {
|
function searchList2() {
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
var start = $("#beginDate").val();
|
var start = $("#beginDate").val();
|
||||||
var end = $("#endDate").val();
|
var end = $("#endDate").val();
|
||||||
$("#beginDateh").val(start);
|
$("#beginDateh").val(start);
|
||||||
@@ -302,7 +378,7 @@
|
|||||||
var entranceId2=$("#entranceId2").val();
|
var entranceId2=$("#entranceId2").val();
|
||||||
var isp2=$("#isp2").val();
|
var isp2=$("#isp2").val();
|
||||||
var searchQuota=$(".searchQuota[class~='active']").val();
|
var searchQuota=$(".searchQuota[class~='active']").val();
|
||||||
appTransAjax(start,end,appType,entranceId2,isp2);// 折线
|
appTransAjax(start,end,appType,entranceId2,isp2,unitType);// 折线
|
||||||
appTop100List(start,end,appType,entranceId2,searchQuota,isp2);// 列表
|
appTop100List(start,end,appType,entranceId2,searchQuota,isp2);// 列表
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -318,7 +394,7 @@
|
|||||||
"appType" : appType,
|
"appType" : appType,
|
||||||
"entranceId" : entranceId,
|
"entranceId" : entranceId,
|
||||||
"searchQuota":searchQuota,
|
"searchQuota":searchQuota,
|
||||||
"searchIspCode":isp
|
"searchIspCode":isp,
|
||||||
},
|
},
|
||||||
async : true,
|
async : true,
|
||||||
timeout : 50000,
|
timeout : 50000,
|
||||||
@@ -403,7 +479,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// app曲线图
|
// app曲线图
|
||||||
function appTransAjax(beginDate, endDate,appType,entranceId,isp) {
|
function appTransAjax(beginDate, endDate,appType,entranceId,isp,unitType) {
|
||||||
loading();
|
loading();
|
||||||
$.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
$.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
||||||
type : "get",
|
type : "get",
|
||||||
@@ -414,18 +490,29 @@
|
|||||||
"endDate" : endDate,
|
"endDate" : endDate,
|
||||||
"appType" : appType,
|
"appType" : appType,
|
||||||
"entranceId" : entranceId,
|
"entranceId" : entranceId,
|
||||||
"searchIspCode":isp
|
"searchIspCode":isp,
|
||||||
|
"searchQuotaType":unitType
|
||||||
},
|
},
|
||||||
traditional:true,
|
traditional:true,
|
||||||
success : function(rs) {
|
success : function(rs) {
|
||||||
var series=new Array();
|
var series=new Array();
|
||||||
var sipResult=new Array();
|
var sipResult=new Array();
|
||||||
var dipResult=new Array();
|
var dipResult=new Array();
|
||||||
|
|
||||||
|
var c2sResult=new Array();
|
||||||
|
var s2cResult=new Array();
|
||||||
|
var totalResult=new Array();
|
||||||
|
|
||||||
var sipData=new Array();
|
var sipData=new Array();
|
||||||
var dipData=new Array();
|
var dipData=new Array();
|
||||||
var timeData=new Array();
|
var timeData=new Array();
|
||||||
|
|
||||||
|
var c2sData=new Array();
|
||||||
|
var s2cData=new Array();
|
||||||
|
var totalData=new Array();
|
||||||
var total=[];
|
var total=[];
|
||||||
if(rs!=null&&Object.keys(rs).length>0){
|
if(rs!=null&&Object.keys(rs).length>0){
|
||||||
|
if(unitType=='Unique Ip'){
|
||||||
sipResult=rs.sipResult;
|
sipResult=rs.sipResult;
|
||||||
dipResult=rs.dipResult
|
dipResult=rs.dipResult
|
||||||
total.push(rs.sipSum,rs.dipSum);
|
total.push(rs.sipSum,rs.dipSum);
|
||||||
@@ -437,15 +524,41 @@
|
|||||||
$(dipResult).each(function(i,d){
|
$(dipResult).each(function(i,d){
|
||||||
dipData.push(d[1])
|
dipData.push(d[1])
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
}else{
|
c2sResult=rs.c2sResult
|
||||||
total.push(0,0);
|
s2cResult=rs.s2cResult
|
||||||
}
|
totalResult=rs.totalResult
|
||||||
showActionHistoryChart(sipResult,dipResult);
|
|
||||||
|
// 图表导出用列
|
||||||
|
$(c2sResult).each(function(i,d){
|
||||||
|
c2sData.push(d[1])
|
||||||
|
timeData.push(d[0])
|
||||||
|
})
|
||||||
|
$(s2cResult).each(function(i,d){
|
||||||
|
s2cData.push(d[1])
|
||||||
|
})
|
||||||
|
$(totalResult).each(function(i,d){
|
||||||
|
totalData.push(d[1])
|
||||||
|
})
|
||||||
|
total.push('--','--','--');
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(unitType=='Unique Ip'){
|
||||||
|
total.push(0,0);
|
||||||
|
}else{
|
||||||
|
total.push('--','--','--');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showActionHistoryChart(sipResult,dipResult,c2sResult,s2cResult,totalResult);
|
||||||
$("#total").val(JSON.stringify(total));
|
$("#total").val(JSON.stringify(total));
|
||||||
$("#sipData").val(JSON.stringify(sipData));
|
$("#sipData").val(JSON.stringify(sipData));
|
||||||
$("#dipData").val(JSON.stringify(dipData));
|
$("#dipData").val(JSON.stringify(dipData));
|
||||||
$("#timeData").val(JSON.stringify(timeData));
|
$("#timeData").val(JSON.stringify(timeData));
|
||||||
|
|
||||||
|
$("#c2sData").val(JSON.stringify(c2sData));
|
||||||
|
$("#s2cData").val(JSON.stringify(s2cData));
|
||||||
|
$("#totalData").val(JSON.stringify(totalData));
|
||||||
|
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error : function(data, textStatus, errorThrown) {
|
error : function(data, textStatus, errorThrown) {
|
||||||
@@ -571,7 +684,8 @@
|
|||||||
$(".pageNum").text(Math.ceil(totalData/10));
|
$(".pageNum").text(Math.ceil(totalData/10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp){
|
|
||||||
|
function realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp,unitType){
|
||||||
var result={};
|
var result={};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
||||||
@@ -582,7 +696,8 @@
|
|||||||
"endDate" : endDate,
|
"endDate" : endDate,
|
||||||
"appType" : appType,
|
"appType" : appType,
|
||||||
"entranceId" : entranceId,
|
"entranceId" : entranceId,
|
||||||
"searchIspCode":isp
|
"searchIspCode":isp,
|
||||||
|
"searchQuotaType":unitType
|
||||||
},
|
},
|
||||||
async : false,
|
async : false,
|
||||||
traditional:true,
|
traditional:true,
|
||||||
@@ -601,16 +716,207 @@
|
|||||||
}
|
}
|
||||||
var timer=null;
|
var timer=null;
|
||||||
// 局点信息
|
// 局点信息
|
||||||
function showRealTimeTransChart(appType,entranceId,isp) {
|
function showRealTimeTransChart(appType,entranceId,isp,unitType) {
|
||||||
var time1=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
var time1=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
var time2=(new Date().getTime())-(1000 * 60 * 5);//推迟五分钟
|
var time2=(new Date().getTime())-(1000 * 60 * 5);//推迟五分钟
|
||||||
var beginDate=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time1)); //获取十个点
|
var beginDate=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time1)); //获取十个点
|
||||||
var endDate=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time2)); // 少算一分钟
|
var endDate=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time2)); // 少算一分钟
|
||||||
var sipResult=new Array();
|
var sipResult=new Array();
|
||||||
var dipResult=new Array();
|
var dipResult=new Array();
|
||||||
var intData = realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp); //初始化数据 为10个点
|
|
||||||
sipResult=intData.sipResult;
|
var c2sResult=new Array();
|
||||||
dipResult=intData.dipResult;
|
var s2cResult=new Array();
|
||||||
|
var totalResult=new Array();
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
|
var intData = realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp,unitType); //初始化数据 为10个点
|
||||||
|
var zxchart=null;
|
||||||
|
if(unitType=='Unique Ip'){
|
||||||
|
sipResult=intData.sipResult;
|
||||||
|
dipResult=intData.dipResult;
|
||||||
|
|
||||||
|
zxchart=[{
|
||||||
|
name: '<spring:message code="client_ip"/>',
|
||||||
|
lineColor:'#a9d4cf',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
data: (function () {
|
||||||
|
var data = [];
|
||||||
|
if(sipResult!=null&&sipResult.length>0){
|
||||||
|
var count=10;
|
||||||
|
if(sipResult.length<10){
|
||||||
|
count=sipResult.length;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
var d =sipResult[i];
|
||||||
|
var x = d[0], // 时间
|
||||||
|
y = d[1];
|
||||||
|
data.push({
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
for (var i = 0; i <10; i++) {
|
||||||
|
data.push({
|
||||||
|
x: time + i * 1000*60,
|
||||||
|
y: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}())
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '<spring:message code="server_ip"/>',
|
||||||
|
lineColor:'#eecf8d',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
data: (function () {
|
||||||
|
var data = [];
|
||||||
|
if(dipResult!=null&&dipResult.length>0){
|
||||||
|
var count=10;
|
||||||
|
if(dipResult.length<10){
|
||||||
|
count=dipResult.length;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
var d =dipResult[i];
|
||||||
|
var x = d[0], // 当前时间
|
||||||
|
y = d[1];
|
||||||
|
data.push({
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
for (var i = 0; i <10; i++) {
|
||||||
|
data.push({
|
||||||
|
x: time + i * 1000*60,
|
||||||
|
y: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}())
|
||||||
|
}]
|
||||||
|
|
||||||
|
}else{
|
||||||
|
c2sResult=intData.c2sResult;
|
||||||
|
s2cResult=intData.s2cResult;
|
||||||
|
totalResult=intData.totalResult;
|
||||||
|
|
||||||
|
zxchart=[{
|
||||||
|
name: 'c2s',
|
||||||
|
lineColor:'#a9d4cf',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
data: (function () {
|
||||||
|
var data = [];
|
||||||
|
if(c2sResult!=null&&c2sResult.length>0){
|
||||||
|
var count=10;
|
||||||
|
if(c2sResult.length<10){
|
||||||
|
count=c2sResult.length;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
var d =c2sResult[i];
|
||||||
|
var x = d[0], // 时间
|
||||||
|
y = d[1];
|
||||||
|
data.push({
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
for (var i = 0; i <10; i++) {
|
||||||
|
data.push({
|
||||||
|
x: time + i * 1000*60,
|
||||||
|
y: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}())
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 's2c',
|
||||||
|
lineColor:'#eecf8d',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
data: (function () {
|
||||||
|
var data = [];
|
||||||
|
if(s2cResult!=null&&s2cResult.length>0){
|
||||||
|
var count=10;
|
||||||
|
if(s2cResult.length<10){
|
||||||
|
count=s2cResult.length;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
var d =s2cResult[i];
|
||||||
|
var x = d[0], // 当前时间
|
||||||
|
y = d[1];
|
||||||
|
data.push({
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
for (var i = 0; i <10; i++) {
|
||||||
|
data.push({
|
||||||
|
x: time + i * 1000*60,
|
||||||
|
y: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}())
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'total',
|
||||||
|
lineColor:'#ebb093',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
data: (function () {
|
||||||
|
var data = [];
|
||||||
|
if(totalResult!=null&&totalResult.length>0){
|
||||||
|
var count=10;
|
||||||
|
if(totalResult.length<10){
|
||||||
|
count=totalResult.length;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
var d =totalResult[i];
|
||||||
|
var x = d[0], // 当前时间
|
||||||
|
y = d[1];
|
||||||
|
data.push({
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
for (var i = 0; i <10; i++) {
|
||||||
|
data.push({
|
||||||
|
x: time + i * 1000*60,
|
||||||
|
y: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}())
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
var nowDate=new Date();
|
var nowDate=new Date();
|
||||||
Highcharts.setOptions({ global: { useUTC: false } });
|
Highcharts.setOptions({ global: { useUTC: false } });
|
||||||
var num=0;
|
var num=0;
|
||||||
@@ -650,9 +956,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors:['#a9d4cf','#eecf8d'],
|
colors:['#a9d4cf','#eecf8d','#ebb093'],
|
||||||
title : {
|
title : {
|
||||||
text : null
|
text : (function () {
|
||||||
|
var timebe=(new Date().getTime())-(1000 * 60 * 6);
|
||||||
|
var start=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
var begin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(start)); //获取1个点少算一分钟
|
||||||
|
var end=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(timebe));
|
||||||
|
var tlt='<spring:message code="${appName}"></spring:message> '+begin+'--'+end+''
|
||||||
|
return tlt;
|
||||||
|
}())
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type:'datetime',
|
type:'datetime',
|
||||||
@@ -707,85 +1022,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [{
|
series: zxchart
|
||||||
name: '<spring:message code="client_ip"/>',
|
|
||||||
lineColor:'#a9d4cf',
|
|
||||||
lineWidth:1,
|
|
||||||
marker: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
data: (function () {
|
|
||||||
var data = [];
|
|
||||||
if(sipResult!=null&&sipResult.length>0){
|
|
||||||
var count=10;
|
|
||||||
if(sipResult.length<10){
|
|
||||||
count=sipResult.length;
|
|
||||||
}
|
|
||||||
for (var i = 0; i < count; i++) {
|
|
||||||
var d =sipResult[i];
|
|
||||||
var x = d[0], // 时间
|
|
||||||
y = d[1];
|
|
||||||
data.push({
|
|
||||||
x: x,
|
|
||||||
y: y
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else{
|
|
||||||
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
|
||||||
for (var i = 0; i <10; i++) {
|
|
||||||
data.push({
|
|
||||||
x: time + i * 1000*60,
|
|
||||||
y: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}())
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '<spring:message code="server_ip"/>',
|
|
||||||
lineColor:'#a9d4cf',
|
|
||||||
lineWidth:1,
|
|
||||||
marker: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
data: (function () {
|
|
||||||
var data = [];
|
|
||||||
if(dipResult!=null&&dipResult.length>0){
|
|
||||||
var count=10;
|
|
||||||
if(dipResult.length<10){
|
|
||||||
count=dipResult.length;
|
|
||||||
}
|
|
||||||
for (var i = 0; i < count; i++) {
|
|
||||||
var d =dipResult[i];
|
|
||||||
var x = d[0], // 当前时间
|
|
||||||
y = d[1];
|
|
||||||
data.push({
|
|
||||||
x: x,
|
|
||||||
y: y
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
var time = (new Date()).getTime()-(1000 * 60 * 10+1000 * 60 * 5);
|
|
||||||
for (var i = 0; i <10; i++) {
|
|
||||||
data.push({
|
|
||||||
x: time + i * 1000*60,
|
|
||||||
y: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}())
|
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var series = chart.series[0];
|
var series = chart.series[0];
|
||||||
var series1 = chart.series[1];
|
var series1 = chart.series[1];
|
||||||
|
if(unitType!='Unique Ip'){
|
||||||
|
var series2 = chart.series[2];
|
||||||
|
}
|
||||||
window.clearInterval(timer);
|
window.clearInterval(timer);
|
||||||
// if(sipResult!=null&&sipResult.length>0){
|
// if(sipResult!=null&&sipResult.length>0){
|
||||||
|
var nu=0;
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
timer=setInterval(function() {
|
timer=setInterval(function() {
|
||||||
var time3=(new Date().getTime())-(1000 * 60 * 5);
|
var time3=(new Date().getTime())-(1000 * 60 * 5);
|
||||||
var time4=(new Date().getTime())-(1000 * 60 * 4);
|
var time4=(new Date().getTime())-(1000 * 60 * 4);
|
||||||
|
var c2sResult=new Array();
|
||||||
|
var s2cResult=new Array();
|
||||||
|
var totalResult=new Array();
|
||||||
var begin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time3)); //获取1个点少算一分钟
|
var begin=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time3)); //获取1个点少算一分钟
|
||||||
var end=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time4));
|
var end=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(time4));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -798,26 +1052,53 @@
|
|||||||
"endDate" : end,
|
"endDate" : end,
|
||||||
"appType" : appType,
|
"appType" : appType,
|
||||||
"entranceId" : entranceId,
|
"entranceId" : entranceId,
|
||||||
"searchIspCode":isp
|
"searchIspCode":isp,
|
||||||
|
"searchQuotaType":unitType
|
||||||
},
|
},
|
||||||
async : true,
|
async : true,
|
||||||
traditional:true,
|
traditional:true,
|
||||||
success : function(rs) {
|
success : function(rs) {
|
||||||
var realTimeData=rs;
|
var realTimeData=rs;
|
||||||
if(realTimeData!=null&&Object.keys(realTimeData).length>0){
|
if(realTimeData!=null&&Object.keys(realTimeData).length>0){
|
||||||
var sipReal=realTimeData.sipResult;
|
if(unitType=='Unique Ip'){
|
||||||
var dipReal=realTimeData.dipResult;
|
var sipReal=realTimeData.sipResult;
|
||||||
var d =sipReal[0];
|
var dipReal=realTimeData.dipResult;
|
||||||
|
|
||||||
|
var d =sipReal[0];
|
||||||
series.addPoint([d[0], d[1]], true, true);
|
series.addPoint([d[0], d[1]], true, true);
|
||||||
var t =dipReal[0];
|
var t =dipReal[0];
|
||||||
series1.addPoint([t[0], t[1]], true, true);
|
series1.addPoint([t[0], t[1]], true, true);
|
||||||
|
}else{
|
||||||
|
var c2sRes=realTimeData.c2sResult;
|
||||||
|
var s2cRes=realTimeData.s2cResult;
|
||||||
|
var totalRes=realTimeData.totalResult;
|
||||||
|
|
||||||
|
var d =c2sRes[0];
|
||||||
|
series.addPoint([d[0], d[1]], true, true);
|
||||||
|
var t =s2cRes[0];
|
||||||
|
series1.addPoint([t[0], t[1]], true, true);
|
||||||
|
var s =totalRes[0];
|
||||||
|
series2.addPoint([s[0], s[1]], true, true);
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
var x=(new Date()).getTime()-(1000 * 60 * 5);
|
var x=(new Date()).getTime()-(1000 * 60 * 5);
|
||||||
var y=0;
|
var y=0;
|
||||||
series.addPoint([x, y], true, true);
|
if(unitType=='Unique Ip'){
|
||||||
series1.addPoint([x, y], true, true);
|
series.addPoint([x, y], true, true);
|
||||||
|
series1.addPoint([x, y], true, true);
|
||||||
|
}else{
|
||||||
|
series.addPoint([x, y], true, true);
|
||||||
|
series1.addPoint([x, y], true, true);
|
||||||
|
series2.addPoint([x, y], true, true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var start=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
||||||
|
var startTime=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(start));
|
||||||
|
var ends=(new Date().getTime())-(1000 * 60 * 5);
|
||||||
|
var endTime=dateFtt("yyyy-MM-dd hh:mm:ss",new Date(ends));
|
||||||
|
chart.title.update({ text: '<spring:message code="${appName}"></spring:message> '+startTime+'--'+endTime+''});
|
||||||
closeTip();
|
closeTip();
|
||||||
},
|
},
|
||||||
error : function(data, textStatus, errorThrown) {
|
error : function(data, textStatus, errorThrown) {
|
||||||
@@ -833,10 +1114,61 @@
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
// 历史信息
|
// 历史信息
|
||||||
function showActionHistoryChart(sipResult,dipResult) {
|
function showActionHistoryChart(sipResult,dipResult,c2sResult,s2cResult,totalResult) {
|
||||||
var nowDate=new Date();
|
var nowDate=new Date();
|
||||||
Highcharts.setOptions({ global: { useUTC: false } });
|
Highcharts.setOptions({ global: { useUTC: false } });
|
||||||
var num=0;
|
var num=0;
|
||||||
|
var lsChart=null;
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
|
if(unitType=='Unique Ip'){
|
||||||
|
lsChart= [{
|
||||||
|
name: '<spring:message code="client_ip"/>',
|
||||||
|
data: sipResult,
|
||||||
|
lineColor:'#a9d4cf',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '<spring:message code="server_ip"/>',
|
||||||
|
data: dipResult,
|
||||||
|
lineColor:'#eecf8d',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}else{
|
||||||
|
lsChart= [{
|
||||||
|
name: 'c2s',
|
||||||
|
data: c2sResult,
|
||||||
|
lineColor:'#a9d4cf',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 's2c',
|
||||||
|
data: s2cResult,
|
||||||
|
lineColor:'#eecf8d',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'total',
|
||||||
|
data: totalResult,
|
||||||
|
lineColor:'#ebb093',
|
||||||
|
lineWidth:1,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
var chart = Highcharts.chart('chart-history',
|
var chart = Highcharts.chart('chart-history',
|
||||||
{
|
{
|
||||||
chart: {
|
chart: {
|
||||||
@@ -867,9 +1199,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors:['#a9d4cf','#eecf8d'],
|
colors:['#a9d4cf','#eecf8d','#ebb093'],
|
||||||
title : {
|
title : {
|
||||||
text : null
|
text : '<spring:message code="${appName}"></spring:message> '+$("#beginDateh").val()+'--'+$("#endDateh").val()+''
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type:'datetime',
|
type:'datetime',
|
||||||
@@ -924,24 +1256,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [{
|
series:lsChart
|
||||||
name: '<spring:message code="client_ip"/>',
|
|
||||||
data: sipResult,
|
|
||||||
lineColor:'#a9d4cf',
|
|
||||||
lineWidth:1,
|
|
||||||
marker: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '<spring:message code="server_ip"/>',
|
|
||||||
data: dipResult,
|
|
||||||
lineColor:'#eecf8d',
|
|
||||||
lineWidth:1,
|
|
||||||
marker: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
(function(H) {
|
(function(H) {
|
||||||
@@ -954,6 +1269,7 @@
|
|||||||
rows.shift(); // 删除一个重复行
|
rows.shift(); // 删除一个重复行
|
||||||
var total=[];
|
var total=[];
|
||||||
var map={};
|
var map={};
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
if(heard[0].indexOf("History") != -1){
|
if(heard[0].indexOf("History") != -1){
|
||||||
rows = [];
|
rows = [];
|
||||||
/* 调用后台接口导出 */
|
/* 调用后台接口导出 */
|
||||||
@@ -961,13 +1277,27 @@
|
|||||||
var timeData = JSON.parse($("#timeData").val());
|
var timeData = JSON.parse($("#timeData").val());
|
||||||
var sipData = JSON.parse($("#sipData").val());
|
var sipData = JSON.parse($("#sipData").val());
|
||||||
var dipData = JSON.parse($("#dipData").val());
|
var dipData = JSON.parse($("#dipData").val());
|
||||||
for(var i=0;i<sipData.length;i++){
|
|
||||||
var colData=[];
|
var c2sData = JSON.parse($("#c2sData").val());
|
||||||
var time=new Date(timeData[i]); //
|
var s2cData = JSON.parse($("#s2cData").val());
|
||||||
var ftime=dateFtt("yyyy-MM-dd hh:mm:ss",time);
|
var totalData = JSON.parse($("#totalData").val());
|
||||||
colData.push(ftime,sipData[i],dipData[i])
|
if(unitType=='Unique Ip'){
|
||||||
rows.push(colData)
|
for(var i=0;i<sipData.length;i++){
|
||||||
}
|
var colData=[];
|
||||||
|
var time=new Date(timeData[i]); //
|
||||||
|
var ftime=dateFtt("yyyy-MM-dd hh:mm:ss",time);
|
||||||
|
colData.push(ftime,sipData[i],dipData[i]);
|
||||||
|
rows.push(colData)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for(var i=0;i<c2sData.length;i++){
|
||||||
|
var colData=[];
|
||||||
|
var time=new Date(timeData[i]); //
|
||||||
|
var ftime=dateFtt("yyyy-MM-dd hh:mm:ss",time);
|
||||||
|
colData.push(ftime,c2sData[i],c2sData[i],totalData[i])
|
||||||
|
rows.push(colData)
|
||||||
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
var siptotal=0;
|
var siptotal=0;
|
||||||
var diptotal=0;
|
var diptotal=0;
|
||||||
@@ -983,7 +1313,12 @@
|
|||||||
diptotal=diptotal+Number(d[2]);
|
diptotal=diptotal+Number(d[2]);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
total.push(siptotal,diptotal);
|
if(unitType=='Unique Ip'){
|
||||||
|
total.push(siptotal,diptotal);
|
||||||
|
}else{
|
||||||
|
total.push('--','--','--');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
total.unshift('<spring:message code="report_total"/>');
|
total.unshift('<spring:message code="report_total"/>');
|
||||||
rows.push(total)
|
rows.push(total)
|
||||||
@@ -1005,6 +1340,7 @@
|
|||||||
var total=[];
|
var total=[];
|
||||||
var start = "";
|
var start = "";
|
||||||
var end = "";
|
var end = "";
|
||||||
|
var unitType=$("#unitType").val();
|
||||||
if(heard[0].indexOf("History") != -1){
|
if(heard[0].indexOf("History") != -1){
|
||||||
start = $("#beginDateh").val();
|
start = $("#beginDateh").val();
|
||||||
end = $("#endDateh").val();
|
end = $("#endDateh").val();
|
||||||
@@ -1012,27 +1348,68 @@
|
|||||||
var timeData = JSON.parse($("#timeData").val());
|
var timeData = JSON.parse($("#timeData").val());
|
||||||
var sipData = JSON.parse($("#sipData").val());
|
var sipData = JSON.parse($("#sipData").val());
|
||||||
var dipData = JSON.parse($("#dipData").val());
|
var dipData = JSON.parse($("#dipData").val());
|
||||||
for(var i=0;i<sipData.length;i++){
|
|
||||||
var colData=[];
|
var c2sData = JSON.parse($("#c2sData").val());
|
||||||
var time=new Date(timeData[i]); //
|
var s2cData = JSON.parse($("#s2cData").val());
|
||||||
var ftime=dateFtt("yyyy-MM-dd hh:mm:ss",time);
|
var totalData = JSON.parse($("#totalData").val());
|
||||||
colData.push(ftime,sipData[i],dipData[i])
|
if(unitType=='Unique Ip'){
|
||||||
data.push({
|
for(var i=0;i<sipData.length;i++){
|
||||||
num1:ftime,
|
var colData=[];
|
||||||
num2:sipData[i],
|
var time=new Date(timeData[i]); //
|
||||||
num3:dipData[i],
|
var ftime=dateFtt("yyyy-MM-dd hh:mm:ss",time);
|
||||||
|
colData.push(ftime,sipData[i],dipData[i])
|
||||||
|
data.push({
|
||||||
|
num1:ftime,
|
||||||
|
num2:sipData[i],
|
||||||
|
num3:dipData[i],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
data.unshift({
|
||||||
|
num1:'RealTime',
|
||||||
|
num2:'<spring:message code="client_ip"/>',
|
||||||
|
num3:'<spring:message code="server_ip"/>',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
}else{
|
||||||
|
for(var i=0;i<c2sData.length;i++){
|
||||||
|
var colData=[];
|
||||||
|
var time=new Date(timeData[i]); //
|
||||||
|
var ftime=dateFtt("yyyy-MM-dd hh:mm:ss",time);
|
||||||
|
colData.push(ftime,c2sData[i],s2cData[i],totalData[i])
|
||||||
|
data.push({
|
||||||
|
num1:ftime,
|
||||||
|
num2:c2sData[i],
|
||||||
|
num3:s2cData[i],
|
||||||
|
num4:totalData[i],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
data.unshift({
|
||||||
|
num1:'RealTime',
|
||||||
|
num2:'c2s',
|
||||||
|
num3:'s2c',
|
||||||
|
num4:'total',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
var siptotal=0;
|
var siptotal=0;
|
||||||
var diptotal=0;
|
var diptotal=0;
|
||||||
$(rows).each(function (i,d){
|
$(rows).each(function (i,d){
|
||||||
if(d!=null){
|
if(d!=null){
|
||||||
|
if(unitType=='Unique Ip'){
|
||||||
data.push({
|
data.push({
|
||||||
num1:d[0],
|
num1:d[0],
|
||||||
num2:d[1],
|
num2:d[1],
|
||||||
num3:d[2],
|
num3:d[2],
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
data.push({
|
||||||
|
num1:d[0],
|
||||||
|
num2:d[1],
|
||||||
|
num3:d[2],
|
||||||
|
num4:d[3],
|
||||||
|
});
|
||||||
|
}
|
||||||
if(i>0){
|
if(i>0){
|
||||||
if(i==1){
|
if(i==1){
|
||||||
start=d[0];
|
start=d[0];
|
||||||
@@ -1045,17 +1422,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
total.push(siptotal,diptotal);
|
if(unitType=='Unique Ip'){
|
||||||
|
total.push(siptotal,diptotal);
|
||||||
|
}else{
|
||||||
|
total.push('--','--','--');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data.push({
|
data.push({
|
||||||
num1:"<spring:message code='report_total'/>",
|
num1:"<spring:message code='report_total'/>",
|
||||||
num2:total
|
num2:total
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var titleKey=null;
|
||||||
|
if(unitType=='Unique Ip'){
|
||||||
|
titleKey=["num1","num2","num3"];
|
||||||
|
}else{
|
||||||
|
titleKey=["num1","num2","num3","num4"];
|
||||||
|
}
|
||||||
exportCsv({
|
exportCsv({
|
||||||
title:["<spring:message code='${appName}'/>",start+"--"+end],
|
title:["<spring:message code='${appName}'/>",start+"--"+end],
|
||||||
titleForKey:["num1","num2","num3"],
|
titleForKey:titleKey,
|
||||||
data:data
|
data:data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user