cloudstack 3.0 UI - "listPublicIpAddresses&id=N" API has been fixed to return a record. Here is related UI change.

This commit is contained in:
Jessica Wang 2012-07-18 11:12:49 -07:00
parent 9bebe245ca
commit ba7d0ba4f9
1 changed files with 6 additions and 7 deletions

View File

@ -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);