fix(home): fix an issue when trying to connect to an Azure ACI endpoint (#2671)

pull/2682/head
Anthony Lapenna 2019-02-04 09:04:52 +13:00 committed by GitHub
parent 2eec8b75d0
commit 899cd5f279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 120 additions and 120 deletions

View File

@ -1,12 +1,12 @@
angular.module('portainer.app')
.controller('HomeController', ['$q', '$scope', '$state', 'Authentication', 'EndpointService', 'EndpointHelper', 'GroupService', 'Notifications', 'EndpointProvider', 'StateManager', 'LegacyExtensionManager', 'ModalService', 'MotdService', 'SystemService',
function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, GroupService, Notifications, EndpointProvider, StateManager, LegacyExtensionManager, ModalService, MotdService, SystemService) {
.controller('HomeController', ['$q', '$scope', '$state', 'Authentication', 'EndpointService', 'EndpointHelper', 'GroupService', 'Notifications', 'EndpointProvider', 'StateManager', 'LegacyExtensionManager', 'ModalService', 'MotdService', 'SystemService',
function($q, $scope, $state, Authentication, EndpointService, EndpointHelper, GroupService, Notifications, EndpointProvider, StateManager, LegacyExtensionManager, ModalService, MotdService, SystemService) {
$scope.goToEdit = function(id) {
$state.go('portainer.endpoints.endpoint', { id: id });
};
$scope.goToDashboard = function (endpoint) {
$scope.goToDashboard = function(endpoint) {
if (endpoint.Type === 3) {
return switchToAzureEndpoint(endpoint);
}
@ -19,16 +19,16 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
});
};
$scope.dismissImportantInformation = function (hash) {
$scope.dismissImportantInformation = function(hash) {
StateManager.dismissImportantInformation(hash);
};
$scope.dismissInformationPanel = function (id) {
$scope.dismissInformationPanel = function(id) {
StateManager.dismissInformationPanel(id);
};
$scope.triggerSnapshot = function () {
ModalService.confirmEndpointSnapshot(function (result) {
$scope.triggerSnapshot = function() {
ModalService.confirmEndpointSnapshot(function(result) {
if (!result) {
return;
}
@ -45,7 +45,7 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
status = 1;
}).catch(function error() {
status = 2;
}).finally(function () {
}).finally(function() {
if (endpoint.Status === status) {
deferred.resolve(endpoint);
return deferred.promise;
@ -55,7 +55,7 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
.then(function sucess() {
deferred.resolve(endpoint);
}).catch(function error(err) {
deferred.reject({msg: 'Unable to update endpoint status', err: err});
deferred.reject({ msg: 'Unable to update endpoint status', err: err });
});
});
@ -66,7 +66,7 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
EndpointProvider.setEndpointID(endpoint.Id);
EndpointProvider.setEndpointPublicURL(endpoint.PublicURL);
EndpointProvider.setOfflineModeFromStatus(endpoint.Status);
StateManager.updateEndpointState(endpoint.Name, endpoint.Type, [])
StateManager.updateEndpointState(endpoint, [])
.then(function success() {
$state.go('azure.dashboard');
})
@ -136,4 +136,4 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
}
initView();
}]);
}]);