Revision 13925182 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_vms_base_view.js
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_vms_base_view.js | ||
---|---|---|
551 | 551 |
_.each(models.VM.ACTIONS, function(action, index) { |
552 | 552 |
if (actions.indexOf(action) > -1) { |
553 | 553 |
this.action(action).removeClass("disabled"); |
554 |
var inactive = models.VM.AVAILABLE_ACTIONS_INACTIVE[action]; |
|
555 |
|
|
556 |
if (inactive && _.contains(inactive, this.vm.get('status'))) { |
|
557 |
this.action(action).addClass("inactive"); |
|
558 |
} else { |
|
559 |
this.action(action).removeClass("inactive"); |
|
560 |
} |
|
561 |
|
|
554 | 562 |
if (this.selected_action == action) { |
555 | 563 |
this.action_confirm_cont(action).css('display', 'block'); |
556 | 564 |
this.action_confirm(action).show(); |
... | ... | |
619 | 627 |
// action links click events |
620 | 628 |
$(this.el).find(".action-container."+action+" a").click(function(ev) { |
621 | 629 |
ev.preventDefault(); |
622 |
self.set(action); |
|
630 |
if ($(ev.currentTarget).parent().hasClass("inactive")) { |
|
631 |
return; |
|
632 |
} |
|
633 |
if (action == "resize") { |
|
634 |
ui.main.vm_resize_view.show(self.vm); |
|
635 |
} else { |
|
636 |
self.set(action); |
|
637 |
} |
|
623 | 638 |
}).data("action", action); |
624 | 639 |
|
625 | 640 |
// confirms |
... | ... | |
672 | 687 |
'shutdown': ['UNKOWN', 'ACTIVE', 'REBOOT'], |
673 | 688 |
'console': ['ACTIVE'], |
674 | 689 |
'start': ['UNKOWN', 'STOPPED'], |
690 |
'resize': ['UNKOWN', 'ACTIVE', 'STOPPED', 'REBOOT', 'ERROR', 'BUILD'], |
|
675 | 691 |
'destroy': ['UNKOWN', 'ACTIVE', 'STOPPED', 'REBOOT', 'ERROR', 'BUILD'] |
676 | 692 |
}; |
677 | 693 |
|
Also available in: Unified diff