summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Hennion <nicolashennion@gmail.com>2015-09-13 13:53:09 +0200
committerNicolas Hennion <nicolashennion@gmail.com>2015-09-13 13:53:09 +0200
commite068f41908a1fb032979af3a9f5adcd7ae775fb5 (patch)
tree3b1ae1814169461e3c123e352bf57726c317c778
parent1006adcce65fa1b4eab42038c8daf8f5ea3a96fe (diff)
parent70507faff248133cb4f100cf1eed63d824ea21e8 (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.html2
-rw-r--r--glances/outputs/static/js/services/plugins/glances_raid.js4
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';