GUI: drop Rielabora buttons; log report progress to Prefect
This commit is contained in:
@@ -30,7 +30,7 @@ Click **Install**. It downloads ffmpeg, llama.cpp (CUDA 13), the diarization mod
|
||||
1. Click **Start**: GUI on http://127.0.0.1:18765/, Prefect dashboard on http://127.0.0.1:4200.
|
||||
2. Click **Extension** to open `app/ext`, then in Chrome/Edge: `chrome://extensions` → Developer mode → **Load unpacked** → select that folder (once).
|
||||
3. In a Teams web call, click the extension icon → record. On stop, the pipeline runs and the report appears in the GUI.
|
||||
4. **Rielabora** on a row reruns that meeting from scratch; **Rielabora tutte** (top right of the GUI) reruns every recording sequentially: *da zero* (full pipeline), *da report* (new summaries), *solo render* (restyle reports only).
|
||||
4. Per rerun: pick a step in the row's dropdown and press **run**. API-only: `POST /run_all?from=audio|report|render` reruns every recording sequentially.
|
||||
|
||||
Alternative without the extension (desktop Teams, system loopback + mic): `cd app && uv run meet.py [--screen]`, Ctrl+C to stop.
|
||||
|
||||
@@ -58,7 +58,7 @@ Base URL `http://127.0.0.1:18765`.
|
||||
| POST | `/events` | `name`, body = JSON array of Teams call events |
|
||||
| POST | `/stop` | `name` → finalize recording, start pipeline |
|
||||
| POST | `/run` | `name`, `from`, `speakers` → rerun pipeline |
|
||||
| POST | `/run_all` | `from` → rerun every recording one at a time, oldest first (GUI: **Rielabora tutte**) |
|
||||
| POST | `/run_all` | `from` → rerun every recording one at a time, oldest first (API only) |
|
||||
| POST | `/speaker_map` | `name`, body = `{"Speaker 1": "Mario Rossi"}` → re-render |
|
||||
|
||||
### curl
|
||||
|
||||
@@ -34,6 +34,7 @@ PROG = None # [name, calls done, calls expected] while report.run() is active
|
||||
|
||||
|
||||
def _tick(note):
|
||||
print(f"report: {note}", flush=True) # flow(log_prints=True) -> Prefect log
|
||||
if PROG: PROG[1] += 1; db.tick(PROG[0], PROG[1], max(PROG[2], PROG[1] + 1) if note != "fine" else PROG[1], note)
|
||||
|
||||
|
||||
|
||||
+3
-6
@@ -343,7 +343,7 @@ background-size:24px 24px,100% 100%;animation:mv 1s linear infinite}
|
||||
body.drag main{outline:3px dashed var(--acc);outline-offset:8px;border-radius:14px}
|
||||
#hint{color:var(--mut);font-size:12.5px}
|
||||
button.del{color:var(--redf)}button.del:hover{background:var(--red);border-color:var(--redf)}</style>
|
||||
<main><header><h1>Riunioni</h1><div class=row><span id=qs></span><select id=llm title="modello per le schermate (shots)" onchange=setLlm()></select><select id=llmr title="modello per il report" onchange=setLlm()></select><select id=fa title="passo da cui ripartire"><option value=audio>da zero (audio)</option><option value=report>da report</option><option value=render>solo render</option></select><button id=ra onclick=runAll()>Rielabora tutte</button><button class=pri onclick=pick() title="mp4, mkv, mov, webm, wav, m4a, mp3">⬆ Carica video</button>
|
||||
<main><header><h1>Riunioni</h1><div class=row><span id=qs></span><select id=llm title="modello per le schermate (shots)" onchange=setLlm()></select><select id=llmr title="modello per il report" onchange=setLlm()></select><button class=pri onclick=pick() title="mp4, mkv, mov, webm, wav, m4a, mp3">⬆ Carica video</button>
|
||||
<input type=file id=up accept="video/*,audio/*,.mkv" hidden></div></header>
|
||||
<div id=hint>Trascina qui un video o un audio di una riunione per elaborarlo.</div>
|
||||
<div class="card" id=ub hidden><div class=pg style="margin:0;border:0;padding:0;background:none"><div class=pgh><span><span class=big id=ubig>0%</span> <b id=utitle></b></span><button id=ucancel>annulla</button></div>
|
||||
@@ -372,9 +372,6 @@ j.rows.map(r=>`<div><b>${E(r.label)}</b> ${fmt(r.talk_s)} <input data-n="${n}" d
|
||||
async function saveSpk(n){const m={};document.querySelectorAll(`input[data-n="${n}"]`).forEach(i=>m[i.dataset.l]=i.value);
|
||||
const r=await fetch("/speaker_map?name="+n,{method:"POST",body:JSON.stringify(m)});alert(await r.text())}
|
||||
const sel={};
|
||||
async function redo(n){if(!confirm(`Rielaborare da zero ${n}?`))return;const r=await fetch(`/run?name=${n}&from=audio`,{method:"POST"});if(r.status==409)alert("già in esecuzione");tick()}
|
||||
async function runAll(){if(!confirm(`Rielaborare TUTTE le registrazioni da "${fa.value}"? Una alla volta, può richiedere ore.`))return;
|
||||
const r=await fetch("/run_all?from="+fa.value,{method:"POST"});if(!r.ok)alert(await r.text());tick()}
|
||||
async function del_(n,label){if(!confirm(`Eliminare definitivamente "${label}"?\nVengono cancellati registrazione, trascrizione, schermate e report. Non si può annullare.`))return;
|
||||
const r=await fetch("/delete?name="+n,{method:"POST"});if(!r.ok)alert(await r.text());tick()}
|
||||
async function stopRun(n){if(!confirm(`Fermare ${n}?`))return;await fetch("/cancel?name="+n,{method:"POST"});tick()}
|
||||
@@ -424,14 +421,14 @@ addEventListener("drop",e=>{e.preventDefault();document.body.classList.remove("d
|
||||
async function tick(){try{const j=await (await fetch("/status")).json();ab.disabled=j.busy;ab.title=j.busy?"pipeline in corso":"";
|
||||
const runp=j.recs.map(r=>r.prog).filter(p=>p&&p.pct!=null);document.title=runp.length?`${Math.round(runp[0].pct*100)}% · ${LBL[runp[0].step]} · Riunioni`:"Riunioni";
|
||||
for(const [s,i,p] of [[llm,0,"shots: "],[llmr,1,"report: "]])if(document.activeElement!==s){s.innerHTML=j.llms.map(([k,l])=>`<option value=${k}>${p}${E(l)}`).join("");s.value=j.llm[i];s.disabled=j.busy}
|
||||
ra.disabled=j.queue>0;qs.textContent=j.queue?`rielaborazione: ${j.queue} da completare`:"";
|
||||
qs.textContent=j.queue?`rielaborazione: ${j.queue} da completare`:"";
|
||||
document.querySelectorAll("select[id^=f-]").forEach(s=>sel[s.id]=s.value);
|
||||
let h="<tr><th>recording<th>status<th>duration<th>speakers<th>MB<th>links<th>actions</tr>";
|
||||
for(const r of j.recs){const st=r.running&&r.status=="done"?"running":r.status;
|
||||
const nm=r.title||r.upload;
|
||||
h+=`<tr><td>${nm?`<b>${E(nm)}</b><br><small>${r.name}</small>`:r.name}<td><span class="b ${r.status}" title="${E(r.error)}">${r.status}</span>${r.receiving_age_s!=null&&r.status=="recording"?` <small>${r.receiving_age_s}s ago</small>`:""}${r.error?`<br><small>${E(r.error)}</small>`:""}<td>${r.duration_s?fmt(r.duration_s):""}<td>${r.speakers??""}<td>${r.mb}
|
||||
<td>${r.files.includes("report.html")?`<a href="/report?name=${r.name}" target=_blank>report</a><a href="/pdf?name=${r.name}" target=_blank>pdf</a>`:""}${r.flow_run_id?`<a href="http://127.0.0.1:4200/runs/flow-run/${r.flow_run_id}" target=_blank>prefect</a>`:""}
|
||||
<td><select id="f-${r.name}">${["audio","transcribe","diarize","speakers","shots","docs","report","memory","render"].map(s=>`<option>${s}`).join("")}</select><button onclick="run('${r.name}')">run</button><button class=pri onclick="redo('${r.name}')">Rielabora</button><button onclick="spk('${r.name}')">speakers</button>${r.running?`<button onclick="stopRun('${r.name}')">stop</button>`:`<button class=del title="elimina la riunione" onclick="del_('${r.name}','${E(nm||r.name).replace(/'/g,"")}')">🗑</button>`}`;
|
||||
<td><select id="f-${r.name}">${["audio","transcribe","diarize","speakers","shots","docs","report","memory","render"].map(s=>`<option>${s}`).join("")}</select><button onclick="run('${r.name}')">run</button><button onclick="spk('${r.name}')">speakers</button>${r.running?`<button onclick="stopRun('${r.name}')">stop</button>`:`<button class=del title="elimina la riunione" onclick="del_('${r.name}','${E(nm||r.name).replace(/'/g,"")}')">🗑</button>`}`;
|
||||
h+=progPanel(r);
|
||||
if(open_.has(r.name))h+=await panel(r.name)}
|
||||
if(!document.activeElement||document.activeElement.tagName!="INPUT"){t.innerHTML=h;for(const k in sel){const e=document.getElementById(k);if(e)e.value=sel[k]}}}catch(e){}}
|
||||
|
||||
Reference in New Issue
Block a user