diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 61223095..ce1c004f 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1379,7 +1379,7 @@ class HttpCli(object): vstate = {("/" + k).rstrip("/") + "/": v for k, v in vs["volstate"].items()} else: vstate = {} - vs = {"scanning": None, "hashq": None, "tagq": None} + vs = {"scanning": None, "hashq": None, "tagq": None, "mtpq": None} html = self.j2( "splash", @@ -1391,6 +1391,7 @@ class HttpCli(object): scanning=vs["scanning"], hashq=vs["hashq"], tagq=vs["tagq"], + mtpq=vs["mtpq"], url_suf=suf, ) self.reply(html.encode("utf-8"), headers=NO_STORE) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 420950bc..1b0b050d 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -132,11 +132,25 @@ class Up2k(object): self.log_func("up2k", msg + "\033[K", c) def get_state(self): + mtpq = 0 + q = "select count(w) from mt where k = 't:mtp'" + got_lock = self.mutex.acquire(timeout=0.5) + if got_lock: + for cur in self.cur.values(): + try: + mtpq += cur.execute(q).fetchone()[0] + except: + pass + self.mutex.release() + else: + mtpq = "?" + ret = { "volstate": self.volstate, "scanning": hasattr(self, "pp"), "hashq": self.n_hashq, "tagq": self.n_tagq, + "mtpq": mtpq, } return json.dumps(ret, indent=4) diff --git a/copyparty/web/splash.css b/copyparty/web/splash.css index af8eafbd..5df9b859 100644 --- a/copyparty/web/splash.css +++ b/copyparty/web/splash.css @@ -34,6 +34,9 @@ table { padding: .3em .6em; text-align: left; } +.num { + border-right: 1px solid #bbb; +} .num td { padding: .1em .7em .1em 0; } @@ -67,4 +70,7 @@ html.dark input { border-radius: .5em; padding: .5em .7em; margin: 0 .5em 0 0; +} +html.dark .num { + border-color: #777; } \ No newline at end of file diff --git a/copyparty/web/splash.html b/copyparty/web/splash.html index f1f065de..a7ba61c6 100644 --- a/copyparty/web/splash.html +++ b/copyparty/web/splash.html @@ -20,7 +20,8 @@
vol | action | status |
---|