forked from FoundKeyGang/FoundKey
fix: server metrics widget
This commit is contained in:
parent
e27c6abaea
commit
a7be9be43d
1 changed files with 4 additions and 4 deletions
|
@ -121,10 +121,10 @@ function onStats(connStats) {
|
||||||
cpuPolygonPoints = `${viewBoxX - (stats.length - 1)},${viewBoxY} ${cpuPolylinePoints} ${viewBoxX},${viewBoxY}`;
|
cpuPolygonPoints = `${viewBoxX - (stats.length - 1)},${viewBoxY} ${cpuPolylinePoints} ${viewBoxX},${viewBoxY}`;
|
||||||
memPolygonPoints = `${viewBoxX - (stats.length - 1)},${viewBoxY} ${memPolylinePoints} ${viewBoxX},${viewBoxY}`;
|
memPolygonPoints = `${viewBoxX - (stats.length - 1)},${viewBoxY} ${memPolylinePoints} ${viewBoxX},${viewBoxY}`;
|
||||||
|
|
||||||
cpuHeadX = cpuPolylinePoints[cpuPolylinePoints.length - 1][0];
|
cpuHeadX = cpuPolylinePointsStats[cpuPolylinePointsStats.length - 1][0];
|
||||||
cpuHeadY = cpuPolylinePoints[cpuPolylinePoints.length - 1][1];
|
cpuHeadY = cpuPolylinePointsStats[cpuPolylinePointsStats.length - 1][1];
|
||||||
memHeadX = memPolylinePoints[memPolylinePoints.length - 1][0];
|
memHeadX = memPolylinePointsStats[memPolylinePointsStats.length - 1][0];
|
||||||
memHeadY = memPolylinePoints[memPolylinePoints.length - 1][1];
|
memHeadY = memPolylinePointsStats[memPolylinePointsStats.length - 1][1];
|
||||||
|
|
||||||
cpuP = (connStats.cpu * 100).toFixed(0);
|
cpuP = (connStats.cpu * 100).toFixed(0);
|
||||||
memP = (connStats.mem.active / props.meta.mem.total * 100).toFixed(0);
|
memP = (connStats.mem.active / props.meta.mem.total * 100).toFixed(0);
|
||||||
|
|
Loading…
Reference in a new issue