From 08c12518a72071d52ef85ea7279023813b2640bc Mon Sep 17 00:00:00 2001
From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com>
Date: Tue, 18 Jan 2022 13:04:46 +0800
Subject: [PATCH] show upload progress in table background
---
theme/classic.html | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/theme/classic.html b/theme/classic.html
index 83ae3fb..312d52d 100644
--- a/theme/classic.html
+++ b/theme/classic.html
@@ -1057,7 +1057,9 @@
let tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
lastCurrentSpeed = tmpspeed;
let remaintime = (totalsize-asize-e.loaded)/tmpspeed;
- label.innerHTML=StartStr+' ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% :'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s
'+size_format(tmpspeed)+'/s '+seconds2hour(remaintime.toFixed(1));
+ let percent = ((asize+e.loaded)*100/totalsize).toFixed(2);
+ label.parentNode.style.background = "linear-gradient(to right, rgba(0,0,0,25%) " + percent + "%, rgba(0,0,0,0%) 0%)";
+ label.innerHTML = StartStr+' ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + percent + '% :'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s
'+size_format(tmpspeed)+'/s '+seconds2hour(remaintime.toFixed(1));
}
}
var C_starttime = new Date();
@@ -1086,7 +1088,7 @@
while (filename.indexOf('%2F')>0) filename = filename.replace('%2F', '/');
document.getElementById('upfile_td1_'+tdnum).innerHTML='