You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/11/27 22:07:56 UTC

git commit: updated refs/heads/master to 0b5a6cb

Updated Branches:
  refs/heads/master f17f35eeb -> 0b5a6cb0c


CLOUDSTACK-1889: UI > accounts > Update Resource Count action > after action succeeds, pop up a dialog to show updated count of resources.


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

Branch: refs/heads/master
Commit: 0b5a6cb0cff2ab13481a158227201593705b7c76
Parents: f17f35e
Author: Jessica Wang <je...@apache.org>
Authored: Wed Nov 27 13:05:47 2013 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Wed Nov 27 13:07:46 2013 -0800

----------------------------------------------------------------------
 ui/scripts/accounts.js | 54 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0b5a6cb0/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 7267252..72bc00f 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -372,7 +372,59 @@
                                         data: data,
                                         async: true,
                                         success: function(json) {
-                                            //var resourcecounts= json.updateresourcecountresponse.resourcecount;   //do nothing
+                                            var resourcecounts= json.updateresourcecountresponse.resourcecount;                                               
+                                            //pop up API response in a dialog box since only updateResourceCount API returns resourcecount (listResourceLimits API does NOT return resourcecount)
+                                            var msg = '';
+                                            if (resourcecounts != null) {
+                                            	for (var i = 0; i < resourcecounts.length; i++) {                                            		
+                                            		switch (resourcecounts[i].resourcetype) {
+                                            		case '0':
+                                            			msg += 'Instance'; //vmLimit
+                                            			break;
+                                            		case '1':
+                                            			msg += 'Public IP'; //ipLimit
+                                            			break;
+                                            		case '2':
+                                            			msg += 'Volume'; //volumeLimit
+                                            			break;
+                                            		case '3':
+                                            		    msg += 'Snapshot'; //snapshotLimit
+                                            		    break;
+                                            		case '4':
+                                            			msg += 'Template'; //templateLimit
+                                            			break;
+                                            		case '5':                                            			
+                                            			continue; //resourcetype 5 is not in use. so, skip to next item.                                          			
+                                            			break;
+                                            		case '6':
+                                            			msg += 'Network'; //networkLimit
+                                            			break;
+                                            		case '7':
+                                            			msg += 'VPC'; //vpcLimit
+                                            			break;
+                                            		case '8':
+                                            			msg += 'CPU'; //cpuLimit
+                                            			break;
+                                            		case '9':
+                                            			msg += 'Memory'; //memoryLimit
+                                            			break;
+                                            		case '10':
+                                            			msg += 'Primary Storage'; //primaryStorageLimit
+                                            			break;
+                                            		case '11':
+                                            			msg += 'Secondary Storage'; //secondaryStorageLimit
+                                            			break;      
+                                            		}
+                                            		                                      		
+                                            		msg += ' Count: ' + resourcecounts[i].resourcecount + ' <br> ';
+                                            	}
+                                            }
+                                            
+                                            
+                                            cloudStack.dialog.notice({
+                                            	message: msg
+                                            });                                            
+                                            
                                             args.response.success();
                                         },
                                         error: function(json) {