|
|
|
@ -1,21 +1,16 @@
|
|
|
|
|
angular.module('portainer')
|
|
|
|
|
.controller('porImageRegistryController', ['$q', 'RegistryService', 'DockerHubService', 'ImageService', 'Notifications',
|
|
|
|
|
function ($q, RegistryService, DockerHubService, ImageService, Notifications) {
|
|
|
|
|
.controller('porImageRegistryController', ['$q', 'RegistryService', 'DockerHubService', 'Notifications',
|
|
|
|
|
function ($q, RegistryService, DockerHubService, Notifications) {
|
|
|
|
|
var ctrl = this;
|
|
|
|
|
ctrl.availableImages = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function initComponent() {
|
|
|
|
|
$q.all({
|
|
|
|
|
registries: RegistryService.registries(),
|
|
|
|
|
dockerhub: DockerHubService.dockerhub(),
|
|
|
|
|
availableImages: ctrl.autoComplete ? ImageService.images() : []
|
|
|
|
|
dockerhub: DockerHubService.dockerhub()
|
|
|
|
|
})
|
|
|
|
|
.then(function success(data) {
|
|
|
|
|
var dockerhub = data.dockerhub;
|
|
|
|
|
var registries = data.registries;
|
|
|
|
|
ctrl.availableImages = _.flatten(_.map(data.availableImages, function (image) {
|
|
|
|
|
return image.RepoTags ? image.RepoTags : [];
|
|
|
|
|
}));
|
|
|
|
|
ctrl.availableRegistries = [dockerhub].concat(registries);
|
|
|
|
|
if (!ctrl.registry.Id) {
|
|
|
|
|
ctrl.registry = dockerhub;
|
|
|
|
|