Revision 7af53e78 ui/templates/machines_single.html

b/ui/templates/machines_single.html
43 43
            <div class="column1">
44 44
                <div class='connect-border' title='{% trans 'Connect to machine' %}'></div>
45 45
                <div class='connect-arrow' title='{% trans 'Connect to machine' %}'></div>
46
                <img src="static/icons/machines/large/ubuntu-on.png" class="single-image" />
46
                <div class="single-image" />
47 47
                <div class="state">
48 48
                    <span class="state-label">{% trans "Running" %}</span>
49 49
                    <div class="indicators">
......
191 191
//hide the all of the tags contents
192 192
$("#machinesview-single.single .tags-content").hide();
193 193

  
194
// handle connect machine image states
195
$("div.connect-arrow, .single-image").live('mouseenter',
196
    function() {
197
        // ugly check to see if machine is running
198
        if ($(this).parent().find(".terminated-state").length > 0) { return };
199
        set_machine_os_image($(this).parent().parent(), "single", "hover", undefined, 1);
200
    });
201

  
202
$("div.connect-arrow, .single-image").live('mouseleave',
203
    function() {
204
        if ($(this).parent().find(".terminated-state").length > 0) { return };
205
        set_machine_os_image($(this).parent().parent(), "single", "hover", undefined, 1, "hover");
206
    });
207

  
208
$("div.connect-arrow, .single-image").live('mousedown',
209
    function() {
210
        if ($(this).parent().find(".terminated-state").length > 0) { return };
211
        set_machine_os_image($(this).parent().parent(), "single", "click", undefined, 1);
212
    });
213

  
214
$("div.connect-arrow, .single-image").live('mouseup',
215
    function() {
216
        if ($(this).parent().find(".terminated-state").length > 0) { return };
217
        set_machine_os_image($(this).parent().parent(), "single", "click", undefined, 1, "click");
218
    });
219

  
194 220
//toggle the component with class tags-content
195 221
$("#machinesview-single.single div.tags-header").live('click', function() {
196 222
    if ($(this).find('.toggler').hasClass('up')) {
......
445 471
                    INACTIVE_STATES.indexOf(STATUSES[server.status]) >= 0) {
446 472
                    // from an active state to an inactive one
447 473
                    log_server_status_change(existing, server.status);
448
                    existing.find("img.single-image").attr("src","static/icons/machines/large/" + server_image + '-off.png');
474
                    set_machine_os_image(existing, "single", "off", server_image);
449 475
                    existing.find(".column1 .state-label").text(STATUSES[server.status]);
450 476
                    existing.find(".connect-border").hide();
451 477
                    existing.find(".connect-arrow").hide();
......
458 484
                         ACTIVE_STATES.indexOf(STATUSES[server.status]) >= 0) {
459 485
                    // From an inactive state to an active one
460 486
                    log_server_status_change(existing, server.status);
461
                    existing.find("img.single-image").attr("src","static/icons/machines/large/" + server_image + '-on.png');
487
                    set_machine_os_image(existing, "single", "on", server_image);
462 488
                    existing.find(".column1 .state-label").text(STATUSES[server.status]);
463 489
                    existing.find(".connect-border").show();
464 490
                    existing.find(".connect-arrow").show();
......
512 538
            var machine = $("#machinesview-single.single #machine-container-template").clone().attr("id", server.id);
513 539
            machine.find(".scrollable").scrollable({vertical: true});
514 540
            machine.find(".machine-details div.name").text(server.name.substring(0,30));
515
            machine.find("img.single-image").attr("src","static/icons/machines/large/"+server_image+'-on.png');
541
            set_machine_os_image(machine, "single", "on", server_image);
516 542
            machine.find("span.imagetag").text(server_image);
517 543
            machine.find(".column1 .state-label").text(STATUSES[server.status]);
518 544
            // find and display flavor parameters
......
530 556
            machine.find(".machine-details div.ipv6").text(ips['ip6']);
531 557
            //show off image if server is not active
532 558
            if (['BUILD', 'ACTIVE', 'REBOOT'].indexOf(server.status) < 0){
533
                    machine.find("img.single-image").attr("src","static/icons/machines/large/"+server_image+'-off.png');
559
                    set_machine_os_image(machine, "single", "off", server_image);
534 560
                    machine.find(".connect-border").hide();
535 561
                    machine.find(".connect-arrow").hide();
536 562
                    machine.find(".column1 .state").removeClass().addClass("state terminated-state");

Also available in: Unified diff