From ba7d0ba4f9e9ef47aa653e2cc5416c0b3b8ce336 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 18 Jul 2012 11:12:49 -0700 Subject: [PATCH] cloudstack 3.0 UI - "listPublicIpAddresses&id=N" API has been fixed to return a record. Here is related UI change. --- ui/scripts/network.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index b323b7dec1a..baea2eec9a2 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1623,8 +1623,8 @@ }, dataType: "json", async: true, - success: function(json) { - var ipObj = items[0]; //because json.listpublicipaddressesresponse.publicipaddress is null (API bug). Use old info here until API is fixed. + success: function(json) { + var ipObj = json.listpublicipaddressesresponse.publicipaddress[0]; if('networks' in args.context) { //from Guest Network section //get ipObj.networkOfferingConserveMode and ipObj.networkOfferingHavingVpnService from guest network's network offering @@ -1966,7 +1966,8 @@ $.ajax({ url: createURL('listPublicIpAddresses'), data: { - id: args.context.ipAddresses[0].id + id: args.context.ipAddresses[0].id, + listAll: true }, dataType: 'json', async: true, @@ -2547,8 +2548,7 @@ listAll: true }, success: function(json) { - //var item = json.listpublicipaddressesresponse.publicipaddress[0]; //uncomment this line and delete the following line when "listPublicIpAddresses&id=N" is fixed to return a record. - var item = args.context.ipAddresses[0]; + var item = json.listpublicipaddressesresponse.publicipaddress[0]; args.context.ipAddresses.shift(); //remove the first element in args.context.ipAddresses args.context.ipAddresses.push(item); @@ -2827,8 +2827,7 @@ listAll: true }, success: function(json) { - //var item = json.listpublicipaddressesresponse.publicipaddress[0]; //uncomment this line and delete the following line when "listPublicIpAddresses&id=N" is fixed to return a record. - var item = args.context.ipAddresses[0]; + var item = json.listpublicipaddressesresponse.publicipaddress[0]; args.context.ipAddresses.shift(); //remove the first element in args.context.ipAddresses args.context.ipAddresses.push(item);