Fix build UI in the repo view to only show the number of current builds

This commit is contained in:
Joseph Schorr 2014-03-05 15:53:00 -05:00
parent 5f0969778e
commit 9e6e4b6a7c
2 changed files with 11 additions and 8 deletions

View file

@ -689,15 +689,18 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
};
ApiService.getRepoBuilds(null, params, true).then(function(resp) {
// Build a filtered list of the builds that are currently running.
var runningBuilds = [];
for (var i = 0; i < resp.builds.length; ++i) {
var build = resp.builds[i];
if (build.status != 'complete') {
if (build['phase'] != 'complete' && build['phase'] != 'error') {
runningBuilds.push(build);
}
}
$scope.buildsInfo = runningBuilds;
$scope.runningBuilds = runningBuilds;
$scope.buildHistory = resp.builds;
if (!runningBuilds.length) {
// Cancel the build timer.
cancelBuildInfoTimer();