From bc70cfa6f00a55292de7ffd391aed65a56640fb8 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 25 Aug 2021 09:02:34 +0200 Subject: [PATCH] fix tmi --- copyparty/web/browser.css | 13 +++++++++++-- copyparty/web/browser.js | 5 +++-- copyparty/web/up2k.js | 19 ++++++++++++++++--- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 7f0adf80..e4db307d 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1602,12 +1602,21 @@ html.light #bbox-overlay figcaption a { padding: .2em .5em; border-radius: .5em; border-width: .25em 0; - width: 20em; + width: 17em; text-align: left; white-space: nowrap; display: inline-block; font-family: 'scp', monospace, monospace; } +#u2etas.o { + width: 20em; +} +#u2etas .o { + display: none; +} +#u2etas.o .o { + display: unset; +} #u2etaw { width: 21em; font-size: .94em; @@ -1627,7 +1636,7 @@ html.light #bbox-overlay figcaption a { #u2etaw.w { width: 52em; text-align: right; - margin: 3em auto -3em auto; + margin: 3em auto -2.7em auto; } #u2cards a { padding: .2em 1em; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index e661e659..66054b00 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -102,9 +102,10 @@ ebi('op_up2k').innerHTML = ( ' \n' + '\n' + - '
\n' + + '
\n' + ' hash: (nothing to do yet)
\n' + - ' send: (nothing to do yet)\n' + + ' send: (nothing to do yet)
\n' + + '
task: (nothing to do yet)\n' + '
\n' + '
\n' + diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 03b68d58..ffe83d6d 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -603,7 +603,8 @@ function up2k_init(subtle) { }, "time": { "hashing": 0, - "uploading": 0 + "uploading": 0, + "busy": 0 } }; @@ -907,13 +908,17 @@ function up2k_init(subtle) { ebi('u2etah').innerHTML = 'Done ({0}, {1} files)'.format(humansize(st.bytes.hashed), pvis.ctr["ok"] + pvis.ctr["ng"]); if (!nsend && !nhash) - ebi('u2etau').innerHTML = 'Done ({0}, {1} files)'.format(humansize(st.bytes.uploaded), pvis.ctr["ok"] + pvis.ctr["ng"]); + ebi('u2etau').innerHTML = ebi('u2etat').innerHTML = ( + 'Done ({0}, {1} files)'.format(humansize(st.bytes.uploaded), pvis.ctr["ok"] + pvis.ctr["ng"])); + + if (!st.busy.hash.length && !hashing_permitted()) + nhash = 0; if (!parallel_uploads || !(nhash + nsend)) return; var t = []; - if (nhash && (st.busy.hash.length || hashing_permitted())) { + if (nhash) { st.time.hashing += td; t.push(['u2etah', st.bytes.hashed, st.time.hashing]); } @@ -921,6 +926,10 @@ function up2k_init(subtle) { st.time.uploading += td; t.push(['u2etau', st.bytes.uploaded, st.time.uploading]); } + if (nhash || nsend) { + st.time.busy += td; + t.push(['u2etat', 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], @@ -1859,6 +1868,10 @@ function up2k_init(subtle) { for (var a = nodes.length - 1; a >= 0; a--) nodes[a].addEventListener('touchend', nop, false); + ebi('u2etas').onclick = function () { + clmod(ebi('u2etas'), 'o', 't'); + }; + set_fsearch(); bumpthread({ "target": 1 }); if (parallel_uploads < 1)