diff options
author | Nicolas Hennion <nicolashennion@gmail.com> | 2015-09-13 13:53:09 +0200 |
---|---|---|
committer | Nicolas Hennion <nicolashennion@gmail.com> | 2015-09-13 13:53:09 +0200 |
commit | e068f41908a1fb032979af3a9f5adcd7ae775fb5 (patch) | |
tree | 3b1ae1814169461e3c123e352bf57726c317c778 | |
parent | 1006adcce65fa1b4eab42038c8daf8f5ea3a96fe (diff) | |
parent | 70507faff248133cb4f100cf1eed63d824ea21e8 (diff) |
Merge pull request #677 from notFloran/fix-webui-raid
[WebUI] Hide RAID plugin if no data
-rw-r--r-- | glances/outputs/static/html/stats.html | 2 | ||||
-rw-r--r-- | glances/outputs/static/js/services/plugins/glances_raid.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/glances/outputs/static/html/stats.html b/glances/outputs/static/html/stats.html index d8ceed44..8a201c9a 100644 --- a/glances/outputs/static/html/stats.html +++ b/glances/outputs/static/html/stats.html @@ -51,7 +51,7 @@ <section id="network" class="plugin table-row-group" ng-show="show.network" ng-include src="'plugins/network.html'"></section> <section id="diskio" class="plugin table-row-group" ng-show="show.diskio" ng-include src="'plugins/diskio.html'"></section> <section id="fs" class="plugin table-row-group" ng-show="show.fs" ng-include src="'plugins/fs.html'"></section> - <section id="raid" class="plugin table-row-group" ng-show="show.fs" ng-include src="'plugins/raid.html'"></section> + <section id="raid" class="plugin table-row-group" ng-show="statsRaid.hasDisks()" ng-include src="'plugins/raid.html'"></section> <section id="sensors" class="plugin table-row-group" ng-show="show.sensors && statsSensors.sensors.length > 0" ng-include src="'plugins/sensors.html'"></section> </div> </div> diff --git a/glances/outputs/static/js/services/plugins/glances_raid.js b/glances/outputs/static/js/services/plugins/glances_raid.js index f2100017..637009e7 100644 --- a/glances/outputs/static/js/services/plugins/glances_raid.js +++ b/glances/outputs/static/js/services/plugins/glances_raid.js @@ -30,6 +30,10 @@ glancesApp.service('GlancesPluginRaid', function () { }, this); }; + this.hasDisks = function() { + return this.disks.length > 0; + } + this.getAlert = function(disk) { if (disk.inactive) { return 'critical'; |