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 19e855e
Date Wed, 04 Dec 2013 22:11:07 GMT
Updated Branches:
  refs/heads/4.3 e85334ff5 -> 19e855e5d


CLOUDSTACK-5200: UI > Infrastructure > Sockets > listView > fix a bug that Hosts
and Sockets displayed wrong number.


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

Branch: refs/heads/4.3
Commit: 19e855e5dca314ac119646da12029d843eba376a
Parents: e85334f
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed Dec 4 14:10:24 2013 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Dec 4 14:10:56 2013 -0800

----------------------------------------------------------------------
 ui/scripts/system.js | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/19e855e5/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 0d8784f..cdece2f 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -392,19 +392,22 @@
                                     	var currentPage = 1;
                                     	var returnedHostCount = 0;
                                     	var returnedHostCpusocketsSum = 0;
-                                    	var returnedHostHavingCpusockets = true;
-                                    	                                                	
+                                    	                                              	
                                     	var callListHostsWithPage = function(setTotalHostCount)
{                                                		
                                     		$.ajax({
                             					url: createURL('listHosts'),
                                         		async: false,
                                         		data: {
                                         			type: 'routing',
-                                        			hypervisortype: hypervisor.name,
+                                        			hypervisor: hypervisor.name,
                                         			page: currentPage,
                                         	        pagesize: pageSize //global variable
                                         		},
-                                        		success: function(json) {                     
                                			
+                                        		success: function(json) {                     
                    			
+                                        			if (json.listhostsresponse.count == undefined)
{                                        				
+                                        				return;
+                                        			}
+                                        			                                        			
                                         			if (setTotalHostCount) {
                                         				totalHostCount = json.listhostsresponse.count;
                                         			}                                            
       			
@@ -414,9 +417,7 @@
                                         			for (var i = 0; i < items.length; i++) {
                                         				if (items[i].cpusockets != undefined &&
isNaN(items[i].cpusockets) == false) {
                                         					returnedHostCpusocketsSum += items[i].cpusockets;
-                                        				} else {
-                                        					returnedHostHavingCpusockets = false;
-                                        				}
+                                        				} 
                                         			}  
                                         			
                                         			if (returnedHostCount < totalHostCount) {
@@ -428,10 +429,8 @@
                                     	}
                                     	
                                     	callListHostsWithPage(true);
-                                    	
-                                    	if (returnedHostHavingCpusockets) {
-                                    		socketCount += returnedHostCpusocketsSum;
-                                    	}                                    	
+                                    	                                    	
+                                    	socketCount += returnedHostCpusocketsSum;          
                         	                                    	
                                     })
                                 });
                             }
@@ -7496,19 +7495,22 @@
                                                 	var currentPage = 1;
                                                 	var returnedHostCount = 0;
                                                 	var returnedHostCpusocketsSum = 0;
-                                                	var returnedHostHavingCpusockets = true;
-                                                	                                       
        	
+                                                	                                       
        	                                                	
                                                 	var callListHostsWithPage = function(setTotalHostCount)
{                                                		
                                                 		$.ajax({
                                         					url: createURL('listHosts'),
                                                     		async: false,
                                                     		data: {
                                                     			type: 'routing',
-                                                    			hypervisortype: hypervisor.name,
+                                                    			hypervisor: hypervisor.name,
                                                     			page: currentPage,
                                                     	        pagesize: pageSize //global
variable
                                                     		},
-                                                    		success: function(json) {         
                                            			
+                                                    		success: function(json) {   
+                                                    			if (json.listhostsresponse.count ==
undefined) {   
+                                                    				return;
+                                                    			}                                
                   			
+                                                    			
                                                     			if (setTotalHostCount) {
                                                     				totalHostCount = json.listhostsresponse.count;
                                                     			}                                
                   			
@@ -7518,9 +7520,7 @@
                                                     			for (var i = 0; i < items.length;
i++) {
                                                     				if (items[i].cpusockets != undefined
&& isNaN(items[i].cpusockets) == false) {
                                                     					returnedHostCpusocketsSum += items[i].cpusockets;
-                                                    				} else {
-                                                    					returnedHostHavingCpusockets = false;
-                                                    				}
+                                                    				} 
                                                     			}  
                                                     			
                                                     			if (returnedHostCount < totalHostCount)
{
@@ -7532,11 +7532,11 @@
                                                 	}
                                                 	
                                                 	callListHostsWithPage(true);
-                                                	                                       
 	
+                                                	                                       
	
                                                     return {
                                                         hypervisor: hypervisor.name,
                                                         hosts: totalHostCount,
-                                                        sockets: (returnedHostHavingCpusockets?
returnedHostCpusocketsSum : 'unknown')                                                   

+                                                        sockets: returnedHostCpusocketsSum
                                                   
                                                     };
                                                 })
                                             });


Mime
View raw message