You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/docker/services/swarmService.js

25 lines
589 B

import { SwarmViewModel } from '../models/swarm';
angular.module('portainer.docker')
.factory('SwarmService', ['$q', 'Swarm', function SwarmServiceFactory($q, Swarm) {
'use strict';
var service = {};
service.swarm = function() {
var deferred = $q.defer();
Swarm.get().$promise
.then(function success(data) {
var swarm = new SwarmViewModel(data);
deferred.resolve(swarm);
})
.catch(function error(err) {
deferred.reject({ msg: 'Unable to retrieve Swarm details', err: err });
});
return deferred.promise;
};
return service;
}]);