diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index 0a9762883..13093e011 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -5,6 +5,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route', $scope.user = Client.getUserInfo(); $scope.installedApps = Client.getInstalledApps(); $scope.config = {}; + $scope.status = {}; $scope.client = Client; $scope.update = { @@ -73,15 +74,24 @@ angular.module('Application').controller('MainController', ['$scope', '$route', Client.getDnsConfig(function (error, result) { if (error) return console.error(error); + var actionScope; + // check if we have aws credentials if selfhosting if ($scope.config.isCustomDomain) { if (result.provider === 'route53' && (!result.accessKeyId || !result.secretAccessKey)) { - var actionScope = $scope.$new(true); + actionScope = $scope.$new(true); actionScope.action = '/#/certs'; Client.notify('Missing AWS credentials', 'Please provide AWS credentials, click here to add them.', true, 'error', actionScope); } } + // warn user if dns config is not working + if (!$scope.status.webadminStatus.dns) { + actionScope = $scope.$new(true); + actionScope.action = '/#/certs'; + Client.notify('Invalid Domain Config', 'Unable to update DNS. Click here to update it.', true, 'error', actionScope); + } + if (result.provider === 'caas') return; // Check if all email DNS records are set up properly only for non external DNS API @@ -120,6 +130,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route', return; } + $scope.status = status; + Client.refreshConfig(function (error) { if (error) return $scope.error(error);