Send config state as part of the status

This commit is contained in:
Girish Ramakrishnan
2017-01-05 20:47:47 -08:00
committed by Johannes Zellner
parent 8a0fe413ba
commit 64c888fbdb
3 changed files with 15 additions and 7 deletions

View File

@@ -140,7 +140,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
if (error) return $scope.error(error);
if (!status.activated) {
window.location.href = status.provider === 'caas' ? '/setup.html' : '/setupdns.html';
window.location.href = status.configState.configured ? '/setup.html' : '/setupdns.html';
return;
}

View File

@@ -52,13 +52,20 @@ app.controller('SetupDNSController', ['$scope', '$http', 'Client', function ($sc
$scope.busy = true;
setTimeout(function () {
// TODO wait until domain is propagated and cert got acquired
window.location.href = 'https://my.' + $scope.dnsCredentials.domain + '/setup.html';
}, 10000);
});
waitForDnsSetup();
});
};
function waitForDnsSetup() {
Client.getStatus(function (error, status) {
if (!error && status.configState.dns && status.configState.tls) {
window.location.href = 'https://my.' + $scope.dnsCredentials.domain + '/setup.html';
}
setTimeout(waitForDnsSetup, 5000);
});
}
Client.getStatus(function (error, status) {
if (error) {
window.location.href = '/error.html';