Skip to content

Commit 4b4fb1a

Browse files
author
Jessica Wang
committed
CLOUDSTACK-6852: UI - attach volume action - VM dropdown - populate options based on whether module is included and whether service is enabled.
1 parent f2a8082 commit 4b4fb1a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

ui/scripts/storage.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,14 @@
901901
});
902902
}
903903

904+
905+
var drModuleIncluded = isModuleIncluded("dr");
906+
var volumeDrEnabled = false;
907+
if (drModuleIncluded) {
908+
volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]);
909+
}
910+
911+
904912
$(['Running', 'Stopped']).each(function() {
905913
$.ajax({
906914
url: createURL('listVirtualMachines'),
@@ -911,10 +919,20 @@
911919
success: function(json) {
912920
var instanceObjs = json.listvirtualmachinesresponse.virtualmachine;
913921
$(instanceObjs).each(function() {
922+
if (drModuleIncluded) {
923+
var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this);
924+
if (vmDrEnabled == volumeDrEnabled) {
914925
items.push({
915926
id: this.id,
916927
description: this.displayname ? this.displayname : this.name
917928
});
929+
}
930+
} else {
931+
items.push({
932+
id: this.id,
933+
description: this.displayname ? this.displayname : this.name
934+
});
935+
}
918936
});
919937
}
920938
});

0 commit comments

Comments
 (0)