From 720ded5717820dd95d15c1bf129667adbf60cb11 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Thu, 3 Mar 2022 10:50:25 +0100 Subject: [PATCH] F #5757: Improve capacity range on VM instantiation (#1824) (cherry picked from commit 5b988776484b03e8f7c470a91e20b8bc903a3eb7) --- .../wizard-tabs/general/capacity-inputs.js | 16 ++++++++++++++++ .../public/app/utils/range-slider/html.hbs | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-inputs.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-inputs.js index 5aa136bb17..958e8b45f9 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-inputs.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-inputs.js @@ -110,6 +110,10 @@ define(function(require) { attr.min = 0.01; } + if (['range', 'range-float'].includes(attr.type)) { + attr.readonly = true + } + input = UserInputs.attributeInput(attr); if (attr.type != "range-float"){ @@ -132,6 +136,10 @@ define(function(require) { attr.min = 1; } + if (['range', 'range-float'].includes(attr.type)) { + attr.readonly = true + } + input = UserInputs.attributeInput(attr); if (attr.type != "range"){ @@ -238,6 +246,14 @@ define(function(require) { attr.mandatory = true; } + if (String(element.TEMPLATE.HYPERVISOR).toLowerCase() === "vcenter") { + attr.step = 4; + } + + if (['range', 'range-float'].includes(attr.type)) { + attr.readonly = true + } + if(attr.min == undefined){ attr.min = 1; } diff --git a/src/sunstone/public/app/utils/range-slider/html.hbs b/src/sunstone/public/app/utils/range-slider/html.hbs index 450ed6225e..261af045d3 100644 --- a/src/sunstone/public/app/utils/range-slider/html.hbs +++ b/src/sunstone/public/app/utils/range-slider/html.hbs @@ -41,6 +41,7 @@ {{#if disabled}}disabled="true"{{/if}}/> + value="{{initial}}" required + {{#if readonly}} readonly {{/if}} />