From 4ed5856407a4747448f59293df35edc48efec9dd Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 28 Jul 2011 17:57:15 -0700 Subject: [PATCH] cloudStack - Elastic Load Balancer - pass "forvirtualnetwork" whenever calling listPublicIpAddresses API. Otherwise, it will return an empty object. --- ui/scripts/cloud.core.ipaddress.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/ui/scripts/cloud.core.ipaddress.js b/ui/scripts/cloud.core.ipaddress.js index 3dd5867f1d7..5dac343b57f 100644 --- a/ui/scripts/cloud.core.ipaddress.js +++ b/ui/scripts/cloud.core.ipaddress.js @@ -1309,14 +1309,30 @@ function ipJsonToDetailsTab() { var networkObj = $midmenuItem1.data("networkObj"); - var id = ipObj.id; + var publicipid = ipObj.id; var $thisTab = $("#right_panel_content").find("#tab_content_details"); $thisTab.find("#tab_container").hide(); $thisTab.find("#tab_spinning_wheel").show(); - + + + var cmd; + if(g_supportELB == "guest") { + cmd = "command=listPublicIpAddresses&forvirtualnetwork=false&id="+publicipid; + } + else if(g_supportELB == "public") { + cmd = "command=listPublicIpAddresses&forvirtualnetwork=true&id="+publicipid; + } + else { + if(g_supportELB == null) + alert("supportELB should be either guest or public. It should not be null."); + else + alert("supportELB should be either guest or public. It should not be " + g_supportELB); + return; + } + $.ajax({ - data: createURL("command=listPublicIpAddresses&id="+id), + data: createURL(cmd), dataType: "json", async: false, success: function(json) {