diff --git a/README.md b/README.md index 7d3bbfcf..4b03903b 100644 --- a/README.md +++ b/README.md @@ -481,6 +481,7 @@ see [up2k](#up2k) for details on how it works, or watch a [demo video](https://a the up2k UI is the epitome of polished inutitive experiences: * "parallel uploads" specifies how many chunks to upload at the same time * `[🏃]` analysis of other files should continue while one is uploading +* `[🥔]` shows a simpler UI for faster uploads from slow devices * `[💭]` ask for confirmation before files are added to the queue * `[🔎]` switch between upload and [file-search](#file-search) mode * ignore `[🔎]` if you add files by dragging them into the browser diff --git a/copyparty/__version__.py b/copyparty/__version__.py index 6bd41add..a8dc3982 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (1, 3, 5) +VERSION = (1, 3, 6) CODENAME = "god dag" -BUILD_DT = (2022, 7, 6) +BUILD_DT = (2022, 7, 16) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index cf4b11d7..34477de2 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -527,6 +527,11 @@ html.dy { --u2-tab-1-bg: a; --u2-b1-bg: #000; --u2-b2-bg: #000; + --u2-o-h-bg: #999; + --u2-o-1h-bg: #999; + --u2-o-bg: #eee; + --u2-o-1-bg: #000; + --ud-b1: a; --sort-1: a; diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index d6a3f9c7..c6547d55 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -393,7 +393,7 @@ function U2pvis(act, btns, uc, st) { // efficiency estimates; // ir: 5=16% 4=50%,30% 27=100% // ipu: 2.7=16% 2=30% 1.6=50% 1.8=100% (ng for big files) - if (ir <= 9 && r.tab.length >= 1000 && r.tab[Math.floor(r.tab.length / 3)].bt <= 1024 * 1024 * 4) + if (ipu >= 1.5 && ir <= 9 && r.tab.length >= 1000 && r.tab[Math.floor(r.tab.length / 3)].bt <= 1024 * 1024 * 4) r.go_potato(); } } @@ -1279,11 +1279,11 @@ function up2k_init(subtle) { } if (!nhash) - ebi('u2etah').innerHTML = L.u_etadone.format(humansize(st.bytes.hashed), pvis.ctr["ok"] + pvis.ctr["ng"]); + ebi('u2etah').innerHTML = L.u_etadone.format(humansize(st.bytes.hashed), pvis.ctr.ok + pvis.ctr.ng); if (!nsend && !nhash) ebi('u2etau').innerHTML = ebi('u2etat').innerHTML = ( - L.u_etadone.format(humansize(st.bytes.uploaded), pvis.ctr["ok"] + pvis.ctr["ng"])); + L.u_etadone.format(humansize(st.bytes.uploaded), pvis.ctr.ok + pvis.ctr.ng)); if (!st.busy.hash.length && !hashing_permitted()) nhash = 0; @@ -1431,25 +1431,7 @@ function up2k_init(subtle) { donut.on(is_busy); if (!is_busy) { - var sr = uc.fsearch, - ok = pvis.ctr["ok"], - ng = pvis.ctr["ng"], - t = uc.ask_up ? 0 : 10; - - if (ok && ng) - toast.warn(t, (sr ? L.ur_sm : L.ur_um).format(ok, ng)); - else if (ok > 1) - toast.ok(t, (sr ? L.ur_aso : L.ur_auo).format(ok)); - else if (ok) - toast.ok(t, sr ? L.ur_1so : L.ur_1uo); - else if (ng > 1) - toast.err(t, (sr ? L.ur_asn : L.ur_aun).format(ng)); - else if (ng) - toast.err(t, sr ? L.ur_1sn : L.ur_1un); - - timer.rm(etafun); - timer.rm(donut.do); - utw_minh = 0; + uptoast(); } else { timer.add(donut.do); @@ -1547,7 +1529,7 @@ function up2k_init(subtle) { // efficiency estimates; // ir: 8=16% 11=60% 16=90% 24=100% // ipu: 1=40% .8=60% .3=100% - if (ir <= 15) + if (ipu >= 0.5 && ir <= 15) pvis.go_potato(); } } @@ -1560,6 +1542,30 @@ function up2k_init(subtle) { return taskerd; })(); + function uptoast() { + var sr = uc.fsearch, + ok = pvis.ctr.ok, + ng = pvis.ctr.ng, + t = uc.ask_up ? 0 : 10; + + console.log('toast', ok, ng); + + if (ok && ng) + toast.warn(t, (sr ? L.ur_sm : L.ur_um).format(ok, ng)); + else if (ok > 1) + toast.ok(t, (sr ? L.ur_aso : L.ur_auo).format(ok)); + else if (ok) + toast.ok(t, sr ? L.ur_1so : L.ur_1uo); + else if (ng > 1) + toast.err(t, (sr ? L.ur_asn : L.ur_aun).format(ng)); + else if (ng) + toast.err(t, sr ? L.ur_1sn : L.ur_1un); + + timer.rm(etafun); + timer.rm(donut.do); + utw_minh = 0; + } + function chill(t) { var now = Date.now(); if ((t.coolmul || 0) < 2 || now - t.cooldown < t.coolmul * 700) @@ -1959,6 +1965,8 @@ function up2k_init(subtle) { f2f(spd1, 2), isNaN(spd2) ? '--' : f2f(spd2, 2))); pvis.move(t.n, 'ok'); + if (!pvis.ctr.bz && !pvis.ctr.q) + uptoast(); } else { if (t.t_uploaded)