diff --git a/ui/jsp/host.jsp b/ui/jsp/host.jsp
index 5581264abc2..57bedb9daa3 100644
--- a/ui/jsp/host.jsp
+++ b/ui/jsp/host.jsp
@@ -356,16 +356,7 @@
Add Host
diff --git a/ui/index.jsp b/ui/index.jsp index 3ea66faabda..510493ccf98 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -841,14 +841,14 @@
- Add a new Primary Storage for zone , pod -
-- Adding....
-diff --git a/ui/jsp/primarystorage.jsp b/ui/jsp/primarystorage.jsp index 09f1b569065..64b023eca28 100644 --- a/ui/jsp/primarystorage.jsp +++ b/ui/jsp/primarystorage.jsp @@ -187,16 +187,7 @@
- Add a host for zone , pod - -
-- Adding....
-diff --git a/ui/scripts/cloud.core.cluster.js b/ui/scripts/cloud.core.cluster.js index 5baab31dba5..068c7a92dc6 100644 --- a/ui/scripts/cloud.core.cluster.js +++ b/ui/scripts/cloud.core.cluster.js @@ -17,6 +17,7 @@ */ function afterLoadClusterJSP($midmenuItem1) { + hideMiddleMenu(); initDialog("dialog_add_host"); initDialog("dialog_add_pool"); } diff --git a/ui/scripts/cloud.core.host.js b/ui/scripts/cloud.core.host.js index 60a3104d958..8726631dec2 100644 --- a/ui/scripts/cloud.core.host.js +++ b/ui/scripts/cloud.core.host.js @@ -73,9 +73,7 @@ function hostToRightPanel($midmenuItem1) { } function afterLoadHostJSP() { - initDialog("dialog_add_host"); - initDialog("dialog_add_pool"); - bindEventHandlerToDialogAddPool($("#dialog_add_pool")); + initDialog("dialog_add_host"); initDialog("dialog_confirmation_enable_maintenance"); initDialog("dialog_confirmation_cancel_maintenance"); initDialog("dialog_confirmation_force_reconnect"); @@ -98,8 +96,7 @@ function hostJsonToDetailsTab() { if(jsonObj == null) return; - bindAddHostButton($midmenuItem1); - bindAddPrimaryStorageButton($midmenuItem1); + bindAddHostButton($midmenuItem1); $.ajax({ data: createURL("command=listHosts&id="+jsonObj.id), diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index c8205284b16..1c93c62b04e 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -771,7 +771,7 @@ function bindAddPrimaryStorageButton($leftmenuItem1) { $clusterArrow.click(); } - $("#cluster_"+clusterId+"_primarystorage").show().click(); + $("#cluster_"+clusterId+"_primarystorage").click(); }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() { diff --git a/ui/scripts/cloud.core.primarystorage.js b/ui/scripts/cloud.core.primarystorage.js index 31bc84bc91e..8275ca0daef 100644 --- a/ui/scripts/cloud.core.primarystorage.js +++ b/ui/scripts/cloud.core.primarystorage.js @@ -67,16 +67,10 @@ function primarystorageToMidmenu(jsonObj, $midmenuItem1) { function primarystorageToRightPanel($midmenuItem1) { $("#right_panel_content").data("$midmenuItem1", $midmenuItem1); - primarystorageJsonToDetailsTab(); - - /* - copyActionInfoFromMidMenuToRightPanel($midmenuItem1); - resourceLoadPage("jsp/primarystorage.jsp", $midmenuItem1); //after reloading "jsp/primarystorage.jsp", afterLoadPrimaryStorageJSP() will be called. - */ + primarystorageJsonToDetailsTab(); } - function afterLoadPrimaryStorageJSP($midmenuItem1) { - initDialog("dialog_add_host"); + function afterLoadPrimaryStorageJSP($midmenuItem1) { initDialog("dialog_add_pool"); bindEventHandlerToDialogAddPool($("#dialog_add_pool")); initDialog("dialog_confirmation_delete_primarystorage"); @@ -90,8 +84,7 @@ function primarystorageJsonToDetailsTab() { var jsonObj = $midmenuItem1.data("jsonObj"); if(jsonObj == null) return; - - bindAddHostButton($midmenuItem1); + bindAddPrimaryStorageButton($midmenuItem1); $.ajax({ diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 715970c71d9..2d3b43221bf 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -241,31 +241,7 @@ function buildZoneTree() { var $clusterArrow = $thisNode.find("#cluster_arrow").hide(); var clusterObj = $thisNode.data("jsonObj"); var $clusterContent = $thisNode.find("#cluster_content"); - if($target.hasClass("expanded_close")) { - $.ajax({ - data: createURL("command=listHosts&type=Routing&clusterid="+clusterObj.id), - dataType: "json", - async: false, - success: function(json) { - var items = json.listhostsresponse.host; - if (items != null && items.length > 0) { - $clusterContent.find("#cluster_"+clusterObj.id+"_host").show(); - } - } - }); - - $.ajax({ - data: createURL("command=listStoragePools&clusterid="+clusterObj.id), - dataType: "json", - async: false, - success: function(json) { - var items = json.liststoragepoolsresponse.storagepool; - if(items != null && items.length > 0) { - $clusterContent.find("#cluster_"+clusterObj.id+"_primarystorage").show(); - } - } - }); - + if($target.hasClass("expanded_close")) { $target.removeClass("expanded_close").addClass("expanded_open"); $clusterContent.show(); } @@ -307,67 +283,7 @@ function buildZoneTree() { break; } return false; - }); - - /* - $("#leftmenu_host_node_template").unbind("click").bind("click", function(event) { - var $thisNode = $(this); - selectRowInZoneTree($thisNode.find("#host_header")); - - if(currentRightPanelJSP != "jsp/host.jsp") { - removeDialogs(); - - $("#right_panel").load("jsp/host.jsp", function(){ - currentRightPanelJSP = "jsp/host.jsp"; - - var $topButtonContainer = clearButtonsOnTop(); - $("#top_buttons").appendTo($topButtonContainer); - - $thisNode.data("onRefreshFn", function() { - hostJsonToDetailsTab(); - }); - - afterLoadHostJSP(); - hostToRightPanel($thisNode); - }); - } - else { - hostToRightPanel($thisNode); - } - - return false; - }); - */ - - /* - $("#leftmenu_primarystorage_node_template").unbind("click").bind("click", function(event) { - var $thisNode = $(this); - selectRowInZoneTree($thisNode.find("#primarystorage_header")); - - if(currentRightPanelJSP != "jsp/primarystorage.jsp") { - removeDialogs(); - - $("#right_panel").load("jsp/primarystorage.jsp", function(){ - currentRightPanelJSP = "jsp/primarystorage.jsp"; - - var $topButtonContainer = clearButtonsOnTop(); - $("#top_buttons").appendTo($topButtonContainer); - - $thisNode.data("onRefreshFn", function() { - primarystorageJsonToDetailsTab(); - }); - - afterLoadPrimaryStorageJSP(); - primarystorageToRightPanel($thisNode); - }); - } - else { - primarystorageToRightPanel($thisNode); - } - - return false; - }); - */ + }); } function refreshClusterUnderPod($podNode, newClusterName, existingClusterId, noClicking) { @@ -467,19 +383,7 @@ function clusterJSONToTreeNode(json, $clusterNode) { $clusterNode.find("#leftmenu_primarystorage_node_template").data("clusterObj", json).attr("id",("cluster_"+json.id+"_primarystorage")); $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"); - } - } - }); + clusterName.data("jsonObj", json); } function hostJSONToTreeNode(json, $node) {