Implement upgrade request dialog

This is currently merely a placeholder for some real upgrade ui
This commit is contained in:
Johannes Zellner
2016-04-18 17:12:47 +02:00
parent 96383a1fae
commit c62ef9e156
6 changed files with 51 additions and 3 deletions

View File

@@ -104,11 +104,10 @@
<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>See available plans for upgrade at <a href="{{ config.webServerOrigin + '/pricing.html' }}" target="_blank">cloudron.io</a>.</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="">Upgrade Cloudron</button>
<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="appInstall.showForm()">Install</button>

View File

@@ -314,6 +314,11 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$('#appNotFoundModal').modal('show');
};
$scope.showRequestUpgrade = function () {
$('#appInstallModal').modal('hide');
$('#upgradeModal').modal('show');
};
$scope.gotoApp = function (app) {
$location.path('/appstore/' + app.manifest.id, false).search({ version : app.manifest.version });
};

View File

@@ -107,6 +107,10 @@
<td class="text-right" style="vertical-align: top; white-space: nowrap;">{{ config.version }}</td>
</tr>
</table>
<br/>
<br/>
<br/>
<button class="btn btn-primary pull-right" data-toggle="modal" data-target="#upgradeModal">Upgrade</button>
</div>
</div>
</div>