ginger-dev-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ginger-dev-list] [PATCH] Show 'progress' image while sensor monitor


From: Rodrigo Trujillo
Subject: Re: [Ginger-dev-list] [PATCH] Show 'progress' image while sensor monitor data is being retrieved
Date: Tue, 29 Sep 2015 17:58:20 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Almost there, test looks good!  Just a minor change below:

On 09/28/2015 04:32 PM, Socorro Stoppler wrote:
From: Socorro Stoppler <address@hidden>

Instead of a blank page, a progress image is now showing while data is being 
retrieved

Signed-off-by: Socorro Stoppler <address@hidden>
---
  ui/css/host-admin.css         | 6 ++++++
  ui/js/host-admin.js           | 3 +++
  ui/pages/host-admin.html.tmpl | 1 +
  3 files changed, 10 insertions(+)

diff --git a/ui/css/host-admin.css b/ui/css/host-admin.css
index bd4e913..8daee8d 100644
--- a/ui/css/host-admin.css
+++ b/ui/css/host-admin.css
@@ -78,6 +78,12 @@
      vertical-align: middle;
  }

+.ginger .host-admin .progress-icon-sensor {
+    background: url("base/images/progress48.gif") center no-repeat;
+    height: 50px;
+    margin-top: 20px;
+}
+
  .ginger .host-admin input.invalid-field[type="text"] {
      border: 1px solid #FF4444 !important;
      padding: 2px;
diff --git a/ui/js/host-admin.js b/ui/js/host-admin.js
index 4fa378e..cd127ff 100644
--- a/ui/js/host-admin.js
+++ b/ui/js/host-admin.js
@@ -451,9 +451,11 @@ ginger.initSANAdapter = function(){

  ginger.listSensors = function() {
      ginger.getSensors(function(result) {
+        $(".progress-icon-sensor").show();
Please, move this "show" line before the getSensors function call. Because we want to make sure that
the icon is going to be showed while we wait for the answer.
          if($(".ginger .host-admin .sensor-inline").length > 0) {
              $(".ginger .host-admin .sensor-inline").remove();
          }
+        $(".progress-icon-sensor").hide();
          $.each(result, function(i1, d1) {
              if(d1 && d1 != null && i1 != "hdds") {
                  $.each(d1, function(i2, d2) {
@@ -496,6 +498,7 @@ ginger.listSensors = function() {
                      });
                  }
              }
+        $(".progress-icon-sensor").hide();
          });
          setTimeout(ginger.listSensors, 5000);
      });
diff --git a/ui/pages/host-admin.html.tmpl b/ui/pages/host-admin.html.tmpl
index 29c3d34..dd49945 100644
--- a/ui/pages/host-admin.html.tmpl
+++ b/ui/pages/host-admin.html.tmpl
@@ -112,6 +112,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
MA  02110-1301  USA
      </div>
      <h3 class="sensors-ppc-enabled">$_("Sensor Monitor")</h3>
      <div class="content-area sensor-panel">
+        <div class="progress-icon-sensor"></div>
      </div>
      <h3 class="sep-ppc-enabled">$_("SEP Configuration")</h3>
      <div class="content-area subsc-manage">




reply via email to

[Prev in Thread] Current Thread [Next in Thread]