From 69aed6fe0fd91ae13880d70f11895edcc06e97c1 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 10 Jan 2014 16:26:44 -0800 Subject: [PATCH] CLOUDSTACK-5831: UI > Volumes > take snapshot > get "quiescevm" property from listVolumes API instead of listStoragePools API since regular-user/domain-admin don't have access to listStoragePools API. --- ui/scripts/storage.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index e4cfff3d62a..1422904d01d 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -572,20 +572,10 @@ label: 'label.quiesce.vm', isBoolean: true, isHidden: function(args) { - var hidden = true; - $.ajax({ - url: createURL('listStoragePools&id='+args.context.volumes[0].storageid), - dataType: "json", - async: false, - success: function(json) { - if (json.liststoragepoolsresponse.storagepool[0].storagecapabilities.VOLUME_SNAPSHOT_QUIESCEVM == 'true') - hidden = false; - else - hidden = true; - } - }); - - return hidden; + if (args.context.volumes[0].quiescevm == true) + return false; + else + return true; } } } @@ -1744,8 +1734,7 @@ createForm: { title: 'label.action.create.volume', desc: '', - preFilter: function(args) { - debugger; + preFilter: function(args) { if (g_regionsecondaryenabled == true) { args.$form.find('.form-item[rel=zoneid]').css('display', 'inline-block'); } else {