mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
download-eta accuracy + misc ux
This commit is contained in:
parent
bc70cfa6f0
commit
6452e927ea
|
@ -1603,7 +1603,7 @@ html.light #bbox-overlay figcaption a {
|
||||||
border-radius: .5em;
|
border-radius: .5em;
|
||||||
border-width: .25em 0;
|
border-width: .25em 0;
|
||||||
width: 17em;
|
width: 17em;
|
||||||
text-align: left;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-family: 'scp', monospace, monospace;
|
font-family: 'scp', monospace, monospace;
|
||||||
|
@ -1618,10 +1618,13 @@ html.light #bbox-overlay figcaption a {
|
||||||
display: unset;
|
display: unset;
|
||||||
}
|
}
|
||||||
#u2etaw {
|
#u2etaw {
|
||||||
width: 21em;
|
width: 18em;
|
||||||
font-size: .94em;
|
font-size: .94em;
|
||||||
margin: 2.5em auto 1em auto;
|
margin: 2.5em auto 1em auto;
|
||||||
}
|
}
|
||||||
|
#u2etas.o #u2etaw {
|
||||||
|
width: 21em;
|
||||||
|
}
|
||||||
#u2cards {
|
#u2cards {
|
||||||
padding: 1em 1em .3em 1em;
|
padding: 1em 1em .3em 1em;
|
||||||
margin: 0 auto -1.5em auto;
|
margin: 0 auto -1.5em auto;
|
||||||
|
|
|
@ -103,9 +103,9 @@ ebi('op_up2k').innerHTML = (
|
||||||
'</div>\n' +
|
'</div>\n' +
|
||||||
|
|
||||||
'<div id="u2etaw"><div id="u2etas"><div class="o">\n' +
|
'<div id="u2etaw"><div id="u2etas"><div class="o">\n' +
|
||||||
' hash: <span id="u2etah" tt="average <em>hashing</em> speed, and estimated time until finish">(nothing to do yet)</span><br />\n' +
|
' hash: <span id="u2etah" tt="average <em>hashing</em> speed, and estimated time until finish">(no uploads are queued yet)</span><br />\n' +
|
||||||
' send: <span id="u2etau" tt="average <em>upload</em> speed and estimated time until finish">(nothing to do yet)</span><br />\n' +
|
' send: <span id="u2etau" tt="average <em>upload</em> speed and estimated time until finish">(no uploads are queued yet)</span><br />\n' +
|
||||||
' </div><span class="o">task: </span><span id="u2etat" tt="average <em>total</em> speed and estimated time until finish">(nothing to do yet)</span>\n' +
|
' </div><span class="o">done: </span><span id="u2etat" tt="average <em>total</em> speed and estimated time until finish">(no uploads are queued yet)</span>\n' +
|
||||||
'</div></div>\n' +
|
'</div></div>\n' +
|
||||||
|
|
||||||
'<div id="u2cards">\n' +
|
'<div id="u2cards">\n' +
|
||||||
|
|
|
@ -903,6 +903,7 @@ function up2k_init(subtle) {
|
||||||
td = (now - (etaref || now)) / 1000.0;
|
td = (now - (etaref || now)) / 1000.0;
|
||||||
|
|
||||||
etaref = now;
|
etaref = now;
|
||||||
|
ebi('acc_info').innerHTML = st.time.busy.toFixed(1) + ' ' + (now / 1000).toFixed(1);
|
||||||
|
|
||||||
if (!nhash)
|
if (!nhash)
|
||||||
ebi('u2etah').innerHTML = 'Done ({0}, {1} files)'.format(humansize(st.bytes.hashed), pvis.ctr["ok"] + pvis.ctr["ng"]);
|
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 = [];
|
var t = [];
|
||||||
if (nhash) {
|
if (nhash) {
|
||||||
st.time.hashing += td;
|
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) {
|
if (nsend) {
|
||||||
st.time.uploading += td;
|
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) {
|
if (nhash || nsend) {
|
||||||
st.time.busy += td;
|
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++) {
|
for (var a = 0; a < t.length; a++) {
|
||||||
var rem = st.bytes.total - t[a][1],
|
var rem = st.bytes.total - t[a][2],
|
||||||
bps = t[a][1] / t[a][2],
|
bps = t[a][1] / t[a][3],
|
||||||
eta = Math.floor(rem / bps);
|
eta = Math.floor(rem / bps);
|
||||||
|
|
||||||
if (t[a][1] < 1024 || t[a][2] < 0.1) {
|
if (t[a][1] < 1024 || t[a][3] < 0.1) {
|
||||||
ebi(t[a][0]).innerHTML = '(nothing to do yet)';
|
ebi(t[a][0]).innerHTML = '(no uploads are queued yet)';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1058,8 +1059,10 @@ function up2k_init(subtle) {
|
||||||
etafun();
|
etafun();
|
||||||
timer.rm(etafun);
|
timer.rm(etafun);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
timer.add(etafun);
|
timer.add(etafun);
|
||||||
|
ebi('u2etas').style.textAlign = 'left';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
|
Loading…
Reference in a new issue