mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
feat(app): push pull image tag
This commit is contained in:
parent
d3d75423fb
commit
b549b8207a
3 changed files with 8 additions and 9 deletions
|
@ -154,8 +154,7 @@ angular.module('portainer.docker')
|
|||
* ! PULL IMAGE
|
||||
*/
|
||||
|
||||
service.tagImage = function(id, image, registry) {
|
||||
void registry;
|
||||
service.tagImage = function(id, image) {
|
||||
return Image.tag({id: id, repo: image}).$promise;
|
||||
};
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<!-- !tag-note -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!formValues.Image" ng-click="tagImage()">Tag</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!formValues.RegistryModel.Image" ng-click="tagImage()">Tag</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -2,8 +2,8 @@ import _ from 'lodash-es';
|
|||
import { PorImageRegistryModel } from 'Docker/models/porImageRegistry';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ImageController', ['$q', '$scope', '$transition$', '$state', '$timeout', 'ImageService', 'RegistryService', 'Notifications', 'HttpRequestHelper', 'ModalService', 'FileSaver', 'Blob',
|
||||
function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryService, Notifications, HttpRequestHelper, ModalService, FileSaver, Blob) {
|
||||
.controller('ImageController', ['$q', '$scope', '$transition$', '$state', '$timeout', 'ImageService', 'ImageHelper', 'RegistryService', 'Notifications', 'HttpRequestHelper', 'ModalService', 'FileSaver', 'Blob',
|
||||
function ($q, $scope, $transition$, $state, $timeout, ImageService, ImageHelper, RegistryService, Notifications, HttpRequestHelper, ModalService, FileSaver, Blob) {
|
||||
$scope.formValues = {
|
||||
RegistryModel: new PorImageRegistryModel()
|
||||
};
|
||||
|
@ -26,12 +26,12 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
|||
$('#layer-command-'+layerId+'-full').toggle();
|
||||
};
|
||||
|
||||
// TODO CHANGE
|
||||
$scope.tagImage = function() {
|
||||
var image = $scope.formValues.Image;
|
||||
var registry = $scope.formValues.Registry;
|
||||
const registryModel = $scope.formValues.RegistryModel;
|
||||
|
||||
ImageService.tagImage($transition$.params().id, image, registry.URL)
|
||||
const image = ImageHelper.createImageConfigForContainer(registryModel);
|
||||
|
||||
ImageService.tagImage($transition$.params().id, image.fromImage)
|
||||
.then(function success() {
|
||||
Notifications.success('Image successfully tagged');
|
||||
$state.go('docker.images.image', {id: $transition$.params().id}, {reload: true});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue