From 8de92095f70add72fd49dabb83cdf3e73d428e5c Mon Sep 17 00:00:00 2001 From: yuming Date: Thu, 23 Apr 2026 13:17:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=BB=E5=8A=A1=E9=98=9F=E5=88=97?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=98=BE=E7=A4=BA=E6=AF=8F=E4=B8=AA=E9=A2=91?= =?UTF-8?q?=E9=81=93=E7=9A=84=E6=97=A5=E6=9C=9F=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端 _compute_current_task_queue 返回每项附带 download_filter - 前端三种卡片(已完成/当前/排队中)都加一行 📅 日期范围, 复用既有 parseFilterDisplay 解析 filter 字符串 Co-Authored-By: Claude Opus 4.7 (1M context) --- module/templates/index.html | 12 ++++++++++++ module/web.py | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/templates/index.html b/module/templates/index.html index a9c19bc..65825d3 100644 --- a/module/templates/index.html +++ b/module/templates/index.html @@ -1506,16 +1506,24 @@ const totalStr = (c.total && c.total > 0) ? `${c.done||0} / ${c.total} 完成` : `${c.done||0} 个完成`; + const filterLine = renderFilterLine(q.download_filter); return `
${title}
+ ${filterLine}
${totalStr},${skipStr}
`; } + function renderFilterLine(filter) { + const txt = parseFilterDisplay(filter || ''); + if (!txt) return ''; + return `
${escapeHtml(txt)}
`; + } + function renderActiveCard(q, p, paused) { const title = escapeHtml(q.chat_title || p.current_chat_title || q.chat_id); const dl = p.downloading_files||0, done = p.completed_files||0, skip = p.skipped_files||0; @@ -1544,11 +1552,13 @@
${done} / ${realTotal}${suffix}
`; } + const filterLine = renderFilterLine(q.download_filter); return `
🚀
${title}
+ ${filterLine}
${st}
${progBar}
@@ -1557,11 +1567,13 @@ function renderPendingCard(q) { const title = escapeHtml(q.chat_title || q.chat_id); + const filterLine = renderFilterLine(q.download_filter); return `
${title}
+ ${filterLine}
排队中…
`; diff --git a/module/web.py b/module/web.py index 9970641..1d2dee2 100644 --- a/module/web.py +++ b/module/web.py @@ -215,11 +215,12 @@ def _compute_current_task_queue() -> list: if cid: history_map[cid] = h.get("chat_title", "") or cid queue = [] - for chat_id in _app.chat_download_config.keys(): + for chat_id, cfg in _app.chat_download_config.items(): cid_str = str(chat_id) queue.append({ "chat_id": cid_str, "chat_title": history_map.get(cid_str, cid_str), + "download_filter": getattr(cfg, "download_filter", "") or "", }) return queue