fix(extensions): init endpoint extensions after admin user creation (#1733)

* fix(extensions): init endpoint extensions after admin user creation
pull/1330/merge
Anthony Lapenna 2018-03-18 07:09:07 +10:00 committed by GitHub
parent adf1ba7b47
commit 27dcd708a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
angular.module('portainer.app')
.controller('InitAdminController', ['$scope', '$state', '$sanitize', 'Notifications', 'Authentication', 'StateManager', 'UserService', 'EndpointService', 'EndpointProvider',
function ($scope, $state, $sanitize, Notifications, Authentication, StateManager, UserService, EndpointService, EndpointProvider) {
.controller('InitAdminController', ['$scope', '$state', '$sanitize', 'Notifications', 'Authentication', 'StateManager', 'UserService', 'EndpointService', 'EndpointProvider', 'ExtensionManager',
function ($scope, $state, $sanitize, Notifications, Authentication, StateManager, UserService, EndpointService, EndpointProvider, ExtensionManager) {
$scope.logo = StateManager.getState().application.logo;
@ -31,8 +31,13 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager
$state.go('portainer.init.endpoint');
} else {
var endpoint = data[0];
EndpointProvider.setEndpointID(endpoint.Id);
StateManager.updateEndpointState(false, endpoint.Extensions)
endpointID = endpoint.Id;
EndpointProvider.setEndpointID(endpointID);
ExtensionManager.initEndpointExtensions(endpointID)
.then(function success(data) {
var extensions = data;
return StateManager.updateEndpointState(false, extensions);
})
.then(function success() {
$state.go('docker.dashboard');
})