From 0e62a3b46b25e7c101b14ed44235f3c276982fc0 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 19 Mar 2021 21:19:42 -0400 Subject: Sweeping changes to switch to bootstrap and make the UI overall a bit more user friendly --- cmd/web/static/main.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'cmd/web/static/main.js') diff --git a/cmd/web/static/main.js b/cmd/web/static/main.js index 55edf0c..b793be4 100644 --- a/cmd/web/static/main.js +++ b/cmd/web/static/main.js @@ -22,7 +22,8 @@ function formatDuration(dur) { } function setStatus(stat) { - var elem = document.getElementById("installBar"); + var barContainer = document.getElementById("installBarContainer"); + var elem = document.getElementById("installBar"); var msg = document.getElementById("message"); // console.log(stat) @@ -42,7 +43,9 @@ function setStatus(stat) { elem.style.width = percent + "%"; elem.innerHTML = percent + "%"; - elem.style.display = ""; + barContainer.style.display = ""; + + elem.ariaValueNow = percent; // in seconds var eta = Math.round(((stat.Size - trans)/1024/1024) / rate); @@ -56,8 +59,11 @@ function setStatus(stat) { if(!stat.Running && stat.Transferred >= 50 && stat.Error == null) { elem.style.width = 100 + "%"; elem.innerHTML = 100 + "%"; + elem.ariaValueNow = 100; + msg.innerHTML = "Completed install for: " + stat.Url; - elem.style.display = ""; + + barContainer.style.display = ""; msg.style.display = ""; } @@ -65,7 +71,7 @@ function setStatus(stat) { msg.innerHTML = "Errors encountered while installing from: \n\n" + stat.Url + "\n\n" + JSON.stringify(stat.Error, undefined, 2); - elem.style.display = "hidden"; + barContainer.style.display = "hidden"; msg.style.display = ""; } } -- cgit v1.2.3