diff --git a/apps/observer-kb/index.html b/apps/observer-kb/index.html index 1aba707..7962243 100644 --- a/apps/observer-kb/index.html +++ b/apps/observer-kb/index.html @@ -110,7 +110,7 @@ let CONVS=[];let CUR=null; // Init async function init(){ -const old=['call_log','placements','clients','threat_intel','timesheets','meta_runs','candidates','job_orders','lab_trials','users','email_log','new_candidates','schema_test_v1','schema_test_v2','stress_test_ingest','stress_ingest']; +const old=['call_log','placements','clients','threat_intel','timesheets','meta_runs','candidates','job_orders','lab_trials','users','email_log','new_candidates','schema_test_v1','schema_test_v2','stress_test_ingest','stress_ingest','knowledge_topics','knowledge_decisions','knowledge_insights','knowledge_questions']; try{ const ds=await(await fetch(API+'/catalog/datasets')).json(); CONVS=ds.filter(d=>!old.includes(d.name)); @@ -159,7 +159,7 @@ pg.textContent='page '+row.page_number; msg.append(role,content,pg);el.appendChild(msg); }); if(!r.rows.length)el.textContent='No content'; -}catch(e){el.textContent='Error: '+e} +}catch(e){const err=document.createElement("div");err.className="empty";err.textContent="Error loading: "+e;el.appendChild(err)} } // Search view @@ -194,7 +194,7 @@ actions.appendChild(saveBtn); item.append(score,src,text,actions);el.appendChild(item); }); if(!(r.results||[]).length){el.textContent='No results — try different terms'} -}catch(e){el.textContent='Error: '+e} +}catch(e){const err=document.createElement("div");err.className="empty";err.textContent="Error loading: "+e;el.appendChild(err)} } async function saveToKB(hit){ @@ -232,7 +232,7 @@ item.append(sc,tx);sources.appendChild(item); const saveBtn=document.createElement('button');saveBtn.className='btn btn-sm btn-save';saveBtn.textContent='Save Answer';saveBtn.style.marginTop='12px'; saveBtn.onclick=()=>{saveToKB({doc_id:'ai_answer',chunk_text:q+'\n\n'+r.answer});saveBtn.textContent='Saved';saveBtn.disabled=true}; el.append(resp,meta,sources,saveBtn); -}catch(e){el.textContent='Error: '+e} +}catch(e){const err=document.createElement("div");err.className="empty";err.textContent="Error loading: "+e;el.appendChild(err)} $('abtn').disabled=false;$('abtn').textContent='Ask AI'; }