From 2e56e7b02c6c1dd5104d4b736f4d354365fdfcea Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 22 Aug 2013 14:09:45 -0700 Subject: [PATCH] CLOUDSTACK-4102: UI > Instracture > SystemVM / VirtualRouter > detailView > change service offering action - display different description based on VM's state. --- ui/scripts/system.js | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 68c31e233ab..8ba1a53a2bc 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -6639,7 +6639,15 @@ label: 'label.change.service.offering', createForm: { title: 'label.change.service.offering', - desc: 'Please read the dynamic scaling section in the admin guide before scaling up.', + desc: function(args) { + var description = ''; + var vmObj = args.jsonObj; + //if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') { //needs to wait for API fix that will return hypervisor property + if (vmObj.state == 'Running') { + description = 'Please read the dynamic scaling section in the admin guide before scaling up.'; + } + return description; + }, fields: { serviceOfferingId: { label: 'label.compute.offering', @@ -7606,7 +7614,15 @@ label: 'label.change.service.offering', createForm: { title: 'label.change.service.offering', - desc: 'Please read the dynamic scaling section in the admin guide before scaling up.', + desc: function(args) { + var description = ''; + var vmObj = args.jsonObj; + //if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') { //needs to wait for API fix that will return hypervisor property + if (vmObj.state == 'Running') { + description = 'Please read the dynamic scaling section in the admin guide before scaling up.'; + } + return description; + }, fields: { serviceOfferingId: { label: 'label.compute.offering', @@ -8155,7 +8171,15 @@ label: 'label.change.service.offering', createForm: { title: 'label.change.service.offering', - desc: 'Please read the dynamic scaling section in the admin guide before scaling up.', + desc: function(args) { + var description = ''; + var vmObj = args.jsonObj; + //if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') { //needs to wait for API fix that will return hypervisor property + if (vmObj.state == 'Running') { + description = 'Please read the dynamic scaling section in the admin guide before scaling up.'; + } + return description; + }, fields: { serviceOfferingId: { label: 'label.compute.offering',