feat(UX): automatically change the state to dashboard when switching endpoint (#602)

pull/560/merge
Anthony Lapenna 8 years ago committed by GitHub
parent 73082f1674
commit 52ab0bd50d

@ -9,10 +9,11 @@ function ($scope, $state, Settings, Config, EndpointService, StateManager, Messa
$scope.uiVersion = Settings.uiVersion; $scope.uiVersion = Settings.uiVersion;
$scope.switchEndpoint = function(endpoint) { $scope.switchEndpoint = function(endpoint) {
EndpointService.setActive(endpoint.Id).then(function success(data) { EndpointService.setActive(endpoint.Id)
.then(function success(data) {
StateManager.updateEndpointState(true) StateManager.updateEndpointState(true)
.then(function success() { .then(function success() {
$state.reload(); $state.go('dashboard');
}, function error(err) { }, function error(err) {
Messages.error("Failure", err, "Unable to connect to the Docker endpoint"); Messages.error("Failure", err, "Unable to connect to the Docker endpoint");
}); });

Loading…
Cancel
Save