节点看板磁盘缓存用量增加剩余磁盘空间

This commit is contained in:
GoEdgeLab
2021-07-08 19:47:49 +08:00
parent 049b6e4bcd
commit 8d1965d997
2 changed files with 8 additions and 5 deletions

View File

@@ -33,7 +33,7 @@
</div>
<div class="ui column">
<h4>磁盘缓存用量</h4>
<div class="value"><span>{{board.cacheDiskSize}}</span></div>
<div class="value"><span>{{board.cacheDiskSize}}</span><span class="small" :class="{grey: !cacheDirAvailWarning, red: cacheDirAvailWarning}" style="font-size: 0.9em" v-if="cacheDirAvail.length > 0">剩余{{cacheDirAvail}}</span></div>
</div>
<div class="ui column">
<h4>内存缓存用量</h4>

View File

@@ -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 + "<br/>使用:" + teaweb.formatBytes(v.used) + "<br/>总量:" + teaweb.formatBytes(v.total) + "<br/>比例:" + (Math.ceil(v.used * 100/v.total * 100) / 100) + "%"
var v = stats[args.dataIndex].value.dirs[0]
return stats[args.dataIndex].time + "<br/>使用:" + teaweb.formatBytes(v.used) + "<br/>总量:" + teaweb.formatBytes(v.total) + "<br/>比例:" + (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