@apisurf/wireui 0.1.2 → 0.1.4
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/README.md +42 -26
- package/bin/wireui.mjs +1 -1
- package/dist/nitro.json +1 -1
- package/dist/public/assets/environments-CpzEnLw2.js +1 -0
- package/dist/public/assets/feed-B8L4GK9D.js +1 -0
- package/dist/public/assets/globals-D_ltS-iC.css +1 -0
- package/dist/public/assets/history-BIXZHMWn.js +1 -0
- package/dist/public/assets/index-3VfD7Ktf.js +11 -0
- package/dist/public/assets/kv-table-Dv6o68aD.js +2 -0
- package/dist/public/assets/preload-helper-CIs162tl.js +3 -0
- package/dist/public/assets/query-DpztusaI.js +19 -0
- package/dist/public/assets/requests._requestId-Byq4gM_2.js +1 -0
- package/dist/public/assets/rolldown-runtime-CbXtAM7H.js +1 -0
- package/dist/public/assets/routes-C9SXJh8z.js +1 -0
- package/dist/public/assets/runs._runId-CMFvexqY.js +1 -0
- package/dist/public/assets/scoped-CiNsRvyC.js +1 -0
- package/dist/public/assets/session-header-DMR_hFkk.js +1 -0
- package/dist/public/assets/sessions-C-F6Wmmg.js +1 -0
- package/dist/public/assets/split-Ddiw3mOT.js +1 -0
- package/dist/public/assets/tabs-C1EijW_Z.js +2 -0
- package/dist/server/_ssr/{api-Dw1Zb_PK.mjs → api-DUem3i24.mjs} +28 -17
- package/dist/server/_ssr/environments-BFBtf7iL.mjs +146 -0
- package/dist/server/_ssr/feed-BgweoqQ4.mjs +108 -0
- package/dist/server/_ssr/history-57VNXvbE.mjs +195 -0
- package/dist/server/_ssr/{kv-table-DQUkoItO.mjs → kv-table-BONnSOLb.mjs} +2 -2
- package/dist/server/_ssr/{router-CPcgc_kh.mjs → prefs-iPvYd_Vz.mjs} +246 -1551
- package/dist/server/_ssr/{query-D4so9xiY.mjs → query-D6nNoSN3.mjs} +7 -6
- package/dist/server/_ssr/{requests._requestId-BFukRwqL.mjs → requests._requestId-bXoTBGVj.mjs} +7 -23
- package/dist/server/_ssr/router-ClsXvW-b.mjs +1068 -0
- package/dist/server/_ssr/{routes-DaV9vGHn.mjs → routes-CrmwJhiA.mjs} +18 -8
- package/dist/server/_ssr/runs._runId-DM5Y8e6b.mjs +850 -0
- package/dist/server/_ssr/{scoped-CnQ56K8h.mjs → scoped-CNX8KOhL.mjs} +2 -2
- package/dist/server/_ssr/session-header-BYy6LaSU.mjs +153 -0
- package/dist/server/_ssr/{collections-CqidTQpw.mjs → sessions-wsD0b1zm.mjs} +35 -72
- package/dist/server/_ssr/{split-DWrMIs7K.mjs → split-qGbYHKc9.mjs} +2 -2
- package/dist/server/_ssr/ssr.mjs +10 -14
- package/dist/server/_tanstack-start-manifest_v-Ag2qLfrP.mjs +79 -0
- package/dist/server/index.mjs +100 -51
- package/package.json +8 -6
- package/dist/public/assets/collections-CLHcfRfi.js +0 -1
- package/dist/public/assets/globals-CZiNFGaK.css +0 -1
- package/dist/public/assets/index-D5VFd_3H.js +0 -14
- package/dist/public/assets/kv-table-oB5gcq0i.js +0 -2
- package/dist/public/assets/query-BKAhHNIi.js +0 -19
- package/dist/public/assets/requests._requestId-Bu7E2eoI.js +0 -1
- package/dist/public/assets/routes-DDY2CfzA.js +0 -1
- package/dist/public/assets/runs._runId-CzwtVjYq.js +0 -1
- package/dist/public/assets/scoped-DB8raIWx.js +0 -1
- package/dist/public/assets/split-Br1RX2I4.js +0 -1
- package/dist/server/_ssr/runs._runId-Df_LmPHa.mjs +0 -836
- package/dist/server/_tanstack-start-manifest_v-CARKjHfs.mjs +0 -50
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as e,D as t,Et as n,G as r,H as i,I as a,T as o,Tt as s,V as c,X as l,Y as u,bt as d,ct as f,h as p,k as m,mt as h,ot as g,q as _,ut as v,w as y,wt as b,yt as x}from"./index-D5VFd_3H.js";var S=n(s(),1),C=b(),w={key:d({color:`synKey`}),string:d({color:`synString`}),number:d({color:`synNumber`}),bool:d({color:`synBool`}),null:d({color:`synNull`}),punct:d({color:`synPunct`})},T=d({fontFamily:`mono`,fontSize:`12px`,lineHeight:`1.65`,py:`2`,pl:`6`,pr:`3`,whiteSpace:`pre-wrap`,wordBreak:`break-word`});function E({value:e,initialDepth:t=2,command:n}){return(0,C.jsx)(`div`,{className:T,children:(0,C.jsx)(D,{value:e,depth:0,initialDepth:t,command:n,last:!0})})}function D({name:e,value:t,depth:n,initialDepth:r,command:i,last:a}){let o=typeof t==`object`&&!!t,[s,c]=S.useState(n<r);S.useEffect(()=>{i&&i.seq>0&&c(i.open)},[i]);let l=e===void 0?null:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:w.key,children:JSON.stringify(e)}),(0,C.jsx)(`span`,{className:w.punct,children:`: `})]}),u=a?null:(0,C.jsx)(`span`,{className:w.punct,children:`,`}),p={paddingLeft:n===0?0:16};if(!o)return(0,C.jsxs)(`div`,{style:p,children:[l,(0,C.jsx)(O,{value:t}),u]});let m=Array.isArray(t),h=m?t.map(e=>[void 0,e]):Object.entries(t),[g,_]=m?[`[`,`]`]:[`{`,`}`];if(h.length===0)return(0,C.jsxs)(`div`,{style:p,children:[l,(0,C.jsx)(`span`,{className:w.punct,children:`${g}${_}`}),u]});let y=m?`${h.length} item${h.length===1?``:`s`}`:`${h.length} key${h.length===1?``:`s`}`;return(0,C.jsxs)(`div`,{style:p,children:[(0,C.jsxs)(`span`,{role:`button`,tabIndex:0,onClick:()=>c(!s),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(!s))},className:d({cursor:`pointer`,rounded:`xs`,position:`relative`,ml:`-14px`,pl:`14px`,_hover:{bg:`hover`}}),children:[(0,C.jsx)(`span`,{className:d({position:`absolute`,left:`0`,top:`2px`,color:`faint`,display:`inline-flex`}),children:s?(0,C.jsx)(f,{size:12}):(0,C.jsx)(v,{size:12})}),l,(0,C.jsx)(`span`,{className:w.punct,children:g}),s?null:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:x(d({color:`faint`,fontStyle:`italic`,px:`1`})),children:y}),(0,C.jsx)(`span`,{className:w.punct,children:_}),u]})]}),s?(0,C.jsxs)(C.Fragment,{children:[h.map(([e,t],a)=>(0,C.jsx)(D,{name:e,value:t,depth:n+1,initialDepth:r,command:i,last:a===h.length-1},e??a)),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`span`,{className:w.punct,children:_}),u]})]}):null]})}function O({value:e}){return e===null?(0,C.jsx)(`span`,{className:w.null,children:`null`}):typeof e==`string`?(0,C.jsx)(`span`,{className:w.string,children:JSON.stringify(e)}):typeof e==`number`?(0,C.jsx)(`span`,{className:w.number,children:String(e)}):typeof e==`boolean`?(0,C.jsx)(`span`,{className:w.bool,children:String(e)}):null}function k(e){return e.kind===`json`?[`pretty`,`raw`]:e.kind===`image`?e.text?[`preview`,`raw`]:[`preview`]:e.kind===`text`?A(e.contentType)?[`pretty`,`preview`]:[`pretty`]:[]}function A(e){return e!=null&&/html/i.test(e)}var j={pretty:`Pretty`,raw:`Raw`,preview:`Preview`};function M({body:e,emptyTitle:n}){let r=k(e),[o,s]=S.useState(r[0]??`pretty`),[f,g]=S.useState({open:!0,seq:0}),v=r.includes(o)?o:r[0]??`pretty`;if(e.kind===`empty`)return(0,C.jsx)(m,{title:n,icon:(0,C.jsx)(h,{size:22}),children:e.note});let b=v===`raw`?u(e):l(e);return(0,C.jsxs)(`div`,{className:d({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,C.jsxs)(`div`,{className:d({display:`flex`,alignItems:`center`,gap:`2`,px:`3`,py:`1.5`,borderBottom:`1px solid`,borderColor:`line`,flexShrink:0,minW:`0`}),children:[r.length>1?(0,C.jsx)(a,{items:r.map(e=>({id:e,label:j[e]})),value:v,onSelect:s}):null,(0,C.jsxs)(`span`,{title:e.contentType??void 0,className:x(i,c,_,d({fontSize:`11px`,flex:`1`,minW:`0`})),children:[e.contentType??`no content-type`,e.size==null?``:` · ${p(e.size)}`]}),(0,C.jsxs)(`div`,{className:d({ml:`auto`,display:`flex`,gap:`1.5`,flexShrink:0}),children:[e.kind===`json`&&v===`pretty`?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(y,{onClick:()=>g(e=>({open:!0,seq:e.seq+1})),children:`Expand`}),(0,C.jsx)(y,{onClick:()=>g(e=>({open:!1,seq:e.seq+1})),children:`Collapse`})]}):null,(0,C.jsx)(t,{text:b})]})]}),(0,C.jsx)(N,{body:e}),(0,C.jsx)(`div`,{className:d({flex:`1`,minH:`0`,overflow:`auto`,bg:`well`}),children:(0,C.jsx)(P,{body:e,mode:v,command:f})})]})}function N({body:e}){let t=e.kind===`binary`?null:e.note;return!e.truncated&&!t?null:(0,C.jsx)(`div`,{className:d({px:`3`,pt:`2`,flexShrink:0}),children:(0,C.jsx)(o,{tone:`warn`,icon:(0,C.jsx)(g,{size:14}),title:e.truncated?`Truncated at capture`:`Note`,children:t??`Only the first part of this ${p(e.size)} payload was stored — raise the capture limit to keep it all.`})})}function P({body:e,mode:t,command:n}){return e.kind===`binary`?(0,C.jsx)(m,{title:`Binary payload`,icon:(0,C.jsx)(h,{size:22}),children:e.note}):e.kind===`json`?t===`raw`?(0,C.jsx)(I,{text:u(e)??``,wrap:!0}):(0,C.jsx)(E,{value:e.json,command:n}):e.kind===`image`?t===`raw`?(0,C.jsx)(I,{text:e.text??``}):(0,C.jsx)(`div`,{className:d({p:`4`,display:`flex`,justifyContent:`center`,bgImage:`linear-gradient(45deg, token(colors.hover) 25%, transparent 25%), linear-gradient(-45deg, token(colors.hover) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, token(colors.hover) 75%), linear-gradient(-45deg, transparent 75%, token(colors.hover) 75%)`,bgSize:`16px 16px`,bgPosition:`0 0, 0 8px, 8px -8px, -8px 0`,minH:`full`}),children:(0,C.jsx)(`img`,{src:e.dataUrl??void 0,alt:`Response body`,className:d({maxW:`full`,objectFit:`contain`})})}):t===`preview`&&e.text!=null?(0,C.jsx)(`iframe`,{title:`HTML preview`,sandbox:``,srcDoc:e.text,className:d({w:`full`,h:`full`,border:`none`,bg:`white`})}):(0,C.jsx)(I,{text:e.text??``})}var F=4e3;function I({text:e,wrap:t=!1}){let[n,r]=S.useState(!1),a=S.useMemo(()=>e.split(`
|
|
2
|
-
`),[e]),o=n?a:a.slice(0,F),s=String(a.length).length;return(0,C.jsxs)(`div`,{className:x(i,d({py:`2`,lineHeight:`1.6`}),!t&&d({w:`max-content`,minW:`full`})),children:[o.map((e,n)=>(0,C.jsxs)(`div`,{className:d({display:`flex`,px:`3`,_hover:{bg:`hover`}}),children:[(0,C.jsx)(`span`,{className:d({color:`faint`,textAlign:`right`,pr:`3`,userSelect:`none`,flexShrink:0}),style:{width:`${s+2}ch`},children:n+1}),(0,C.jsx)(`span`,{className:x(d({flex:`1`,minW:`0`}),d(t?{whiteSpace:`pre-wrap`,wordBreak:`break-all`}:{whiteSpace:`pre`})),children:e||` `})]},n)),!n&&a.length>F?(0,C.jsx)(`div`,{className:d({px:`3`,py:`2`}),children:(0,C.jsxs)(y,{onClick:()=>r(!0),children:[`Show all `,a.length.toLocaleString(`en-US`),` lines`]})}):null]})}function L({rows:t,empty:n,filterable:a=t.length>8,nameLabel:o=`Key`,valueLabel:s=`Value`,extraLabel:c}){let[l,u]=S.useState(``),f=l.trim().toLowerCase(),p=f?t.filter(e=>e.name.toLowerCase().includes(f)||e.value.toLowerCase().includes(f)):t;return t.length===0?(0,C.jsx)(m,{title:n}):(0,C.jsxs)(`div`,{className:d({display:`flex`,flexDir:`column`,minH:`0`}),children:[a?(0,C.jsx)(`div`,{className:d({px:`3`,py:`2`}),children:(0,C.jsx)(e,{placeholder:`Filter ${t.length} rows…`,value:l,onChange:e=>u(e.target.value)})}):null,(0,C.jsxs)(`table`,{className:r,children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{className:d({w:`32%`}),children:o}),(0,C.jsx)(`th`,{children:s}),c?(0,C.jsx)(`th`,{children:c}):null]})}),(0,C.jsxs)(`tbody`,{children:[p.map((e,t)=>(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`td`,{className:x(i,d({color:`muted`,verticalAlign:`top`,wordBreak:`break-all`})),children:e.name}),(0,C.jsx)(`td`,{className:x(i,d({wordBreak:`break-all`,whiteSpace:`pre-wrap`})),children:e.value}),c?(0,C.jsx)(`td`,{children:e.extra}):null]},`${e.name}:${t}`)),p.length===0?(0,C.jsx)(`tr`,{children:(0,C.jsxs)(`td`,{colSpan:c?3:2,className:d({color:`faint`,textAlign:`center`}),children:[`Nothing matches “`,l,`”.`]})}):null]})]})]})}export{E as i,M as n,I as r,L as t};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{A as e,Ct as t,Et as n,G as r,H as i,M as a,P as o,T as s,Tt as c,b as l,bt as u,c as d,ft as f,ht as p,k as m,l as h,q as g,r as _,u as v,w as y,wt as b,yt as x}from"./index-D5VFd_3H.js";import{t as S}from"./split-Br1RX2I4.js";var C=n(c()),w=b(),T=[{label:`Slowest requests`,sql:`SELECT id, method, host, path, status, duration_ms
|
|
2
|
-
FROM v_requests
|
|
3
|
-
ORDER BY duration_ms DESC
|
|
4
|
-
LIMIT 20`},{label:`Errors by host`,sql:`SELECT host, status, COUNT(*) AS n
|
|
5
|
-
FROM v_requests
|
|
6
|
-
WHERE status >= 400 OR error_name IS NOT NULL
|
|
7
|
-
GROUP BY host, status
|
|
8
|
-
ORDER BY n DESC`},{label:`Failed checks`,sql:`SELECT c.run_id, r.label, c.name, c.message
|
|
9
|
-
FROM v_checks c JOIN v_runs r ON r.id = c.run_id
|
|
10
|
-
WHERE c.status = 'fail'
|
|
11
|
-
ORDER BY c.ts DESC`},{label:`Search payloads`,sql:`SELECT q.id, q.method, q.path, q.status
|
|
12
|
-
FROM body_fts f
|
|
13
|
-
JOIN v_requests q ON q.response_body_id = f.body_id
|
|
14
|
-
WHERE body_fts MATCH 'error'
|
|
15
|
-
LIMIT 50`},{label:`Header usage`,sql:`SELECT name, COUNT(DISTINCT value) AS distinct_values, COUNT(*) AS n
|
|
16
|
-
FROM v_headers
|
|
17
|
-
WHERE kind = 'response'
|
|
18
|
-
GROUP BY name
|
|
19
|
-
ORDER BY n DESC`}];function E(){v({key:h.query(),title:`SQL`,icon:`query`});let e=_.useLoaderData(),n=_.useSearch(),r=t({from:_.fullPath}),[o,s]=C.useState(n.sql??T[0].sql),[c,l]=C.useState(null),[f,m]=C.useState(!1),g=C.useRef(null),b=C.useCallback(async e=>{if(e.trim()){m(!0);try{l(await d({data:{sql:e}}))}catch(e){l({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{m(!1)}r({search:{sql:e},replace:!0})}},[r]),E=C.useRef(!1);C.useEffect(()=>{!E.current&&n.sql&&(E.current=!0,b(n.sql))},[n.sql,b]);let k=e=>{let t=g.current;if(!t)return s(t=>t+e);let{selectionStart:n,selectionEnd:r}=t,i=o.slice(0,n)+e+o.slice(r);s(i),window.requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(n+e.length,n+e.length)})},A=(0,w.jsxs)(`div`,{className:u({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,w.jsxs)(`div`,{className:u({display:`flex`,alignItems:`center`,gap:`2`,px:`3`,h:`40px`,flexShrink:0,borderBottom:`1px solid`,borderColor:`line`}),children:[(0,w.jsxs)(y,{onClick:()=>void b(o),disabled:f,className:u({bg:`accent`,color:`accentFg`,borderColor:`accent`,_hover:{bg:`accent`,opacity:.9}}),children:[(0,w.jsx)(p,{size:12}),`Run`]}),(0,w.jsx)(a,{children:`⌘ ↵`}),(0,w.jsxs)(`select`,{"aria-label":`Example queries`,value:``,onChange:e=>{let t=T.find(t=>t.label===e.target.value);t&&s(t.sql)},className:u({h:`28px`,rounded:`md`,border:`1px solid`,borderColor:`line`,bg:`raised`,px:`1.5`,fontSize:`12px`}),children:[(0,w.jsx)(`option`,{value:``,children:`Examples…`}),T.map(e=>(0,w.jsx)(`option`,{value:e.label,children:e.label},e.label))]}),(0,w.jsx)(`span`,{className:u({ml:`auto`,color:`faint`,fontSize:`12px`}),children:`Read-only connection`})]}),(0,w.jsx)(`textarea`,{ref:g,value:o,spellCheck:!1,onChange:e=>s(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),b(o))},className:x(i,u({flex:`1`,minH:`0`,resize:`none`,border:`none`,outline:`none`,p:`3`,bg:`well`,fontSize:`13px`,lineHeight:`1.6`,tabSize:2}))})]});return(0,w.jsxs)(`div`,{className:u({display:`flex`,h:`full`,minH:`0`}),children:[(0,w.jsx)(D,{schema:e,onInsert:k}),(0,w.jsx)(`div`,{className:u({flex:`1`,minW:`0`,display:`flex`,borderLeft:`1px solid`,borderColor:`line`}),children:(0,w.jsx)(S,{direction:`stacked`,storageKey:`query`,initial:.38,first:A,second:(0,w.jsx)(O,{result:c,running:f})})})]})}function D({schema:t,onInsert:n}){let[r,a]=C.useState(``),[s,c]=C.useState(`v_requests`),l=r.trim().toLowerCase(),d=t.filter(e=>!l||e.name.includes(l)||e.columns.some(e=>e.name.includes(l)));return(0,w.jsxs)(`div`,{className:u({w:`260px`,flexShrink:0,display:`flex`,flexDir:`column`,minH:`0`,bg:`canvas`}),children:[(0,w.jsx)(`div`,{className:u({p:`2.5`,flexShrink:0}),children:(0,w.jsx)(e,{placeholder:`Filter tables and columns`,value:r,onChange:e=>a(e.target.value)})}),(0,w.jsx)(`div`,{className:u({flex:`1`,minH:`0`,overflow:`auto`,px:`1.5`,pb:`3`}),children:d.map(e=>{let t=s===e.name||l.length>0;return(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`button`,{type:`button`,onClick:()=>c(t&&!l?null:e.name),onDoubleClick:()=>n(e.name),title:e.description??e.name,className:u({display:`flex`,alignItems:`center`,gap:`1.5`,w:`full`,h:`26px`,px:`1.5`,rounded:`sm`,border:`none`,bg:`transparent`,cursor:`pointer`,textAlign:`left`,_hover:{bg:`hover`}}),children:[(0,w.jsx)(`span`,{className:u({color:e.type===`view`?`accent`:`faint`,display:`inline-flex`}),children:(0,w.jsx)(f,{size:13})}),(0,w.jsx)(`span`,{className:x(i,g,u({flex:`1`})),children:e.name}),(0,w.jsx)(o,{children:e.type})]}),t?(0,w.jsxs)(`div`,{className:u({pl:`6`,pb:`1`}),children:[e.description?(0,w.jsx)(`div`,{className:u({color:`faint`,fontSize:`11px`,pr:`2`,pb:`1`}),children:e.description}):null,e.columns.filter(t=>!l||e.name.includes(l)||t.name.includes(l)).map(e=>(0,w.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),title:`Insert ${e.name}`,className:u({display:`flex`,w:`full`,gap:`2`,h:`22px`,alignItems:`center`,px:`1.5`,border:`none`,bg:`transparent`,rounded:`sm`,cursor:`pointer`,textAlign:`left`,_hover:{bg:`hover`}}),children:[(0,w.jsx)(`span`,{className:x(i,g,u({flex:`1`})),children:e.name}),(0,w.jsx)(`span`,{className:x(i,u({color:`faint`,fontSize:`10.5px`})),children:e.type||`?`})]},e.name))]}):null]},e.name)})})]})}function O({result:e,running:t}){return e?e.ok?(0,w.jsxs)(`div`,{className:u({display:`flex`,flexDir:`column`,h:`full`,minH:`0`,opacity:t?.6:1}),children:[(0,w.jsxs)(`div`,{className:u({display:`flex`,gap:`3`,px:`3`,h:`32px`,alignItems:`center`,flexShrink:0,fontSize:`12px`,color:`muted`,borderBottom:`1px solid`,borderColor:`line`}),children:[(0,w.jsxs)(`span`,{children:[e.rows.length.toLocaleString(`en-US`),` row`,e.rows.length===1?``:`s`,e.truncated?` (first 1,000)`:``]}),(0,w.jsx)(`span`,{children:l(e.ms)})]}),(0,w.jsx)(`div`,{className:u({flex:`1`,minH:`0`,overflow:`auto`}),children:e.columns.length===0?(0,w.jsx)(m,{title:`No columns`}):(0,w.jsxs)(`table`,{className:x(r,u({w:`auto`,minW:`full`,"& td":{fontFamily:`mono`,fontSize:`12px`,maxW:`420px`}})),children:[(0,w.jsx)(`thead`,{children:(0,w.jsx)(`tr`,{children:e.columns.map((e,t)=>(0,w.jsx)(`th`,{children:e},`${e}:${t}`))})}),(0,w.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,w.jsx)(`tr`,{children:e.map((e,t)=>(0,w.jsx)(`td`,{className:g,title:e==null?`NULL`:String(e),children:(0,w.jsx)(k,{value:e})},t))},t))})]})})]}):(0,w.jsx)(`div`,{className:u({p:`3`}),children:(0,w.jsx)(s,{tone:`bad`,title:`Query failed`,children:(0,w.jsx)(`span`,{className:i,children:e.error})})}):(0,w.jsxs)(m,{title:`Run a query`,icon:(0,w.jsx)(f,{size:22}),children:[`Views (`,(0,w.jsx)(`span`,{className:i,children:`v_runs`}),`, `,(0,w.jsx)(`span`,{className:i,children:`v_requests`}),`,`,` `,(0,w.jsx)(`span`,{className:i,children:`v_headers`}),`…) join the interned ids back to strings. Click a column on the left to insert it.`]})}function k({value:e}){return e===null?(0,w.jsx)(`span`,{className:u({color:`faint`,fontStyle:`italic`}),children:`NULL`}):typeof e==`number`?(0,w.jsx)(`span`,{className:u({color:`synNumber`}),children:e}):(0,w.jsx)(w.Fragment,{children:e})}export{E as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,Ct as i,D as a,Et as o,F as s,H as c,I as l,J as u,M as d,N as f,P as p,Q as m,St as h,T as g,Tt as _,V as v,_t as y,at as b,b as x,bt as S,dt as C,et as w,g as T,gt as ee,h as E,it as D,j as O,k,l as A,lt as j,n as M,ot as te,p as ne,pt as re,q as N,u as ie,ut as P,wt as F,x as I,y as L,yt as R,z}from"./index-D5VFd_3H.js";import{t as B}from"./split-Br1RX2I4.js";import{i as V,n as H,r as U,t as W}from"./kv-table-oB5gcq0i.js";var G=o(_(),1),K=F();function q({messages:e,openedAt:n}){let[r,i]=G.useState(`all`),[a,o]=G.useState(``),[s,u]=G.useState(e[0]?.id??null),d=a.trim().toLowerCase(),f=e.filter(e=>(r===`all`||e.direction===r)&&(!d||e.name.toLowerCase().includes(d)||(e.text??``).toLowerCase().includes(d))),p=e.find(e=>e.id===s)??null,m=e.filter(e=>e.direction===`sent`).length;if(e.length===0)return(0,K.jsx)(k,{title:`No messages`,children:`The connection opened but nothing was sent or received on it.`});let h=(0,K.jsxs)(`div`,{className:S({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,K.jsxs)(`div`,{className:S({display:`flex`,gap:`2`,px:`3`,py:`2`,alignItems:`center`,flexShrink:0}),children:[(0,K.jsx)(l,{items:[{id:`all`,label:`All ${e.length}`},{id:`sent`,label:`Sent ${m}`},{id:`received`,label:`Received ${e.length-m}`}],value:r,onSelect:i}),(0,K.jsx)(t,{className:S({flex:`1`}),placeholder:`Filter messages…`,value:a,onChange:e=>o(e.target.value)})]}),(0,K.jsxs)(`div`,{className:S({flex:`1`,minH:`0`,overflow:`auto`}),role:`listbox`,"aria-label":`Messages`,children:[f.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.id===s,onClick:()=>u(e.id),className:S({display:`grid`,gridTemplateColumns:`18px 76px 70px 1fr 64px`,alignItems:`center`,gap:`2`,w:`full`,px:`3`,py:`1`,border:`none`,borderBottom:`1px solid`,borderColor:`line`,bg:`transparent`,textAlign:`left`,cursor:`pointer`,_hover:{bg:`hover`},"&[aria-selected=true]":{bg:`selected`}}),children:[(0,K.jsx)(`span`,{title:e.direction,className:e.direction===`sent`?S({color:`post`}):S({color:`get`}),children:e.direction===`sent`?(0,K.jsx)(y,{size:14}):(0,K.jsx)(re,{size:14})}),(0,K.jsx)(`span`,{className:R(c,S({color:`faint`})),children:I(e.ts-n)}),(0,K.jsx)(`span`,{className:R(c,N,S({color:`muted`})),children:e.name}),(0,K.jsx)(`span`,{className:R(c,N),children:e.text??(e.code==null?`—`:`close ${e.code}`)}),(0,K.jsx)(`span`,{className:R(c,S({color:`faint`,textAlign:`right`})),children:E(e.bytes)})]},e.id)),f.length===0?(0,K.jsx)(`div`,{className:S({p:`4`,color:`faint`,textAlign:`center`}),children:`No messages match.`}):null]})]});return(0,K.jsx)(B,{direction:`stacked`,storageKey:`messages`,initial:.55,first:h,second:p?(0,K.jsx)(J,{message:p,openedAt:n}):(0,K.jsx)(k,{title:`Select a message`})})}function J({message:e,openedAt:t}){let n=G.useMemo(()=>ae(e.text),[e.text]);return(0,K.jsxs)(`div`,{className:S({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,K.jsxs)(`div`,{className:S({display:`flex`,alignItems:`center`,gap:`2`,px:`3`,py:`1.5`,borderBottom:`1px solid`,borderColor:`line`,flexShrink:0,flexWrap:`wrap`}),children:[(0,K.jsx)(p,{tone:e.direction===`sent`?`warn`:`ok`,children:e.direction}),(0,K.jsxs)(`span`,{className:c,children:[`#`,e.seq]}),(0,K.jsx)(`span`,{className:R(c,S({color:`muted`})),children:e.name}),e.event_id?(0,K.jsxs)(`span`,{title:e.event_id,className:R(c,N,S({maxW:`240px`,color:`faint`,fontSize:`11px`})),children:[`id `,e.event_id]}):null,e.code==null?null:(0,K.jsxs)(p,{children:[`code `,e.code]}),e.truncated?(0,K.jsx)(p,{tone:`warn`,children:`truncated`}):null,(0,K.jsxs)(`span`,{className:R(c,S({color:`faint`})),children:[I(e.ts-t),` · `,E(e.bytes)]}),(0,K.jsx)(`div`,{className:S({ml:`auto`}),children:(0,K.jsx)(a,{text:e.text})})]}),(0,K.jsx)(`div`,{className:S({flex:`1`,minH:`0`,overflow:`auto`,bg:`well`}),children:e.text==null?(0,K.jsx)(k,{title:e.body_id==null?`No payload`:`Binary payload`}):n===void 0?(0,K.jsx)(U,{text:e.text,wrap:!0}):(0,K.jsx)(V,{value:n})})]})}function ae(e){if(!e)return;let t=e.trimStart()[0];if(t===`{`||t===`[`)try{return JSON.parse(e)}catch{return}}var oe={dns:S({bg:`sse`}),connect:S({bg:`info`}),tls:S({bg:`patch`}),wait:S({bg:`post`}),download:S({bg:`get`}),other:S({bg:`faint`})};function se({request:e}){let t=D(e),n=Math.max(e.duration_ms,.001),r=0;return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(s,{right:(0,K.jsx)(`span`,{className:R(c,S({fontWeight:`600`})),children:x(e.duration_ms)}),children:e.kind===`http`?`Timing`:`Connection`}),t.length===0?(0,K.jsx)(`p`,{className:v,children:`Only the total duration was measured for this exchange.`}):(0,K.jsx)(`div`,{className:S({display:`flex`,flexDir:`column`,gap:`1`}),children:t.map(e=>{let t=r/n*100,i=Math.max(e.ms/n*100,.4);return r+=e.ms,(0,K.jsxs)(`div`,{title:e.hint,className:S({display:`grid`,gridTemplateColumns:`150px 1fr 80px`,alignItems:`center`,gap:`3`,py:`1`}),children:[(0,K.jsx)(`span`,{className:S({color:`muted`,fontSize:`12px`}),children:e.label}),(0,K.jsx)(`div`,{className:S({position:`relative`,h:`10px`,bg:`hover`,rounded:`full`}),children:(0,K.jsx)(`div`,{className:R(S({position:`absolute`,top:`0`,bottom:`0`,rounded:`full`}),oe[e.key]),style:{left:`${t}%`,width:`${Math.min(i,100-t)}%`}})}),(0,K.jsx)(`span`,{className:R(c,S({textAlign:`right`})),children:x(e.ms)})]},e.key)})}),e.kind===`http`&&e.dns_ms==null&&e.connect_ms==null?(0,K.jsx)(`p`,{className:R(v,S({mt:`2`,fontSize:`12px`})),children:`No DNS, connect or TLS phase: the request reused an open connection.`}):null]})}function ce({request:e,requestHeaders:t,responseHeaders:n}){let r=le(e,t,n);return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(s,{children:`Transcript`}),(0,K.jsx)(`div`,{className:R(c,S({bg:`well`,border:`1px solid`,borderColor:`line`,rounded:`md`,p:`3`,lineHeight:`1.6`,overflowX:`auto`})),children:r.map((e,t)=>(0,K.jsxs)(`div`,{className:R(S({whiteSpace:`pre-wrap`,wordBreak:`break-all`}),e.tone===`sent`&&S({color:`post`}),e.tone===`received`&&S({color:`get`}),e.tone===`info`&&S({color:`faint`})),children:[e.prefix,` `,e.text]},t))})]})}function le(e,t,n){let r=[],i=e=>r.push({prefix:`*`,text:e,tone:`info`}),a=e=>r.push({prefix:`>`,text:e,tone:`sent`}),o=e=>r.push({prefix:`<`,text:e,tone:`received`});i(`${new Date(e.ts).toISOString()} ${e.kind.toUpperCase()} ${e.url}`);for(let t of ue(e))i(t);let s=e.query?`${e.path}?${e.query}`:e.path;a(`${e.method} ${s}`),t.some(([e])=>e.toLowerCase()===`host`)||a(`host: ${e.host}`);for(let[e,n]of t)a(`${e}: ${n}`);if(e.request_bytes>0&&i(`${e.request_bytes} bytes sent`),e.status!=null){o(`${e.status} ${u[e.status]??``}`.trim());for(let[e,t]of n)o(`${e}: ${t}`);e.ttfb_ms!=null&&i(`First byte after ${x(e.ttfb_ms)}`),i(`${e.response_bytes} bytes received`)}return e.error_name&&i(`${e.error_name}: ${e.error_message??``}`),i(`Completed in ${x(e.duration_ms)}`),r}function ue(e){if(e.dns_ms==null&&e.connect_ms==null&&e.tls_ms==null)return[`Re-using existing connection`];let t=[];return e.dns_ms!=null&&t.push(`Resolved ${e.host} in ${x(e.dns_ms)}`),e.connect_ms!=null&&t.push(`Connected in ${x(e.connect_ms)}`),e.tls_ms!=null&&t.push(`TLS handshake in ${x(e.tls_ms)}`),t}function Y(){let{detail:e,run:t,neighbours:n,runRequestCount:a}=M.useLoaderData(),o=M.useSearch(),s=i({from:M.fullPath}),{prefs:l}=ne(),u=r(),d=e.request,f=d.error_name!=null||d.status==null||d.status>=400;ie({key:A.request(d.id),title:d.path,icon:`request`,method:d.method,kind:d.kind,failed:f});let m=G.useCallback(e=>{e!=null&&s({to:`/requests/$requestId`,params:{requestId:String(e)},search:e=>e})},[s]);if(G.useEffect(()=>{let e=e=>{let t=e.target;t&&/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)||(e.key===`[`&&m(n.prev),e.key===`]`&&m(n.next))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,n.prev,n.next]),u)return u;let g=d.kind!==`http`,_=o.req??(d.query?`params`:e.requestBody.present?`body`:`headers`),v=g?`messages`:`body`,y=o.res&&(g?o.res!==`body`:o.res!==`messages`)?o.res:v;return(0,K.jsxs)(`div`,{className:S({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,K.jsxs)(`div`,{className:S({px:`4`,pt:`3`,pb:`2.5`,display:`flex`,flexDir:`column`,gap:`2`,flexShrink:0}),children:[(0,K.jsxs)(`div`,{className:S({display:`flex`,alignItems:`center`,gap:`2`,fontSize:`12px`,color:`muted`,minW:`0`}),children:[(0,K.jsxs)(h,{to:`/collections`,search:{entry:t.entry},className:S({display:`inline-flex`,alignItems:`center`,gap:`1`,color:`muted`,_hover:{color:`accent`}}),title:t.rel,children:[(0,K.jsx)(C,{size:12}),t.file]}),(0,K.jsx)(`span`,{className:S({color:`faint`}),children:`›`}),(0,K.jsxs)(h,{to:`/runs/$runId`,params:{runId:String(t.id)},className:S({display:`inline-flex`,alignItems:`center`,gap:`1`,color:`muted`,_hover:{color:`accent`}}),children:[(0,K.jsx)(ee,{size:10}),`Run #`,t.id]}),t.env?(0,K.jsx)(p,{children:t.env}):null,(0,K.jsx)(`span`,{className:S({color:`faint`}),children:`›`}),(0,K.jsxs)(`span`,{className:S({whiteSpace:`nowrap`}),children:[d.seq+1,` of `,a]}),(0,K.jsxs)(`span`,{className:R(c,S({color:`faint`,whiteSpace:`nowrap`})),children:[L(Date.now(),d.ts),` `,T(d.ts),` ·`,` `,I(d.ts-t.started_at)]}),(0,K.jsxs)(`div`,{className:S({ml:`auto`,display:`flex`,alignItems:`center`,gap:`1`}),children:[(0,K.jsx)(O,{label:`Previous request in run ([)`,disabled:n.prev==null,onClick:()=>m(n.prev),children:(0,K.jsx)(j,{})}),(0,K.jsx)(O,{label:`Next request in run (])`,disabled:n.next==null,onClick:()=>m(n.next),children:(0,K.jsx)(P,{})})]})]}),(0,K.jsx)(de,{detail:e})]}),(0,K.jsx)(`div`,{className:S({flex:`1`,minH:`0`,display:`flex`,borderTop:`1px solid`,borderColor:`line`}),children:(0,K.jsx)(B,{direction:l.layout,storageKey:`request-${l.layout}`,initial:l.layout===`side`?.42:.4,first:(0,K.jsx)(fe,{detail:e,tab:_,onTab:e=>void s({search:t=>({...t,req:e}),replace:!0})}),second:(0,K.jsx)(pe,{detail:e,tab:y,onTab:e=>void s({search:t=>({...t,res:e}),replace:!0})})})})]})}function de({detail:e}){let t=e.request,n=t.kind===`http`?b(t,e.requestHeaders,e.requestBody):null,r=t.url.slice(0,t.url.indexOf(t.host)),i=t.url.slice(r.length+t.host.length);return(0,K.jsxs)(`div`,{className:S({display:`flex`,gap:`2`,alignItems:`stretch`}),children:[(0,K.jsxs)(`div`,{className:S({display:`flex`,alignItems:`center`,flex:`1`,minW:`0`,h:`36px`,rounded:`md`,border:`1px solid`,borderColor:`lineStrong`,bg:`well`,overflow:`hidden`}),children:[(0,K.jsx)(`span`,{className:S({display:`flex`,alignItems:`center`,px:`3`,h:`full`,borderRight:`1px solid`,borderColor:`line`,flexShrink:0,"& > span":{fontSize:`12px`}}),children:(0,K.jsx)(f,{method:t.method,kind:t.kind})}),(0,K.jsxs)(`span`,{className:R(c,N,S({px:`3`,fontSize:`13px`,userSelect:`all`,flex:`1`})),title:t.url,children:[(0,K.jsx)(`span`,{className:S({color:`faint`}),children:r}),(0,K.jsx)(`span`,{children:t.host}),(0,K.jsx)(`span`,{className:S({color:`muted`}),children:i})]})]}),n?(0,K.jsx)(a,{text:n,label:`cURL`}):null,(0,K.jsx)(a,{text:t.url,label:`URL`})]})}function X({title:e,children:t}){return(0,K.jsxs)(`div`,{className:S({display:`flex`,alignItems:`center`,gap:`2.5`,px:`3`,h:`36px`,flexShrink:0,bg:`chrome`,borderBottom:`1px solid`,borderColor:`line`}),children:[(0,K.jsx)(`span`,{className:S({fontWeight:`600`,fontSize:`12px`}),children:e}),t]})}var Z=S({flex:`1`,minH:`0`,overflow:`auto`});function fe({detail:t,tab:r,onTab:i}){let a=t.request,o=m(a.query),s=e(t.requestHeaders);return(0,K.jsxs)(`div`,{className:S({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,K.jsx)(X,{title:a.kind===`http`?`Request`:`Handshake`,children:(0,K.jsxs)(`span`,{className:R(c,S({color:`faint`,fontSize:`11px`})),children:[E(a.request_bytes),` sent`]})}),(0,K.jsx)(n,{dense:!0,items:[{id:`params`,label:`Params`,count:o.length},{id:`headers`,label:`Headers`,count:t.requestHeaders.length},{id:`body`,label:`Body`,hidden:a.kind!==`http`,count:t.requestBody.present?`●`:void 0},{id:`cookies`,label:`Cookies`,count:s.length,hidden:s.length===0},{id:`tags`,label:`Tags`,count:t.tags.length,hidden:t.tags.length===0}],value:r,onSelect:i}),(0,K.jsxs)(`div`,{className:Z,children:[r===`params`?(0,K.jsx)(W,{rows:o.map(([e,t])=>({name:e,value:t})),empty:`No query parameters`}):null,r===`headers`?(0,K.jsx)(W,{rows:t.requestHeaders.map(([e,t])=>({name:e,value:t})),empty:`No request headers`,nameLabel:`Header`}):null,r===`body`?(0,K.jsx)(H,{body:t.requestBody,emptyTitle:`No request body`}):null,r===`cookies`?(0,K.jsx)($,{cookies:s}):null,r===`tags`?(0,K.jsx)(W,{rows:t.tags.map(e=>({name:e.key,value:e.value})),empty:`No tags`}):null]})]})}function pe({detail:e,tab:t,onTab:r}){let i=e.request,a=i.kind!==`http`,o=w(e.responseHeaders);return(0,K.jsxs)(`div`,{className:S({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,K.jsxs)(X,{title:a?`Connection`:`Response`,children:[(0,K.jsx)(z,{status:i.status,error:i.error_name,pill:!0}),(0,K.jsx)(Q,{label:a?`Open`:`Time`,value:x(i.duration_ms)}),(0,K.jsx)(Q,{label:a?`Received`:`Size`,value:E(i.response_bytes)})]}),(0,K.jsx)(n,{dense:!0,items:[{id:`body`,label:`Body`,hidden:a},{id:`messages`,label:`Messages`,count:e.messages.length,hidden:!a},{id:`headers`,label:`Headers`,count:e.responseHeaders.length},{id:`cookies`,label:`Cookies`,count:o.length,hidden:o.length===0},{id:`timeline`,label:`Timeline`}],value:t,onSelect:r}),i.error_name?(0,K.jsx)(`div`,{className:S({px:`3`,pt:`2.5`,flexShrink:0}),children:(0,K.jsx)(g,{tone:`bad`,icon:(0,K.jsx)(te,{size:15}),title:i.status==null?`Could not get a response`:i.error_name,children:(0,K.jsxs)(`span`,{className:c,children:[i.error_name,`: `,i.error_message]})})}):null,(0,K.jsxs)(`div`,{className:Z,children:[t===`body`?(0,K.jsx)(H,{body:e.responseBody,emptyTitle:`No response body`}):null,t===`messages`?(0,K.jsx)(q,{messages:e.messages,openedAt:i.ts}):null,t===`headers`?(0,K.jsx)(W,{rows:e.responseHeaders.map(([e,t])=>({name:e,value:t})),empty:`No response headers`,nameLabel:`Header`}):null,t===`cookies`?(0,K.jsx)($,{cookies:o}):null,t===`timeline`?(0,K.jsxs)(`div`,{className:S({p:`4`,display:`flex`,flexDir:`column`,gap:`5`}),children:[(0,K.jsx)(se,{request:i}),(0,K.jsx)(ce,{request:i,requestHeaders:e.requestHeaders,responseHeaders:e.responseHeaders})]}):null]}),(0,K.jsxs)(`div`,{className:S({px:`3`,py:`1`,borderTop:`1px solid`,borderColor:`line`,color:`faint`,fontSize:`11px`,flexShrink:0,display:`flex`,gap:`3`}),children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(d,{children:`[`}),` `,(0,K.jsx)(d,{children:`]`}),` previous / next request`]}),i.ttfb_ms!=null&&!a?(0,K.jsxs)(`span`,{children:[`TTFB `,x(i.ttfb_ms)]}):null]})]})}function Q({label:e,value:t}){return(0,K.jsxs)(`span`,{className:S({display:`inline-flex`,gap:`1`,fontSize:`12px`,whiteSpace:`nowrap`}),children:[(0,K.jsx)(`span`,{className:S({color:`muted`}),children:e}),(0,K.jsx)(`span`,{className:R(c,S({fontWeight:`600`})),children:t})]})}function $({cookies:e}){let t=e.map(e=>({name:e.name,value:e.value,extra:Object.keys(e.attributes).length?(0,K.jsx)(`span`,{className:S({display:`flex`,gap:`1`,flexWrap:`wrap`}),children:Object.entries(e.attributes).map(([e,t])=>(0,K.jsx)(p,{children:t===`true`?e:`${e}=${t}`},e))}):null})),n=e.some(e=>Object.keys(e.attributes).length>0);return(0,K.jsx)(W,{rows:t,empty:`No cookies`,nameLabel:`Name`,extraLabel:n?`Attributes`:void 0})}export{Y as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,Ct as t,E as n,F as r,G as i,H as a,L as o,N as s,O as c,P as l,R as u,S as d,St as f,U as p,W as m,_ as h,a as g,b as _,bt as v,f as y,h as b,k as x,l as S,m as C,nt as w,o as T,p as E,q as D,st as O,tt as k,u as A,vt as j,wt as M,xt as N,yt as P,z as F}from"./index-D5VFd_3H.js";import{t as I}from"./scoped-DB8raIWx.js";var L=M(),R=N(`__root__`);function z(){A({key:S.overview(),title:`Overview`,icon:`overview`});let o=e(),u=R.useLoaderData(),d=y(u.now),{prefs:b}=E(),M=t(),{data:N}=I(g.useLoaderData(),e=>T({data:{env:e}}));if(o)return o;let z=u.counts;if(!z)return null;let V=b.env===`*`?null:b.env===``?`No environment`:b.env;return(0,L.jsx)(`div`,{className:m,children:(0,L.jsxs)(`div`,{className:p,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h1`,{className:v({fontSize:`18px`,fontWeight:`600`,m:`0`}),children:`Overview`}),(0,L.jsx)(`p`,{className:P(a,v({color:`muted`,m:`0`,mt:`0.5`})),children:u.path})]}),(0,L.jsx)(B,{counts:z,envCount:u.envs.length,fileBytes:u.bytes}),V?(0,L.jsxs)(`p`,{className:v({color:`muted`,m:`0`,mt:`-2`}),children:[`Totals cover the whole file; the lists below are scoped to `,(0,L.jsx)(`b`,{children:V}),`.`]}):null,(0,L.jsxs)(`div`,{className:v({display:`grid`,gridTemplateColumns:{base:`1fr`,xl:`3fr 2fr`},gap:`5`}),children:[(0,L.jsxs)(`section`,{children:[(0,L.jsx)(r,{children:`Recent runs`}),(0,L.jsx)(n,{children:N.runs.length===0?(0,L.jsx)(x,{title:`No runs in this environment`}):(0,L.jsxs)(`table`,{className:i,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Collection`}),(0,L.jsx)(`th`,{children:`Result`}),(0,L.jsx)(`th`,{children:`Env`}),(0,L.jsx)(`th`,{className:`num`,children:`Requests`}),(0,L.jsx)(`th`,{className:`num`,children:`Wall`}),(0,L.jsx)(`th`,{className:`num`,children:`When`})]})}),(0,L.jsx)(`tbody`,{children:N.runs.map(e=>(0,L.jsxs)(`tr`,{"data-link":!0,onClick:()=>void M({to:`/runs/$runId`,params:{runId:String(e.id)}}),children:[(0,L.jsx)(`td`,{className:v({maxW:`260px`}),children:(0,L.jsxs)(`div`,{className:v({display:`flex`,alignItems:`center`,gap:`2`}),children:[(0,L.jsx)(c,{tone:k(e)}),(0,L.jsx)(`span`,{className:P(D,v({fontWeight:`500`})),title:e.rel,children:e.file}),(0,L.jsxs)(`span`,{className:P(a,v({color:`faint`})),children:[`#`,e.id]})]})}),(0,L.jsx)(`td`,{className:v({color:`muted`,whiteSpace:`nowrap`}),children:w(e)}),(0,L.jsx)(`td`,{children:e.env?(0,L.jsx)(l,{children:e.env}):null}),(0,L.jsx)(`td`,{className:`num`,children:h(e.request_count)}),(0,L.jsx)(`td`,{className:P(`num`,a),children:e.finished_at?_(e.finished_at-e.started_at):`—`}),(0,L.jsx)(`td`,{className:P(`num`,v({color:`muted`})),children:C(d,e.started_at)})]},e.id))})]})})]}),(0,L.jsxs)(`section`,{className:v({display:`flex`,flexDir:`column`,gap:`5`}),children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(r,{children:`Failing checks`}),(0,L.jsx)(n,{children:N.failedChecks.length===0?(0,L.jsxs)(`div`,{className:v({display:`flex`,gap:`2`,alignItems:`center`,p:`3`,color:`ok`}),children:[(0,L.jsx)(O,{size:16}),` No failed checks.`]}):N.failedChecks.map(e=>(0,L.jsxs)(f,{to:`/runs/$runId`,params:{runId:String(e.run_id)},search:{tab:`checks`},className:v({display:`flex`,gap:`2`,px:`3`,py:`2`,borderBottom:`1px solid`,borderColor:`line`,color:`fg`,textDecoration:`none`,_hover:{bg:`hover`},_last:{borderBottom:`none`}}),children:[(0,L.jsx)(`span`,{className:v({color:`bad`,pt:`1px`}),children:(0,L.jsx)(j,{size:15})}),(0,L.jsxs)(`span`,{className:v({minW:`0`,flex:`1`}),children:[(0,L.jsx)(`span`,{className:P(D,v({display:`block`,fontWeight:`500`})),children:e.name}),e.message?(0,L.jsx)(`span`,{className:P(D,v({display:`block`,color:`bad`,fontSize:`12px`})),children:e.message}):null,(0,L.jsxs)(`span`,{className:v({display:`block`,color:`faint`,fontSize:`11px`}),children:[e.file,` · run #`,e.run_id,` · `,C(d,e.ts)]})]})]},e.id))})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(r,{children:`Failed requests`}),(0,L.jsx)(n,{children:N.failedRequests.length===0?(0,L.jsxs)(`div`,{className:v({display:`flex`,gap:`2`,alignItems:`center`,p:`3`,color:`ok`}),children:[(0,L.jsx)(O,{size:16}),` Every request succeeded.`]}):N.failedRequests.map(e=>(0,L.jsxs)(f,{to:`/requests/$requestId`,params:{requestId:String(e.id)},className:v({display:`flex`,alignItems:`center`,gap:`2`,px:`3`,py:`1.5`,borderBottom:`1px solid`,borderColor:`line`,color:`fg`,textDecoration:`none`,_hover:{bg:`hover`},_last:{borderBottom:`none`}}),children:[(0,L.jsx)(s,{method:e.method,kind:e.kind,width:`list`}),(0,L.jsx)(`span`,{className:P(D,a,v({flex:`1`})),title:`${e.host}${e.path}`,children:e.path}),(0,L.jsx)(`span`,{className:v({color:`faint`,fontSize:`11px`,whiteSpace:`nowrap`}),children:C(d,e.ts)}),(0,L.jsx)(F,{status:e.status,error:e.error_name})]},e.id))})]})]})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(r,{children:`Slowest endpoints`}),(0,L.jsx)(n,{children:N.slowest.length===0?(0,L.jsx)(x,{title:`No HTTP requests yet`}):(0,L.jsxs)(`table`,{className:i,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Endpoint`}),(0,L.jsx)(`th`,{className:`num`,children:`Calls`}),(0,L.jsx)(`th`,{className:`num`,children:`Errors`}),(0,L.jsx)(`th`,{className:`num`,children:`Avg`}),(0,L.jsx)(`th`,{className:`num`,children:`Max`})]})}),(0,L.jsx)(`tbody`,{children:N.slowest.map(e=>(0,L.jsxs)(`tr`,{"data-link":!0,onClick:()=>void M({to:`/requests/$requestId`,params:{requestId:String(e.slowest_request_id)}}),children:[(0,L.jsx)(`td`,{className:v({maxW:`0`,w:`full`}),children:(0,L.jsxs)(`div`,{className:v({display:`flex`,alignItems:`center`,gap:`2`,minW:`0`}),children:[(0,L.jsx)(s,{method:e.method,width:`list`}),(0,L.jsxs)(`span`,{className:P(D,a),children:[(0,L.jsx)(`span`,{className:v({color:`faint`}),children:e.host}),e.path]})]})}),(0,L.jsx)(`td`,{className:`num`,children:h(e.count)}),(0,L.jsx)(`td`,{className:P(`num`,e.errors?v({color:`warn`}):void 0),children:h(e.errors)}),(0,L.jsx)(`td`,{className:P(`num`,a),children:_(e.avg_ms)}),(0,L.jsx)(`td`,{className:P(`num`,a),children:_(e.max_ms)})]},`${e.method} ${e.host}${e.path}`))})]})})]})]})})}function B({counts:e,envCount:t,fileBytes:n}){return(0,L.jsxs)(u,{children:[(0,L.jsx)(o,{label:`Collections`,value:h(e.scripts),sub:`scripts recorded`}),(0,L.jsx)(o,{label:`Runs`,value:h(e.runs),sub:`${d(t,`environment`)}`}),(0,L.jsx)(o,{label:`Requests`,value:h(e.requests),sub:e.connections?`+ ${d(e.connections,`connection`)} · ${d(e.messages,`message`)}`:`HTTP`}),(0,L.jsx)(o,{label:`Failed requests`,value:h(e.failedRequests),tone:e.failedRequests?`warn`:void 0,sub:`errors and ≥ 400`}),(0,L.jsx)(o,{label:`Checks`,value:e.checks?`${h(e.checks-e.failedChecks)}/${h(e.checks)}`:`—`,tone:e.failedChecks?`bad`:e.checks?`ok`:void 0,sub:e.failedChecks?`${h(e.failedChecks)} failed`:`passing`}),(0,L.jsx)(o,{label:`Stored payloads`,value:b(e.storedBodyBytes),sub:`${h(e.bodies)} unique · ${b(n)} on disk`})]})}export{z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,Ct as r,E as i,Et as a,F as o,G as s,H as c,I as l,K as u,L as d,N as f,O as p,P as m,R as h,S as g,St as _,T as v,Tt as y,U as b,W as x,Z as S,_ as C,b as w,bt as T,dt as E,f as D,h as O,j as k,k as A,l as j,lt as M,nt as N,ot as ee,q as P,rt as F,st as I,t as L,tt as R,u as z,ut as B,v as V,vt as H,wt as U,x as W,yt as G,z as K}from"./index-D5VFd_3H.js";import{r as q,t as J}from"./kv-table-oB5gcq0i.js";var Y=a(y()),X=U();function Z(){let{run:e,tags:i,requests:a,checks:o,analytics:s,neighbours:c}=L.useLoaderData(),{tab:l=`requests`}=L.useSearch(),u=r({from:L.fullPath}),d=n(),f=R(e);if(z({key:j.run(e.id),title:`${e.file} #${e.id}`,icon:`run`,failed:f===`bad`}),d)return d;let p=o.filter(e=>e.status===`fail`).length;return(0,X.jsxs)(`div`,{className:T({display:`flex`,flexDir:`column`,h:`full`,minH:`0`}),children:[(0,X.jsx)(te,{run:e,neighbours:c}),(0,X.jsx)(t,{items:[{id:`requests`,label:`Requests`,count:a.length},{id:`checks`,label:`Checks`,count:o.length?`${o.length-p}/${o.length}`:0,tone:p?`bad`:o.length?`ok`:void 0},{id:`insights`,label:`Insights`},{id:`details`,label:`Details`,count:i.length||void 0}],value:l,onSelect:e=>void u({search:{tab:e===`requests`?void 0:e}})}),l===`requests`?(0,X.jsx)(ne,{run:e,requests:a,checks:o}):null,l===`checks`?(0,X.jsx)(ie,{run:e,checks:o}):null,l===`insights`?(0,X.jsx)(ae,{run:e,analytics:s}):null,l===`details`?(0,X.jsx)(oe,{run:e,tags:i}):null]})}function te({run:e,neighbours:t}){let n=r(),i=D(Date.now(),6e4),a=R(e),o=e.finished_at?e.finished_at-e.started_at:null,s=e.request_count-e.connection_count;return(0,X.jsxs)(`header`,{className:T({px:`5`,pt:`4`,pb:`3`,display:`flex`,flexDir:`column`,gap:`3`,flexShrink:0}),children:[(0,X.jsxs)(`div`,{className:T({display:`flex`,alignItems:`flex-start`,gap:`3`}),children:[(0,X.jsxs)(`div`,{className:T({minW:`0`,flex:`1`}),children:[(0,X.jsxs)(`div`,{className:T({display:`flex`,alignItems:`center`,gap:`2`}),children:[(0,X.jsx)(p,{tone:a}),(0,X.jsx)(`h1`,{className:G(P,T({fontSize:`18px`,fontWeight:`600`,m:`0`})),children:e.file}),(0,X.jsxs)(`span`,{className:G(c,T({color:`faint`,fontSize:`13px`})),children:[`#`,e.id]}),(0,X.jsx)(m,{tone:a,children:N(e)}),e.env?(0,X.jsx)(m,{children:e.env}):null]}),(0,X.jsxs)(`div`,{className:T({display:`flex`,gap:`2`,mt:`1`,color:`muted`,flexWrap:`wrap`,fontSize:`12px`}),children:[(0,X.jsxs)(_,{to:`/collections`,search:{entry:e.entry},className:G(c,T({color:`muted`,display:`inline-flex`,gap:`1`,alignItems:`center`,_hover:{color:`accent`}})),title:e.entry,children:[(0,X.jsx)(E,{size:12}),e.rel]}),(0,X.jsx)(`span`,{children:`·`}),(0,X.jsx)(`span`,{children:V(i,e.started_at)}),(0,X.jsx)(`span`,{children:`·`}),(0,X.jsxs)(`span`,{children:[`node `,e.node_version]}),e.label&&e.label!==e.file?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:`·`}),(0,X.jsx)(`span`,{children:e.label})]}):null]})]}),(0,X.jsxs)(`div`,{className:T({display:`flex`,gap:`1`,flexShrink:0}),children:[(0,X.jsx)(k,{label:`Older run of this script`,disabled:t.prev==null,onClick:()=>t.prev&&void n({to:`/runs/$runId`,params:{runId:String(t.prev)}}),children:(0,X.jsx)(M,{})}),(0,X.jsx)(k,{label:`Newer run of this script`,disabled:t.next==null,onClick:()=>t.next&&void n({to:`/runs/$runId`,params:{runId:String(t.next)}}),children:(0,X.jsx)(B,{})})]})]}),e.exit_status===`error`?(0,X.jsx)(v,{tone:`bad`,icon:(0,X.jsx)(ee,{size:15}),title:e.error_name??`The script threw`,children:(0,X.jsx)(`span`,{className:c,children:e.error_message})}):null,(0,X.jsxs)(h,{children:[(0,X.jsx)(d,{label:`Wall time`,value:w(o),sub:e.finished_at?`start to finish`:`never finished`}),(0,X.jsx)(d,{label:`Requests`,value:C(s),sub:e.connection_count?`+ ${g(e.connection_count,`connection`)}`:`${w(e.total_duration_ms)} in flight`}),(0,X.jsx)(d,{label:`Failed requests`,value:C(e.error_count),tone:e.error_count?`warn`:`ok`,sub:`errors and ≥ 400`}),(0,X.jsx)(d,{label:`Checks`,value:e.check_count?`${e.check_count-e.failed_check_count}/${e.check_count}`:`—`,tone:e.failed_check_count?`bad`:e.check_count?`ok`:void 0,sub:e.check_count?e.failed_check_count?`${e.failed_check_count} failed`:`all passed`:`none recorded`}),(0,X.jsx)(d,{label:`Data`,value:O(e.total_bytes),sub:`sent + received`})]})]})}var Q={ok:T({bg:`ok`}),info:T({bg:`info`}),warn:T({bg:`warn`}),bad:T({bg:`bad`}),neutral:T({bg:`faint`})};function ne({run:t,requests:n,checks:i}){let a=r(),[o,u]=Y.useState(``),[d,p]=Y.useState(`all`),[m,h]=Y.useState(!0),_=o.trim().toLowerCase(),v=n.filter(e=>(d===`all`||S(e))&&(!_||`${e.method} ${e.host}${e.path} ${e.status??``}`.toLowerCase().includes(_))),y=Y.useMemo(()=>{let e=v.map(e=>({type:`request`,row:e}));if(!m||_||d===`failed`)return e;for(let t of i)e.push({type:`check`,row:t});return e.toSorted((e,t)=>e.row.ts-t.row.ts)},[v,i,m,_,d]),b=t.started_at,C=Math.max(t.finished_at??0,...n.map(e=>e.ts+e.duration_ms),...i.map(e=>e.ts),b+1)-b,E=n.filter(S).length;return n.length===0&&i.length===0?(0,X.jsx)(A,{title:`This run made no requests`}):(0,X.jsxs)(`div`,{className:T({display:`flex`,flexDir:`column`,flex:`1`,minH:`0`}),children:[(0,X.jsxs)(`div`,{className:T({display:`flex`,gap:`2`,px:`5`,py:`2`,alignItems:`center`,flexShrink:0,flexWrap:`wrap`}),children:[(0,X.jsx)(e,{className:T({w:`280px`}),placeholder:`Filter by method, path or status`,value:o,onChange:e=>u(e.target.value)}),(0,X.jsx)(l,{items:[{id:`all`,label:`All ${n.length}`},{id:`failed`,label:`Failed ${E}`}],value:d,onSelect:p}),i.length?(0,X.jsxs)(`label`,{className:T({display:`inline-flex`,alignItems:`center`,gap:`1.5`,color:`muted`,fontSize:`12px`,cursor:`pointer`}),children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),`Show checks inline`]}):null,(0,X.jsxs)(`span`,{className:T({ml:`auto`,color:`faint`,fontSize:`12px`}),children:[`Timeline spans `,w(C)]})]}),(0,X.jsx)(`div`,{className:x,children:(0,X.jsxs)(`table`,{className:s,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`num`,style:{width:40},children:`#`}),(0,X.jsx)(`th`,{children:`Request`}),(0,X.jsx)(`th`,{children:`Status`}),(0,X.jsx)(`th`,{className:`num`,children:`Time`}),(0,X.jsx)(`th`,{className:`num`,children:`Size`}),(0,X.jsx)(`th`,{style:{width:`32%`},children:`Timeline`})]})}),(0,X.jsxs)(`tbody`,{children:[y.map(e=>e.type===`check`?(0,X.jsx)(re,{check:e.row,start:b,span:C},`c${e.row.id}`):(0,X.jsxs)(`tr`,{"data-link":!0,onClick:()=>void a({to:`/requests/$requestId`,params:{requestId:String(e.row.id)}}),children:[(0,X.jsx)(`td`,{className:G(`num`,c,T({color:`faint`})),children:e.row.seq+1}),(0,X.jsx)(`td`,{className:T({maxW:`0`,w:`full`}),children:(0,X.jsxs)(`div`,{className:T({display:`flex`,alignItems:`center`,gap:`2`,minW:`0`}),children:[(0,X.jsx)(f,{method:e.row.method,kind:e.row.kind,width:`list`}),(0,X.jsxs)(`span`,{className:G(P,c),title:`${e.row.host}${e.row.path}`,children:[(0,X.jsx)(`span`,{className:T({color:`faint`}),children:e.row.host}),e.row.path]}),e.row.kind===`http`?null:(0,X.jsx)(`span`,{className:T({color:`faint`,fontSize:`11px`,whiteSpace:`nowrap`}),children:g(e.row.message_count,`message`)})]})}),(0,X.jsx)(`td`,{children:(0,X.jsx)(K,{status:e.row.status,error:e.row.error_name})}),(0,X.jsx)(`td`,{className:G(`num`,c),children:w(e.row.duration_ms)}),(0,X.jsx)(`td`,{className:G(`num`,c,T({color:`muted`})),children:O(e.row.response_bytes)}),(0,X.jsx)(`td`,{children:(0,X.jsx)(`div`,{className:T({position:`relative`,h:`8px`}),title:`${W(e.row.ts-b)} · ${w(e.row.duration_ms)}`,children:(0,X.jsx)(`div`,{className:G(T({position:`absolute`,top:`0`,bottom:`0`,rounded:`full`,minW:`2px`}),Q[F(e.row.status,e.row.error_name)]),style:{left:`${(e.row.ts-b)/C*100}%`,width:`${e.row.duration_ms/C*100}%`,opacity:e.row.kind===`http`?1:.5}})})})]},e.row.id)),y.length===0?(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:6,className:T({textAlign:`center`,color:`faint`,py:`6`}),children:`No requests match.`})}):null]})]})})]})}function re({check:e,start:t,span:n}){let r=e.status===`pass`;return(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{colSpan:4,className:T({maxW:`0`}),children:(0,X.jsxs)(`div`,{className:T({display:`flex`,alignItems:`center`,gap:`2`,minW:`0`,fontSize:`12px`}),children:[(0,X.jsx)(`span`,{className:G(T({display:`inline-flex`,w:`46px`,justifyContent:`center`}),u(r?`ok`:`bad`)),children:r?(0,X.jsx)(I,{size:14}):(0,X.jsx)(H,{size:14})}),(0,X.jsxs)(`span`,{className:G(P,T(r?{color:`muted`}:{color:`bad`,fontWeight:`500`})),children:[e.name,!r&&e.message?` — ${e.message}`:``]})]})}),(0,X.jsx)(`td`,{children:(0,X.jsx)(`div`,{className:T({position:`relative`,h:`8px`}),children:(0,X.jsx)(`div`,{className:G(T({position:`absolute`,top:`-1px`,w:`2px`,h:`10px`,rounded:`full`}),r?Q.ok:Q.bad),style:{left:`${(e.ts-t)/n*100}%`}})})})]})}function ie({run:e,checks:t}){return t.length===0?(0,X.jsxs)(A,{title:`No checks in this run`,icon:(0,X.jsx)(I,{size:22}),children:[`A script records expectations with `,(0,X.jsx)(`code`,{children:`check()`}),` and `,(0,X.jsx)(`code`,{children:`assert()`}),` from`,` `,(0,X.jsx)(`code`,{children:`@apisurf/wire/kit`}),`.`]}):(0,X.jsx)(`div`,{className:x,children:(0,X.jsx)(`div`,{className:b,children:(0,X.jsx)(i,{children:t.map(t=>{let n=t.status===`pass`;return(0,X.jsxs)(`div`,{className:T({display:`flex`,gap:`2.5`,px:`3`,py:`2`,borderBottom:`1px solid`,borderColor:`line`,_last:{borderBottom:`none`}}),children:[(0,X.jsx)(`span`,{className:G(T({pt:`1px`}),u(n?`ok`:`bad`)),children:n?(0,X.jsx)(I,{size:16}):(0,X.jsx)(H,{size:16})}),(0,X.jsxs)(`div`,{className:T({flex:`1`,minW:`0`}),children:[(0,X.jsxs)(`div`,{className:T({display:`flex`,gap:`2`,alignItems:`center`}),children:[(0,X.jsx)(`span`,{className:T({fontWeight:`500`}),children:t.name}),t.mode===`assert`?(0,X.jsx)(m,{tone:n?`neutral`:`bad`,children:`assert`}):null]}),!n&&t.message?(0,X.jsx)(`div`,{className:G(c,T({color:`bad`,mt:`0.5`,wordBreak:`break-word`})),children:t.message}):null]}),(0,X.jsx)(`span`,{className:G(c,T({color:`faint`,whiteSpace:`nowrap`})),children:W(t.ts-e.started_at)})]},t.id)})})})})}var $={"1xx":`info`,"2xx":`ok`,"3xx":`info`,"4xx":`warn`,"5xx":`bad`,error:`bad`};function ae({run:e,analytics:t}){let n=r();if(t.total===0)return(0,X.jsx)(A,{title:`Nothing to analyse — this run made no requests`});let a=Math.max(...t.byHost.map(e=>e.count),1);return(0,X.jsx)(`div`,{className:x,children:(0,X.jsxs)(`div`,{className:b,children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(d,{label:`p50 latency`,value:w(t.p50),sub:`over ${g(t.latencySamples,`HTTP request`)}`}),(0,X.jsx)(d,{label:`p95 latency`,value:w(t.p95)}),(0,X.jsx)(d,{label:`p99 latency`,value:w(t.p99)}),(0,X.jsx)(d,{label:`Hosts`,value:C(t.byHost.length),sub:t.byHost[0]?.host})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(o,{children:`Status mix`}),(0,X.jsxs)(i,{className:T({p:`3`}),children:[(0,X.jsx)(`div`,{className:T({display:`flex`,gap:`2px`,h:`14px`}),children:t.statusMix.map(e=>(0,X.jsx)(`div`,{title:`${e.status_class}: ${e.count}`,className:G(T({rounded:`sm`,minW:`4px`}),Q[$[e.status_class]??`neutral`]),style:{flexGrow:e.count}},e.status_class))}),(0,X.jsx)(`div`,{className:T({display:`flex`,gap:`4`,mt:`2.5`,flexWrap:`wrap`}),children:t.statusMix.map(e=>(0,X.jsxs)(`span`,{className:T({display:`inline-flex`,alignItems:`center`,gap:`1.5`}),children:[(0,X.jsx)(`span`,{className:G(T({w:`8px`,h:`8px`,rounded:`xs`}),Q[$[e.status_class]??`neutral`])}),(0,X.jsx)(`span`,{className:c,children:e.status_class}),(0,X.jsxs)(`span`,{className:T({color:`muted`}),children:[e.count,` · `,Math.round(e.count/t.total*100),`%`]})]},e.status_class))})]})]}),(0,X.jsxs)(`div`,{className:T({display:`grid`,gridTemplateColumns:{base:`1fr`,lg:`1fr 1fr`},gap:`5`}),children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(o,{children:`By host`}),(0,X.jsx)(i,{children:(0,X.jsxs)(`table`,{className:s,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:`Host`}),(0,X.jsx)(`th`,{className:`num`,children:`Calls`}),(0,X.jsx)(`th`,{className:`num`,children:`Errors`}),(0,X.jsx)(`th`,{className:`num`,children:`p95`})]})}),(0,X.jsx)(`tbody`,{children:t.byHost.map(e=>(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`td`,{children:[(0,X.jsx)(`div`,{className:G(c,P),children:e.host}),(0,X.jsx)(`div`,{className:T({h:`3px`,mt:`1`,bg:`accent`,rounded:`full`,opacity:.6}),style:{width:`${e.count/a*100}%`}})]}),(0,X.jsx)(`td`,{className:`num`,children:e.count}),(0,X.jsx)(`td`,{className:G(`num`,e.errors?T({color:`warn`}):void 0),children:e.errors}),(0,X.jsx)(`td`,{className:G(`num`,c),children:w(e.p95)})]},e.host))})]})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(o,{children:`Slowest requests`}),(0,X.jsx)(i,{children:(0,X.jsx)(`table`,{className:s,children:(0,X.jsx)(`tbody`,{children:t.slowest.map(e=>(0,X.jsxs)(`tr`,{"data-link":!0,onClick:()=>void n({to:`/requests/$requestId`,params:{requestId:String(e.id)}}),children:[(0,X.jsx)(`td`,{className:T({maxW:`0`,w:`full`}),children:(0,X.jsxs)(`div`,{className:T({display:`flex`,gap:`2`,alignItems:`center`,minW:`0`}),children:[(0,X.jsx)(f,{method:e.method,width:`list`}),(0,X.jsx)(`span`,{className:G(c,P),children:e.path})]})}),(0,X.jsx)(`td`,{className:G(`num`,c),children:w(e.duration_ms)})]},e.id))})})})]})]}),(0,X.jsxs)(`p`,{className:T({color:`faint`,fontSize:`12px`,m:`0`}),children:[`Latency covers HTTP requests only; a WebSocket or SSE connection's duration is how long it stayed open.`,e.connection_count?` This run opened ${g(e.connection_count,`connection`)}.`:``]})]})})}function oe({run:e,tags:t}){let n=D(Date.now(),6e4),r=[{name:`id`,value:String(e.id)},{name:`uid`,value:e.uid},{name:`label`,value:e.label??`—`},{name:`entry`,value:e.entry},{name:`cwd`,value:e.cwd},{name:`env`,value:e.env??`—`},{name:`node`,value:e.node_version},{name:`started`,value:V(n,e.started_at)},{name:`finished`,value:e.finished_at?V(n,e.finished_at):`—`},{name:`exit status`,value:e.exit_status??`—`}];return(0,X.jsx)(`div`,{className:x,children:(0,X.jsxs)(`div`,{className:b,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(o,{children:`Run`}),(0,X.jsx)(i,{children:(0,X.jsx)(J,{rows:r,empty:``,filterable:!1,nameLabel:`Field`})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(o,{children:`Tags`}),(0,X.jsx)(i,{children:(0,X.jsx)(J,{rows:t.map(e=>({name:e.key,value:e.value})),empty:`No tags — add them with wire execute --tag key=value`,filterable:!1})})]}),e.entry_source?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(o,{children:`Inline source`}),(0,X.jsx)(i,{children:(0,X.jsx)(`div`,{className:T({bg:`well`}),children:(0,X.jsx)(q,{text:e.entry_source})})})]}):null]})})}export{Z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Et as e,Tt as t,d as n,p as r}from"./index-D5VFd_3H.js";var i=e(t(),1);function a(e,t){let{prefs:a,refreshKey:o}=r(),[s,c]=i.useState(null),l=i.useRef(t);return l.current=t,i.useEffect(()=>{if(a.env===`*`)return;let e=!1;return l.current(n(a.env)).then(t=>{e||c({env:a.env,data:t})}),()=>{e=!0}},[a.env,o,e]),a.env===`*`?{data:e,pending:!1}:s&&s.env===a.env?{data:s.data,pending:!1}:{data:e,pending:!0}}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Et as e,Tt as t,bt as n,wt as r,yt as i}from"./index-D5VFd_3H.js";var a=e(t(),1),o=r(),s=.15,c=.85;function l(e,t){try{let n=Number(localStorage.getItem(`wireui:split:${e}`));return n>=s&&n<=c?n:t}catch{return t}}function u({direction:e,first:t,second:r,initial:u=.5,storageKey:d}){let f=a.useRef(null),[p,m]=a.useState(u),[h,g]=a.useState(!1),_=e===`side`;a.useEffect(()=>m(l(d,u)),[d,u]);let v=e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),g(!0)},y=e=>{if(!h||!f.current)return;let t=f.current.getBoundingClientRect(),n=_?(e.clientX-t.left)/t.width:(e.clientY-t.top)/t.height;m(Math.min(c,Math.max(s,n)))},b=()=>{if(h){g(!1);try{localStorage.setItem(`wireui:split:${d}`,String(p))}catch{}}},x=n({minW:`0`,minH:`0`,overflow:`hidden`,display:`flex`,flexDir:`column`});return(0,o.jsxs)(`div`,{ref:f,className:i(n({display:`flex`,flex:`1`,minH:`0`,minW:`0`,h:`full`}),n(_?{flexDir:`row`}:{flexDir:`column`}),h&&n({userSelect:`none`,cursor:_?`col-resize`:`row-resize`})),children:[(0,o.jsx)(`div`,{className:x,style:{flexBasis:`${p*100}%`,flexGrow:0,flexShrink:0},children:t}),(0,o.jsx)(`div`,{role:`separator`,"aria-orientation":_?`vertical`:`horizontal`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onDoubleClick:()=>m(u),className:i(n({flexShrink:0,bg:`line`,position:`relative`,transition:`background 80ms`,_hover:{bg:`accent`},_after:{content:`""`,position:`absolute`}}),n(_?{w:`1px`,cursor:`col-resize`,_after:{top:`0`,bottom:`0`,left:`-3px`,right:`-3px`}}:{h:`1px`,cursor:`row-resize`,_after:{left:`0`,right:`0`,top:`-3px`,bottom:`-3px`}}),h&&n({bg:`accent`}))}),(0,o.jsx)(`div`,{className:i(x,n({flex:`1`})),children:r})]})}export{u as t};
|