修改流量统计主题显示问题,设定图单位为G保留5位小数,增加app,协议时间查询
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<!-- 网络带宽 --><spring:message code="traffic"/>
|
||||
</label>
|
||||
</p>
|
||||
<a href="${ctx}/dashboard/traffic/bandwidthList"><p class="csNum">In <span class="c2sNum">0</span> | Out <span class="s2cNum">0</span> </p>
|
||||
<a href="${ctx}/dashboard/traffic/bandwidthList"><p class="csNum">c2s <span class="c2sNum">0</span> | s2c <span class="s2cNum">0</span> </p>
|
||||
<span class="numberRun4">0</span > <span class="numberRun4-unit">bps</span></a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -398,7 +398,7 @@ $(document).ready(function(){
|
||||
ipActiveList();//活跃IP
|
||||
portActiveList();//活跃端口
|
||||
appTypeList();//应用类型
|
||||
systemList();//操作系统列表
|
||||
// systemList();//操作系统列表
|
||||
websiteList();//http网站列表
|
||||
topicAndDomainList();//主题网站域名
|
||||
|
||||
@@ -751,7 +751,7 @@ function osClick(osType,obj){
|
||||
dataType:"json",
|
||||
cache:false,async:true,timeout:10000,//超时时间设置,查询接口时间过长超时
|
||||
success:function (rs) {
|
||||
echart_5(rs.reverse());
|
||||
echart_5(rs);
|
||||
|
||||
closeTip();
|
||||
},
|
||||
@@ -772,7 +772,7 @@ function bsClick(bsType,obj){
|
||||
dataType:"json",
|
||||
cache:false,async:true,timeout:10000,//超时时间设置,查询接口时间过长超时
|
||||
success:function (rs) {
|
||||
echart_2(rs.reverse());
|
||||
echart_2(rs);
|
||||
|
||||
closeTip();
|
||||
},
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/FileSaver.js"></script>
|
||||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/tableexport.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
td:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
.Wdate {
|
||||
width: 220px !important;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
@@ -21,6 +29,39 @@
|
||||
<spring:message code="App"></spring:message>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<!-- searchform -->
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" action="${ctx}/dashboard/traffic/appTypeList" method="get" class="form-search">
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<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="searchFoundStartTime" name="searchFoundStartTime" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="${searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</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="searchFoundEndTime" name="searchFoundEndTime" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="${searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</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 class="row">
|
||||
<div id="chart" style="width:98%;height: 510px; -moz-user-select: none; position: relative;"></div>
|
||||
</div>
|
||||
@@ -55,14 +96,35 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
ajaxProtocolList();
|
||||
|
||||
//筛选功能初始化
|
||||
$("#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 ajaxProtocolList(){
|
||||
function searchList(){
|
||||
var start=$("#searchFoundStartTime").val();
|
||||
var end=$("#searchFoundEndTime").val();
|
||||
if(start==''||end==''||end==null||start==null){
|
||||
start="";
|
||||
end="";
|
||||
$("#searchFoundStartTime").val("");
|
||||
$("#searchFoundEndTime").val("");
|
||||
}
|
||||
ajaxProtocolList(start,end);
|
||||
}
|
||||
function ajaxProtocolList(start,end){
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/traffic/appList',
|
||||
type: 'get',
|
||||
dataType: "json",
|
||||
data:{"searchFoundStartTime":start,"searchFoundEndTime":end},
|
||||
async:false,
|
||||
timeout:10000,
|
||||
success:function (data){
|
||||
@@ -75,6 +137,13 @@ function ajaxProtocolList(){
|
||||
pageJuan(10);//初始化分页
|
||||
protocolTypeChart(data);// 初始化图
|
||||
closeTip();
|
||||
if(data!= null&&data.length<1){
|
||||
$(".none-data").show();
|
||||
$('.M-box').hide();
|
||||
}else{
|
||||
$('.none-data').hide();
|
||||
$('.M-box').show();
|
||||
}
|
||||
},
|
||||
error: function(data, textStatus, errorThrown){
|
||||
closeTip();
|
||||
@@ -125,6 +194,7 @@ function getPageData(currentPage,pageNumber){
|
||||
}
|
||||
// 处理接口数据
|
||||
function htmlData(fileDataS){
|
||||
|
||||
$("#tableData").html("");
|
||||
if(fileDataS == null){
|
||||
$(".none-data").show();
|
||||
|
||||
@@ -21,6 +21,37 @@
|
||||
<spring:message code="protocol_type"></spring:message>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" action="${ctx}/dashboard/traffic/protocolTypeList" method="get" class="form-search">
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<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="searchFoundStartTime" name="searchFoundStartTime" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="${searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</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="searchFoundEndTime" name="searchFoundEndTime" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||
value="${searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</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 class="row">
|
||||
<div id="chart" style="width:98%;height: 510px; -moz-user-select: none; position: relative;"></div>
|
||||
</div>
|
||||
@@ -55,14 +86,35 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
ajaxProtocolList();
|
||||
|
||||
//筛选功能初始化
|
||||
$("#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 ajaxProtocolList(){
|
||||
function searchList(){
|
||||
var start=$("#searchFoundStartTime").val();
|
||||
var end=$("#searchFoundEndTime").val();
|
||||
if(start==''||end==''||end==null||start==null){
|
||||
start="";
|
||||
end="";
|
||||
$("#searchFoundStartTime").val("");
|
||||
$("#searchFoundEndTime").val("");
|
||||
}
|
||||
ajaxProtocolList(start,end);
|
||||
}
|
||||
function ajaxProtocolList(start,end){
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/traffic/protocolList',
|
||||
type: 'get',
|
||||
dataType: "json",
|
||||
data:{"searchFoundStartTime":start,"searchFoundEndTime":end},
|
||||
async:false,
|
||||
timeout:10000,
|
||||
success:function (data){
|
||||
@@ -75,6 +127,13 @@ function ajaxProtocolList(){
|
||||
pageJuan(10);//初始化分页
|
||||
protocolTypeChart(data);// 初始化图
|
||||
closeTip();
|
||||
if(data!= null&&data.length<1){
|
||||
$(".none-data").show();
|
||||
$('.M-box').hide();
|
||||
}else{
|
||||
$('.none-data').hide();
|
||||
$('.M-box').show();
|
||||
}
|
||||
},
|
||||
error: function(data, textStatus, errorThrown){
|
||||
closeTip();
|
||||
|
||||
@@ -365,33 +365,34 @@
|
||||
var inoctetsNumK=inoctetsNum/1024;
|
||||
var inoctetsNumM=inoctetsNumK/1024;
|
||||
var inoctetsNumG=inoctetsNumM/1024;
|
||||
if(inoctetsNumK>1){
|
||||
inoctetsNum=inoctetsNumK;
|
||||
};
|
||||
if(inoctetsNumM>1){
|
||||
inoctetsNum=inoctetsNumM;
|
||||
};
|
||||
if(inoctetsNumG>1){
|
||||
// if(inoctetsNumK>1){
|
||||
// inoctetsNum=inoctetsNumK;
|
||||
// };
|
||||
// if(inoctetsNumM>1){
|
||||
// inoctetsNum=inoctetsNumM;
|
||||
// };
|
||||
// if(inoctetsNumG>1){
|
||||
// inoctetsNum=inoctetsNumG;
|
||||
// };
|
||||
inoctetsNum=inoctetsNumG;
|
||||
};
|
||||
inoctetsNum=inoctetsNum.toFixed(1)
|
||||
inoctetsNum=inoctetsNum.toFixed(5)
|
||||
return inoctetsNum;
|
||||
}
|
||||
function changeUnit(inoctetsNum){
|
||||
// 变化单位
|
||||
var unit="bytes";
|
||||
var inoctetsNumK=inoctetsNum/1024;
|
||||
var inoctetsNumM=inoctetsNumK/1024;
|
||||
var inoctetsNumG=inoctetsNumM/1024;
|
||||
if(inoctetsNumK>1){
|
||||
unit="KB";
|
||||
};
|
||||
if(inoctetsNumM>1){
|
||||
unit="MB";
|
||||
};
|
||||
if(inoctetsNumG>1){
|
||||
unit="GB";
|
||||
};
|
||||
var unit="GB";
|
||||
// var inoctetsNumK=inoctetsNum/1024;
|
||||
// var inoctetsNumM=inoctetsNumK/1024;
|
||||
// var inoctetsNumG=inoctetsNumM/1024;
|
||||
// if(inoctetsNumK>1){
|
||||
// unit="KB";
|
||||
// };
|
||||
// if(inoctetsNumM>1){
|
||||
// unit="MB";
|
||||
// };
|
||||
// if(inoctetsNumG>1){
|
||||
// unit="GB";
|
||||
// };
|
||||
return unit
|
||||
}
|
||||
//app应用类型统计 echart_3
|
||||
@@ -1129,7 +1130,7 @@ function echart_6(rs){
|
||||
function echart_topic_domain(rs){
|
||||
var data=[{
|
||||
'id': '0.0',
|
||||
'parent': '',
|
||||
// 'parent': '',
|
||||
'name': 'TOPIC'
|
||||
}];
|
||||
var unit="bytes";
|
||||
@@ -1145,7 +1146,7 @@ function echart_topic_domain(rs){
|
||||
});
|
||||
/****主题中的子域名*******/
|
||||
$(d.domainData).each(function(j,t){
|
||||
var domainNum=d.count;
|
||||
var domainNum=t.count;
|
||||
unit=changeUnit(domainNum);
|
||||
domainNum=changeNum(domainNum);
|
||||
data.push({
|
||||
|
||||
Reference in New Issue
Block a user