diff --git a/app/scripts/directives/editRequestLimit.js b/app/scripts/directives/editRequestLimit.js
index 7490bb5b67..6f95ead7ff 100644
--- a/app/scripts/directives/editRequestLimit.js
+++ b/app/scripts/directives/editRequestLimit.js
@@ -68,21 +68,34 @@ angular.module('openshiftConsole')
case 'memory':
scope.input.unit = 'Mi';
scope.units = [{
- value: "M",
- label: "MB"
- }, {
- value: "G",
- label: "GB"
- }, {
value: "Mi",
label: "MiB"
}, {
value: "Gi",
label: "GiB"
+ }, {
+ value: "M",
+ label: "MB"
+ }, {
+ value: "G",
+ label: "GB"
}];
break;
}
+ scope.groupUnits = function(unit) {
+ switch (unit.value) {
+ case 'Mi':
+ case 'Gi':
+ return 'Binary Units';
+ case 'M':
+ case 'G':
+ return 'Decimal Units';
+ }
+
+ return '';
+ };
+
var validateLimitRange = function() {
// Use usageValue filter to normalize units for comparison.
var value = scope.input.amount && usageValue(scope.input.amount + scope.input.unit),
diff --git a/app/scripts/directives/oscPersistentVolumeClaim.js b/app/scripts/directives/oscPersistentVolumeClaim.js
index d433b4066f..3e3fd01b79 100644
--- a/app/scripts/directives/oscPersistentVolumeClaim.js
+++ b/app/scripts/directives/oscPersistentVolumeClaim.js
@@ -1,7 +1,9 @@
"use strict";
angular.module("openshiftConsole")
- .directive("oscPersistentVolumeClaim", function(DataService){
+ .directive("oscPersistentVolumeClaim",
+ function(DataService,
+ ModalsService) {
return {
restrict: 'E',
scope: {
@@ -10,7 +12,7 @@ angular.module("openshiftConsole")
templateUrl: 'views/directives/osc-persistent-volume-claim.html',
link: function(scope) {
scope.storageClasses = [];
- scope.claim.unit = 'Mi';
+ scope.claim.unit = 'Gi';
scope.units = [{
value: "Mi",
label: "MiB"
@@ -21,10 +23,36 @@ angular.module("openshiftConsole")
value: "Ti",
label: "TiB"
}, {
- value: "Pi",
- label: "PiB"
+ value: "M",
+ label: "MB"
+ }, {
+ value: "G",
+ label: "GB"
+ }, {
+ value: "T",
+ label: "TB"
}];
scope.claim.selectedLabels = [];
+
+ scope.groupUnits = function(unit) {
+ switch (unit.value) {
+ case 'Mi':
+ case 'Gi':
+ case 'Ti':
+ return 'Binary Units';
+ case 'M':
+ case 'G':
+ case 'T':
+ return 'Decimal Units';
+ }
+
+ return '';
+ };
+
+ scope.showComputeUnitsHelp = function() {
+ ModalsService.showComputeUnitsHelp();
+ };
+
DataService.list({group: 'storage.k8s.io', resource: 'storageclasses'}, {}, function(storageClasses) {
scope.storageClasses = storageClasses.by('metadata.name');
}, {errorNotification: false});
diff --git a/app/styles/_select.less b/app/styles/_select.less
index 7326facce3..9e5b37238a 100644
--- a/app/styles/_select.less
+++ b/app/styles/_select.less
@@ -35,6 +35,10 @@
min-height: 24px;
cursor: pointer;
}
+ .ui-select-choices-group-label:empty {
+ // Prevent extra space above the first choice when the group label is empty.
+ padding: 0;
+ }
.ui-select-match-text, .ui-select-placeholder {
font-weight: normal;
}
diff --git a/app/views/_compute-resource.html b/app/views/_compute-resource.html
index 80c1616680..70d481428b 100644
--- a/app/views/_compute-resource.html
+++ b/app/views/_compute-resource.html
@@ -17,7 +17,7 @@