290 |
290 |
// change the status text in cases where no api state exists
|
291 |
291 |
if (action[0] == start) {
|
292 |
292 |
$(this).parent().parent().find('.status').text(TRANSITIONS['Starting']);
|
293 |
|
$(this).parent().parent().find('.state').removeClass().addClass('state starting');
|
|
293 |
$(this).parent().parent().find('.state').removeClass().addClass('state starting-state');
|
294 |
294 |
$(this).parent().parent().find('.spinner').show();
|
295 |
295 |
} else if (action[0] == shutdown) {
|
296 |
296 |
$(this).parent().parent().find('.status').text(TRANSITIONS['Shutting down']);
|
297 |
|
$(this).parent().parent().find('.state').removeClass().addClass('state shutting');
|
|
297 |
$(this).parent().parent().find('.state').removeClass().addClass('state shutting-state');
|
298 |
298 |
$(this).parent().parent().find('.spinner').show();
|
299 |
299 |
} else if (action[0] == reboot) {
|
300 |
300 |
$(this).parent().parent().find('.status').text(TRANSITIONS['Rebooting']);
|
301 |
|
$(this).parent().parent().find('.state').removeClass().addClass('state rebooting');
|
|
301 |
$(this).parent().parent().find('.state').removeClass().addClass('state rebooting-state');
|
302 |
302 |
$(this).parent().parent().find('.spinner').show();
|
303 |
303 |
} else if (action[0] == destroy) {
|
304 |
304 |
$(this).parent().parent().find('.status').text(TRANSITIONS['Destroying']);
|
305 |
|
$(this).parent().parent().find('.state').removeClass().addClass('state destroying');
|
|
305 |
$(this).parent().parent().find('.state').removeClass().addClass('state destroying-state');
|
306 |
306 |
$(this).parent().parent().find('.spinner').show();
|
307 |
307 |
}
|
308 |
308 |
action[0]([action[1]]); // execute action
|
... | ... | |
410 |
410 |
existing.find(".status").text(STATUSES[server.status]);
|
411 |
411 |
existing.find('.spinner').hide();
|
412 |
412 |
existing.find(' .wave').attr('src','static/icons/indicators/medium/wave.gif').show();
|
|
413 |
existing.find('.state').removeClass().addClass('state running-state');
|
413 |
414 |
setTimeout("$('#" + server.id +" .wave').attr('src','').hide()", 3000);
|
414 |
415 |
}
|
415 |
416 |
else {
|
... | ... | |
424 |
425 |
existing.find(".status").text(STATUSES[server.status]);
|
425 |
426 |
existing.find('.spinner').hide();
|
426 |
427 |
existing.find(' .wave').attr('src','static/icons/indicators/medium/wave.gif').show();
|
|
428 |
existing.find('.state').removeClass().addClass('state running-state');
|
427 |
429 |
setTimeout("$('#" + server.id +" .wave').attr('src','').hide()", 3000);
|
428 |
430 |
}
|
429 |
431 |
else {
|
430 |
432 |
// in any other case just change the status and ignore spinners/waves
|
431 |
433 |
existing.find(".status").text(STATUSES[server.status]);
|
|
434 |
existing.appendTo("#machinesview-icon.standard .running");
|
|
435 |
existing.find('.state').removeClass().addClass('state running-state');
|
432 |
436 |
}
|
433 |
437 |
}
|
434 |
438 |
}
|