diff --git a/src/js/setupdns.js b/src/js/setupdns.js index bf7b4cc91..10abb6246 100644 --- a/src/js/setupdns.js +++ b/src/js/setupdns.js @@ -16,7 +16,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f var search = decodeURIComponent(window.location.search).slice(1).split('&').map(function (item) { return item.split('='); }).reduce(function (o, k) { o[k[0]] = k[1]; return o; }, {}); $scope.state = null; // 'initialized', 'waitingForDnsSetup', 'waitingForBox' - $scope.error = null; + $scope.error = {}; $scope.provider = ''; $scope.showDNSSetup = false; $scope.instanceId = ''; @@ -67,7 +67,6 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f { name: 'No-op (only for development)', value: 'noop' } ]; $scope.dnsCredentials = { - error: null, busy: false, advancedVisible: false, domain: '', @@ -123,8 +122,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f $scope.setDnsCredentials = function () { $scope.dnsCredentials.busy = true; - $scope.dnsCredentials.error = null; - $scope.error = null; + $scope.error = {}; var provider = $scope.dnsCredentials.provider; @@ -149,7 +147,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f throw 'fields_missing'; } } catch(e) { - $scope.dnsCredentials.error = 'Cannot parse Google Service Account Key'; + $scope.error.dnsCredentials = 'Cannot parse Google Service Account Key'; $scope.dnsCredentials.busy = false; return; } @@ -183,11 +181,11 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f Client.setup($scope.dnsCredentials.domain, $scope.dnsCredentials.zoneName, provider, data, tlsConfig, function (error) { if (error && error.statusCode === 401) { $scope.dnsCredentials.busy = false; - $scope.error = 'Wrong instance id provided.'; + $scope.error.ami = 'Wrong instance id provided.'; return; } else if (error) { $scope.dnsCredentials.busy = false; - $scope.dnsCredentials.error = error.message; + $scope.error.dnsCredentials = error.message; return; } @@ -201,8 +199,9 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f Client.getStatus(function (error, status) { if (!error && !status.setup.active) { if (!status.adminFqdn || status.setup.errorMessage) { // setup reset or errored. start over - $scope.error = status.setup.errorMessage; + $scope.error.setup = status.setup.errorMessage; $scope.state = 'initialized'; + $scope.dnsCredentials.busy = false; } else { // proceed to activation window.location.href = 'https://' + status.adminFqdn + '/setup.html'; } diff --git a/src/setupdns.html b/src/setupdns.html index 01cf2875c..608271613 100644 --- a/src/setupdns.html +++ b/src/setupdns.html @@ -57,6 +57,7 @@

Cloudron Setup

+

{{ error.setup }}

Provide a domain for your Cloudron

Apps will be installed on subdomains of this domain

@@ -75,7 +76,7 @@

Domain Configuration

-

{{ dnsCredentials.error }}

+

{{ error.dnsCredentials }}


@@ -172,10 +173,10 @@

Owner verification

Provide the EC2 instance id to verify you have access to this server.

-
+
-

 {{ error }}

+

 {{ error.ami }}

Let's Encrypt requires your server to be reachable on port 80