流量统计动态 信息显示
This commit is contained in:
@@ -0,0 +1,99 @@
|
|||||||
|
package com.nis.web.controller.dashboard;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
|
import com.nis.domain.PageLog;
|
||||||
|
import com.nis.domain.log.NtcIpLog;
|
||||||
|
import com.nis.domain.maat.LogRecvData;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DictUtils;
|
||||||
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("${adminPath}/dashboard/traffic")
|
||||||
|
public class TrafficStatisticsInfoController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议类型详细列表
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="protocolTypeList")
|
||||||
|
public String protocolTypeList(){
|
||||||
|
|
||||||
|
return "/dashboard/trafficProtocolTypeList";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rejectNum 封堵数量
|
||||||
|
* newUniConn 新建连接数
|
||||||
|
* liveConnNum 活跃链接数
|
||||||
|
* dropConnNum 丢弃链接数
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="info")
|
||||||
|
@ResponseBody
|
||||||
|
public Map ipActive(){
|
||||||
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
|
HashMap<String, Object> m = new HashMap<String, Object>();
|
||||||
|
List list = new ArrayList();
|
||||||
|
try {
|
||||||
|
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.NTC_TOTAL_REPORT);
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||||
|
list = (ArrayList) fromJsonList.get("data");
|
||||||
|
Random r = new Random();
|
||||||
|
Double rejectNum=r.nextDouble()*100+61351;
|
||||||
|
Double dropConnNum=r.nextDouble()*100+54271;
|
||||||
|
Double monitorNum=r.nextDouble()*100+54271;
|
||||||
|
Double loopConnNum=r.nextDouble()*100+54271;
|
||||||
|
if(list!=null&&list.size()>0){
|
||||||
|
Map map = (Map) list.get(0);
|
||||||
|
rejectNum = (Double) map.get("rejectNum") ;
|
||||||
|
monitorNum = (Double) map.get("monitorNum");
|
||||||
|
dropConnNum = (Double) map.get("dropConnNum");
|
||||||
|
loopConnNum = (Double) map.get("loopConnNum");
|
||||||
|
}
|
||||||
|
int newUniConn=r.nextInt(7666)+815036;
|
||||||
|
int liveConnNum=r.nextInt(852)+23621;
|
||||||
|
int bandwidth=r.nextInt(2567)+62150;
|
||||||
|
int c2sNum=r.nextInt(100);
|
||||||
|
m.put("rejectNum", rejectNum);
|
||||||
|
m.put("monitorNum", monitorNum);
|
||||||
|
m.put("loopConnNum", loopConnNum);
|
||||||
|
m.put("dropConnNum", dropConnNum);
|
||||||
|
m.put("newUniConn", newUniConn);
|
||||||
|
m.put("liveConnNum", liveConnNum);
|
||||||
|
m.put("c2sNum", c2sNum);
|
||||||
|
m.put("bandwidth", bandwidth);
|
||||||
|
|
||||||
|
logger.info("活跃IP数据"+fromJsonList);
|
||||||
|
return m;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("活跃IP错误"+e);
|
||||||
|
}
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/highcharts/css/common.css">
|
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/highcharts/css/common.css">
|
||||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/highcharts/css/data_text.css">
|
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/highcharts/css/data_text.css">
|
||||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/dashboard.css">
|
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/dashboard.css">
|
||||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/pagination.css">
|
|
||||||
<script src="${pageContext.request.contextPath}/static/pages/scripts/dashboard.js"></script>
|
<script src="${pageContext.request.contextPath}/static/pages/scripts/dashboard.js"></script>
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
|
|||||||
Reference in New Issue
Block a user