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 2012/09/29 08:02:33 UTC

git commit: bug 15089: cloudstack UI - domain page - get volume count and VM count from listAccounts API response that has volumetotal property and vmtotal property under each account object. listVolumes API and listVirtualMachines API are no longer call

Updated Branches:
  refs/heads/master 5c60f8e48 -> 295e22881


bug 15089: cloudstack UI - domain page - get volume count and VM count from listAccounts API response that has volumetotal property and vmtotal property under each account object. listVolumes API and listVirtualMachines API are no longer called when domains are clicked in domain page.


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

Branch: refs/heads/master
Commit: 295e22881924559905d94c382664aa94e390a9be
Parents: 5c60f8e
Author: Jessica Wang <je...@citrix.com>
Authored: Fri Sep 28 22:26:47 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Fri Sep 28 22:58:34 2012 -0700

----------------------------------------------------------------------
 ui/scripts/domains.js |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/295e2288/ui/scripts/domains.js
----------------------------------------------------------------------
diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js
index 02471b6..7249cc4 100644
--- a/ui/scripts/domains.js
+++ b/ui/scripts/domains.js
@@ -363,10 +363,21 @@
                   else
                     total = 0;
                   domainObj["accountTotal"] = total;
+                  var itemsAcc;
+                  var totalVMs=0;
+                  var totalVolumes=0;
+                  for(var i=0;i<total;i++) {
+                        itemsAcc = json.listaccountsresponse.account[i];
+                        totalVMs = totalVMs + itemsAcc.vmtotal;
+                        totalVolumes = totalVolumes + itemsAcc.volumetotal;
+                  }
+                  domainObj["vmTotal"] = totalVMs;
+                  domainObj["volumeTotal"] = totalVolumes;
+
                 }
               });
 
-              $.ajax({
+              /* $.ajax({
                 url: createURL("listVirtualMachines&details=min&domainid=" + domainObj.id),
                 async: false,
                 dataType: "json",
@@ -394,7 +405,7 @@
                     total = 0;
                   domainObj["volumeTotal"] = total;
                 }
-              });
+              });*/
 
               $.ajax({
                 url: createURL("listResourceLimits&domainid=" + domainObj.id),