@@ -47,6 +47,7 @@ import com.nis.util.DateUtil;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeResult;
|
||||
@@ -469,7 +470,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
@RequestMapping("ajaxAppTrend")
|
||||
@ResponseBody
|
||||
public Map ajaxAppTrend(String beginDate,String endDate,Integer appType,Integer entranceId,Model model){
|
||||
public Map ajaxAppTrend(String beginDate,String endDate,Integer appType,Integer entranceId,Integer[] searchIspCode,Model model){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
Map list = new HashMap();
|
||||
try {
|
||||
@@ -484,6 +485,10 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
if(entranceId!=null){
|
||||
url=url+"&searchEntranceId="+entranceId;
|
||||
}
|
||||
if(searchIspCode!=null&&searchIspCode.length>0){
|
||||
String str=StringUtils.join(searchIspCode,",");
|
||||
url=url+"&searchIspCode="+str;
|
||||
}
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||
@@ -499,7 +504,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
@RequestMapping("ajaxAppTopList")
|
||||
@ResponseBody
|
||||
public List ajaxAppTopList(String beginDate,String endDate,Integer appType,Integer entranceId,Integer searchQuota,Model model){
|
||||
public List ajaxAppTopList(String beginDate,String endDate,Integer appType,Integer entranceId,Integer searchQuota,Integer[] searchIspCode,Model model){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List<Map> list = new ArrayList<Map>();
|
||||
try {
|
||||
@@ -519,6 +524,10 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}else{
|
||||
url=url+"&searchQuota="+1; // 默认是按照link 排序
|
||||
}
|
||||
if(searchIspCode!=null&&searchIspCode.length>0){
|
||||
String str=StringUtils.join(searchIspCode,",");
|
||||
url=url+"&searchIspCode="+str;
|
||||
}
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||
|
||||
@@ -219,7 +219,7 @@ function showActionTransChart(xData,series){
|
||||
entrance="Astana";
|
||||
}
|
||||
if(d!=null&&d.entranceId==2){
|
||||
entrance="Alamty";
|
||||
entrance="Almaty";
|
||||
}
|
||||
series.push({
|
||||
name: entrance,
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<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">
|
||||
<select id="entranceId1" 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>
|
||||
@@ -51,16 +51,29 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="isp"/></span>
|
||||
</div>
|
||||
<select id="isp1" name="isp" class="selectpicker form-control input-medium" data-max-options="10" data-selected-text-format="count > 3" multiple data-live-search="true" data-live-search-placeholder="search">
|
||||
<%-- <option value=""><spring:message code="select"/></option> --%>
|
||||
<c:forEach items="${fns:getIspDicList('ispCode')}" var="dict" >
|
||||
<option value="${dict.ispKeyCode}"><spring:message code="${dict.ispKeyName}"></spring:message></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue"
|
||||
onClick="return searchList1()">
|
||||
<i class="fa fa-search"></i>
|
||||
<spring:message code="search" />
|
||||
</button>
|
||||
<%-- <button type="button" class="btn btn-default" id="resetBtn">
|
||||
<button type="button" class="btn btn-default" id="resetBtn1">
|
||||
<i class="fa fa-refresh"></i>
|
||||
<spring:message code="reset" />
|
||||
</button> --%>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
@@ -95,7 +108,7 @@
|
||||
<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">
|
||||
<select id="entranceId2" 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>
|
||||
@@ -103,16 +116,29 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="isp"/></span>
|
||||
</div>
|
||||
<select id="isp2" name="isp" class="selectpicker form-control input-medium" data-max-options="10" data-selected-text-format="count > 3" multiple data-live-search="true" data-live-search-placeholder="search">
|
||||
<%-- <option value=""><spring:message code="select"/></option> --%>
|
||||
<c:forEach items="${fns:getIspDicList('ispCode')}" var="dict" >
|
||||
<option value="${dict.ispKeyCode}"><spring:message code="${dict.ispKeyName}"></spring:message></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue"
|
||||
onClick="return searchList2()">
|
||||
<i class="fa fa-search"></i>
|
||||
<spring:message code="search" />
|
||||
</button>
|
||||
<%-- <button type="button" class="btn btn-default" id="resetBtn">
|
||||
<button type="button" class="btn btn-default" id="resetBtn2">
|
||||
<i class="fa fa-refresh"></i>
|
||||
<spring:message code="reset" />
|
||||
</button> --%>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
@@ -156,6 +182,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><spring:message code="client_ip"/></th>
|
||||
<th><spring:message code="isp"/></th>
|
||||
<th><spring:message code="link_num"/></th>
|
||||
<th><spring:message code="percentage"/> (<spring:message code="link_num"/>)</th>
|
||||
<th><spring:message code="packets"/></th>
|
||||
@@ -189,20 +216,32 @@
|
||||
$("#beginDate").val(starth);
|
||||
$("#endDate").val(endh);
|
||||
var appType=$("#appType").val();
|
||||
var entranceId=$("#entranceId").val();
|
||||
var entranceId1=$("#entranceId1").val();
|
||||
var entranceId2=$("#entranceId2").val();
|
||||
var isp1=$("#isp1").val();
|
||||
var isp2=$("#isp2").val();
|
||||
var searchQuota=$(".searchQuota[class~='active']").val();
|
||||
appTransAjax(starth,endh,appType,entranceId);
|
||||
showRealTimeTransChart(appType,entranceId);// 实时折线
|
||||
appTop100List(starth,endh,appType,entranceId,searchQuota);
|
||||
showRealTimeTransChart(appType,entranceId1,isp1);// 实时折线
|
||||
appTransAjax(starth,endh,appType,entranceId2,isp2);
|
||||
appTop100List(starth,endh,appType,entranceId2,searchQuota,isp2);
|
||||
//筛选功能初始化
|
||||
$("#resetBtn").on("click",function() {
|
||||
$("select.selectpicker").each(function() {
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$("#resetBtn1").on("click",function() {
|
||||
$("#searchForm1 select.selectpicker").each(function() {
|
||||
$(this).selectpicker('val',"");
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
// $(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$("#searchForm1")[0].reset();
|
||||
});
|
||||
//筛选功能初始化
|
||||
$("#resetBtn2").on("click",function() {
|
||||
$("#searchForm2 select.selectpicker").each(function() {
|
||||
$(this).selectpicker('val',"");
|
||||
$(this).find("option").attr("selected",false);
|
||||
// $(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value", '');
|
||||
$("#searchForm")[0].reset();
|
||||
$("#searchForm2")[0].reset();
|
||||
});
|
||||
$(".searchQuota").on("click",function(){
|
||||
$(".searchQuota").removeClass("active");
|
||||
@@ -226,12 +265,14 @@
|
||||
// 改变排序字段
|
||||
function changeOrderby(searchQuota) {
|
||||
loading();
|
||||
appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId").val(),searchQuota);
|
||||
appTop100List($("#beginDate").val(),$("#endDate").val(),$("#appType").val(),$("#entranceId2").val(),searchQuota,$("#isp2").val());
|
||||
}
|
||||
function searchList1() {
|
||||
loading();
|
||||
var appType=$("#appType").val();
|
||||
var entranceId=$("#entranceId").val();
|
||||
showRealTimeTransChart(appType,entranceId);// 折线
|
||||
var entranceId1=$("#entranceId1").val();
|
||||
var isp1=$("#isp1").val();
|
||||
showRealTimeTransChart(appType,entranceId1,isp1);// 折线
|
||||
}
|
||||
function searchList2() {
|
||||
var start = $("#beginDate").val();
|
||||
@@ -242,14 +283,15 @@
|
||||
window.location.reload();
|
||||
} else {
|
||||
var appType=$("#appType").val();
|
||||
var entranceId=$("#entranceId").val();
|
||||
var entranceId2=$("#entranceId2").val();
|
||||
var isp2=$("#isp2").val();
|
||||
var searchQuota=$(".searchQuota[class~='active']").val();
|
||||
appTransAjax(start,end,appType,entranceId);// 折线
|
||||
appTop100List(start,end,appType,entranceId,searchQuota);// 列表
|
||||
appTransAjax(start,end,appType,entranceId2,isp2);// 折线
|
||||
appTop100List(start,end,appType,entranceId2,searchQuota,isp2);// 列表
|
||||
}
|
||||
}
|
||||
// 列表
|
||||
function appTop100List(start,end,appType,entranceId,searchQuota){
|
||||
function appTop100List(start,end,appType,entranceId,searchQuota,isp){
|
||||
$.ajax({
|
||||
url : "${ctx}/dashboard/traffic/ajaxAppTopList",
|
||||
type : 'get',
|
||||
@@ -259,7 +301,8 @@
|
||||
"endDate" : end,
|
||||
"appType" : appType,
|
||||
"entranceId" : entranceId,
|
||||
"searchQuota":searchQuota
|
||||
"searchQuota":searchQuota,
|
||||
"searchIspCode":isp
|
||||
},
|
||||
async : true,
|
||||
timeout : 50000,
|
||||
@@ -312,9 +355,10 @@
|
||||
if (data != null) {
|
||||
var html ="<tr>";
|
||||
html += "<td class='tc'>" + data.ipAddr + "</td>";
|
||||
html += "<td class='tc'>" + data.ispName + "</td>";
|
||||
html += "<td class='tc'>" + data.logNum + "</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":"Almaty") + "</td>";
|
||||
html += "<td class='tc'>" + Math.round(data.pktNum*100)/100 + "</td>";
|
||||
html += "<td class='tc'>" + data.pktPercent + " %</td>";
|
||||
html += "<td class='tc'>" + Math.round(data.byteNum*100)/100 + "</td>";
|
||||
@@ -325,6 +369,7 @@
|
||||
if(index==fileDataS.length-1){
|
||||
html+="<tr class='tr-total hidden'>"
|
||||
html+= "<td class='tc'>"+"<spring:message code='report_total'/>"+"</td>";
|
||||
html+= "<td class='tc'>" +"--"+"</td>";
|
||||
html+= "<td class='tc'>"+totalunique+"</td>";
|
||||
html+= "<td class='tc'>" +"--"+"</td>";
|
||||
html+= "<td class='tc'>"+totalpkt+"</td>";
|
||||
@@ -333,7 +378,7 @@
|
||||
html+= "<td class='tc'>"+"--"+"</td>";
|
||||
html+= "<td class='tc'>"+"--"+"</td>";
|
||||
html+= "<td class='tc'>"+"--"+"</td>";
|
||||
html+="</tr>"
|
||||
html+="</tr>"
|
||||
}
|
||||
}
|
||||
$("#tableData").append(html);
|
||||
@@ -342,12 +387,20 @@
|
||||
}
|
||||
|
||||
// app曲线图
|
||||
function appTransAjax(beginDate, endDate,appType,entranceId) {
|
||||
function appTransAjax(beginDate, endDate,appType,entranceId,isp) {
|
||||
loading();
|
||||
$.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTrend?appType="+appType+"&beginDate="+beginDate+"&endDate="+endDate+"&entranceId="+entranceId,
|
||||
$.ajax({ url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
||||
type : "get",
|
||||
dataType : "json",
|
||||
async : true,
|
||||
data : {
|
||||
"beginDate" : beginDate,
|
||||
"endDate" : endDate,
|
||||
"appType" : appType,
|
||||
"entranceId" : entranceId,
|
||||
"searchIspCode":isp
|
||||
},
|
||||
traditional:true,
|
||||
success : function(rs) {
|
||||
var series=new Array();
|
||||
var sipResult=new Array();
|
||||
@@ -502,13 +555,22 @@
|
||||
$(".pageNum").text(Math.ceil(totalData/10));
|
||||
}
|
||||
}
|
||||
function realTimeTrendAjax(beginDate, endDate,appType,entranceId){
|
||||
function realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp){
|
||||
console.log(isp)
|
||||
var result={};
|
||||
$.ajax({
|
||||
url : "${ctx}/dashboard/traffic/ajaxAppTrend?appType="+appType+"&beginDate="+beginDate+"&endDate="+endDate+"&entranceId="+entranceId,
|
||||
url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
||||
type : "get",
|
||||
dataType : "json",
|
||||
data : {
|
||||
"beginDate" : beginDate,
|
||||
"endDate" : endDate,
|
||||
"appType" : appType,
|
||||
"entranceId" : entranceId,
|
||||
"searchIspCode":isp
|
||||
},
|
||||
async : false,
|
||||
traditional:true,
|
||||
success : function(rs) {
|
||||
result=rs;
|
||||
closeTip();
|
||||
@@ -524,14 +586,14 @@
|
||||
}
|
||||
var timer=null;
|
||||
// 局点信息
|
||||
function showRealTimeTransChart(appType,entranceId) {
|
||||
function showRealTimeTransChart(appType,entranceId,isp) {
|
||||
var time1=(new Date().getTime())-(1000 * 60 * 10+1000 * 60 * 5);
|
||||
var time2=(new Date().getTime())-(1000 * 60 * 5);//推迟五分钟
|
||||
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 sipResult=new Array();
|
||||
var dipResult=new Array();
|
||||
var intData = realTimeTrendAjax(beginDate, endDate,appType,entranceId); //初始化数据 为10个点
|
||||
var intData = realTimeTrendAjax(beginDate, endDate,appType,entranceId,isp); //初始化数据 为10个点
|
||||
sipResult=intData.sipResult;
|
||||
dipResult=intData.dipResult;
|
||||
var nowDate=new Date();
|
||||
@@ -712,11 +774,19 @@
|
||||
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));
|
||||
$.ajax({
|
||||
url : "${ctx}/dashboard/traffic/ajaxAppTrend?appType="+appType+"&beginDate="+begin+"&endDate="+end+"&entranceId="+entranceId,
|
||||
url : "${ctx}/dashboard/traffic/ajaxAppTrend",
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
cache:false,
|
||||
data : {
|
||||
"beginDate" : begin,
|
||||
"endDate" : end,
|
||||
"appType" : appType,
|
||||
"entranceId" : entranceId,
|
||||
"searchIspCode":isp
|
||||
},
|
||||
async : true,
|
||||
traditional:true,
|
||||
success : function(rs) {
|
||||
var realTimeData=rs;
|
||||
if(realTimeData!=null&&Object.keys(realTimeData).length>0){
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
<spring:message code="App"></spring:message>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<!-- searchform -->
|
||||
<!-- searchForm1 -->
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" action="${ctx}/dashboard/traffic/appTypeList" method="get" class="form-search">
|
||||
<form:form id="searchForm1" action="${ctx}/dashboard/traffic/appTypeList" method="get" class="form-search">
|
||||
<input id="beginDateh" type="hidden" value="${beginDate}"/>
|
||||
<input id="endDateh" type="hidden" value="${endDate}"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
@@ -154,7 +154,7 @@ $(document).ready(function(){
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
$("#searchForm1")[0].reset();
|
||||
});
|
||||
// setInterval(function(){
|
||||
// ajaxAppList(starth,new Date().Format("yyyy-MM-dd HH:mm:00"));
|
||||
|
||||
@@ -248,7 +248,7 @@ function changeBandwidth(unitType,beginDate,endDate){
|
||||
}
|
||||
});
|
||||
$("#total2").val(JSON.stringify(total2));
|
||||
showBandwidthChart("chart2",unitType,xdata,series,"Alamty");
|
||||
showBandwidthChart("chart2",unitType,xdata,series,"Almaty");
|
||||
closeTip();
|
||||
},
|
||||
error: function(data, textStatus, errorThrown){
|
||||
@@ -407,7 +407,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){
|
||||
if(d[0].indexOf("Astana") != -1){
|
||||
total=JSON.parse($("#total").val());
|
||||
}
|
||||
if(d[0].indexOf("Alamty") != -1){
|
||||
if(d[0].indexOf("Almaty") != -1){
|
||||
total=JSON.parse($("#total2").val());
|
||||
}
|
||||
}
|
||||
@@ -495,7 +495,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){
|
||||
if(d[0].indexOf("Astana") != -1){
|
||||
total=JSON.parse($("#total").val());
|
||||
}
|
||||
if(d[0].indexOf("Alamty") != -1){
|
||||
if(d[0].indexOf("Almaty") != -1){
|
||||
total=JSON.parse($("#total2").val());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ function showIpActiveChart(xData,series){
|
||||
|
||||
var html = "<tr>";
|
||||
html+= "<td class='tc'>"+rs.ipAddr+"</td>";
|
||||
html+= "<td class='tc'>"+(rs.areaId==1? "Astana":"Alamty")+"</td>";
|
||||
html+= "<td class='tc'>"+(rs.areaId==1? "Astana":"Almaty")+"</td>";
|
||||
html+= "<td class='tc'>"+rs.c2sByteLen+"</td>";
|
||||
html+= "<td class='tc'>"+rs.s2cByteLen+"</td>";
|
||||
html+= "<td class='tc'>"+byteNum+"</td>";
|
||||
|
||||
@@ -395,7 +395,7 @@
|
||||
html += '<td class="tc"><a onclick="searchByDomain(\''+data.webId+'\',\''+data.website+'\')"><i class="fa fa-line-chart"></i></a></td>';
|
||||
html += "<td class='tc'>" + data.website + "</td>";
|
||||
html += "<td class='tc'>" + data.uniqueNum + "</td>";
|
||||
html += "<td class='tc'>" + (((data.entranceId)==1) ? "Astana":"Alamty") + "</td>";
|
||||
html += "<td class='tc'>" + (((data.entranceId)==1) ? "Astana":"Almaty") + "</td>";
|
||||
html += "<td class='tc'>" + Math.round(data.pktCount*100)/100 + "</td>";
|
||||
html += "<td class='tc'>" + packper + " %</td>";
|
||||
html += "<td class='tc'>" + Math.round(data.Gbyte*100)/100 + "</td>";
|
||||
|
||||
Reference in New Issue
Block a user