From b040bf224bacc0434671df062fa1e86d0ec880da Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 9 Aug 2013 18:45:47 -0700 Subject: [PATCH] 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. --- ui/scripts/system.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index f4bee5a27ad..3512958853f 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -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 }) } }