Handle dns overwrite in appstore view

This commit is contained in:
Johannes Zellner
2019-09-24 00:21:01 +02:00
parent 07f5bfe3dc
commit 70fae41042
3 changed files with 5 additions and 11 deletions
+2 -5
View File
@@ -43,7 +43,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
error: {},
app: {},
needsOverwrite: false,
overwriteDns: false,
location: '',
domain: null,
portBindings: {},
@@ -67,7 +66,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.appInstall.app = {};
$scope.appInstall.error = {};
$scope.appInstall.needsOverwrite = false;
$scope.appInstall.overwriteDns = false;
$scope.appInstall.location = '';
$scope.appInstall.domain = null;
$scope.appInstall.portBindings = {};
@@ -151,7 +149,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.appInstall.error.other = null;
$scope.appInstall.error.location = null;
$scope.appInstall.error.port = null;
$scope.appInstall.needsOverwrite = false;
// only use enabled ports from portBindings
var finalPortBindings = {};
@@ -169,7 +166,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
}
var data = {
overwriteDns: $scope.appInstall.overwriteDns,
overwriteDns: $scope.appInstall.needsOverwrite,
location: $scope.appInstall.location || '',
domain: $scope.appInstall.domain.domain,
portBindings: finalPortBindings,
@@ -185,7 +182,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
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';
$scope.appInstall.error.location = result.error ? result.error.message : 'DNS Record already exists outside of Cloudron. Resubmit to overwrite.';
$scope.appInstall.busy = false;
$scope.appInstallForm.location.$setPristine();
$('#appInstallLocationInput').focus();