diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index e7bb0877..740119f9 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -311,7 +311,7 @@ class HttpCli(object): reader, _ = self.get_body_reader() for buf in reader: buf = buf.decode("utf-8", "replace") - self.log("urlform:\n {}\n".format(buf)) + self.log("urlform @ {}\n {}\n".format(self.vpath, buf)) if "get" in opt: return self.handle_get() diff --git a/copyparty/up2k.py b/copyparty/up2k.py index ed9ddc5a..d54708df 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -412,11 +412,11 @@ class Up2k(object): if job["need"]: self.log("unfinished:\n {0}\n {1}".format(src, dst)) err = "partial upload exists at a different location; please resume uploading here instead:\n" - err += vsrc + " " + err += "/" + vsrc + " " raise Pebkac(400, err) elif "nodupe" in job["flag"]: self.log("dupe-reject:\n {0}\n {1}".format(src, dst)) - err = "upload rejected, file already exists:\n " + vsrc + " " + err = "upload rejected, file already exists:\n/" + vsrc + " " raise Pebkac(400, err) else: # symlink to the client-provided name, @@ -644,14 +644,14 @@ class Up2k(object): while not self.lastmod_q.empty(): ready.append(self.lastmod_q.get()) - # self.log("lmod", "got {}".format(len(ready))) + # self.log("lmod: got {}".format(len(ready))) time.sleep(5) for path, times in ready: - self.log("lmod", "setting times {} on {}".format(times, path)) + self.log("lmod: setting times {} on {}".format(times, path)) try: os.utime(fsenc(path), times) except: - self.log("lmod", "failed to utime ({}, {})".format(path, times)) + self.log("lmod: failed to utime ({}, {})".format(path, times)) def _snapshot(self): persist_interval = 30 # persist unfinished uploads index every 30 sec diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index baedfa50..36506a5c 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -154,10 +154,12 @@ a, #srv_info span { color: #fff; } -a.play { +#files tbody a.play { color: #e70; + padding: .2em; + margin: -.2em; } -a.play.act { +#files tbody a.play.act { color: #af0; } #blocked { @@ -423,6 +425,8 @@ input[type="checkbox"]:checked+label { #detree { padding: .3em .5em; font-size: 1.5em; + display: inline-block; + width: 100%; } #treefiles #files tbody { border-radius: 0 .7em 0 .7em; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 03e45953..0e44218d 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -928,7 +928,7 @@ function autoplay_blocked() { })(); -function reload_browser() { +function reload_browser(not_mp) { makeSortable(ebi('files')); var parts = get_vpath().split('/'); @@ -945,10 +945,21 @@ function reload_browser() { ebi('path').appendChild(o); } - if (mp && mp.au) { - mp.au.pause(); - mp.au = null; + var oo = document.querySelectorAll('#files>tbody>tr>td:nth-child(3)'); + for (var a = 0, aa = oo.length; a < aa; a++) { + var sz = oo[a].textContent.replace(/ /g, ""), + hsz = sz.replace(/\B(?=(\d{3})+(?!\d))/g, " "); + + oo[a].textContent = hsz; + } + + if (!not_mp) { + if (mp && mp.au) { + mp.au.pause(); + mp.au = null; + } + widget.close(); + mp = init_mp(); } - widget.close(); - mp = init_mp(); } +reload_browser(true); diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 37da44cd..74ecf38f 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -151,10 +151,6 @@ function up2k_init(have_crypto) { ebi('u2notbtn').innerHTML = ''; } - var post_url = ebi('op_bup').getElementsByTagName('form')[0].getAttribute('action'); - if (post_url && post_url.charAt(post_url.length - 1) !== '/') - post_url += '/'; - var shame = 'your browser disables sha512 unless you use https' var is_https = (window.location + '').indexOf('https:') === 0; if (is_https) @@ -371,6 +367,7 @@ function up2k_init(have_crypto) { "name": fobj.name, "size": fobj.size, "lmod": lmod / 1000, + "purl": get_vpath(), "hash": [] }; @@ -385,7 +382,7 @@ function up2k_init(have_crypto) { var tr = document.createElement('tr'); tr.innerHTML = '