diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index cd1a7fe15..8ba4192fb 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -638,6 +638,10 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', }).error(defaultErrorHandler(callback)); }; + Client.prototype.enoughResourcesAvailable = function (app) { + return true; + }; + client = new Client(); return client; }]); diff --git a/webadmin/src/views/appstore.html b/webadmin/src/views/appstore.html index 3c286da5d..086525aea 100644 --- a/webadmin/src/views/appstore.html +++ b/webadmin/src/views/appstore.html @@ -52,11 +52,15 @@
+
+

Not enough resources left to install this application.

+

The Cloudron's resources can be extended with a model upgrade or available resources may be freed up by uninstalling unused applications.

+
diff --git a/webadmin/src/views/appstore.js b/webadmin/src/views/appstore.js index 8191610dd..8b2c81811 100644 --- a/webadmin/src/views/appstore.js +++ b/webadmin/src/views/appstore.js @@ -140,8 +140,10 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca $scope.appInstall.accessRestriction = null; $scope.appInstall.oauthProxy = false; $scope.appInstall.installFormVisible = false; + $scope.appInstall.resourceConstraintVisible = false; $scope.appInstall.mediaLinks = []; $('#collapseInstallForm').collapse('hide'); + $('#collapseResourceConstraint').collapse('hide'); $('#collapseMediaLinksCarousel').collapse('show'); $scope.appInstallForm.$setPristine(); @@ -149,10 +151,16 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca }; $scope.showInstallForm = function () { - $scope.appInstall.installFormVisible = true; - $('#collapseMediaLinksCarousel').collapse('hide'); - $('#collapseInstallForm').collapse('show'); - $('#appInstallLocationInput').focus(); + if (Client.enoughResourcesAvailable($scope.appInstall.app)) { + $scope.appInstall.installFormVisible = true; + $('#collapseMediaLinksCarousel').collapse('hide'); + $('#collapseInstallForm').collapse('show'); + $('#appInstallLocationInput').focus(); + } else { + $scope.appInstall.resourceConstraintVisible = true; + $('#collapseMediaLinksCarousel').collapse('hide'); + $('#collapseResourceConstraint').collapse('show'); + } }; $scope.showInstall = function (app) {