Some small fixes and start on handling SSL better
This commit is contained in:
parent
30209e2bda
commit
98d63e00ee
5 changed files with 23 additions and 8 deletions
|
@ -1290,7 +1290,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
}, 2000);
|
||||
};
|
||||
|
||||
containerService.checkStatus = function(callback) {
|
||||
containerService.checkStatus = function(callback, force_ssl) {
|
||||
var errorHandler = function(resp) {
|
||||
if (resp.status == 404 || resp.status == 502) {
|
||||
// Container has not yet come back up, so we schedule another check.
|
||||
|
@ -1301,7 +1301,8 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
return ApiService.errorDisplay('Cannot load status. Please report this to support')(resp);
|
||||
};
|
||||
|
||||
ApiService.scRegistryStatus(null, null).then(callback, errorHandler, /* background */true);
|
||||
ApiService.scRegistryStatus(null, null)
|
||||
.then(callback, errorHandler, /* background */true, /* force ssl*/force_ssl);
|
||||
};
|
||||
|
||||
return containerService;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -180,7 +180,7 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
$scope.savingConfiguration = false;
|
||||
$scope.mapped.$hasChanges = false;
|
||||
$('#validateAndSaveModal').modal('hide');
|
||||
$scope.configurationSaved({});
|
||||
$scope.configurationSaved({'config': $scope.config});
|
||||
}, ApiService.errorDisplay('Could not save configuration. Please report this error.'));
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue