From ce2537d69dfac3c6d179d6efd7c364aa3e7dc8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 8 Jul 2021 19:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E7=9C=8B=E6=9D=BF=E7=A3=81?= =?UTF-8?q?=E7=9B=98=E7=BC=93=E5=AD=98=E7=94=A8=E9=87=8F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E7=A3=81=E7=9B=98=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@default/clusters/cluster/node/boards/index.html | 2 +- .../@default/clusters/cluster/node/boards/index.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/web/views/@default/clusters/cluster/node/boards/index.html b/web/views/@default/clusters/cluster/node/boards/index.html index 0973cd03..ccba57a7 100644 --- a/web/views/@default/clusters/cluster/node/boards/index.html +++ b/web/views/@default/clusters/cluster/node/boards/index.html @@ -33,7 +33,7 @@

磁盘缓存用量

-
{{board.cacheDiskSize}}
+
{{board.cacheDiskSize}}剩余{{cacheDirAvail}}

内存缓存用量

diff --git a/web/views/@default/clusters/cluster/node/boards/index.js b/web/views/@default/clusters/cluster/node/boards/index.js index bd44834d..238d9a6f 100644 --- a/web/views/@default/clusters/cluster/node/boards/index.js +++ b/web/views/@default/clusters/cluster/node/boards/index.js @@ -428,10 +428,13 @@ Tea.context(function () { this.cacheDirUsed = "" this.cacheDirTotal = "" + this.cacheDirAvail = "" + this.cacheDirAvailWarning = false if (this.cacheDirValues.length > 0) { this.cacheDirUsed = teaweb.formatBytes(this.cacheDirValues.$last().value.dirs[0].used) this.cacheDirTotal = teaweb.formatBytes(this.cacheDirValues.$last().value.dirs[0].total) this.cacheDirAvail = teaweb.formatBytes(this.cacheDirValues.$last().value.dirs[0].avail) + this.cacheDirAvailWarning = (this.cacheDirValues.$last().value.dirs[0].avail < 1024 * 1024 * 1024 * 10) } this.reloadCacheDirsChart = function () { let axis = {unit: "%", divider: 1} @@ -443,12 +446,12 @@ Tea.context(function () { return v.time }, tooltip: function (args, stats) { - var v = stats[args.dataIndex].value.dirs[0] - return stats[args.dataIndex].time + "
使用:" + teaweb.formatBytes(v.used) + "
总量:" + teaweb.formatBytes(v.total) + "
比例:" + (Math.ceil(v.used * 100/v.total * 100) / 100) + "%" + var v = stats[args.dataIndex].value.dirs[0] + return stats[args.dataIndex].time + "
使用:" + teaweb.formatBytes(v.used) + "
总量:" + teaweb.formatBytes(v.total) + "
比例:" + (Math.ceil(v.used * 100 / v.total * 100) / 100) + "%" }, value: function (v) { - v = v.value.dirs[0] - return (v.used * 100 / v.total) ; + v = v.value.dirs[0] + return (v.used * 100 / v.total); }, axis: axis, max: 100