diff --git a/harbor/web/app.html b/harbor/web/app.html index b0e9e33..9fd61de 100644 --- a/harbor/web/app.html +++ b/harbor/web/app.html @@ -1180,18 +1180,21 @@ let LB=null; const pct=n=>Number(n||0).toFixed(Number(n)>=10?1:2)+'%'; const kb=b=>b>=1048576?(b/1048576).toFixed(2)+' MB':Math.round((b||0)/1024)+' KB'; const cssVar=n=>getComputedStyle(el('view-logbook')).getPropertyValue(n).trim(); +function renderLbFigs(){const s=(LB&&LB.stats)||{},cat=k=>(s.by_category||{})[k]||{functions:0,bytes:0}; + /* by_status.decompiled counts every category (engine and platform too); the game-only count comes from the progress map */ + const total=s.functions||0,game=cat('game').functions,uns=cat('unsorted').functions,all=(s.by_status&&s.by_status.decompiled||{}).functions||0; + const c=PM.doc&&PM.doc.code,done=c?c.decompiled_functions:null,handled=done==null?null:total-uns-Math.max(0,game-done); + put('lbFigs',[[handled==null?'…':pct(total?100*handled/total:0)+' done',handled==null?'counting…':fmt(handled)+' of '+fmt(total)+' functions handled','game code decompiled, everything else identified'], + [done==null?'…':fmt(done)+' of '+fmt(game),'game functions decompiled to readable C',done==null?fmt(all)+' decompiled across all code':fmt(game-done)+' to go · '+fmt(all)+' decompiled across all code'], + [fmt(uns),'functions not sorted yet','each one is either game code (to decompile) or engine/library code (to name)']] + .map(([v,l,n])=>'
'+esc(v)+'
'+esc(l)+'
'+esc(n)+'
').join(''))} async function renderLogbook(){try{LB=await get('api/logbook')}catch(e){put('lbStamp',''+esc(e.message)+'');return} const s=LB.stats||{},cat=k=>(s.by_category||{})[k]||{functions:0,bytes:0}; const cur=LB.milestones.find(m=>/progress/i.test(m.state||''));el('lbMilestone').textContent=cur?'Milestone '+cur.code+' · '+cur.title:'Milestones'; const au=LB.auto||{};put('lbStamp',(s.updated_at?'Statistics updated '+esc(central(s.updated_at))+'
main at '+esc(s.commit||'–')+'':'No statistics yet')+(au.last_refresh?'
Keeps itself current: last checked '+esc(central(au.last_refresh))+(au.last_error?' · '+esc(String(au.last_error).slice(0,120))+'':''):'')); - const total=s.functions||0,game=cat('game').functions,done=(s.by_status&&s.by_status.decompiled||{}).functions||0,uns=cat('unsorted').functions; - const handled=total-uns-Math.max(0,game-done); - put('lbFigs',[[pct(total?100*handled/total:0)+' done',fmt(handled)+' of '+fmt(total)+' functions handled','game code decompiled, everything else identified'], - [fmt(done)+' of '+fmt(game),'game functions decompiled to readable C',fmt(game-done)+' to go'], - [fmt(uns),'functions not sorted yet','each one is either game code (to decompile) or engine/library code (to name)']] - .map(([v,l,n])=>'
'+esc(v)+'
'+esc(l)+'
'+esc(n)+'
').join('')); + renderLbFigs(); put('lbLegend',LB_CATS.map(([k,n])=>''+esc(n)+'').join('')+'decompiled share under each column'); - drawLbMap();pmLoad().then(()=>{if(PM.doc)pmLayout()});renderLbWhere(s);renderLbTrend(LB.history);renderLbMilestones(LB.milestones); + drawLbMap();pmLoad().then(()=>{if(PM.doc){pmLayout();renderLbFigs()}});renderLbWhere(s);renderLbTrend(LB.history);renderLbMilestones(LB.milestones); el('lbLogCount').textContent=LB.log_total?LB.log_total+' entries':''; put('lbLog',LB.log.length?LB.log.map(e=>'
  • '+esc(e.kind)+''+esc(e.title)+'
    '+esc(e.detail)+'
  • ').join(''):'
  • No entries yet.
  • ')} async function renderLbWhere(s){const total=s.bytes||0,cat=k=>(s.by_category||{})[k]||{functions:0,bytes:0},uns=cat('unsorted'),sorted=total?100*(total-uns.bytes)/total:0;