Send config state as part of the status
This commit is contained in:
committed by
Johannes Zellner
parent
8a0fe413ba
commit
64c888fbdb
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user