Merge "Add warning for stale subunit2sql data"

This commit is contained in:
Jenkins 2016-03-01 20:02:36 +00:00 committed by Gerrit Code Review
commit 136be737a6
8 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,38 @@
'use strict';
var directivesModule = require('./_index.js');
/**
* @ngInject
*/
function freshCheck() {
/**
* @ngInject
*/
var controller = function($scope, healthService) {
$scope.status = null;
$scope.date = null;
healthService.getRecentGroupedRuns('build_queue', 'gate', {
num_runs: 1
}).then(function(response) {
var lastRun = response.data[0];
var today = new Date();
var runDate = new Date(lastRun.start_date);
var diffSecs = (today - runDate) / 1000;
var diffDays = diffSecs / (60 * 60 * 24);
if (diffSecs > (60 * 60 * 24)) {
$scope.status = 'stale';
$scope.date = runDate;
}
});
};
return {
restrict : 'EA',
templateUrl: 'fresh-check.html',
scope: true,
controller: controller
};
}
directivesModule.directive('freshCheck', freshCheck);

View File

@ -0,0 +1,5 @@
<div class="alert alert-warning" ng-if="status == 'stale'">
<fa name="exclamation-triangle"></fa>
The last data in the subunit2sql database is >1 day old. There might be an
issue with result collection.
</div>

View File

@ -11,6 +11,7 @@
<div class="row">
<div class="col-lg-12">
<loading-indicator></loading-indicator>
<fresh-check></fresh-check>
</div>
</div>
<div class="row">

View File

@ -7,6 +7,7 @@
show-resolution="true"
show-period="true"></crumb-menu>
<loading-indicator></loading-indicator>
<fresh-check></fresh-check>
</div>
</div>
</div>

View File

@ -11,6 +11,7 @@
<div class="row">
<div class="col-lg-12">
<loading-indicator></loading-indicator>
<fresh-check></fresh-check>
</div>
</div>
<div class="row">

View File

@ -11,6 +11,7 @@
<div class="row">
<div class="col-lg-12">
<loading-indicator></loading-indicator>
<fresh-check></fresh-check>
</div>
</div>
<div class=row>

View File

@ -9,6 +9,7 @@
<div class="row">
<div class="col-lg-12">
<loading-indicator></loading-indicator>
<fresh-check></fresh-check>
</div>
</div>
<div class="row">

View File

@ -9,6 +9,7 @@
<div class="row">
<div class="col-lg-12">
<loading-indicator></loading-indicator>
<fresh-check></fresh-check>
</div>
</div>
<div class="row">