[BUGFIX] 0 value in loadavg

This commit is contained in:
Xaver Maierhofer 2017-11-18 12:08:39 +01:00
parent 0c9860192b
commit e99c38970a
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8

View File

@ -61,16 +61,10 @@ define(['snabbdom', 'helper', 'moment'], function (V, helper, moment) {
}; };
self.showLoad = function showLoad(d) { self.showLoad = function showLoad(d) {
if (!d.loadavg) {
return undefined;
}
return showBar(d.loadavg.toFixed(2), d.loadavg % 1, d.loadavg >= d.nproc); return showBar(d.loadavg.toFixed(2), d.loadavg % 1, d.loadavg >= d.nproc);
}; };
self.showRAM = function showRAM(d) { self.showRAM = function showRAM(d) {
if (!d.memory_usage) {
return undefined;
}
return showBar(Math.round(d.memory_usage * 100) + ' %', d.memory_usage, d.memory_usage >= 0.8); return showBar(Math.round(d.memory_usage * 100) + ' %', d.memory_usage, d.memory_usage >= 0.8);
}; };