40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
|
(function() {
|
||
|
/**
|
||
|
* Application view page.
|
||
|
*/
|
||
|
angular.module('quayPages').config(['pages', function(pages) {
|
||
|
pages.create('app-view', 'app-view.html', AppViewCtrl, {
|
||
|
'newLayout': true,
|
||
|
'title': '{{ namespace }}/{{ name }}',
|
||
|
'description': 'Application {{ namespace }}/{{ name }}'
|
||
|
});
|
||
|
}]);
|
||
|
|
||
|
function AppViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
|
||
|
$scope.namespace = $routeParams.namespace;
|
||
|
$scope.name = $routeParams.name;
|
||
|
|
||
|
$scope.viewScope = {};
|
||
|
$scope.settingsShown = 0;
|
||
|
|
||
|
$scope.showSettings = function() {
|
||
|
$scope.settingsShown++;
|
||
|
};
|
||
|
|
||
|
var loadRepository = function() {
|
||
|
var params = {
|
||
|
'repository': $scope.namespace + '/' + $scope.name,
|
||
|
'repo_kind': 'application',
|
||
|
'includeStats': true
|
||
|
};
|
||
|
|
||
|
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
|
||
|
$scope.repository = repo;
|
||
|
$scope.viewScope.repository = repo;
|
||
|
});
|
||
|
};
|
||
|
|
||
|
loadRepository();
|
||
|
}
|
||
|
})();
|