Fix bug
This commit is contained in:
parent
32117a573b
commit
6b19e54c23
|
@ -102,7 +102,6 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onStats(stats) {
|
onStats(stats) {
|
||||||
stats.mem.used = stats.mem.total - stats.mem.free;
|
|
||||||
this.stats.push(stats);
|
this.stats.push(stats);
|
||||||
if (this.stats.length > 50) this.stats.shift();
|
if (this.stats.length > 50) this.stats.shift();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onStats(stats) {
|
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.usage = stats.mem.used / stats.mem.total;
|
||||||
this.total = stats.mem.total;
|
this.total = stats.mem.total;
|
||||||
this.used = stats.mem.used;
|
this.used = stats.mem.used;
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default function() {
|
||||||
|
|
||||||
async function tick() {
|
async function tick() {
|
||||||
const cpu = await cpuUsage();
|
const cpu = await cpuUsage();
|
||||||
const freemem = await freeMem();
|
const usedmem = await usedMem();
|
||||||
const totalmem = await totalMem();
|
const totalmem = await totalMem();
|
||||||
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
|
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ export default function() {
|
||||||
cpu_usage: cpu,
|
cpu_usage: cpu,
|
||||||
mem: {
|
mem: {
|
||||||
total: totalmem,
|
total: totalmem,
|
||||||
free: freemem
|
used: usedmem
|
||||||
},
|
},
|
||||||
disk,
|
disk,
|
||||||
os_uptime: os.uptime(),
|
os_uptime: os.uptime(),
|
||||||
|
@ -55,7 +55,7 @@ async function cpuUsage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MEMORY(excl buffer + cache) STAT
|
// MEMORY(excl buffer + cache) STAT
|
||||||
async function freeMem() {
|
async function usedMem() {
|
||||||
try {
|
try {
|
||||||
const data = await sysUtils.mem();
|
const data = await sysUtils.mem();
|
||||||
return data.active;
|
return data.active;
|
||||||
|
|
Loading…
Reference in New Issue