From d041232ccd712eb48a10b10ec6a1e83bc6bf9a34 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 9 Jun 2017 01:21:56 +0900 Subject: [PATCH] [Client] Improve server home widget --- src/web/app/desktop/tags/home-widgets/server.tag | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/web/app/desktop/tags/home-widgets/server.tag b/src/web/app/desktop/tags/home-widgets/server.tag index 0d869eec9..94418005b 100644 --- a/src/web/app/desktop/tags/home-widgets/server.tag +++ b/src/web/app/desktop/tags/home-widgets/server.tag @@ -73,7 +73,7 @@ - CPU + CPU { cpuP }% - MEM + MEM { memP }% tspan + opacity 0.5 + &:after content "" display block @@ -152,13 +155,18 @@ const cpuColor = `hsl(${180 - (stats.cpu_usage * 180)}, 80%, 70%)`; const memColor = `hsl(${180 - (stats.mem.used / stats.mem.total * 180)}, 80%, 70%)`; + const cpuP = (stats.cpu_usage * 100).toFixed(0); + const memP = (stats.mem.used / stats.mem.total * 100).toFixed(0); + this.update({ cpuPolylinePoints, memPolylinePoints, cpuPolygonPoints, memPolygonPoints, cpuColor, - memColor + memColor, + cpuP, + memP }); };