diff options
| author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-10 11:57:30 -0500 |
|---|---|---|
| committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-10 11:57:30 -0500 |
| commit | 89b7b2ae27cbab6a7edd5fa3759949afe2cd2f71 (patch) | |
| tree | e3d034d928a63f478ea705c083a3f74764e38d03 /deploy/index.html | |
| parent | e7dd6dbdf8d01cef390ff65c0948e5e70ac232cf (diff) | |
| parent | 80597c4780b1e8833d3742339836815d388356d2 (diff) | |
conflicts
Diffstat (limited to 'deploy/index.html')
| -rw-r--r-- | deploy/index.html | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/deploy/index.html b/deploy/index.html index f2eb5e2aa..dda0c6457 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -125,26 +125,15 @@ let load = getCookie("loadtime"); document.startLoad = Date.now(); console.log("Last Load = " + load); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "10%" - document.getElementById("dash-loader-text").innerHTML = "Loading Dash..." - }, load / 10); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "33%" - document.getElementById("dash-loader-text").innerHTML = "Preparing dashboards..." - }, load / 3); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "50%" - document.getElementById("dash-loader-text").innerHTML = "Initializing scripts..." - }, load / 2); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "75%" - document.getElementById("dash-loader-text").innerHTML = "Fetching documents..." - }, load / 4 * 3); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "100%" - document.getElementById("dash-loader-text").innerHTML = "Finalising setup..." - }, load); + let dashmesg = (width, msg) => { + if (document.getElementById("dash-progress")) document.getElementById("dash-progress").style.width = width + if (document.getElementById("dash-progress")) document.getElementById("dash-progress").innerHTML = msg + } + setTimeout(() => dashmesg("10%", "Loading Dash..."), load / 10); + setTimeout(() => dashmesg("33%", "Preparing dashboards..."), load / 3); + setTimeout(() => dashmesg("50%", "Initializing scripts..."), load / 2); + setTimeout(() => dashmesg("75%", "Fetching documents..."), load / 4 * 3); + setTimeout(() => dashmesg("100%", "Finalising setup..."), load); </script> </div> <div id="dash-loader-text" class="dash-loader-text"> |
