From f6db0aa43fde5863b1c322873b0fc2cb53d4a68e Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 21 May 2012 10:46:21 -0700 Subject: [PATCH] CS-15015: cloudstack 3.0 UI - Volume page - Upload Volume action - API has been changed from sync to async. Here is related UI change. --- ui/scripts/storage.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index c98afd03129..36d4464595f 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -33,8 +33,8 @@ fields: { name: { label: 'label.name' }, type: { label: 'label.type' }, - hypervisor: { label: 'label.hypervisor' }, - vmdisplayname: { label: 'label.vm.display.name' }, + //hypervisor: { label: 'label.hypervisor' }, + //vmdisplayname: { label: 'label.vm.display.name' }, state: { label: 'State', indicator: { @@ -233,9 +233,20 @@ url: createURL("uploadVolume" + array1.join("")), dataType: "json", async: true, - success: function(json) { - var items = json.uploadvolumeresponse.volume; - args.response.success({data:items[0]}); + success: function(json) { + var jid = json.uploadvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); }, error: function(json) { args.response.error(parseXMLHttpResponse(json)); @@ -244,9 +255,7 @@ }, notification: { - poll: function(args) { - args.complete(); - } + poll: pollAsyncJobResult } }