Add err message when image or container not found

pull/2/head
Michael Crosby 12 years ago
parent 20f67f9f4a
commit 3985e608c2

@ -96,3 +96,8 @@
.footer { .footer {
max-height:6px; max-height:6px;
} }
#response {
width: 80%;
margin: 0 auto;
}

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

@ -1,8 +1,9 @@
<div class="detail"> <div id="response" class="alert alert-{{ alertClass }}">
<div id="response" class="alert alert-{{ alertClass }}">
{{ response }} {{ response }}
</div> </div>
<div class="detail">
<h4>Container: {{ container.Id }}</h4> <h4>Container: {{ container.Id }}</h4>
<div class="btn-group detail"> <div class="btn-group detail">

@ -1,9 +1,9 @@
<div class="detail"> <div id="response" class="alert alert-{{ alertClass }}">
<div id="response" class="alert alert-{{ alertClass }}">
{{ response }} {{ response }}
</div> </div>
<div class="detail">
<h4>Image: {{ image.id }}</h4> <h4>Image: {{ image.id }}</h4>
<table class="table table-striped"> <table class="table table-striped">

@ -1,6 +1,10 @@
<h2>Images:</h2> <h2>Images:</h2>
<div id="response" class="alert alert-{{ alertClass }}">
{{ response }}
</div>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>

Loading…
Cancel
Save