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/07/23 20:38:54 UTC

git commit: updated refs/heads/4.2 to 09b898a

Updated Branches:
  refs/heads/4.2 682652865 -> 09b898adb


CLOUDSTACK-2760: UI > Infrastructure menu > System VMs > fix a bug that Agent State was not mapped correctly between systemVMs and hosts.


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

Branch: refs/heads/4.2
Commit: 09b898adbcaa8d54c48742adbd41bb6f13477f99
Parents: 6826528
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jul 23 11:34:22 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Jul 23 11:38:44 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/09b898ad/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 047612d..dc8d82f 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -7420,34 +7420,29 @@
                                             listAll: true
                                         },
                                         success: function(json) {
-                                            var items = json.listsystemvmsresponse.systemvm;
-                                            if (items != null) {
+                                            var systemvmObjs = json.listsystemvmsresponse.systemvm;
+                                            if (systemvmObjs != null) {
                                                 $.ajax({
-                                                    url: createURL("listHosts&listAll=true"),
-                                                    async: false,
+                                                    url: createURL("listHosts&listAll=true"),                                                    
                                                     success: function(json) {
-
-                                                        var hostObj = json.listhostsresponse.host;
-
-                                                        $(hostObj).each(function(index) {
-
-                                                            $.extend(items[index], {
-                                                                agentstate: hostObj[index].state
-                                                            });
-
-                                                        });
+                                                        var hostObjs = json.listhostsresponse.host;
+                                                        for (var i = 0; i < systemvmObjs.length; i++) {
+                                                        	for (var k = 0; k < hostObjs.length; k++) {
+                                                        		if (hostObjs[k].name == systemvmObjs[i].name) {
+                                                        			systemvmObjs[i].agentstate = hostObjs[k].state;
+                                                        			break;
+                                                        		}
+                                                        	}
+                                                        }    
                                                         args.response.success({
-                                                            data: items
+                                                            data: systemvmObjs
                                                         });
                                                     },
                                                     error: function(json) {
                                                         args.response.error(parseXMLHttpResponse(json));
-
                                                     }
                                                 });
                                             }
-
-                                            // args.response.success({ data: json.listsystemvmsresponse.systemvm });
                                         },
                                         error: function(json) {
                                             args.response.error(parseXMLHttpResponse(json));