1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 23:05:26 +02:00

feat(images): add the ability to export/import Docker images (#935) (#2073)

This commit is contained in:
baron_l 2018-07-26 15:09:48 +02:00 committed by Anthony Lapenna
parent d2702d6d7b
commit 5bca9560c9
16 changed files with 278 additions and 10 deletions

View file

@ -10,7 +10,6 @@ angular.module('portainer.app')
service.buildImage = function(names, file, path) {
var endpointID = EndpointProvider.endpointID();
Upload.setDefaults({ ngfMinSize: 10 });
return Upload.http({
url: 'api/endpoints/' + endpointID + '/docker/build',
headers : {
@ -28,6 +27,18 @@ angular.module('portainer.app')
});
};
service.loadImages = function(file) {
var endpointID = EndpointProvider.endpointID();
return Upload.http({
url: 'api/endpoints/' + endpointID + '/docker/images/load',
headers : {
'Content-Type': file.type
},
data: file,
ignoreLoadingBar: true
});
};
service.createSwarmStack = function(stackName, swarmId, file, env, endpointId) {
return Upload.upload({
url: 'api/stacks?method=file&type=1&endpointId=' + endpointId,

View file

@ -156,6 +156,20 @@ angular.module('portainer.app')
});
};
service.confirmImageExport = function(callback) {
service.confirm({
title: 'Caution',
message: 'The export may take several minutes, do not navigate away whilst the export is in progress.',
buttons: {
confirm: {
label: 'Continue',
className: 'btn-primary'
}
},
callback: callback
});
};
service.confirmServiceForceUpdate = function(message, callback) {
service.customPrompt({
title: 'Are you sure ?',