Merge pull request #657 from notFloran/hide-empty-sensors

Hide empty sensors in web ui
This commit is contained in:
Nicolas Hennion 2015-08-22 23:10:03 +02:00
commit 2905689749

View File

@ -4,11 +4,13 @@ glancesApp.service('GlancesPluginSensors', function(GlancesPlugin) {
this.sensors = []; this.sensors = [];
this.setData = function(data, views) { this.setData = function(data, views) {
_.remove(data[_pluginName], function(sensor) { data = data[_pluginName];
return sensor.type == "battery" && _.isArray(sensor.value) && _.isEmpty(sensor.value);
_.remove(data, function(sensor) {
return (_.isArray(sensor.value) && _.isEmpty(sensor.value)) || sensor.value === 0;
}); });
this.sensors = data[_pluginName]; this.sensors = data;
}; };
this.getAlert = function(sensor) { this.getAlert = function(sensor) {