PageSourceSearch

https://shiftnex.ai/assets/StatusComponentPage-BYAmok3F.js

js shiftnex.ai collected 2026-10-05 12:36:35 UTC 8,347 bytes, 1 lines download raw bytes

1import{u as L,g as T,r as p,b as S,c as E,T as A,j as e,L as d,A as C,d as D}from"./index-ByN0RtWI.js";import{v as r,f as y,a as v}from"./v3-design-Usx7DSJe.js";import{E as B}from"./external-link-CDQOhTzU.js";const M="https://uzqyppurmtmepdlzquqq.supabase.co",g={operational:{label:"Operational",color:"#0a9981",bg:"#e7f6f1",icon:S},degraded:{label:"Partial degradation",color:"#d97706",bg:"#fef3c7",icon:A},outage:{label:"Major outage",color:"#dc2626",bg:"#fee2e2",icon:E},"no-data":{label:"No recent data",color:r.muted,bg:r.gray2,icon:S}};function w(o,l){return l?o>=99.9?"operational":o>=99?"degraded":"outage":"no-data"}function u(o){return o?`${Math.round(o)}ms`:"—"}function W(o){return new Date(o).toLocaleString()}function U(){const{componentId:o="api"}=L(),[l]=T(),c=l.get("date")??"",[s,b]=p.useState(null),[h,f]=p.useState(null);p.useEffect(()=>{b(null),f(null);const t=new URLSearchParams({component:o});c&&t.set("date",c),document.title=`${o} status — ShiftNex AI`,fetch(`${M}/functions/v1/status-component?${t.toString()}`).then(a=>a.json()).then(a=>{a.error?f(a.error):b(a)}).catch(a=>f(String(a)))},[o,c]);const i=g[(s==null?void 0:s.summary.status)??"operational"],N=i.icon,z=p.useMemo(()=>s?Math.max(1,...s.hourly.map(t=>t.total)):1,[s]);return e.jsxs("div",{className:"min-h-screen",style:{background:r.gray,color:r.dark,fontFamily:y.sans},children:[e.jsx("nav",{className:"fixed top-0 inset-x-0 z-50 backdrop-blur-xl",style:{background:"rgba(255,255,255,0.85)",borderBottom:`1px solid ${r.border}`,height:44},children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 sm:px-6 h-full flex items-center justify-between",children:[e.jsxs(d,{to:"/status",className:"flex items-center gap-2",style:{textDecoration:"none",color:r.dark},children:[e.jsx(C,{className:"h-3.5 w-3.5"}),e.jsx("span",{style:{fontSize:13,fontWeight:600},children:"Status"})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-4",style:{fontSize:12,color:r.muted},children:[e.jsx(d,{to:"/api",className:"hover:opacity-70",children:"API Docs"}),e.jsx(d,{to:"/api/policies/sla",className:"hover:opacity-70",children:"SLA"})]})]})}),e.jsxs("main",{className:"max-w-5xl mx-auto px-5 sm:px-6 pt-24 pb-24",children:[e.jsxs("div",{style:v.chip,children:[e.jsx("span",{style:v.chipDot}),e.jsx("span",{children:"Component health"})]}),e.jsx("h1",{style:{fontFamily:y.serif,fontSize:44,fontWeight:400,letterSpacing:"-0.025em",margin:"12px 0 6px"},children:(s==null?void 0:s.component.label)??o}),e.jsxs("p",{style:{fontSize:14,color:r.mid,marginBottom:24},children:[c?`Detailed health for ${c} (UTC).`:"Detailed health for the last 24 hours."," ",e.jsx(d,{to:"/status",style:{color:r.dark,textDecoration:"underline"},children:"Back to overview"})]}),h&&e.jsxs("div",{style:{background:"#fee2e2",border:"1px solid #fecaca",color:"#991b1b",padding:14,borderRadius:10,marginBottom:24,fontSize:13},children:["Couldn't load detail: ",h]}),!s&&!h&&e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(D,{className:"h-5 w-5 animate-spin",style:{color:r.muted}})}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-8",style:{background:i.bg,border:`1px solid ${i.color}33`,borderRadius:14,padding:"16px 20px"},children:[e.jsx(N,{className:"h-5 w-5 flex-shrink-0",style:{color:i.color}}),e.jsx("div",{style:{fontWeight:600,color:i.color,fontSize:15},children:i.label})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8",children:[e.jsx(n,{label:"Uptime",value:`${s.summary.uptime.toFixed(2)}%`}),e.jsx(n,{label:"Requests",value:s.summary.total.toLocaleString()}),e.jsx(n,{label:"Errors (5xx)",value:s.summary.errors.toLocaleString()}),e.jsx(n,{label:"p95 latency",value:u(s.summary.p95)}),e.jsx(n,{label:"p50 latency",value:u(s.summary.p50)}),e.jsx(n,{label:"p99 latency",value:u(s.summary.p99)}),e.jsx(n,{label:"Window",value:s.scope.label}),e.jsx(n,{label:"Generated",value:new Date(s.generatedAt).toLocaleTimeString()})]}),e.jsxs(j,{title:"Hourly volume & errors",children:[e.jsx("div",{className:"flex items-end gap-[2px] w-full",style:{height:80},children:s.hourly.map(t=>{const a=t.total/z*100,R=w(t.uptime,t.total),$=g[R].color;
1return e.jsx("div",{title:`${new Date(t.hour).toLocaleString()} · ${t.total} req · ${t.errors} err · p95 ${Math.round(t.p95)}ms`,style:{flex:1,height:`${Math.max(a,t.total?6:2)}%`,background:t.total?$:r.gray2,borderRadius:2,minWidth:2,opacity:t.total?1:.5}},t.hour)})}),e.jsxs("div",{className:"flex justify-between mt-2",style:{fontSize:10,color:r.muted},children:[e.jsx("span",{children:new Date(s.scope.start).toLocaleString()}),e.jsx("span",{children:new Date(s.scope.end).toLocaleString()})]})]}),e.jsx(j,{title:"Top routes (checks)",children:s.checks.length===0?e.jsx(k,{children:"No traffic in this window."}):e.jsx("div",{className:"overflow-hidden",style:{border:`1px solid ${r.border}`,borderRadius:10},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:r.gray2,color:r.muted,textAlign:"left"},children:[e.jsx(m,{children:"Route"}),e.jsx(m,{children:"Requests"}),e.jsx(m,{children:"Errors"}),e.jsx(m,{children:"Uptime"}),e.jsx(m,{children:"p95"})]})}),e.jsx("tbody",{children:s.checks.map(t=>{const a=w(t.uptime,t.total);return e.jsxs("tr",{style:{borderTop:`1px solid ${r.border}`},children:[e.jsx(x,{mono:!0,children:t.key}),e.jsx(x,{children:t.total.toLocaleString()}),e.jsx(x,{children:t.errors}),e.jsx(x,{children:e.jsxs("span",{style:{color:g[a].color,fontWeight:500},children:[t.uptime.toFixed(2),"%"]})}),e.jsx(x,{children:u(t.p95)})]},t.key)})})]})})}),e.jsx(j,{title:"Recent errors",children:s.recentErrors.length===0?e.jsx(k,{children:"No errors recorded in this window. 🎉"}):e.jsx("div",{className:"flex flex-col gap-2",children:s.recentErrors.map((t,a)=>e.jsxs("div",{style:{background:r.white,border:`1px solid ${r.border}`,borderRadius:10,padding:14},children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-1",children:[e.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"#dc2626"},children:[t.status_code??"ERR"," ",t.error_code?`· ${t.error_code}`:""]}),e.jsx("div",{style:{fontSize:11,color:r.muted},children:W(t.at)})]}),e.jsxs("div",{style:{fontSize:12,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:r.mid,marginBottom:4},children:[t.method??"GET"," ",t.path??"—"]}),t.error_message&&e.jsx("div",{style:{fontSize:12,color:r.dark,whiteSpace:"pre-wrap"},children:t.error_message})]},a))})}),e.jsxs("div",{style:{background:r.white,border:`1px solid ${r.border}`,borderRadius:14,padding:18,marginTop:24,display:"flex",justifyContent:"space-between",alignItems:"center",gap:16},children:[e.jsx("div",{style:{fontSize:13,color:r.mid},children:"Need historical SLO reports? See the SLA & deprecation policy."}),e.jsxs(d,{to:"/api/policies/sla",style:{fontSize:13,fontWeight:500,color:r.dark,background:r.gray2,padding:"8px 14px",borderRadius:8,textDecoration:"none",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap"},children:["Read SLA ",e.jsx(B,{className:"h-3.5 w-3.5"})]})]})]})]})]})}function j({title:o,children:l}){return e.jsxs("section",{style:{marginBottom:28},children:[e.jsx("h2",{style:{fontSize:13,fontWeight:600,color:r.muted,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:10},children:o}),e.jsx("div",{style:{background:r.white,border:`1px solid ${r.border}`,borderRadius:14,padding:18},children:l})]})}function n({label:o,value:l}){return e.jsxs("div",{style:{background:r.white,border:`1px solid ${r.border}`,borderRadius:12,padding:14},children:[e.jsx("div",{style:{fontSize:11,color:r.muted,marginBottom:4,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),e.jsx("div",{style:{fontSize:18,fontWeight:600},children:l})]})}function m({children:o}){return e.jsx("th",{style:{padding:"10px 12px",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em"},children:o})}function x({children:o,mono:l}){return e.jsx("td",{style:{padding:"10px 12px",fontFamily:l?"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace":y.sans,fontSize:12.5},children:o})}function k({children:o}){return e.jsx("div",{style:{fontSize:13,color:r.muted,padding:"8px 0"},children:o})}export{U as default};

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.