summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-07-27 18:18:05 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-07-27 18:18:05 +0900
commit6b19e54c23d100d10ccc643f8eadeaafdc0b67e0 (patch)
treedb509186c33cfc8d141d12093c75b6e0ed50efe8 /src
parentFix bug (diff)
downloadsharkey-6b19e54c23d100d10ccc643f8eadeaafdc0b67e0.tar.gz
sharkey-6b19e54c23d100d10ccc643f8eadeaafdc0b67e0.tar.bz2
sharkey-6b19e54c23d100d10ccc643f8eadeaafdc0b67e0.zip
Fix bug
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/widgets/server.cpu-memory.vue1
-rw-r--r--src/client/app/common/views/widgets/server.memory.vue2
-rw-r--r--src/daemons/server-stats.ts6
3 files changed, 4 insertions, 5 deletions
diff --git a/src/client/app/common/views/widgets/server.cpu-memory.vue b/src/client/app/common/views/widgets/server.cpu-memory.vue
index da6b9f799f..00c42bf73b 100644
--- a/src/client/app/common/views/widgets/server.cpu-memory.vue
+++ b/src/client/app/common/views/widgets/server.cpu-memory.vue
@@ -102,7 +102,6 @@ export default Vue.extend({
},
methods: {
onStats(stats) {
- stats.mem.used = stats.mem.total - stats.mem.free;
this.stats.push(stats);
if (this.stats.length > 50) this.stats.shift();
diff --git a/src/client/app/common/views/widgets/server.memory.vue b/src/client/app/common/views/widgets/server.memory.vue
index 9212f2271f..8a60621343 100644
--- a/src/client/app/common/views/widgets/server.memory.vue
+++ b/src/client/app/common/views/widgets/server.memory.vue
@@ -35,7 +35,7 @@ export default Vue.extend({
},
methods: {
onStats(stats) {
- stats.mem.used = stats.mem.total - stats.mem.free;
+ stats.mem.free = stats.mem.total - stats.mem.used;
this.usage = stats.mem.used / stats.mem.total;
this.total = stats.mem.total;
this.used = stats.mem.used;
diff --git a/src/daemons/server-stats.ts b/src/daemons/server-stats.ts
index 750c00c0c4..d1b5126381 100644
--- a/src/daemons/server-stats.ts
+++ b/src/daemons/server-stats.ts
@@ -19,7 +19,7 @@ export default function() {
async function tick() {
const cpu = await cpuUsage();
- const freemem = await freeMem();
+ const usedmem = await usedMem();
const totalmem = await totalMem();
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
@@ -27,7 +27,7 @@ export default function() {
cpu_usage: cpu,
mem: {
total: totalmem,
- free: freemem
+ used: usedmem
},
disk,
os_uptime: os.uptime(),
@@ -55,7 +55,7 @@ async function cpuUsage() {
}
// MEMORY(excl buffer + cache) STAT
-async function freeMem() {
+async function usedMem() {
try {
const data = await sysUtils.mem();
return data.active;