diff --git a/webadmin/src/views/settings.html b/webadmin/src/views/settings.html
index 6cff98798..20e486bcf 100644
--- a/webadmin/src/views/settings.html
+++ b/webadmin/src/views/settings.html
@@ -85,7 +85,7 @@
- This will change your plan from
{{ currentPlan.name }} to
{{ requestedPlan.name }}.
+ This will change your plan from
{{ currentPlan.name }} to
{{ planChange.requestedPlan.name }}.
Your apps and data will be migrated to the new Cloudron and will take around 15 minutes.
@@ -162,9 +162,9 @@
diff --git a/webadmin/src/views/settings.js b/webadmin/src/views/settings.js
index b4df4af81..b139956ea 100644
--- a/webadmin/src/views/settings.js
+++ b/webadmin/src/views/settings.js
@@ -17,13 +17,13 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.currentRegionSlug = null;
$scope.availablePlans = [];
- $scope.requestedPlan = null;
$scope.currentPlan = null;
$scope.planChange = {
busy: false,
error: {},
- password: ''
+ password: '',
+ requestedPlan: null
};
$scope.developerModeChange = {
@@ -128,11 +128,10 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
AppStore.getSizes(function (error, result) {
if (error) return console.error(error);
- // result array is ordered by size. only select higher sizes
+ // result array is ordered by size. only select higher plans
var found = false;
result = result.filter(function (size) {
- if (size.slug === $scope.config.size) {
- $scope.currentPlan = $scope.requestedPlan = size;
+ if (size.name === $scope.config.plan.name) {
found = true;
return true;
} else {
@@ -140,6 +139,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
}
});
angular.copy(result, $scope.availablePlans);
+ $scope.planChange.requestedPlan = $scope.availablePlans[0]; // need the reference
AppStore.getRegions(function (error, result) {
if (error) return console.error(error);
@@ -151,10 +151,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
});
}
- $scope.setRequestedPlan = function (plan) {
- $scope.requestedPlan = plan;
- };
-
$scope.showChangePlan = function () {
$('#planChangeModal').modal('show');
};
@@ -346,6 +342,8 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
Client.onReady(function () {
fetchBackups();
getPlans();
+
+ $scope.currentPlan = $scope.config.plan;
});
// setup all the dialog focus handling