Get the main repo page design working
This commit is contained in:
parent
3d3c8ca198
commit
002dc083f2
18 changed files with 299 additions and 18 deletions
|
@ -13,12 +13,14 @@
|
|||
}, ['old-layout']);
|
||||
}]);
|
||||
|
||||
function RepoViewCtrl($scope, $routeParams, ApiService, UserService) {
|
||||
function RepoViewCtrl($scope, $routeParams, ApiService, UserService, AngularPollChannel) {
|
||||
$scope.namespace = $routeParams.namespace;
|
||||
$scope.name = $routeParams.name;
|
||||
|
||||
$scope.logsShown = 0;
|
||||
|
||||
var buildPollChannel = null;
|
||||
|
||||
// Make sure we track the current user.
|
||||
UserService.updateUserIn($scope);
|
||||
|
||||
|
@ -30,12 +32,32 @@
|
|||
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
|
||||
$scope.repository = repo;
|
||||
$scope.setTag($routeParams.tag);
|
||||
|
||||
// Track builds.
|
||||
buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 5000 /* 5s */);
|
||||
buildPollChannel.start();
|
||||
});
|
||||
};
|
||||
|
||||
var loadRepositoryBuilds = function(callback) {
|
||||
var params = {
|
||||
'repository': $scope.namespace + '/' + $scope.name
|
||||
};
|
||||
|
||||
var errorHandler = function() {
|
||||
callback(false);
|
||||
};
|
||||
|
||||
$scope.repositoryBuildsResource = ApiService.getRepoBuildsAsResource(params, /* background */true).get(function(resp) {
|
||||
$scope.builds = resp.builds;
|
||||
callback(false);
|
||||
}, errorHandler);
|
||||
};
|
||||
|
||||
// Load the repository.
|
||||
loadRepository();
|
||||
|
||||
|
||||
$scope.setTag = function(tagName) {
|
||||
window.console.log('set tag')
|
||||
};
|
||||
|
|
Reference in a new issue