Do not offer 'install anyway'

This commit is contained in:
Johannes Zellner
2016-08-30 11:33:32 +02:00
parent 8312cbe792
commit 1f1e299939
2 changed files with 11 additions and 4 deletions

View File

@@ -103,13 +103,12 @@
</div>
<div class="collapse" id="collapseResourceConstraint" data-toggle="false">
<h4 class="text-danger">This Cloudron is running low on resources.</h4>
<p>Installing this app might decrease the performance of other apps. The Cloudron's resources can be extended with a plan upgrade or available resources may be freed up by uninstalling unused applications.</p>
<p>The Cloudron's resources can be extended with a plan upgrade or available resources may be freed up by uninstalling unused applications.</p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success pull-left" ng-show="!appInstall.installFormVisible && user.admin && appInstall.resourceConstraintVisible" ng-click="showRequestUpgrade()">Upgrade Cloudron</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" ng-show="!appInstall.installFormVisible && user.admin && appInstall.resourceConstraintVisible" ng-click="appInstall.showForm(true)">Install anyway</button>
<button type="button" class="btn btn-success" ng-show="!appInstall.installFormVisible && user.admin && appInstall.resourceConstraintVisible" ng-click="showRequestUpgrade()">Upgrade Cloudron</button>
<button type="button" class="btn btn-success" ng-show="!appInstall.installFormVisible && user.admin && !appInstall.resourceConstraintVisible" ng-click="appInstall.showForm()">Install</button>
<button type="button" class="btn btn-success" ng-show="appInstall.installFormVisible && user.admin && !appInstall.resourceConstraintVisible" ng-click="appInstall.submit()" ng-disabled="appInstallForm.$invalid || appInstall.busy"><i class="fa fa-spinner fa-pulse" ng-show="appInstall.busy"></i> Install</button>
</div>

View File

@@ -12,7 +12,14 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.searchString = '';
$scope.showRequestUpgrade = function () {
$location.path('/settings');
// wait for dialog to be fully closed to avoid modal behavior breakage when moving to a different view already
$('#appInstallModal').on('hidden.bs.modal', function () {
$scope.appInstall.reset();
$('#appInstallModal').off('hidden.bs.modal');
$location.path('/settings');
});
$('#appInstallModal').modal('hide');
};
$scope.appInstall = {
@@ -166,6 +173,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
// wait for dialog to be fully closed to avoid modal behavior breakage when moving to a different view already
$('#appInstallModal').on('hidden.bs.modal', function () {
$scope.appInstall.reset();
$('#appInstallModal').off('hidden.bs.modal');
$location.path('/apps');
});