From d074396f0c41aa389f87ca19a70e88ccb5d7d16f Mon Sep 17 00:00:00 2001 From: NIKITA Date: Thu, 28 Oct 2010 13:46:32 -0700 Subject: [PATCH 1/2] Status color added to Host --- ui/new/css/main.css | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ui/new/css/main.css b/ui/new/css/main.css index 93de1d09cfe..ea08e1b8ccd 100644 --- a/ui/new/css/main.css +++ b/ui/new/css/main.css @@ -2556,6 +2556,45 @@ a:hover.search_button { padding:0; } +.row_celltitles.status_red { + width:auto; + height:auto; + float:left; + color:#AB0202; + text-align:left; + font-size:11px; + font-weight:bold; + margin:0 0 0 10px; + display:inline; + padding:0; +} + +.row_celltitles.status_green { + width:auto; + height:auto; + float:left; + color:#538002; + text-align:left; + font-size:11px; + font-weight:bold; + margin:0 0 0 10px; + display:inline; + padding:0; +} + +.row_celltitles.status_gray { + width:auto; + height:auto; + float:left; + color:#666666; + text-align:left; + font-size:11px; + font-weight:bold; + margin:0 0 0 10px; + display:inline; + padding:0; +} + .row_celltitles.alert { width:100%; height:auto; From 17b9a237977e21d9a5df343d88dff5c4aff3533c Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 28 Oct 2010 14:08:52 -0700 Subject: [PATCH 2/2] new UI - Add Host button displays on host page now. fix a bug ("podObj is not found") that appears when clicking Add Host button on host page without visiting pod page first. --- ui/new/scripts/cloud.core2.resource.js | 52 +++++++++++++++++++------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/ui/new/scripts/cloud.core2.resource.js b/ui/new/scripts/cloud.core2.resource.js index a86fa76e19c..9f88647e43e 100644 --- a/ui/new/scripts/cloud.core2.resource.js +++ b/ui/new/scripts/cloud.core2.resource.js @@ -310,7 +310,7 @@ function showPage2($pageToShow, $menuItem1) { else if($pageToShow.attr("id") == "pod_page") { hideMiddleMenu(); - initAddHostButton($("#midmenu_add_link")); + initAddHostButton($("#midmenu_add_link"), "pod_page"); initAddPrimaryStorageButton($("#midmenu_add2_link")); initDialog("dialog_add_host"); @@ -350,9 +350,11 @@ function showPage2($pageToShow, $menuItem1) { $header2.show(); } else if($pageToShow.attr("id") == "host_page") { - initAddHostButton($("#midmenu_add_link")); + initAddHostButton($("#midmenu_add_link"), "host_page"); initAddPrimaryStorageButton($("#midmenu_add2_link")); + initDialog("dialog_add_host"); + initDialog("dialog_add_pool"); initDialog("dialog_confirmation_enable_maintenance"); initDialog("dialog_confirmation_cancel_maintenance"); initDialog("dialog_confirmation_force_reconnect"); @@ -360,9 +362,11 @@ function showPage2($pageToShow, $menuItem1) { initDialog("dialog_update_os"); } else if($pageToShow.attr("id") == "primarystorage_page") { - initAddHostButton($("#midmenu_add_link")); + initAddHostButton($("#midmenu_add_link"), "primarystorage_page"); initAddPrimaryStorageButton($("#midmenu_add2_link")); + initDialog("dialog_add_host"); + initDialog("dialog_add_pool"); initDialog("dialog_confirmation_delete_primarystorage"); } else if($pageToShow.attr("id") == "systemvm_page") { @@ -1289,19 +1293,39 @@ function initAddPodButton($midmenuAddLink1) { }); } -function initAddHostButton($midmenuAddLink1) { +function initAddHostButton($midmenuAddLink1, currentPageInRightPanel) { $midmenuAddLink1.find("#label").text("Add Host"); $midmenuAddLink1.show(); $midmenuAddLink1.unbind("click").bind("click", function(event) { dialogAddHost = $("#dialog_add_host"); dialogAddHost.find("#info_container").hide(); - var podObj = $("#pod_page").find("#tab_content_details").data("jsonObj"); - dialogAddHost.find("#zone_name").text(fromdb(podObj.zonename)); - dialogAddHost.find("#pod_name").text(fromdb(podObj.name)); - dialogAddHost.find("#new_cluster_name").val(""); - + dialogAddHost.find("#new_cluster_name").val(""); + + var zoneId, podId; + if(currentPageInRightPanel == "pod_page") { + var podObj = $("#pod_page").find("#tab_content_details").data("jsonObj"); + zoneId = podObj.zoneid; + podId = podObj.id; + dialogAddHost.find("#zone_name").text(fromdb(podObj.zonename)); + dialogAddHost.find("#pod_name").text(fromdb(podObj.name)); + } + else if(currentPageInRightPanel == "host_page") { + var hostObj = $("#host_page").find("#tab_content_details").data("jsonObj"); + zoneId = hostObj.zoneid; + podId = hostObj.podid; + dialogAddHost.find("#zone_name").text(fromdb(hostObj.zonename)); + dialogAddHost.find("#pod_name").text(fromdb(hostObj.podname)); + } + else if(currentPageInRightPanel == "primarystorage_page") { + var primarystorageObj = $("#primarystorage_page").find("#tab_content_details").data("jsonObj"); + zoneId = primarystorageObj.zoneid; + podId = primarystorageObj.podid; + dialogAddHost.find("#zone_name").text(fromdb(primarystorageObj.zonename)); + dialogAddHost.find("#pod_name").text(fromdb(primarystorageObj.podname)); + } + $.ajax({ - data: createURL("command=listClusters&podid="+podObj.id+maxPageSize), + data: createURL("command=listClusters&podid="+podId+maxPageSize), dataType: "json", success: function(json) { var items = json.listclustersresponse.cluster; @@ -1337,8 +1361,8 @@ function initAddHostButton($midmenuAddLink1) { $thisDialog.find("#spinning_wheel").show() var array1 = []; - array1.push("&zoneId="+podObj.zoneid); - array1.push("&podId="+podObj.id); + array1.push("&zoneId="+zoneId); + array1.push("&podId="+podId); var username = trim($thisDialog.find("#host_username").val()); array1.push("&username="+encodeURIComponent(username)); @@ -1395,10 +1419,10 @@ function initAddHostButton($midmenuAddLink1) { } */ - clickClusterNodeAfterAddHost(clusterRadio, podObj.id, newClusterName, existingClusterId, $thisDialog); + clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); }, error: function(XMLHttpResponse) { - clickClusterNodeAfterAddHost(clusterRadio, podObj.id, newClusterName, existingClusterId, $thisDialog); + clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); handleErrorInDialog(XMLHttpResponse, $thisDialog); } });