From cedf4f4c47f8aa3f9526edbfb9061b78c5592491 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 31 Jul 2012 17:44:51 -0700 Subject: [PATCH] cloudstack 3.0 UI - autoscale - service offering, disk offering, security group can not be changed after autosccale is created. So, disable the 3 dropdowns in edit mode. --- ui/scripts/ui-custom/autoscaler.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ui/scripts/ui-custom/autoscaler.js b/ui/scripts/ui-custom/autoscaler.js index 4b045d22f4d..a897c0d0828 100644 --- a/ui/scripts/ui-custom/autoscaler.js +++ b/ui/scripts/ui-custom/autoscaler.js @@ -270,10 +270,21 @@ $loading.remove(); renderDialogContent(args); - if (args.data && args.data.isAdvanced) { - $autoscalerDialog.find('input[type=checkbox]').trigger('click'); - $autoscalerDialog.find('input[type=checkbox]').attr('checked', 'checked'); - } + if (args.data == null) { //from a new LB rule + $autoscalerDialog.find('select[name=serviceOfferingId]').removeAttr('disabled'); + $autoscalerDialog.find('select[name=securityGroups]').removeAttr('disabled'); + $autoscalerDialog.find('select[name=diskOfferingId]').removeAttr('disabled'); + } + else { //from an existing LB rule + $autoscalerDialog.find('select[name=serviceOfferingId]').attr('disabled', true); + $autoscalerDialog.find('select[name=securityGroups]').attr('disabled', true); + $autoscalerDialog.find('select[name=diskOfferingId]').attr('disabled', true); + + if(args.data.isAdvanced != null) { + $autoscalerDialog.find('input[type=checkbox]').trigger('click'); + $autoscalerDialog.find('input[type=checkbox]').attr('checked', 'checked'); + } + } } } });