1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-31 03:09:44 +02:00

feat(uac): add multi user management and UAC (#647)

This commit is contained in:
Anthony Lapenna 2017-03-12 17:24:15 +01:00 committed by GitHub
parent f28f223624
commit 80d50378c5
91 changed files with 3973 additions and 866 deletions

View file

@ -2,6 +2,7 @@ angular.module('portainer.services')
.factory('ModalService', [function ModalServiceFactory() {
'use strict';
var service = {};
service.confirm = function(options){
var box = bootbox.confirm({
title: options.title,
@ -9,11 +10,11 @@ angular.module('portainer.services')
buttons: {
confirm: {
label: options.buttons.confirm.label,
className: 'btn-danger'
className: options.buttons.confirm.className
},
cancel: {
label: options.buttons.cancel.label
}
cancel: {
label: options.buttons.cancel && options.buttons.cancel.label ? options.buttons.cancel.label : 'Cancel'
}
},
callback: options.callback
});
@ -24,5 +25,62 @@ angular.module('portainer.services')
}
});
};
service.confirmOwnershipChange = function(callback, msg) {
service.confirm({
title: 'Are you sure ?',
message: msg,
buttons: {
confirm: {
label: 'Change ownership',
className: 'btn-primary'
}
},
callback: callback,
});
};
service.confirmContainerOwnershipChange = function(callback) {
var msg = 'You can change the ownership of a container one way only. You will not be able to make this container private again. <b>Changing ownership on this container will also change the ownership on any attached volume.</b>';
service.confirmOwnershipChange(callback, msg);
};
service.confirmServiceOwnershipChange = function(callback) {
var msg = 'You can change the ownership of a service one way only. You will not be able to make this service private again. <b>Changing ownership on this service will also change the ownership on any attached volume.</b>';
service.confirmOwnershipChange(callback, msg);
};
service.confirmVolumeOwnershipChange = function(callback) {
var msg = 'You can change the ownership of a volume one way only. You will not be able to make this volume private again.';
service.confirmOwnershipChange(callback, msg);
};
service.confirmImageForceRemoval = function(callback) {
service.confirm({
title: "Are you sure?",
message: "Forcing the removal of the image will remove the image even if it has multiple tags or if it is used by stopped containers.",
buttons: {
confirm: {
label: 'Remove the image',
className: 'btn-danger'
}
},
callback: callback,
});
};
service.confirmDeletion = function(message, callback) {
service.confirm({
title: 'Are you sure ?',
message: message,
buttons: {
confirm: {
label: 'Delete',
className: 'btn-danger'
}
},
callback: callback,
});
};
return service;
}]);