From ca36bf3c60123e07fc2866762211a6b9d0842a81 Mon Sep 17 00:00:00 2001 From: Stefano Zini Date: Thu, 5 Nov 2026 15:03:12 +0100 Subject: [PATCH] ui: fix undefined h/j in tick() that left the meetings table empty --- app/ui/ui.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/ui/ui.js b/app/ui/ui.js index 73669af..c296c4e 100644 --- a/app/ui/ui.js +++ b/app/ui/ui.js @@ -1,4 +1,6 @@ // Web UI logic: polls /status every 3 s, renders the meetings table, and wires search, Q&A, upload, crop and bulk actions to the local server. +// Element ids from index.html used as window globals (plus bare addEventListener), declared for ESLint no-undef. +/* global ab addEventListener ar bf bn bulk cdlg ce cgi_ cgo_ cmsg cpr cs ctitle cv llm llma llmr omps pgr q qa qs skp sr t ub ubar ubig ucancel up utitle utxt */ // Escape text for innerHTML (&, <, >, "). const E=value=>String(value??"").replace(/[&<>"]/g,char=>({"&":"&","<":"<",">":">",'"':"""}[char])); // Seconds -> mm:ss (minutes can exceed 59; no hour form here). @@ -120,7 +122,7 @@ const clock=seconds=>new Date(Date.now()+seconds*1000).toLocaleTimeString([],{ho // Per recording: last [timestamp, tokens decoded], used to compute tokens/s between ticks. const LT={}; // LLM activity line: prompt reading vs token writing; idle time sets the severity colour. -function live(name,prog){const l=prog.llm;let txt="",act=false; +function live(name,prog){const info=prog.llm;let txt="",act=false; // Model is busy: compare token counts with the previous tick. if(info&&info.is_processing){act=true;const key=name,prev=LT[key],now=Date.now(),decoded=info.n_decoded||0; // Tokens/s from the delta since the previous tick. @@ -201,13 +203,13 @@ document.querySelectorAll("select[id^=f-]").forEach(select=>sel[select.id]=selec let html="recordingstatusdurationspeakersMBlinksactions"; // 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} (${j.recs.length} riunioni)`:""; +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; // Main row: checkbox, title and rename buttons; status badge with error text and time since last data. -h+=`${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} +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")?`reportpdf`:""}${row.flow_run_id?`prefect`:""} ${row.mb?``:""}${row.mb?``:""}${row.mb&&row.status==="done"&&!row.running?``:""}${row.running||row.status==="queued"?``:``}`; html+=progPanel(row);