cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to 386ee6b
Date Fri, 22 Nov 2013 00:49:57 GMT
Updated Branches:
  refs/heads/master 7b0cae602 -> 386ee6bf3


CLOUDSTACK-4793: UI > Virtual Routers > Select View > group by zone > listView
of Zone, Total of Virtual Routers, Virtual Routers require upgrade.


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

Branch: refs/heads/master
Commit: 386ee6bf344f1cd82260b7319685991c06913ab5
Parents: 7b0cae6
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Nov 21 16:48:47 2013 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Nov 21 16:49:48 2013 -0800

----------------------------------------------------------------------
 ui/scripts/system.js | 45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/386ee6bf/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 91674eb..d6ced5b 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -387,7 +387,7 @@
                             async: false,
                             success: function(json) {
                                 args.response.success({
-                                    data: $(json.listhypervisorsresponse.hypervisor).map(function(index,
hypervisor) {                                                	
+                                    data: $(json.listhypervisorsresponse.hypervisor).map(function(index,
hypervisor) {                                              	
                                     	var totalHostCount = 0;                            
                   	
                                     	var currentPage = 1;
                                     	var returnedHostCount = 0;
@@ -8648,6 +8648,16 @@
                                 },
                                 routerCount: {
                                 	label: 'Total of Virtual Routers'
+                                },
+                                routerRequiresUpgrade: {
+                                	label: 'Virtual Routers require upgrade',
+                                	converter: function(args) {                            
   		
+                                		if (args > 0) {
+                                			return 'Yes';
+                                		} else {
+                                			return 'No';
+                                		}
+                                	}
                                 }
                             },
 
@@ -8680,8 +8690,41 @@
     	                                            success: function(json) {
     	                                            	if (json.listroutersresponse.count != undefined)
{
     	                                            		zoneObjs[i].routerCount = json.listroutersresponse.count;
   
+    	                                            		    	                                
           		
+    	                                            		var routerCountFromAllPages = zoneObjs[i].routerCount;
                                               	
+    	                                                	var currentPage = 1;
+    	                                                	var routerCountFromFirstPageToCurrentPage
= 0;  
+    	                                                	var routerRequiresUpgrade = 0;    
                                                	                                        
       	
+    	                                                	var callListApiWithPage = function()
{                                                		
+    	                                                		$.ajax({
+    	                                        					url: createURL('listRouters'),
+    	                                                    		async: false,
+    	                                                    		data: {    	                 
                                  			
+    	                                                    			zoneid: zoneObjs[i].id,
+    	                                                    			page: currentPage,
+    	                                                    	        pagesize: pageSize //global
variable
+    	                                                    		},
+    	                                                    		success: function(json) {    
                      			
+    	                                                    			routerCountFromFirstPageToCurrentPage
+= json.listroutersresponse.router.length;    	                                          
         			                                                    			
+    	                                                    			var items = json.listroutersresponse.router;
+    	                                                    			for (var i = 0; i < items.length;
i++) {    	                                                    				
+    	                                                    				if (items[i].requiresupgrade)
{
+    	                                                    					routerRequiresUpgrade++;
+    	                                                    				}
+    	                                                    			}      	                    
                               			
+    	                                                    			if (routerCountFromFirstPageToCurrentPage
< routerCountFromAllPages) {
+    	                                                    				currentPage++;
+    	                                                    				callListApiWithPage();
+    	                                                    			}                           
                        			
+    	                                                    		}
+    	                                        				});                                    
           		
+    	                                                	}    	                            
                   	
+    	                                                	callListApiWithPage();            
     	
+    	                                                	zoneObjs[i].routerRequiresUpgrade =
routerRequiresUpgrade;
+    	                                            		
     	                                            	} else {
     	                                            		zoneObjs[i].routerCount = 0;
+    	                                            		zoneObjs[i].routerRequiresUpgrade = 0;
     	                                            	}    	                                
           		                                                
     	                                            }
     	                                        });


Mime
View raw message