
航空缺陷数据库上线飞机部位筛选功能
来源标题:Aircraft Defects
该工具支持点击飞机任意部位,仅显示该部位发现的缺陷记录。系统列表按FAA章节归类,点击即可筛选单一系统。后台改用单次DuckDB查询替代原来21次逐章请求,消除页面加载约1.2秒的延迟。
以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。
点击飞机的任何一个部位,就只保留在该部位发现的缺陷 '+ ''+[96,190,348,424].map(function(x){return ''}).join("")+''+ ''+ [150,164,220,234,248,300,314,328,400,414].map(function(x){return ''}).join("")+ ''; w.innerHTML=s; w.querySelectorAll("[data-z]").forEach(function(el){el.style.cursor="pointer";el.onclick=function(){var p=q();if(p.get("zone")===el.dataset.z)p.delete("zone");else p.set("zone",el.dataset.z);go(p)};el.onkeydown=function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();el.onclick()}}}); /* systems: a ranked list under the drawing, never labels on it (they collided) / var base=sel().toString(),curA=q().get("ata");var list=D.createElement("div");list.className="bars";list.innerHTML='Systems written up, placed by the FAA's own chapter · click to keep one ';w.appendChild(list); / One call, not twenty-one. This asked the file for a count per ATA chapter one chapter at a time: 21 requests of about 0.38s each, and the browser allows six at a time, so the bars took 1.2s to appear on every page load. /api/breakdown?by=ata answers the same question in a single DuckDB GROUP BY and returns every chapter at once. The selection is passed minus its own ata, which is what the loop did in effect and is right for a chooser: you want to see the chapters you could switch to, not only the one you are in. / var got=[];var lab={};SYS.forEach(function(x){lab[x[0]]=x[1]}); (ATA_COUNTS || fetch("/api/breakdown?by=ata"+(selQS(["ata"])?"&"+selQS(["ata"]):"")).then(function(r){return r.json()})).then(function(d){ got=(d.rows||[]).filter(function(r){return lab[r.key]&&r.n}).map(function(r){return {key:r.key,label:lab[r.key],n:r.n}}); if(!got.length)return; got.sort(function(a,b){return b.n-a.n});var mx=got[0].n; list.innerHTML='Systems written up · click to keep one '+got.slice(0,14).map(function(r){return ''+esc(r.label)+''+num(r.n)+''}).join(""); wireBars(list); }).catch(function(){}); var placed=(h.zones||[]).reduce(function(a,z){return a+z.n},0); var c=D.createElement("p");c.className="cannot";c.innerHTML="Nine FAA zones, shaded by count, and the systems written up, placed where they sit; every one is a filter. The zones place "+num(placed)+" reports; another "+num(h.other_location||0)+" name a place in words the FAA never coded, and "+num(h.no_location||0)+" give none: read the ones in words · the ones with none."; c.querySelectorAll("button").forEach(function(b){var sp=document.createElement("span");sp.textContent=b.textContent;b.replaceWith(sp)});w.appendChild(c);return w} function months(h){var w=D.createElement("div");var ms=h.months||[];var mx=Math.max.apply(null,ms.map(function(m){return m.n||0}).concat([1]));var cur=q().get("from"); var strip=D.createElement("div");strip.className="months";ms.forEach(function(m){var b=D.createElement("button");b.className="mo";b.type="button";b.style.height=Math.max(1,Math.round((m.n||0)/mx118))+"px";b.title=(m.label||m.m||m.key||"")+" · "+num(m.n)+" reports";b.setAttribute("aria-label",b.title); var k=m.m||m.key||m.label;if(k&&cur&&cur.slice(0,7)===String(k).slice(0,7))b.classList.add("on");b.onclick=function(){var p=q();var y=String(k).slice(0,4),mo=String(k).slice(5,7)||"01";p.set("from",y+"-"+mo+"-01");var d=new Date(+y,+mo,0);p.set("to",y+"-"+mo+"-"+String(d.getDate()).padStart(2,"0"));go(p)};strip.appendChild(b)}); w.appendChild(strip);var ax=D.createElement("div");ax.className="axis";ax.innerHTML=""+esc((ms[0]||{}).m||(ms[0]||{}).label||"1995")+""+esc((ms[ms.length-1]||{}).m||(ms[ms.length-1]||{}).label||"today")+"";w.appendChild(ax); var c=D.createElement("p");c.className="cannot";c.textContent="Click a month to take it. "+num(ms.length)+" months; the newest are still filling up, since reports reach the FAA days to years after the defect.";w.appendChild(c);return w} function ladder(rows,key,labelOf,noteText){var w=D.createElement("div");var l=D.createElement("div");l.className="ladder";var mx=Math.max.apply(null,rows.map(function(r){return r.n||0}).concat([1])); rows.slice(0,14).forEach(function(r){var b=D.createElement("button");b.type="button";b.innerHTML=''+esc(labelOf(r))+''+num(r.n)+'';b.onclick=function(){var p=q();p.set(key,r.key||r.code);go(p)};l.appendChild(b)}); w.appendChild(l);var c=D.createElement("p");c.className="cannot";c.textContent=noteText;w.appendChild(c);return w} function who(h){var w=D.createElement("div");var ops=(h.operator_rows||h.operators||[]).map(function(o){return{key:o.o||o.key||o.code,n:o.n,label:o.label||o.name||o.o||o.key}}); var e=D.createElement("p");e.className="eyebrow";e.textContent="Airlines, by reports filed";w.appendChild(e);w.appendChild(ladder(ops,"operator",function(r){return opName(r.label)||r.label},"The airline list counts every report. Airline names come from the FAA’s 2006 cross-reference and can be stale.")); var tails=(h.swarm||[]).slice(0,14).map(function(t){var k=t.t||t.tail||t.key||t.n_number||"";return{key:k,n:t.n||t.reports,label:"N"+k}});if(tails.length){var e2=D.createElement("p");e2.className="eyebrow";e2.style.marginTop="18px";e2.textContent="Most-reported airframes";w.appendChild(e2);w.appendChild(ladder(tails,"tail",function(r){return r.label},"The tail list shows the 900 most-reported aircraft out of "+num(h.aircraft)+"."))}return w} function forced(h){var w=D.createElement("div");var rows=(h.crew||[]).filter(function(c){return c.n>0&&["K","0","O"].indexOf(c.code)2}) .sort(function(a,b){return b.text.length-a.text.length}) .forEach(function(t){var e=esc(t.text).replace(/[.+?^${}()|[]\]/g,"\$&"); h=h.replace(new RegExp("(^|[^\w>])("+e+")(?![^)","i"),function(_,a,b){ return a+''+b+''})}); return h} / hand-written, 3 September 2026: the reading used to link three or four words the model picked to Perplexity searches. The picks were arbitrary and the reader could not steer them. Now one editable question, built from the report's own fields, goes to Perplexity in a new tab, and beside it the
(原文较长,此处译出前 6000 字,完整内容请点「打开原文」。)
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。