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

Add images views and controllers

This commit is contained in:
Michael Crosby 2013-06-09 14:11:40 -09:00
parent 72cef567be
commit d4c556752f
6 changed files with 150 additions and 3 deletions

View file

@ -90,3 +90,42 @@ function ContainersController($scope, Container) {
$scope.containers = d;
});
}
function ImagesController($scope, Image) {
$scope.predicate = '-Created';
Image.query({}, function(d) {
$scope.images = d;
});
}
function ImageController($scope, $routeParams, Image) {
$scope.history = [];
$scope.tag = {tag: '', repo: '', force: false};
$scope.remove = function() {
if (confirm("Are you sure you want to delete this image?")) {
Image.remove({id: $routeParams.id}, function(d) {
$scope.response = d;
});
}
};
$scope.getHistory = function() {
Image.history({id: $routeParams.id}, function(d) {
$scope.history = d;
});
};
$scope.updateTag = function() {
var tag = $scope.tag;
Image.tag({id: $routeParams.id, tag: tag.tag, repo: tag.repo, force: tag.force ? 1 : 0}, function(d) {
$scope.response = d;
});
};
Image.get({id: $routeParams.id}, function(d) {
$scope.image = d;
});
$scope.getHistory();
}