From 4b4fb1ac9008b0f69a0ef0ad8634ba06ccf206b1 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jun 2014 13:44:57 -0700 Subject: [PATCH] CLOUDSTACK-6852: UI - attach volume action - VM dropdown - populate options based on whether module is included and whether service is enabled. --- ui/scripts/storage.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 12cfde8892c..32a6a7e5df4 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -901,6 +901,14 @@ }); } + + var drModuleIncluded = isModuleIncluded("dr"); + var volumeDrEnabled = false; + if (drModuleIncluded) { + volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]); + } + + $(['Running', 'Stopped']).each(function() { $.ajax({ url: createURL('listVirtualMachines'), @@ -911,10 +919,20 @@ success: function(json) { var instanceObjs = json.listvirtualmachinesresponse.virtualmachine; $(instanceObjs).each(function() { + if (drModuleIncluded) { + var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this); + if (vmDrEnabled == volumeDrEnabled) { items.push({ id: this.id, description: this.displayname ? this.displayname : this.name }); + } + } else { + items.push({ + id: this.id, + description: this.displayname ? this.displayname : this.name + }); + } }); } });