Fix build UI in the repo view to only show the number of current builds
This commit is contained in:
parent
5f0969778e
commit
9e6e4b6a7c
2 changed files with 11 additions and 8 deletions
|
@ -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();
|
||||
|
|
Reference in a new issue