download-eta accuracy + misc ux

This commit is contained in:
ed 2021-08-26 00:40:12 +02:00
parent bc70cfa6f0
commit 6452e927ea
3 changed files with 19 additions and 13 deletions

View file

@ -1603,7 +1603,7 @@ html.light #bbox-overlay figcaption a {
border-radius: .5em;
border-width: .25em 0;
width: 17em;
text-align: left;
text-align: center;
white-space: nowrap;
display: inline-block;
font-family: 'scp', monospace, monospace;
@ -1618,10 +1618,13 @@ html.light #bbox-overlay figcaption a {
display: unset;
}
#u2etaw {
width: 21em;
width: 18em;
font-size: .94em;
margin: 2.5em auto 1em auto;
}
#u2etas.o #u2etaw {
width: 21em;
}
#u2cards {
padding: 1em 1em .3em 1em;
margin: 0 auto -1.5em auto;

View file

@ -103,9 +103,9 @@ ebi('op_up2k').innerHTML = (
'</div>\n' +
'<div id="u2etaw"><div id="u2etas"><div class="o">\n' +
' hash: <span id="u2etah" tt="average &lt;em&gt;hashing&lt;/em&gt; speed, and estimated time until finish">(nothing to do yet)</span><br />\n' +
' send: <span id="u2etau" tt="average &lt;em&gt;upload&lt;/em&gt; speed and estimated time until finish">(nothing to do yet)</span><br />\n' +
' </div><span class="o">task: </span><span id="u2etat" tt="average &lt;em&gt;total&lt;/em&gt; speed and estimated time until finish">(nothing to do yet)</span>\n' +
' hash: <span id="u2etah" tt="average &lt;em&gt;hashing&lt;/em&gt; speed, and estimated time until finish">(no uploads are queued yet)</span><br />\n' +
' send: <span id="u2etau" tt="average &lt;em&gt;upload&lt;/em&gt; speed and estimated time until finish">(no uploads are queued yet)</span><br />\n' +
' </div><span class="o">done: </span><span id="u2etat" tt="average &lt;em&gt;total&lt;/em&gt; speed and estimated time until finish">(no uploads are queued yet)</span>\n' +
'</div></div>\n' +
'<div id="u2cards">\n' +

View file

@ -903,6 +903,7 @@ function up2k_init(subtle) {
td = (now - (etaref || now)) / 1000.0;
etaref = now;
ebi('acc_info').innerHTML = st.time.busy.toFixed(1) + ' ' + (now / 1000).toFixed(1);
if (!nhash)
ebi('u2etah').innerHTML = 'Done ({0}, {1} files)'.format(humansize(st.bytes.hashed), pvis.ctr["ok"] + pvis.ctr["ng"]);
@ -920,23 +921,23 @@ function up2k_init(subtle) {
var t = [];
if (nhash) {
st.time.hashing += td;
t.push(['u2etah', st.bytes.hashed, st.time.hashing]);
t.push(['u2etah', st.bytes.hashed, st.bytes.hashed, st.time.hashing]);
}
if (nsend) {
st.time.uploading += td;
t.push(['u2etau', st.bytes.uploaded, st.time.uploading]);
t.push(['u2etau', st.bytes.uploaded, st.bytes.finished, st.time.uploading]);
}
if (nhash || nsend) {
st.time.busy += td;
t.push(['u2etat', st.bytes.finished, st.time.busy]);
t.push(['u2etat', st.bytes.finished, st.bytes.finished, st.time.busy]);
}
for (var a = 0; a < t.length; a++) {
var rem = st.bytes.total - t[a][1],
bps = t[a][1] / t[a][2],
var rem = st.bytes.total - t[a][2],
bps = t[a][1] / t[a][3],
eta = Math.floor(rem / bps);
if (t[a][1] < 1024 || t[a][2] < 0.1) {
ebi(t[a][0]).innerHTML = '(nothing to do yet)';
if (t[a][1] < 1024 || t[a][3] < 0.1) {
ebi(t[a][0]).innerHTML = '(no uploads are queued yet)';
continue;
}
@ -1058,8 +1059,10 @@ function up2k_init(subtle) {
etafun();
timer.rm(etafun);
}
else
else {
timer.add(etafun);
ebi('u2etas').style.textAlign = 'left';
}
}
if (flag) {