From 298af5d3f6de2758d4f2f814621adaa8b16a08af Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 23 Jun 2015 13:32:53 +0200 Subject: [PATCH] feature #3748: Add loading spinner until the page is loaded --- src/sunstone/public/app/app.js | 6 ++ src/sunstone/public/scss/app.scss | 19 +++++ src/sunstone/views/index.erb | 134 +++++++----------------------- 3 files changed, 53 insertions(+), 106 deletions(-) diff --git a/src/sunstone/public/app/app.js b/src/sunstone/public/app/app.js index 00371a3769..8865d637fc 100644 --- a/src/sunstone/public/app/app.js +++ b/src/sunstone/public/app/app.js @@ -56,6 +56,10 @@ define(function(require) { Sunstone.addMainTab(tab); }); + //$(window).load(function() { + // $('#loading').hide(); + //}); + $(document).ready(function() { Sunstone.insertTabs(); @@ -64,8 +68,10 @@ define(function(require) { if (Config.isTabEnabled(PROVISION_TAB_ID)) { Sunstone.showTab(PROVISION_TAB_ID); + $('#loading').hide(); } else if (Config.isTabEnabled(DASHBOARD_TAB_ID)) { Sunstone.showTab(DASHBOARD_TAB_ID); + $('#loading').hide(); } }); diff --git a/src/sunstone/public/scss/app.scss b/src/sunstone/public/scss/app.scss index 2bbe1ad479..a17cd5431c 100644 --- a/src/sunstone/public/scss/app.scss +++ b/src/sunstone/public/scss/app.scss @@ -1221,4 +1221,23 @@ hr { margin-left: 0px; margin-right: 0px; } +} + +#loading { + width: 100%; + height: 100%; + top: 0px; + left: 0px; + position: fixed; + display: block; + opacity: 0.7; + background-color: #fff; + z-index: 99; + text-align: center; +} + +#loading-content { + position: absolute; + top: 200px; + z-index: 100; } \ No newline at end of file diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index e536f316e7..d8ba86f843 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -1,96 +1,29 @@ - - - - - - + + OpenNebula Sunstone: Cloud Operations Center - - - - - + <% view = $views_config.view(session[:user], session[:user_gname], session[:default_view]) %> - - - - - - - - - - - - - - - + +
+ + + +
+
-
+
+
+
+