mirror of
https://github.com/portainer/portainer.git
synced 2025-08-06 06:15:22 +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
|
* ! PULL IMAGE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
service.tagImage = function(id, image, registry) {
|
service.tagImage = function(id, image) {
|
||||||
void registry;
|
|
||||||
return Image.tag({id: id, repo: image}).$promise;
|
return Image.tag({id: id, repo: image}).$promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
<!-- !tag-note -->
|
<!-- !tag-note -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-12">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -2,8 +2,8 @@ import _ from 'lodash-es';
|
||||||
import { PorImageRegistryModel } from 'Docker/models/porImageRegistry';
|
import { PorImageRegistryModel } from 'Docker/models/porImageRegistry';
|
||||||
|
|
||||||
angular.module('portainer.docker')
|
angular.module('portainer.docker')
|
||||||
.controller('ImageController', ['$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, RegistryService, Notifications, HttpRequestHelper, ModalService, FileSaver, Blob) {
|
function ($q, $scope, $transition$, $state, $timeout, ImageService, ImageHelper, RegistryService, Notifications, HttpRequestHelper, ModalService, FileSaver, Blob) {
|
||||||
$scope.formValues = {
|
$scope.formValues = {
|
||||||
RegistryModel: new PorImageRegistryModel()
|
RegistryModel: new PorImageRegistryModel()
|
||||||
};
|
};
|
||||||
|
@ -26,12 +26,12 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
||||||
$('#layer-command-'+layerId+'-full').toggle();
|
$('#layer-command-'+layerId+'-full').toggle();
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO CHANGE
|
|
||||||
$scope.tagImage = function() {
|
$scope.tagImage = function() {
|
||||||
var image = $scope.formValues.Image;
|
const registryModel = $scope.formValues.RegistryModel;
|
||||||
var registry = $scope.formValues.Registry;
|
|
||||||
|
|
||||||
ImageService.tagImage($transition$.params().id, image, registry.URL)
|
const image = ImageHelper.createImageConfigForContainer(registryModel);
|
||||||
|
|
||||||
|
ImageService.tagImage($transition$.params().id, image.fromImage)
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
Notifications.success('Image successfully tagged');
|
Notifications.success('Image successfully tagged');
|
||||||
$state.go('docker.images.image', {id: $transition$.params().id}, {reload: true});
|
$state.go('docker.images.image', {id: $transition$.params().id}, {reload: true});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue