Revision 336ddd59
b/snf-cyclades-app/synnefo/ui/static/snf/css/main.css | ||
---|---|---|
4833 | 4833 |
} |
4834 | 4834 |
|
4835 | 4835 |
#loading-view { |
4836 |
width: 600px;
|
|
4836 |
width: 400px;
|
|
4837 | 4837 |
margin: 0 auto; |
4838 | 4838 |
padding: 20px 0; |
4839 | 4839 |
font-size: 0.8em; |
4840 | 4840 |
} |
4841 | 4841 |
|
4842 |
#loading-view .header.off { |
|
4843 |
color: #829096; |
|
4844 |
} |
|
4845 |
|
|
4846 |
#loading-view .header.on { |
|
4847 |
color: #fff; |
|
4848 |
background-image: url("../images/icons/indicators/small/progress.gif"); |
|
4849 |
} |
|
4850 |
|
|
4851 |
#loading-view .header.done { |
|
4852 |
color: #2B6681; |
|
4853 |
background-image: url("../images/check.png"); |
|
4854 |
} |
|
4855 |
|
|
4856 |
#loading-view .header { |
|
4857 |
font-size: 0.9em; |
|
4858 |
text-align: left; |
|
4859 |
border-bottom: 1px solid #578BA3; |
|
4860 |
margin-bottom: 10px; |
|
4861 |
padding-bottom: 6px; |
|
4862 |
background-repeat: no-repeat; |
|
4863 |
background-position: 380px 0px; |
|
4864 |
} |
|
4865 |
|
|
4842 | 4866 |
#loading-view .header span { |
4843 | 4867 |
font-weight: bold; |
4844 | 4868 |
color: #4085A5; |
b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js | ||
---|---|---|
2119 | 2119 |
opts = _.extend(opts, extra); |
2120 | 2120 |
|
2121 | 2121 |
this.api_call(this.path, "create", {'server': opts}, undefined, undefined, callback, {critical: true}); |
2122 |
}, |
|
2123 |
|
|
2124 |
load_missing_images: function(callback) { |
|
2125 |
var missing_ids = []; |
|
2126 |
this.each(function(el) { |
|
2127 |
var imgid = el.get("imageRef"); |
|
2128 |
var existing = synnefo.storage.images.get(imgid); |
|
2129 |
if (!existing && missing_ids.indexOf(imgid) == -1) { |
|
2130 |
missing_ids.push(imgid); |
|
2131 |
synnefo.storage.images.update_unknown_id(imgid, function(){}); |
|
2132 |
} |
|
2133 |
}); |
|
2134 |
callback(missing_ids); |
|
2122 | 2135 |
} |
2123 | 2136 |
|
2124 | 2137 |
}) |
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() { |
b/snf-cyclades-app/synnefo/ui/templates/home.html | ||
---|---|---|
557 | 557 |
</div> |
558 | 558 |
</div> |
559 | 559 |
|
560 |
<div id="loading-view" class="hidden"> |
|
561 |
<img src="{{ SYNNEFO_IMAGES_URL }}icons/indicators/small/progress.gif" /> |
|
562 |
<div class="header">Loading <span>~okeanos</span></div> |
|
563 |
<div class="info hidden"></div> |
|
560 |
<div id="loading-view" class="hidden clearfix"> |
|
561 |
<div class="header clearfix images off">Loading images...<span></span></div> |
|
562 |
<div class="header clearfix flavors off">Loading flavors...<span></span></div> |
|
563 |
<div class="header clearfix vms off">Loading machines...<span></span></div> |
|
564 |
<div class="header clearfix networks off">Loading networks...<span></span></div> |
|
565 |
<div class="header clearfix layout off">Rendering layout...<span></span></div> |
|
564 | 566 |
</div> |
565 | 567 |
<div id="user_public_keys" class="overlay-content overlay-content hidden"> |
566 | 568 |
{% include "userdata/public_keys_view.html" %} |
Also available in: Unified diff