Merge branch 'master' of ssh://bitbucket.org/yackob03/quay
This commit is contained in:
commit
a87dcf79d4
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();
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
<div class="repo-controls">
|
||||
<!-- Builds -->
|
||||
<div class="dropdown" data-placement="top" style="display: inline-block"
|
||||
bs-tooltip="buildsInfo ? 'Dockerfile Builds Running: ' + (buildsInfo.length) : 'Dockerfile Build'"
|
||||
ng-show="repo.can_write || buildsInfo.length">
|
||||
bs-tooltip="runningBuilds.length ? 'Dockerfile Builds Running: ' + (runningBuilds.length) : 'Dockerfile Build'"
|
||||
ng-show="repo.can_write || buildHistory.length">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<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>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
|
@ -37,9 +37,9 @@
|
|||
<i class="fa fa-bolt" style="margin-left: 3px; margin-right: 10px;"></i>Build Triggers
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation" class="divider" ng-show="buildsInfo && repo.can_write"></li>
|
||||
<li role="presentation" class="dropdown-header" ng-show="buildsInfo">Current Builds</li>
|
||||
<li ng-repeat="buildInfo in buildsInfo">
|
||||
<li role="presentation" class="divider" ng-show="buildHistory && repo.can_write"></li>
|
||||
<li role="presentation" class="dropdown-header" ng-show="buildHistory.length">Recent Builds</li>
|
||||
<li ng-repeat="buildInfo in buildHistory">
|
||||
<div class="build-info" ng-class="repo.can_write ? 'clickable' : ''" ng-click="repo.can_write && showBuild(buildInfo)">
|
||||
<span class="build-status" build="buildInfo"></span>
|
||||
</div>
|
||||
|
|
Reference in a new issue