mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
better eta for fsearch
This commit is contained in:
parent
12986da147
commit
5099bc365d
|
@ -821,7 +821,7 @@ function up2k_init(subtle) {
|
||||||
for (var a = 0; a < good_files.length; a++) {
|
for (var a = 0; a < good_files.length; a++) {
|
||||||
var fobj = good_files[a][0],
|
var fobj = good_files[a][0],
|
||||||
name = good_files[a][1],
|
name = good_files[a][1],
|
||||||
fdir = get_evpath(),
|
fdir = evpath,
|
||||||
now = Date.now(),
|
now = Date.now(),
|
||||||
lmod = fobj.lastModified || now,
|
lmod = fobj.lastModified || now,
|
||||||
ofs = name.lastIndexOf('/') + 1;
|
ofs = name.lastIndexOf('/') + 1;
|
||||||
|
@ -925,22 +925,29 @@ function up2k_init(subtle) {
|
||||||
if (nhash) {
|
if (nhash) {
|
||||||
st.time.hashing += td;
|
st.time.hashing += td;
|
||||||
t.push(['u2etah', st.bytes.hashed, st.bytes.hashed, st.time.hashing]);
|
t.push(['u2etah', st.bytes.hashed, st.bytes.hashed, st.time.hashing]);
|
||||||
|
if (fsearch)
|
||||||
|
t.push(['u2etat', 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.bytes.finished, st.time.uploading]);
|
t.push(['u2etau', st.bytes.uploaded, st.bytes.finished, st.time.uploading]);
|
||||||
}
|
}
|
||||||
if (nhash || nsend) {
|
if ((nhash || nsend) && !fsearch) {
|
||||||
|
if (!st.bytes.finished) {
|
||||||
|
ebi('u2etat').innerHTML = '(preparing to upload)';
|
||||||
|
}
|
||||||
|
else {
|
||||||
st.time.busy += td;
|
st.time.busy += td;
|
||||||
t.push(['u2etat', st.bytes.finished, 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][2],
|
var rem = st.bytes.total - t[a][2],
|
||||||
bps = t[a][1] / t[a][3],
|
bps = t[a][1] / t[a][3],
|
||||||
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 = '(no uploads are queued yet)';
|
ebi(t[a][0]).innerHTML = '(preparing to upload)';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1065,7 +1072,7 @@ function up2k_init(subtle) {
|
||||||
timer.rm(etafun);
|
timer.rm(etafun);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
timer.add(etafun);
|
timer.add(etafun, false);
|
||||||
ebi('u2etas').style.textAlign = 'left';
|
ebi('u2etas').style.textAlign = 'left';
|
||||||
}
|
}
|
||||||
etafun();
|
etafun();
|
||||||
|
|
Loading…
Reference in a new issue