@debugkit/dashboard 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/_authed-C29P68T-.js +1 -0
- package/dist/client/assets/{_authed-CNObwuZh.js → _authed-D-dYbHoP.js} +1 -1
- package/dist/client/assets/{charts-CUvev8lV.js → charts--S1o8iId.js} +7 -7
- package/dist/client/assets/{copy-button-ORgLIh59.js → copy-button-BJkvWYRY.js} +1 -1
- package/dist/client/assets/{customers-DTMEprFQ.js → customers-Cwx5qEO1.js} +1 -1
- package/dist/client/assets/{endpoints-lMSO2CdM.js → endpoints-zz1TotR2.js} +1 -1
- package/dist/client/assets/{events._eventId-bWag-i8J.js → events._eventId-Bx6TfUjv.js} +2 -2
- package/dist/client/assets/index-COHr_cc3.js +10 -0
- package/dist/client/assets/{invite._token-CxXek2SP.js → invite._token-DiDJMnQu.js} +1 -1
- package/dist/client/assets/{issues._fingerprint-BQr85TVY.js → issues._fingerprint-Cv522h2j.js} +1 -1
- package/dist/client/assets/{login-Dlk3GyyC.js → login-CKkpc0t5.js} +1 -1
- package/dist/client/assets/{sessions._sessionId-3wNImMqM.js → sessions._sessionId-B0NxM46y.js} +1 -1
- package/dist/client/assets/settings-CIlF10MI.js +1 -0
- package/dist/client/assets/{src-Dq5mIUf0.js → src-BKSiJUs3.js} +1 -1
- package/dist/client/assets/styles-GAsMUS4-.css +2 -0
- package/dist/client/assets/{team-Bud2-07A.js → team-BRuVQ2bU.js} +1 -1
- package/dist/client/assets/{timeline-BSDhQPpY.js → timeline-BIGo9MCA.js} +1 -1
- package/dist/client/assets/{ui-CEv2y56s.js → ui-CaEZB1j2.js} +1 -1
- package/dist/client/assets/version-banner-VFvyqbPh.js +1 -0
- package/dist/server/assets/_authed-BJWDiF9i.js +92 -0
- package/dist/server/assets/{_authed-DsB8kjZB.js → _authed-X9u_5JUy.js} +2 -2
- package/dist/server/assets/{_tanstack-start-manifest_v-D1_ErrJK.js → _tanstack-start-manifest_v-C6vaeBdY.js} +30 -37
- package/dist/server/assets/{customers-CvSLt_xV.js → customers-827fC5I3.js} +2 -2
- package/dist/server/assets/{demo-BRTkdmQJ.js → demo-DDNiXCgj.js} +6 -5
- package/dist/server/assets/{dynamodb-B0V3ZO20.js → dynamodb-Cd4blXkh.js} +55 -2
- package/dist/server/assets/{endpoints-mPQXpH8C.js → endpoints-_T0NSOyA.js} +2 -2
- package/dist/server/assets/{errors-C2KEDL7l.js → errors-Po4Tt5zd.js} +57 -10
- package/dist/server/assets/{events._eventId-pkQBQ9sL.js → events._eventId-Dcsu4oVO.js} +2 -2
- package/dist/server/assets/{firestore-Jd-LeWZI.js → firestore-c8Sz2Q4O.js} +13 -2
- package/dist/server/assets/{fns-Di0vMpkQ.js → fns-BiUOnY1_.js} +6 -4
- package/dist/server/assets/{fns-B3PHbFwV.js → fns-CVbk8Gf9.js} +19 -4
- package/dist/server/assets/{invite._token-LwWF5YxP.js → invite._token-7DjEeeaD.js} +3 -3
- package/dist/server/assets/{issues._fingerprint-DAA0QCuA.js → issues._fingerprint-vc9r3jgg.js} +3 -3
- package/dist/server/assets/{login-DqjCU4DJ.js → login-CwKAx9Bj.js} +3 -3
- package/dist/server/assets/{memory-aqsrtEUn.js → memory-Bv4C8uyK.js} +55 -3
- package/dist/server/assets/{router-C0Dauj2C.js → router-Dk3XHn7B.js} +17 -15
- package/dist/server/assets/{sessions._sessionId-D7JPV0M4.js → sessions._sessionId-BvXxK9qF.js} +2 -2
- package/dist/server/assets/{settings-Drjd64d7.js → settings-B9NLQjl1.js} +60 -4
- package/dist/server/assets/{src-C4fNgijW.js → src-oWPSAvXv.js} +1 -1
- package/dist/server/assets/{team-D7iXYnSE.js → team-Bsm2wFG0.js} +3 -3
- package/dist/server/assets/{ui-B_XHlLUQ.js → ui-SAkSlP7f.js} +1 -1
- package/dist/server/assets/version-banner-nf-yZurq.js +106 -0
- package/dist/server/assets/versions-BOlL8jam.js +58 -0
- package/dist/server/server.js +29 -25
- package/package.json +4 -4
- package/dist/client/assets/_authed-CuP-He8G.js +0 -1
- package/dist/client/assets/index-BNpacHyi.js +0 -10
- package/dist/client/assets/settings-CzbEYB7k.js +0 -1
- package/dist/client/assets/styles-DPsgRH7g.css +0 -2
- package/dist/server/assets/_authed-DkkRwdZl.js +0 -87
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e,V as t,st as n,ut as r,x as i,z as a}from"./src-BKSiJUs3.js";import{a as o}from"./ui-CaEZB1j2.js";import{i as s}from"./index-COHr_cc3.js";var c=r(n()),l=t(),u=`mt-1 w-full rounded-md border border-line bg-bg px-3 py-2 text-sm outline-none focus:border-accent`;function d(){let t=s.useLoaderData(),{token:n}=s.useParams(),r=a(),[d,f]=(0,c.useState)(t.valid?t.email??``:``),[p,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(``),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(!1);if(!t.valid)return(0,l.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,l.jsxs)(`div`,{className:`w-full max-w-sm rounded-xl border border-line bg-panel p-6 shadow-sm`,children:[(0,l.jsx)(o,{}),(0,l.jsx)(`h1`,{className:`mt-6 text-xl font-semibold`,children:`This invite link doesn't work`}),(0,l.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:`It may have been used already, cancelled, or expired (links last 7 days). Ask whoever sent it for a new one.`}),(0,l.jsx)(e,{to:`/login`,className:`mt-5 inline-block text-sm underline`,children:`Sign in instead`})]})});async function x(e){e.preventDefault(),b(!0),v(null);try{let e=await i({data:{token:n,email:d,name:p,password:h}});if(!e.ok)return v(e.error);await r.invalidate(),await r.navigate({to:`/`})}catch{v(`Could not reach the dashboard server.`)}finally{b(!1)}}return(0,l.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,l.jsxs)(`form`,{onSubmit:x,className:`w-full max-w-sm rounded-xl border border-line bg-panel p-6 shadow-sm`,children:[(0,l.jsx)(o,{}),(0,l.jsx)(`h1`,{className:`mt-6 text-xl font-semibold`,children:`Join the team`}),(0,l.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[t.invitedBy,` invited you as `,(0,l.jsx)(`b`,{children:t.role}),`. Choose how you'll sign in.`]}),(0,l.jsx)(`label`,{className:`mt-5 block text-sm font-medium`,htmlFor:`email`,children:`Email`}),(0,l.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`username`,required:!0,readOnly:!!t.email,value:d,onChange:e=>f(e.target.value),className:u}),(0,l.jsx)(`label`,{className:`mt-4 block text-sm font-medium`,htmlFor:`name`,children:`Name (optional)`}),(0,l.jsx)(`input`,{id:`name`,autoComplete:`name`,value:p,onChange:e=>m(e.target.value),className:u}),(0,l.jsx)(`label`,{className:`mt-4 block text-sm font-medium`,htmlFor:`password`,children:`Password (10+ characters)`}),(0,l.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:10,value:h,onChange:e=>g(e.target.value),className:u}),_&&(0,l.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-sev-critical`,children:_}),(0,l.jsx)(`button`,{disabled:y,className:`mt-5 w-full rounded-md bg-ink px-3 py-2 text-sm font-medium text-bg disabled:opacity-60`,children:y?`Joining…`:`Join and sign in`})]})})}export{d as component};
|
package/dist/client/assets/{issues._fingerprint-BQr85TVY.js → issues._fingerprint-Cv522h2j.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,N as t,R as n,k as r,lt as i,ot as a}from"./src-Dq5mIUf0.js";import{n as o,r as s}from"./charts-CUvev8lV.js";import{d as c,n as l,u}from"./index-BNpacHyi.js";import{c as d,l as f,n as p,o as m,r as h,s as g,t as _}from"./ui-CEv2y56s.js";import{t as v}from"./copy-button-ORgLIh59.js";var y=i(a()),b=e();function x(){let e=l.useLoaderData(),{issue:n,sample:r}=e,i=r?.event.type===`error`?r.event:null,a=i?.error.frames??[],y=l.useNavigate(),x=l.useSearch(),{range:w}=e;return(0,b.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsx)(t,{to:`/`,search:{app:e.app,range:x.range,from:x.from,to:x.to},className:`text-sm text-muted hover:text-ink`,children:`← Overview`}),(0,b.jsx)(u,{value:w,today:new Date().toISOString().slice(0,10),onChange:e=>y({search:t=>({...t,...e})})},`${w.preset}${w.from}${w.to}`)]}),(0,b.jsx)(c,{rangeFrom:w.from,retention:e.retention}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,b.jsx)(m,{severity:n.severity}),n.flow&&(0,b.jsx)(`span`,{className:`rounded bg-panel-2 px-1.5 py-0.5 font-mono`,children:n.flow}),(0,b.jsxs)(`span`,{children:[`First seen `,f(n.firstSeen),` · last seen `,f(n.lastSeen)]})]}),(0,b.jsx)(`h1`,{className:`mt-2 break-words text-xl font-semibold tracking-tight sm:text-2xl`,children:n.title}),n.culprit&&(0,b.jsx)(`p`,{className:`mt-1 font-mono text-sm text-muted`,children:n.culprit}),(0,b.jsx)(h,{issue:n}),n.incidentTitle&&(0,b.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[`Part of an incident:`,` `,(0,b.jsx)(t,{to:`/`,search:{app:e.app},className:`font-medium text-ink hover:text-accent`,children:n.incidentTitle})]})]}),(0,b.jsx)(S,{app:e.app,issue:n,canChange:e.canChangeStatus,links:e.links}),(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,b.jsx)(d,{label:`Occurrences (24h)`,value:n.count24h,tone:n.severity}),(0,b.jsx)(d,{label:`Occurrences (${w.label})`,value:n.countRange.toLocaleString(),hint:`${n.countTotal.toLocaleString()} since first seen`}),(0,b.jsx)(d,{label:`Users affected`,value:e.affectedUsers.toLocaleString(),hint:`since ${w.preset===`24h`?`yesterday`:w.from}`}),(0,b.jsx)(d,{label:`Top app version`,value:e.breakdowns.appVersion[0]?.key??`—`,hint:e.breakdowns.appVersion[0]?`${Math.round(e.breakdowns.appVersion[0].share*100)}% of occurrences`:void 0})]}),n.explanation&&(0,b.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,b.jsx)(_,{title:`What happened`,subtitle:`In plain words, for support.`,right:e.ticketMarkdown?(0,b.jsx)(v,{text:e.ticketMarkdown,label:`Copy for a ticket`}):void 0,children:(0,b.jsx)(`p`,{className:`text-sm leading-relaxed`,children:n.explanation.summary})}),(0,b.jsxs)(_,{title:`For developers`,subtitle:C(n.explanation.technical.headline),children:[(0,b.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-sm`,children:n.explanation.technical.evidence.map((e,t)=>(0,b.jsx)(`li`,{className:`break-words`,children:C(e)},t))}),n.explanation.technical.where&&(0,b.jsxs)(`p`,{className:`mt-3 text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:`Where: `}),(0,b.jsx)(`span`,{className:`break-words font-mono text-xs`,children:C(n.explanation.technical.where)})]}),(0,b.jsxs)(`p`,{className:`mt-3 text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:`Suggested fix: `}),C(n.explanation.technical.fix)]})]})]}),e.hints.length>0&&(0,b.jsx)(_,{title:n.explanation?`Also worth checking`:`What to look at`,subtitle:`Generated from the error, its breadcrumbs and where it happens.`,children:(0,b.jsx)(`ol`,{className:`space-y-3`,children:e.hints.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full bg-accent-soft text-[11px] font-semibold text-accent`,children:t+1}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,b.jsx)(`div`,{className:`text-sm text-muted`,children:e.detail})]})]},t))})}),(0,b.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-3`,children:[(0,b.jsxs)(`div`,{className:`lg:col-span-2`,children:[w.preset!==`24h`&&(0,b.jsx)(`div`,{className:`mb-5`,children:(0,b.jsx)(_,{title:`Occurrences per day`,subtitle:`${w.label} (UTC)`,children:(0,b.jsx)(s,{data:e.daily.map(e=>({day:e.day,errors:e.count}))})})}),(0,b.jsxs)(_,{title:`Occurrences per hour`,subtitle:`Last 48 hours`,children:[(0,b.jsx)(o,{data:e.hourly}),(0,b.jsx)(p,{columns:[`Hour (UTC)`,`Count`],rows:e.hourly.map(e=>[e.hour,e.count])})]})]}),(0,b.jsx)(_,{title:`Where it happens`,subtitle:`Share of recent occurrences`,children:(0,b.jsx)(`div`,{className:`space-y-4`,children:[`os`,`appVersion`,`deviceModel`,`network`].map(t=>(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`mb-1.5 text-xs font-medium text-muted`,children:{os:`OS`,appVersion:`App version`,deviceModel:`Device`,network:`Network`}[t]}),(0,b.jsx)(g,{rows:e.breakdowns[t].map(e=>({key:e.key,value:e.count}))})]},t))})})]}),(0,b.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,b.jsx)(_,{title:`Stack trace`,subtitle:`Most recent occurrence. In-app frames highlighted.`,children:a.length?(0,b.jsx)(`ol`,{className:`space-y-1 font-mono text-xs`,children:a.map((e,t)=>(0,b.jsxs)(`li`,{className:`rounded px-2 py-1 ${e.inApp?`bg-accent-soft text-ink`:`text-muted`}`,children:[(0,b.jsx)(`span`,{className:`font-semibold`,children:e.fn??`<anonymous>`}),` `,(0,b.jsxs)(`span`,{className:`break-all`,children:[e.file,`:`,e.line,`:`,e.col]})]},t))}):(0,b.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap text-xs text-muted`,children:i?.error.stack??`No stack trace captured.`})}),(0,b.jsx)(_,{title:`Breadcrumbs`,subtitle:`What the user did right before the error`,children:i?.breadcrumbs?.length?(0,b.jsxs)(`ol`,{className:`relative space-y-3 border-l border-line pl-4`,children:[i.breadcrumbs.map((e,t)=>(0,b.jsxs)(`li`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`absolute -left-[5px] mt-1.5 h-2.5 w-2.5 rounded-full ${e.level===`error`?`bg-sev-critical`:`bg-line`}`}),(0,b.jsx)(`span`,{className:`mr-2 rounded bg-panel-2 px-1.5 py-0.5 text-[11px] uppercase tracking-wide text-muted`,children:e.category}),(0,b.jsx)(`span`,{className:`break-words`,children:e.message})]},t)),(0,b.jsxs)(`li`,{className:`text-sm font-medium text-sev-critical`,children:[(0,b.jsx)(`span`,{className:`absolute -left-[5px] mt-1.5 h-2.5 w-2.5 rounded-full bg-sev-critical`}),n.title]})]}):(0,b.jsxs)(`p`,{className:`text-sm text-muted`,children:[`No breadcrumbs. Call `,(0,b.jsx)(`code`,{children:`deBug.breadcrumb()`}),` on navigation and network calls to see the path to the error.`]})})]}),(0,b.jsx)(_,{title:`Recent occurrences`,subtitle:`Newest first. Open one for its timeline, request, device and stack.`,children:(0,b.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,b.jsxs)(`table`,{className:`tabular w-full min-w-[600px] text-left text-sm`,children:[(0,b.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,b.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`When`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`OS`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Version`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Device`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`User`})]})}),(0,b.jsx)(`tbody`,{children:e.recent.map(r=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-panel-2`,children:[(0,b.jsx)(`td`,{className:`px-4 py-2 text-xs sm:px-2`,children:r.type===`error`?(0,b.jsx)(t,{to:`/events/$eventId`,params:{eventId:r.id},search:{app:e.app,issue:n.fingerprint,range:x.range,from:x.from,to:x.to},className:`font-medium text-accent hover:underline`,title:r.ts,children:f(r.ts)}):(0,b.jsx)(`span`,{className:`text-muted`,title:r.ts,children:f(r.ts)})}),(0,b.jsx)(`td`,{className:`px-2 py-2`,children:r.os}),(0,b.jsx)(`td`,{className:`px-2 py-2`,children:r.appVersion??`—`}),(0,b.jsx)(`td`,{className:`px-2 py-2`,children:r.device??`—`}),(0,b.jsx)(`td`,{className:`px-2 py-2 font-mono text-xs text-muted`,children:r.userId??`anonymous`})]},r.id))})]})})})]})}function S({app:e,issue:t,canChange:i,links:a}){let o=n(),[s,c]=(0,y.useState)(t.resolvedIn??t.lastVersion??``),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(!1),p=async n=>{f(!0),u(null);let i=await r({data:{app:e,fingerprint:t.fingerprint,status:n,resolvedIn:n===`resolved`?s:void 0}}).catch(e=>({ok:!1,error:e.message}));if(f(!1),!i.ok)return u(i.error);await o.invalidate()},m=`rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2 disabled:opacity-40`,h=t.status===`resolved`||t.status===`ignored`;return(0,b.jsxs)(`section`,{"aria-label":`Issue actions`,className:`flex flex-wrap items-center gap-2`,children:[i&&!h&&(0,b.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),p(`resolved`)},children:[(0,b.jsx)(`label`,{className:`text-sm text-muted`,htmlFor:`fixed-in`,children:`Fixed in`}),(0,b.jsx)(`input`,{id:`fixed-in`,value:s,onChange:e=>c(e.target.value),placeholder:`2.4.1`,className:`w-28 rounded-md border border-line bg-panel px-2 py-1.5 text-sm`}),(0,b.jsx)(`button`,{type:`submit`,disabled:d,className:`rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white disabled:opacity-40`,children:`Resolve`}),(0,b.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>void p(`ignored`),className:m,children:`Ignore`})]}),i&&h&&(0,b.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>void p(`open`),className:m,children:`Reopen`}),a.linear&&(0,b.jsx)(`a`,{href:a.linear,target:`_blank`,rel:`noopener noreferrer`,className:m,children:`Create Linear issue`}),a.github&&(0,b.jsx)(`a`,{href:a.github,target:`_blank`,rel:`noopener noreferrer`,className:m,children:`Create GitHub issue`}),i&&!h&&(0,b.jsxs)(`p`,{className:`w-full text-xs text-muted`,children:[`If it shows up again in `,s||`that version`,` or later, it's marked Regressed. Occurrences from older versions don't count: those users haven't updated yet.`]}),l&&(0,b.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-sev-critical`,children:l})]})}var C=e=>e.replaceAll("`",``);export{x as component};
|
|
1
|
+
import{A as e,P as t,V as n,st as r,ut as i,z as a}from"./src-BKSiJUs3.js";import{n as o,r as s}from"./charts--S1o8iId.js";import{d as c,n as l,u}from"./index-COHr_cc3.js";import{c as d,l as f,n as p,o as m,r as h,s as g,t as _}from"./ui-CaEZB1j2.js";import{t as v}from"./copy-button-BJkvWYRY.js";var y=i(r()),b=n();function x(){let e=l.useLoaderData(),{issue:n,sample:r}=e,i=r?.event.type===`error`?r.event:null,a=i?.error.frames??[],y=l.useNavigate(),x=l.useSearch(),{range:w}=e;return(0,b.jsxs)(`main`,{className:`mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsx)(t,{to:`/`,search:{app:e.app,range:x.range,from:x.from,to:x.to},className:`text-sm text-muted hover:text-ink`,children:`← Overview`}),(0,b.jsx)(u,{value:w,today:new Date().toISOString().slice(0,10),onChange:e=>y({search:t=>({...t,...e})})},`${w.preset}${w.from}${w.to}`)]}),(0,b.jsx)(c,{rangeFrom:w.from,retention:e.retention}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,b.jsx)(m,{severity:n.severity}),n.flow&&(0,b.jsx)(`span`,{className:`rounded bg-panel-2 px-1.5 py-0.5 font-mono`,children:n.flow}),(0,b.jsxs)(`span`,{children:[`First seen `,f(n.firstSeen),` · last seen `,f(n.lastSeen)]})]}),(0,b.jsx)(`h1`,{className:`mt-2 break-words text-xl font-semibold tracking-tight sm:text-2xl`,children:n.title}),n.culprit&&(0,b.jsx)(`p`,{className:`mt-1 font-mono text-sm text-muted`,children:n.culprit}),(0,b.jsx)(h,{issue:n}),n.incidentTitle&&(0,b.jsxs)(`p`,{className:`mt-2 text-sm text-muted`,children:[`Part of an incident:`,` `,(0,b.jsx)(t,{to:`/`,search:{app:e.app},className:`font-medium text-ink hover:text-accent`,children:n.incidentTitle})]})]}),(0,b.jsx)(S,{app:e.app,issue:n,canChange:e.canChangeStatus,links:e.links}),(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,b.jsx)(d,{label:`Occurrences (24h)`,value:n.count24h,tone:n.severity}),(0,b.jsx)(d,{label:`Occurrences (${w.label})`,value:n.countRange.toLocaleString(),hint:`${n.countTotal.toLocaleString()} since first seen`}),(0,b.jsx)(d,{label:`Users affected`,value:e.affectedUsers.toLocaleString(),hint:`since ${w.preset===`24h`?`yesterday`:w.from}`}),(0,b.jsx)(d,{label:`Top app version`,value:e.breakdowns.appVersion[0]?.key??`—`,hint:e.breakdowns.appVersion[0]?`${Math.round(e.breakdowns.appVersion[0].share*100)}% of occurrences`:void 0})]}),n.explanation&&(0,b.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,b.jsx)(_,{title:`What happened`,subtitle:`In plain words, for support.`,right:e.ticketMarkdown?(0,b.jsx)(v,{text:e.ticketMarkdown,label:`Copy for a ticket`}):void 0,children:(0,b.jsx)(`p`,{className:`text-sm leading-relaxed`,children:n.explanation.summary})}),(0,b.jsxs)(_,{title:`For developers`,subtitle:C(n.explanation.technical.headline),children:[(0,b.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-sm`,children:n.explanation.technical.evidence.map((e,t)=>(0,b.jsx)(`li`,{className:`break-words`,children:C(e)},t))}),n.explanation.technical.where&&(0,b.jsxs)(`p`,{className:`mt-3 text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:`Where: `}),(0,b.jsx)(`span`,{className:`break-words font-mono text-xs`,children:C(n.explanation.technical.where)})]}),(0,b.jsxs)(`p`,{className:`mt-3 text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:`Suggested fix: `}),C(n.explanation.technical.fix)]})]})]}),e.hints.length>0&&(0,b.jsx)(_,{title:n.explanation?`Also worth checking`:`What to look at`,subtitle:`Generated from the error, its breadcrumbs and where it happens.`,children:(0,b.jsx)(`ol`,{className:`space-y-3`,children:e.hints.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full bg-accent-soft text-[11px] font-semibold text-accent`,children:t+1}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,b.jsx)(`div`,{className:`text-sm text-muted`,children:e.detail})]})]},t))})}),(0,b.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-3`,children:[(0,b.jsxs)(`div`,{className:`lg:col-span-2`,children:[w.preset!==`24h`&&(0,b.jsx)(`div`,{className:`mb-5`,children:(0,b.jsx)(_,{title:`Occurrences per day`,subtitle:`${w.label} (UTC)`,children:(0,b.jsx)(s,{data:e.daily.map(e=>({day:e.day,errors:e.count}))})})}),(0,b.jsxs)(_,{title:`Occurrences per hour`,subtitle:`Last 48 hours`,children:[(0,b.jsx)(o,{data:e.hourly}),(0,b.jsx)(p,{columns:[`Hour (UTC)`,`Count`],rows:e.hourly.map(e=>[e.hour,e.count])})]})]}),(0,b.jsx)(_,{title:`Where it happens`,subtitle:`Share of recent occurrences`,children:(0,b.jsx)(`div`,{className:`space-y-4`,children:[`os`,`appVersion`,`deviceModel`,`network`].map(t=>(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`mb-1.5 text-xs font-medium text-muted`,children:{os:`OS`,appVersion:`App version`,deviceModel:`Device`,network:`Network`}[t]}),(0,b.jsx)(g,{rows:e.breakdowns[t].map(e=>({key:e.key,value:e.count}))})]},t))})})]}),(0,b.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,b.jsx)(_,{title:`Stack trace`,subtitle:`Most recent occurrence. In-app frames highlighted.`,children:a.length?(0,b.jsx)(`ol`,{className:`space-y-1 font-mono text-xs`,children:a.map((e,t)=>(0,b.jsxs)(`li`,{className:`rounded px-2 py-1 ${e.inApp?`bg-accent-soft text-ink`:`text-muted`}`,children:[(0,b.jsx)(`span`,{className:`font-semibold`,children:e.fn??`<anonymous>`}),` `,(0,b.jsxs)(`span`,{className:`break-all`,children:[e.file,`:`,e.line,`:`,e.col]})]},t))}):(0,b.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap text-xs text-muted`,children:i?.error.stack??`No stack trace captured.`})}),(0,b.jsx)(_,{title:`Breadcrumbs`,subtitle:`What the user did right before the error`,children:i?.breadcrumbs?.length?(0,b.jsxs)(`ol`,{className:`relative space-y-3 border-l border-line pl-4`,children:[i.breadcrumbs.map((e,t)=>(0,b.jsxs)(`li`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`absolute -left-[5px] mt-1.5 h-2.5 w-2.5 rounded-full ${e.level===`error`?`bg-sev-critical`:`bg-line`}`}),(0,b.jsx)(`span`,{className:`mr-2 rounded bg-panel-2 px-1.5 py-0.5 text-[11px] uppercase tracking-wide text-muted`,children:e.category}),(0,b.jsx)(`span`,{className:`break-words`,children:e.message})]},t)),(0,b.jsxs)(`li`,{className:`text-sm font-medium text-sev-critical`,children:[(0,b.jsx)(`span`,{className:`absolute -left-[5px] mt-1.5 h-2.5 w-2.5 rounded-full bg-sev-critical`}),n.title]})]}):(0,b.jsxs)(`p`,{className:`text-sm text-muted`,children:[`No breadcrumbs. Call `,(0,b.jsx)(`code`,{children:`deBug.breadcrumb()`}),` on navigation and network calls to see the path to the error.`]})})]}),(0,b.jsx)(_,{title:`Recent occurrences`,subtitle:`Newest first. Open one for its timeline, request, device and stack.`,children:(0,b.jsx)(`div`,{className:`-mx-4 overflow-x-auto sm:mx-0`,children:(0,b.jsxs)(`table`,{className:`tabular w-full min-w-[600px] text-left text-sm`,children:[(0,b.jsx)(`thead`,{className:`text-xs text-muted`,children:(0,b.jsxs)(`tr`,{className:`border-b border-line`,children:[(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium sm:px-2`,children:`When`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`OS`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Version`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Device`}),(0,b.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`User`})]})}),(0,b.jsx)(`tbody`,{children:e.recent.map(r=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-panel-2`,children:[(0,b.jsx)(`td`,{className:`px-4 py-2 text-xs sm:px-2`,children:r.type===`error`?(0,b.jsx)(t,{to:`/events/$eventId`,params:{eventId:r.id},search:{app:e.app,issue:n.fingerprint,range:x.range,from:x.from,to:x.to},className:`font-medium text-accent hover:underline`,title:r.ts,children:f(r.ts)}):(0,b.jsx)(`span`,{className:`text-muted`,title:r.ts,children:f(r.ts)})}),(0,b.jsx)(`td`,{className:`px-2 py-2`,children:r.os}),(0,b.jsx)(`td`,{className:`px-2 py-2`,children:r.appVersion??`—`}),(0,b.jsx)(`td`,{className:`px-2 py-2`,children:r.device??`—`}),(0,b.jsx)(`td`,{className:`px-2 py-2 font-mono text-xs text-muted`,children:r.userId??`anonymous`})]},r.id))})]})})})]})}function S({app:t,issue:n,canChange:r,links:i}){let o=a(),[s,c]=(0,y.useState)(n.resolvedIn??n.lastVersion??``),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(!1),p=async r=>{f(!0),u(null);let i=await e({data:{app:t,fingerprint:n.fingerprint,status:r,resolvedIn:r===`resolved`?s:void 0}}).catch(e=>({ok:!1,error:e.message}));if(f(!1),!i.ok)return u(i.error);await o.invalidate()},m=`rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2 disabled:opacity-40`,h=n.status===`resolved`||n.status===`ignored`;return(0,b.jsxs)(`section`,{"aria-label":`Issue actions`,className:`flex flex-wrap items-center gap-2`,children:[r&&!h&&(0,b.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),p(`resolved`)},children:[(0,b.jsx)(`label`,{className:`text-sm text-muted`,htmlFor:`fixed-in`,children:`Fixed in`}),(0,b.jsx)(`input`,{id:`fixed-in`,value:s,onChange:e=>c(e.target.value),placeholder:`2.4.1`,className:`w-28 rounded-md border border-line bg-panel px-2 py-1.5 text-sm`}),(0,b.jsx)(`button`,{type:`submit`,disabled:d,className:`rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white disabled:opacity-40`,children:`Resolve`}),(0,b.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>void p(`ignored`),className:m,children:`Ignore`})]}),r&&h&&(0,b.jsx)(`button`,{type:`button`,disabled:d,onClick:()=>void p(`open`),className:m,children:`Reopen`}),i.linear&&(0,b.jsx)(`a`,{href:i.linear,target:`_blank`,rel:`noopener noreferrer`,className:m,children:`Create Linear issue`}),i.github&&(0,b.jsx)(`a`,{href:i.github,target:`_blank`,rel:`noopener noreferrer`,className:m,children:`Create GitHub issue`}),r&&!h&&(0,b.jsxs)(`p`,{className:`w-full text-xs text-muted`,children:[`If it shows up again in `,s||`that version`,` or later, it's marked Regressed. Occurrences from older versions don't count: those users haven't updated yet.`]}),l&&(0,b.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-sev-critical`,children:l})]})}var C=e=>e.replaceAll("`",``);export{x as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{S as e,V as t,st as n,ut as r,z as i}from"./src-BKSiJUs3.js";import{a}from"./ui-CaEZB1j2.js";import{v as o}from"./index-COHr_cc3.js";var s=r(n()),c=t();function l(){let t=o.useLoaderData(),n=i(),[r,l]=(0,s.useState)(t.demo?.email??``),[u,d]=(0,s.useState)(t.demo?.password??``),[f,p]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1);async function g(t){t.preventDefault(),h(!0),p(null);try{let t=await e({data:{email:r,password:u}});if(!t.ok)return p(t.error);await n.invalidate(),await n.navigate({to:`/`})}catch{p(`Could not reach the dashboard server.`)}finally{h(!1)}}return(0,c.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,c.jsxs)(`form`,{onSubmit:g,className:`w-full max-w-sm rounded-xl border border-line bg-panel p-6 shadow-sm`,children:[(0,c.jsx)(a,{}),(0,c.jsx)(`h1`,{className:`mt-6 text-xl font-semibold`,children:`Sign in`}),(0,c.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`This dashboard runs on your infrastructure and reads from your`,` `,t.store===`demo`?`demo dataset`:t.store===`memory`?`in-memory store on this machine`:t.store===`firestore`?`Firestore`:`DynamoDB`,`.`]}),t.demo&&(0,c.jsxs)(`p`,{className:`mt-4 rounded-md bg-accent-soft px-3 py-2 text-xs text-ink`,children:[`Demo mode: sign in with `,(0,c.jsx)(`b`,{children:t.demo.email}),` / `,(0,c.jsx)(`b`,{children:t.demo.password}),`. Set `,(0,c.jsx)(`code`,{children:`DEBUG_DASHBOARD_USERS`}),` to require real accounts.`]}),(0,c.jsx)(`label`,{className:`mt-5 block text-sm font-medium`,htmlFor:`email`,children:`Email`}),(0,c.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`username`,required:!0,value:r,onChange:e=>l(e.target.value),className:`mt-1 w-full rounded-md border border-line bg-bg px-3 py-2 text-sm outline-none focus:border-accent`}),(0,c.jsx)(`label`,{className:`mt-4 block text-sm font-medium`,htmlFor:`password`,children:`Password`}),(0,c.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`current-password`,required:!0,value:u,onChange:e=>d(e.target.value),className:`mt-1 w-full rounded-md border border-line bg-bg px-3 py-2 text-sm outline-none focus:border-accent`}),f&&(0,c.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-sev-critical`,children:f}),(0,c.jsx)(`button`,{disabled:m,className:`mt-5 w-full rounded-md bg-ink px-3 py-2 text-sm font-medium text-bg disabled:opacity-60`,children:m?`Signing in…`:`Sign in`})]})})}export{l as component};
|
package/dist/client/assets/{sessions._sessionId-3wNImMqM.js → sessions._sessionId-B0NxM46y.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e,V as t}from"./src-BKSiJUs3.js";import{t as n}from"./copy-button-BJkvWYRY.js";import{a as r,i,n as a,r as o,s,t as c}from"./timeline-BIGo9MCA.js";import{t as l}from"./ui-CaEZB1j2.js";import{t as u}from"./index-COHr_cc3.js";var d=t();function f(){let{session:t,missingIndex:a}=u.useLoaderData();if(!t)return(0,d.jsxs)(`main`,{className:`mx-auto max-w-3xl px-4 py-10 sm:px-6`,children:[(0,d.jsx)(`h1`,{className:`text-xl font-semibold`,children:`This session can't be read yet`}),(0,d.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:a&&`Firestore needs deBug's new index on events (sessionId, ts). Deploy it with: firebase deploy --only firestore:indexes, using deBug's firestore.indexes.json. It takes a few minutes to build.`})]});let s=t.user.id;return(0,d.jsxs)(`main`,{className:`mx-auto max-w-5xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,title:`From the earliest step recorded to the last stored event. The session may have started earlier and gone on after.`,children:[`Session · recorded `,i(t.start),` to `,i(t.end),` · `,g(t.start,t.end)]}),(0,d.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-3`,children:[(0,d.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:s?(0,d.jsx)(`span`,{className:`break-all font-mono`,children:s}):`Not signed in`}),(0,d.jsx)(o,{outcome:t.outcome}),(s||t.user.anonymousId)&&(0,d.jsx)(e,{to:`/customers`,search:{app:t.app,q:s??t.user.anonymousId},className:`text-sm text-accent hover:underline`,children:`All their sessions →`})]})]}),(0,d.jsxs)(`section`,{"aria-label":`Device and app`,className:`flex flex-wrap items-center gap-x-6 gap-y-2 rounded-xl border border-line bg-panel px-4 py-3 text-sm`,children:[(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`span`,{className:`text-muted`,children:`Device `}),r([t.context.device.brand,t.context.device.model])??`—`]}),(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`span`,{className:`text-muted`,children:`OS `}),r([t.context.os.name,t.context.os.version])??`—`]}),(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`span`,{className:`text-muted`,children:`App `}),r([t.context.app.version,t.context.app.build&&`(${t.context.app.build})`])??`—`]}),(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`span`,{className:`text-muted`,children:`Errors `}),t.counts.errors,t.counts.handled>0&&(0,d.jsxs)(`span`,{className:`text-muted`,children:[` (`,t.counts.handled,` caught by the app)`]})]}),(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`span`,{className:`text-muted`,children:`Session `}),(0,d.jsx)(`span`,{className:`break-all font-mono text-xs`,children:t.sessionId}),(0,d.jsx)(`span`,{className:`ml-2`,children:(0,d.jsx)(n,{text:t.sessionId,label:`Copy`,ariaLabel:`Copy session id`})})]}),t.user.anonymousId&&(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`span`,{className:`text-muted`,children:`Install `}),(0,d.jsx)(`span`,{className:`break-all font-mono text-xs`,children:t.user.anonymousId})]}),s&&(0,d.jsx)(`span`,{className:`ml-auto`,children:(0,d.jsx)(n,{text:s,label:`Copy customer`,ariaLabel:`Copy customer id`})})]}),(0,d.jsxs)(l,{title:`Timeline`,subtitle:`Screens, taps, API calls, flow steps and errors in this session, in order. Times are from the device, from the session's start.`,children:[(0,d.jsx)(`ol`,{className:`space-y-1.5`,children:t.rows.map((e,n)=>(0,d.jsx)(p,{row:e,app:t.app,start:t.start},e.kind===`crumb`?`c${n}`:e.eventId))}),t.truncated&&(0,d.jsxs)(`p`,{className:`mt-3 text-xs text-muted`,children:[`Showing the newest `,t.read,` events of this session; older ones are left out.`]}),(0,d.jsx)(`p`,{className:`mt-3 text-xs text-muted`,children:`Screens, taps and API calls come from the trail each error carries, so what happened after the last error isn't shown, and the trail before an error goes back as far as the SDK's breadcrumb limit.`})]})]})}function p({row:t,app:n,start:r}){let i=(0,d.jsx)(`span`,{className:`tabular pt-0.5 text-right text-xs text-muted`,title:t.ts,children:h(t.ts,r)}),o=`grid grid-cols-[4.5rem_1.25rem_1fr] gap-2 rounded-md px-2 py-1.5 text-sm`;if(t.kind===`crumb`){let e=t.item;return(0,d.jsxs)(`li`,{className:`${o} ${e.failed?`bg-sev-critical/10`:e.level===`warning`?`bg-sev-medium/10`:``}`,children:[i,(0,d.jsx)(`span`,{"aria-hidden":!0,className:`pt-0.5 text-center ${e.failed?`text-sev-critical`:`text-muted`}`,children:a[e.category]}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(c,{item:e}),(0,d.jsx)(m,{source:t.source,app:n})]})]})}return t.kind===`event`?(0,d.jsxs)(`li`,{className:`${o} ${t.failed?`bg-sev-medium/10`:``}`,children:[i,(0,d.jsx)(`span`,{"aria-hidden":!0,className:`pt-0.5 text-center ${t.failed?`text-sev-high`:`text-muted`}`,children:`◆`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`span`,{className:`mr-2 rounded bg-panel-2 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted`,children:`flow`}),(0,d.jsx)(`span`,{className:`break-words ${t.failed?`font-medium`:``}`,children:t.detail}),(0,d.jsx)(m,{source:t.source,app:n})]})]}):(0,d.jsxs)(`li`,{className:`${o} ${t.handled?`bg-sev-critical/10`:`bg-sev-critical/20`} font-medium text-sev-critical`,children:[i,(0,d.jsx)(`span`,{"aria-hidden":!0,className:`pt-0.5 text-center`,children:`✕`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`span`,{className:`mr-2 rounded bg-sev-critical px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-white`,children:t.crash?`crash`:t.handled?`error`:`uncaught`}),t.fingerprint?(0,d.jsx)(e,{to:`/events/$eventId`,params:{eventId:t.eventId},search:{app:n,issue:t.fingerprint},className:`break-words hover:underline`,children:t.title}):(0,d.jsx)(`span`,{className:`break-words`,children:t.title})]})]})}function m({source:t,app:n}){return t?(0,d.jsx)(e,{to:`/events/$eventId`,params:{eventId:t.eventId},search:{app:n,issue:t.fingerprint},className:`ml-2 whitespace-nowrap text-xs text-muted hover:text-ink hover:underline`,title:`Open the error this step led to`,children:`in error →`}):null}function h(e,t){let n=Math.max(0,Math.round((Date.parse(e)-Date.parse(t))/1e3));return n>=3600?`+${Math.floor(n/3600)}:${_(Math.floor(n/60)%60)}:${_(n%60)}`:`+${Math.floor(n/60)}:${_(n%60)}`}function g(e,t){let n=Math.max(0,(Date.parse(t)-Date.parse(e))/1e3);return n<.05?`0 s`:s(n)}var _=e=>String(e).padStart(2,`0`);export{f as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,E as t,F as n,O as r,T as i,V as a,a as o,i as s,st as c,t as l,ut as u,z as d}from"./src-BKSiJUs3.js";import{l as f,t as p}from"./ui-CaEZB1j2.js";import{i as m,r as h,t as g}from"./version-banner-VFvyqbPh.js";import{o as _}from"./index-COHr_cc3.js";var v=u(c()),y=a(),b=[30,60,90,180,365];function x(){let{apps:t,settings:r,seenHosts:a}=_.useLoaderData(),o=h(),s=n({from:_.fullPath}),c=d(),[l,u]=(0,v.useState)(String(r?.retentionDays??60)),[f,m]=(0,v.useState)(null),[g,x]=(0,v.useState)(!1);if(!r)return(0,y.jsx)(`main`,{className:`mx-auto max-w-3xl px-4 py-16 text-center text-muted`,children:`No apps yet. Settings appear once an app sends its first event.`});let C=r.writer!==`none`,T=Number(l),E=Number.isInteger(T)&&T!==r.retentionDays,D=async()=>{x(!0),m(null);let t=await e({data:{app:r.app,retentionDays:T}}).catch(e=>({ok:!1,error:e.message}));if(x(!1),!t.ok)return m({tone:`error`,text:t.error});m({tone:`ok`,text:`Saved. New events are kept for ${T} days, starting within about a minute.`}),await c.invalidate()},k=async()=>{x(!0);let e,t=0;try{do{let n=await i({data:{app:r.app,cursor:e}});if(!n.ok)throw Error(n.error);t+=n.updated,e=n.cursor,m({tone:`info`,text:`Updating existing events… ${t.toLocaleString()} so far`})}while(e);m({tone:`ok`,text:`Done: ${t.toLocaleString()} existing events now expire ${r.retentionDays} days after they arrived.`})}catch(e){m({tone:`error`,text:`Stopped after ${t.toLocaleString()} events: ${e.message}`})}x(!1)};return(0,y.jsxs)(`main`,{className:`mx-auto max-w-3xl space-y-5 px-4 py-6 sm:px-6`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted`,children:`Settings`}),(0,y.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:r.app})]}),t.length>1&&(0,y.jsx)(`select`,{"aria-label":`App`,value:r.app,onChange:e=>s({search:{app:e.target.value}}),className:`rounded-md border border-line bg-panel px-2 py-1.5 text-sm`,children:t.map(e=>(0,y.jsx)(`option`,{children:e},e))})]}),o&&(0,y.jsx)(O,{status:o}),(0,y.jsxs)(p,{title:`Data retention`,subtitle:`Your data lives in your own database, so you decide how long to keep it.`,children:[(0,y.jsxs)(`dl`,{className:`grid gap-3 text-sm sm:grid-cols-2`,children:[(0,y.jsxs)(`div`,{className:`rounded-lg border border-line p-3`,children:[(0,y.jsx)(`dt`,{className:`text-xs text-muted`,children:`Raw events (stack traces, breadcrumbs, context)`}),(0,y.jsx)(`dd`,{className:`mt-1 text-lg font-semibold`,children:r.retentionDays?`${r.retentionDays} days`:`Unknown`}),(0,y.jsx)(`dd`,{className:`text-xs text-muted`,children:r.source===`setting`?`Set here${r.updatedAt?` on ${new Date(r.updatedAt).toLocaleDateString(`en-GB`)}`:``}`:r.source==="default"?`The default chosen at setup`:`Not reported by this deployment`})]}),(0,y.jsxs)(`div`,{className:`rounded-lg border border-line p-3`,children:[(0,y.jsx)(`dt`,{className:`text-xs text-muted`,children:`Counts, issues and release health`}),(0,y.jsx)(`dd`,{className:`mt-1 text-lg font-semibold`,children:`Forever`}),(0,y.jsx)(`dd`,{className:`text-xs text-muted`,children:`Charts and trends cover any date range`})]})]}),C?(0,y.jsxs)(`form`,{className:`mt-4 space-y-3`,onSubmit:e=>{e.preventDefault(),E&&D()},children:[(0,y.jsx)(`label`,{className:`block text-sm font-medium`,htmlFor:`days`,children:`Keep raw events for`}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[b.map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>u(String(e)),className:`rounded-md border px-3 py-1.5 text-sm ${Number(l)===e?`border-accent bg-accent-soft text-accent`:`border-line hover:bg-panel-2`}`,children:[e,` days`]},e)),(0,y.jsx)(`input`,{id:`days`,type:`number`,min:1,max:3650,value:l,onChange:e=>u(e.target.value),className:`w-24 rounded-md border border-line bg-panel px-2 py-1.5 text-sm`,"aria-label":`Days`}),(0,y.jsx)(`button`,{type:`submit`,disabled:!E||g,className:`rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white disabled:opacity-40`,children:`Save`})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted`,children:`Applies to events that arrive from now on. When you shorten it, older events are removed by your database's own clean-up: within about a day on Firestore, up to two days on DynamoDB.`})]}):(0,y.jsx)(`p`,{className:`mt-4 text-sm text-muted`,children:r.note}),r.note&&C&&(0,y.jsx)(`p`,{className:`mt-2 text-xs text-sev-high`,children:r.note})]}),C&&(0,y.jsxs)(p,{title:`Existing events`,subtitle:`Events already stored keep the expiry they arrived with.`,children:[(0,y.jsxs)(`p`,{className:`text-sm`,children:[`Give every stored event an expiry based on the current setting (`,r.retentionDays,` days after it arrived). This costs one database write per event.`]}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void k(),disabled:g,className:`mt-3 rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2 disabled:opacity-40`,children:`Apply to existing events`})]}),C&&(0,y.jsx)(S,{settings:r,onStatus:m},r.app+JSON.stringify([r.criticalFlows,r.alerts])),C&&(0,y.jsx)(w,{app:r.app,hosts:r.hosts,seen:a,onStatus:m},r.app+JSON.stringify(r.hosts)),f&&(0,y.jsx)(`p`,{role:`status`,className:`rounded-lg border px-3 py-2 text-sm ${f.tone===`error`?`border-sev-critical text-sev-critical`:f.tone===`ok`?`border-line bg-panel-2`:`border-line text-muted`}`,children:f.text})]})}function S({settings:e,onStatus:n}){let i=d(),[a,o]=(0,v.useState)(e.criticalFlows.join(`, `)),[s,c]=(0,v.useState)(e.alerts.slackWebhookUrl??``),[l,u]=(0,v.useState)(e.alerts.newIssues!==!1),[f,m]=(0,v.useState)(e.alerts.regressions!==!1),[h,g]=(0,v.useState)(e.alerts.onlyCriticalFlows===!0),[_,b]=(0,v.useState)(e.alerts.dashboardUrl??(typeof window<`u`?window.location.origin:``)),[x,S]=(0,v.useState)(!1),C=async()=>{S(!0),n(null);let r=await t({data:{app:e.app,criticalFlows:a.split(/[\s,]+/).filter(Boolean),alerts:{slackWebhookUrl:s,newIssues:l,regressions:f,onlyCriticalFlows:h,dashboardUrl:_}}}).catch(e=>({ok:!1,error:e.message}));if(S(!1),!r.ok)return n({tone:`error`,text:r.error});n({tone:`ok`,text:`Saved. Alerts and critical flows apply within about a minute.`}),await i.invalidate()},w=async()=>{S(!0);let t=await r({data:{app:e.app}}).catch(e=>({ok:!1,error:e.message}));S(!1),n(t.ok?{tone:`ok`,text:`Test message sent. Check your Slack channel.`}:{tone:`error`,text:t.error})},T=`rounded-md border border-line bg-panel px-2 py-1.5 text-sm`;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(p,{title:`Critical flows`,subtitle:`Issues in these flows rank one severity level higher, and can be the only ones that alert.`,children:[(0,y.jsx)(`label`,{className:`block text-sm font-medium`,htmlFor:`flows`,children:`Flows, separated by commas`}),(0,y.jsx)(`input`,{id:`flows`,value:a,onChange:e=>o(e.target.value),placeholder:`checkout.payment, auth.login`,className:`mt-2 w-full ${T}`})]}),(0,y.jsx)(p,{title:`Slack alerts`,subtitle:`Your ingest function posts to Slack when an issue first appears or comes back after being resolved.`,children:(0,y.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`label`,{className:`block font-medium`,htmlFor:`hook`,children:`Incoming webhook URL`}),(0,y.jsx)(`input`,{id:`hook`,value:s,onChange:e=>c(e.target.value),placeholder:`https://hooks.slack.com/services/…`,className:`mt-2 w-full font-mono ${T}`}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Create one under your Slack app's Incoming Webhooks. Leave empty to turn alerts off.`})]}),(0,y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),` New issues`]}),(0,y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>m(e.target.checked)}),` Regressions`]}),(0,y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),` Only for critical flows`]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`label`,{className:`block font-medium`,htmlFor:`dash-url`,children:`Dashboard address, for links in alerts`}),(0,y.jsx)(`input`,{id:`dash-url`,value:_,onChange:e=>b(e.target.value),className:`mt-2 w-full ${T}`})]})]})}),(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>void C(),disabled:x,className:`rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white disabled:opacity-40`,children:`Save flows and alerts`}),e.alerts.slackWebhookUrl&&e.writer===`admin`&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>void w(),disabled:x,className:`rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2 disabled:opacity-40`,children:`Send a test alert`})]})]})}var C=s.filter(e=>e!==`unknown`);function w({app:e,hosts:n,seen:r,onStatus:i}){let a=d(),[s,c]=(0,v.useState)(n.length+1),[u,f]=(0,v.useState)(()=>n.length?n.map((e,t)=>({id:t,match:e.match,name:e.name,owner:e.owner??``})):[{id:0,match:``,name:``,owner:``}]),[m,h]=(0,v.useState)(!1),g=new Set(u.map(e=>l(e.match))),_=r.filter(e=>!g.has(e)),b=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,...t}:n)),x=(e=``)=>{f(t=>[...t.filter(e=>e.match||e.name),{id:s,match:e,name:``,owner:``}]),c(e=>e+1)},S=async()=>{h(!0),i(null);let n=await t({data:{app:e,hosts:u.map(e=>({match:e.match,name:e.name,...e.owner?{owner:e.owner}:{}}))}}).catch(e=>({ok:!1,error:e.message}));if(h(!1),!n.ok)return i({tone:`error`,text:n.error});i({tone:`ok`,text:`Saved. Names show straight away; owners apply to new errors within about a minute, and to existing issues now.`}),await a.invalidate()},w=`rounded-md border border-line bg-panel px-2 py-1.5 text-sm`;return(0,y.jsx)(p,{title:`Host names`,subtitle:`Give the servers your app calls a name people recognise, and say who looks after each one.`,children:(0,y.jsxs)(`div`,{className:`space-y-3`,children:[u.map((e,t)=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":`Host ${t+1}`,className:`grid gap-2 rounded-lg border border-line p-3 sm:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_auto_auto] sm:items-end sm:border-0 sm:p-0`,children:[(0,y.jsxs)(`label`,{className:`min-w-0 text-xs text-muted`,children:[`Host, or host and path`,(0,y.jsx)(`input`,{value:e.match,onChange:t=>b(e.id,{match:t.target.value}),list:`seen-hosts`,placeholder:`api.example.com/payments`,className:`mt-1 w-full font-mono text-xs text-ink ${w}`})]}),(0,y.jsxs)(`label`,{className:`min-w-0 text-xs text-muted`,children:[`Name`,(0,y.jsx)(`input`,{value:e.name,onChange:t=>b(e.id,{name:t.target.value}),placeholder:`Balance service`,maxLength:60,className:`mt-1 w-full text-ink ${w}`})]}),(0,y.jsxs)(`label`,{className:`text-xs text-muted`,children:[`Looked after by`,(0,y.jsxs)(`select`,{value:e.owner,onChange:t=>b(e.id,{owner:t.target.value}),className:`mt-1 w-full text-ink ${w}`,children:[(0,y.jsx)(`option`,{value:``,children:`Work it out`}),C.map(e=>(0,y.jsx)(`option`,{value:e,children:o[e].name},e))]})]}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>f(t=>t.filter(t=>t.id!==e.id)),"aria-label":`Remove ${e.match||`this host`}`,className:`justify-self-start rounded-md border border-line px-2.5 py-1.5 text-sm hover:bg-panel-2`,children:`Remove`})]},e.id)),(0,y.jsx)(`datalist`,{id:`seen-hosts`,children:_.map(e=>(0,y.jsx)(`option`,{value:e},e))}),_.length>0&&(0,y.jsxs)(`div`,{className:`text-xs text-muted`,children:[(0,y.jsx)(`p`,{children:`Called in the last 30 days and not named yet:`}),(0,y.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:_.slice(0,8).map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>x(e),className:`max-w-full truncate rounded-md border border-line px-2 py-0.5 font-mono hover:bg-panel-2`,title:`Name ${e}`,children:[`+ `,e]},e))})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted`,children:`A path names part of a host: api.example.com/payments covers /payments/… only; the longest match wins. The owner decides who server errors from that host are passed to.`}),(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>x(),className:`rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2`,children:`Add a host`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void S(),disabled:m,className:`rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white disabled:opacity-40`,children:`Save host names`})]})]})})}var T=e=>e.level===`note`&&e.behind.some(e=>e.part!==`sdk`),E=e=>e.charAt(0).toUpperCase()+e.slice(1),D={sdk:`App SDK (newest seen)`,ingest:`Ingest`,dashboard:`This dashboard`};function O({status:e}){let t=new Set(e.behind.map(e=>e.part));return(0,y.jsxs)(p,{title:`deBug versions`,subtitle:`Your app's SDK, your ingest and this dashboard are released together and work best on the same version.`,children:[(0,y.jsx)(`dl`,{className:`grid grid-cols-[minmax(8rem,auto)_1fr] gap-x-4 gap-y-1.5 text-sm`,children:e.parts.map(e=>(0,y.jsxs)(`div`,{className:`contents`,children:[(0,y.jsx)(`dt`,{className:`text-muted`,children:D[e.part]}),(0,y.jsxs)(`dd`,{className:t.has(e.part)?`font-medium text-sev-high`:``,children:[e.version??(e.part===`sdk`?`not seen yet`:`predates version tracking`),e.at&&(0,y.jsxs)(`span`,{className:`ml-2 text-xs text-muted`,title:e.at,children:[e.part===`sdk`?`seen`:`recorded`,` `,f(e.at)]})]})]},e.part))}),e.level===`none`?(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted`,children:`All in step.`}):(0,y.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm`,children:[(0,y.jsxs)(`p`,{className:e.level===`banner`?``:`text-muted`,children:[E(e.behind.map(m).join(` and `)),T(e)?`: a patch behind ${e.newest}, so nothing's missing, but worth catching up.`:`, behind ${e.newest}.`]}),e.behind.some(e=>e.part!==`sdk`)?(0,y.jsx)(g,{status:e}):(0,y.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Update @debugkit/sdk in your app to `,e.newest,`.`]})]})]})}export{x as component};
|