@perses-dev/tracing-gantt-chart-plugin 0.14.0-beta.1 → 0.14.0-beta.2
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/__mf/js/{TracingGanttChart.5745bc80.js → TracingGanttChart.4460ff1c.js} +2 -2
- package/__mf/js/async/{121.618b4fb6.js → 121.5b3411ef.js} +2 -2
- package/__mf/js/async/{192.c6c201e3.js → 192.b0550d58.js} +1 -1
- package/__mf/js/async/{2.48e075e5.js → 2.2a545358.js} +1 -1
- package/__mf/js/async/{235.19919f16.js → 235.831bea3e.js} +1 -1
- package/__mf/js/async/247.e4d2c197.js +1 -0
- package/__mf/js/async/{274.6cf6422e.js → 274.eee92e86.js} +2 -2
- package/__mf/js/async/{356.318657d1.js → 356.43c6ada2.js} +1 -1
- package/__mf/js/async/{392.924637be.js → 392.a3f49cf0.js} +2 -2
- package/__mf/js/async/407.6e0c3fb4.js +4 -0
- package/__mf/js/async/43.cbae1eef.js +2 -0
- package/__mf/js/async/43.cbae1eef.js.LICENSE.txt +24 -0
- package/__mf/js/async/{436.d35ff1bd.js → 436.4db73a03.js} +2 -2
- package/__mf/js/async/{470.22f77478.js → 470.8d6cfc01.js} +2 -2
- package/__mf/js/async/496.9a3d3d3d.js +1 -0
- package/__mf/js/async/{587.05c4c4aa.js → 587.849f1255.js} +1 -1
- package/__mf/js/async/588.39275df8.js +1 -0
- package/__mf/js/async/{616.7443c7ea.js → 616.4d217c10.js} +1 -1
- package/__mf/js/async/665.2b61216d.js +2 -0
- package/__mf/js/async/{672.2a876b27.js → 672.790df7d1.js} +1 -1
- package/__mf/js/async/71.4eb8fa2f.js +1 -0
- package/__mf/js/async/77.27ff39b8.js +1 -0
- package/__mf/js/async/776.f19f62f3.js +43 -0
- package/__mf/js/async/{518.0bb3a33a.js.LICENSE.txt → 776.f19f62f3.js.LICENSE.txt} +0 -25
- package/__mf/js/async/873.a00a9302.js +1 -0
- package/__mf/js/async/{941.a9b68d98.js → 941.7ee2dbf0.js} +2 -2
- package/__mf/js/async/{968.ad5c8bce.js → 968.b61d3c02.js} +1 -1
- package/__mf/js/async/978.4227a27e.js +1 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.303e7806.js +1 -0
- package/__mf/js/async/{lib-router.b71f208a.js → lib-router.a8607481.js} +2 -2
- package/__mf/js/{main.b5e393d7.js → main.7b791d2a.js} +3 -3
- package/mf-manifest.json +73 -29
- package/mf-stats.json +81 -29
- package/package.json +3 -3
- package/__mf/js/async/247.ca32b71b.js +0 -1
- package/__mf/js/async/354.f46df209.js +0 -4
- package/__mf/js/async/518.0bb3a33a.js +0 -43
- package/__mf/js/async/663.94619f01.js +0 -1
- package/__mf/js/async/665.70388bbd.js +0 -2
- package/__mf/js/async/__federation_expose_TracingGanttChart.bf18fa45.js +0 -1
- /package/__mf/css/async/{518.85c2cbf6.css → 776.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{121.618b4fb6.js.LICENSE.txt → 121.5b3411ef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.6cf6422e.js.LICENSE.txt → 274.eee92e86.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.924637be.js.LICENSE.txt → 392.a3f49cf0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{354.f46df209.js.LICENSE.txt → 407.6e0c3fb4.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{436.d35ff1bd.js.LICENSE.txt → 436.4db73a03.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.22f77478.js.LICENSE.txt → 470.8d6cfc01.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.a9b68d98.js.LICENSE.txt → 941.7ee2dbf0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.b71f208a.js.LICENSE.txt → lib-router.a8607481.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_TracingGanttChart_0_14_0_beta_1=self.chunk_TracingGanttChart_0_14_0_beta_1||[]).push([["989"],{68985(e,t,n){n.r(t),n.d(t,{TracingGanttChart:()=>eE});var s=n(62540),r=n(56875),i=n(66711),a=n(97090),l=n(70451),o=n(74628),d=n(315),u=n(47095),c=n(88091),p=n(87034),x=n(33868),m=n(47601),h=n(7800),f=n(76477),v=n(6227),j=n(57438),g=n(79956),b=n(14045),k=n(9222),M=n(47563),T=n(92959);let w=new T.A({hue:{min:20,max:360}}),y=new T.A({hue:{min:0,max:20}}),I={},A="2rem",S=e=>{var t;return(null==(t=e.status)?void 0:t.code)===M.CY};function U(e,t,n,s){return function(e,t,n,s){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("categorical"===n){let n=t.echartsTheme.color,i=[e.palette.error.light,e.palette.error.main,e.palette.error.dark],a=r?i:n;if(0===a.length)return console.warn("getConsistentCategoricalColor() called with empty color palette, fallback to #000"),"#000";let l=0;for(let e=0;e<s.length;e++)l=s.charCodeAt(e)+((l<<5)-l);return a[Math.abs(l)%a.length]??"#000"}{let e,t;return(t=I[e=`${s}_____${r}`])||(t=function(e,t){let[n,s,r]=t?y.hsl(e):w.hsl(e),i=`${(100*s).toFixed(0)}%`,a=`${(100*r).toFixed(0)}%`;return`hsla(${n.toFixed(2)},${i},${a},0.9)`}(s,r),I[e]=t),t}}(e,t,n,s.resource.serviceName??"",S(s))}function C(e){return e<1?`${Math.round(1e3*e)}μs`:e<1e3?`${+e.toFixed(2)}ms`:`${+(e/1e3).toFixed(2)}s`}function L(e){let{customLinks:t,trace:n,span:r}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(f.A,{children:[(0,s.jsx)(E,{name:"span ID",value:r.spanId}),(0,s.jsx)(E,{name:"start",value:C(r.startTimeUnixMs-n.startTimeUnixMs)}),(0,s.jsx)(E,{name:"duration",value:C(r.endTimeUnixMs-r.startTimeUnixMs)}),r.kind&&(0,s.jsx)(E,{name:"kind",value:r.kind}),r.status.code&&(0,s.jsx)(E,{name:"status code",value:r.status.code}),r.status.message&&(0,s.jsx)(E,{name:"status message",value:r.status.message})]}),r.attributes.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{}),(0,s.jsx)($,{customLinks:t,attributes:r.attributes.toSorted((e,t)=>e.key.localeCompare(t.key))})]}),r.resource.attributes.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{}),(0,s.jsx)($,{customLinks:t,attributes:r.resource.attributes.toSorted((e,t)=>e.key.localeCompare(t.key))})]}),(r.scope.name||r.scope.version||r.scope.attributes&&r.scope.attributes.length>0)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{}),(0,s.jsxs)(f.A,{children:[r.scope.name&&(0,s.jsx)(E,{name:"scope name",value:r.scope.name}),r.scope.version&&(0,s.jsx)(E,{name:"scope version",value:r.scope.version}),(0,s.jsx)(z,{customLinks:t,attributes:(r.scope.attributes??[]).toSorted((e,t)=>e.key.localeCompare(t.key))})]})]})]})}function $(e){let{customLinks:t,attributes:n}=e;return(0,s.jsx)(f.A,{children:(0,s.jsx)(z,{customLinks:t,attributes:n})})}function z(e){let{customLinks:t,attributes:n}=e,r=(0,k.useAllVariableValues)(),i=(0,l.useMemo)(()=>Object.fromEntries(((null==t?void 0:t.links.attributes)??[]).map(e=>[e.name,e.link])),[t]),a=(0,l.useMemo)(()=>{let e=n.map(e=>[e.key.replaceAll(".","_"),R(e.value)]);return{...null==t?void 0:t.variables,...Object.fromEntries(e)}},[t,n]);return(0,s.jsx)(s.Fragment,{children:n.map((e,t)=>(0,s.jsx)(E,{name:e.key,value:R(e.value),link:i[e.key]?(0,k.replaceVariablesInString)(i[e.key],r,a):void 0},t))})}function E(e){let{name:t,value:n,link:r}=e,{RouterComponent:i}=(0,k.useRouterContext)(),a=i&&r?(0,s.jsx)(j.A,{component:i,to:r,children:n}):n;return(0,s.jsx)(g.Ay,{sx:{px:1,py:0},children:(0,s.jsx)(b.A,{primary:t,secondary:a,slotProps:{primary:{variant:"h5"},secondary:{variant:"body1",sx:{wordBreak:"break-word"}}}})})}function R(e){if("stringValue"in e)return e.stringValue||"<empty string>";if("intValue"in e)return e.intValue;if("doubleValue"in e)return String(e.doubleValue);if("boolValue"in e)return String(e.boolValue);if("arrayValue"in e){let t=e.arrayValue.values;return t&&t.length>0?t.map(R).join(", "):"<empty array>"}return"<unknown type>"}var V=n(99415),F=n(39098),P=n(87275),B=n(38990);function D(e){let{customLinks:t,trace:n,span:r}=e;return(0,s.jsx)(s.Fragment,{children:r.events.toSorted((e,t)=>e.timeUnixMs-t.timeUnixMs).map((e,r)=>(0,s.jsxs)(l.Fragment,{children:[r>0&&(0,s.jsx)(v.A,{}),(0,s.jsx)(_,{customLinks:t,trace:n,event:e})]},r))})}function _(e){let{customLinks:t,trace:n,event:r}=e,i=r.timeUnixMs-n.startTimeUnixMs,[a,o]=(0,l.useState)(!1);return(0,s.jsxs)(f.A,{children:[(0,s.jsxs)(V.A,{onClick:()=>{o(!a)},sx:{px:1},children:[(0,s.jsx)(b.A,{primary:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("strong",{children:[C(i),":"]})," ",r.name]}),slotProps:{primary:{noWrap:!0}}}),a?(0,s.jsx)(B.default,{}):(0,s.jsx)(P.default,{})]}),(0,s.jsx)(F.A,{in:a,timeout:"auto",unmountOnExit:!0,children:(0,s.jsxs)(f.A,{sx:{px:1},children:[(0,s.jsx)(E,{name:"name",value:r.name}),(0,s.jsx)(E,{name:"time",value:C(i)}),(0,s.jsx)(z,{customLinks:t,attributes:r.attributes})]})})]})}function N(e){let{customLinks:t,span:n}=e;return(0,s.jsx)(s.Fragment,{children:n.links.map((e,n)=>(0,s.jsxs)(l.Fragment,{children:[n>0&&(0,s.jsx)(v.A,{}),(0,s.jsx)(O,{link:e,customLinks:t})]},n))})}function O(e){let{customLinks:t,link:n}=e,r=(0,k.useAllVariableValues)(),i=(null==t?void 0:t.links.trace)?(0,k.replaceVariablesInString)(t.links.trace,r,{...null==t?void 0:t.variables,traceId:n.traceId}):void 0,a=(null==t?void 0:t.links.span)?(0,k.replaceVariablesInString)(t.links.span,r,{...null==t?void 0:t.variables,traceId:n.traceId,spanId:n.spanId}):void 0;return(0,s.jsxs)(f.A,{children:[(0,s.jsx)(E,{name:"trace ID",value:n.traceId,link:i}),(0,s.jsx)(E,{name:"span ID",value:n.spanId,link:a}),(0,s.jsx)(z,{customLinks:t,attributes:n.attributes})]})}function W(e){let{customLinks:t,trace:n,span:r,onCloseBtnClick:i}=e,[a,d]=(0,l.useState)("attributes");return"events"===a&&0===r.events.length&&d("attributes"),"links"===a&&0===r.links.length&&d("attributes"),(0,s.jsxs)(o.A,{children:[(0,s.jsx)(u.A,{sx:{float:"right"},onClick:i,children:(0,s.jsx)(h.default,{})}),(0,s.jsx)(c.A,{sx:{wordBreak:"break-word"},children:r.resource.serviceName}),(0,s.jsx)(c.A,{variant:"h2",sx:{wordBreak:"break-word"},children:r.name}),(0,s.jsx)(o.A,{sx:{borderBottom:1,borderColor:"divider"},children:(0,s.jsxs)(p.A,{value:a,onChange:(e,t)=>d(t),variant:"scrollable",children:[(0,s.jsx)(x.A,{sx:{p:0},value:"attributes",label:"Attributes"}),r.events.length>0&&(0,s.jsx)(x.A,{value:"events",label:"Events",icon:(0,s.jsx)(m.A,{label:r.events.length}),iconPosition:"end",sx:{minHeight:48,height:48}}),r.links.length>0&&(0,s.jsx)(x.A,{value:"links",label:"Links",icon:(0,s.jsx)(m.A,{label:r.links.length}),iconPosition:"end",sx:{minHeight:48,height:48}})]})}),"attributes"===a&&(0,s.jsx)(L,{customLinks:t,trace:n,span:r}),"events"===a&&(0,s.jsx)(D,{customLinks:t,trace:n,span:r}),"links"===a&&(0,s.jsx)(N,{customLinks:t,span:r})]})}var G=n(56599),H=n(74649),Y=n(40224);function J(e,t){for(let n of e)!1!==t(n)&&J(n.childSpans,t)}function Q(e){return{timeUnixMs:1e-6*parseInt(e.timeUnixNano),name:e.name,attributes:e.attributes??[]}}function X(e){return{traceId:e.traceId,spanId:e.spanId,attributes:e.attributes??[]}}var Z=n(77308);function q(e){let{trace:t,viewport:n}=e,r=n.endTimeUnixMs-n.startTimeUnixMs,i=n.startTimeUnixMs-t.startTimeUnixMs;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ee,{style:{left:"0%",borderWidth:0},children:C(i)}),(0,s.jsx)(ee,{style:{left:"25%"},children:C(i+.25*r)}),(0,s.jsx)(ee,{style:{left:"50%"},children:C(i+.5*r)}),(0,s.jsx)(ee,{style:{left:"75%"},children:C(i+.75*r)}),(0,s.jsx)(ee,{style:{left:"100%"},children:(0,s.jsx)("span",{style:{position:"absolute",right:".75rem"},children:C(i+ +r)})})]})}function K(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ee,{style:{left:"25%"}}),(0,s.jsx)(ee,{style:{left:"50%"}}),(0,s.jsx)(ee,{style:{left:"75%"}})]})}let ee=(0,Z.A)(o.A)(e=>{let{theme:t}=e;return{position:"absolute",height:"100%",borderLeft:`1px solid ${t.palette.divider}`,padding:".25rem"}});function et(e){let{trace:t,viewport:n,nameColumnWidth:r,divider:i}=e,a=(0,G.A)();return(0,s.jsxs)(d.A,{direction:"row",alignItems:"center",sx:{height:A,fontSize:"0.9rem",borderBottom:`1px solid ${a.palette.divider}`},children:[(0,s.jsx)(o.A,{style:{width:`${100*r}%`},children:(0,s.jsx)("span",{style:{padding:".25rem"},children:"Service & Operation"})}),i,(0,s.jsx)(o.A,{sx:{position:"relative",height:"100%",flexGrow:1},children:(0,s.jsx)(q,{trace:t,viewport:n})})]})}let en=(0,l.createContext)(void 0);function es(e){let{children:t}=e,[n,r]=(0,l.useState)(new Set),[i,a]=(0,l.useState)([]),[o,d]=(0,l.useState)(void 0);return(0,s.jsx)(en.Provider,{value:{collapsedSpans:n,setCollapsedSpans:r,visibleSpans:i,setVisibleSpans:a,hoveredParent:o,setHoveredParent:d},children:t})}function er(){let e=(0,l.useContext)(en);if(void 0===e)throw Error("No GanttTableContext found. Did you forget a Provider?");return e}function ei(e){var t,n;let{options:i,span:a,viewport:l}=e,d=(0,G.A)(),u=(0,r.useChartsTheme)(),c=a.endTimeUnixMs-a.startTimeUnixMs,p=l.endTimeUnixMs-l.startTimeUnixMs,x=c/p,m=(a.startTimeUnixMs-l.startTimeUnixMs)/p;return(0,s.jsxs)(o.A,{sx:{position:"relative",height:"100%",flexGrow:1,overflow:"hidden"},children:[(0,s.jsx)(K,{}),(0,s.jsx)(o.A,{"data-testid":"span-duration-bar",sx:{position:"absolute",top:0,bottom:0,margin:"auto",minWidth:"2px",height:"8px",borderRadius:d.shape.borderRadius},style:{left:`${100*m}%`,width:`${100*x}%`,backgroundColor:U(d,u,null==(n=i.visual)||null==(t=n.palette)?void 0:t.mode,a)}}),(0,s.jsx)(o.A,{sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",padding:"0 8px",color:d.palette.grey[700],fontSize:".7rem"},style:m+x<.95?{left:`${(m+x)*100}%`}:{left:`${100*m}%`,transform:"translateY(-50%) translateX(-100%)"},children:C(c)})]})}var ea=n(94574),el=n(11061);function eo(e){let{span:t}=e,{collapsedSpans:n,setCollapsedSpans:r,visibleSpans:i,hoveredParent:a,setHoveredParent:o}=er(),d=(0,G.A)(),u=(0,l.useCallback)(e=>{e.stopPropagation(),r(e=>{let n=new Set(e);return n.has(t.spanId)?n.delete(t.spanId):n.add(t.spanId),n})},[t,r]),c=(0,l.useCallback)(()=>{o(t.spanId)},[t,o]),p=[t],x=t.parentSpan;for(;x;)p.unshift(x),x=x.parentSpan;return(0,s.jsx)(s.Fragment,{children:p.map((e,t)=>(0,s.jsx)(ed,{style:{width:t===p.length-1||0===i.length||i.includes(e.spanId)?24:8,borderLeft:`${a===(e.parentSpanId??"")?3:1}px solid ${d.palette.divider}`},onMouseEnter:()=>o(e.parentSpanId??""),onMouseLeave:()=>o(void 0),children:t===p.length-1&&e.childSpans.length>0&&(n.has(e.spanId)?(0,s.jsx)(el.default,{titleAccess:"expand",onClick:u,onMouseEnter:c}):(0,s.jsx)(P.default,{titleAccess:"collapse",onClick:u,onMouseEnter:c}))},e.spanId))})}let ed=(0,Z.A)("div")({display:"flex",height:"100%",alignItems:"center",justifyContent:"flex-end",flexShrink:0,transition:"width 1s"});var eu=n(58597),ec=n(97653),ep=n(65241);function ex(e){let{customLinks:t,span:n}=e,i=(0,k.useAllVariableValues)(),{RouterComponent:a}=(0,k.useRouterContext)(),[o,d]=(0,l.useState)(null),c=!!o;if(!a||!t.links.span)return null;if(1===n.links.length&&n.links[0]){let e=n.links[0];return(0,s.jsx)(r.InfoTooltip,{description:"open linked span",children:(0,s.jsx)(u.A,{size:"small",component:a,to:(0,k.replaceVariablesInString)(t.links.span,i,{...t.variables,traceId:e.traceId,spanId:e.spanId}),children:(0,s.jsx)(ep.default,{fontSize:"inherit"})})})}let p=e=>{e.stopPropagation(),d(null)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.InfoTooltip,{description:`${n.links.length} linked spans`,children:(0,s.jsx)(u.A,{"aria-label":"span links","aria-haspopup":"true","aria-expanded":c?"true":void 0,size:"small",onClick:e=>{e.stopPropagation(),d(e.currentTarget)},children:(0,s.jsx)(ep.default,{fontSize:"inherit"})})}),(0,s.jsx)(eu.A,{anchorEl:o,open:c,onClose:p,children:n.links.map(e=>(0,s.jsxs)(ec.A,{component:a,onClick:p,to:(0,k.replaceVariablesInString)(t.links.span,i,{...t.variables,traceId:e.traceId,spanId:e.spanId}),children:["Open linked span ",e.spanId]},e.spanId))})]})}function em(e){let{customLinks:t,span:n,nameColumnWidth:r}=e;return(0,s.jsxs)(d.A,{direction:"row",sx:{alignItems:"center"},style:{width:`${100*r}%`},children:[(0,s.jsx)(eo,{span:n}),S(n)&&(0,s.jsx)(ea.default,{titleAccess:"error",color:"error",sx:{marginRight:"5px"}}),(0,s.jsxs)(o.A,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:[(0,s.jsxs)("strong",{children:[n.resource.serviceName,":"]})," ",n.name]}),t&&t.links.span&&n.links.length>0&&(0,s.jsx)(o.A,{sx:{marginLeft:"auto",px:1},children:(0,s.jsx)(ex,{customLinks:t,span:n})})]})}let eh=(0,l.memo)(function(e){let t,{options:n,customLinks:r,span:i,viewport:a,selected:l,matched:o,focused:d,nameColumnWidth:u,divider:c,onClick:p}=e,x=(0,G.A)();return l?t=x.palette.action.focus:d?t=x.palette.action.selected:o&&(t=x.palette.action.hover),(0,s.jsxs)(ef,{sx:{backgroundColor:t,"&:hover":t?{backgroundColor:t}:void 0},direction:"row",onClick:()=>{var e;(null==(e=document.getSelection())?void 0:e.type)!=="Range"&&p(i)},children:[(0,s.jsx)(em,{customLinks:r,span:i,nameColumnWidth:u}),c,(0,s.jsx)(ei,{options:n,span:i,viewport:a})]})}),ef=(0,Z.A)(d.A)(e=>{let{theme:t}=e;return{height:A,"&:hover":{backgroundColor:t.palette.action.hover,borderTop:`1px solid ${t.palette.divider}`,borderBottom:`1px solid ${t.palette.divider}`}}});function ev(e){let{parentRef:t,spacing:n=0,onMove:r}=e,[i,a]=(0,l.useState)(!1),o=(0,k.useEvent)(e=>{if(!t.current)return;let s=t.current.getBoundingClientRect(),i=(e.clientX-s.left+n)/s.width;.05<=i&&i<=.95&&r(i)}),d=(0,k.useEvent)(()=>{a(!1)});return(0,l.useEffect)(()=>{function e(){window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",d),document.body.style.cursor="inherit"}return i?(window.addEventListener("mousemove",o),window.addEventListener("mouseup",d),document.body.style.cursor="col-resize"):e(),e},[i,o,d]),(0,s.jsx)(ej,{onMouseDown:e=>{e.preventDefault(),a(!0)},onClick:e=>e.stopPropagation()})}let ej=(0,Z.A)(o.A)(e=>{let{theme:t}=e;return{position:"relative",width:"1px",minWidth:"1px",height:"100%",backgroundColor:t.palette.divider,cursor:"col-resize","&:before":{position:"absolute",width:"7px",left:"-3px",top:0,bottom:0,content:'" "',zIndex:1}}});function eg(e){let{options:t,customLinks:n,trace:r,viewport:i,selectedSpan:a,onSpanClick:d,matchingSpanIds:u,focusedSpanId:c}=e,{collapsedSpans:p,setCollapsedSpans:x,setVisibleSpans:m}=er(),[h,f]=(0,l.useState)(.25),v=(0,l.useRef)(null),j=(0,l.useRef)(null),g=(0,G.A)(),b=(0,l.useMemo)(()=>{let e=[];return J(r.rootSpans,t=>{if(e.push(t),p.has(t.spanId))return!1}),e},[r.rootSpans,p]),k=(0,l.useMemo)(()=>new Set(u??[]),[u]);(0,l.useEffect)(()=>{if(!c)return;let e=r.spanById.get(c);if(!e)return;let t=new Set,n=e.parentSpan;for(;n;)t.add(n.spanId),n=n.parentSpan;t.size>0&&x(e=>{let n=new Set(e),s=!1;for(let e of t)n.delete(e)&&(s=!0);return s?n:e})},[c,r.spanById,x]),(0,l.useEffect)(()=>{if(!c||!j.current)return;let e=b.findIndex(e=>e.spanId===c);e>=0&&j.current.scrollToIndex({index:e,align:"center"})},[c,b]);let M=(0,l.useMemo)(()=>{if(!a)return 0;let e=b.findIndex(e=>e.spanId===a.spanId);return e>=0?e:0},[b,a]),T=(0,s.jsx)(ev,{parentRef:v,onMove:f});return(0,s.jsxs)(o.A,{ref:v,sx:{display:"flex",flexDirection:"column",flexGrow:1,border:`1px solid ${g.palette.divider}`,borderRadius:`${g.shape.borderRadius}px`},children:[(0,s.jsx)(et,{trace:r,viewport:i,nameColumnWidth:h,divider:T}),(0,s.jsx)(H.aY,{ref:j,data:b,initialTopMostItemIndex:M,itemContent:(e,r)=>(0,s.jsx)(eh,{options:t,customLinks:n,span:r,viewport:i,selected:r===a,matched:k.has(r.spanId),focused:r.spanId===c,nameColumnWidth:h,divider:T,onClick:d}),rangeChanged:function(e){let{startIndex:t,endIndex:n}=e,s=[];for(let e=t;e<=n;e++)s.push(b[e].spanId);m(s)}})]})}var eb=n(85180);function ek(e){var t,n;let{options:i,trace:a,viewport:d,setViewport:u}=e,c=(0,G.A)(),p=(0,r.useChartsTheme)(),{width:x,ref:m}=(0,eb.A)(),h=(0,l.useRef)(null),[f,v]=(0,l.useState)({type:"none"}),j=a.endTimeUnixMs-a.startTimeUnixMs,g=(d.startTimeUnixMs-a.startTimeUnixMs)/j,b=(a.endTimeUnixMs-d.endTimeUnixMs)/j,M=(0,l.useCallback)(e=>{var t,n;return U(c,p,null==(n=i.visual)||null==(t=n.palette)?void 0:t.mode,e)},[c,p,null==(n=i.visual)||null==(t=n.palette)?void 0:t.mode]);(0,l.useEffect)(()=>{if(!h.current||!x)return;let e=h.current.getContext("2d");if(e){let t,n,s,r,i;n=Math.round(Math.min(Math.max(60/(t=a.spanById.size),1),7)),s=a.endTimeUnixMs-a.startTimeUnixMs,r=60/t,i=0,J(a.rootSpans,t=>{let l=t.endTimeUnixMs-t.startTimeUnixMs,o=(t.startTimeUnixMs-a.startTimeUnixMs)/s;e.fillStyle=M(t),e.beginPath(),e.rect(Math.round(o*x),Math.round(i),Math.max(2,Math.round(l/s*x)),n),e.fill(),i+=r})}},[x,60,a,M]);let T=e=>{if(!h.current||!x)return 0;let t=e.clientX-h.current.getBoundingClientRect().left;return a.startTimeUnixMs+t/x*j},w=(0,k.useEvent)(e=>{switch(e.preventDefault(),f.type){case"none":return;case"resize":{let t,n,s=f.fixedPoint,r=T(e);s<r?(t=s,n=r):(t=r,n=s),u({startTimeUnixMs:Math.max(t,a.startTimeUnixMs),endTimeUnixMs:Math.min(n,a.endTimeUnixMs)});return}case"drag":{let{start:t,end:n}=f,s=T(e);s-t<a.startTimeUnixMs&&(s=a.startTimeUnixMs+t),s+n>a.endTimeUnixMs&&(s=a.endTimeUnixMs-n),u({startTimeUnixMs:s-t,endTimeUnixMs:s+n});return}}}),y=(0,k.useEvent)(e=>{e.preventDefault(),v({type:"none"}),d.startTimeUnixMs===d.endTimeUnixMs&&u({startTimeUnixMs:a.startTimeUnixMs,endTimeUnixMs:a.endTimeUnixMs})});return(0,l.useEffect)(()=>{function e(){window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",y),document.body.style.cursor="inherit"}return"none"===f.type?e():(window.addEventListener("mousemove",w),window.addEventListener("mouseup",y),document.body.style.cursor="resize"===f.type?"col-resize":"move"),e},[f,w,y]),(0,s.jsxs)(o.A,{ref:m,sx:{position:"relative",height:60},onMouseDown:e=>{if(e.preventDefault(),!(e.target instanceof HTMLElement))return;let t=d.startTimeUnixMs===a.startTimeUnixMs&&d.endTimeUnixMs===a.endTimeUnixMs,n=e.target.dataset.elem,s=T(e);"resizerLeft"===n?v({type:"resize",fixedPoint:d.endTimeUnixMs}):"resizerRight"===n?v({type:"resize",fixedPoint:d.startTimeUnixMs}):"cutoffBox"===n||t?(v({type:"resize",fixedPoint:s}),u({startTimeUnixMs:s,endTimeUnixMs:s})):v({type:"drag",start:s-d.startTimeUnixMs,end:d.endTimeUnixMs-s})},children:[(0,s.jsx)("canvas",{ref:h,width:x,height:60,style:{position:"absolute"}}),(0,s.jsx)(K,{}),(0,s.jsx)(eM,{"data-elem":"cutoffBox",style:{left:0,width:`${100*g}%`}}),(0,s.jsx)(eT,{"data-elem":"resizerLeft",style:{left:`${100*g}%`}}),(0,s.jsx)(eT,{"data-elem":"resizerRight",style:{right:`${100*b}%`}}),(0,s.jsx)(eM,{"data-elem":"cutoffBox",style:{right:0,width:`${100*b}%`}})]})}let eM=(0,Z.A)(o.A)({position:"absolute",height:"100%",backgroundColor:"rgba(225, 225, 225, .5)"}),eT=(0,Z.A)(o.A)(e=>{let{theme:t}=e;return{position:"absolute",height:"100%",backgroundColor:t.palette.divider,width:"2px",cursor:"col-resize","&:before":{position:"absolute",width:"8px",left:"-3px",top:0,bottom:0,content:'" "',zIndex:1}}});function ew(e){let{options:t,trace:n,viewport:r,setViewport:i}=e,a=(0,G.A)();return(0,s.jsxs)(o.A,{sx:{border:`1px solid ${a.palette.divider}`,borderRadius:`${a.shape.borderRadius}px`},children:[(0,s.jsx)(o.A,{sx:{position:"relative",height:A,borderBottom:`1px solid ${a.palette.divider}`},children:(0,s.jsx)(q,{trace:n,viewport:{startTimeUnixMs:n.startTimeUnixMs,endTimeUnixMs:n.endTimeUnixMs}})}),(0,s.jsx)(ek,{options:t,trace:n,viewport:r,setViewport:i})]})}var ey=n(93648),eI=n(2582);function eA(e){let{search:t}=e,{searchQuery:n,setSearchQuery:r,matchingSpanIds:i,focusedMatchIndex:a,setFocusedMatchIndex:l}=t,o=n.length>0,c=i.length,p=c>0;function x(){p&&l((a-1+c)%c)}function m(){p&&l((a+1)%c)}return(0,s.jsxs)(d.A,{direction:"row",sx:{alignItems:"center",gap:.5,minWidth:300},children:[(0,s.jsx)(ey.A,{size:"small",placeholder:"Search spans...",value:n,onChange:e=>r(e.target.value),onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.shiftKey?x():m())},slotProps:{input:{endAdornment:(0,s.jsx)(eI.A,{position:"end",sx:{visibility:o?"visible":"hidden",whiteSpace:"nowrap"},children:p?`${a+1}/${c}`:"0/0"})}},sx:{minWidth:200}}),(0,s.jsx)(u.A,{size:"small",disabled:!p,"aria-label":"Previous match",onClick:x,children:(0,s.jsx)(B.default,{})}),(0,s.jsx)(u.A,{size:"small",disabled:!p,"aria-label":"Next match",onClick:m,children:(0,s.jsx)(P.default,{})}),(0,s.jsx)(u.A,{size:"small",disabled:!o,"aria-label":"Clear search",onClick:()=>r(""),children:(0,s.jsx)(h.default,{})})]})}var eS=n(65211),eU=n(98599);let eC={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3},eL=new Intl.DateTimeFormat(void 0,{...eC,timeZone:"UTC",timeZoneName:"short"}).format;function e$(e){let{trace:t,search:n}=e,{dateFormatOptionsWithUserTimeZone:i}=(0,r.useTimeZone)(),a=(0,l.useMemo)(()=>{let e=i(eC);return new Intl.DateTimeFormat(void 0,e).format},[i]),[o,p]=(0,l.useState)(!1),x=t.rootSpans[0];return x?(0,s.jsxs)(d.A,{direction:"column",sx:{gap:1},children:[(0,s.jsxs)(d.A,{direction:"row",sx:{gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[(0,s.jsxs)(d.A,{direction:"row",sx:{gap:1,alignItems:"center"},children:[(0,s.jsxs)(c.A,{variant:"h3",children:[x.resource.serviceName,": ",x.name," (",C(t.endTimeUnixMs-t.startTimeUnixMs),")"]}),(0,s.jsx)(u.A,{size:"small",onClick:()=>p(e=>!e),"aria-label":"Toggle search",children:(0,s.jsx)(eU.default,{fontSize:"small"})})]}),(0,s.jsxs)(d.A,{direction:"row",sx:{rowGap:1,columnGap:2,alignItems:"center",flexWrap:"wrap"},children:[(0,s.jsxs)(c.A,{variant:"h4",sx:{fontWeight:"normal"},children:[(0,s.jsx)("strong",{children:"Start:"})," ",(0,s.jsx)(eS.A,{title:eL(t.startTimeUnixMs),placement:"top",arrow:!0,children:(0,s.jsx)(c.A,{component:"span",children:a(t.startTimeUnixMs)})})]}),(0,s.jsxs)(c.A,{variant:"h4",sx:{fontWeight:"normal"},children:[(0,s.jsx)("strong",{children:"Trace ID:"})," ",x.traceId]})]})]}),o&&(0,s.jsx)(eA,{search:n})]}):(0,s.jsx)(c.A,{children:"Trace contains no spans."})}function ez(e){let{options:t,customLinks:n,trace:r}=e,i=(0,l.useMemo)(()=>{try{return function(e){let t=new Map,n=[],s=0,r=0;for(let n of e.resourceSpans){let e=function(e){let t="unknown";for(let n of(null==e?void 0:e.attributes)??[])if("service.name"===n.key&&"stringValue"in n.value){t=n.value.stringValue;break}return{serviceName:t,attributes:(null==e?void 0:e.attributes)??[]}}(n.resource);for(let a of n.scopeSpans){let n=a.scope??{};for(let l of a.spans){var i;let a={resource:e,scope:n,childSpans:[],...{traceId:(i=l).traceId,spanId:i.spanId,parentSpanId:i.parentSpanId,name:i.name,kind:i.kind,startTimeUnixMs:1e-6*parseInt(i.startTimeUnixNano),endTimeUnixMs:1e-6*parseInt(i.endTimeUnixNano),attributes:i.attributes??[],events:(i.events??[]).map(Q),links:(i.links??[]).map(X),status:i.status??{}}};t.set(l.spanId,a),(0===s||a.startTimeUnixMs<s)&&(s=a.startTimeUnixMs),(0===r||a.endTimeUnixMs>r)&&(r=a.endTimeUnixMs)}}}for(let[,e]of t){if(!e.parentSpanId){n.push(e);continue}let s=t.get(e.parentSpanId);if(!s){console.trace(`span ${e.spanId} has parent ${e.parentSpanId} which has not been received yet`),n.push(e);continue}e.parentSpan=s;let r=(0,Y.sortedIndexBy)(s.childSpans,e,e=>e.startTimeUnixMs);s.childSpans.splice(r,0,e)}return{trace:e,rootSpans:n,spanById:t,startTimeUnixMs:s,endTimeUnixMs:r}}(r)}catch(e){throw Error(`Error: unable to parse trace: ${e}`,{cause:e})}},[r]),[a,u]=(0,l.useState)({startTimeUnixMs:i.startTimeUnixMs,endTimeUnixMs:i.endTimeUnixMs}),[c,p]=(0,l.useState)(()=>t.selectedSpanId?i.spanById.get(t.selectedSpanId):void 0),x=function(e){let[t,n]=(0,l.useState)(""),[s,r]=(0,l.useState)(0),i=(0,l.useMemo)(()=>{if(0===t.length)return[];let n=t.toLowerCase(),s=[];return J(e.rootSpans,e=>{var t;let r;r=e=>e.key.toLowerCase().includes(n)||R(e.value).toLowerCase().includes(n),((null==(t=e.resource.serviceName)?void 0:t.toLowerCase().includes(n))||e.name.toLowerCase().includes(n)||e.spanId.toLowerCase().includes(n)||e.attributes.some(r)||e.resource.attributes.some(r))&&s.push(e.spanId)}),s},[t,e.rootSpans]);return{searchQuery:t,setSearchQuery:(0,l.useCallback)(e=>{n(e),r(0)},[]),matchingSpanIds:i,focusedMatchIndex:s,setFocusedMatchIndex:r}}(i),m=(0,l.useRef)(null),[h,f]=(0,l.useState)(.82),v=m.current&&parseFloat(getComputedStyle(m.current).columnGap)||0;return(0,s.jsxs)(d.A,{ref:m,direction:"row",sx:{height:"100%",minHeight:"240px",gap:2},children:[(0,s.jsxs)(d.A,{sx:{flexGrow:1,gap:2},children:[(0,s.jsx)(e$,{trace:i,search:x}),(0,s.jsx)(ew,{options:t,trace:i,viewport:a,setViewport:u}),(0,s.jsx)(es,{children:(0,s.jsx)(eg,{options:t,customLinks:n,trace:i,viewport:a,selectedSpan:c,onSpanClick:p,matchingSpanIds:x.matchingSpanIds,focusedSpanId:x.matchingSpanIds[x.focusedMatchIndex]})})]}),c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ev,{parentRef:m,spacing:v,onMove:f}),(0,s.jsx)(o.A,{style:{width:`${(1-h)*100}%`,minWidth:`${(1-h)*100}%`},sx:{overflow:"auto"},children:(0,s.jsx)(W,{customLinks:n,trace:i,span:c,onCloseBtnClick:()=>p(void 0)})})]})]})}let eE={PanelComponent:function(e){var t,n,i,a;let{spec:l,queryResults:d}=e,u=(0,r.useChartsTheme)().container.padding.default;if(d.length>1)return(0,s.jsx)(r.TextOverlay,{message:"This panel does not support more than one query."});if(null==(t=d[0])?void 0:t.data.searchResult)return(0,s.jsx)(r.TextOverlay,{message:"This panel does not support displaying trace search results. Please enter a trace id in the query field instead."});let c=null==(n=d[0])?void 0:n.data.trace;if(!c)return(0,s.jsx)(r.NoDataOverlay,{resource:"trace"});let p=null==(i=d[0])?void 0:i.definition.spec.plugin.spec,x=null==p||null==(a=p.datasource)?void 0:a.name,m=l.links?{variables:{datasourceName:x??""},links:l.links}:void 0;return(0,s.jsx)(o.A,{sx:{height:"100%",padding:`${u}px`},children:(0,s.jsx)(ez,{options:l,customLinks:m,trace:c})})},supportedQueryTypes:["TraceQuery"],createInitialOptions:function(){return{}},actions:[{component:function(e){var t,n;let{queryResults:o}=e,d=null==(n=o[0])||null==(t=n.data)?void 0:t.trace,u=(0,l.useCallback)(()=>{var e,t,n;let s,r;if(!d)return;let i=JSON.stringify(d,null,2);e=function(e){for(let t of e.resourceSpans)for(let e of t.scopeSpans)for(let t of e.spans)return`${t.traceId}.json`;return"trace.json"}(d),t="application/json",n=i,s=URL.createObjectURL(new Blob([n],{type:t})),(r=document.createElement("a")).download=e,r.href=s,r.click(),URL.revokeObjectURL(s)},[d]);return d?(0,s.jsx)(r.InfoTooltip,{description:"download OTLP/JSON trace",children:(0,s.jsx)(i.v,{"aria-label":"download OTLP/JSON trace",size:"small",onClick:u,children:(0,s.jsx)(a.default,{fontSize:"inherit"})})}):null}}]}}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/__mf/js/async/{lib-router.b71f208a.js.LICENSE.txt → lib-router.a8607481.js.LICENSE.txt}
RENAMED
|
File without changes
|