fix: 监控进度显示优化 - 通用任务改为"已执行操作数",操作计数紧凑展示

- 通用步骤任务进度语义:done=累计执行操作次数,不再配固定 total(原来显示 33/2 步骤 无意义)
- 前端操作计数徽章按数量降序、最多显示6个,超出折叠为 +N
- 移除无意义的百分比进度条(无固定总数时不显示)
This commit is contained in:
2026-08-08 16:57:40 +08:00
parent aeffb1b95b
commit 47b3d0bf03
2 changed files with 14 additions and 6 deletions
+11 -4
View File
@@ -953,10 +953,17 @@ function fmtProgress(progress, workerStatus){
const m=Math.floor(elapsed/60), s=elapsed%60;
timeHtml=' <span style="font-size:11px;color:#94a3b8">'+m+'m'+s+'s</span>';
}
// 操作计数徽章(仅显示 >0 的)
const countParts=Object.entries(counts).filter(([_,v])=>v>0).map(([k,v])=>
'<span class="label label-info" style="margin-left:4px">'+(ACTION_LABELS[k]||esc(k))+' '+v+'</span>');
const countsHtml=countParts.length?'<div style="margin-top:2px">'+countParts.join('')+'</div>':'';
// 操作计数徽章(按数量降序,最多显示6个,超出的折叠为 +N)
const countEntries=Object.entries(counts).filter(([_,v])=>v>0).sort((a,b)=>b[1]-a[1]);
const MAX_COUNTS=6;
const shown=countEntries.slice(0,MAX_COUNTS);
const more=countEntries.length-MAX_COUNTS;
let countsHtml='';
if(shown.length){
countsHtml='<div style="margin-top:2px">'+shown.map(([k,v])=>
'<span class="label label-info" style="margin-left:4px;font-size:11px">'+(ACTION_LABELS[k]||esc(k))+' '+v+'</span>'
).join('')+(more>0?' <span style="font-size:11px;color:#94a3b8">+'+more+'</span>':'')+'</div>';
}
// 空闲/完成但无进度数据 → 灰显
if(done===0&&total===0&&elapsed===0&&!countParts.length){
return '<span class="text-muted">-</span>';