diff --git a/ui/new/css/main.css b/ui/new/css/main.css index 0ed7bdf1736..a37c17c24ad 100644 --- a/ui/new/css/main.css +++ b/ui/new/css/main.css @@ -3337,7 +3337,7 @@ a:hover.search_button { } .zonetree_secondlevel_selected { - width:475px; + width:455px; height:25px; float:left; margin:0 0 5px 55px; @@ -3363,6 +3363,24 @@ a:hover.search_button { padding:0; } +.zonetree_forthlevel { + width:345px; + height:25px; + float:left; + margin:0 0 5px 110px; + display:inline; + padding:0; +} + +.zonetree_forthlevel_selected { + width:345px; + height:25px; + float:left; + margin:0 0 5px 110px; + background:#eaf3f5 repeat top left; + padding:0; +} + .zonetree_closedarrows { width:12px; height:14px; @@ -3417,6 +3435,36 @@ a:hover.search_button { padding:0; } +.zonetree_clustericon { + width:22px; + height:18px; + float:left; + background:url(../images/zone_clustericon.png) no-repeat top left; + font-weight:bold; + margin:3px 0 0 5px; + padding:0; +} + +.zonetree_hosticon { + width:22px; + height:18px; + float:left; + background:url(../images/zone_hosticon.png) no-repeat top left; + font-weight:bold; + margin:3px 0 0 5px; + padding:0; +} + +.zonetree_primarystorageicon { + width:22px; + height:18px; + float:left; + background:url(../images/zone__primarystorageicon.png) no-repeat top left; + font-weight:bold; + margin:3px 0 0 5px; + padding:0; +} + .zonetree_links { width:auto; height:auto; diff --git a/ui/new/images/zone_clustericon.png b/ui/new/images/zone_clustericon.png new file mode 100644 index 00000000000..5f881f42095 Binary files /dev/null and b/ui/new/images/zone_clustericon.png differ diff --git a/ui/new/images/zone_hosticon.png b/ui/new/images/zone_hosticon.png new file mode 100644 index 00000000000..5f881f42095 Binary files /dev/null and b/ui/new/images/zone_hosticon.png differ diff --git a/ui/new/images/zone_primarystorageicon.png b/ui/new/images/zone_primarystorageicon.png new file mode 100644 index 00000000000..5f881f42095 Binary files /dev/null and b/ui/new/images/zone_primarystorageicon.png differ diff --git a/ui/new/jsp/resource.jsp b/ui/new/jsp/resource.jsp index 147832d06c6..ae3087e541f 100644 --- a/ui/new/jsp/resource.jsp +++ b/ui/new/jsp/resource.jsp @@ -315,8 +315,12 @@

Pod:

+ +
+
@@ -333,3 +337,49 @@ + + + + + + + + + + + + + diff --git a/ui/new/scripts/cloud.core2.resource.js b/ui/new/scripts/cloud.core2.resource.js index 55839e10a39..88772f3e749 100644 --- a/ui/new/scripts/cloud.core2.resource.js +++ b/ui/new/scripts/cloud.core2.resource.js @@ -8,8 +8,8 @@ function afterLoadResourceJSP() { var forceLogout = true; // We force a logout only if the user has first added a POD for the very first time $("#midmenu_container").append($("#zonetree").clone().attr("id", "zonetree1").show()); - $.ajax({ - data: createURL("command=listZones&available=true&response=json"+maxPageSize), + $.ajax({ + data: createURL("command=listZones&available=true"+maxPageSize), dataType: "json", success: function(json) { var items = json.listzonesresponse.zone; @@ -42,7 +42,7 @@ function afterLoadResourceJSP() { template.find("#zone_name").data("vlan", json.vlan); $.ajax({ - data: createURL("command=listPods&zoneid="+zoneid+"&response=json"), + data: createURL("command=listPods&zoneid="+zoneid+maxPageSize), dataType: "json", success: function(json) { var items = json.listpodsresponse.pod; @@ -59,7 +59,7 @@ function afterLoadResourceJSP() { }); $.ajax({ - data: createURL("command=listSystemVms&zoneid="+zoneid+"&response=json"), + data: createURL("command=listSystemVms&zoneid="+zoneid+maxPageSize), dataType: "json", success: function(json) { var items = json.listsystemvmsresponse.systemvm; @@ -74,18 +74,7 @@ function afterLoadResourceJSP() { } }); } - - function getIpRange(startip, endip) { - var ipRange = ""; - if (startip != null && startip.length > 0) { - ipRange = startip; - } - if (endip != null && endip.length > 0) { - ipRange = ipRange + "-" + endip; - } - return ipRange; - } - + function podJSONToTemplate(json, template) { var ipRange = getIpRange(json.startip, json.endip); template.data("id", json.id).data("name", json.name); @@ -98,9 +87,25 @@ function afterLoadResourceJSP() { podName.data("startip", json.startip); podName.data("endip", json.endip); podName.data("ipRange", ipRange); - podName.data("gateway", json.gateway); + podName.data("gateway", json.gateway); + + $.ajax({ + data: createURL("command=listClusters&podid="+json.id+maxPageSize), + dataType: "json", + success: function(json) { + var items = json.listclustersresponse.cluster; + var container = template.find("#clusters_container").empty(); + if (items != null && items.length > 0) { + for (var i = 0; i < items.length; i++) { + var clusterTemplate = $("#cluster_template").clone(true).attr("id", "cluster_"+items[i].id); + clusterJSONToTemplate(items[i], clusterTemplate); + container.append(clusterTemplate.show()); + } + } + } + }); } - + function systemvmJSONToTemplate(json, template) { template.data("id", json.id).data("name", json.name); @@ -115,6 +120,12 @@ function afterLoadResourceJSP() { systeymvmName.data("gateway", json.gateway); systeymvmName.data("created", json.created); systeymvmName.data("state", json.state); + } + + function clusterJSONToTemplate(json, template) { + template.data("id", json.id).data("name", fromdb(json.name)); + + var systeymvmName = template.find("#cluster_name").text(fromdb(json.name)); } $("#zone_template").bind("click", function(event) { @@ -159,6 +170,17 @@ function afterLoadResourceJSP() { } return false; }); - + + + function getIpRange(startip, endip) { + var ipRange = ""; + if (startip != null && startip.length > 0) { + ipRange = startip; + } + if (endip != null && endip.length > 0) { + ipRange = ipRange + "-" + endip; + } + return ipRange; + } }