We no longer place primary storage in middle menu. Here is related UI change.

This commit is contained in:
Jessica Wang 2010-12-16 15:15:23 -08:00
parent a25aeb4007
commit 1433c3ad6c
3 changed files with 19 additions and 75 deletions

View File

@ -547,34 +547,12 @@ function initAddPrimaryStorageButton($button, currentPageInRightPanel, $leftmenu
$thisDialog.dialog("close");
var item = json.createstoragepoolresponse.storagepool;
var $newTemplate = $("#primarystorage_tab_template").clone(true);
hostPrimaryStorageJSONToTemplate(item, $newTemplate);
$("#tab_content_primarystorage").find("#tab_container").append($newTemplate.show());
/*
if(isMiddleMenuShown() == false) { //not on cluster node (still on pod node, so middle menu is hidden)
var $clusterNode = $("#cluster_"+clusterId);
if($clusterNode.length > 0)
$("#cluster_"+clusterId).find("#cluster_name").click();
else //pod node is close. Expand pod node.
refreshClusterUnderPod($("#pod_" + podId), null, clusterId);
}
else {
var $container = $("#midmenu_container").find("#midmenu_primarystorage_container");
var $noItemsAvailable = $container.find("#midmenu_container_no_items_available_clone");
if($noItemsAvailable.length > 0) {
$noItemsAvailable.slideUp("slow", function() {
$(this).remove();
});
}
var $midmenuItem1 = $("#midmenu_item").clone();
$container.append($midmenuItem1.fadeIn("slow"));
var item = json.createstoragepoolresponse.storagepool;
primarystorageToMidmenu(item, $midmenuItem1);
bindClickToMidMenu($midmenuItem1, primarystorageToRightPanel, primarystorageGetMidmenuId);
}
*/
if($("#tab_content_primarystorage").length > 0 && $("#tab_content_primarystorage").css("display") != "none" && $("#primarystorage_tab_template").length > 0) {
var $newTemplate = $("#primarystorage_tab_template").clone(true);
hostPrimaryStorageJSONToTemplate(item, $newTemplate);
$("#tab_content_primarystorage").find("#tab_container").append($newTemplate.show());
}
},
error: function(XMLHttpResponse) {
handleError(XMLHttpResponse, function() {

View File

@ -1160,30 +1160,13 @@ function initAddPrimaryStorageShortcut($midmenuAddLink2, currentPageInRightPanel
$.ajax({
data: createURL("command=createStoragePool" + array1.join("")),
dataType: "json",
success: function(json) {
if(isMiddleMenuShown() == false) { //not on cluster node (still on pod node, so middle menu is hidden)
var $clusterNode = $("#cluster_"+clusterId);
if($clusterNode.length > 0)
$("#cluster_"+clusterId).find("#cluster_name").click();
else //pod node is close. Expand pod node.
refreshClusterUnderPod($("#pod_" + podId), null, clusterId);
}
else {
var $container = $("#midmenu_container").find("#midmenu_primarystorage_container");
var $noItemsAvailable = $container.find("#midmenu_container_no_items_available_clone");
if($noItemsAvailable.length > 0) {
$noItemsAvailable.slideUp("slow", function() {
$(this).remove();
});
}
var $midmenuItem1 = $("#midmenu_item").clone();
$container.append($midmenuItem1.fadeIn("slow"));
var item = json.createstoragepoolresponse.storagepool;
primarystorageToMidmenu(item, $midmenuItem1);
bindClickToMidMenu($midmenuItem1, primarystorageToRightPanel, primarystorageGetMidmenuId);
}
success: function(json) {
var $clusterNode = $("#cluster_"+clusterId);
if($clusterNode.length > 0)
$("#cluster_"+clusterId).find("#cluster_name").click();
else //pod node is close. Expand pod node.
refreshClusterUnderPod($("#pod_" + podId), null, clusterId);
var primarystorageTotal = parseInt($("#primarystorage_total").text());
primarystorageTotal++;
$("#primarystorage_total").text(primarystorageTotal.toString());

View File

@ -1252,29 +1252,12 @@ function initAddPrimaryStorageButtonOnZonePage($button, zoneId, zoneName) {
$.ajax({
data: createURL("command=createStoragePool" + array1.join("")),
dataType: "json",
success: function(json) {
if(isMiddleMenuShown() == false) { //not on cluster node (still on pod node, so middle menu is hidden)
var $clusterNode = $("#cluster_"+clusterId);
if($clusterNode.length > 0)
$("#cluster_"+clusterId).find("#cluster_name").click();
else //pod node is close. Expand pod node.
refreshClusterUnderPod($("#pod_" + podId), null, clusterId);
}
else {
var $container = $("#midmenu_container").find("#midmenu_primarystorage_container");
var $noItemsAvailable = $container.find("#midmenu_container_no_items_available_clone");
if($noItemsAvailable.length > 0) {
$noItemsAvailable.slideUp("slow", function() {
$(this).remove();
});
}
var $midmenuItem1 = $("#midmenu_item").clone();
$container.append($midmenuItem1.fadeIn("slow"));
var item = json.createstoragepoolresponse.storagepool;
primarystorageToMidmenu(item, $midmenuItem1);
bindClickToMidMenu($midmenuItem1, primarystorageToRightPanel, primarystorageGetMidmenuId);
}
success: function(json) {
var $clusterNode = $("#cluster_"+clusterId);
if($clusterNode.length > 0)
$("#cluster_"+clusterId).find("#cluster_name").click();
else //pod node is close. Expand pod node.
refreshClusterUnderPod($("#pod_" + podId), null, clusterId);
$thisDialog.find("#spinning_wheel").hide();
$thisDialog.dialog("close");