From e43608c02f38dd3059eb8f67bcae2eb0454d2a44 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 11 Oct 2010 10:58:08 -0700 Subject: [PATCH] new UI - resources page - add cluster under each pod node in the tree. --- ui/new/css/main.css | 50 +++++++++++++++++- ui/new/images/zone_clustericon.png | Bin 0 -> 1055 bytes ui/new/images/zone_hosticon.png | Bin 0 -> 1055 bytes ui/new/images/zone_primarystorageicon.png | Bin 0 -> 1055 bytes ui/new/jsp/resource.jsp | 50 ++++++++++++++++++ ui/new/scripts/cloud.core2.resource.js | 60 +++++++++++++++------- 6 files changed, 140 insertions(+), 20 deletions(-) create mode 100644 ui/new/images/zone_clustericon.png create mode 100644 ui/new/images/zone_hosticon.png create mode 100644 ui/new/images/zone_primarystorageicon.png 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 0000000000000000000000000000000000000000..5f881f4209567894678b88f0442c5f9a9d309498 GIT binary patch literal 1055 zcmV+)1mOFLP)^001Q-Bsn%Z2nGWG|NjBJzrfPa(Ea`W zHa9vA3km`Nd;o+00qg7Q^7HbgrKbf11pxv8^6>IwZdCd92Mq-d_xbk$|NsA3T3akD zD-8(?2MY)Q008jo>h$#Y;o{??rlSGf+}`c+^5Wp)0RI2|0R8^`{Tv(~009991_Sc* z@&pD51tSt4$-=?@0s;R1{`~p)Ej}^<{0ATt5!%|^0#HCED-AoN#>Gxu0j2Dpbi7k^;hnRA7ow z3jAa6)VY~9>$U0(RE#K`#*n z27ty|2-UD{z=#5^nkGD4U!7c>Gm9-cPHncHa_$GCag^+B@05c)&$AelMIp6nxraSI z$Vch=#v0w++Kr;PY@!AbkWyunU!k+txBj01os&&VLQxQg&)j=GCZxA3(WZrcY?AhU zu0(NRv-p^)jp=ujM&3W07P Ze*i>dGTY>Pc*y_&002ovPDHLkV1msj0sQ~~ literal 0 HcmV?d00001 diff --git a/ui/new/images/zone_hosticon.png b/ui/new/images/zone_hosticon.png new file mode 100644 index 0000000000000000000000000000000000000000..5f881f4209567894678b88f0442c5f9a9d309498 GIT binary patch literal 1055 zcmV+)1mOFLP)^001Q-Bsn%Z2nGWG|NjBJzrfPa(Ea`W zHa9vA3km`Nd;o+00qg7Q^7HbgrKbf11pxv8^6>IwZdCd92Mq-d_xbk$|NsA3T3akD zD-8(?2MY)Q008jo>h$#Y;o{??rlSGf+}`c+^5Wp)0RI2|0R8^`{Tv(~009991_Sc* z@&pD51tSt4$-=?@0s;R1{`~p)Ej}^<{0ATt5!%|^0#HCED-AoN#>Gxu0j2Dpbi7k^;hnRA7ow z3jAa6)VY~9>$U0(RE#K`#*n z27ty|2-UD{z=#5^nkGD4U!7c>Gm9-cPHncHa_$GCag^+B@05c)&$AelMIp6nxraSI z$Vch=#v0w++Kr;PY@!AbkWyunU!k+txBj01os&&VLQxQg&)j=GCZxA3(WZrcY?AhU zu0(NRv-p^)jp=ujM&3W07P Ze*i>dGTY>Pc*y_&002ovPDHLkV1msj0sQ~~ literal 0 HcmV?d00001 diff --git a/ui/new/images/zone_primarystorageicon.png b/ui/new/images/zone_primarystorageicon.png new file mode 100644 index 0000000000000000000000000000000000000000..5f881f4209567894678b88f0442c5f9a9d309498 GIT binary patch literal 1055 zcmV+)1mOFLP)^001Q-Bsn%Z2nGWG|NjBJzrfPa(Ea`W zHa9vA3km`Nd;o+00qg7Q^7HbgrKbf11pxv8^6>IwZdCd92Mq-d_xbk$|NsA3T3akD zD-8(?2MY)Q008jo>h$#Y;o{??rlSGf+}`c+^5Wp)0RI2|0R8^`{Tv(~009991_Sc* z@&pD51tSt4$-=?@0s;R1{`~p)Ej}^<{0ATt5!%|^0#HCED-AoN#>Gxu0j2Dpbi7k^;hnRA7ow z3jAa6)VY~9>$U0(RE#K`#*n z27ty|2-UD{z=#5^nkGD4U!7c>Gm9-cPHncHa_$GCag^+B@05c)&$AelMIp6nxraSI z$Vch=#v0w++Kr;PY@!AbkWyunU!k+txBj01os&&VLQxQg&)j=GCZxA3(WZrcY?AhU zu0(NRv-p^)jp=ujM&3W07P Ze*i>dGTY>Pc*y_&002ovPDHLkV1msj0sQ~~ literal 0 HcmV?d00001 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; + } }