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:
parent
72cef567be
commit
d4c556752f
6 changed files with 150 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue