mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4713: EIP/ELB Basic Zone: UI > Network > IP Addresses > make extra API call to get IPs allocated at guest network.
This commit is contained in:
parent
94e744fe0c
commit
47384e30cc
@ -2054,57 +2054,63 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var data = {};
|
var items = [];
|
||||||
listViewDataProvider(args, data);
|
var data = {};
|
||||||
|
listViewDataProvider(args, data);
|
||||||
//The following 10 lines caused CLOUDSTACK-4713 (EIP/ELB Basic Zone - unable to see any IPs that are acquired)
|
|
||||||
/*
|
|
||||||
if (g_supportELB == "guest") // IPs are allocated on guest network
|
|
||||||
$.extend(data, {
|
|
||||||
forvirtualnetwork: false,
|
|
||||||
forloadbalancing: true
|
|
||||||
});
|
|
||||||
else if (g_supportELB == "public") // IPs are allocated on public network
|
|
||||||
$.extend(data, {
|
|
||||||
forvirtualnetwork: true,
|
|
||||||
forloadbalancing: true
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (args.context.networks) {
|
if (args.context.networks) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
associatedNetworkId: args.context.networks[0].id
|
associatedNetworkId: args.context.networks[0].id
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("vpc" in args.context) {
|
if ("vpc" in args.context) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
vpcid: args.context.vpc[0].id
|
vpcid: args.context.vpc[0].id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listPublicIpAddresses'),
|
url: createURL('listPublicIpAddresses'),
|
||||||
data: data,
|
data: $.extend({}, data, {
|
||||||
|
forvirtualnetwork: true, //IPs are allocated on public network
|
||||||
|
}),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var items = json.listpublicipaddressesresponse.publicipaddress;
|
var ips = json.listpublicipaddressesresponse.publicipaddress;
|
||||||
|
if(ips != null) {
|
||||||
$(items).each(function() {
|
for(var i = 0; i < ips.length; i++) {
|
||||||
getExtaPropertiesForIpObj(this, args);
|
getExtaPropertiesForIpObj(ips[i], args);
|
||||||
});
|
items.push(ips[i]);
|
||||||
|
}
|
||||||
args.response.success({
|
}
|
||||||
actionFilter: actionFilters.ipAddress,
|
|
||||||
data: items
|
|
||||||
});
|
|
||||||
},
|
|
||||||
error: function(data) {
|
|
||||||
args.response.error(parseXMLHttpResponse(data));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (g_supportELB == "guest") {
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('listPublicIpAddresses'),
|
||||||
|
data: $.extend({}, data, {
|
||||||
|
forvirtualnetwork: false, // ELB IPs are allocated on guest network
|
||||||
|
forloadbalancing: true
|
||||||
|
}),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
var ips = json.listpublicipaddressesresponse.publicipaddress;
|
||||||
|
if(ips != null) {
|
||||||
|
for(var i = 0; i < ips.length; i++) {
|
||||||
|
getExtaPropertiesForIpObj(ips[i], args);
|
||||||
|
items.push(ips[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
args.response.success({
|
||||||
|
actionFilter: actionFilters.ipAddress,
|
||||||
|
data: items
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Detail view
|
// Detail view
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user