From 005d8739fb45031656872e49f14fc0d875947963 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Thu, 28 Jan 2021 18:49:18 +0100 Subject: [PATCH] B #5231: Fix scale action in cloud view (#703) --- .../app/tabs/provision-tab/flows/list.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/sunstone/public/app/tabs/provision-tab/flows/list.js b/src/sunstone/public/app/tabs/provision-tab/flows/list.js index 440fe4b2ca5..6a408719b3f 100644 --- a/src/sunstone/public/app/tabs/provision-tab/flows/list.js +++ b/src/sunstone/public/app/tabs/provision-tab/flows/list.js @@ -433,9 +433,11 @@ define(function(require) { context.on("click", ".provision_role_cardinality_button", function(){ var role = $(this).closest(".provision_role_ul").data("role"); + var role_name = role.name var min_vms = (role.min_vms||1); var max_vms = (role.max_vms||100); + $(".provision_confirm_action:first", context).html( "
"+ "
"+ @@ -445,7 +447,9 @@ define(function(require) { "
"+ "
"+ "
"+ - ""+ + ""+ "
"+ ""+Locale.tr("The cardinality for this role cannot be changed")+""+ "
"+ @@ -462,7 +466,7 @@ define(function(require) { min: min_vms, max: max_vms, initial: role.cardinality, - label: Locale.tr("Number of VMs for Role")+" "+role.name + label: Locale.tr("Number of VMs for Role")+" "+role_name })); $( ".cardinality_slider_div", context).show(); @@ -477,15 +481,17 @@ define(function(require) { return false; }); - context.on("click", ".provision_change_cardinality_button", function(){ + context.on("click", ".provision_change_cardinality_button", function() { var flow_id = $(".provision_info_flow", context).attr("flow_id"); - var cardinality = $(".uinput-slider-val", context).val(); + var role_name = $(this).attr("role_id") - OpenNebula.Role.update({ + OpenNebula.Role.scale({ data : { - id: flow_id + "/role/" + $(this).attr("role_id"), + id: flow_id, extra_param: { - cardinality: cardinality + force: false, + cardinality: $(".visor", ".cardinality_slider_div", context).val(), + role_name: role_name, } }, success: function(request, response){