Revision 13925182

b/snf-cyclades-app/synnefo/ui/static/snf/css/main.css
876 876
}
877 877

  
878 878
.icon .machine-info {
879
    padding: 10px 0;
879
    padding: 20px 0;
880 880
}
881 881

  
882 882
.icon .machine-details .name {
......
913 913

  
914 914
.icon .vm-actions, .network .vm-actions {
915 915
    width: 180px;
916
    height: 76px;
916
    height: 96px;
917 917
    float: left;
918 918
}
919 919

  
......
970 970
div.list div.actions a.enabled.destroy {
971 971
}
972 972

  
973
.vm-actions .action-container.inactive a {
974
  color: #aaa;
975
}
976

  
977
.vm-actions .action-container.inactive a:hover{
978
  background-color: transparent !important;
979
  border: none !important;
980
  padding-left: 8px;
981
}
982

  
973 983
.vm-actions .action-container.destroy {
974 984
    position: absolute;
975 985
    bottom: -1px;
......
1070 1080
    display: none;
1071 1081
    left: -3px;
1072 1082
    position: absolute;
1073
    top: 9px;
1083
    top: 22px;
1074 1084
}
1075 1085

  
1076 1086
div.connect-arrow:hover, div.connect-arrow.border-hover, div.connect-arrow-ie, div.connect-arrow.border-ie {
......
1098 1108
    display: none;
1099 1109
    left: -15px;
1100 1110
    position: absolute;
1101
    top: 9px;
1111
    top: 22px;
1102 1112
}
1103 1113

  
1104 1114
.standard .machine .logo {
......
3561 3571

  
3562 3572
.single .single-actions {
3563 3573
    width: 150px;
3564
    height: 60px;
3574
    height: 77px;
3565 3575
    margin-bottom: 45px;
3566 3576
    margin-left: -10px;
3567 3577
}
......
4099 4109
div.state .start, tbody.machines .start {
4100 4110
    background-image: url("../images/icons/actions/medium/start.png");
4101 4111
}
4112
div.state .resize, tbody.machines .resize {
4113
    background-image: url("../images/icons/actions/medium/resize.png");
4114
}
4102 4115
div.state .reboot, tbody.machines .reboot {
4103 4116
    background-image: url("../images/icons/actions/medium/reboot.png");
4104 4117
}
b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js
1556 1556
        'UNKNWON'       : ['destroy'],
1557 1557
        'BUILD'         : ['destroy'],
1558 1558
        'REBOOT'        : ['destroy'],
1559
        'STOPPED'       : ['start', 'destroy'],
1560
        'ACTIVE'        : ['shutdown', 'destroy', 'reboot', 'console'],
1559
        'STOPPED'       : ['start', 'destroy', 'resize'],
1560
        'ACTIVE'        : ['shutdown', 'destroy', 'reboot', 'console', 'resize'],
1561 1561
        'ERROR'         : ['destroy'],
1562 1562
        'DELETED'       : ['destroy'],
1563 1563
        'DESTROY'       : ['destroy'],
......
1567 1567
        'DISCONNECT'    : ['destroy'],
1568 1568
        'RESIZE'        : ['destroy']
1569 1569
    }
1570
    
1571
    models.VM.AVAILABLE_ACTIONS_INACTIVE = {
1572
      'resize': ['ACTIVE']
1573
    }
1570 1574

  
1571 1575
    // api status values
1572 1576
    models.VM.STATUSES = [
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

  
b/snf-cyclades-app/synnefo/ui/templates/partials/machines_icon.html
135 135
                        <button class="no">X</button>
136 136
                    </div>
137 137
                </div>
138
                <div class="action-container resize">
139
                    <a href="#" class="action-resize">{% trans "Resize" %}</a>
140
                    <div class="confirm_single">
141
                        <button class="yes">{% trans "Confirm" %}</button>
142
                        <button class="no">X</button>
143
                    </div>
144
                </div>
138 145
                <div class="action-container destroy">
139 146
                    <a href="#" class="action-destroy">{% trans "Destroy" %}</a>
140 147
                    <div class="confirm_single">
b/snf-cyclades-app/synnefo/ui/templates/partials/machines_single.html
100 100
                            <button class="no">X</button>
101 101
                        </div>
102 102
                    </div>
103
                    <div class="action-container resize">
104
                        <a class="single-action action-resize">{% trans "Resize" %}</a>
105
                        <div class="confirm_single">
106
                            <button class="yes">{% trans "Confirm" %}</button>
107
                            <button class="no">X</button>
108
                        </div>
109
                    </div>
103 110
                    <div class="action-container destroy">
104 111
                        <a class="single-action action-destroy">{% trans "Destroy" %}</a>
105 112
                        <div class="confirm_single">

Also available in: Unified diff