This commit is contained in:
ed 2023-10-15 20:06:46 +00:00
parent 9ca8154651
commit ac40dccc8f
5 changed files with 20 additions and 11 deletions

View file

@ -580,7 +580,8 @@ the up2k UI is the epitome of polished inutitive experiences:
* "parallel uploads" specifies how many chunks to upload at the same time * "parallel uploads" specifies how many chunks to upload at the same time
* `[🏃]` analysis of other files should continue while one is uploading * `[🏃]` analysis of other files should continue while one is uploading
* `[🥔]` shows a simpler UI for faster uploads from slow devices * `[🥔]` shows a simpler UI for faster uploads from slow devices
* `[💭]` ask for confirmation before files are added to the queue * `[🎲]` generate random filenames during upload
* `[📅]` preserve last-modified timestamps; server times will match yours
* `[🔎]` switch between upload and [file-search](#file-search) mode * `[🔎]` switch between upload and [file-search](#file-search) mode
* ignore `[🔎]` if you add files by dragging them into the browser * ignore `[🔎]` if you add files by dragging them into the browser

View file

@ -1,8 +1,8 @@
# coding: utf-8 # coding: utf-8
VERSION = (1, 9, 11) VERSION = (1, 9, 12)
CODENAME = "prometheable" CODENAME = "prometheable"
BUILD_DT = (2023, 10, 9) BUILD_DT = (2023, 10, 15)
S_VERSION = ".".join(map(str, VERSION)) S_VERSION = ".".join(map(str, VERSION))
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)

View file

@ -86,6 +86,7 @@ flagcats = {
"vmaxn=4k": "max 4096 files in volume (suffixes: b, k, m, g, t)", "vmaxn=4k": "max 4096 files in volume (suffixes: b, k, m, g, t)",
"rand": "force randomized filenames, 9 chars long by default", "rand": "force randomized filenames, 9 chars long by default",
"nrand=N": "randomized filenames are N chars long", "nrand=N": "randomized filenames are N chars long",
"u2ts=fc": "[f]orce [c]lient-last-modified or [u]pload-time",
"sz=1k-3m": "allow filesizes between 1 KiB and 3MiB", "sz=1k-3m": "allow filesizes between 1 KiB and 3MiB",
"df=1g": "ensure 1 GiB free disk space", "df=1g": "ensure 1 GiB free disk space",
}, },

View file

@ -4,6 +4,7 @@ from __future__ import print_function, unicode_literals
import argparse # typechk import argparse # typechk
import colorsys import colorsys
import hashlib import hashlib
import re
from .__init__ import PY2 from .__init__ import PY2
from .th_srv import HAVE_PIL, HAVE_PILF from .th_srv import HAVE_PIL, HAVE_PILF
@ -24,7 +25,7 @@ class Ico(object):
zb = [ord(x) for x in zb] zb = [ord(x) for x in zb]
c1 = colorsys.hsv_to_rgb(zb[0] / 256.0, 1, 0.3) c1 = colorsys.hsv_to_rgb(zb[0] / 256.0, 1, 0.3)
c2 = colorsys.hsv_to_rgb(zb[0] / 256.0, 1, 1) c2 = colorsys.hsv_to_rgb(zb[0] / 256.0, 0.8 if HAVE_PILF else 1, 1)
ci = [int(x * 255) for x in list(c1) + list(c2)] ci = [int(x * 255) for x in list(c1) + list(c2)]
c = "".join(["{:02x}".format(x) for x in ci]) c = "".join(["{:02x}".format(x) for x in ci])
@ -38,16 +39,21 @@ class Ico(object):
if chrome: if chrome:
# cannot handle more than ~2000 unique SVGs # cannot handle more than ~2000 unique SVGs
if HAVE_PILF: if HAVE_PILF:
# pillow 10.1 made this the default font;
# svg: 3.7s, this: 36s
try: try:
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
h = int(96 * h / w) # [.lt] are hard to see lowercase / unspaced
w = 96 ext2 = re.sub("(.)", "\\1 ", ext).upper()
h = int(128 * h / w)
w = 128
img = Image.new("RGB", (w, h), "#" + c[:6]) img = Image.new("RGB", (w, h), "#" + c[:6])
pb = ImageDraw.Draw(img) pb = ImageDraw.Draw(img)
_, _, tw, th = pb.textbbox((0, 0), ext, font_size=16) _, _, tw, th = pb.textbbox((0, 0), ext2, font_size=16)
xy = ((w - tw) // 2, (h - th) // 2) xy = ((w - tw) // 2, (h - th) // 2)
pb.text(xy, ext, fill="#" + c[6:], font_size=16) pb.text(xy, ext2, fill="#" + c[6:], font_size=16)
img = img.resize((w * 2, h * 2), Image.NEAREST) img = img.resize((w * 2, h * 2), Image.NEAREST)

View file

@ -1050,7 +1050,7 @@ ebi('op_up2k').innerHTML = (
' </td>\n' + ' </td>\n' +
' <td class="c" rowspan="2">\n' + ' <td class="c" rowspan="2">\n' +
' <input type="checkbox" id="u2ts" />\n' + ' <input type="checkbox" id="u2ts" />\n' +
' <label for="u2ts" tt="' + L.ut_u2ts + '">🕒</a>\n' + ' <label for="u2ts" tt="' + L.ut_u2ts + '">📅</a>\n' +
' </td>\n' + ' </td>\n' +
' <td class="c" data-perm="read" data-dep="idx" rowspan="2">\n' + ' <td class="c" data-perm="read" data-dep="idx" rowspan="2">\n' +
' <input type="checkbox" id="fsearch" />\n' + ' <input type="checkbox" id="fsearch" />\n' +
@ -3147,7 +3147,7 @@ function eval_hash() {
function read_dsort(txt) { function read_dsort(txt) {
try { try {
var zt = txt.trim().split(/,+/g); var zt = (('' + txt).trim() || 'href').split(/,+/g);
dsort = []; dsort = [];
for (var a = 0; a < zt.length; a++) { for (var a = 0; a < zt.length; a++) {
var z = zt[a].trim(), n = 1, t = ""; var z = zt[a].trim(), n = 1, t = "";
@ -3163,6 +3163,7 @@ function read_dsort(txt) {
} }
catch (ex) { catch (ex) {
toast.warn(10, 'failed to apply default sort order [' + txt + ']:\n' + ex); toast.warn(10, 'failed to apply default sort order [' + txt + ']:\n' + ex);
dsort = [['href', 1, '']];
} }
} }
read_dsort(dsort); read_dsort(dsort);
@ -6400,7 +6401,7 @@ var filecols = (function () {
toh = ths[a].outerHTML, // !ff10 toh = ths[a].outerHTML, // !ff10
ttv = L.cols[ths[a].textContent]; ttv = L.cols[ths[a].textContent];
ttv = (ttv ? ttv + '$N' : '') + 'ID: <code>' + th.getAttribute('name') + '</code>'; ttv = (ttv ? ttv + '; ' : '') + 'id=<code>' + th.getAttribute('name') + '</code>';
if (!MOBILE && toh) { if (!MOBILE && toh) {
th.innerHTML = '<div class="cfg"><a href="#">-</a></div>' + toh; th.innerHTML = '<div class="cfg"><a href="#">-</a></div>' + toh;
th.getElementsByTagName('a')[0].onclick = ev_row_tgl; th.getElementsByTagName('a')[0].onclick = ev_row_tgl;