- 后端 _compute_current_task_queue 返回每项附带 download_filter - 前端三种卡片(已完成/当前/排队中)都加一行 📅 日期范围, 复用既有 parseFilterDisplay 解析 filter 字符串 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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 `
|
||||
<div class="qcard qcard-done">
|
||||
<div class="qcard-icon">✅</div>
|
||||
<div class="qcard-main">
|
||||
<div class="qcard-name">${title}</div>
|
||||
${filterLine}
|
||||
<div class="qcard-state">${totalStr},${skipStr}</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function renderFilterLine(filter) {
|
||||
const txt = parseFilterDisplay(filter || '');
|
||||
if (!txt) return '';
|
||||
return `<div class="qcard-state" style="color:var(--muted);">${escapeHtml(txt)}</div>`;
|
||||
}
|
||||
|
||||
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 @@
|
||||
<div class="qcard-state" style="margin-top:3px;">${done} / ${realTotal}${suffix}</div>`;
|
||||
}
|
||||
|
||||
const filterLine = renderFilterLine(q.download_filter);
|
||||
return `
|
||||
<div class="qcard qcard-active">
|
||||
<div class="qcard-icon">🚀</div>
|
||||
<div class="qcard-main">
|
||||
<div class="qcard-name">${title}</div>
|
||||
${filterLine}
|
||||
<div class="qcard-state">${st}</div>
|
||||
${progBar}
|
||||
</div>
|
||||
@@ -1557,11 +1567,13 @@
|
||||
|
||||
function renderPendingCard(q) {
|
||||
const title = escapeHtml(q.chat_title || q.chat_id);
|
||||
const filterLine = renderFilterLine(q.download_filter);
|
||||
return `
|
||||
<div class="qcard qcard-pending">
|
||||
<div class="qcard-icon">⏳</div>
|
||||
<div class="qcard-main">
|
||||
<div class="qcard-name">${title}</div>
|
||||
${filterLine}
|
||||
<div class="qcard-state">排队中…</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user