1import{u as o,j as e,P as h,G as x,c as d,b as u}from"./index-CfycvL5P.js";import{u as p}from"./features-9UbirI8q.js";function b(){const{scraperEnabled:s}=p(),a=o({queryKey:["readyz"],queryFn:async()=>{const{data:t,error:c}=await u.GET("/api/internal/readyz");if(c)throw new Error("readiness check failed");return t},refetchInterval:3e4}),r=o({queryKey:["poller-health"],enabled:s,queryFn:async()=>await(await fetch("/api/internal/poller/health",{credentials:"include"})).json(),refetchInterval:6e4});return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Overview",note:s?"Is the system alive, is it recording, and what has it spent. The poller heartbeat is shown even when nothing is wrong, because for a recorder the failure mode is silence rather than errors â a poller that died quietly loses history that cannot be re-acquired.":"Is the system alive, and what has it spent. Status scraping is deferred to a later stage, so there is no poller to report."}),e.jsx(x,{terms:s?["Poller","CPO","Connector","Archive","Change log","Dead-man's switch"]:["CPO","Connector"]}),s&&e.jsxs("section",{className:"max-w-3xl",children:[e.jsx(i,{children:"Poller"}),r.isPending?e.jsx("p",{className:"font-data text-[13px] text-ink-faint",children:"â¦"}):r.isError||!r.data?e.jsx("p",{className:"bg-warn-ground px-2 py-1 font-data text-[13px] text-warn",children:"Could not reach the poller health endpoint."}):e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:"border-t border-rule",children:[e.jsx(n,{label:"Recording",value:r.data.never_run?"never run":r.data.alive?"alive":`silent > ${r.data.threshold_minutes} min`,warn:!r.data.never_run&&!r.data.alive,ok:r.data.alive&&!r.data.never_run}),e.jsx(n,{label:"Dead-man threshold",value:`${r.data.threshold_minutes} min`})]}),e.jsxs("table",{className:"mt-4 w-full border-t border-rule text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"font-ui text-[10px] tracking-[0.08em] text-ink-faint uppercase",children:[e.jsx("th",{className:"py-1 font-medium",children:"Source"}),e.jsx("th",{className:"py-1 font-medium",children:"State"}),e.jsx("th",{className:"py-1 text-right font-medium",title:"Pages archived losslessly",children:"Pages"}),e.jsx("th",{className:"py-1 text-right font-medium",title:"Connectors the source reported in its last successful poll",children:"Connectors"}),e.jsx("th",{className:"py-1 text-right font-medium",title:"Status changes recorded. Zero is normal â this is a change log.",children:"Changes"}),e.jsx("th",{className:"py-1 text-right font-medium",children:"Silent for"})]})}),e.jsx("tbody",{children:r.data.sources.map(t=>e.jsxs("tr",{className:"border-t border-rule align-top",children:[e.jsx("td",{className:"py-1.5 font-data text-[13px]",children:t.source}),e.jsx("td",{className:"py-1.5 text-[13px]",children:t.pollable?e.jsx("span",{className:"font-data",children:t.stale?"stalled":"polling"}):e.jsx("span",{className:"font-data text-ink-faint",title:t.blocking_reason??void 0,children:"not authorised"})}),e.jsx("td",{className:d("py-1.5 text-right font-data text-[13px] tabular-nums",t.pollable&&t.raw_pages_last_run===0&&"bg-warn-ground text-warn"),children:t.pollable?t.raw_pages_last_run:"â"}),e.jsx("td",{className:d("py-1.5 text-right font-data text-[13px] tabular-nums",t.pollable&&t.connectors_last_run===0&&"bg-warn-ground text-warn"),children:t.pollable?t.connectors_last_run:"â"}),e.jsx("td",{className:"py-1.5 text-right font-data text-[13px] text-ink-muted tabular-nums",children:t.pollable?t.events_last_run:"â"}),e.jsx("td",{className:"py-1.5 text-right font-data text-[13px] tabular-nums",children:t.silent_for_seconds===null?"â":`${Math.round(t.silent_for_seconds/60)}m`})]},t.source))})]}),e.jsxs("p",{className:"mt-2 max-w-prose font-data text-[11px] text-ink-faint",children:["A source reads ânot authorisedâ until its terms, rate limit and authorisation are recorded in ",e.jsx("code",{children:"app/domain/polling/sources.py"}),". That is deliberate â traffic requires a reviewed change, never a default."]}),e.jsxs("p",{className:"mt-1 max-w-prose font-data text-[11px] text-ink-faint",children:[e.jsx("strong",{children:"Changes of zero is healthy."})," We store one row per status transition, not one per observation, so a quiet five minutes writes nothing. The numbers that must not be zero on a live source are ",e.jsx("em",{children:"pages"})," â the lossless archive â and"," ",e.jsx("em",{children:"connectors"}),", which reads zero when an endpoint answers 200 with an empty feed."]})]})]}),e.jsxs("section",{className:"mt-8 max-w-3xl",children:[e.jsx(i,{children:"Backend"}),e.jsxs("dl",{className:"border-t border-rule",children:[e.jsx(n,{label:"Database",value:l(a.isPending,a.isError,a.data?.database)}),e.jsx(n,{label:"PostGIS",value:l(a.isPending,a.isError,a.data?.postgis)}),e.jsx(n,{label:"Environment",value:l(a.isPending,a.isError,a.data?.env)}),e.jsx(n,{label:"Paid providers enabled",value:a.isPending||a.isError?"â¦":a.data.paid_providers_enabled.length?a.data.paid_providers_enabled.join(", "):"none"})]})]}),e.jsxs("section",{className:"mt-8 max-w-3xl",children:[e.jsx(i,{children:"Awaiting their Part"}),e.jsxs("dl",{className:"border-t border-rule",children:[e.jsx(n,{label:"Spend today",value:"not built â PLAN C.2",warn:!0}),e.jsx(n,{label:"Stale data layers",value:"not built â PLAN C.5",warn:!0})]})]})]})}function l(s,a,r){return s?"â¦":a||r===void 0?"unknown":r}function i({children:s}){return e.jsx("h2",{className:"mb-2 font-ui text-[10px] font-bold tracking-[0.08em] text-ink-faint uppercase",children:s})}function n({label:s,value:a,warn:r=!1,ok:t=!1}){return e.jsxs("div",{className:"flex justify-between gap-4 border-b border-rule py-1.5",children:[e.jsx("dt",{className:"font-ui text-[13px] text-ink-muted",children:s}
1),e.jsx("dd",{className:r?"bg-warn-ground px-1 font-data text-[13px] text-warn":t?"bg-ok-ground px-1 font-data text-[13px] text-ok":"font-data text-[13px] tabular-nums",children:a})]})}export{b as Overview}; 2//# sourceMappingURL=Overview-CagKeB-K.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.