From 0f9b829531f75394e09c5bc78f39e80e4a1073d8 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Fri, 28 Dec 2018 18:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=EF=BC=8C=E5=AF=B9service=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/dashBoardIndex.jsp | 8 ++--- .../webapp/static/pages/scripts/echart.js | 35 ++++++++++++------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp index 43f3e958f..a2c656c0d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -610,7 +610,7 @@ function portActiveList(){ $("#tbodyDataPort").html(""); var n=rs.length; if(rs!=null&&rs.length>0&&rs[0].error!=null){ - $("#tbodyDataPort").prepend(""); + $("#tbodyDataPort").prepend(""); }else{ if(n>0){ @@ -694,7 +694,7 @@ function systemList(){ rs.reverse(); var n=rs.length; if(rs!=null&&rs.length>0&&rs[0].error!=null){ - $("#tbodyData1").prepend(""); + $("#tbodyData1").prepend(""); }else{ if(n>0){ @@ -807,7 +807,7 @@ function browserList() { rs.reverse(); var n=rs.length; if(rs!=null&&rs.length>0&&rs[0].error!=null){ - $("#tbodyData1").prepend(""); + $("#tbodyData1").prepend(""); }else{ if(n>0){ $(rs).each(function(i, itemObj) { @@ -873,7 +873,7 @@ function websiteList() { $("#tbodyData2").html(""); var n=rs.length; if(rs!=null&&rs.length>0&&rs[0].error!=null){ - $("#tbodyData2").prepend(""); + $("#tbodyData2").prepend(""); }else{ if(n>0){ $(rs).each(function(i, itemObj) { diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 3a9404b94..979477f92 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -1186,29 +1186,38 @@ function echart_topic_domain(rs){ var unit="bytes"; $(rs).each(function(i,d){ var inoctetsNum=d.count; - unit=changeUnit(inoctetsNum); - inoctetsNum=changeNum(inoctetsNum); - data.push({ - 'id': '1.'+d.topicId, - 'parent': '0.0', - 'name': d.topic, - 'value':parseFloat(inoctetsNum) - }); + var inoctetsNumK=inoctetsNum/1024; + var inoctetsNumM=inoctetsNumK/1024; + var inoctetsNumG=inoctetsNumM/1024; + inoctetsNum=inoctetsNumG; + inoctetsNum=Math.round(inoctetsNum*100)/100; + + unit="GB"; + if(inoctetsNum>0){ /****主题中的子域名*******/ + var topicData=0; $(d.domainData).each(function(j,t){ var domainNum=t.byteCount; - unit=changeUnit(domainNum); - domainNum=changeNum(domainNum); - if(domainNum>0){ + var domainNumK=domainNum/1024; + var domainNumM=domainNumK/1024; + var domainNumG=domainNumM/1024; + domainNum=domainNumG; + domainNum=Math.round(domainNum*100)/100; + topicData=topicData+domainNum; data.push({ 'id': '2.'+t.webId, 'parent': '1.'+d.topicId, 'name': t.domain, 'value':parseFloat(domainNum) }); - } }) - + data.push({ + 'id': '1.'+d.topicId, + 'parent': '0.0', + 'name': d.topic, + 'value':parseFloat(topicData) + }); + } }); Highcharts.getOptions().colors.splice(0, 0, 'transparent'); var chart = Highcharts.chart('chart_topic', {