Some small fixes and start on handling SSL better

This commit is contained in:
Joseph Schorr 2015-02-04 11:48:25 -05:00
parent 30209e2bda
commit 98d63e00ee
5 changed files with 23 additions and 8 deletions

View file

@ -68,6 +68,8 @@ function SetupCtrl($scope, $timeout, ApiService, Features, UserService, Containe
$scope.currentStep = $scope.States.LOADING;
$scope.errors = {};
$scope.stepProgress = [];
$scope.hasSSL = false;
$scope.hostname = null;
$scope.$watch('currentStep', function(currentStep) {
$scope.stepProgress = $scope.getProgress(currentStep);
@ -111,10 +113,14 @@ function SetupCtrl($scope, $timeout, ApiService, Features, UserService, Containe
$scope.showSuperuserPanel = function() {
$('#setupModal').modal('hide');
window.location = '/superuser';
var prefix = scope.hasSSL ? 'https' : 'http';
var hostname = $scope.hostname;
window.location = prefix + '://' + hostname + '/superuser';
};
$scope.configurationSaved = function() {
$scope.configurationSaved = function(config) {
$scope.hasSSL = config['PREFERRED_URL_SCHEME'] == 'https';
$scope.hostname = config['SERVER_HOSTNAME'];
$scope.currentStep = $scope.States.VALID_CONFIG;
};
@ -255,7 +261,7 @@ function SetupCtrl($scope, $timeout, ApiService, Features, UserService, Containe
$scope.checkStatus = function() {
ContainerService.checkStatus(function(resp) {
$scope.currentStep = resp['status'];
});
}, $scope.hasSSL);
};
// Load the initial status.