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
+1 -5
View File
@@ -35,10 +35,6 @@
</div>
</div>
<div ng-show="appInstall.needsOverwrite">
</div>
<p class="text-center" ng-show="appInstall.location && appInstall.domain.provider === 'manual'">
<b>Add an A record manually for {{ appInstall.location }} to this Cloudron's public IP</b>
<br>
@@ -159,7 +155,7 @@
<button type="button" class="btn btn-default"data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" ng-show="user.admin && appInstall.state === 'resourceConstraint'" ng-click="appInstall.showForm(true)">Install anyway</button>
<button type="button" class="btn btn-success" ng-show="appInstall.state === 'appInfo'" ng-click="appInstall.showForm()">Install</button>
<button type="button" class="btn btn-success" ng-show="appInstall.state === 'installForm'" ng-click="appInstall.submit()" ng-disabled="appInstallForm.$invalid || appInstall.busy"><i class="fa fa-circle-notch fa-spin" ng-show="appInstall.busy"></i> Install</button>
<button type="button" class="btn btn-success" ng-show="appInstall.state === 'installForm'" ng-click="appInstall.submit()" ng-disabled="appInstallForm.$invalid || appInstall.busy"><i class="fa fa-circle-notch fa-spin" ng-show="appInstall.busy"></i> Install {{ appInstall.needsOverwrite ? 'and overwrite DNS' : '' }}</button>
</div>
</div>
</div>
+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();