mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
CLOUDSTACK-4142: listNetworkOfferings API has been changed to not return system-owned network offerings to regular user(domain user). This API change causes several UI bugs. Change UI to determine whether an IP Address has VPN service upon listNetworks API response instead of listNetworkOfferings API response.
This commit is contained in:
parent
f1c611ac60
commit
380a961664
@ -5977,9 +5977,37 @@
|
||||
}
|
||||
};
|
||||
|
||||
function getExtaPropertiesForIpObj(ipObj, args) {
|
||||
if ('networks' in args.context) { //from Guest Network section
|
||||
//get ipObj.networkOfferingConserveMode and ipObj.networkOfferingHavingVpnService from guest network's network offering
|
||||
function getExtaPropertiesForIpObj(ipObj, args) {
|
||||
if (!('vpc' in args.context)) { //from Guest Network section
|
||||
var services = args.context.networks[0].service;
|
||||
if(services != null) {
|
||||
for(var i = 0; i < services.length; i++) {
|
||||
var thisService = services[i];
|
||||
if (thisService.name == "Vpn") {
|
||||
ipObj.networkOfferingHavingVpnService = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ipObj.networkOfferingHavingVpnService == true) {
|
||||
$.ajax({
|
||||
url: createURL('listRemoteAccessVpns'),
|
||||
data: {
|
||||
listAll: true,
|
||||
publicipid: ipObj.id
|
||||
},
|
||||
async: false,
|
||||
success: function(vpnResponse) {
|
||||
var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
|
||||
if (isVPNEnabled) {
|
||||
ipObj.vpnenabled = true;
|
||||
ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//get ipObj.networkOfferingConserveMode and ipObj.networkOfferingHavingVpnService from guest network's network offering
|
||||
$.ajax({
|
||||
url: createURL('listNetworkOfferings'),
|
||||
data: {
|
||||
@ -5987,32 +6015,10 @@
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var networkOfferingObj = json.listnetworkofferingsresponse.networkoffering[0];
|
||||
ipObj.networkOfferingConserveMode = networkOfferingObj.conservemode;
|
||||
|
||||
$(networkOfferingObj.service).each(function() {
|
||||
var thisService = this;
|
||||
if (thisService.name == "Vpn")
|
||||
ipObj.networkOfferingHavingVpnService = true;
|
||||
});
|
||||
|
||||
if (ipObj.networkOfferingHavingVpnService == true) {
|
||||
$.ajax({
|
||||
url: createURL('listRemoteAccessVpns'),
|
||||
data: {
|
||||
listAll: true,
|
||||
publicipid: ipObj.id
|
||||
},
|
||||
async: false,
|
||||
success: function(vpnResponse) {
|
||||
var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
|
||||
if (isVPNEnabled) {
|
||||
ipObj.vpnenabled = true;
|
||||
ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
if(json.listnetworkofferingsresponse.networkoffering != null) {
|
||||
var networkOfferingObj = json.listnetworkofferingsresponse.networkoffering[0];
|
||||
ipObj.networkOfferingConserveMode = networkOfferingObj.conservemode;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else { //from VPC section
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user