📂
${filtered.map(r=>{
const isExp=S.dlExpandedRid===r.id;
const fHtml=isExp&&S.reportFiles[r.id]?renderFileList(r.id,S.reportFiles[r.id]):'';
+ const fCount=S.reportFiles[r.id]?S.reportFiles[r.id].length:null;
return`
-
-
${r.tenancy_name}Level ${r.level||2} — ${r.created_at}
-
${isExp?'▲ Ocultar':'▼ Ver Arquivos'}
+
+
+
+
${r.tenancy_name}
+
Level ${r.level||2} · ${r.created_at}${fCount!=null?' · '+fCount+' arquivo(s)':''}
+
${isExp?'Ocultar':'Ver Arquivos'}
${isExp?fHtml:''}
`}).join('')}
`}`}
async function toggleFiles(rid){if(S.dlExpandedRid===rid){S.dlExpandedRid=null;R();return}
S.dlExpandedRid=rid;if(!S.reportFiles[rid]){try{S.reportFiles[rid]=await $api('/reports/'+rid+'/files')}catch(e){S.reportFiles[rid]=[]}}R()}
-function renderFileList(rid,files){if(!files.length)return'
Nenhum arquivo encontrado
';
+function renderFileList(rid,files){if(!files.length)return'
Nenhum arquivo encontrado
';
const groups={};files.forEach(f=>{if(!groups[f.file_category])groups[f.file_category]=[];groups[f.file_category].push(f)});
const labels={summary:'Summary Reports',cis_finding:'CIS Findings',obp_finding:'OBP Findings',obp_best_practice:'OBP Best Practices',raw_data:'Raw Data',error:'Error Reports',diagram:'Diagrams',consolidated:'Consolidated',other:'Other'};
- let h='
';
+ const icons={summary:'📊',cis_finding:'🛡️',obp_finding:'⚠️',obp_best_practice:'✅',raw_data:'📋',error:'❌',diagram:'📈',consolidated:'📑',other:'📄'};
+ let h='
';return h}
function dlRpt(id,f){window.open(API+'/reports/'+id+'/download?fmt='+f,'_blank')}
async function refreshDl(){S.reports=await $api('/reports');S.reportFiles={};S.dlExpandedRid=null;R()}