Commit 6c7b0d9f authored by Mike Muzurakis's avatar Mike Muzurakis
Browse files

revert to standard view after destroying last VM, Refs #279

parent c42b5ed5
......@@ -679,11 +679,11 @@ function start(serverIDs){
// show the welcome screen
function showWelcome() {
$("#emptymachineslist").fadeIn("fast");
$("#createbody").fadeIn("fast");
$("#view-select").fadeOut("fast");
$("#createcontainer").addClass('emptycreatecontainer')
$("#create").addClass('emptycreate')
$("#view-select").fadeOut("fast");
$("#emptymachineslist").fadeIn("fast");
$("#createbody").fadeIn("fast");
$("#create").css("display", "block");
}
......
......@@ -202,7 +202,11 @@ function update_machines_view(data){
if (server.status == "DELETED") {
vmTable.fnDeleteRow(current);
// Reload the page to check if server list is empty
//location.reload(true);
console.info(tableData.length);
if (tableData.length == 1) {
$("#machinesview_content").fadeOut("fast")
standard_view();
}
} else { // when server is not be deleted, it should be updated
if (['BUILD','ACTIVE','REBOOT'].indexOf(server.status) >= 0 &&
[STATUS_MESSAGES['STOPPED'], STATUS_MESSAGES['ERROR'],
......@@ -296,15 +300,10 @@ function update_machines_view(data){
}
// show message in case user has no servers!
if (servers.length == 0) {
showWelcome();
$("#machinesview_content").fadeOut("fast")
standard_view();
} else {
if (servers.length > 0) {
hideWelcome();
$("#machinesview_content").fadeIn("fast")
}
}
// set confirm box position
if (window.innerHeight - 200 < $('#machinesview').height())
......
......@@ -234,7 +234,7 @@ function update_machines_view(data){
if (server.status == 'DELETED') {
existing.remove();
// Reload the page to check if server list is empty
//location.reload(true);
standard_view()
try {
console.info(existing.find("a.name span.name").text() + ' removed');
} catch(err) {}
......
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