Load repo info on the image view page so we can display the proper visibility status in the repo circle
This commit is contained in:
parent
c75921498c
commit
5115292bf8
1 changed files with 20 additions and 5 deletions
|
@ -1808,6 +1808,16 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
|
||||||
}, 10);
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var fetchRepository = function() {
|
||||||
|
var params = {
|
||||||
|
'repository': namespace + '/' + name
|
||||||
|
};
|
||||||
|
|
||||||
|
ApiService.getRepoAsResource(params).get(function(repo) {
|
||||||
|
$scope.repo = repo;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var fetchImage = function() {
|
var fetchImage = function() {
|
||||||
var params = {
|
var params = {
|
||||||
'repository': namespace + '/' + name,
|
'repository': namespace + '/' + name,
|
||||||
|
@ -1815,11 +1825,13 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.image = ApiService.getImageAsResource(params).get(function(image) {
|
$scope.image = ApiService.getImageAsResource(params).get(function(image) {
|
||||||
$scope.repo = {
|
if (!$scope.repo) {
|
||||||
'name': name,
|
$scope.repo = {
|
||||||
'namespace': namespace,
|
'name': name,
|
||||||
'is_public': true
|
'namespace': namespace,
|
||||||
};
|
'is_public': true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
$rootScope.title = 'View Image - ' + image.id;
|
$rootScope.title = 'View Image - ' + image.id;
|
||||||
$rootScope.description = 'Viewing docker image ' + image.id + ' under repository ' + namespace + '/' + name +
|
$rootScope.description = 'Viewing docker image ' + image.id + ' under repository ' + namespace + '/' + name +
|
||||||
|
@ -1860,6 +1872,9 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Fetch the repository.
|
||||||
|
fetchRepository();
|
||||||
|
|
||||||
// Fetch the image.
|
// Fetch the image.
|
||||||
fetchImage();
|
fetchImage();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue