From fcbed5f63e5aeb57c3f71ee29b6e93343a2fbaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 21 Jul 2021 09:02:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDNS=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E4=B8=ADY=E5=9D=90=E6=A0=87=E8=BD=B4=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/views/@default/dashboard/boards/dns.js | 26 +++------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/web/views/@default/dashboard/boards/dns.js b/web/views/@default/dashboard/boards/dns.js index d94b8942..2d9e8761 100644 --- a/web/views/@default/dashboard/boards/dns.js +++ b/web/views/@default/dashboard/boards/dns.js @@ -27,34 +27,14 @@ Tea.context(function () { this.reloadHourlyTrafficChart = function () { let stats = this.hourlyStats this.reloadTrafficChart("hourly-traffic-chart", "流量统计", stats, function (args) { - if (args.seriesIndex == 0) { - return stats[args.dataIndex].day + " " + stats[args.dataIndex].hour + "时 流量: " + teaweb.formatBytes(stats[args.dataIndex].bytes) - } - if (args.seriesIndex == 1) { - let ratio = 0 - if (stats[args.dataIndex].bytes > 0) { - ratio = Math.round(stats[args.dataIndex].cachedBytes * 10000 / stats[args.dataIndex].bytes) / 100 - } - return stats[args.dataIndex].day + " " + stats[args.dataIndex].hour + "时 缓存流量: " + teaweb.formatBytes(stats[args.dataIndex].cachedBytes) + ", 命中率:" + ratio + "%" - } - return "" + return stats[args.dataIndex].day + " " + stats[args.dataIndex].hour + "时 流量: " + teaweb.formatBytes(stats[args.dataIndex].bytes) }) } this.reloadDailyTrafficChart = function () { let stats = this.dailyStats this.reloadTrafficChart("daily-traffic-chart", "流量统计", stats, function (args) { - if (args.seriesIndex == 0) { - return stats[args.dataIndex].day + " 流量: " + teaweb.formatBytes(stats[args.dataIndex].bytes) - } - if (args.seriesIndex == 1) { - let ratio = 0 - if (stats[args.dataIndex].bytes > 0) { - ratio = Math.round(stats[args.dataIndex].cachedBytes * 10000 / stats[args.dataIndex].bytes) / 100 - } - return stats[args.dataIndex].day + " 缓存流量: " + teaweb.formatBytes(stats[args.dataIndex].cachedBytes) + ", 命中率:" + ratio + "%" - } - return "" + return stats[args.dataIndex].day + " 流量: " + teaweb.formatBytes(stats[args.dataIndex].bytes) }) } @@ -65,7 +45,7 @@ Tea.context(function () { } let axis = teaweb.bytesAxis(stats, function (v) { - return Math.max(v.bytes, v.cachedBytes) + return v.bytes }) let chart = teaweb.initChart(chartBox)