Revision 336ddd59 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_main_view.js
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_main_view.js | ||
---|---|---|
600 | 600 |
if (this.completed_items == 2) { |
601 | 601 |
this.load_nets_and_vms(); |
602 | 602 |
} |
603 |
|
|
604 | 603 |
if (this.completed_items == this.items_to_load) { |
605 |
this.update_status("Rendering layout...");
|
|
604 |
this.update_status("layout", 1);
|
|
606 | 605 |
var self = this; |
607 | 606 |
window.setTimeout(function(){ |
608 | 607 |
self.after_load(); |
609 | 608 |
}, 10) |
610 | 609 |
} |
611 | 610 |
}, |
611 |
|
|
612 |
load_missing_images: function(cb) { |
|
613 |
synnefo.storage.vms.load_missing_images(cb); |
|
614 |
}, |
|
612 | 615 |
|
613 | 616 |
load_nets_and_vms: function() { |
614 | 617 |
var self = this; |
615 |
this.update_status("Loading vms...");
|
|
618 |
this.update_status("vms", 0);
|
|
616 | 619 |
storage.vms.fetch({refresh:true, update:false, success: function(){ |
617 |
self.update_status("VMS Loaded."); |
|
618 |
self.check_status(); |
|
620 |
self.load_missing_images(function(){ |
|
621 |
self.update_status("vms", 1); |
|
622 |
self.update_status("layout", 0); |
|
623 |
self.check_status(); |
|
624 |
}); |
|
619 | 625 |
}}); |
620 | 626 |
|
621 |
this.update_status("Loading networks...");
|
|
627 |
this.update_status("networks", 0);
|
|
622 | 628 |
storage.networks.fetch({refresh:true, update:false, success: function(){ |
623 |
self.update_status("Networks loaded.");
|
|
629 |
self.update_status("networks", 1);
|
|
624 | 630 |
self.check_status(); |
625 | 631 |
}}); |
626 | 632 |
}, |
... | ... | |
664 | 670 |
|
665 | 671 |
after_load: function() { |
666 | 672 |
var self = this; |
667 |
this.update_status("Setting vms update interval..."); |
|
668 | 673 |
this.init_intervals(); |
669 | 674 |
this.update_intervals(); |
670 |
this.update_status("Showing initial view...");
|
|
675 |
this.update_status("layout", 0);
|
|
671 | 676 |
|
672 | 677 |
// bypass update_hidden_views in initial view |
673 | 678 |
// rendering to force all views to get render |
... | ... | |
678 | 683 |
snf.config.update_hidden_views = uhv; |
679 | 684 |
|
680 | 685 |
window.setTimeout(function() { |
681 |
self.update_status("Initializing overlays...");
|
|
686 |
self.update_status("layout", 0);
|
|
682 | 687 |
self.load_initialize_overlays(); |
683 | 688 |
}, 20); |
684 | 689 |
}, |
... | ... | |
717 | 722 |
// display loading message |
718 | 723 |
this.show_loading_view(); |
719 | 724 |
// sync load initial data |
720 |
this.update_status("Loading images...");
|
|
725 |
this.update_status("images", 0);
|
|
721 | 726 |
storage.images.fetch({refresh:true, update:false, success: function(){ |
727 |
self.update_status("images", 1); |
|
722 | 728 |
self.check_status() |
723 | 729 |
}}); |
724 |
this.update_status("Loading flavors...");
|
|
730 |
this.update_status("flavors", 0);
|
|
725 | 731 |
storage.flavors.fetch({refresh:true, update:false, success:function(){ |
732 |
self.update_status("flavors", 1); |
|
726 | 733 |
self.check_status() |
727 | 734 |
}}); |
728 | 735 |
}, |
729 | 736 |
|
730 |
update_status: function(msg) { |
|
731 |
//this.log.debug(msg) |
|
732 |
this.status = msg; |
|
733 |
$("#loading-view .info").removeClass("hidden") |
|
734 |
$("#loading-view .info").text(this.status); |
|
737 |
update_status: function(ns, state) { |
|
738 |
var el = $("#loading-view .header."+ns); |
|
739 |
if (state == 0) { |
|
740 |
el.removeClass("off").addClass("on"); |
|
741 |
} |
|
742 |
if (state == 1) { |
|
743 |
el.removeClass("on").addClass("done"); |
|
744 |
} |
|
735 | 745 |
}, |
736 | 746 |
|
737 | 747 |
initialize_views: function() { |
Also available in: Unified diff