From 82df9cfe1cc97a61157ca2ebe5dca72728b1febc Mon Sep 17 00:00:00 2001 From: pimeri Date: Fri, 1 Jun 2018 15:35:56 -0700 Subject: [PATCH 1/2] added a loader/spinner while data loads --- seadssite/static/css/dashboard.css | 19 +++++++++++++++++++ seadssite/static/js/device.js | 2 ++ seadssite/templates/device.html | 1 + 3 files changed, 22 insertions(+) diff --git a/seadssite/static/css/dashboard.css b/seadssite/static/css/dashboard.css index df4d1de..a5374b5 100755 --- a/seadssite/static/css/dashboard.css +++ b/seadssite/static/css/dashboard.css @@ -9,6 +9,25 @@ .page { display: none; } +#loader { + border: 16px solid #f3f3f3; /* Light grey */ + border-top: 16px solid #3498db; /* Blue */ + border-radius: 50%; + position: absolute; + margin: auto; + top: -400; left: 0; bottom: 0; right: 0; + /* display: block;*/ + width: 120px; + height: 120px; + animation: spin 1s linear infinite; + z-index: 10; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + #graphs_page { display: inline; diff --git a/seadssite/static/js/device.js b/seadssite/static/js/device.js index 85c3640..09ef340 100644 --- a/seadssite/static/js/device.js +++ b/seadssite/static/js/device.js @@ -164,6 +164,7 @@ var app = function () { } else result.push(null); } + return result; } @@ -183,6 +184,7 @@ var app = function () { }) } }); + document.getElementById("loader").style.display = "none" return result; } diff --git a/seadssite/templates/device.html b/seadssite/templates/device.html index 21edba5..59cf839 100644 --- a/seadssite/templates/device.html +++ b/seadssite/templates/device.html @@ -31,6 +31,7 @@

Please sign in to continue

}) {% else %} +