diff --git a/ui/new/css/main.css b/ui/new/css/main.css index a37c17c24ad..bbbc9d672e5 100644 --- a/ui/new/css/main.css +++ b/ui/new/css/main.css @@ -3367,7 +3367,7 @@ a:hover.search_button { width:345px; height:25px; float:left; - margin:0 0 5px 110px; + margin:0 0 5px 165px; display:inline; padding:0; } @@ -3376,7 +3376,7 @@ a:hover.search_button { width:345px; height:25px; float:left; - margin:0 0 5px 110px; + margin:0 0 5px 165px; background:#eaf3f5 repeat top left; padding:0; } @@ -3459,7 +3459,7 @@ a:hover.search_button { width:22px; height:18px; float:left; - background:url(../images/zone__primarystorageicon.png) no-repeat top left; + background:url(../images/zone_primarystorageicon.png) no-repeat top left; font-weight:bold; margin:3px 0 0 5px; padding:0; diff --git a/ui/new/jsp/resource.jsp b/ui/new/jsp/resource.jsp index ae3087e541f..d7895e2f2ef 100644 --- a/ui/new/jsp/resource.jsp +++ b/ui/new/jsp/resource.jsp @@ -347,7 +347,13 @@

Cluster:

-
+ +
+
+
+
+
+
@@ -376,7 +382,7 @@
-

Primary Storage:

+

Primary:

diff --git a/ui/new/scripts/cloud.core2.resource.js b/ui/new/scripts/cloud.core2.resource.js index 88772f3e749..3a3796c9762 100644 --- a/ui/new/scripts/cloud.core2.resource.js +++ b/ui/new/scripts/cloud.core2.resource.js @@ -126,6 +126,50 @@ function afterLoadResourceJSP() { template.data("id", json.id).data("name", fromdb(json.name)); var systeymvmName = template.find("#cluster_name").text(fromdb(json.name)); + + $.ajax({ + data: createURL("command=listHosts&clusterid="+json.id+maxPageSize), + dataType: "json", + success: function(json) { + var items = json.listhostsresponse.host; + var container = template.find("#hosts_container").empty(); + if (items != null && items.length > 0) { + for (var i = 0; i < items.length; i++) { + var hostTemplate = $("#host_template").clone(true).attr("id", "host_"+items[i].id); + hostJSONToTemplate(items[i], hostTemplate); + container.append(hostTemplate.show()); + } + } + } + }); + + $.ajax({ + data: createURL("command=listStoragePools&clusterid="+json.id+maxPageSize), + dataType: "json", + success: function(json) { + var items = json.liststoragepoolsresponse.storagepool; + var container = template.find("#primarystorages_container").empty(); + if (items != null && items.length > 0) { + for (var i = 0; i < items.length; i++) { + var primaryStorageTemplate = $("#primary_storage_template").clone(true).attr("id", "primary_storage_"+items[i].id); + primaryStorageJSONToTemplate(items[i], primaryStorageTemplate); + container.append(primaryStorageTemplate.show()); + } + } + } + }); + } + + function hostJSONToTemplate(json, template) { + template.data("id", json.id).data("name", fromdb(json.name)); + + var hostName = template.find("#host_name").text(fromdb(json.name)); + } + + function primaryStorageJSONToTemplate(json, template) { + template.data("id", json.id).data("name", fromdb(json.name)); + + var primaryStorageName = template.find("#primary_storage_name").text(fromdb(json.name)); } $("#zone_template").bind("click", function(event) {