活跃IPTOP10及详情增加时间条件,app增加appType条件查询,时间范围做校验开始时间小于结束时间,
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.nis.web.controller.dashboard;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -12,6 +16,7 @@ import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -85,11 +90,13 @@ public class DashboardController extends BaseController{
|
||||
*/
|
||||
@RequestMapping(value="ipActive")
|
||||
@ResponseBody
|
||||
public List ipActive(){
|
||||
public List ipActive(String beginDate,String endDate){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
try {
|
||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE);
|
||||
String url =Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE;
|
||||
url = urlAddDate(url, beginDate, endDate);
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.debug("活跃IP数据"+fromJsonList);
|
||||
@@ -107,11 +114,13 @@ public class DashboardController extends BaseController{
|
||||
*/
|
||||
@RequestMapping(value="ipActiveMinuteList")
|
||||
@ResponseBody
|
||||
public List ipActiveMinuteList(){
|
||||
public List ipActiveMinuteList(String beginDate,String endDate){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
try {
|
||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_FIVEMINUTE);
|
||||
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_FIVEMINUTE;
|
||||
url=urlAddDate(url, beginDate, endDate);
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.debug("活跃IP1小时,间隔5分钟数据"+fromJsonList);
|
||||
@@ -155,26 +164,50 @@ public class DashboardController extends BaseController{
|
||||
return gson;
|
||||
}
|
||||
@RequestMapping(value="ipActiveList")
|
||||
public String ipActiveList( HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes redirectAttributes){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List<TrafficIpActiveStatistic> ipActiveList = new ArrayList<TrafficIpActiveStatistic>();
|
||||
public String ipActiveList(@RequestParam(value="beginDate",required=false)String beginDate,@RequestParam(value="endDate",required=false)String endDate,HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR);
|
||||
|
||||
Gson gson = getIntGson();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||
logger.debug("活跃IP1小时"+fromJsonList);
|
||||
ipActiveList = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken<List<TrafficIpActiveStatistic>>() {}.getType()) ;
|
||||
// 默认当前时间一小时
|
||||
if(StringUtil.isEmpty(beginDate)||StringUtil.isEmpty(endDate)){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||
}
|
||||
model.addAttribute("beginDate", beginDate);
|
||||
model.addAttribute("endDate", endDate);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("活跃IP统计错误"+e);
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}
|
||||
|
||||
model.addAttribute("ipActiveList", ipActiveList);
|
||||
return "/dashboard/trafficIpActiveList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 活跃IP TOP10 一小时 间隔5分钟数据
|
||||
*/
|
||||
@RequestMapping(value="ajaxIpActiveList")
|
||||
@ResponseBody
|
||||
public List ajaxIpActiveList(String beginDate,String endDate){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
try {
|
||||
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_IPACTIVE_ONEHOUR;
|
||||
url=urlAddDate(url, beginDate, endDate);
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = getIntGson();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||
logger.debug("活跃IP1小时"+fromJsonList);
|
||||
list = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken<List<TrafficIpActiveStatistic>>() {}.getType()) ;
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("活跃IP数据获取错误"+e);
|
||||
list.add(Maps.newHashMap("error","request_service_failed"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//IP活跃导出
|
||||
@RequestMapping(value = "export")
|
||||
public void exportddos(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@@ -512,7 +545,7 @@ public class DashboardController extends BaseController{
|
||||
list = (List<Map>) fromJsonList.get("data");
|
||||
//标签集合
|
||||
// List<CodeResult> codeList = CodeDicUtils.getCodeList("webCode");
|
||||
List<SysDataDictionaryItem> codeList = DictUtils.getDictList("WEBSITE_SERVER");
|
||||
List<SysDataDictionaryItem> codeList = DictUtils.getDictList("WEBSITE_SERVER");//网站名
|
||||
//将数字替换为标签文字
|
||||
if(list!=null&&!list.isEmpty()){
|
||||
for (Map map : list) {
|
||||
@@ -557,7 +590,7 @@ public class DashboardController extends BaseController{
|
||||
list = (List<Map>) fromJsonList.get("data");
|
||||
//标签集合
|
||||
// List<CodeResult> codeList2 = CodeDicUtils.getCodeList("webCode");//网站子域名表获取域名domain
|
||||
List<WebsiteDomainTopic> domainList = appCfgService.getDomainDict(new WebsiteDomainTopic());
|
||||
List<WebsiteDomainTopic> domainList = appCfgService.getDomainDict(new WebsiteDomainTopic());// domain 域名
|
||||
if(list!=null&&list.size()>0&&domainList!=null&&domainList.size()>0){
|
||||
for (Map dataMap : list) {
|
||||
for (WebsiteDomainTopic wdt : domainList) {
|
||||
@@ -744,5 +777,27 @@ public class DashboardController extends BaseController{
|
||||
|
||||
System.out.println(map2.get("c"));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* url路径时间参数格式化
|
||||
* @param url
|
||||
* @param beginDate
|
||||
* @param endDate
|
||||
* @return
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
public String urlAddDate(String url,String beginDate,String endDate) throws URISyntaxException{
|
||||
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||
}
|
||||
URIBuilder uriBuilder = new URIBuilder(url);
|
||||
uriBuilder.addParameter("beginDate",beginDate);
|
||||
uriBuilder.addParameter("endDate",endDate);
|
||||
return uriBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.nis.web.controller.dashboard;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -38,13 +35,10 @@ import com.google.gson.JsonParseException;
|
||||
import com.google.gson.LongSerializationPolicy;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.configuration.WebsiteDomainTopic;
|
||||
import com.nis.domain.dashboard.TrafficIpActiveStatistic;
|
||||
import com.nis.util.CodeDicUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -346,12 +340,15 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value="appList")
|
||||
@ResponseBody
|
||||
public List appList(@RequestParam(value="beginDate",required=false)String beginDate,@RequestParam(value="endDate",required=false)String endDate){
|
||||
public List appList(@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>();
|
||||
List list = new ArrayList();
|
||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST;
|
||||
try {
|
||||
url=urlAddDate(url,beginDate,endDate);
|
||||
if(!StringUtil.isEmpty(appType)){
|
||||
url=url+"&appType="+appType;
|
||||
}
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
@@ -388,100 +385,4 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 网址类型列表
|
||||
*/
|
||||
@RequestMapping("webTypeList")
|
||||
public String webTypeList(Model model){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||
model.addAttribute("beginDate", oneHoursAgo);
|
||||
model.addAttribute("endDate", now);
|
||||
return "/dashboard/trafficWebTypeList";
|
||||
}
|
||||
/**
|
||||
* 网站统计图跟表
|
||||
*/
|
||||
@RequestMapping(value="websiteList")
|
||||
@ResponseBody
|
||||
public List websiteList(Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_WEBSITELIST;
|
||||
// String url = "http://192.168.11.87:8088/galaxy-service/service/log/v1/"+Constants.TRAFFIC_WEBSITELIST;
|
||||
try {
|
||||
url=urlAddDate(url,beginDate,endDate);
|
||||
String string = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
logger.debug("website接口数据"+fromJsonList);
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
BigDecimal divisor=new BigDecimal(1024*1024*1024);
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
DecimalFormat dl = new DecimalFormat("0");
|
||||
DecimalFormat pf = new DecimalFormat("0.00%");
|
||||
Double totalLink=0d;
|
||||
Double totalGbyte=0d;
|
||||
Double totalPackets=0d;
|
||||
for (Object object : list) {
|
||||
Map m=(Map)object;
|
||||
Double count=(Double)m.get("count");
|
||||
totalGbyte+=count;
|
||||
totalLink+=(Double)m.get("linkNum");
|
||||
totalPackets+=(Double)m.get("packets");
|
||||
String format = df.format(count/1024/1024/1024);
|
||||
m.put("Gbyte", format);
|
||||
}
|
||||
List<WebsiteDomainTopic> codeList = appCfgService.getDomainDict(new WebsiteDomainTopic());
|
||||
Map<Long, String> map = new HashMap<Long,String>();
|
||||
for (WebsiteDomainTopic websiteDomainTopic : codeList) {
|
||||
if(!map.containsKey(websiteDomainTopic.getWebsiteServiceId())){
|
||||
map.put(websiteDomainTopic.getId(),websiteDomainTopic.getDomain());
|
||||
}
|
||||
}
|
||||
for (Object object : list) {
|
||||
Map m=(Map)object;
|
||||
Double perLink = ((Double)m.get("linkNum"))/totalLink;
|
||||
m.put("perLink",pf.format(perLink));
|
||||
Double perPackets = ((Double)m.get("packets"))/totalPackets;
|
||||
m.put("perPackets", pf.format(perPackets));
|
||||
Double perGbyte = ((Double)m.get("count"))/totalGbyte;
|
||||
m.put("perGbyte", pf.format(perGbyte));
|
||||
if(map.containsKey(Long.parseLong(dl.format(m.get("webId"))))){
|
||||
m.put("website", map.get(Long.parseLong(dl.format(m.get("webId")))));
|
||||
}
|
||||
}
|
||||
Collections.sort(list, new Comparator<Object>() {
|
||||
|
||||
@Override
|
||||
public int compare(Object o1, Object o2) {
|
||||
if(o1==null&&o2!=null){
|
||||
return 1;
|
||||
}
|
||||
if(o1!=null&&o2==null){
|
||||
return -1;
|
||||
}
|
||||
if(o1==null&&o2==null){
|
||||
return 0;
|
||||
}
|
||||
Map m1=(Map)o1;
|
||||
Map m2=(Map)o2;
|
||||
if((Double)m1.get("count")==(Double)m2.get("count")){
|
||||
return 0;
|
||||
}
|
||||
int result=((Double)m1.get("count")-(Double)m2.get("count"))>0?-1:1;
|
||||
return result;
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("网站域名数据获取错误"+e);
|
||||
list.add(Maps.newHashMap("error","request_service_failed"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1365,7 +1365,7 @@ nas_ip=NAS IP Address
|
||||
framed_ip=Framed IP Address
|
||||
log_user_name=User Name
|
||||
av_tips=The system does not support the index information of audio and video coding in the tail of the audio and video files. The system does not support video with resolution greater than 1080P.
|
||||
asn_ip_group_delete=\uff08IP configuration under this ASN group will also be deleted.)
|
||||
asn_ip_group_delete=\uFF08IP configuration under this ASN group will also be deleted.)
|
||||
keyword_log_tips=Deduplicate http body keywords log,for the control status of http body keywords is not ideal, configure the http url of the hit keyword as URL control configuration.
|
||||
conn_record=Connection Records
|
||||
bps=Bps
|
||||
@@ -1392,4 +1392,6 @@ ip_end_num=IP End Num
|
||||
ip_sub=IP Subnet
|
||||
start_ip=Start IP
|
||||
end_ip=End IP
|
||||
action_detail=Action Detail
|
||||
action_detail=Action Detail
|
||||
pass=Pass
|
||||
live_link=Live Link
|
||||
@@ -1396,4 +1396,6 @@ ip_end_num=IP End Num
|
||||
ip_sub=IP Subnet
|
||||
start_ip=Start IP
|
||||
end_ip=End IP
|
||||
action_detail=Action Detail
|
||||
action_detail=Action Detail
|
||||
pass=Pass
|
||||
live_link=Live Link
|
||||
@@ -1392,4 +1392,6 @@ ip_end_num=IP End Num
|
||||
ip_sub=IP Subnet
|
||||
start_ip=Start IP
|
||||
end_ip=End IP
|
||||
action_detail=\u52a8\u4f5c\u8be6\u60c5
|
||||
action_detail=\u52a8\u4f5c\u8be6\u60c5
|
||||
pass=Pass
|
||||
live_link=Live Link
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="data_info">
|
||||
<div class="info_1 fl_fc">
|
||||
<div class="text_1">
|
||||
<div class="fr_fc">
|
||||
<div class="fr_fc" style="width:60%">
|
||||
<div class="fl_visual">
|
||||
<a href="${ctx}/dashboard/traffic/bandwidthList"><i class="fa fa-cloud-download"></i></a>
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@
|
||||
<span class="numberRun4">0</span > <span class="numberRun4-unit">bps</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fr_fc">
|
||||
<div class="fr_fc" style="width:40%">
|
||||
<div class="fl_visual">
|
||||
<a href="${ctx}/dashboard/traffic/trafficBlockList?searchAction=block"><i class="fa fa-ban"></i></a>
|
||||
</div>
|
||||
@@ -127,6 +127,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fr_fc">
|
||||
<div class="fl_visual">
|
||||
<i class="fa fa-smile-o"> </i>
|
||||
</div>
|
||||
<div class="fl_fc">
|
||||
<p data-original-title="<spring:message code="pass"/>"
|
||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||
<!-- pass --><spring:message code="pass"/></p>
|
||||
<p class="numberRun7">0</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fr_fc">
|
||||
<div class="fl_visual">
|
||||
<i class="fa fa-heartbeat"> </i>
|
||||
</div>
|
||||
<div class="fl_fc">
|
||||
<p data-original-title="<spring:message code="live_link"/>"
|
||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||
<!-- live link--><spring:message code="live_link"/></p>
|
||||
<p class="numberRun8">0</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -139,6 +162,12 @@
|
||||
<div class="main_title">
|
||||
<spring:message code="traffic_ipactive_chart"/> <a href="${ctx}/dashboard/ipActiveList"><i class="fa fa-line-chart"></i></a> <a href="javascipt:void(0)" onclick="ipActiveList();return false;"><i class="fa fa-refresh"></i></a>
|
||||
</div>
|
||||
<div style="margin-left:150px;margin-top:19px;position:absolute;z-index:1000;">
|
||||
<input id="iPBeginDate" name="beginDate" type="text" readonly="readonly" class="Wdate" style="font-size:10px;width:125px;background-color: #424242;border:0;color:#fff"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'iPEndDate\')}'});"/>
|
||||
<input id="iPEndDate" name="endDate" type="text" readonly="readonly" class="Wdate" style="font-size:10px;width:125px;background-color: #424242;border:0;color:#fff""
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'iPBeginDate\')}'});"/>
|
||||
</div>
|
||||
<!-- 活跃IP图 --> <div id="chart_main" style="width:100%;height:400px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -184,7 +213,7 @@
|
||||
<div class="main_left1 fl">
|
||||
<div class="left_1">
|
||||
<div class="main_title1">
|
||||
<spring:message code="topic"/> <%-- <a href="${ctx}/dashboard/ipActiveList"><i class="fa fa-list-ul"></i></a> --%>
|
||||
<spring:message code="service"/> <%-- <a href="${ctx}/dashboard/ipActiveList"><i class="fa fa-list-ul"></i></a> --%>
|
||||
<a href="javascipt:void(0)" onclick="topicAndDomainList();return false;"><i class="fa fa-refresh"></i></a>
|
||||
</div>
|
||||
<!-- 网站主题分类图 --><div id="chart_topic" style="width:100%;height:400px;"></div>
|
||||
@@ -196,7 +225,7 @@
|
||||
<div class="main_center1 fl">
|
||||
<div class="bottom_web fl">
|
||||
<div class="main_title_web">
|
||||
<spring:message code="traffic_website_list"/> <a href="${ctx}/dashboard/traffic/webTypeList"><i class="fa fa-line-chart"></i></a>
|
||||
<spring:message code="traffic_website_list"/> <%-- <a href="${ctx}/dashboard/webTypeList"><i class="fa fa-list-ul"></i></a> --%>
|
||||
<a href="javascipt:void(0)" onclick="websiteList();return false;"><i class="fa fa-refresh"></i></a>
|
||||
</div>
|
||||
<div class="main_table_web">
|
||||
@@ -392,7 +421,7 @@ $(document).ready(function(){
|
||||
ajaxinfo();
|
||||
setInterval(function(){
|
||||
ajaxinfo();
|
||||
},30000);
|
||||
},300000);
|
||||
|
||||
protocolList();//协议统计
|
||||
ipActiveList();//活跃IP
|
||||
@@ -413,8 +442,6 @@ $(document).ready(function(){
|
||||
});
|
||||
//获取数据info
|
||||
function ajaxinfo(){
|
||||
// var c2s = $(".c2sNum").text().trim();
|
||||
// var s2c = $(".s2cNum").text().trim();
|
||||
$.ajax({
|
||||
url:'${ctx}/dashboard/traffic/info',
|
||||
type : "get" ,
|
||||
@@ -452,10 +479,11 @@ function ajaxinfo(){
|
||||
dataScroll(".numberRun3",Math.round(dropConnNum));
|
||||
dataScroll(".numberRun5",Math.round(newUniConnNum));
|
||||
dataScroll(".numberRun6",Math.round(liveConnNum));
|
||||
dataScroll(".numberRun7",Math.round(newUniConnNum-rejectNum));
|
||||
dataScroll(".numberRun8",Math.round(newUniConnNum-rejectNum-dropConnNum));
|
||||
|
||||
//计算带宽进出口流量百分比
|
||||
// $("#c2sColor").removeClass();
|
||||
// $("#s2cColor").removeClass();
|
||||
|
||||
var inoctetsNum=Math.round(data.inoctetsNum);
|
||||
var inoctetsNumK=inoctetsNum/1024;
|
||||
var inoctetsNumM=inoctetsNumK/1024;
|
||||
@@ -488,24 +516,7 @@ function ajaxinfo(){
|
||||
|
||||
bandwidth=parseFloat(inoctetsNum)+parseFloat(outoctetsNum);
|
||||
dataScroll2(".numberRun4",bandwidth);
|
||||
/* if(data.inoctetsNum!=c2s){
|
||||
$(".c2sNum").text(data.c2sNum);
|
||||
$(".s2cNum").text(100-data.c2sNum);
|
||||
if(data.c2sNum>c2s){
|
||||
//c2s增长 fa fa-arrow-up
|
||||
$("#c2sColor").addClass("fa fa-arrow-up");
|
||||
$("#c2sColor").attr({style:"color:green"});
|
||||
$("#s2cColor").addClass("fa fa-arrow-down");
|
||||
$("#s2cColor").attr({style:"color:red"});
|
||||
}
|
||||
//c2s下降
|
||||
if(data.c2sNum<c2s){
|
||||
$("#c2sColor").addClass("fa fa-arrow-down");
|
||||
$("#c2sColor").attr({style:"color:red"});
|
||||
$("#s2cColor").addClass("fa fa-arrow-up");
|
||||
$("#s2cColor").attr({style:"color:green"});
|
||||
}
|
||||
} */
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -563,12 +574,17 @@ function protocolList(){
|
||||
}
|
||||
//活跃IP统计
|
||||
function ipActiveList(){
|
||||
var begin=$("#iPBeginDate").val();
|
||||
var end=$("#iPEndDate").val();
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/ipActive',
|
||||
type : "get" ,
|
||||
dataType:"json",
|
||||
cache:false,async:true,timeout:60000,//超时时间设置,查询接口时间过长超时
|
||||
data:{"beginDate":begin,"endDate":end},
|
||||
cache:false,
|
||||
async:true,
|
||||
timeout:60000,//超时时间设置,查询接口时间过长超时
|
||||
success:function (rs) {
|
||||
if(rs!=null&&rs.length>0&&rs[0].error!=null){
|
||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||
@@ -951,7 +967,6 @@ function topicAndDomainList(){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -27,7 +27,7 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||
</div>
|
||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
@@ -36,7 +36,7 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
</div>
|
||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'${endDate}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -43,16 +43,29 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||
</div>
|
||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="${beginDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="${beginDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
</div>
|
||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="${endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="${endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'${endDate}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="social_app"/></span>
|
||||
</div>
|
||||
<select id="appType" name="appType" class="selectpicker form-control input-medium" data-live-search="true" data-live-search-placeholder="search">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<c:forEach items="${fns:getCodeList('appCode')}" var="dict" >
|
||||
<option value="${dict.code}"><spring:message code="${dict.item}"></spring:message></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -127,12 +140,13 @@ function searchList(){
|
||||
}
|
||||
}
|
||||
function ajaxAppList(start,end){
|
||||
var appType=$("#appType").val();
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/traffic/appList',
|
||||
type: 'get',
|
||||
dataType: "json",
|
||||
data:{"beginDate":start,"endDate":end},
|
||||
data:{"beginDate":start,"endDate":end,"appType":appType},
|
||||
async:false,
|
||||
timeout:10000,
|
||||
success:function (data){
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||
</div>
|
||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
@@ -41,7 +41,7 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
</div>
|
||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'${endDate}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,18 +17,45 @@
|
||||
<h3 class="page-title">
|
||||
<spring:message code="traffic_ipactive_hour_trend"></spring:message>
|
||||
</h3>
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" action="${ctx}/traffic/ipActiveList" method="get" class="form-search">
|
||||
<input id="beginDateh" type="hidden" value="${beginDate}"/>
|
||||
<input id="endDateh" type="hidden" value="${endDate}"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||
</div>
|
||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
</div>
|
||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'${endDate}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
</form:form>
|
||||
</div>
|
||||
<div id="chart" style="width:95%;height:350px;"></div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="entry" action="${ctx}/traffic/ipActiveList" method="post" class="form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
</form:form>
|
||||
</div>
|
||||
|
||||
<sys:message content="${message}" type="${messageType }"/>
|
||||
<h3 class="page-title">
|
||||
<spring:message code="traffic_ipactive_hour_max"></spring:message>
|
||||
@@ -54,30 +81,8 @@
|
||||
<th><spring:message code="stat_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="entry" items="${ipActiveList }" varStatus="status">
|
||||
<tr>
|
||||
<td>${entry.ipAddr }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('AREA_NAME')}" var="dic">
|
||||
<c:choose>
|
||||
<c:when test="${dic.itemCode eq entry.areaId}">
|
||||
<spring:message code="${dic.itemValue}"/>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${entry.c2sByteLen }</td>
|
||||
<td>${entry.s2cByteLen }</td>
|
||||
<td>${entry.s2cByteLen+entry.c2sByteLen }</td>
|
||||
<td>${entry.linkNum }</td>
|
||||
<td>${entry.c2sPktNum }</td>
|
||||
<td>${entry.s2cPktNum }</td>
|
||||
<td>${entry.s2cPktNum+entry.c2sPktNum}</td>
|
||||
<td>${entry.statTime }</td>
|
||||
<%-- <td><fmt:formatDate value="${entry.statTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td> --%>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<tbody id="tbodyData">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%-- <div class="page">${page}</div> --%>
|
||||
@@ -93,9 +98,58 @@
|
||||
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
ipActiveMinuteList()
|
||||
|
||||
var starth=$("#beginDateh").val();
|
||||
var endh=$("#endDateh").val();
|
||||
$("#beginDate").val(starth);
|
||||
$("#endDate").val(endh);
|
||||
ipActiveMinuteList(starth,endh);
|
||||
ipActiveOneHourList(starth,endh);
|
||||
//筛选功能初始化
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
});
|
||||
function searchList(){
|
||||
var start=$("#beginDate").val();
|
||||
var end=$("#endDate").val();
|
||||
// IF(!CHECKDATE(START,END)){
|
||||
// RETURN FALSE
|
||||
// }
|
||||
loading();
|
||||
if(start==''||end==''||end==null||start==null){
|
||||
window.location.reload();
|
||||
}else{
|
||||
ipActiveMinuteList(start,end);
|
||||
ipActiveOneHourList(start,end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function checkDate(start,end){
|
||||
if(getDate(start)-getDate(end)>0){
|
||||
alert("结束时间不能小于开始时间!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function getDate(date){
|
||||
var dates = date.split("-");
|
||||
var dateReturn = '';
|
||||
for(var i=0; i<dates.length; i++){
|
||||
dateReturn+=dates[i];
|
||||
}
|
||||
return dateReturn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function showIpActiveChart(rs){
|
||||
var data=new Array();
|
||||
@@ -167,22 +221,76 @@ function showIpActiveChart(rs){
|
||||
});
|
||||
}
|
||||
//活跃IP一小时间隔五分钟统计
|
||||
function ipActiveMinuteList(){
|
||||
function ipActiveMinuteList(beginDate,endDate){
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/ipActiveMinuteList',
|
||||
type : "get" ,
|
||||
dataType:"json",
|
||||
cache:false,async:true,
|
||||
data:{"beginDate":beginDate,"endDate":endDate},
|
||||
cache:false,
|
||||
async:false,
|
||||
timeout:40000,
|
||||
success:function (rs) {
|
||||
showIpActiveChart(rs);
|
||||
$("#tbodyData").html("");
|
||||
if(rs!=null&&rs.length>0){
|
||||
showIpActiveChart(rs);
|
||||
}
|
||||
closeTip();
|
||||
},
|
||||
error: function(data, textStatus, errorThrown){
|
||||
closeTip();
|
||||
// warning_prompt("获取实时列表数据失败!",1500);
|
||||
},
|
||||
|
||||
complete:function(XMLHttpRequest,status){//超时设置
|
||||
closeTip();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//活跃IP一小时统计
|
||||
function ipActiveOneHourList(beginDate,endDate){
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/ajaxIpActiveList',
|
||||
type : "get" ,
|
||||
dataType:"json",
|
||||
data:{"beginDate":beginDate,"endDate":endDate},
|
||||
cache:false,
|
||||
async:false,
|
||||
timeout:40000,
|
||||
success:function (data) {
|
||||
$("#tbodyData").html("");
|
||||
if(data!=null&&data.length>0){
|
||||
$(data).each(function(i, rs) {
|
||||
var byteNum=rs.s2cByteLen+rs.c2sByteLen;
|
||||
var packetNum=rs.s2cPktNum+rs.c2sPktNum;
|
||||
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.c2sByteLen+"</td>";
|
||||
html+= "<td class='tc'>"+rs.s2cByteLen+"</td>";
|
||||
html+= "<td class='tc'>"+byteNum+"</td>";
|
||||
html+= "<td class='tc'>"+rs.linkNum+"</td>";
|
||||
html+= "<td class='tc'>"+rs.c2sPktNum+"</td>";
|
||||
html+= "<td class='tc'>"+rs.s2cPktNum+"</td>";
|
||||
html+= "<td class='tc'>"+packetNum+"</td>";
|
||||
html+= "<td class='tc'>"+rs.statTime+"</td>";
|
||||
html+="</tr>"
|
||||
$("#tbodyData").append(html);
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
closeTip();
|
||||
},
|
||||
error: function(data, textStatus, errorThrown){
|
||||
closeTip();
|
||||
// warning_prompt("获取实时列表数据失败!",1500);
|
||||
},
|
||||
complete:function(XMLHttpRequest,status){//超时设置
|
||||
closeTip();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||
</div>
|
||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
@@ -42,7 +42,7 @@
|
||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||
</div>
|
||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'${endDate}'});"/>
|
||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'${endDate}'});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ p{
|
||||
display: inline-block;
|
||||
}
|
||||
.data_content .data_info .info_2{
|
||||
width: 70%;
|
||||
width: 75%;
|
||||
height: 110px;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ p{
|
||||
}
|
||||
|
||||
.data_content .data_info .info_1{
|
||||
width: 30%;
|
||||
width: 25%;
|
||||
height: 110px;
|
||||
}
|
||||
.data_content .data_info .info_2 .fr_fc:first-child{
|
||||
@@ -94,7 +94,7 @@ p{
|
||||
} */
|
||||
|
||||
.data_content .data_info>div.info_2>.text_2>div{
|
||||
width: 20%;
|
||||
width: 14.2%;
|
||||
position: relative;
|
||||
}
|
||||
.data_content .data_info>div.info_1>div>div,
|
||||
@@ -170,6 +170,22 @@ p{
|
||||
margin-top: 2.1em;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.data_content .data_info .info_2 .fr_fc .numberRun7{
|
||||
width:100%;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color:#288dce;
|
||||
margin-top: 2.1em;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.data_content .data_info .info_2 .fr_fc .numberRun8{
|
||||
width:100%;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color:#288dce;
|
||||
margin-top: 2.1em;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.data_content .data_info .info_2 .fr_fc .numberRun{
|
||||
width:100%;
|
||||
font-weight: 600;
|
||||
|
||||
Reference in New Issue
Block a user