Add app install dns preflight check

This commit is contained in:
Johannes Zellner
2019-09-23 23:47:33 +02:00
parent 9555f3c853
commit 66900d594f
3 changed files with 76 additions and 58 deletions
+5 -5
View File
@@ -241,18 +241,18 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
if (overwriteDns) return callback();
Client.getDNSRecords(domain.domain, domain.subdomain, 'A', function (error, result) {
if (error && (error.statusCode === 424 || error.statusCode === 200)) {
if (error) return callback(error);
if (result.error) {
if (data.domain === domain.domain && data.location === domain.subdomain) {
$scope.location.error.location = domain.domain + ' ' + error.message;
$scope.location.error.location = domain.domain + ' ' + result.error.message;
} else {
$scope.location.error.alternateDomains = domain.domain + ' ' + error.message;
$scope.location.error.alternateDomains = domain.domain + ' ' + result.error.message;
}
$scope.location.busy = false;
return;
}
if (error) return callback(error);
if (result.length) $scope.location.domainCollisions.push(domain);
if (result.needsOverwrite) $scope.location.domainCollisions.push(domain);
callback();
});