diff --git a/ui/scripts/cloud.core.diskoffering.js b/ui/scripts/cloud.core.diskoffering.js index d2a2681c735..52e00cdfeb0 100644 --- a/ui/scripts/cloud.core.diskoffering.js +++ b/ui/scripts/cloud.core.diskoffering.js @@ -90,7 +90,7 @@ function initAddDiskOfferingButton($midmenuAddLink1) { data: createURL("command=createDiskOffering&isMirrored=false" + array1.join("")), dataType: "json", success: function(json) { - var item = json.creatediskofferingresponse; + var item = json.creatediskofferingresponse.diskoffering; diskOfferingToMidmenu(item, $midmenuItem1); bindClickToMidMenu($midmenuItem1, diskOfferingToRightPanel, getMidmenuId); afterAddingMidMenuItem($midmenuItem1, true); @@ -150,17 +150,7 @@ function doEditDiskOffering2($actionLink, $detailsTab, $midmenuItem1, $readonlyF data: createURL("command=updateDiskOffering&id="+id+array1.join("")), dataType: "json", success: function(json) { - //call listDiskOffering before bug 6502(What updateDiskOffering API returns should include an embedded object) is fixed. - var jsonObj; - $.ajax({ - data: createURL("command=listDiskOfferings&id="+id), - dataType: "json", - async: false, - success: function(json) { - jsonObj = json.listdiskofferingsresponse.diskoffering[0]; - } - }); - var $midmenuItem1 = $("#"+getMidmenuId(jsonObj)); + var $midmenuItem1 = $("#"+getMidmenuId(json.updatediskofferingresponse.diskoffering)); diskOfferingToMidmenu(jsonObj, $midmenuItem1); diskOfferingToRightPanel($midmenuItem1); diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index ff064c2ef52..0c99d338bd5 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -534,7 +534,7 @@ function doEditPod2($actionLink, $detailsTab, $midmenuItem1, $readonlyFields, $e data: createURL("command=updatePod"+array1.join("")), dataType: "json", success: function(json) { - var item = json.updatepodresponse; + var item = json.updatepodresponse.pod; $midmenuItem1.data("jsonObj", item); podJsonToRightPanel($midmenuItem1); diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index a6d2089c111..13377cd0f82 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -341,7 +341,7 @@ function initUpdateConsoleCertButton($midMenuAddLink2) { $thisDialog.dialog("close"); // TODO: Add a confirmation message } else if (result.jobstatus == 2) { // Failed - var errorMsg = result.jobresult.uploadcustomcertificateresponse.errortext; + var errorMsg = result.jobresult.errortext; $thisDialog.find("#info_container").text(errorMsg).show(); } } @@ -472,7 +472,7 @@ function initAddZoneButton($midmenuAddLink1) { $zoneTree.prepend(template); template.fadeIn("slow"); - var item = json.createzoneresponse; + var item = json.createzoneresponse.zone; zoneJSONToTreeNode(item, template); }, error: function(XMLHttpResponse) { diff --git a/ui/scripts/cloud.core.serviceoffering.js b/ui/scripts/cloud.core.serviceoffering.js index e8eede18816..aab71c9a2b4 100644 --- a/ui/scripts/cloud.core.serviceoffering.js +++ b/ui/scripts/cloud.core.serviceoffering.js @@ -90,7 +90,7 @@ function afterLoadServiceOfferingJSP() { data: createURL("command=createServiceOffering"+array1.join("")+"&response=json"), dataType: "json", success: function(json) { - var item = json.createserviceofferingresponse; + var item = json.createserviceofferingresponse.serviceoffering; serviceOfferingToMidmenu(item, $midmenuItem1); bindClickToMidMenu($midmenuItem1, serviceOfferingToRightPanel, getMidmenuId); afterAddingMidMenuItem($midmenuItem1, true); @@ -153,7 +153,7 @@ function doEditServiceOffering2($actionLink, $detailsTab, $midmenuItem1, $readon data: createURL("command=updateServiceOffering&id="+id+array1.join("")), dataType: "json", success: function(json) { - var jsonObj = json.updateserviceofferingresponse; + var jsonObj = json.updateserviceofferingresponse.serviceoffering; serviceOfferingToMidmenu(jsonObj, $midmenuItem1); serviceOfferingToRightPanel($midmenuItem1); diff --git a/ui/scripts/cloud.core.zone.js b/ui/scripts/cloud.core.zone.js index 388be00eb3f..c3eb95c3130 100644 --- a/ui/scripts/cloud.core.zone.js +++ b/ui/scripts/cloud.core.zone.js @@ -402,7 +402,7 @@ function initAddVLANButton($addButton) { else //virtual $template1.find("#vlan_type_icon").removeClass("direct").addClass("virtual"); - vlanJsonToTemplate(json.createvlaniprangeresponse, $template1); + vlanJsonToTemplate(json.createvlaniprangeresponse.vlaniprange, $template1); $vlanContainer.prepend($template1); $template1.fadeIn("slow"); }, @@ -523,7 +523,7 @@ function initAddPodButton($midmenuAddLink1) { $thisDialog.find("#spinning_wheel").hide(); $thisDialog.dialog("close"); - var item = json.createpodresponse; + var item = json.createpodresponse.pod; var template = $("#leftmenu_pod_node_template").clone(true); podJSONToTreeNode(item, template); var $zoneNode = $("#leftmenu_zone_tree").find("#tree_container").find("#zone_" + zoneObj.id); @@ -784,7 +784,7 @@ function doEditZone2($actionLink, $detailsTab, $midmenuItem1, $readonlyFields, $ data: createURL("command=updateZone"+moreCriteria.join("")), dataType: "json", success: function(json) { - var item = json.updatezoneresponse; + var item = json.updatezoneresponse.zone; $midmenuItem1.data("jsonObj", item); zoneJsonToRightPanel($midmenuItem1);