mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
include client total ETA in upload logs
This commit is contained in:
parent
660705a436
commit
bfb3303d87
|
@ -983,10 +983,10 @@ quick outline of the up2k protocol, see [uploading](#uploading) for the web-clie
|
||||||
up2k has saved a few uploads from becoming corrupted in-transfer already; caught an android phone on wifi redhanded in wireshark with a bitflip, however bup with https would *probably* have noticed as well (thanks to tls also functioning as an integrity check)
|
up2k has saved a few uploads from becoming corrupted in-transfer already; caught an android phone on wifi redhanded in wireshark with a bitflip, however bup with https would *probably* have noticed as well (thanks to tls also functioning as an integrity check)
|
||||||
|
|
||||||
regarding the frequent server log message during uploads;
|
regarding the frequent server log message during uploads;
|
||||||
`6.0M 106M/s 2.77G 102.9M/s n948 thank 4/0/3/1 10042/7198`
|
`6.0M 106M/s 2.77G 102.9M/s n948 thank 4/0/3/1 10042/7198 00:01:09`
|
||||||
* this chunk was `6 MiB`, uploaded at `106 MiB/s`
|
* this chunk was `6 MiB`, uploaded at `106 MiB/s`
|
||||||
* on this http connection, `2.77 GiB` transferred, `102.9 MiB/s` average, `948` chunks handled
|
* on this http connection, `2.77 GiB` transferred, `102.9 MiB/s` average, `948` chunks handled
|
||||||
* client says `4` uploads OK, `0` failed, `3` busy, `1` queued, `10042 MiB` total size, `7198 MiB` left
|
* client says `4` uploads OK, `0` failed, `3` busy, `1` queued, `10042 MiB` total size, `7198 MiB` and `00:01:09` left
|
||||||
|
|
||||||
|
|
||||||
## why chunk-hashes
|
## why chunk-hashes
|
||||||
|
|
|
@ -835,6 +835,11 @@ function up2k_init(subtle) {
|
||||||
"uploading": 0,
|
"uploading": 0,
|
||||||
"busy": 0
|
"busy": 0
|
||||||
},
|
},
|
||||||
|
"eta": {
|
||||||
|
"h": "",
|
||||||
|
"u": "",
|
||||||
|
"t": ""
|
||||||
|
},
|
||||||
"car": 0,
|
"car": 0,
|
||||||
"modn": 0,
|
"modn": 0,
|
||||||
"modv": 0,
|
"modv": 0,
|
||||||
|
@ -1314,19 +1319,21 @@ function up2k_init(subtle) {
|
||||||
for (var a = 0; a < t.length; a++) {
|
for (var a = 0; a < t.length; a++) {
|
||||||
var rem = st.bytes.total - t[a][2],
|
var rem = st.bytes.total - t[a][2],
|
||||||
bps = t[a][1] / t[a][3],
|
bps = t[a][1] / t[a][3],
|
||||||
|
hid = t[a][0],
|
||||||
|
eid = hid.slice(-1),
|
||||||
eta = Math.floor(rem / bps);
|
eta = Math.floor(rem / bps);
|
||||||
|
|
||||||
if (t[a][1] < 1024 || t[a][3] < 0.1) {
|
if (t[a][1] < 1024 || t[a][3] < 0.1) {
|
||||||
ebi(t[a][0]).innerHTML = L.u_etaprep;
|
ebi(hid).innerHTML = L.u_etaprep;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
donut.eta = eta;
|
donut.eta = eta;
|
||||||
if (etaskip)
|
st.eta[eid] = '{0}, {1}/s, {2}'.format(
|
||||||
continue;
|
|
||||||
|
|
||||||
ebi(t[a][0]).innerHTML = '{0}, {1}/s, {2}'.format(
|
|
||||||
humansize(rem), humansize(bps, 1), humantime(eta));
|
humansize(rem), humansize(bps, 1), humantime(eta));
|
||||||
|
|
||||||
|
if (!etaskip)
|
||||||
|
ebi(hid).innerHTML = st.eta[eid];
|
||||||
}
|
}
|
||||||
if (++etaskip > 2)
|
if (++etaskip > 2)
|
||||||
etaskip = 0;
|
etaskip = 0;
|
||||||
|
@ -2138,8 +2145,9 @@ function up2k_init(subtle) {
|
||||||
xhr.open('POST', t.purl, true);
|
xhr.open('POST', t.purl, true);
|
||||||
xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
|
xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
|
||||||
xhr.setRequestHeader("X-Up2k-Wark", t.wark);
|
xhr.setRequestHeader("X-Up2k-Wark", t.wark);
|
||||||
xhr.setRequestHeader("X-Up2k-Stat", "{0}/{1}/{2}/{3} {4}/{5}".format(
|
xhr.setRequestHeader("X-Up2k-Stat", "{0}/{1}/{2}/{3} {4}/{5} {6}".format(
|
||||||
pvis.ctr.ok, pvis.ctr.ng, pvis.ctr.bz, pvis.ctr.q, btot, btot - bfin));
|
pvis.ctr.ok, pvis.ctr.ng, pvis.ctr.bz, pvis.ctr.q, btot, btot - bfin,
|
||||||
|
st.eta.t.split(' ').pop()));
|
||||||
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
|
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
|
||||||
if (xhr.overrideMimeType)
|
if (xhr.overrideMimeType)
|
||||||
xhr.overrideMimeType('Content-Type', 'application/octet-stream');
|
xhr.overrideMimeType('Content-Type', 'application/octet-stream');
|
||||||
|
|
Loading…
Reference in a new issue