Fix usage of webadminStatus

This commit is contained in:
Girish Ramakrishnan
2018-12-14 15:24:00 -08:00
parent 54b9154457
commit a485df2f79
3 changed files with 14 additions and 11 deletions

View File

@@ -192,10 +192,14 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
$scope.state = 'waitingForDnsSetup';
Client.getStatus(function (error, status) {
// webadminStatus.dns is intentionally not tested. it can be false if dns creds are invalid
// runConfigurationChecks() in main.js will pick the .dns and show a notification
if (!error && status.adminFqdn && status.webadminStatus.tls) {
window.location.href = 'https://' + status.adminFqdn + '/setup.html';
if (!error && !status.setup.active) {
if (!status.adminFqdn || status.setup.errorMessage) { // setup reset or errored. start over
$scope.error = status.setup.errorMessage;
$scope.status = 'initialized';
} else { // proceed to activation
window.location.href = 'https://' + status.adminFqdn + '/setup.html';
}
return;
}
setTimeout(waitForDnsSetup, 5000);