diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 7d483a8f..676bf051 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3365,6 +3365,7 @@ class HttpCli(object): "idx": ("e2d" in vn.flags), "itag": ("e2t" in vn.flags), "lifetime": vn.flags.get("lifetime") or 0, + "frand": bool(vn.flags.get("rand")), "perms": perms, "logues": logues, "readme": readme, @@ -3377,6 +3378,7 @@ class HttpCli(object): "acct": self.uname, "perms": json.dumps(perms), "lifetime": ls_ret["lifetime"], + "frand": bool(vn.flags.get("rand")), "taglist": [], "def_hcols": [], "have_emp": self.args.emp, diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index 0753a23c..83823d0c 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -155,6 +155,7 @@ sb_lg = "{{ sb_lg }}", lifetime = {{ lifetime }}, turbolvl = {{ turbolvl }}, + frand = {{ frand|tojson }}, u2sort = "{{ u2sort }}", have_emp = {{ have_emp|tojson }}, txt_ext = "{{ txt_ext }}", diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index c6a4562a..6e3ff941 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -5537,7 +5537,7 @@ var treectl = (function () { have_up2k_idx = res.idx; have_tags_idx = res.itag; lifetime = res.lifetime; - apply_perms(res.perms); + apply_perms(res); fileman.render(); } if (sel.length) @@ -5766,8 +5766,8 @@ var wfp_debounce = (function () { })(); -function apply_perms(newperms) { - perms = newperms || []; +function apply_perms(res) { + perms = res.perms || []; var a = QS('#ops a[data-dest="up2k"]'); if (have_up2k_idx) { @@ -5841,6 +5841,8 @@ function apply_perms(newperms) { (have_write || tds[a].getAttribute('data-perm') == 'read') ? 'table-cell' : 'none'; } + if (res.frand) + ebi('u2rand').parentNode.style.display = 'none'; if (up2k) up2k.set_fsearch(); diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 6e19b773..066c6c4f 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -2918,7 +2918,7 @@ ebi('ico1').onclick = function () { if (QS('#op_up2k.act')) goto_up2k(); -apply_perms(perms); +apply_perms({ "perms": perms, "frand": frand }); (function () {