PageSourceSearch

https://axonhub.onrender.com/assets/_traceId-C9pN55T_.js

js axonhub.onrender.com collected 2026-10-03 11:40:28 UTC 12,935 bytes, 1 lines download raw bytes

1import{I as E,a2 as U,F as $,r as m,j as e,B as a,a3 as z,c as r,X as M,am as O,an as V}from"./index-DHw9oA_9.js";import{P as X}from"./project-guard-BAQgFXYF.js";import{u as _}from"./use-pagination-search-Bvdj626l.js";import{u as J}from"./useInterval-CxsRpM-s.js";import{S as L}from"./separator-Dr0amUq4.js";import{S as K}from"./switch-gJnpXWOQ.js";import{H as b}from"./header-Cv8cqG2Q.js";import{M as w}from"./main-DVTNl6i5.js";import{u as Q}from"./system-7Tzze9qo.js";import{u as Y}from"./style-SvDnmqan.js";import{p as Z}from"./schema-Dv1T_neT.js";import{L as I,G as F,W as D,M as ee,T as se,a as te,b as ae,S as re}from"./trace-flow-timeline-nOhUvban.js";import{z as le}from"./zh-CN-Q7bnGY18.js";import{e as ie,f as ce}from"./format-Cr--RMFj.js";import{A as p}from"./activity-ygB6GkSG.js";import{A as v}from"./wrench-DnPZeogI.js";import{R as ne}from"./refresh-cw-HpjJfzkN.js";import{F as oe}from"./file-text-r5AWu5FN.js";import"./alert-CDypPSvf.js";import"./projects-BI7BU8R_.js";import"./use-error-handler-DNWpwRYc.js";import"./schemas-Dk9VIjIk.js";import"./pagination-A-lnj4Ev.js";import"./coerce-CPg-xoCJ.js";import"./index-OHEQoLNU.js";import"./index-CYhYchP8.js";import"./format-number-DatnL_QQ.js";import"./badge-B6qX-S9N.js";import"./checkbox-T9BQO82N.js";import"./check-9LYngghg.js";import"./popover-BsOz1jcH.js";import"./index-CPF_HSnu.js";import"./format-duration-CLi-hl45.js";import"./funnel-D-fuuOYG.js";import"./chevrons-down-up-CpEvHx1X.js";import"./chevron-down-DXGKvrGC.js";import"./chevron-right-Cda121HX.js";import"./external-link-BAeBLCXl.js";import"./proxy-Doseqd7i.js";import"./json-tree-view-iq1aJrSD.js";import"./tooltip-DrbA_q--.js";import"./index-y6pprLpS.js";import"./copy-RWk8Yj30.js";import"./chevron-up-BFohDdsk.js";import"./ellipsis-I4rERU3U.js";import"./transform-BpQxuIUt.js";import"./string-DrVeOkaC.js";import"./value-D0d0dz72.js";import"./circle-CgC1UHPE.js";import"./settings-cKT8VPuV.js";import"./circle-check-BUTFTzkA.js";import"./sparkles-D5I-x_74.js";import"./message-square-DLwDkM4i.js";function me(){const{t:s,i18n:k}=E(),{traceId:R}=U({from:"/_authenticated/project/traces/$traceId"}),P=$(),A=k.language==="zh"?le:ie,[W,S]=m.useState(null),[d,u]=m.useState(null),[B,y]=m.useState(null),[f,G]=m.useState(!1),[o,h]=m.useState("flat"),[c,g]=m.useState(!1),{getSearchParams:H}=_({defaultPageSize:20}),{data:t,isLoading:j,refetch:T}=Y(R),{data:q}=Q(),l=m.useMemo(()=>t?.rawRootSegment?Z(t.rawRootSegment):null,[t]);m.useEffect(()=>{if(l&&!d){const i=l.requestSpans?.[0]||l.responseSpans?.[0];if(i){const n=l.requestSpans?.[0]?"request":"response";S(l),u(i),y(n)}}},[l,d]),J(()=>{T()},f?3e4:null);const N=(i,n,x)=>{S(i),u(n),y(x)},C=()=>{P({to:"/project/traces",search:H()})};return j?e.jsxs("div",{className:"flex h-screen flex-col",children:[e.jsx(b,{className:"border-b"}),e.jsx(w,{className:"flex-1",children:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"border-primary mx-auto h-12 w-12 animate-spin rounded-full border-b-2"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:s("common.loading")})]})})})]}):t?e.jsxs("div",{className:"flex h-screen flex-col",children:[!c&&e.jsx(b,{className:"bg-background/95 supports-[backdrop-filter]:bg-background/60 w-full border-b backdrop-blur",children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0 flex-1",children:[e.jsxs(a,{variant:"ghost",size:"sm",onClick:C,className:"hover:bg-accent shrink-0",children:[e.jsx(v,{className:"mr-1 sm:mr-2 h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("common.back")})]}),e.jsx(L,{orientation:"vertical",className:"h-6 shrink-0 hidden sm:block"}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"bg-primary/10 flex h-7 w-7 sm:h-8 sm:w-8 items-center justify-center rounded-lg shrink-0",children:e.jsx(p,{className:"text-primary h-3.5 w-3.5 sm:h-4 sm:w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-sm sm:text-lg leading-none font-semibold truncate",children:[s("traces.detail.title")," #",z(t.id)||t.traceID]}),e.jsxs("div",{className:"mt-1 flex items-center gap-1 sm:gap-2 text-xs sm:text-sm",children:[e.jsx("p",{className:"text-muted-foreground truncate max-w-[120px] sm:max-w-none",children:t.traceID}),e.jsx("span",{className:"text-muted-foreground hidden sm:inline",children:"•"}),e.jsx("p",{className:"text-muted-foreground text-[10px] sm:text-xs hidden sm:inline",children:ce(new Date(t.createdAt),"yyyy-MM-dd HH:mm:ss",{locale:A})})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 shrink-0",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[e.jsx(K,{checked:f,onCheckedChange:G,id:"auto-refresh-switch"}),e.jsx("label",{htmlFor:"auto-refresh-switch",className:"text-muted-foreground cursor-pointer text-sm",children:s("common.autoRefresh")})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:()=>T(),disabled:j,className:"px-2 sm:px-3",children:[e.jsx(ne,{className:`h-4 w-4 ${j||f?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline ml-2",children:s("common.refresh")})]})]})]})}),e.jsx(w,{className:r("flex-1 overflow-hidden flex flex-col p-0",c&&"fixed inset-0 z-50 bg-background"),children:l?e.jsxs(e.Fragment,{children:[!c&&e.jsx("div",{className:"px-4 sm:px-6 py-3 sm:py-4 border-b bg-background",children:e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 sm:gap-4",children:[e.jsxs("div",{className:"bg-muted/30 rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:s("traces.detail.totalTokensLabel")}),e.jsx("p",{className:"text-base sm:text-lg font-semibold",children:(t.usageMetadata?.totalTokens??0).toLocaleStr
1ing()})]}),e.jsxs("div",{className:"bg-muted/30 rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:s("traces.detail.inputTokensLabel")}),e.jsx("p",{className:"text-base sm:text-lg font-semibold",children:(t.usageMetadata?.totalInputTokens??0).toLocaleString()})]}),e.jsxs("div",{className:"bg-muted/30 rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:s("traces.detail.outputTokensLabel")}),e.jsx("p",{className:"text-base sm:text-lg font-semibold",children:(t.usageMetadata?.totalOutputTokens??0).toLocaleString()})]}),e.jsxs("div",{className:"bg-muted/30 rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:s("traces.detail.cachedTokensLabel")}),e.jsx("p",{className:"text-base sm:text-lg font-semibold",children:(t.usageMetadata?.totalCachedTokens??0).toLocaleString()})]}),e.jsxs("div",{className:"bg-muted/30 rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:s("traces.detail.cachedWriteTokensLabel")}),e.jsx("p",{className:"text-base sm:text-lg font-semibold",children:(t.usageMetadata?.totalCachedWriteTokens??0).toLocaleString()})]}),e.jsxs("div",{className:"bg-muted/30 rounded-lg px-3 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:s("usageLogs.columns.totalCost")}),t.usageMetadata?.totalCost?e.jsx("p",{className:"text-base sm:text-lg font-semibold",children:s("currencies.format",{val:t.usageMetadata.totalCost,currency:q?.currencyCode,locale:k.language==="zh"?"zh-CN":"en-US",minimumFractionDigits:6})}):e.jsx("p",{className:"text-muted-foreground text-base sm:text-lg font-semibold",children:"-"})]})]})}),c&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-background shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(a,{variant:"ghost",size:"sm",onClick:()=>g(!1),children:[e.jsx(v,{className:"mr-2 h-4 w-4"}),s("common.back")]}),e.jsx(L,{orientation:"vertical",className:"h-6"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{className:"text-primary h-4 w-4"}),e.jsxs("span",{className:"font-semibold",children:[s("traces.detail.title")," #",z(t.id)||t.traceID]}),e.jsx("span",{className:"text-muted-foreground text-sm",children:t.traceID})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"bg-muted inline-flex items-center rounded-md p-0.5 mr-2",children:[e.jsxs(a,{variant:"ghost",size:"sm",className:r("h-7 gap-1.5 rounded-sm px-2.5 text-xs",o==="flat"&&"bg-background shadow-sm"),onClick:()=>h("flat"),children:[e.jsx(I,{className:"h-3.5 w-3.5"}),s("traces.detail.viewMode.flat")]}),e.jsxs(a,{variant:"ghost",size:"sm",className:r("h-7 gap-1.5 rounded-sm px-2.5 text-xs",o==="flow"&&"bg-background shadow-sm"),onClick:()=>h("flow"),children:[e.jsx(F,{className:"h-3.5 w-3.5"}),s("traces.detail.viewMode.flow")]}),e.jsxs(a,{variant:"ghost",size:"sm",className:r("h-7 gap-1.5 rounded-sm px-2.5 text-xs",o==="tree"&&"bg-background shadow-sm"),onClick:()=>h("tree"),children:[e.jsx(D,{className:"h-3.5 w-3.5"}),s("traces.detail.viewMode.tree")]})]}),e.jsx(a,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>g(!1),title:s("common.exitFullscreen"),children:e.jsx(M,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:r("flex flex-1 overflow-hidden flex-col",c?"":"pt-2"),children:[e.jsxs("div",{className:"mb-3 flex items-center justify-end shrink-0 px-4 sm:px-6",children:[e.jsxs("div",{className:"bg-muted inline-flex items-center rounded-md p-0.5",children:[e.jsxs(a,{variant:"ghost",size:"sm",className:r("h-7 gap-1.5 rounded-sm px-2.5 text-xs",o==="flat"&&"bg-background shadow-sm"),onClick:()=>h("flat"),children:[e.jsx(I,{className:"h-3.5 w-3.5"}),s("traces.detail.viewMode.flat")]}),e.jsxs(a,{variant:"ghost",size:"sm",className:r("h-7 gap-1.5 rounded-sm px-2.5 text-xs",o==="flow"&&"bg-background shadow-sm"),onClick:()=>h("flow"),children:[e.jsx(F,{className:"h-3.5 w-3.5"}
1),s("traces.detail.viewMode.flow")]}),e.jsxs(a,{variant:"ghost",size:"sm",className:r("h-7 gap-1.5 rounded-sm px-2.5 text-xs",o==="tree"&&"bg-background shadow-sm"),onClick:()=>h("tree"),children:[e.jsx(D,{className:"h-3.5 w-3.5"}),s("traces.detail.viewMode.tree")]})]}),e.jsx(a,{variant:"ghost",size:"sm",className:"ml-2 h-7 w-7 p-0",onClick:()=>g(!0),title:s("common.fullscreen"),children:e.jsx(ee,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col sm:flex-row",children:[e.jsx("div",{className:r("flex-1 overflow-hidden flex flex-col",c?"p-0":"p-4 sm:p-6 overflow-auto"),children:e.jsx("div",{className:r("flex-1 overflow-auto",c&&"p-4"),children:o==="flat"?e.jsx(se,{trace:l,onSelectSpan:(i,n,x)=>N(i,n,x),selectedSpanId:d?.id}):o==="flow"?e.jsx(te,{trace:l,onSelectSpan:(i,n,x)=>N(i,n,x),selectedSpanId:d?.id,isFullscreen:c}):e.jsx(ae,{trace:l,onSelectSpan:(i,n,x)=>N(i,n,x),selectedSpanId:d?.id})})}),e.jsxs("div",{className:r("border-border bg-background overflow-y-auto border-t sm:border-t-0 sm:border-l transition-all duration-300",c?"w-full sm:w-[450px]":"w-full sm:w-[500px]",d?"flex flex-col":"hidden sm:flex sm:flex-col"),children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b sm:hidden bg-background sticky top-0 z-10",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{className:"text-primary h-4 w-4"}),e.jsx("h3",{className:"font-medium text-sm",children:s("traces.detail.spanDetail")})]}),e.jsx(a,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>u(null),children:e.jsx(M,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(re,{selectedTrace:W,selectedSpan:d,selectedSpanType:B})})]})]})]})]}):e.jsx("div",{className:"flex h-full items-center justify-center p-6",children:e.jsx(O,{className:"border-0 shadow-sm",children:e.jsx(V,{className:"py-16",children:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx(oe,{className:"text-muted-foreground mx-auto h-16 w-16"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:s("traces.detail.noTraceData")})]})})})})})})]}):e.jsxs("div",{className:"flex h-screen flex-col",children:[e.jsx(b,{className:"border-b"}),e.jsx(w,{className:"flex-1",children:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"space-y-6 text-center",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{className:"text-muted-foreground mx-auto h-16 w-16"}),e.jsx("p",{className:"text-muted-foreground text-xl font-medium",children:s("traces.detail.notFound")})]}),e.jsxs(a,{onClick:C,size:"lg",children:[e.jsx(v,{className:"mr-2 h-4 w-4"}),s("common.back")]})]})})})]})}function ms(){return e.jsx(X,{children:e.jsx(me,{})})}export{ms as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.