From 8c8188afec10f5781b5fb2a008737bd9d7c5f02c Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 17 Nov 2010 15:18:09 -0800 Subject: [PATCH] bug 7151: cluster page - add "Add Host", "Add Primary Storage" option. --- ui/jsp/cluster.jsp | 159 +++++++++++++++++++++++++++++++ ui/scripts/cloud.core.cluster.js | 14 ++- ui/scripts/cloud.core.pod.js | 16 +++- 3 files changed, 184 insertions(+), 5 deletions(-) diff --git a/ui/jsp/cluster.jsp b/ui/jsp/cluster.jsp index 7811fb0372a..ba490a86798 100644 --- a/ui/jsp/cluster.jsp +++ b/ui/jsp/cluster.jsp @@ -79,3 +79,162 @@ + + + + + + + diff --git a/ui/scripts/cloud.core.cluster.js b/ui/scripts/cloud.core.cluster.js index 81e54c2a5a9..481d272290a 100644 --- a/ui/scripts/cloud.core.cluster.js +++ b/ui/scripts/cloud.core.cluster.js @@ -19,9 +19,17 @@ function afterLoadClusterJSP($midmenuItem1) { showMiddleMenu(); - $("#midmenu_add_link").unbind("click").hide(); - $("#midmenu_add2_link").unbind("click").hide(); - $("#midmenu_add3_link").unbind("click").hide(); + //$("#midmenu_add_link").unbind("click").hide(); + //$("#midmenu_add2_link").unbind("click").hide(); + + //??? + initAddHostButton($("#midmenu_add_link"), "cluster_page"); + initAddPrimaryStorageButton($("#midmenu_add2_link"), "cluster_page"); + $("#midmenu_add3_link").unbind("click").hide(); + + initDialog("dialog_add_host"); + initDialog("dialog_add_pool"); + //??? clusterJsonToRightPanel($midmenuItem1); var clusterId = $midmenuItem1.data("jsonObj").id; diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index 6913321f5ca..c5892c909ab 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -255,7 +255,7 @@ function initAddHostButton($midmenuAddLink1, currentPageInRightPanel) { dialogAddHost = $("#dialog_add_host"); dialogAddHost.find("#info_container").hide(); dialogAddHost.find("#new_cluster_name").val(""); - + var zoneId, podId, clusterId; if(currentPageInRightPanel == "pod_page") { var podObj = $("#tab_content_details").data("jsonObj"); @@ -264,6 +264,12 @@ function initAddHostButton($midmenuAddLink1, currentPageInRightPanel) { dialogAddHost.find("#zone_name").text(fromdb(podObj.zonename)); dialogAddHost.find("#pod_name").text(fromdb(podObj.name)); } + else if(currentPageInRightPanel == "cluster_page") { + var clusterObj = $("#tab_content_details").data("jsonObj"); + zoneId = clusterObj.zoneid; + podId = clusterObj.podid; + clusterId = clusterObj.id; + } else if(currentPageInRightPanel == "host_page") { var hostObj = $("#tab_content_details").data("jsonObj"); zoneId = hostObj.zoneid; @@ -407,7 +413,13 @@ function initAddPrimaryStorageButton($midmenuAddLink2, currentPageInRightPanel) podId = podObj.id; dialogAddPool.find("#zone_name").text(fromdb(podObj.zonename)); dialogAddPool.find("#pod_name").text(fromdb(podObj.name)); - } + } + else if(currentPageInRightPanel == "cluster_page") { + var clusterObj = $("#tab_content_details").data("jsonObj"); + zoneId = clusterObj.zoneid; + podId = clusterObj.podid; + sourceClusterId = clusterObj.id; + } else if(currentPageInRightPanel == "host_page") { var hostObj = $("#tab_content_details").data("jsonObj"); zoneId = hostObj.zoneid;