diff --git a/CHANGES b/CHANGES index 34d470492..cb48054a5 100644 --- a/CHANGES +++ b/CHANGES @@ -2834,4 +2834,5 @@ * cpu quota: fix rounding error * frontend: fix translation resolver to actually fallback to english * i18n: fix crash if language file is missing +* memory: fix slider UI where max was incorrectly set diff --git a/dashboard/src/views/app.js b/dashboard/src/views/app.js index 9cf0d3bbd..142c1d3a9 100644 --- a/dashboard/src/views/app.js +++ b/dashboard/src/views/app.js @@ -629,9 +629,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location' var nearest256m = Math.ceil(Math.max(result.memory, $scope.resources.currentMemoryLimit) / (256*1024*1024)) * 256 * 1024 * 1024; var startTick = app.manifest.memoryLimit || (256 * 1024 * 1024); - for (var i = startTick; i <= nearest256m; i *= 2) { + // code below ensure we atleast have 2 ticks to keep the slider usable + $scope.resources.memoryTicks.push(startTick); // start tick + for (var i = startTick * 2; i < nearest256m; i *= 2) { $scope.resources.memoryTicks.push(i); } + $scope.resources.memoryTicks.push(nearest256m); // end tick }); // for firefox widget update