Commit f1899ce5 authored by Christodoulos Psaltis's avatar Christodoulos Psaltis
Browse files

Fix if statements when loading list and icon view

parent 166a9294
......@@ -346,16 +346,18 @@ var vmTable = $("div.list table.list-machines").dataTable({
});
// basic functions executed on page load
if ( flavors.length == 0 || images.length == 0 ) {
if ( flavors.length == 0 ) {
// configure flavors, this also calls update_vms(UPDATE_INTERVAL)
update_flavors();
} else {
// populate image list
update_images();
// start updating vm list
update_vms(UPDATE_INTERVAL);
}
if ( flavors.length == 0 && images.length == 0 ) {
// configure flavors, this also calls update_vms(UPDATE_INTERVAL)
update_flavors();
// populate image list
update_images();
} else if ( flavors.length == 0 && images.length != 0 ) {
// configure flavors, this also calls update_vms(UPDATE_INTERVAL)
update_flavors();
} else if ( flavors.length != 0 && images.length == 0 ) {
// populate image list
update_images();
update_vms(UPDATE_INTERVAL);
} else {
// start updating vm list
update_vms(UPDATE_INTERVAL);
......
......@@ -397,16 +397,18 @@ function display_failure(status, serverID, action, responseText) {
}
// basic functions executed on page load
if ( flavors.length == 0 || images.length == 0 ) {
if ( flavors.length == 0 ) {
// configure flavors, this also calls update_vms(UPDATE_INTERVAL)
update_flavors();
} else {
// populate image list
update_images();
// start updating vm list
update_vms(UPDATE_INTERVAL);
}
if ( flavors.length == 0 && images.length == 0 ) {
// configure flavors, this also calls update_vms(UPDATE_INTERVAL)
update_flavors();
// populate image list
update_images();
} else if ( flavors.length == 0 && images.length != 0 ) {
// configure flavors, this also calls update_vms(UPDATE_INTERVAL)
update_flavors();
} else if ( flavors.length != 0 && images.length == 0 ) {
// populate image list
update_images();
update_vms(UPDATE_INTERVAL);
} else {
// start updating vm list
update_vms(UPDATE_INTERVAL);
......
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