1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 07:19:41 +02:00

Add err message when image or container not found

This commit is contained in:
Michael Crosby 2013-06-14 15:37:00 -09:00
parent 20f67f9f4a
commit 3985e608c2
5 changed files with 30 additions and 9 deletions

View file

@ -151,7 +151,10 @@ function ContainerController($scope, $routeParams, $location, Container) {
$scope.container = d;
}, function(e) {
console.log(e);
$location.path('/containers/');
setFailedResponse($scope, e.data, '#response');
if (e.status === 404) {
$('.detail').hide();
}
});
$scope.getChanges();
@ -185,9 +188,14 @@ function ContainersController($scope, Container, Settings) {
// Controller for the list of images
function ImagesController($scope, Image) {
$scope.predicate = '-Created';
$('#response').hide();
$scope.alertClass = 'block';
Image.query({}, function(d) {
$scope.images = d;
}, function (e) {
console.log(e);
setFailedResponse($scope, e.data, '#response');
});
}
@ -232,7 +240,10 @@ function ImageController($scope, $routeParams, $location, Image) {
$scope.image = d;
}, function(e) {
console.log(e);
$location.path('/images/');
setFailedResponse($scope, e.data, '#response');
if (e.status === 404) {
$('.detail').hide();
}
});
$scope.getHistory();