From a1855ebb276d1bd389bf75277d5660c085422bef Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 28 Dec 2010 18:08:52 -0800 Subject: [PATCH] Show expandable close arrow icon for cluster node that has host. Otherwise, show non-expandable icon for cluster node. --- ui/scripts/cloud.core.resource.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index b893339065e..e22fb6bfbcd 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -301,6 +301,18 @@ function clusterJSONToTreeNode(json, $clusterNode) { $clusterNode.data("id", json.id).data("name", fromdb(json.name)); var clusterName = $clusterNode.find("#cluster_name").text(fromdb(json.name)); clusterName.data("jsonObj", json); + + $.ajax({ + data: createURL("command=listHosts&type=Routing&clusterid="+json.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listhostsresponse.host; + if (items != null && items.length > 0) { + $clusterNode.find("#cluster_arrow").removeClass("white_nonexpanded_close").addClass("expanded_close"); + } + } + }); } function afterLoadResourceJSP() {