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:
parent
53f31ba3b8
commit
50305e0eee
5 changed files with 104 additions and 80 deletions
20
app/services/infoService.js
Normal file
20
app/services/infoService.js
Normal 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;
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue