Start on the new build view

This commit is contained in:
Joseph Schorr 2015-02-26 17:45:28 -05:00
parent 5cc1c90021
commit e227d7e526
30 changed files with 816 additions and 11 deletions

View file

@ -0,0 +1,51 @@
(function() {
/**
* Build view page. Displays the view of a particular build for a repository.
*/
angular.module('quayPages').config(['pages', function(pages) {
pages.create('build-view', 'build-view.html', BuildViewCtrl, {
newLayout: true
});
}]);
function BuildViewCtrl($scope, ApiService, $routeParams, AngularPollChannel) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
$scope.build_uuid = $routeParams.buildid;
var loadBuild = function() {
var params = {
'repository': $scope.namespace + '/' + $scope.name,
'build_uuid': $scope.build_uuid
};
$scope.buildResource = ApiService.getRepoBuildAsResource(params).get(function(build) {
$scope.build = build;
$scope.originalBuild = build;
});
};
var loadRepository = function() {
var params = {
'repository': $scope.namespace + '/' + $scope.name
};
$scope.repoResource = ApiService.getRepoAsResource(params).get(function(repo) {
$scope.repo = repo;
}, ApiService.errorDisplay('Cannot load repository'));
};
// Page startup:
loadRepository();
loadBuild();
$scope.setUpdatedBuild = function(build) {
$scope.build = build;
};
$scope.isBuilding = function(build) {
if (!build) { return true; }
return build.phase != 'complete' && build.phase != 'error';
};
}
})();