Commit 1984f6c9 authored by Dimitris Moraitis's avatar Dimitris Moraitis
Browse files

fix wave in list view & minor css improvements - refs #293

parent f6f94d2e
......@@ -897,10 +897,10 @@ div.confirm_single button, div.confirm_multiple button, div.action_error button{
color: #3D3D3D;
cursor: pointer;
padding: 0px;
height: 20px !important;
}
div.confirm_single button, .action_error button {
height: 20px !important;
width: 80px !important;
}
div.confirm_single button.yes, div.confirm_multiple button.yes {
......@@ -941,7 +941,7 @@ div.action_error {
div.confirm_multiple {
width: 692px;
height: 25px;
height: 28px;
margin: 0 0 10px -32px;
}
......
......@@ -48,9 +48,9 @@
'501' : '{% trans "This server has not been implemented yet." %}',
// service unavailable
'503' : '{% trans "This service is unavailable right now, please try again later." %}',
// no images unavailable
// no images found
'NO_IMAGES' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
// no images unavailable
// no flavors found
'NO_FLAVORS' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}'
};
......
......@@ -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", imgStr;
var osIcon = osTag + ".png", imgStr, imgSrc;
// check if the server already exists in the datatable
tableData.forEach(function(row,index){
......@@ -189,36 +189,33 @@ function update_machines_view(data){
try {
console.info(server.name + ' from '
+ tableData[current][5] + ' to ' + STATUS_MESSAGES[server.status]);
} catch(err) {}
} catch(err) {}
if (server.status == "DELETED") {
vmTable.fnDeleteRow(current);
} else {
// update status
tableData[current][0] = "<input class="+server.status+" id="+server.id+" type=checkbox>";
} else { // server exists and should not be deleted
// check server status to select the appropriate OS icon
if (['ERROR', 'STOPPED'].indexOf(server.status) >= 0) {
osIcon = osTag + "-off.png";
}
if (tableData[current][5].indexOf(STATUS_MESSAGES[server.status]) > -1 ||
$('#'+server.id).parent().parent().find('.list-logo').attr('src').indexOf('wave')>-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>" + 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($('#'+server.id).parent().parent().find('.list-logo').attr, 2000,'src',imgStr);
//setTimeout("vmTable.fnUpdate('"+tableData[current]+"','"+current+"')",2000);
// if the new state does not differ from the previous one
if (tableData[current][5].indexOf(STATUS_MESSAGES[server.status]) > -1){
// do nothing
} else { // state has changed
//$('#'+server.id).parent().parent().find('.list-logo').attr('src').indexOf('wave')>-1){
imgSrc = "static/wave.gif";
tableData[current][0] = "<input class="+server.status+" id="+server.id+" type=checkbox>";
imgStr = "<img class=list-logo src=" + imgSrc + " title=" + osTag + " height=16 width=16 />";
tableData[current][1] = "<span class=imagetag>" + osTag + "</span>" + imgStr;
tableData[current][2] = "<a class=name><span class=name>" + server.name + "</span></a>";
tableData[current][3] = "<a class=ip><span class=public>"+ server.addresses.public.ip.addr + "</span></a>";
//tableData[current][4] = "group"; //TODO
tableData[current][5] = "<span class=status>" + STATUS_MESSAGES[server.status] + "</span>";
vmTable.fnUpdate(tableData[current],current);
//try{console.info('vm ' + server.id + ' from ' + tableData[current][5] + ' to ' + STATUS_MESSAGES[server.status])} catch(err) {}
setTimeout("$('#"+server.id+"').parent().parent().find('.list-logo').attr('src','static/os_logos/" + osIcon+"')", 2000);
}
}
updateActions();
} else if (server.status != "DELETED") { // does not exist, we should create it
......@@ -249,7 +246,7 @@ function update_machines_view(data){
}
// set confirm box position
if (window.innerHeight - 235 < $('#machinesview').height())
if (window.innerHeight - 200 < $('#machinesview').height())
$('.confirm_multiple').addClass('fixed');
else
$('.confirm_multiple').removeClass('fixed');
......
......@@ -447,7 +447,7 @@ if (flavors.length > 0) {
$("ul.tabs").tabs("div.panes ul");
$(window).resize(function(){
if (this.innerHeight - 240 < $('#machinesview').height())
if (this.innerHeight - 200 < $('#machinesview').height())
$('.confirm_multiple').addClass('fixed');
else
$('.confirm_multiple').removeClass('fixed');
......
......@@ -246,7 +246,7 @@ function update_machines_view(data){
}
// set confirm box position
if (window.innerHeight - 235 < $('#machinesview').height())
if (window.innerHeight - 200 < $('#machinesview').height())
$('.confirm_multiple').addClass('fixed');
else
$('.confirm_multiple').removeClass('fixed');
......
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