Commit 18ef8cf4 authored by Dimitris Moraitis's avatar Dimitris Moraitis
Browse files

display animation only once - Refs #293

parent 0add93c3
......@@ -518,7 +518,7 @@ div.machine {
div.machine div.actions {
float: right;
width: 70px;
margin:-60px -70px 0 0;
margin:0px -70px 0 0;
font-weight: normal;
}
......@@ -1151,7 +1151,10 @@ div.list table thead #name {
}
.wave {
background: url("../static/wave.gif") !important;
border: none;
margin: -5px 0px 0 0px !important;
float:right !important;
clear: both;
}
.hidden {
......
ui/static/wave.gif

4.7 KB | W: | H:

ui/static/wave.gif

4.79 KB | W: | H:

ui/static/wave.gif
ui/static/wave.gif
ui/static/wave.gif
ui/static/wave.gif
  • 2-up
  • Swipe
  • Onion skin
......@@ -175,7 +175,7 @@ function update_machines_view(data){
current = -1;
// check server status to select the appropriate OS icon
osTag = image_tags[server.imageRef]
var osIcon = osTag + ".png";
var osIcon = osTag + ".png", imgStr;
// check if the server already exists in the datatable
tableData.forEach(function(row,index){
......@@ -199,12 +199,24 @@ function update_machines_view(data){
if (['ERROR', 'STOPPED'].indexOf(server.status) >= 0) {
osIcon = osTag + "-off.png";
}
if (tableData[current][5].indexOf(STATUS_MESSAGES[server.status]) > -1){
imgStr = "<img class=list-logo src=static/os_logos/" + osIcon +
" title=" + osTag + " height=16 width=16 />";
} else {
imgStr = "<img class=list-logo src=static/wave.gif height=16 width=16 />";
}
tableData[current][1] = "<span class=imagetag>" + osTag +
"</span><img class=list-logo src=static/os_logos/" + osIcon +
" title=" + osTag + " height=16 width=16>";
"</span>" + imgStr;
tableData[current][5] = "<span class=status>" + STATUS_MESSAGES[server.status] + "</span>";
// TODO: update name & ip
vmTable.fnUpdate(tableData[current],current);
imgStr = "<img class=list-logo src=static/os_logos/" + osIcon +
" title=" + osTag + " height=16 width=16 />";
tableData[current][1] = "<span class=imagetag>" + osTag +
"</span>" + imgStr;
setTimeout(vmTable.fnUpdate,2000,tableData[current],current);
}
updateActions();
} else if (server.status != "DELETED") { // does not exist, we should create it
......@@ -236,8 +248,7 @@ function update_machines_view(data){
}
function display_success(serverID) {
//TODO
$('#'+serverID).parent().parent().find('.list-logo').attr('src','static/wave.gif');
// do nothing
}
// indicate that the requested action was not completed
......
......@@ -5,13 +5,20 @@
<div id="emptymachineslist">{% trans "You have no virtual machines! Press Create New to create some!" %}</div>
<div id="spinner"></div>
<div class="machine" id="machine-template" style="display:none">
<div class="actions">
<a href="#" class="action-start">{% trans "Start" %}</a>
<a href="#" class="action-reboot">{% trans "Reboot" %}</a>
<a href="#" class="action-shutdown">{% trans "Shutdown" %}</a>
<a href="#" class="more">{% trans "more &hellip;" %}</a>
</div>
<div class="state">
<div class="status">{% trans "Running" %}</div>
<div class="indicator"></div>
<div class="indicator"></div>
<div class="indicator"></div>
<div class="indicator"></div>
<div class="spinner hidden"></div>
<div class="spinner" style="display:none"></div>
<img class="wave" src="" />
</div>
<img class="logo" src="" />
<a href="#" class="name">
......@@ -23,12 +30,7 @@
<h5 class="settings">
{% trans "Show:" %} <a href="#">{% trans "disks" %}</a> | <a href="#">{% trans "networks" %}</a> | <a href="#">{% trans "group" %}</a>
</h5>
<div class="actions">
<a href="#" class="action-start">{% trans "Start" %}</a>
<a href="#" class="action-reboot">{% trans "Reboot" %}</a>
<a href="#" class="action-shutdown">{% trans "Shutdown" %}</a>
<a href="#" class="more">{% trans "more &hellip;" %}</a>
</div>
<div class="confirm_single">
<button class="yes">{% trans "Confirm" %}</button>
<button class="no">{% trans "Cancel" %}</button>
......@@ -201,7 +203,11 @@ function update_machines_view(data){
existing.remove();
existing = moved;
existing.find('.spinner').hide();
}
} else {
existing.find('.spinner').hide();
existing.find(' .wave').attr('src','static/wave.gif');
setTimeout("$('#" + server.id +" .wave').attr('src','')", 3000);
}
existing.find(".status").text(STATUS_MESSAGES[server.status]);
}
......@@ -243,8 +249,7 @@ function update_machines_view(data){
// indicate that the requested action was succesfully completed
function display_success(serverID) {
$('#'+serverID+ ' .spinner').addClass('wave');
setTimeout("$('#"+serverID+ " .spinner').hide();$('#"+serverID+ " .wave').removeClass('wave')", 5000);
}
// indicate that the requested action was not completed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment