Drupal: Add views tile which is hidden if views are disabled

Change-Id: I3f3c9d95c9fb754052f29c7627fed125804cb6e3
This commit is contained in:
Frédéric Vachon 2015-06-29 14:12:35 -04:00
parent 980e4ee258
commit 4056cd3e68
3 changed files with 7 additions and 9 deletions

View File

@ -47,17 +47,9 @@
warning="70"
critical="40"></bansho-drupal-tile>
<!--
<bansho-drupal-tile host-name="{{hostName}}"
plugin="drupal_status"
title="Status"
warning="70"
critical="40"></bansho-drupal-tile>
<bansho-drupal-tile host-name="{{hostName}}"
plugin="drupal_views"
title="Views"
warning="70"
critical="40"></bansho-drupal-tile>
-->
</article>

View File

@ -1,4 +1,4 @@
<div class="tile__main" ng-controller='DrupalTileCtrl'>
<div class="tile__main" ng-controller='DrupalTileCtrl' ng-hide="hide">
<h1>{{title}} <span ng-class="finalScoreClass">{{finalScore}}</span></h1>
<table class="data-table">
<tbody>

View File

@ -34,6 +34,12 @@ angular.module('bansho.drupal.tile', [])
$scope.finalScoreClass = 'tile__score-warning';
}
if ($scope.plugins === 'drupal_views') {
if (response[0].plugin_output.indexOf('Views is not enabled.') !== -1) {
$scope.hide = true;
}
}
// Split data into (metric, score_class, action) tuples
for (var i = 0; i < data.length; i+=3) {
var tuple = [];