From 929103b9dd36c0ae715e41a8b256586c82cce696 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 15 Nov 2010 15:28:21 -0800 Subject: [PATCH] bug 6922: related UI change after bug 7101 is fixed ("Bug 7101 - DetachISO API and AttachISO API should return an embedded object of virtualmachine, not an embedded object of ISO") --- ui/scripts/cloud.core.instance.js | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 508fabdb016..d7da82b4aa7 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -933,18 +933,8 @@ var vmActionMap = { asyncJobResponse: "attachisoresponse", inProcessText: "Attaching ISO....", dialogBeforeActionFn : doAttachISO, - afterActionSeccessFn: function(json, $midmenuItem1, id) { - //call listVirtualMachine to get embedded object until Bug 7101 is fixed ("Bug 7101 - DetachISO API and AttachISO API should return an embedded object of virtualmachine, not an embedded object of ISO") - var jsonObj; - $.ajax({ - data: createURL("command=listVirtualMachines&id="+id), - dataType: "json", - async: false, - success: function(json) { - jsonObj = json.listvirtualmachinesresponse.virtualmachine[0]; - } - }); - + afterActionSeccessFn: function(json, $midmenuItem1, id) { + var jsonObj = json.queryasyncjobresultresponse.jobresult.virtualmachine; vmToMidmenu(jsonObj, $midmenuItem1); vmToRightPanel($midmenuItem1); } @@ -955,17 +945,7 @@ var vmActionMap = { inProcessText: "Detaching ISO....", dialogBeforeActionFn : doDetachISO, afterActionSeccessFn: function(json, $midmenuItem1, id) { - //call listVirtualMachine to get embedded object until Bug 7101 is fixed ("Bug 7101 - DetachISO API and AttachISO API should return an embedded object of virtualmachine, not an embedded object of ISO") - var jsonObj; - $.ajax({ - data: createURL("command=listVirtualMachines&id="+id), - dataType: "json", - async: false, - success: function(json) { - jsonObj = json.listvirtualmachinesresponse.virtualmachine[0]; - } - }); - + var jsonObj = json.queryasyncjobresultresponse.jobresult.virtualmachine; vmToMidmenu(jsonObj, $midmenuItem1); vmToRightPanel($midmenuItem1); }