CLOUDSTACK-4189: UI > Infrastructure > zone > dedicatedZone object is different from zone object. Fix a bug that they were wrongly presumed to be the same object and wrongly mixed which caused zone object's properties being wrongly overriden.

This commit is contained in:
Jessica Wang 2013-08-09 18:45:47 -07:00
parent 71af0db668
commit b040bf224b
1 changed files with 14 additions and 8 deletions

View File

@ -6256,20 +6256,26 @@
success: function(json) {
selectedZoneObj = json.listzonesresponse.zone[0];
$.ajax({
url: createURL("listDedicatedZones&zoneid=" + args.context.physicalResources[0].id),
dataType: "json",
url: createURL('listDedicatedZones'),
data: {
zoneid: args.context.physicalResources[0].id
},
async: false,
success: function(json) {
success: function(json) {
if (json.listdedicatedzonesresponse.dedicatedzone != undefined) {
var zoneItem = json.listdedicatedzonesresponse.dedicatedzone[0];
if (zoneItem.domainid != null) {
$.extend(selectedZoneObj, zoneItem, {
isdedicated: 'Yes'
var dedicatedzoneObj = json.listdedicatedzonesresponse.dedicatedzone[0];
if (dedicatedzoneObj.domainid != null) {
$.extend(selectedZoneObj, {
isdedicated: 'Yes',
domainid: dedicatedzoneObj.domainid,
accountid: dedicatedzoneObj.accountid
});
}
} else {
$.extend(selectedZoneObj, {
isdedicated: 'No'
isdedicated: 'No',
domainid: null,
accountid: null
})
}
}