Merge branch 'master' of ssh://bitbucket.org/yackob03/quay

This commit is contained in:
jakedt 2014-03-05 16:17:09 -05:00
commit a87dcf79d4
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) { ApiService.getRepoBuilds(null, params, true).then(function(resp) {
// Build a filtered list of the builds that are currently running.
var runningBuilds = []; var runningBuilds = [];
for (var i = 0; i < resp.builds.length; ++i) { for (var i = 0; i < resp.builds.length; ++i) {
var build = resp.builds[i]; var build = resp.builds[i];
if (build.status != 'complete') { if (build['phase'] != 'complete' && build['phase'] != 'error') {
runningBuilds.push(build); runningBuilds.push(build);
} }
} }
$scope.buildsInfo = runningBuilds; $scope.runningBuilds = runningBuilds;
$scope.buildHistory = resp.builds;
if (!runningBuilds.length) { if (!runningBuilds.length) {
// Cancel the build timer. // Cancel the build timer.
cancelBuildInfoTimer(); cancelBuildInfoTimer();

View file

@ -16,11 +16,11 @@
<div class="repo-controls"> <div class="repo-controls">
<!-- Builds --> <!-- Builds -->
<div class="dropdown" data-placement="top" style="display: inline-block" <div class="dropdown" data-placement="top" style="display: inline-block"
bs-tooltip="buildsInfo ? 'Dockerfile Builds Running: ' + (buildsInfo.length) : 'Dockerfile Build'" bs-tooltip="runningBuilds.length ? 'Dockerfile Builds Running: ' + (runningBuilds.length) : 'Dockerfile Build'"
ng-show="repo.can_write || buildsInfo.length"> ng-show="repo.can_write || buildHistory.length">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-tasks fa-lg"></i> <i class="fa fa-tasks fa-lg"></i>
<span class="count" ng-class="buildsInfo ? 'visible' : ''"><span>{{ buildsInfo ? buildsInfo.length : '' }}</span></span> <span class="count" ng-class="runningBuilds.length ? 'visible' : ''"><span>{{ runningBuilds.length ? runningBuilds.length : '' }}</span></span>
<b class="caret"></b> <b class="caret"></b>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
@ -37,9 +37,9 @@
<i class="fa fa-bolt" style="margin-left: 3px; margin-right: 10px;"></i>Build Triggers <i class="fa fa-bolt" style="margin-left: 3px; margin-right: 10px;"></i>Build Triggers
</a> </a>
</li> </li>
<li role="presentation" class="divider" ng-show="buildsInfo && repo.can_write"></li> <li role="presentation" class="divider" ng-show="buildHistory && repo.can_write"></li>
<li role="presentation" class="dropdown-header" ng-show="buildsInfo">Current Builds</li> <li role="presentation" class="dropdown-header" ng-show="buildHistory.length">Recent Builds</li>
<li ng-repeat="buildInfo in buildsInfo"> <li ng-repeat="buildInfo in buildHistory">
<div class="build-info" ng-class="repo.can_write ? 'clickable' : ''" ng-click="repo.can_write && showBuild(buildInfo)"> <div class="build-info" ng-class="repo.can_write ? 'clickable' : ''" ng-click="repo.can_write && showBuild(buildInfo)">
<span class="build-status" build="buildInfo"></span> <span class="build-status" build="buildInfo"></span>
</div> </div>