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

feat(volume-creation): retrieve available drivers from the engine (#751)

This commit is contained in:
Anthony Lapenna 2017-04-01 12:18:46 +02:00 committed by GitHub
parent 53f31ba3b8
commit 50305e0eee
5 changed files with 104 additions and 80 deletions

View file

@ -0,0 +1,20 @@
angular.module('portainer.services')
.factory('InfoService', ['$q', 'Info', function InfoServiceFactory($q, Info) {
'use strict';
var service = {};
service.getVolumePlugins = function() {
var deferred = $q.defer();
Info.get({}).$promise
.then(function success(data) {
var plugins = data.Plugins.Volume;
deferred.resolve(plugins);
})
.catch(function error(err) {
deferred.reject({msg: 'Unable to retrieve volume plugin information', err: err});
});
return deferred.promise;
};
return service;
}]);