Rename func and put error below the control label
This commit is contained in:
@@ -240,7 +240,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
asyncForEach(domains, function (domain, callback) {
|
||||
if (overwriteDns) return callback();
|
||||
|
||||
Client.getDNSRecords(domain.domain, domain.subdomain, function (error, result) {
|
||||
Client.checkDNSRecords(domain.domain, domain.subdomain, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
if (result.error) {
|
||||
if (data.domain === domain.domain && data.location === domain.subdomain) {
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
<form role="form" name="appInstallForm" ng-submit="appInstall.submit()" autocomplete="off">
|
||||
<div class="has-error text-center" ng-show="appInstall.error.other" ng-bind-html="appInstall.error.other"></div>
|
||||
<div class="form-group" ng-class="{ 'has-error': (appInstallForm.location.$dirty && appInstallForm.location.$invalid) || (!appInstallForm.location.$dirty && appInstall.error.location) }">
|
||||
<label class="control-label" for="appInstallLocationInput">Location {{ appInstall.error.location }} </label>
|
||||
<label class="control-label" for="appInstallLocationInput">Location</label>
|
||||
<div ng-show="appInstall.error.location"><small>{{ appInstall.error.location }}</small></div>
|
||||
<div class="input-group form-inline">
|
||||
<input type="text" class="form-control" ng-model="appInstall.location" id="appInstallLocationInput" name="location" placeholder="Leave empty to use bare domain" autofocus>
|
||||
<div class="input-group-btn">
|
||||
|
||||
@@ -176,13 +176,13 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
sso: !$scope.appInstall.optionalSso ? undefined : ($scope.appInstall.accessRestrictionOption !== 'nosso')
|
||||
};
|
||||
|
||||
Client.getDNSRecords(data.domain, data.location, function (error, result) {
|
||||
Client.checkDNSRecords(data.domain, data.location, function (error, result) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
if (!data.overwriteDns) {
|
||||
if (result.error || result.needsOverwrite) {
|
||||
$scope.appInstall.needsOverwrite = true;
|
||||
$scope.appInstall.error.location = result.error ? result.error.message : 'DNS Record already exists outside of Cloudron. Resubmit to overwrite.';
|
||||
$scope.appInstall.error.location = result.error ? result.error.message : 'DNS Record already exists. Confirm that the domain is not in use for services external to Cloudron';
|
||||
$scope.appInstall.busy = false;
|
||||
$scope.appInstallForm.location.$setPristine();
|
||||
$('#appInstallLocationInput').focus();
|
||||
|
||||
Reference in New Issue
Block a user