mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-11-04 12:22:26 +01:00
1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
import{B as e,E as t,F as n,G as r,I as i,J as a,N as o,O as s,Q as c,S as l,U as u,V as ee,b as d,g as te,h as f,l as p,m as ne,o as m,r as h,s as g,u as _,vt as v,w as re,yt as y}from"./runtime-core.esm-bundler-Bf9AMS9g.js";import{o as ie}from"./runtime-dom.esm-bundler-BEOB_s5k.js";import{t as ae}from"./packets-LMZdG6Cm.js";import{m as oe}from"./index-B3_WAJA_.js";import{_ as se,a as ce,c as le,f as ue,g as de,i as fe,l as pe,m as me,n as he,o as ge,p as _e,r as ve,s as ye,t as be,u as xe,v as Se,y as Ce}from"./ChartCard-DkUDxN-u.js";import{t as b}from"./streamingFetch-BfBAE1L-.js";import"./chartjs-adapter-date-fns.esm-DQ6UT87Y.js";import{t as we}from"./RadioScopeSelector-Dtm_gWE-.js";import{a as Te,i as Ee,o as De,r as Oe}from"./radioAnalytics-CWBET8Wd.js";import{t as x}from"./Sparkline-BuWA0MVa.js";function ke(e){return e.noise_floor_dbm??e.noise_floor??null}var Ae={class:`p-3 sm:p-6 space-y-4 sm:space-y-6`},je={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3`},Me={class:`flex flex-wrap items-center gap-3 sm:gap-4`},Ne={class:`flex items-center gap-2 sm:gap-3`},Pe=[`value`],Fe={class:`grid grid-cols-1 sm:grid-cols-3 gap-4`},Ie={key:0,class:`text-xs text-content-muted -mt-2`,"data-testid":`unattributed-note`},Le={class:`glass-card rounded-[15px] p-3 sm:p-6`},Re={class:`text-content-secondary dark:text-content-muted text-ui-caption sm:text-ui-label uppercase tracking-wide mb-2`},ze={class:`flex items-center gap-3 sm:gap-6 mb-3 sm:mb-4`},Be={class:`flex items-center gap-2`},Ve={class:`flex items-center gap-2`},He={class:`grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch`},Ue={class:`glass-card rounded-[15px] p-3 sm:p-6 flex flex-col`},We={key:0,class:`text-xs text-content-muted -mt-2 mb-3`,"data-testid":`noise-floor-radio-note`},Ge={class:`glass-card rounded-[15px] p-3 sm:p-6 flex flex-col`},Ke={key:0,class:`text-xs text-content-muted -mt-2 mb-3`},qe={class:`w-28 sm:w-32 text-sm text-content-primary truncate`},Je={class:`flex-1 h-12 bg-background-mute dark:bg-stroke/opacity-subtle rounded overflow-hidden`},Ye={class:`w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums`},S=20,C=te({name:`StatisticsView`,__name:`Statistics`,setup(te){ge.register(ce,xe,ue,pe,le,ve,ye,_e,Se,Ce,se,he,fe,de,me);let C=ae(),{profiles:w,isMultiRadio:T,scope:E}=oe(),Xe=e=>e>48?{unit:`day`,displayFormats:{day:`EEE MMM d`}}:e>24?{unit:`hour`,displayFormats:{hour:`EEE HH:mm`}}:{unit:`hour`,displayFormats:{hour:`HH:mm`}},D=u({packetRate:`Connecting...`,noiseFloor:`Connecting...`,routePie:`Connecting...`}),O=(e,t)=>typeof window>`u`?t:window.getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t,k=()=>({gridColor:O(`--color-border-subtle`,`lightgray`),tickColor:O(`--color-text-secondary`,`gray`),legendColor:O(`--color-text-primary`,`white`),titleColor:O(`--color-text-primary`,`white`),tooltipBg:O(`--color-surface-elevated`,`black`),tooltipTitle:O(`--color-heading`,`white`),tooltipBody:O(`--color-text-primary`,`white`),tooltipBorder:O(`--color-border-subtle`,`gray`)}),A={tx:O(`--color-accent-red`,`tomato`),rx:O(`--color-secondary`,`violet`),noiseFloor:O(`--color-primary`,`deepskyblue`),noiseFloorFill:O(`--color-primary`,`deepskyblue`),noiseFloorGrid:O(`--color-border-hover`,`gray`),totalRx:O(`--color-accent-cyan`,`cyan`),totalTx:O(`--color-accent-green`,`limegreen`),crcErrors:O(`--color-accent-red`,`tomato`),packetTypes:[O(`--openhop-blue-light`,`lightskyblue`),O(`--color-accent-green`,`limegreen`),O(`--color-primary-bg`,`khaki`),O(`--openhop-purple-light`,`violet`),O(`--color-accent-red`,`tomato`),O(`--color-accent-cyan`,`cyan`),O(`--color-accent-green-bg`,`lightgreen`),O(`--color-accent-purple`,`orchid`),O(`--color-accent-green`,`limegreen`)],routes:[O(`--color-primary`,`deepskyblue`),O(`--color-accent-green`,`limegreen`),O(`--color-accent-cyan`,`cyan`),O(`--color-secondary`,`violet`),O(`--color-accent-red`,`tomato`)]},j=r(24),Ze=[{value:1,label:`1 Hour`},{value:6,label:`6 Hours`},{value:12,label:`12 Hours`},{value:24,label:`24 Hours`},{value:48,label:`2 Days`},{value:168,label:`1 Week`}],M=r(null),N=r(null),P=r(null),F=r(null),Qe=r(null),$e=r([]),I=r([]),et=r(!0),tt=r(null),L=r({packetRate:!0,noiseFloor:!1,routePie:!0,sparklineMetrics:!0,sparklineCrc:!0}),R=r(null),z=r(null),B=r(null),V=r(null),H=r(null),U=r(null),nt=r(null),rt=r(null),W=r(null),it=m(()=>{let e=Oe(W.value,E.value);return{totalRx:e.rx,totalTx:e.tx}}),G=m(()=>E.value===`all`?M.value:N.value?Te(N.value,E.value,Math.floor(Date.now()/1e3)):null),K=m(()=>E.value!==`all`&&!N.value&&!P.value),at=m(()=>De(Qe.value,E.value)),q=m(()=>({rx:W.value?.unattributed_rx_count??0,tx:W.value?.unattributed_tx_count??0})),J=m(()=>{if(!T.value)return{rx:`Total RX`,rxSub:``,tx:`Total TX`,txSub:``,crc:`CRC Errors`,crcSub:``};if(E.value===`all`)return{rx:`Total RX`,rxSub:`All radios`,tx:`Total TX`,txSub:`Per packet`,crc:`CRC Errors`,crcSub:`All radios`};let e=E.value;return{rx:`Total RX`,rxSub:e,tx:`Transmissions`,txSub:e,crc:`CRC Errors`,crcSub:e}}),Y=(e,t)=>{if(e.length===0)return[];let n=Ee(t)*1e3,r=new Map;return e.forEach(([e,t])=>{let i=e;e>0x38d7ea4c68000?i=e/1e3:e>1e9&&e<0xe8d4a51000&&(i=e*1e3);let a=Math.floor(i/n)*n;r.has(a)||r.set(a,[]),r.get(a).push(t)}),Array.from(r.entries()).sort((e,t)=>e[0]-t[0]).map(([,e])=>e.reduce((e,t)=>e+t,0)/e.length)},ot=m(()=>{let e=[],t=[];if(G.value?.series){let n=G.value.series.find(e=>e.type===`rx_count`),r=G.value.series.find(e=>e.type===`tx_count`);n?.data&&(e=Y(n.data.map(([e,t])=>[e,t>S?0:t]),j.value)),r?.data&&(t=Y(r.data.map(([e,t])=>[e,t>S?0:t]),j.value))}return{totalPackets:e,transmittedPackets:t,droppedPackets:[],crcErrors:Y(I.value.map(e=>[e.timestamp>0xe8d4a51000?e.timestamp:e.timestamp*1e3,e.count]),j.value)}}),st=async()=>{try{et.value=!0,tt.value=null,W.value=(await b(`/packet_stats`,{hours:j.value})).data??null,et.value=!1}catch(e){tt.value=e instanceof Error?e.message:`Failed to fetch data`,et.value=!1}ct()},ct=async()=>{L.value={packetRate:!0,noiseFloor:!0,routePie:!0,sparklineMetrics:!0,sparklineCrc:!0},C.metricsGraphData&&(M.value=C.metricsGraphData),C.crcErrorHistory.length>0&&(I.value=[...C.crcErrorHistory]),C.noiseFloorHistory.length>0&&(F.value={chart_data:C.noiseFloorHistory.map(e=>({timestamp:e.timestamp,noise_floor_dbm:e.noise_floor_dbm}))},$()),X(),ut(),dt(),ft()},lt=0,X=async()=>{let e=++lt;D.packetRate=`Connecting...`,R.value=null;let t=j.value,n=T.value,[r,i]=await Promise.allSettled([b(`/metrics_graph_data`,{hours:t,resolution:`average`,metrics:`rx_count,tx_count`},{onPhaseChange:e=>{D.packetRate=e===`receiving`?`Receiving data...`:`Connecting...`}}),n?b(`/radio_packet_rates`,{hours:t,bucket_seconds:Ee(t)}):Promise.resolve(null)]);if(e===lt){if(r.status===`fulfilled`)r.value?.success&&(M.value=r.value.data);else{let e=r.reason;R.value=e instanceof Error?e.message:`Failed to load`,M.value=null}if(!n)N.value=null,P.value=null;else if(i.status===`fulfilled`&&i.value?.success)N.value=i.value.data??null,P.value=null;else{let e=i.status===`rejected`?i.reason:null;N.value=null,P.value=e instanceof Error?e.message:`Per-radio packet counts are unavailable`}L.value.packetRate=!1,L.value.sparklineMetrics=!1,R.value||(await d(),ht())}},ut=async()=>{D.routePie=`Connecting...`,z.value=null;try{let e=await b(`/route_stats`,{hours:j.value},{onPhaseChange:e=>{D.routePie=e===`receiving`?`Receiving data...`:`Connecting...`}});e?.success&&e.data&&(Qe.value=e.data)}catch(e){Qe.value=null,z.value=e instanceof Error?e.message:`Failed to load`}finally{L.value.routePie=!1}},Z=0,Q=0,dt=async()=>{let e=++Z;D.noiseFloor=`Connecting...`,B.value=null;try{let t=j.value*120*Math.max(1,w.value.length),n={hours:j.value,limit:t};E.value!==`all`&&(n.radio_id=E.value);let r=await b(`/noise_floor_history`,n,{idleTimeoutMs:3e4,onPhaseChange:e=>{D.noiseFloor=e===`receiving`?`Receiving data...`:`Connecting...`}});if(e!==Z)return;if(r.success&&r.data){let e=r.data.history||[];if(!Array.isArray(e)||e.length===0)F.value={chart_data:[]},$();else{let t=new Map;for(let n of e){let e=n.radio_id??null,r=t.get(e);r?r.push(n):t.set(e,[n])}let n=Math.max(1,Math.floor(1500/t.size)),r=[];for(let e of t.values()){let t=e.length>n?Math.ceil(e.length/n):1;r.push(...e.filter((e,n)=>n%t===0))}r.sort((e,t)=>(e.timestamp??0)-(t.timestamp??0)),F.value={chart_data:r.map(e=>({timestamp:e.timestamp??Date.now()/1e3,noise_floor_dbm:ke(e),radio_id:e.radio_id??null}))},$()}}}catch(t){if(e!==Z)return;F.value={chart_data:[]},B.value=t instanceof Error?t.message:`Failed to load`}finally{e===Z&&(L.value.noiseFloor=!1,B.value||(await d(),vt()))}},ft=async()=>{let e=++Q;V.value=null;try{let t={hours:j.value};E.value!==`all`&&(t.radio_id=E.value);let n=await b(`/crc_error_history`,t);if(e!==Q)return;n?.success&&n.data&&(I.value=n.data.history||[])}catch(t){if(e!==Q)return;I.value=[],V.value=t instanceof Error?t.message:`Failed to load`}finally{e===Q&&(L.value.sparklineCrc=!1)}},pt=()=>{L.value={packetRate:!0,noiseFloor:!0,routePie:!0,sparklineMetrics:!0,sparklineCrc:!0},mt(),R.value=null,z.value=null,B.value=null,st()},$=()=>{$e.value=[],F.value?.chart_data&&F.value.chart_data.length>0&&($e.value=F.value.chart_data.map(e=>({timestamp:e.timestamp*1e3,snr:null,rssi:null,noiseFloor:e.noise_floor_dbm,radioId:e.radio_id??null})))},mt=()=>{try{H.value&&=(H.value.destroy(),null),U.value&&=(U.value.destroy(),null)}catch(e){console.error(`Error destroying charts:`,e)}},ht=()=>{if(!nt.value)return;let e=nt.value.getContext(`2d`);if(!e||K.value)return;let t=[],n=[];if(G.value?.series){let e=G.value.series.find(e=>e.type===`rx_count`),r=G.value.series.find(e=>e.type===`tx_count`);e?.data&&(t=e.data.map(([e,t])=>{let n=e;return n=e>0x38d7ea4c68000?e/1e3:e>0xe8d4a51000?e:e>1e9?e*1e3:Date.now(),{x:n,y:t>S?0:t*3600}})),r?.data&&(n=r.data.map(([e,t])=>{let n=e;return n=e>0x38d7ea4c68000?e/1e3:e>0xe8d4a51000?e:e>1e9?e*1e3:Date.now(),{x:n,y:t>S?0:t*3600}}))}if(t.length===0&&n.length===0){R.value=E.value!==`all`&&P.value?P.value:`No data available for the selected time range`;return}R.value=null,H.value&&=(H.value.destroy(),null);let r=Ee(j.value)*1e3,i=e=>{if(e.length===0)return[];let t=new Map;return e.forEach(e=>{let n=Math.floor(e.x/r)*r;t.has(n)||t.set(n,[]),t.get(n).push(e.y)}),Array.from(t.entries()).map(([e,t])=>({x:e,y:t.reduce((e,t)=>e+t,0)/t.length})).sort((e,t)=>e.x-t.x)},a=(e,t=3)=>{if(e.length<t)return e;let n=[];for(let r=0;r<e.length;r++){let i=Math.max(0,r-Math.floor(t/2)),a=Math.min(e.length,r+Math.ceil(t/2)),o=e.slice(i,a),s=o.reduce((e,t)=>e+t.y,0)/o.length;n.push({x:e[r].x,y:s})}return n},o=a(i(t)),s=a(i(n)),c=[...o.map(e=>e.y),...s.map(e=>e.y)],l=Math.min(...c),u=Math.max(...c),d=u-l||u*.1||.001,te=Math.max(0,l-d*.05),f=u+d*.05;try{let t=JSON.parse(JSON.stringify(o));H.value=ee(new ge(e,{type:`line`,data:{datasets:[{label:`TX/hr`,data:JSON.parse(JSON.stringify(s)),borderColor:A.tx,backgroundColor:A.tx,borderWidth:2,fill:`origin`,tension:.4,pointRadius:0,pointHoverRadius:3,order:1},{label:`RX/hr`,data:t,borderColor:A.rx,backgroundColor:A.rx,borderWidth:2,fill:`origin`,tension:.4,pointRadius:0,pointHoverRadius:3,order:2}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:`index`,intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:!0,backgroundColor:k().tooltipBg,titleColor:k().tooltipTitle,bodyColor:k().tooltipBody,borderColor:k().tooltipBorder,borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(e){let t=e[0]?.parsed?.x;return t==null?``:new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})},label:function(e){let t=e.dataset?.label||``,n=e.parsed?.y;return n==null?t:`${t}: ${n.toFixed(1)}`}}}},scales:{x:{type:`time`,time:Xe(j.value),min:Date.now()-j.value*3600*1e3,max:Date.now(),grid:{color:k().gridColor},ticks:{color:k().tickColor,maxTicksLimit:8}},y:{beginAtZero:!1,title:{display:!0,text:`Packets / Hour`,color:k().tickColor},grid:{color:k().gridColor},ticks:{color:k().tickColor,callback:function(e){return typeof e==`number`?e.toFixed(1):e}},min:te,max:f}}}}))}catch(e){console.error(`Error creating packet rate chart:`,e),R.value=`Failed to render chart`}},gt=e=>e.map(e=>({label:e.label,data:JSON.parse(JSON.stringify(e.points.map(e=>({x:e.x,y:e.y})))),borderWidth:0,backgroundColor:e.color,pointRadius:3,pointHoverRadius:5,pointStyle:`circle`})),_t=m(()=>{let e=$e.value.filter(e=>e.noiseFloor!==null&&e.noiseFloor!==void 0).map(e=>({x:e.timestamp,y:e.noiseFloor,radioId:e.radioId}));if(!T.value||E.value!==`all`)return[{label:`Noise Floor (dBm)`,color:A.noiseFloorFill,points:e}];let t=w.value.map(e=>e.radioId),n=[A.noiseFloorFill,O(`--openhop-purple-light`,`#a78bfa`),O(`--color-accent-cyan`,`#06b6d4`),O(`--color-accent-green`,`#10b981`)],r=new Map;for(let e of t)r.set(e,[]);for(let t of e){let e=t.radioId!=null&&r.has(t.radioId)?t.radioId:null;r.has(e)||r.set(e,[]),r.get(e).push(t)}return[...r.entries()].filter(([,e])=>e.length>0).map(([e,r])=>({label:e??`no radio`,color:n[(e===null?t.length:t.indexOf(e))%n.length],points:r}))}),vt=()=>{if(!rt.value)return;let e=rt.value.getContext(`2d`);if(!e)return;let t=_t.value,n=t.flatMap(e=>e.points).map(e=>e.y),r=n.length>0?Math.min(...n):-120,i=n.length>0?Math.max(...n):-110,o=i-r||1,s=r-o*.05,c=i+o*.05;if(U.value)try{let e=a(U.value);e.data.datasets=gt(t),e.options?.scales?.x&&(e.options.scales.x.min=Date.now()-j.value*3600*1e3,e.options.scales.x.max=Date.now(),e.options.scales.x.time=Xe(j.value)),e.options?.scales?.y&&(e.options.scales.y.min=s,e.options.scales.y.max=c),e.options?.scales?.y?.ticks&&(e.options.scales.y.ticks.color=k().tickColor),e.options?.plugins?.legend?.labels&&(e.options.plugins.legend.labels.color=k().legendColor),e.update();return}catch{U.value.destroy(),U.value=null}U.value=ee(new ge(e,{type:`scatter`,data:{datasets:gt(t)},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:`index`,intersect:!1},plugins:{legend:{display:!0,position:`top`,labels:{color:k().legendColor,usePointStyle:!0,padding:20}},tooltip:{enabled:!0,backgroundColor:k().tooltipBg,titleColor:k().tooltipTitle,bodyColor:k().tooltipBody,borderColor:k().tooltipBorder,borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(e){let t=e[0]?.parsed?.x;return t==null?``:new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})},label:function(e){let t=e.dataset?.label||``,n=e.parsed?.y;return n==null?t:`${t}: ${n.toFixed(1)} dBm`}}}},scales:{x:{type:`time`,time:Xe(j.value),min:Date.now()-j.value*3600*1e3,max:Date.now(),grid:{color:k().gridColor},ticks:{color:k().tickColor,maxTicksLimit:8}},y:{type:`linear`,display:!0,title:{display:!0,text:`Noise Floor (dBm)`,color:k().titleColor},grid:{color:A.noiseFloorGrid},ticks:{color:k().tickColor,callback:function(e){return typeof e==`number`?e.toFixed(1):e}},min:s,max:c}}}}))};return o(E,async()=>{L.value.noiseFloor=!0,L.value.sparklineCrc=!0,B.value=null,dt(),ft(),await d(),ht()}),o(T,e=>{e&&!N.value&&X()}),re(async()=>{await d(),st(),window.addEventListener(`resize`,()=>{setTimeout(()=>{a(H.value)?.resize(),a(U.value)?.resize()},100)})}),l(()=>{H.value?.destroy(),U.value?.destroy(),window.removeEventListener(`resize`,()=>{})}),(r,a)=>(t(),_(`div`,Ae,[g(`div`,je,[a[9]||=g(`h1`,{class:`text-ui-title sm:text-ui-title-lg font-bold text-content-primary`},` Statistics `,-1),g(`div`,Me,[f(we,{modelValue:c(E),"onUpdate:modelValue":a[0]||=t=>e(E)?E.value=t:null,radios:c(w)},null,8,[`modelValue`,`radios`]),g(`div`,Ne,[a[8]||=g(`label`,{class:`text-content-secondary dark:text-content-muted text-ui-caption sm:text-ui-label`},`Time Range:`,-1),i(g(`select`,{"onUpdate:modelValue":a[1]||=e=>j.value=e,onChange:pt,class:`modal-select w-auto`},[(t(),_(h,null,s(Ze,e=>g(`option`,{key:e.value,value:e.value,class:`bg-surface text-content-primary`},y(e.label),9,Pe)),64))],544),[[ie,j.value]])])])]),g(`div`,Fe,[f(x,{title:J.value.rx,subtitle:J.value.rxSub,value:it.value.totalRx,color:A.totalRx,data:ot.value.totalPackets,loading:L.value.sparklineMetrics||K.value,error:R.value,variant:`classic`,onRetry:a[2]||=()=>{L.value.sparklineMetrics=!0,L.value.packetRate=!0,R.value=null,X()}},null,8,[`title`,`subtitle`,`value`,`color`,`data`,`loading`,`error`]),f(x,{title:J.value.tx,subtitle:J.value.txSub,value:it.value.totalTx,color:A.totalTx,data:ot.value.transmittedPackets,loading:L.value.sparklineMetrics||K.value,error:R.value,variant:`classic`,onRetry:a[3]||=()=>{L.value.sparklineMetrics=!0,L.value.packetRate=!0,R.value=null,X()}},null,8,[`title`,`subtitle`,`value`,`color`,`data`,`loading`,`error`]),f(x,{title:J.value.crc,subtitle:J.value.crcSub,value:I.value.reduce((e,t)=>e+t.count,0),color:A.crcErrors,data:ot.value.crcErrors,loading:L.value.sparklineCrc,error:V.value,variant:`classic`,onRetry:a[4]||=()=>{L.value.sparklineCrc=!0,V.value=null,ft()}},null,8,[`title`,`subtitle`,`value`,`color`,`data`,`loading`,`error`])]),c(E)!==c(`all`)&&(q.value.rx>0||q.value.tx>0)?(t(),_(`p`,Ie,y(q.value.rx)+` receptions and `+y(q.value.tx)+` transmissions in this window have no recorded radio, so they are not counted for `+y(c(E))+`. `,1)):p(``,!0),g(`div`,Le,[a[13]||=g(`h3`,{class:`text-content-primary text-ui-section sm:text-ui-title font-semibold mb-3 sm:mb-4`},` Performance Metrics `,-1),g(`div`,null,[g(`p`,Re,[a[10]||=ne(` Packet Rate (RX/TX PER HOUR)`,-1),c(E)===c(`all`)?p(``,!0):(t(),_(h,{key:0},[ne(` · `+y(c(E)),1)],64))]),g(`div`,ze,[g(`div`,Be,[g(`div`,{class:`w-3 h-3 rounded-full`,style:v({backgroundColor:A.rx})},null,4),a[11]||=g(`span`,{class:`text-content-secondary dark:text-content-muted text-ui-label`},`RX/hr`,-1)]),g(`div`,Ve,[g(`div`,{class:`w-3 h-3 rounded-full`,style:v({backgroundColor:A.tx})},null,4),a[12]||=g(`span`,{class:`text-content-secondary dark:text-content-muted text-ui-label`},`TX/hr`,-1)])]),f(be,{class:`h-40 sm:h-48 rounded-lg p-2 sm:p-4`,"is-loading":L.value.packetRate||K.value,error:R.value,status:D.packetRate,onRetry:a[5]||=()=>{L.value.packetRate=!0,R.value=null,X()}},{default:n(()=>[g(`canvas`,{ref_key:`packetRateCanvasRef`,ref:nt,class:`w-full h-full relative z-10`},null,512)]),_:1},8,[`is-loading`,`error`,`status`])])]),g(`div`,He,[g(`div`,Ue,[a[14]||=g(`h3`,{class:`text-content-primary text-ui-section sm:text-ui-title font-semibold mb-3 sm:mb-4`},` Noise Floor Over Time `,-1),c(T)?(t(),_(`p`,We,y(c(E)===c(`all`)?`One line per radio; noise floors are not comparable across bands.`:`Measured on ${c(E)}.`),1)):p(``,!0),f(be,{class:`flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg`,"is-loading":L.value.noiseFloor,error:B.value,status:D.noiseFloor,onRetry:a[6]||=()=>{L.value.noiseFloor=!0,B.value=null,dt()}},{default:n(()=>[g(`canvas`,{ref_key:`signalMetricsCanvasRef`,ref:rt,class:`absolute inset-0 w-full h-full`},null,512)]),_:1},8,[`is-loading`,`error`,`status`])]),g(`div`,Ge,[a[15]||=g(`h3`,{class:`text-content-primary text-ui-section sm:text-ui-title font-semibold mb-3 sm:mb-4`},` Route Distribution `,-1),c(E)===c(`all`)?p(``,!0):(t(),_(`p`,Ke,` Receptions on `+y(c(E))+`. `,1)),f(be,{class:`flex-1 flex flex-col justify-evenly min-h-[8rem]`,"is-loading":L.value.routePie,error:z.value,status:D.routePie,onRetry:a[7]||=()=>{L.value.routePie=!0,z.value=null,ut()}},{default:n(()=>[at.value?(t(!0),_(h,{key:0},s(at.value,(e,n,r)=>(t(),_(`div`,{key:n,class:`flex items-center gap-3`},[g(`div`,qe,y(n),1),g(`div`,Je,[g(`div`,{class:`h-full rounded transition-all duration-300`,style:v({width:`${e/Math.max(...Object.values(at.value))*100}%`,backgroundColor:A.routes[r%A.routes.length]})},null,4)]),g(`div`,Ye,y(e.toLocaleString()),1)]))),128)):p(``,!0)]),_:1},8,[`is-loading`,`error`,`status`])])])]))}});export{C as default}; |