diff --git a/copyparty/__version__.py b/copyparty/__version__.py index 5076f952..11c119fa 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (1, 3, 10) +VERSION = (1, 3, 11) CODENAME = "god dag" -BUILD_DT = (2022, 8, 4) +BUILD_DT = (2022, 8, 10) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/ftpd.py b/copyparty/ftpd.py index a47586de..17a2a4f2 100644 --- a/copyparty/ftpd.py +++ b/copyparty/ftpd.py @@ -391,7 +391,7 @@ class Ftpd(object): for h, lp in hs: FTPServer((ip, int(lp)), h, ioloop) - thr = threading.Thread(target=ioloop.loop) + thr = threading.Thread(target=ioloop.loop, name="ftp") thr.daemon = True thr.start() diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index 5ae5dcb8..3a35099a 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -102,7 +102,7 @@ class HttpSrv(object): start_log_thrs(self.log, self.args.log_thrs, nid) self.th_cfg: dict[str, Any] = {} - t = threading.Thread(target=self.post_init) + t = threading.Thread(target=self.post_init, name="hsrv-init2") t.daemon = True t.start() @@ -171,7 +171,7 @@ class HttpSrv(object): def fun() -> None: self.broker.say("cb_httpsrv_up") - threading.Thread(target=fun).start() + threading.Thread(target=fun, name="sig-hsrv-up1").start() while not self.stopping: if self.args.log_conn: diff --git a/copyparty/svchub.py b/copyparty/svchub.py index a70284f3..e10b52e2 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -269,7 +269,7 @@ class SvcHub(object): def run(self) -> None: self.tcpsrv.run() - thr = threading.Thread(target=self.thr_httpsrv_up) + thr = threading.Thread(target=self.thr_httpsrv_up, name="sig-hsrv-up2") thr.daemon = True thr.start() @@ -308,7 +308,7 @@ class SvcHub(object): return "cannot reload; already in progress" self.reloading = True - t = threading.Thread(target=self._reload) + t = threading.Thread(target=self._reload, name="reloading") t.daemon = True t.start() return "reload initiated" diff --git a/copyparty/util.py b/copyparty/util.py index 0138b868..61d37a2e 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -509,8 +509,8 @@ class MTHash(object): self.work_q: Queue[int] = Queue() self.done_q: Queue[tuple[int, str, int, int]] = Queue() self.thrs = [] - for _ in range(cores): - t = threading.Thread(target=self.worker) + for n in range(cores): + t = threading.Thread(target=self.worker, name="mth-" + str(n)) t.daemon = True t.start() self.thrs.append(t) @@ -1390,7 +1390,7 @@ def db_ex_chk(log: "NamedLogger", ex: Exception, db_path: str) -> bool: if str(ex) != "database is locked": return False - thr = threading.Thread(target=lsof, args=(log, db_path)) + thr = threading.Thread(target=lsof, args=(log, db_path), name="dbex") thr.daemon = True thr.start() diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 8021ca1e..81cca653 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -504,7 +504,7 @@ html.dy { --a: #000; --a-b: #000; --a-hil: #000; - --a-gray: #000; + --a-gray: #bbb; --a-dark: #000; --btn-fg: #000; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 548d411a..9d209aaf 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4652,9 +4652,9 @@ var treectl = (function () { return ta[a]; }; - r.goto = function (url, push) { + r.goto = function (url, push, back) { get_tree("", url, true); - r.reqls(url, push, true); + r.reqls(url, push, true, back); }; function get_tree(top, dst, rst) { @@ -4823,9 +4823,10 @@ var treectl = (function () { thegrid.setvis(true); } - r.reqls = function (url, hpush, no_tree) { + r.reqls = function (url, hpush, no_tree, back) { var xhr = new XHR(); xhr.top = url; + xhr.back = back xhr.hpush = hpush; xhr.ts = Date.now(); xhr.open('GET', xhr.top + '?ls' + (r.dots ? '&dots' : ''), true); @@ -4893,6 +4894,12 @@ var treectl = (function () { if (res.readme) show_readme(res.readme); + if (this.hpush && !this.back) { + var ofs = ebi('wrap').offsetTop; + if (document.documentElement.scrollTop > ofs) + document.documentElement.scrollTop = ofs; + } + wintitle(); var fun = r.ls_cb; if (fun) { @@ -5068,7 +5075,7 @@ var treectl = (function () { if (url.search.indexOf('doc=') + 1 && hbase == cbase) return showfile.show(hbase + showfile.sname(url.search), true); - r.goto(url.pathname); + r.goto(url.pathname, false, true); }; hist_replace(get_evpath() + window.location.hash); diff --git a/scripts/sfx.ls b/scripts/sfx.ls index a7bc05e2..980b46b7 100644 --- a/scripts/sfx.ls +++ b/scripts/sfx.ls @@ -77,3 +77,4 @@ copyparty/web/splash.js, copyparty/web/ui.css, copyparty/web/up2k.js, copyparty/web/util.js, +copyparty/web/w.hash.js,