Provide appstore install overwrite checkbox
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
</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>
|
||||
|
||||
@@ -42,6 +42,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
subscriptionHelperPage: '',
|
||||
error: {},
|
||||
app: {},
|
||||
needsOverwrite: false,
|
||||
overwriteDns: false,
|
||||
location: '',
|
||||
domain: null,
|
||||
@@ -65,6 +66,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
reset: function () {
|
||||
$scope.appInstall.app = {};
|
||||
$scope.appInstall.error = {};
|
||||
$scope.appInstall.needsOverwrite = false;
|
||||
$scope.appInstall.overwriteDns = false;
|
||||
$scope.appInstall.location = '';
|
||||
$scope.appInstall.domain = null;
|
||||
@@ -114,7 +116,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
angular.copy(app, $scope.appInstall.app);
|
||||
|
||||
$scope.appInstall.mediaLinks = $scope.appInstall.app.manifest.mediaLinks || [];
|
||||
$scope.appInstall.overwriteDns = false;
|
||||
$scope.appInstall.domain = $scope.domains.find(function (d) { return $scope.config.adminDomain === d.domain; }); // pre-select the adminDomain
|
||||
$scope.appInstall.portBindingsInfo = angular.extend({}, $scope.appInstall.app.manifest.tcpPorts, $scope.appInstall.app.manifest.udpPorts); // Portbinding map only for information
|
||||
$scope.appInstall.portBindings = {}; // This is the actual model holding the env:port pair
|
||||
@@ -150,6 +151,7 @@ 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 = {};
|
||||
@@ -182,6 +184,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.busy = false;
|
||||
$scope.appInstallForm.location.$setPristine();
|
||||
|
||||
Reference in New Issue
Block a user