From acd31f5237bba3cdd1a02e69f1fcce666b0cfcdc Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 29 Mar 2022 10:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1--=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1--=E5=8D=B3?= =?UTF-8?q?=E6=97=B6=E7=9A=84tooltip=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@default/servers/server/stat/index.js | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/web/views/@default/servers/server/stat/index.js b/web/views/@default/servers/server/stat/index.js index a2b64aa9..e8c51760 100644 --- a/web/views/@default/servers/server/stat/index.js +++ b/web/views/@default/servers/server/stat/index.js @@ -2,6 +2,15 @@ Tea.context(function () { this.$delay(function () { let that = this + // 每N分钟取一次 + let newStats = [] + for (let i = 0; i < this.minutelyStats.length; i++) { + if (i % 5 == 0) { + newStats.push(this.minutelyStats[i]) + } + } + this.minutelyStats = newStats + this.reloadRequestsChart("minutely-requests-chart", "请求数统计", this.minutelyStats, function (args) { if (args.seriesIndex == 0) { return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "
请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countRequests) @@ -36,15 +45,6 @@ Tea.context(function () { return } - // 每N分钟取一次 - let newStats = [] - for (let i = 0; i < stats.length; i++) { - if (i % 5 == 0) { - newStats.push(stats[i]) - } - } - stats = newStats - let axis = teaweb.countAxis(stats, function (v) { return Math.max(v.countRequests, v.countCachedRequests) }) @@ -119,15 +119,6 @@ Tea.context(function () { return } - // 每N分钟取一次 - let newStats = [] - for (let i = 0; i < stats.length; i++) { - if (i % 5 == 0) { - newStats.push(stats[i]) - } - } - stats = newStats - let axis = teaweb.bytesAxis(stats, function (v) { return Math.max(v.bytes, v.cachedBytes) })