mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-29 20:21:35 +03:00
Merge pull request #657 from notFloran/hide-empty-sensors
Hide empty sensors in web ui
This commit is contained in:
commit
2905689749
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user