bug 7701: add primary storage node under cluster node in zonetree.

This commit is contained in:
Jessica Wang 2010-12-29 11:39:20 -08:00
parent 396cc34dc1
commit 3a698c09b7
2 changed files with 44 additions and 8 deletions

View File

@ -849,7 +849,7 @@
<div id="cluster_content" style="display: none">
<div id="hosts_container">
</div>
<div id="storages_container">
<div id="primarystorages_container">
</div>
</div>
</div>
@ -869,6 +869,20 @@
</div>
<!-- host Template (end) -->
<!-- primarystorage Template (begin) -->
<div class="leftmenu_expandedlist" id="leftmenu_primarystorage_node_template" style="display:none">
<div id="primarystorage_header" class="leftmenu_content">
<div class="leftmenu_sixthindent">
<div class="leftmenu_arrowloader" id="primarystorage_loading_container" style="display:none;"></div>
<div class="leftmenu_arrows white_nonexpanded_close" id="primarystorage_arrow">
</div>
<span id="primarystorage_name_label">Storage: </span>
<span id="primarystorage_name"></span>
</div>
</div>
</div>
<!-- primarystorage Template (end) -->
<!-- domain tree node template (begin) -->
<div id="domain_tree_node_template" style="display:none">

View File

@ -238,7 +238,25 @@ function buildZoneTree() {
}
}
}
});
});
$.ajax({
data: createURL("command=listStoragePools&clusterid="+clusterObj.id),
dataType: "json",
success: function(json) {
var items = json.liststoragepoolsresponse.storagepool;
var $container = $clusterContent.find("#primarystorages_container").empty();
if(items != null && items.length > 0) {
var $template = $("#leftmenu_primarystorage_node_template");
for(var i=0; i<items.length;i++) {
var $primarystorageNode = $template.clone(true);
primarystorageJSONToTreeNode(items[i], $primarystorageNode);
$container.append($primarystorageNode.show());
}
}
}
});
$target.removeClass("expanded_close").addClass("expanded_open");
$clusterContent.show();
}
@ -418,12 +436,16 @@ function clusterJSONToTreeNode(json, $clusterNode) {
});
}
function hostJSONToTreeNode(json, $hostNode) {
$hostNode.attr("id", "host_"+json.id);
$hostNode.data("jsonObj", json);
//$hostNode.data("id", json.id).data("name", fromdb(json.name));
var hostName = $hostNode.find("#host_name").text(fromdb(json.name));
//hostName.data("jsonObj", json);
function hostJSONToTreeNode(json, $node) {
$node.attr("id", "host_"+json.id);
$node.data("jsonObj", json);
var hostName = $node.find("#host_name").text(fromdb(json.name));
}
function primarystorageJSONToTreeNode(json, $node) {
$node.attr("id", "primarystorage_"+json.id);
$node.data("jsonObj", json);
var primarystorageName = $node.find("#primarystorage_name").text(fromdb(json.name));
}
function afterLoadResourceJSP() {