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/4.3 to 3fbddbb
Date Mon, 25 Nov 2013 20:08:18 GMT
Updated Branches:
  refs/heads/4.3 a3db8ea4c -> 3fbddbb91


CLOUDSTACK-4793: UI > Virtual Routers > Select View > group by zone > implement
detailView 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/3fbddbb9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3fbddbb9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3fbddbb9

Branch: refs/heads/4.3
Commit: 3fbddbb911011230ca5edc634372502f930ce5c6
Parents: a3db8ea
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Nov 25 12:06:57 2013 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Nov 25 12:07:45 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3fbddbb9/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index d6ced5b..d748b72 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8735,7 +8735,86 @@
                                         });
                                     }
                                 });
-                            }
+                            },                                                       
+                            detailView: {
+                            	name: 'Virtual Routers group by zone',    
+                            	tabs: {
+                            		details: {
+                            			title: 'Virtual Routers group by zone',                  
         			
+                            			fields: [{
+                                            name: {
+                                                label: 'label.zone'
+                                            }
+                            			}, {
+                                            routerCount: {
+                                            	label: 'Total of Virtual Routers'
+                                            },
+                                            routerRequiresUpgrade: {
+                                            	label: 'Virtual Routers require upgrade',
+                                            	converter: function(args) {                
               		
+                                            		if (args > 0) {
+                                            			return 'Yes';
+                                            		} else {
+                                            			return 'No';
+                                            		}
+                                            	}
+                                            }
+                                        }],  
+                                        dataProvider: function(args) {     
+                                        	$.ajax({
+	                                            url: createURL('listRouters'),
+	                                            data: {
+	                                            	zoneid: args.context.routerGroupByZone[0].id
+	                                            },
+	                                            async: false,
+	                                            success: function(json) {
+	                                            	if (json.listroutersresponse.count != undefined)
{
+	                                            		args.context.routerGroupByZone[0].routerCount
= json.listroutersresponse.count;    
+	                                            		    	                                    
       		
+	                                            		var routerCountFromAllPages = args.context.routerGroupByZone[0].routerCount;
                                               	
+	                                                	var currentPage = 1;
+	                                                	var routerCountFromFirstPageToCurrentPage
= 0;  
+	                                                	var routerRequiresUpgrade = 0;    	   
                                            	                                            
   	
+	                                                	var callListApiWithPage = function() {
                                               		
+	                                                		$.ajax({
+	                                        					url: createURL('listRouters'),
+	                                                    		async: false,
+	                                                    		data: {    	                     
                              			
+	                                                    			zoneid: args.context.routerGroupByZone[0].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();                
 	
+	                                                	args.context.routerGroupByZone[0].routerRequiresUpgrade
= routerRequiresUpgrade;
+	                                            		
+	                                            	} else {
+	                                            		args.context.routerGroupByZone[0].routerCount
= 0;
+	                                            		args.context.routerGroupByZone[0].routerRequiresUpgrade
= 0;
+	                                            	}    	                                    
       		                                                
+	                                            }
+	                                        });                                        	
+                                        	args.response.success({
+                                        		data: args.context.routerGroupByZone[0]
+                                        	})
+                                        }
+                            		}
+                            	}
+                            }                                               
                         }
                     }                   
                 }


Mime
View raw message