mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(registries): add registry management (#930)
This commit is contained in:
parent
9360f24d89
commit
08c5a5a4f6
75 changed files with 2317 additions and 621 deletions
26
app/services/api/dockerhubService.js
Normal file
26
app/services/api/dockerhubService.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
angular.module('portainer.services')
|
||||
.factory('DockerHubService', ['$q', 'DockerHub', function DockerHubServiceFactory($q, DockerHub) {
|
||||
'use strict';
|
||||
var service = {};
|
||||
|
||||
service.dockerhub = function() {
|
||||
var deferred = $q.defer();
|
||||
|
||||
DockerHub.get().$promise
|
||||
.then(function success(data) {
|
||||
var dockerhub = new DockerHubViewModel(data);
|
||||
deferred.resolve(dockerhub);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
deferred.reject({ msg: 'Unable to retrieve DockerHub details', err: err });
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
service.update = function(dockerhub) {
|
||||
return DockerHub.update({}, dockerhub).$promise;
|
||||
};
|
||||
|
||||
return service;
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue