summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-06-09 01:15:48 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-06-09 01:15:48 +0900
commit04d07f9bba9c6354c55ba1529d41ba6c9182f3db (patch)
treea0f741323fc1d680058b5dc8ceeb1fc0ccc65c86
parentv2041 (diff)
downloadmisskey-04d07f9bba9c6354c55ba1529d41ba6c9182f3db.tar.gz
misskey-04d07f9bba9c6354c55ba1529d41ba6c9182f3db.tar.bz2
misskey-04d07f9bba9c6354c55ba1529d41ba6c9182f3db.zip
Fix bug
-rw-r--r--src/web/app/desktop/tags/home-widgets/server.tag5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/web/app/desktop/tags/home-widgets/server.tag b/src/web/app/desktop/tags/home-widgets/server.tag
index 7a51299585..0d869eec9d 100644
--- a/src/web/app/desktop/tags/home-widgets/server.tag
+++ b/src/web/app/desktop/tags/home-widgets/server.tag
@@ -139,17 +139,18 @@
});
this.onStats = stats => {
+ stats.mem.used = stats.mem.total - stats.mem.free;
this.stats.push(stats);
if (this.stats.length > 50) this.stats.shift();
const cpuPolylinePoints = this.stats.map((s, i) => `${this.viewBoxX - ((this.stats.length - 1) - i)},${(1 - s.cpu_usage) * this.viewBoxY}`).join(' ');
- const memPolylinePoints = this.stats.map((s, i) => `${this.viewBoxX - ((this.stats.length - 1) - i)},${(s.mem.free / s.mem.total) * this.viewBoxY}`).join(' ');
+ const memPolylinePoints = this.stats.map((s, i) => `${this.viewBoxX - ((this.stats.length - 1) - i)},${(1 - (s.mem.used / s.mem.total)) * this.viewBoxY}`).join(' ');
const cpuPolygonPoints = `${this.viewBoxX - (this.stats.length - 1)},${ this.viewBoxY } ${ cpuPolylinePoints } ${ this.viewBoxX },${ this.viewBoxY }`;
const memPolygonPoints = `${this.viewBoxX - (this.stats.length - 1)},${ this.viewBoxY } ${ memPolylinePoints } ${ this.viewBoxX },${ this.viewBoxY }`;
const cpuColor = `hsl(${180 - (stats.cpu_usage * 180)}, 80%, 70%)`;
- const memColor = `hsl(${180 - (stats.mem.free / stats.mem.total * 180)}, 80%, 70%)`;
+ const memColor = `hsl(${180 - (stats.mem.used / stats.mem.total * 180)}, 80%, 70%)`;
this.update({
cpuPolylinePoints,