Skip to content

Commit 64776f3

Browse files
authored
Merge pull request #1852 from Accelerite/CLOUDSTACK-9695
CLOUDSTACK-9695: VM snapshot is disabled if the VM Instance is off
2 parents 3f6d27f + bd80c8e commit 64776f3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ui/scripts/instances.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
return true;
5151
}
5252
return false;
53+
},
54+
isDisabled: function(args){
55+
if(args.context.instances[0].state == 'Stopped'){
56+
return true;
57+
}
58+
return false;
5359
}
5460
},
5561
quiescevm: {

ui/scripts/ui/dialog.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,14 @@
637637
$input.attr('id', inputId);
638638
$name.find('label').attr('for', inputId);
639639

640-
if (field.isDisabled)
641-
$input.attr("disabled", "disabled");
640+
if(field.isDisabled ){
641+
if(typeof(field.isDisabled) == 'boolean' && field.isDisabled == true){
642+
$input.attr("disabled","disabled");
643+
}
644+
else if (typeof(field.isDisabled) == 'function' && field.isDisabled(args) == true){
645+
$input.attr("disabled","disabled");
646+
}
647+
}
642648

643649
// Tooltip
644650
if (field.docID) {

0 commit comments

Comments
 (0)