You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2014/06/05 22:49:34 UTC

git commit: updated refs/heads/master to 4b4fb1a

Repository: cloudstack
Updated Branches:
  refs/heads/master f2a8082a4 -> 4b4fb1ac9


CLOUDSTACK-6852: UI - attach volume action - VM dropdown - populate options based on whether module is included and whether service is enabled.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4b4fb1ac
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4b4fb1ac
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4b4fb1ac

Branch: refs/heads/master
Commit: 4b4fb1ac9008b0f69a0ef0ad8634ba06ccf206b1
Parents: f2a8082
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jun 5 13:44:57 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jun 5 13:49:19 2014 -0700

----------------------------------------------------------------------
 ui/scripts/storage.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b4fb1ac/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 12cfde8..32a6a7e 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
+                                                                    });
+                                                                }                                                                
                                                             });
                                                         }
                                                     });