diff --git a/app/components/image/image.html b/app/components/image/image.html index 59bc430d6..5cf83602a 100644 --- a/app/components/image/image.html +++ b/app/components/image/image.html @@ -11,24 +11,36 @@
diff --git a/app/components/image/imageController.js b/app/components/image/imageController.js index 7c474086a..fc663e23e 100644 --- a/app/components/image/imageController.js +++ b/app/components/image/imageController.js @@ -1,6 +1,11 @@ angular.module('image', []) -.controller('ImageController', ['$scope', '$stateParams', '$state', 'Image', 'ImageHelper', 'Messages', -function ($scope, $stateParams, $state, Image, ImageHelper, Messages) { +.filter('onlylabel', function(){ + return function(tag){ + return tag.substr(tag.indexOf(":")+1); + }; +}) +.controller('ImageController', ['$scope', '$stateParams', '$state', 'Image', 'ImageService', 'ImageHelper', 'Messages', +function ($scope, $stateParams, $state, Image, ImageService, ImageHelper, Messages) { $scope.RepoTags = []; $scope.config = { Image: '', @@ -49,6 +54,23 @@ function ($scope, $stateParams, $state, Image, ImageHelper, Messages) { }); }; + $scope.pullImage = function(tag) { + var items = tag.split(":"); + var image = items[0]; + tag = items[1]; + $('#loadingViewSpinner').show(); + ImageService.pullImage({fromImage: image, tag: tag}) + .then(function success(data) { + Messages.send('Image successfully pulled'); + }) + .catch(function error(error){ + Messages.error("Failure", error, "Unable to pull image"); + }) + .finally(function final() { + $('#loadingViewSpinner').hide(); + }); + }; + $scope.removeImage = function (id) { $('#loadingViewSpinner').show(); Image.remove({id: id}, function (d) {