You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2012/11/16 11:00:32 UTC

[50/50] git commit: cloudstack 3.0 UI - autoscale -fix a bug that action bar was not refreshed after action was complete.

cloudstack 3.0 UI - autoscale -fix a bug that action bar was not refreshed after action was complete.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/08a73d11
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/08a73d11
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/08a73d11

Branch: refs/heads/master
Commit: 08a73d11340b0fabd82615353414e11735d16afe
Parents: f348fcf
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Aug 8 13:56:13 2012 -0700
Committer: Vijay Venkatachalam <vi...@citrix.com>
Committed: Fri Nov 16 10:56:48 2012 +0530

----------------------------------------------------------------------
 ui/scripts/autoscaler.js           |   18 +++++++++++++-----
 ui/scripts/ui-custom/autoscaler.js |    7 ++++++-
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/08a73d11/ui/scripts/autoscaler.js
----------------------------------------------------------------------
diff --git a/ui/scripts/autoscaler.js b/ui/scripts/autoscaler.js
index 1dc90b9..4d06813 100644
--- a/ui/scripts/autoscaler.js
+++ b/ui/scripts/autoscaler.js
@@ -86,11 +86,19 @@
 			if(args.context.originalAutoscaleData == null) { //new LB rule
 			  //no actions  for new LB rule
 			}
-			else { //existing LB rule			 
-				if(args.context.originalAutoscaleData[0].context.autoscaleVmGroup.state == 'disabled')
-				  allowedActions.push('enable');
-				else if(args.context.originalAutoscaleData[0].context.autoscaleVmGroup.state == 'enabled')
-				  allowedActions.push('disable');				
+			else { //existing LB rule			  
+        if(args.context.originalAutoscaleData[0].afterActionIsComplete	== null) {	
+					if(args.context.originalAutoscaleData[0].context.autoscaleVmGroup.state == 'disabled')
+						allowedActions.push('enable');
+					else if(args.context.originalAutoscaleData[0].context.autoscaleVmGroup.state == 'enabled')
+						allowedActions.push('disable');		
+        }			
+        else {
+          if(args.context.originalAutoscaleData[0].afterActionIsComplete.state == 'disabled')
+						allowedActions.push('enable');
+					else if(args.context.originalAutoscaleData[0].afterActionIsComplete.state == 'enabled')
+						allowedActions.push('disable');		
+        }				
 			}	
 			return allowedActions;      
     },

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/08a73d11/ui/scripts/ui-custom/autoscaler.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/autoscaler.js b/ui/scripts/ui-custom/autoscaler.js
index 8e9c5c2..df7d56e 100644
--- a/ui/scripts/ui-custom/autoscaler.js
+++ b/ui/scripts/ui-custom/autoscaler.js
@@ -101,8 +101,13 @@
               });
 
               // Reload actions
+							if(data != null) { //data is originalAutoscaleData in \ui\scripts\autoscaler.js
+							  data['afterActionIsComplete'] = args.data;
+							}
+							
               var $newActions = renderActions({
-                data: data ? $.extend(data, args.data) : args.data,
+                data: data ? data: args.data,
+                actionFilter: args.actionFilter,
                 context: context
               });