${data.candidates.map(candidate=>``).join("")} `+
data.rows.map(row=>`${E(row.label)} ${fmt(row.talk_s)} ${row.source}${row.source==="auto"&&row.overlap_s!=null?" "+Math.round(row.overlap_s)+"s":""}${row.samples.map(E).join(" | ")}
`).join("")+
`✓ Salva nomi ✕ Chiudi
`}
// Read the label -> person inputs and save them (/speaker_map).
@@ -69,6 +74,15 @@ const response=await fetch("/speaker_map?name="+name,{method:"POST",body:JSON.st
// Recompute the automatic title from the report.
async function retitle(name){const response=await fetch(`/run?name=${name}&from=title`,{method:"POST"});if(!response.ok)alert(await response.text());tick()}
const sel={};
+// Mini modal with the secondary actions of one recording: rerun from step, drop video, delete.
+function more(name,mb,label,canDrop,title,canRetitle,blocked){
+mbody.innerHTML=`${label} 👥 partecipanti speakers ✎ modifica titolo `+(canRetitle?`↻ ricalcola titolo `:"")+(mb?`↻ riprocessa `:"")+
+(canDrop&&!blocked?`🎞 elimina video `:"")+
+(blocked?"":`🗑 elimina riunione `)+`✕ chiudi `;mdlg.showModal()}
+// Participants: named speakers (unnamed labels shown as-is) with talk time, in the same modal.
+async function who(name){const data=await (await fetch("/speakers?name="+name)).json();
+mbody.innerHTML=`Partecipanti `+(data.rows.map(row=>`${E(row.person||row.label)} ${fmt(row.talk_s)}
`).join("")||"nessun dato
")+`✕ chiudi `}
+const mclose=()=>mdlg.close();
// Delete one recording after confirmation.
async function del_(name,label){if(!confirm(`Eliminare definitivamente "${label}"?
Vengono cancellati registrazione, trascrizione, schermate e report. Non si può annullare.`))return;
@@ -77,9 +91,10 @@ const response=await fetch("/delete?name="+name,{method:"POST"});if(!response.ok
async function dropVid(name,mb){if(!confirm(`Eliminare il file video (${mb} MB)?
Report, trascrizione, audio e schermate restano, ma la riunione non potrà più essere rielaborata. Non si può annullare.`))return;
const response=await fetch("/drop_video?name="+name,{method:"POST"});if(!response.ok)alert(await response.text());tick()}
-// Prompt for a new title; empty means automatic. The date suffix is stripped from the default text.
-async function setTitle(name,cur){const title=prompt("Titolo della riunione (vuoto = automatico)",cur.replace(/ — \d{4}-\d\d-\d\d.*$/,""));if(title===null)return;
-const response=await fetch("/title?name="+name,{method:"POST",body:title});if(!response.ok)alert(await response.text());tick()}
+// Title dialog; empty means automatic. The date suffix is stripped from the default text.
+let tname="";
+function setTitle(name,cur){tname=name;tin.value=cur.replace(/ — \d{4}-\d\d-\d\d.*$/,"");tdlg.showModal();tin.select()}
+async function saveTitle(){const response=await fetch("/title?name="+tname,{method:"POST",body:tin.value});tdlg.close();if(!response.ok)alert(await response.text());tick()}
// "mm:ss" or "h:mm:ss" -> seconds.
const sec=str=>str.trim().split(":").reduce((acc,part)=>acc*60+(+part),0);
// Open the preview dialog for recording n; the video is streamed from /video. Optional at = seconds to start playing from (used by the Q&A sources).
@@ -112,9 +127,9 @@ async function setLlm(){const response=await fetch(`/llm?shots=${llm.value}&repo
// Save the "skip screenshots" switch on the server.
async function setSkip(){await fetch("/skip_shots?v="+(skp.checked?1:0),{method:"POST"});tick()}
// Italian labels for pipeline steps.
-const LBL={audio:"Audio",transcribing:"Trascrizione",diarizing:"Chi parla",identifying:"Nomi parlanti",shots:"Schermate",docs:"Documentazione",report:"Report",memory:"Memoria"};
+const LBL={audio:"Audio",transcribing:"Trascrizione",diarizing:"Riconoscimento voci",identifying:"Assegnazione nomi",shots:"Schermate",docs:"Documentazione",report:"Report",memory:"Memoria"};
// What each step does, shown under the progress bar.
-const HOW={audio:"pulizia e normalizzazione dell'audio",transcribing:"Whisper trascrive il parlato",diarizing:"riconoscimento di chi parla",identifying:"abbinamento voci-nomi",shots:"il modello di visione legge ogni schermata condivisa",docs:"ricerca su Confluence e Jira",report:"il modello scrive argomenti, decisioni e azioni",memory:"indicizzazione per la ricerca tra riunioni"};
+const HOW={audio:"pulizia e normalizzazione dell'audio",transcribing:"Whisper trascrive il parlato",diarizing:"separazione dei partecipanti in base alla voce",identifying:"associazione di ogni voce al nome del partecipante",shots:"il modello di visione legge ogni schermata condivisa",docs:"ricerca su Confluence e Jira",report:"il modello scrive argomenti, decisioni e azioni",memory:"indicizzazione per la ricerca tra riunioni"};
// Seconds -> "N s", "N min" or "H h MM min".
const dur=seconds=>{if(seconds==null||!isFinite(seconds))return"–";seconds=Math.max(0,Math.round(seconds));if(seconds<60)return seconds+" s";const minutes=Math.round(seconds/60);return minutes<60?minutes+" min":Math.floor(minutes/60)+" h "+String(minutes%60).padStart(2,"0")+" min"};
// Seconds from now -> local HH:MM.
@@ -136,11 +151,11 @@ const idle=prog.idle,cls=act||idle<90?"":idle<300?"warn":"bad";
const tail=act?`ultimo passo completato ${dur(idle)} fa`:idle<90?`attivo · aggiornato ${dur(idle)} fa`:idle<300?`nessun avanzamento da ${dur(idle)} : può essere normale (avvio modello, passo lungo)`:`nessuna attività da ${dur(idle)} : possibile blocco, controlla il log Prefect o premi stop`;
return `${txt?txt+" — ":""}${tail}
`}
// Progress panel for a recording: boot, queued, or running pipeline.
-function progPanel(row){const prog=row.prog;
+function progPanel(row){const prog=row.prog,stop=`${row.flow_run_id?`prefect `:""}■ stop `;
// Pipeline starting: the Python environment can take minutes on the first run.
-if(!prog&&row.running)return `In coda parte appena finisce l'elaborazione in corso ${stop}
`:"";
// Overall percent (null if unknown) and the running step.
const pct=prog.pct!=null?Math.round(prog.pct*100):null,cur=prog.plan.find(stage=>stage.state==="run");
// Step chips: skipped / done with duration / running with fraction / pending with estimate.
@@ -148,9 +163,9 @@ const chips=prog.plan.map(stage=>stage.state==="skip"?`
+return `
${pct!=null?pct+"%":"…"} ${step} — ${E(prog.note||HOW[prog.step]||"")}
-${prog.eta!=null?`fine prevista ~${clock(prog.eta)} · mancano ${dur(prog.eta)} · `:""}trascorso ${dur(prog.elapsed)}
+
${prog.eta!=null?`fine prevista ~${clock(prog.eta)} · mancano ${dur(prog.eta)} · `:""}trascorso ${dur(prog.elapsed)} ${stop}
${chips}
@@ -200,19 +215,18 @@ qs.textContent=data.queue?`rielaborazione: ${data.queue} da completare`:"";
// Remember step-select values so they survive the re-render.
document.querySelectorAll("select[id^=f-]").forEach(select=>sel[select.id]=select.value);
// Table header.
-let html="recording status duration speakers MB links actions ";
+let html="riunione stato durata speaker MB azioni ";
// Pagination: PS meetings per page; clamp the page if recordings were removed, then draw the pager.
const pages=Math.max(1,Math.ceil(data.recs.length/PS));if(pg_>=pages)pg_=pages-1;
pgr.innerHTML=pages>1?`‹ pagina ${pg_+1} di ${pages} (${data.recs.length} riunioni) › `:"";
// One tbody per recording on the current page; "running" when the status is done but the process is still alive.
for(const row of data.recs.slice(pg_*PS,(pg_+1)*PS)){
// Display title, falling back to the upload name.
-const nm=row.title||row.upload;
+const nm=row.title||row.upload,act=!!(row.prog||row.running||row.status==="queued");
// Main row: checkbox, title and rename buttons; status badge with error text and time since last data.
-html+=` ${nm?`${E(nm)} ${row.name} `:row.name} ✎ ${row.mb&&row.files.includes("report.html")?`↻ `:""}${row.status} ${row.receiving_age_s!=null&&row.status==="recording"?` ${row.receiving_age_s}s ago `:""}${row.error?`${E(row.error)} `:""}${row.duration_s?fmt(row.duration_s):""} ${row.speakers??""} ${row.mb}
- ${row.files.includes("report.html")?`report pdf `:""}${row.flow_run_id?`prefect `:""}
- ${row.mb?`${["audio","transcribe","diarize","speakers","shots","docs","report","memory","render"].map(step=>`${step}`).join("")} run `:""}speakers ${row.mb?`▶ video `:""}${row.mb&&row.status==="done"&&!row.running?`🎞 elimina video `:""}${row.running||row.status==="queued"?`stop `:`🗑 `}`;
-html+=progPanel(row);
+html+=` ${nm?`${E(nm)} ${act?" ":""}${row.name} `:row.name+(act?" ":"")} ${row.status} ${row.receiving_age_s!=null&&row.status==="recording"?` ${row.receiving_age_s}s ago `:""}${row.error?`${E(row.error)} `:""}${row.duration_s?fmt(row.duration_s):""} ${row.speakers??""} ${row.mb}
+ `;
+html+=pgo.has(row.name)?progPanel(row):"";
if(open_.has(row.name))html+=await panel(row.name);html+=" "}
// Re-render only when not editing a speaker field and no table input has focus, so user input is kept.
const ae=document.activeElement;if(!editing&&!(ae&&t.contains(ae)&&/^(INPUT|SELECT)$/.test(ae.tagName))){const ck=[...document.querySelectorAll(".mg:checked")].map(box=>box.value);t.innerHTML=html;for(const id in sel){const element=document.getElementById(id);if(element)element.value=sel[id]}document.querySelectorAll(".mg").forEach(box=>box.checked=ck.includes(box.value));upd()}}catch{/* poll failed: next tick retries */}}