From 489f4909b4a8af40d34e586fb1a3b1e3a4bee2b2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 19 Nov 2010 11:49:31 -0800 Subject: [PATCH] new UI - cluster page - fix a bug that zone name and pod name didn't show in Add Host dialog, Add Primary Storage dialog. --- ui/scripts/cloud.core.pod.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index b55dc8ce665..99a18443423 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -248,10 +248,9 @@ function refreshClsuterFieldInAddHostDialog(dialogAddHost, podId, clusterId) { }); } -function initAddHostButton($midmenuAddLink1, currentPageInRightPanel) { - $midmenuAddLink1.find("#label").text("Add Host"); - $midmenuAddLink1.show(); - $midmenuAddLink1.unbind("click").bind("click", function(event) { +function initAddHostButton($button, currentPageInRightPanel) { + $button.show(); + $button.unbind("click").bind("click", function(event) { dialogAddHost = $("#dialog_add_host"); dialogAddHost.find("#info_container").hide(); dialogAddHost.find("#new_cluster_name").val(""); @@ -268,7 +267,9 @@ function initAddHostButton($midmenuAddLink1, currentPageInRightPanel) { var clusterObj = $("#tab_content_details").data("jsonObj"); zoneId = clusterObj.zoneid; podId = clusterObj.podid; - clusterId = clusterObj.id; + clusterId = clusterObj.id; + dialogAddHost.find("#zone_name").text(fromdb(clusterObj.zonename)); + dialogAddHost.find("#pod_name").text(fromdb(clusterObj.podname)); } else if(currentPageInRightPanel == "host_page") { var hostObj = $("#tab_content_details").data("jsonObj"); @@ -399,10 +400,9 @@ function clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, exist } } -function initAddPrimaryStorageButton($midmenuAddLink2, currentPageInRightPanel) { - $midmenuAddLink2.find("#label").text("Add Primary Storage"); - $midmenuAddLink2.show(); - $midmenuAddLink2.unbind("click").bind("click", function(event) { +function initAddPrimaryStorageButton($button, currentPageInRightPanel) { + $button.show(); + $button.unbind("click").bind("click", function(event) { dialogAddPool = $("#dialog_add_pool"); dialogAddPool.find("#info_container").hide(); @@ -419,6 +419,8 @@ function initAddPrimaryStorageButton($midmenuAddLink2, currentPageInRightPanel) zoneId = clusterObj.zoneid; podId = clusterObj.podid; sourceClusterId = clusterObj.id; + dialogAddPool.find("#zone_name").text(fromdb(clusterObj.zonename)); + dialogAddPool.find("#pod_name").text(fromdb(clusterObj.podname)); } else if(currentPageInRightPanel == "host_page") { var hostObj = $("#tab_content_details").data("jsonObj");