@odigos/ui-kit 0.0.244 → 0.0.246
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/CHANGELOG.md +27 -0
- package/lib/chunks/helpers-BFZzc68M.js +19 -0
- package/lib/chunks/index-BrSebk-Z.js +155 -0
- package/lib/chunks/source-instrument-form-context-n8N3zC_-.js +1 -0
- package/lib/chunks/ui-components-DNrEjxrR.js +1635 -0
- package/lib/components/_v2/cards/section-card/index.d.ts +3 -1
- package/lib/components/_v2/input-table/dynamic-field/index.d.ts +1 -0
- package/lib/components/_v2/input-table/types.d.ts +2 -1
- package/lib/components/_v2/table/styled.d.ts +7 -1
- package/lib/components/_v2/table/table-columns/index.d.ts +2 -0
- package/lib/components/_v2/table/table-rows/index.d.ts +2 -0
- package/lib/components/_v2/typography/index.d.ts +8 -4
- package/lib/components/_v2/typography-truncatable/index.d.ts +18 -10
- package/lib/components/styled.d.ts +4 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/regex.d.ts +40 -0
- package/lib/constants/sampling/index.d.ts +5 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/{yaml-files → debug}/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/index.d.ts +1 -0
- package/lib/containers/_v2/_drawers/regex-tester-drawer/highlighter.d.ts +20 -0
- package/lib/containers/_v2/_drawers/regex-tester-drawer/index.d.ts +13 -0
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/extract-attribute/index.d.ts +5 -0
- package/lib/containers/_v2/central-connections/index.d.ts +1 -2
- package/lib/containers/_v2/overview/columns/index.d.ts +1 -2
- package/lib/containers/_v2/overview/drawers/index.d.ts +4 -1
- package/lib/containers/_v2/overview/index.d.ts +0 -2
- package/lib/containers/_v2/pipeline-collectors/index.d.ts +3 -3
- package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +2 -2
- package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -1
- package/lib/containers/_v2/sampling-rules/rules-table/index.d.ts +1 -2
- package/lib/containers/_v2/sampling-rules/types.d.ts +0 -2
- package/lib/containers/_v2/settings/index.d.ts +0 -1
- package/lib/containers/service-map/index.d.ts +0 -1
- package/lib/containers/v2.js +255 -126
- package/lib/containers.js +7 -4
- package/lib/contexts/rule-form-context.d.ts +13 -4
- package/lib/contexts.js +1 -1
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/instrumentation-rule-source-scopes/index.d.ts +76 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useInstrumentationRuleFormData.d.ts +2 -2
- package/lib/hooks/useOverflow.d.ts +26 -0
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/index.d.ts +1 -0
- package/lib/snippets/_v2/instrumentation-rule-form-sections/index.d.ts +1 -0
- package/lib/snippets/_v2/instrumentation-rule-form-sections/instrumentation-preview.d.ts +10 -0
- package/lib/snippets/_v2/rich-title/index.d.ts +5 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/source-scope.d.ts +18 -8
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +2 -2
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +19 -2
- package/lib/types/instrumentation-rules/index.d.ts +14 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/helpers-aJJ1GhqS.js +0 -19
- package/lib/chunks/index-BnOPIhIp.js +0 -149
- package/lib/chunks/source-instrument-form-context-5GXsAhJd.js +0 -1
- package/lib/chunks/ui-components-Dnqp-MQm.js +0 -1592
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,120 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as T,S as k,f as I,e as $,a as E,r as N,h as O,i as A,j as D,k as R,l as P,m as F,o as L,p as _,q as B,s as z,t as M}from"../chunks/helpers-aJJ1GhqS.js";import{q as X,R as V,U,V as H,W as j,X as W,Y as G,Z as K,_ as Y,$ as J,i as q,F as Z,a0 as Q,a1 as ee,a2 as te,a3 as oe,r as ne,a4 as ae,b as ie,c as le,a5 as se,a6 as re,a7 as ce,a8 as de,n as ue,S as pe,B as he,G as ge,z as me,a9 as fe,aa as be,ab as ve,ac as ye,J as Ce,ad as Se,L as we,M as xe,K as Te,O as ke,ae as Ie,af as $e,ag as Ee,ah as Ne,D as Oe,w as Ae,ai as De,aj as Re,ak as Pe,al as Fe,am as Le,an as _e,ao as Be,ap as ze,aq as Me,ar as Xe,as as Ve,A as Ue,at as He,y as je,au as We,av as Ge,aw as Ke,ax as Ye,ay as Je,az as qe,p as Ze,C as Qe,j as et,I as tt,E as ot,aA as nt,T as at,aB as it,aC as lt,aD as st,aE as rt,aF as ct,aG as dt,aH as ut,f as pt,aI as ht,aJ as gt,aK as mt,aL as ft,aM as bt,o as vt,aN as yt,H as Ct,aO as St,aP as wt,aQ as xt,l as Tt,v as kt,aR as It,aS as $t,aT as Et,aU as Nt,aV as Ot,aW as At,aX as Dt,aY as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as Bt,b2 as zt,b3 as Mt,b4 as Xt,b5 as Vt,b6 as Ut,g as Ht,d as jt,b7 as Wt,b8 as Gt,b9 as Kt,ba as Yt,bb as Jt,bc as qt,bd as Zt,be as Qt,bf as eo,bg as to,Q as oo,bh as no,bi as ao,bj as io,bk as lo,bl as so,bm as ro,bn as co,bo as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as To,bC as ko,bD as Io,bE as $o,bF as Eo,bG as No,bH as Oo,bI as Ao,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as Bo,bQ as zo,bR as Mo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as jo,bX as Wo,bY as Go,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as sn,ca as rn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as Tn,cr as kn,cs as In,ct as $n,cu as En,cv as Nn,cw as On,cx as An,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as Bn,cF as zn,cG as Mn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as jn,cM as Wn,cN as Gn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as sa,d0 as ra,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,e as Sa,dd as wa,de as xa,df as Ta,dg as ka,dh as Ia,di as $a,dj as Ea,dk as Na,dl as Oa,dm as Aa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as Ba,dv as za,dw as Ma,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as ja,dC as Wa,dD as Ga,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei}from"../chunks/ui-components-Dnqp-MQm.js";import{TrashIcon as ti,PlusIcon as oi,BookIcon as ni,VSquareIcon as ai,XSquareIcon as ii,DeleteIcon as li,EditIcon as si,GoLogo as ri,JavaLogo as ci,ChevronRightIcon as di,ActionIcon as ui,DestinationIcon as pi,ChevronUpIcon as hi,ChevronDownIcon as gi,VIcon as mi,XIcon as fi,InstrumentationRuleIcon as bi,SourceIcon as vi,NamespacesIcon as yi,SettingsIcon as Ci,PodIcon as Si,OdigosLogo as wi,K8sLogo as xi,RefreshIcon as Ti,ExclamationCircleIcon as ki,QuestionCircleIcon as Ii,InboundIcon as $i,OutboundIcon as Ei,UserIcon as Ni,ExpandIcon as Oi,SearchIcon as Ai,MinusIcon as Di,CopyIcon as Ri,DotIcon as Pi,DownloadIcon as Fi,RefreshLeftArrowIcon as Li,SamplingIcon as _i,ExclamationTriangleIcon as Bi,KeyIcon as zi,DiagnoseIcon as Mi,TerminalIcon as Xi,ArrowRightIcon as Vi,StarIcon as Ui,ArrowIcon as Hi,ConnectionsIcon as ji,FilterIcon as Wi,DataStreamIcon as Gi,PipelineCollectorIcon as Ki,ArrowDownSquareIcon as Yi,ArrowUpSquareIcon as Ji,GatewayIcon as qi,YamlIcon as Zi}from"../icons.js";import{S as Qi,D as el,A as tl,P as ol,a as nl,b as al,R as il,c as ll,O as sl,d as rl,e as cl,f as dl,W as ul,g as pl,C as hl,Y as gl,h as ml,i as fl,U as bl}from"../chunks/index-BnOPIhIp.js";import{u as vl,f as yl,g as Cl,e as Sl,i as wl,h as xl,S as Tl,k as kl,E as Il,l as $l,m as El,j as Nl,b as Ol,d as Al,a as Dl,A as Rl,R as Pl,c as Fl,D as Ll}from"../chunks/source-instrument-form-context-5GXsAhJd.js";import{createPortal as _l}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Bl=[{id:"CREDIT_CARD",label:"Credit card"}],zl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Ml=[{id:G.Pod,label:G.Pod},{id:G.Namespace,label:G.Namespace},{id:G.Node,label:G.Node}],Xl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ml}],Vl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ml}],Ul=X.UrlTemplatizationRulesGroups,Hl=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],jl={[ne.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:zl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(W,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Xl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(W,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Vl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ne.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(W,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ne.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ne.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(W,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[ne.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Bl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Bl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[ne.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Ul]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ul,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(q,{}),e(V,{$gap:12,children:[e(Z,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(Q,{leftIcon:()=>t(ti,{fill:s.v2.colors.red[500]}),variant:te.Secondary,size:ee.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(oe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(W,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Hl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Ul]})]},`url-templatization-group-${n}`)),t(Q,{variant:te.Secondary,label:"Add rule group",leftIcon:oi,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(q,{})]})}},Wl=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=jl[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Gl=()=>{const o=f(),{selectedOption:n,genericForm:a}=vl();if(!a||!n)return t(ae,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[t(ie,{size:le.XXS,children:n.docsDescription}),t(Q,{label:"Docs",leftIcon:ni,variant:te.Text,size:ee.S,onClick:()=>window.open(`${se}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(re,{options:[{icon:ai,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ii,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(Qi,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(oe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Wl,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(ce,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Kl=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||de(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(el,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Yl=m(Z)`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as E,a as I,r as N,h as A,j as O,k as D,l as R,o as P,p as F,q as L,s as _,t as z,w as B,x as M}from"../chunks/helpers-BFZzc68M.js";import{q as X,R as V,U,V as H,W as G,X as j,Y as W,Z as K,_ as Y,$ as J,f as q,a0 as Z,b as Q,a1 as ee,c as te,F as oe,a2 as ne,a3 as ae,a4 as ie,a5 as le,a6 as re,a7 as se,a8 as ce,a9 as de,aa as ue,ab as pe,i as he,r as ge,ac as me,ad as fe,ae as be,af as ve,ag as ye,ah as Ce,n as Se,S as we,B as xe,G as ke,z as Te,ai as $e,aj as Ee,ak as Ie,J as Ne,al as Ae,L as Oe,M as De,K as Re,O as Pe,am as Fe,an as Le,ao as _e,ap as ze,D as Be,w as Me,aq as Xe,ar as Ve,as as Ue,at as He,au as Ge,av as je,aw as We,ax as Ke,ay as Ye,az as Je,aA as qe,A as Ze,aB as Qe,y as et,aC as tt,aD as ot,aE as nt,aF as at,aG as it,aH as lt,p as rt,C as st,j as ct,I as dt,E as ut,aI as pt,T as ht,aJ as gt,aK as mt,aL as ft,aM as bt,aN as vt,aO as yt,aP as Ct,aQ as St,aR as wt,aS as xt,aT as kt,aU as Tt,o as $t,aV as Et,H as It,aW as Nt,aX as At,aY as Ot,l as Dt,v as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as zt,b2 as Bt,b3 as Mt,b4 as Xt,b5 as Vt,b6 as Ut,b7 as Ht,b8 as Gt,b9 as jt,ba as Wt,bb as Kt,bc as Yt,bd as Jt,be as qt,g as Zt,d as Qt,bf as eo,Q as to,bg as oo,bh as no,bi as ao,bj as io,bk as lo,bl as ro,bm as so,bn as co,bo as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as ko,bC as To,bD as $o,bE as Eo,bF as Io,bG as No,bH as Ao,bI as Oo,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as zo,bQ as Bo,bR as Mo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as Go,bX as jo,bY as Wo,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as rn,ca as sn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as kn,cr as Tn,cs as $n,ct as En,cu as In,cv as Nn,cw as An,cx as On,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as zn,cF as Bn,cG as Mn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as Gn,cM as jn,cN as Wn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as ra,d0 as sa,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,dd as Sa,de as wa,df as xa,dg as ka,dh as Ta,e as $a,di as Ea,dj as Ia,dk as Na,dl as Aa,dm as Oa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as za,dv as Ba,dw as Ma,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as Ga,dC as ja,dD as Wa,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei,dL as ti,dM as oi,dN as ni,dO as ai}from"../chunks/ui-components-DNrEjxrR.js";import{TrashIcon as ii,PlusIcon as li,ArrowRightIcon as ri,VSquareIcon as si,XSquareIcon as ci,BookIcon as di,DeleteIcon as ui,EditIcon as pi,GoLogo as hi,JavaLogo as gi,ChevronRightIcon as mi,ActionIcon as fi,DestinationIcon as bi,ChevronUpIcon as vi,ChevronDownIcon as yi,VIcon as Ci,XIcon as Si,InstrumentationRuleIcon as wi,SourceIcon as xi,NamespacesIcon as ki,SettingsIcon as Ti,PodIcon as $i,OdigosLogo as Ei,K8sLogo as Ii,RefreshIcon as Ni,ExclamationCircleIcon as Ai,QuestionCircleIcon as Oi,InboundIcon as Di,OutboundIcon as Ri,UserIcon as Pi,TerminalIcon as Fi,ExpandIcon as Li,SearchIcon as _i,MinusIcon as zi,CopyIcon as Bi,DotIcon as Mi,DownloadIcon as Xi,RefreshLeftArrowIcon as Vi,VmLogo as Ui,SamplingIcon as Hi,ExclamationTriangleIcon as Gi,KeyIcon as ji,DiagnoseIcon as Wi,StarIcon as Ki,ArrowIcon as Yi,ConnectionsIcon as Ji,FilterIcon as qi,DataStreamIcon as Zi,PipelineCollectorIcon as Qi,ArrowDownSquareIcon as el,ArrowUpSquareIcon as tl,GatewayIcon as ol,YamlIcon as nl}from"../icons.js";import{S as al,D as il,I as ll,a as rl,A as sl,P as cl,b as dl,c as ul,R as pl,O as hl,d as gl,e as ml,f as fl,W as bl,g as vl,C as yl,Y as Cl,h as Sl,i as wl,U as xl}from"../chunks/index-BrSebk-Z.js";import{u as kl,f as Tl,g as $l,e as El,i as Il,h as Nl,S as Al,k as Ol,E as Dl,l as Rl,m as Pl,j as Fl,b as Ll,d as _l,a as zl,A as Bl,R as Ml,c as Xl,D as Vl}from"../chunks/source-instrument-form-context-n8N3zC_-.js";import{createPortal as Ul}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Hl=[{id:"CREDIT_CARD",label:"Credit card"}],Gl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],jl=[{id:W.Pod,label:W.Pod},{id:W.Namespace,label:W.Namespace},{id:W.Node,label:W.Node}],Wl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:jl}],Kl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:jl}],Yl=/^[a-zA-Z]$/,Jl=new Set(["*","+","?"]),ql=new Set(["^","$"]),Zl={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},Ql=m.div`
|
|
2
|
+
padding: 8px 16px;
|
|
3
|
+
border-radius: 6px;
|
|
4
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
5
|
+
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
6
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
line-height: 20px;
|
|
9
|
+
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
10
|
+
word-break: break-all;
|
|
11
|
+
white-space: pre-wrap;
|
|
12
|
+
user-select: text;
|
|
13
|
+
|
|
14
|
+
/* Wraps the background tightly to each visual fragment when a colored
|
|
15
|
+
token gets split across two visual lines. Without this the highlight
|
|
16
|
+
stretches all the way to the right edge of the container. */
|
|
17
|
+
& > span {
|
|
18
|
+
box-decoration-break: clone;
|
|
19
|
+
-webkit-box-decoration-break: clone;
|
|
20
|
+
}
|
|
21
|
+
`,er=m.span`
|
|
22
|
+
background: ${({$kind:e})=>Zl[e]};
|
|
23
|
+
`,tr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Jl.has(t)||ql.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Yl.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(Ql,e?{"data-id":o,children:n.map((e,o)=>t(er,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},or="rgba(102, 191, 255, 0.5)",nr=b`
|
|
24
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 20px;
|
|
27
|
+
letter-spacing: 0;
|
|
28
|
+
white-space: pre-wrap;
|
|
29
|
+
word-wrap: break-word;
|
|
30
|
+
overflow-wrap: break-word;
|
|
31
|
+
/* tab-size keeps tabs visually consistent across the two layers — some
|
|
32
|
+
browsers default to 8 on a textarea but 4 on a div. */
|
|
33
|
+
-moz-tab-size: 4;
|
|
34
|
+
tab-size: 4;
|
|
35
|
+
margin: 0;
|
|
36
|
+
`,ar=m.div`
|
|
37
|
+
position: relative;
|
|
38
|
+
width: 100%;
|
|
39
|
+
min-height: ${({$minHeight:e})=>e}px;
|
|
40
|
+
border-radius: 6px;
|
|
41
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
42
|
+
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
43
|
+
|
|
44
|
+
&:hover,
|
|
45
|
+
&:focus-within {
|
|
46
|
+
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
|
+
}
|
|
48
|
+
`,ir=m.div`
|
|
49
|
+
${nr}
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset: 0;
|
|
52
|
+
padding: 12px;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
color: transparent;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
|
|
57
|
+
/* Mandatory for backgrounds that wrap across visual lines. */
|
|
58
|
+
& > span {
|
|
59
|
+
box-decoration-break: clone;
|
|
60
|
+
-webkit-box-decoration-break: clone;
|
|
61
|
+
}
|
|
62
|
+
`,lr=m.textarea`
|
|
63
|
+
${nr}
|
|
64
|
+
position: relative;
|
|
65
|
+
z-index: 1;
|
|
66
|
+
display: block;
|
|
67
|
+
width: 100%;
|
|
68
|
+
min-height: ${({$minHeight:e})=>e}px;
|
|
69
|
+
padding: 12px;
|
|
70
|
+
border: 0;
|
|
71
|
+
background: transparent;
|
|
72
|
+
outline: none;
|
|
73
|
+
resize: vertical;
|
|
74
|
+
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
75
|
+
caret-color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
|
|
78
|
+
&::placeholder {
|
|
79
|
+
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
|
+
}
|
|
81
|
+
`,rr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),sr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return rr(t);let o;try{o=new RegExp(e)}catch{return rr(t)}const n=o.exec(t);if(!n)return rr(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),r=l>=0?a+l:a,s=r+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(ar,{$minHeight:s,children:[e(ir,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:or},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:or},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(lr,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},cr=m.div`
|
|
82
|
+
flex: 1;
|
|
83
|
+
min-height: 0;
|
|
84
|
+
overflow-y: auto;
|
|
85
|
+
`,dr=m.div`
|
|
86
|
+
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
padding: 8px;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: 12px;
|
|
92
|
+
`,ur=m.div`
|
|
93
|
+
padding: 8px 16px;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
96
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
line-height: 20px;
|
|
99
|
+
color: ${({theme:e,$tone:t})=>"error"===t?e.v2.colors.red[500]:"match"===t?e.v2.colors.white[500]:e.v2.colors.silver[200]};
|
|
100
|
+
word-break: break-all;
|
|
101
|
+
white-space: pre-wrap;
|
|
102
|
+
user-select: text;
|
|
103
|
+
`,pr=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:Z.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:Z.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(q,{isOpen:o,header:{title:Z.TITLE,onClose:()=>{c(""),i()}},children:t(cr,{children:e(dr,{children:[e(V,{$gap:6,children:[t(U,{label:Z.REGEX_LABEL}),t(tr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.REGEX_EMPTY_HINT})]}),e(V,{$gap:6,children:[e(oe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:Z.TEST_STRING_LABEL}),t(ne,{"data-id":"regex-tester-unescape",label:Z.UNESCAPE_LABEL,tooltip:Z.UNESCAPE_TOOLTIP,variant:ie.Secondary,size:ae.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(sr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:Z.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(G,{helpMessage:Z.TEST_STRING_HELP})]}),e(V,{$gap:8,children:[t(U,{label:Z.RESULT_LABEL}),t(ur,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.RESULT_CAPTURE_HINT})]})]})})});var p},hr=X.ExtractAttribute;var gr;!function(e){e.Preset="preset",e.Regex="regex"}(gr||(gr={}));const mr=[se.JSON,se.SQL,se.ResourcePath],fr=(e=se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),br=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,vr=m.div`
|
|
104
|
+
width: calc(100% - 16px);
|
|
105
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
106
|
+
border-radius: 8px;
|
|
107
|
+
padding: 8px;
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 8px;
|
|
111
|
+
`,yr=m.div`
|
|
112
|
+
flex: 1;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
`,Cr=m.div`
|
|
115
|
+
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
|
+
padding-top: 24px;
|
|
117
|
+
`,Sr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),wr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},xr=X.UrlTemplatizationRulesGroups,kr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Tr={[ge.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Gl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(G,{errorMessage:l[o]})]},o))}),t(j,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Wl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(j,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Kl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ge.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(j,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ge.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ge.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[X.Renames],[l,s]=r(()=>Sr(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(wr(l),i||{})||s(Sr(i))},[i]),t(j,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(X.Renames,wr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Hl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Hl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(G,{errorMessage:i[X.PiiCategories]})]})),[ge.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[xr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(xr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(he,{}),e(V,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(ne,{leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(pe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(j,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:kr,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(G,{errorMessage:i[xr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:li,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[hr],c=o[hr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(br)?gr.Regex:gr.Preset)(c)),[p,h]=r(null),g=e=>a(hr,{extractions:e});n(()=>{0===c.length&&g([d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===gr.Preset,y=c.length?c:[v?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:gr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:gr.Regex,label:re.SEGMENT_REGEX_LABEL,tooltip:re.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(V,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||se.JSON,r=de[i];return e(vr,{"data-id":`extract-row-${n}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(V,{$gap:10,children:[t(U,{label:v?re.PRESET_ROW_TITLE(n):re.REGEX_ROW_TITLE(n)}),v&&t(oe,{$gap:24,children:mr.map(e=>t(ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:ue.L,label:de[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!v&&t(ne,{"data-id":`extract-row-${n}-test-regex`,label:re.TEST_REGEX_LABEL,variant:ie.Secondary,size:ae.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ne,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:li,variant:ie.Secondary,size:ae.S,onClick:b})]})]}),v?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(yr,{children:t(pe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(Cr,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(yr,{children:t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(V,{$gap:12,$width:"100%",children:[t(pe,{name:`extract-row-${n}-regex`,label:re.REGEX_LABEL,placeholder:re.REGEX_PLACEHOLDER,helpMessage:re.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(G,{errorMessage:s})]}),t(pr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},$r=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Tr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Er=()=>{const o=f(),{selectedOption:n,genericForm:a}=kl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(al,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(pe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t($r,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Ir=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||Ce(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(il,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Nr=m(oe)`
|
|
2
118
|
position: sticky;
|
|
3
119
|
bottom: 4px;
|
|
4
120
|
align-self: center;
|
|
@@ -9,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
9
125
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
10
126
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
11
127
|
z-index: 1;
|
|
12
|
-
`,Jl=i(({testConnection:o,isEdit:a},i)=>{const r=f(),{isVm:c}=y(),{activeForm:d,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=yl(),[v,C]=l(h?.testResult),[S,w]=l(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!d?.option.testConnectionSupported||!u||c)return;const e=await o(fe(u.formData));return C(e),e};return s(i,()=>({testConnection:x,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,u,o]),u&&d?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(ue,{status:pe.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(ue,{status:pe.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),t(Q,{"data-id":"dest-form-docs",label:"Docs",leftIcon:ni,variant:te.Text,size:ee.S,onClick:()=>window.open(`${se}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]}),!c&&t(re,{options:[{icon:ai,label:"Enabled",value:!1,selectedBgColor:r.v2.colors.green[800]},{icon:ii,label:"Disabled",value:!0,selectedBgColor:r.v2.colors.red[800]}],selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(Qi,{title:"This connection will monitor:",allowedSignals:me(d.option.supportedSignals),selectedSignals:ge(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(he.Logs),metrics:e.includes(he.Metrics),traces:e.includes(he.Traces),profiles:e.includes(he.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(oe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Kl,{signals:ge(u.formData.exportedSignals),fields:d.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Yl,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:li,variant:te.Secondary,textColor:r.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),!c&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:te.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:si,variant:te.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:te.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(d.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:te.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(ae,{title:"No active form"})});Jl.displayName="AddDestinationForm";const ql=[{id:ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Zl=[{id:ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ql=["*"],es=[{id:Se.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Se.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Se.DbQuery,label:"Collect DB query",tooltip:""},{id:Se.Messaging,label:"Collect messaging",tooltip:""}],ts={[Te.Java]:[new xe("","")],[Te.Golang]:[new we("")]},os={[ke.CodeAttributes]:({value:a,setValue:i,formErrors:l})=>{const s=l.codeAttributes,c=r(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[ve.FilePath]:!0,[ve.Function]:!0,[ve.LineNumber]:!0,[ve.Column]:null,[ve.Namespace]:null,[ve.StackTrace]:null};i("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});i("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:ql.map(({id:e,label:o,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Zl.map(({id:e,label:o,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[ke.CustomInstrumentation]:({value:a,setValue:i,formErrors:l})=>{const s=l.customInstrumentations,c=r(()=>(a?.customInstrumentations?.[Te.Golang]||[]).map(e=>new we(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=r(()=>(a?.customInstrumentations?.[Te.Java]||[]).map(e=>new xe(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||i("customInstrumentations",{[Te.Golang]:ts[Te.Golang],[Te.Java]:ts[Te.Java]})},[]),e(o,{children:[e(V,{children:[e(Z,{$gap:8,children:[t(ri,{}),t(U,{label:"Golang custom probes"})]}),t(W,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Te.Golang]=e.map(e=>new we(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Te.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(Z,{$gap:8,children:[t(ci,{}),t(U,{label:"Java custom probes"})]}),t(W,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Te.Golang]=c,t[Te.Java]=e.map(e=>new xe(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[ke.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const i=a.headersCollection,l=r(()=>e?.headersCollection?.[Ce.HeaderKeys]||[],[e]),s=e=>{const t={[Ce.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{l.length||i||s(Ql)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:s,errorMessage:i})},[ke.PayloadCollection]:({value:o,setValue:a,formErrors:i})=>{const l=i.payloadCollection,s=r(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!l){const e={[Se.HttpRequest]:{},[Se.HttpResponse]:{},[Se.DbQuery]:{},[Se.Messaging]:{}};a("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:es.map(({id:e,label:o,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Se.HttpRequest]:o.includes(Se.HttpRequest)?{}:null,[Se.HttpResponse]:o.includes(Se.HttpResponse)?{}:null,[Se.DbQuery]:o.includes(Se.DbQuery)?{}:null,[Se.Messaging]:o.includes(Se.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:l})]})},[ke.UnknownType]:null},ns=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=os[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},as=()=>{const o=f(),{selectedOption:n,genericForm:a}=Cl();if(!a||!n)return t(ae,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[t(ie,{size:le.XXS,children:n.docsDescription}),t(Q,{label:"Docs",leftIcon:ni,variant:te.Text,size:ee.S,onClick:()=>window.open(`${se}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(Z,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Ie,{label:$e[e],leftIcon:Ee(e),status:pe.Default,useSecondaryTone:!0},e))]}),t(re,{options:[{icon:ai,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ii,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(oe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:s.ruleName}),t(ns,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:s}),t(ce,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},is=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Sl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ne,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Oe.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:te.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:te.Secondary,onClick:n}})},ls=({autoFocus:o})=>{const{dataStreams:n}=Ae(),{genericForm:a,excludeName:i,editingName:l}=Sl(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=r(()=>n.find(e=>e.name===u&&e.name!==i),[n,u,i]);return e(V,{$width:"100%",$gap:12,children:[t(oe,{name:"data-stream-name",label:Oe.STREAM_NAME,placeholder:Oe.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Oe.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(ue,{status:pe.Warning,message:Oe.DATA_STREAM_MERGE_WARNING(l,p.name),fullWidth:!0})]})},ss=()=>{const{selectedStreamName:e}=Ae(),{genericForm:o}=wl();if(!o)return t(ae,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(oe,{name:"sourceName",label:Oe.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},rs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],cs=m.div`
|
|
128
|
+
`,Ar=c(({testConnection:o,isEdit:a},i)=>{const l=f(),{isVm:s}=y(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Tl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||s)return;const e=await o($e(u.formData));return C(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,o]),u&&c?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Se,{status:we.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Se,{status:we.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[!s&&t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:be.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ne,{"data-id":"dest-form-docs",leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(al,{title:"This connection will monitor:",allowedSignals:Te(c.option.supportedSignals),selectedSignals:ke(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(xe.Logs),metrics:e.includes(xe.Metrics),traces:e.includes(xe.Traces),profiles:e.includes(xe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(pe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ir,{signals:ke(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Nr,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ui,variant:ie.Secondary,textColor:l.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!s&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ie.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:pi,variant:ie.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(me,{title:"No active form"})});Ar.displayName="AddDestinationForm";const Or=[{id:Ee.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ee.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ee.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Dr=[{id:Ee.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ee.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ee.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Rr=["*"],Pr=[{id:Ae.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ae.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ae.DbQuery,label:"Collect DB query",tooltip:""},{id:Ae.Messaging,label:"Collect messaging",tooltip:""}],Fr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Lr={[Pe.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Ee.FilePath]:!0,[Ee.Function]:!0,[Ee.LineNumber]:!0,[Ee.Column]:null,[Ee.Namespace]:null,[Ee.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ee).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:Or.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]}),e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Dr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]})]})},[Pe.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Re.Golang]||[]).map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Re.Java]||[]).map(e=>new De(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Re.Golang]:Fr[Re.Golang],[Re.Java]:Fr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(hi,{}),t(U,{label:"Golang custom probes"})]}),t(j,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Re.Golang]=e.map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Re.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(oe,{$gap:8,children:[t(gi,{}),t(U,{label:"Java custom probes"})]}),t(j,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Re.Golang]=c,t[Re.Java]=e.map(e=>new De(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Pe.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Ne.HeaderKeys]||[],[e]),s=e=>{const t={[Ne.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Rr)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Pe.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Ae.HttpRequest]:{},[Ae.HttpResponse]:{},[Ae.DbQuery]:{},[Ae.Messaging]:{}};i("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:Pr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ae.HttpRequest]:o.includes(Ae.HttpRequest)?{}:null,[Ae.HttpResponse]:o.includes(Ae.HttpResponse)?{}:null,[Ae.DbQuery]:o.includes(Ae.DbQuery)?{}:null,[Ae.Messaging]:o.includes(Ae.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(G,{errorMessage:r})]})},[Pe.UnknownType]:null},_r=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Lr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},zr=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=$l();if(!a||!n)return t(me,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(ll,{option:n,formState:r}),e(oe,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Fe,{label:Le[e],leftIcon:_e(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(rl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Pe.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(pe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(_r,{ruleType:n.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Br=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=El();if(!e)return null;const{existingName:a,editingName:i}=e;return t(ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Be.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ie.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ie.Secondary,onClick:n}})},Mr=({autoFocus:o})=>{const{dataStreams:n}=Me(),{genericForm:i,excludeName:l,editingName:r}=El(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(V,{$width:"100%",$gap:12,children:[t(pe,{name:"data-stream-name",label:Be.STREAM_NAME,placeholder:Be.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Be.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Se,{status:we.Warning,message:Be.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Xr=()=>{const{selectedStreamName:e}=Me(),{genericForm:o}=Il();if(!o)return t(me,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(pe,{name:"sourceName",label:Be.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Vr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ur=m.div`
|
|
13
129
|
display: flex;
|
|
14
130
|
flex-direction: column;
|
|
15
131
|
gap: 24px;
|
|
16
|
-
`,
|
|
132
|
+
`,Hr=m.div`
|
|
17
133
|
display: contents;
|
|
18
134
|
& > * {
|
|
19
135
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
20
136
|
transition: opacity 0.2s ease;
|
|
21
137
|
}
|
|
22
|
-
`,
|
|
138
|
+
`,Gr=({value:e})=>{const o=f();return t(Fe,e?{status:we.Success,label:We,leftIcon:si}:{label:Ke,leftIcon:ci,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},jr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:si,label:We,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ci,label:Ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(le,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Wr=()=>{const e=Nl();switch(e.formType){case Al.Create:return t(Kr,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(jr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Al.View:return e.data?e.isEditing?t(Kr,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(jr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Yr,{data:e.data,renderAction:()=>t(Gr,{value:!e.data?.rule.disabled})}):null;case Al.EditAutoNoisy:return t(Jr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:je,sectionTitle:Ue,sectionSubTitle:Ge,presetLabel:Ve,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(jr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoCostReduction:return t(Jr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:He,sectionTitle:Ue,presetLabel:Ve,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(jr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoHighlyRelevant:return t(Ur,{children:t(sl,{title:e.localEnabled?void 0:Xe,summary:e.summary,renderAction:()=>t(jr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Kr=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Ur,{children:[t(ul,{category:o,formState:n,renderAction:r}),e(Hr,{$faded:!!n.disabled,children:[t(pl,{category:o,formState:n,onChange:a}),t(rl,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(hl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(gl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(ml,{ruleType:n.ruleType,formState:n,onChange:a}),t(fl,{category:o,formState:n,onChange:a})]})]}),Yr=({data:o,renderAction:n})=>e(Ur,{children:[t(ul,{readOnly:!0,summary:o.summary,renderAction:n}),t(pl,{readOnly:!0,data:o}),t(rl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(hl,{readOnly:!0,data:o}),t(fl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(ml,{readOnly:!0,rule:o.rule})]}),Jr=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Ur,{children:[t(sl,{title:o?void 0:a,summary:n,renderAction:b}),t(Hr,{$faded:!o,children:e(Ye,{richTitle:{title:i,subTitle:r},children:[d&&t(V,{$alignItems:"flex-start",children:t(le,{options:Vr,selected:u,setSelected:v})}),S&&t(cl,{description:s,options:dl,selected:h,onSelect:y,customName:c,customLabel:Je,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},qr=m.div`
|
|
23
139
|
display: flex;
|
|
24
140
|
align-items: center;
|
|
25
141
|
justify-content: space-between;
|
|
@@ -30,29 +146,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
30
146
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
31
147
|
opacity: ${({$disabled:e})=>e?.5:1};
|
|
32
148
|
&:hover {
|
|
33
|
-
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>
|
|
149
|
+
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
34
150
|
}
|
|
35
|
-
`,
|
|
151
|
+
`,Zr=m.div`
|
|
36
152
|
display: flex;
|
|
37
153
|
align-items: center;
|
|
38
154
|
justify-content: center;
|
|
39
155
|
padding: 8px;
|
|
40
156
|
border-radius: 8px;
|
|
41
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
42
|
-
`,
|
|
157
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
|
|
158
|
+
`,Qr=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(qr,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(V,{$gap:4,children:[e(oe,{$gap:12,children:[g&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(Zr,{children:t(n,{size:20})}),t(Q,{size:te.XS,children:a})]}),i&&t(Q,{size:te.XXXS,color:ee.Secondary,children:i})]}),(l||c)&&e(oe,{$gap:8,children:[c,l&&t(mi,{size:18})]})]}),es=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=kl(),f=a(()=>(c?Ze.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ze).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(Qr,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Er,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:fi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(bl,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_ACTION,subTitle:Be.CREATING_ACTION_SUBTITLE},header:{icon:fi,title:Be.ADD_ACTION,subTitle:Be.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},ts=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(et).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(xe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(tt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(le,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},os=m.div`
|
|
43
159
|
display: flex;
|
|
44
160
|
flex-direction: column;
|
|
45
161
|
padding: 8px;
|
|
46
162
|
border-radius: 16px;
|
|
47
163
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
48
164
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
|
|
49
|
-
`,
|
|
165
|
+
`,ns=m.div`
|
|
50
166
|
display: flex;
|
|
51
167
|
align-items: center;
|
|
52
168
|
justify-content: space-between;
|
|
53
169
|
gap: 12px;
|
|
54
170
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
55
|
-
`,
|
|
171
|
+
`,as=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(os,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ns,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(Q,{size:te.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Fe,{label:a.length,status:l?we.Default:void 0})]}),t(ot,{icon:s?vi:yi,size:nt.M,onClick:()=>c(e=>!e)})]}),s?t(V,{children:a.length?u.toArray(a):t(Qe,{$padding:"12px 0",children:t(me,{})})}):null]})},is=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Te(e.supportedSignals).includes(o.signalType))):e,ls=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(Qr,{icon:lt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Fe,{status:n.succeeded?we.Success:we.Error,leftIcon:n.succeeded?Ci:Si})}),rs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Tl();return o?.length?t(as,{title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:o.map((o,n)=>t(ls,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(as,{purpleColors:!0,title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(ls,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ss;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ss||(ss={}));const cs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ss.SELF_HOSTED?n.push(...e.items):e.name===ss.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=rt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=st(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[et.DETECTED]:o,[et.SELF_HOSTED]:n,[et.MANAGED]:a}},ds=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:g,updateDestination:m,withOverlay:f,disableAnimation:b})=>{const[v,y]=r(""),[C,S]=r({categoryType:null,signalType:null}),{destinations:w}=ct(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Tl();n(()=>{p&&$(p)},[p]);const[E,I]=r(!0),[N,A]=r([]),[O,D]=r({[et.ALL]:[],[et.UNSAVED]:[],[et.EXISTS]:[],[et.DETECTED]:[],[et.SELF_HOSTED]:[],[et.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=st(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[et.EXISTS]:e}))},[w,N]);const R=l(async()=>{try{I(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...cs(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const P=l(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=$e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return m(e.id,o,s)}return g(o,s)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,s,g,m]),F=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Tl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(rs,{listType:et.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(et)){if(i.categoryType&&i.categoryType!==e)continue;const l=is(o[e],n,i);l.length&&a.push(t(rs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(Qe,{$height:"100%",children:t(at,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=Tl();return{width:"60%",list:o?[t(Ar,{testConnection:e},o.option.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:bi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(bl,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:P,disableSave:!x&&!T.length,isFetching:E,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_DESTINATION,subTitle:Be.CREATING_DESTINATION_SUBTITLE},header:{icon:bi,title:Be.ADD_DESTINATIONS,subTitle:Be.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:v,onChange:y},filters:t(ts,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},us=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=$l(),f=a(()=>c?dt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):dt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(Qr,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(zr,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:wi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(bl,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_INSTRUMENTATION_RULE,subTitle:Be.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:wi,title:Be.ADD_INSTRUMENTATION_RULE,subTitle:Be.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},ps={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Be.FETCHING_NAMESPACES,subTitle:Be.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Be.SELECT_NAMESPACE,subTitle:Be.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},hs={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===ut.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},gs=e=>e?hs:ps,ms="No matches",fs="No sources",bs=e=>`No sources matched the filter '${e}'`,vs=e=>(e?"Unselect":"Select")+" all",ys="Show only:",Cs="Selected",Ss="Auto",ws="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",xs="Enterprise only",ks=m.div``,Ts=m.div`
|
|
56
172
|
visibility: hidden;
|
|
57
173
|
|
|
58
174
|
transition: visibility 0s;
|
|
@@ -60,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
60
176
|
transition-duration: 0s;
|
|
61
177
|
}
|
|
62
178
|
|
|
63
|
-
${
|
|
179
|
+
${ks}:hover & {
|
|
64
180
|
visibility: visible;
|
|
65
181
|
}
|
|
66
|
-
|
|
182
|
+
`,$s=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(ks,{children:t(Qr,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:n,onCheckboxChange:i?s:a,children:i&&l?t(Fe,{label:l,status:we.Default,textSize:te.XXXS}):t(Ts,{children:t(Fe,{label:o,status:we.Info,textSize:te.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Es=m.div``,Is=m.div`
|
|
67
183
|
visibility: ${({$visible:e})=>e?"visible":"hidden"};
|
|
68
184
|
|
|
69
185
|
transition: visibility 0s;
|
|
70
186
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
71
187
|
|
|
72
|
-
${
|
|
188
|
+
${Es}:hover & {
|
|
73
189
|
visibility: visible;
|
|
74
190
|
}
|
|
75
|
-
`,Ys=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Gs,{children:t(ys,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(Z,{$gap:12,children:[!d&&t(Ks,{$visible:s||i,children:t(ye,{text:Vs,children:t(K,{label:Xs,labelAlign:Y.Left,size:it.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Z,{$gap:8,children:[t(ie,{variant:lt.Span,size:le.XXXS,color:be.Secondary,align:"right",children:Ms}),t(Ie,{label:`${l.sourced}/${l.total}`,status:s?pe.Default:nt.Unknown,minWidth:"42px"})]})]})})})},Js=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ys,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(Ts,{title:n,list:c,noBgColor:!0}):c},qs=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=Ps(m),{selectedStreamName:b}=Ae(),{progress:v,resetProgress:C}=st(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:T,handleSourceChange:k,handleSelectAll:I,formDiff:$,isFormDirty:E}=Nl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:dt,clusterName:ct,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,O]=l(""),[A,D]=l(ot.Namespace),[R,P]=l({showOnlySelected:!1}),[F,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Ps(p),g=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>$l(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...El(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=r(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=r(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Js,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,l]);return{width:"60%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(ie,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(ye,{text:b?Oe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ie,{label:`${b?`${v} / ${C}`:C}`,status:nt.Unknown})})]}),t(ie,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Bs(m)})]}),list:f.length?f:o?[t(He,{$height:"100%",children:t(Ye,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(He,{$height:"100%",children:t(ae,c?{icon:yi,title:Fs,subTitle:h.noGroupMatchedFilter(c)}:{icon:yi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:T,handleSourceChange:k,handleSelectAll:I,selectedArea:F,setSelectedArea:L,searchText:A===ot.Namespace?N:"",searchBy:A,filters:R}),B=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Ps(u),h=d===at.Onprem,g=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),m=r(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>kl(e,l,c)):[],[g,l,c]),f=r(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=r(()=>{if(!g)return[];const{clusterId:e}=i.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Il.has(l);return t(Ws,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Us},`${e}#${o}#${a}#${l}`)})},[m,g,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(ie,{size:le.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(ye,{text:v?Oe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ie,{label:`${v?`${C} / ${S}`:S}`,status:nt.Unknown})})]}),t(ie,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:le.XS,children:Bs(f)})]}),list:b.length?b:[t(He,{$height:"100%",children:t(ae,g?l?{icon:vi,title:Fs,subTitle:_s(l)}:{icon:vi,title:Ls,subTitle:p.noItemsInGroupSubTitle}:{icon:vi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:k,handleSelectAll:I,selectedArea:{value:F},searchText:A===ot.Source?N:"",searchBy:A,filters:R});return t(ul,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(rt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a($):void 0,onNext:i?()=>i($):void 0,nextIsSkip:!E,onSave:()=>d($),header:{icon:vi,title:Oe.ADD_SOURCE,subTitle:Oe.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{O(e),A===ot.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(A),segment:{options:[{label:f.groupSegmentLabel,value:ot.Namespace},{label:f.itemSegmentLabel,value:ot.Source}],selected:A,setSelected:D}},filters:e(Z,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,nowrap:!0,children:zs}),t(K,{name:"filter-selected",size:it.S,label:Ms,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:S,progress:{title:Oe.CREATING_SOURCES,subTitle:Oe.CREATING_SOURCES_SUBTITLE,percentage:v[rt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:B})},Zs=(e,t)=>{const o=[{id:"type",title:Oe.TYPE,label:t.label},{id:"status",title:Oe.STATUS,badge:{status:e.disabled?nt.Unknown:pe.Success,label:e.disabled?Oe.DISABLED:Oe.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Oe.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Oe.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Oe.NOTES,label:e.notes}),o},Qs=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=et(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=vl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),T=v&&!!b?.isFormDirty,k=r(()=>p?.find(e=>ut(e)===i),[i,p]),I=r(()=>Ue.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const $=c(()=>{k&&y(!0)},[k]),E=c(()=>{k&&(g(k),y(!1))},[k,g]),N=c(()=>{T?x("close"):a()},[T,a]),O=c(()=>{T?x("cancel"):E()},[T,E]),A=c(()=>{const e=w;x(null),"close"===e?(E(),a()):E()},[w,E,a]),D=c(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await s(k.id,t),y(!1))}},[k,m,s]),R=c(()=>{k&&S(!0)},[k]),P=c(async()=>{k&&(await d(k.id,k.type),a())},[k,d,a]);if(!k||!I)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?pe.Success:nt.Unknown,label:e?"True":"False",invertColors:!0});return o===ne.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||G.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||G.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===ne.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ne.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ne.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ne.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ne.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(k);return e(o,{children:[t(pt,{isOpen:!0,header:{icon:bt(k.type),title:I.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:ht.EDIT,icon:si,active:v,onClick:$},{id:"edit-action-btn-delete",label:ht.DELETE,icon:ti,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:O},{"data-id":"edit-action-btn-save",label:ht.SAVE,variant:te.Primary,onClick:D}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:v&&h?t(Gl,{}):t(V,{$gap:16,children:e(mt,{bgTint:"1000",children:[e(mt,{bgTint:"900",children:[t(ft,{conditions:k.conditions||[]}),t(mt,{bgTint:"800",cellsPerRow:2,items:Zs(k,I)})]}),!!F?.length&&t(mt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(mt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(pl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(hl,{isOpen:null!==w,onClose:()=>x(null),onApprove:A})]})},er=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,g]=l({showOnlySelected:!1}),m=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:T}=vt(y||{rollout:{automaticRolloutDisabled:!1}}),k=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),T(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(ul,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:Ci,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(Z,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:it.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:k,isFetching:b,leftColumn:{width:"35%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(ie,{size:le.XS,children:"Clusters"}),t(Ie,{label:m.length,status:nt.Unknown})]}),e(Z,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,align:"right",children:"Selected clusters"}),t(Ie,{label:`${i.length}/${m.length}`,status:nt.Unknown})]})]}),list:m.map(e=>t(ys,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ie,{size:le.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},tr=e=>{const t=[{id:"type",title:Oe.TYPE,label:e.destinationType.displayName},{id:"status",title:Oe.STATUS,badge:{status:e.disabled?nt.Unknown:pe.Success,label:e.disabled?Oe.DISABLED:Oe.ENABLED}}],o=ge(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Oe.MONITORS,label:o}),e.name&&t.push({id:"name",title:Oe.NAME,label:e.name}),t},or=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=et(),{selectedStreamName:v}=Ae(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=yl(),T=d(null),[k,I]=l(!1),[$,E]=l(!1),[N,O]=l(null),[A,D]=l(!0),[R,P]=l(null),F=k&&!!x?.isFormDirty,L=r(()=>St(b,v),[b,v]),_=r(()=>L?.find(e=>ut(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||O(t?.destinationCategories.categories??[])}).catch(t=>{e||O([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const B=r(()=>_&&N?wt(N,_):[],[_,N]),z=c(()=>{_&&I(!0)},[_]),M=c(()=>{_&&N&&(S(_,N),I(!1))},[_,N,S]),X=c(()=>{F?P("close"):a()},[F,a]),U=c(()=>{F?P("cancel"):M()},[F,M]),H=c(()=>{const e=R;P(null),"close"===e?(M(),a()):M()},[R,M,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,fe(t)),I(!1))}},[_,w,p]),W=c(()=>{_&&E(!0)},[_]),G=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=qe(_.destinationType.type),J=((e,t)=>{const o=[],n=yt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ge(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&de(h,i,a))return;const{type:m}=Qe(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Ct.MultiInput){const t=Qe(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Ct.KeyValuePair){const t=Qe(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,B);return e(o,{children:[t(pt,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:ht.EDIT,icon:si,active:k,onClick:z},{id:"edit-destination-btn-delete",label:ht.DELETE,icon:ti,color:g.v2.colors.red[500],active:$,onClick:W}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:ht.TEST_CONNECTION,variant:te.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:ht.SAVE,variant:te.Primary,onClick:j}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:A?t(He,{$height:"50vh",children:t(Ye,{withSpinner:!0})}):k&&C?t(Jl,{ref:T,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(mt,{bgTint:"1000",children:[e(mt,{bgTint:"900",children:[!m&&t(ft,{conditions:_.conditions||[]}),t(mt,{bgTint:"800",cellsPerRow:2,items:tr(_)})]}),!!J.length&&t(mt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(mt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(mt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(pl,{target:"destination",isOpen:$,onClose:()=>E(!1),onApprove:G}),t(hl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},nr=(e,t)=>{const o=[{id:"type",title:Oe.TYPE,label:t.label},{id:"status",title:Oe.STATUS,badge:{status:e.disabled?nt.Unknown:pe.Success,label:e.disabled?Oe.DISABLED:Oe.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Oe.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Oe.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Oe.NOTES,label:e.notes}),o},ar=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=et(),{addNotification:h}=Tt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=Cl(),[y,C]=l(!1),[S,w]=l(!1),[x,T]=l(null),k=y&&!!v?.isFormDirty,I=r(()=>p?.find(e=>ut(e)===i),[i,p]),$=r(()=>tt.find(({type:e})=>e===I?.type)??null,[I?.type]);n(()=>{I&&m(I)},[I]);const E=c(()=>{if(I){if(!I.mutable)return void h({type:pe.Warning,title:kt.FORBIDDEN,message:kt.CANNOT_EDIT_RULE,crdType:ot.InstrumentationRule,target:I.ruleId,hideFromHistory:!0});C(!0)}},[I,h]),N=c(()=>{I&&(m(I),C(!1))},[I,m]),O=c(()=>{k?T("close"):a()},[k,a]),A=c(()=>{k?T("cancel"):N()},[k,N]),D=c(()=>{const e=x;T(null),"close"===e?(N(),a()):N()},[x,N,a]),R=c(async()=>{if(I){const{errorMessage:e,preparedFormData:t}=b();e||(await s(I.ruleId,t),C(!1))}},[I,b,s]),P=c(()=>{if(I){if(!I.mutable)return void h({type:pe.Warning,title:kt.FORBIDDEN,message:kt.CANNOT_DELETE_RULE,crdType:ot.InstrumentationRule,target:I.ruleId,hideFromHistory:!0});w(!0)}},[I,h]),F=c(async()=>{I&&(await d(I.ruleId),a())},[I,d,a]);if(!I||!$)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ie,{size:le.XS,children:`• ${xt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ie,{size:le.XS,children:`• ${xt(e).toLowerCase()}`},e))}),e.headersCollection?.[Ce.HeaderKeys]?.length&&e.headersCollection[Ce.HeaderKeys].forEach(e=>{e&&n.push(t(ie,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Te.Java]?.forEach((e,a)=>{const i=new xe(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ie,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ie,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Te.Golang]?.forEach((e,a)=>{const i=new we(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ie,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ie,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(I,u);return e(o,{children:[t(pt,{isOpen:!0,header:{icon:$t(I.type),title:$.label,onClose:O,actions:[{id:"edit-rule-btn-edit",label:ht.EDIT,icon:si,active:y,onClick:E},{id:"edit-rule-btn-delete",label:ht.DELETE,icon:ti,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:A},{"data-id":"edit-rule-btn-save",label:ht.SAVE,variant:te.Primary,onClick:R}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:y&&g?t(as,{}):t(V,{$gap:16,children:e(mt,{bgTint:"1000",children:[e(mt,{bgTint:"900",children:[t(ft,{conditions:I.conditions||[]}),t(mt,{bgTint:"800",cellsPerRow:2,items:nr(I,$)})]}),!!L.length&&t(mt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(mt,{bgTint:"800",children:L})}),!!$.supportedLanguages.length&&t(mt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(mt,{bgTint:"800",children:t(Z,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(It,{label:$e[e],leftIcon:Ee(e),flex:"0.5"},e))})})})]})})})}),t(pl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(hl,{isOpen:null!==x,onClose:()=>T(null),onApprove:D})]})};var ir;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(ir||(ir={}));const lr=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:a,podName:i,nodeName:l,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Et(),g=Nt(!!o),m=r(()=>({title:i,icon:Si,withCopy:!0}),[i]),f=r(()=>{const e=[],t=Ot(c);t&&e.push(t);const o=Ot(d,wi,"health");o&&e.push(o);const n=Ot(u,xi,"health");return n&&e.push(n),e},[c,d,u]),b=r(()=>n?[{id:`restart-pod-${i}`,icon:Ti,label:ht.RESTART_POD,onClick:()=>n(a,i)}]:void 0,[n,a,i]),v=r(()=>[{id:"nodeName",title:Oe.NODE,label:l,withCopy:!0},{id:"age",title:Oe.AGE,label:s?h(s,{style:"short"}):Oe.NOT_RUNNING,labelTooltip:s}],[l,s,h]);return t("div",{ref:g,children:t(mt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},sr=m.div`
|
|
191
|
+
`,Ns=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Es,{children:t(Qr,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(oe,{$gap:12,children:[!d&&t(Is,{$visible:r||i,children:t(Ie,{text:ws,children:t(K,{label:Ss,labelAlign:Y.Left,size:gt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(oe,{$gap:8,children:[t(Q,{variant:mt.Span,size:te.XXXS,color:ee.Secondary,align:"right",children:Cs}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},As=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ns,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(as,{title:n,list:c,noBgColor:!0}):c},Os=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=gs(m),{selectedStreamName:b}=Me(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:E,isFormDirty:I}=Fl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:yt,clusterName:vt,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,A]=r(""),[O,D]=r(ut.Namespace),[R,P]=r({showOnlySelected:!1}),[F,L]=r({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=gs(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Rl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Pl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(As,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${b?`${v} / ${C}`:C}`,status:pt.Unknown})})]}),t(Q,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:te.XS,children:vs(m)})]}),list:f.length?f:o?[t(Qe,{$height:"100%",children:t(at,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Qe,{$height:"100%",children:t(me,c?{icon:ki,title:ms,subTitle:h.noGroupMatchedFilter(c)}:{icon:ki,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:F,setSelectedArea:L,searchText:O===ut.Namespace?N:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=gs(u),h=d===ht.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Dl.has(l);return t($s,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:xs},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${v?`${C} / ${S}`:S}`,status:pt.Unknown})})]}),t(Q,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:vs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:xi,title:ms,subTitle:bs(r)}:{icon:xi,title:fs,subTitle:p.noItemsInGroupSubTitle}:{icon:xi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(bl,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(bt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>d(E),header:{icon:xi,title:Be.ADD_SOURCE,subTitle:Be.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{A(e),O===ut.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:ut.Namespace},{label:f.itemSegmentLabel,value:ut.Source}],selected:O,setSelected:D}},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:ys}),t(K,{name:"filter-selected",size:gt.S,label:Cs,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Be.CREATING_SOURCES,subTitle:Be.CREATING_SOURCES_SUBTITLE,percentage:v[bt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},Ds=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Be.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Be.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},Rs=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=kl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),k=v&&!!b?.isFormDirty,T=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&g(T)},[T]);const E=l(()=>{T&&y(!0)},[T]),I=l(()=>{T&&(g(T),y(!1))},[T,g]),N=l(()=>{k?x("close"):i()},[k,i]),A=l(()=>{k?x("cancel"):I()},[k,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=m();e||(await c(T.id,t),y(!1))}},[T,m,c]),R=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?we.Success:pt.Unknown,label:e?"True":"False",invertColors:!0});if(o===ge.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ge.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ge.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ge.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ge.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Tt(T.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:pi,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:St.SAVE,variant:ie.Primary,onClick:D}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:v&&h?t(Er,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:T.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ds(T,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(vl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(yl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Ps=({onClose:o,connections:i,selectedConnectionIds:l,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>i.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[i.length,l.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=r(!1),[y,C]=r(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),T=a(()=>l.length>1||void 0!==y&&!x(y,S),[l.length,y,S]);return n(()=>{1===l.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(bl,{isOpen:!0,onClose:o,onSave:()=>d(S,l),header:{icon:Ti,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:gt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,children:"Clusters"}),t(Fe,{label:m.length,status:pt.Unknown})]}),e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,align:"right",children:"Selected clusters"}),t(Fe,{label:`${l.length}/${m.length}`,status:pt.Unknown})]})]}),list:m.map(e=>t(Qr,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(Q,{size:te.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Fs=e=>{const t=[{id:"type",title:Be.TYPE,label:e.destinationType.displayName},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],o=ke(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Be.MONITORS,label:o}),e.name&&t.push({id:"name",title:Be.NAME,label:e.name}),t},Ls=({onClose:s,destinationId:c,getDestinationCategories:d,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=ct(),{selectedStreamName:v}=Me(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Tl(),k=i(null),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=T&&!!x?.isFormDirty,L=a(()=>Nt(b,v),[b,v]),_=a(()=>L?.find(e=>Ct(e)===c),[c,L]);n(()=>{let e=!1;return D(!0),d().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const z=a(()=>_&&N?At(N,_):[],[_,N]),B=l(()=>{_&&$(!0)},[_]),M=l(()=>{_&&N&&(S(_,N),$(!1))},[_,N,S]),X=l(()=>{F?P("close"):s()},[F,s]),U=l(()=>{F?P("cancel"):M()},[F,M]),H=l(()=>{const e=R;P(null),"close"===e?(M(),s()):M()},[R,M,s]),G=l(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,$e(t)),$(!1))}},[_,w,p]),j=l(()=>{_&&I(!0)},[_]),W=l(async()=>{_&&(await h(_.id),s())},[_,h,s]);if(!_)return null;const{icon:K,iconSrc:Y}=lt(_.destinationType.type),J=((e,t)=>{const o=[],n=Et(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ke(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Ce(h,i,a))return;const{type:m}=st(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===It.MultiInput){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===It.KeyValuePair){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(_,z);return e(o,{children:[t(q,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:St.EDIT,icon:pi,active:T,onClick:B},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ii,color:g.v2.colors.red[500],active:E,onClick:j}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:St.TEST_CONNECTION,variant:ie.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:St.SAVE,variant:ie.Primary,onClick:G}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:O?t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})}):T&&C?t(Ar,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(kt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Fs(_)})]}),!!J.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(vl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(yl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},_s=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Be.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Be.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},zs=({onClose:i,ruleId:s,updateInstrumentationRule:c,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=ct(),{addNotification:h}=Dt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=$l(),[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Ct(e)===s),[s,p]),E=a(()=>dt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_EDIT_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),N=l(()=>{$&&(m($),C(!1))},[$,m]),A=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):N()},[T,N]),D=l(()=>{const e=x;k(null),"close"===e?(N(),i()):N()},[x,N,i]),R=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await c($.ruleId,t),C(!1))}},[$,b,c]),P=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_DELETE_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),F=l(async()=>{$&&(await d($.ruleId),i())},[$,d,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.headersCollection?.[Ne.HeaderKeys]?.length&&e.headersCollection[Ne.HeaderKeys].forEach(e=>{e&&n.push(t(Q,{size:te.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Re.Java]?.forEach((e,a)=>{const i=new De(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Re.Golang]?.forEach((e,a)=>{const i=new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Ft($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:St.EDIT,icon:pi,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:St.SAVE,variant:ie.Primary,onClick:R}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:y&&g?t(zr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:_s($,E)})]}),t(rl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(Pt,{label:Le[e],leftIcon:_e(e),flex:"0.5"},e))})})})]})})})}),t(vl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(yl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]})};var Bs;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(Bs||(Bs={}));const Ms=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Lt(),g=_t(!!o),m=a(()=>({title:l,icon:$i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,Ei,"health");o&&e.push(o);const n=zt(u,Ii,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ni,label:St.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Be.NODE,label:r,withCopy:!0},{id:"age",title:Be.AGE,label:s?h(s,{style:"short"}):Be.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(xt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Xs=m.div`
|
|
76
192
|
display: flex;
|
|
77
193
|
align-items: center;
|
|
78
194
|
justify-content: space-between;
|
|
@@ -80,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
80
196
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
81
197
|
border-radius: 12px;
|
|
82
198
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
83
|
-
`,
|
|
199
|
+
`,Vs=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Xt(o?.status),r=Ot(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Bt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Bt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Bt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Xs,{$noPadding:i,children:[t(Mt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Hs,{label:Be.PODS,count:c}),t(Hs,{label:Be.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Hs,{label:Be.ODIGOS_HEALTHY,icon:Ei,count:u,total:c}),t(Hs,{label:Be.KUBERNETES_HEALTHY,icon:Ii,count:p,total:c})]})]}):null},Us=m.div`
|
|
84
200
|
display: flex;
|
|
85
201
|
flex-direction: column;
|
|
86
202
|
justify-content: center;
|
|
@@ -91,23 +207,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
91
207
|
width: fit-content;
|
|
92
208
|
border-radius: 8px;
|
|
93
209
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
94
|
-
`,
|
|
210
|
+
`,Hs=({count:o,total:n,label:a,icon:i})=>{const l=f(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Us,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(Q,{size:te.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(Q,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(Q,{size:te.XXXS,nowrap:!0,children:a})]})]})},Gs=12,js=24,Ws=12,Ks=24,Ys=40,Js=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Vt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Vt.VPID);return t?.value??null};var qs;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(qs||(qs={}));const Zs=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(qs.IdentifyingAttributes),g=_t(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:qs.IdentifyingAttributes,label:Be.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:qs.InstrumentationLibraries,label:Be.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ai,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case qs.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(nc,{label:e.name,value:e.value},e.name))});case qs.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(nc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>Js({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(xt,{bgTint:"800",richTitle:{title:C?`${Be.PROCESS} ${Be.PID(C)}`:Be.PROCESS_FALLBACK_NAME},renderOnRightSide:t(Q,{color:i?ee.Success:ee.Error,size:te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?we.Success:we.Error,leftIcon:Ei,label:i?Be.HEALTHY:Be.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(le,{options:m,selected:p,setSelected:h}),!v&&y]})})},Qs=m.div`
|
|
95
211
|
display: flex;
|
|
96
|
-
align-items:
|
|
97
|
-
|
|
212
|
+
align-items: flex-start;
|
|
213
|
+
gap: 8px;
|
|
98
214
|
padding: 8px;
|
|
99
215
|
border-radius: 4px;
|
|
100
216
|
&:hover {
|
|
101
217
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
102
218
|
}
|
|
103
|
-
`,
|
|
219
|
+
`,ec=m(Q)`
|
|
220
|
+
flex: 0 0 30%;
|
|
221
|
+
`,tc=m(Q)`
|
|
222
|
+
flex: 1 1 auto;
|
|
223
|
+
min-width: 0;
|
|
224
|
+
`,oc=m(oe)`
|
|
225
|
+
flex: 1 1 auto;
|
|
226
|
+
justify-content: flex-end;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
`,nc=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(Qs,{children:[t(ec,{size:te.XXS,color:ee.Secondary,children:o}),n&&t(tc,{size:te.XXS,color:ee.Primary,align:"right",children:n}),(r||a)&&e(oc,{children:[a&&t(Fe,{status:we.Info,label:Be.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&t(Fe,{status:i?we.Success:we.Error,label:i?Be.HEALTHY:Be.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},ac=p(null),ic=({value:e,children:o})=>t(ac.Provider,{value:e,children:o}),lc=()=>{const e=h(ac);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e},rc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Be.CONTAINERS,titleSize:te.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(cc,{...e,language:Ut(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},sc=m.div`
|
|
104
229
|
display: flex;
|
|
105
230
|
flex-direction: column;
|
|
106
231
|
gap: 12px;
|
|
107
232
|
padding: 8px 12px;
|
|
108
233
|
border-radius: 8px;
|
|
109
234
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
110
|
-
`,
|
|
235
|
+
`,cc=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Lt(),C=_t(v),S=a(()=>({title:n,icon:o?_e(o):Oi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=zt({status:i?Bt.Success:Bt.Disabled,reasonEnum:i?Be.INSTRUMENTED_WITH_DISTRO(i):Be.UNINSTRUMENTED,message:""});t&&e.push(t);const o=zt(h,Ei,"health");o&&e.push(o);const n=zt(g,Ii,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:Be.RUNNING_TIME,label:l?y(l,{style:"short"}):Be.NOT_RUNNING,labelTooltip:`${Be.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?we.Success:Ht.Disabled,leftIcon:r?si:ci,label:r?Be.STARTED:Be.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?we.Success:Ht.Disabled,leftIcon:s?si:ci,label:s?Be.READY:Be.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?we.Error:we.Success,leftIcon:d?ci:si,label:d?Be.CRASHLOOP:Be.NO_CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Be.RESTARTS,badge:{status:c?we.Error:void 0,label:c||0,textSize:te.XXXS}}],[l,y,r,s,d,c]),k=a(()=>p?Ot(u):"",[p,u]);return t("div",{ref:C,children:e(xt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(sc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,leftIcon:Ii,label:k}),t(Q,{size:te.XXXS,color:ee.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,r=e,!!l?.processPid&&Js({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Zs,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},dc=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Be.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=a(()=>[{label:Be.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Be.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Be.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(jt,{bgTint:"700",label:e,value:o},e))})},uc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=lc(),r=l?.tab===Bs.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Be.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(Vs,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(xt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Ms,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(dc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(rc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(Qe,{$height:"70vh",children:t(me,{title:Be.NO_RUNNING_PODS,subTitle:Be.NO_RUNNING_PODS_SUBTITLE})})})},pc=({source:o,fetchPeerSources:i})=>{const s=a(()=>o.serviceName||o.id.name,[o]),[c,d]=r(!1),[u,p]=r(null),h=l(()=>{d(!0),i(s).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[s]);return n(()=>{h()},[h]),!u||c?t(Qe,c?{$height:"70vh",children:t(at,{withSpinner:!0})}:{$height:"70vh",children:t(me,{subTitle:Be.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(hc,{icon:Di,title:Be.INBOUND,subTitle:Be.INBOUND_DESCRIPTION(s),onRefresh:h,items:u?.inbound??[]}),t(hc,{icon:Ri,title:Be.OUTBOUND,subTitle:Be.OUTBOUND_DESCRIPTION(s),onRefresh:h,items:u?.outbound??[]})]})},hc=({icon:o,title:n,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:te.XS,subTitle:i,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:l}}],children:[t(Kt,{value:c,onChange:d,width:"100%"}),t(Yt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:Be.NO_RESULTS,subTitle:Be.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(mc,{...e},`${n}-${e.serviceName}`)):[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:`No ${n} connections yet`,subTitle:n===Be.INBOUND?Be.NO_INBOUND_CONNECTIONS_DESCRIPTION:Be.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},gc=m.div`
|
|
111
236
|
display: flex;
|
|
112
237
|
align-items: center;
|
|
113
238
|
justify-content: space-between;
|
|
@@ -121,7 +246,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
121
246
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
122
247
|
}
|
|
123
248
|
`}
|
|
124
|
-
`,
|
|
249
|
+
`,mc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=Jt(e=>e.drawerEntityId),r=ct(e=>e.sources),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(qt(s))!==JSON.stringify(qt(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[Zt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Pi];const e=s?Qt(s):void 0;return e?.length?e:[Oi]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Jt.getState();e(ut.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(gc,{onClick:u,$withClick:!!u,children:[e(oe,{$gap:8,children:[t(eo,{icons:d}),t(Q,{size:te.XXS,children:o})]}),n&&t(Fe,{status:we.Info,label:Be.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:Be.VIRTUAL_TOOLTIP})]})},fc=({source:o,fetchK8sManifest:i})=>{const l=f(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[g,m]=r(void 0);n(()=>{i(o.id.namespace,o.id.kind,o.id.name).then(u).finally(()=>c(!1)),i(o.id.namespace,to.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(m).finally(()=>h(!1))},[i,o.id.namespace,o.id.kind,o.id.name]);const b=a(()=>[{label:Be.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Be.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Be.GET_POD_YAML,value:`kubectl get ${to.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.name,o.id.namespace]);return e(xt,{bgTint:"1000",children:[t(xt,{bgTint:"900",richTitle:{icon:Fi,title:Be.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:o})=>t(jt,{label:e,value:o},e))}),s?t(oo,{size:1}):t(Cl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(oo,{size:1}):t(Cl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},bc=({title:o,children:n})=>e(V,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,children:o}),n]}),vc=({source:o})=>{const n=a(()=>{const[e,t]=no(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(bc,{title:Be.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(Q,{size:te.L,children:n.value}),t(Q,{size:te.XS,variant:mt.Span,children:n.units})]})})},yc=({source:o})=>{const{CopyButton:n}=ao();return t(bc,{title:Be.NAMESPACE,children:e(oe,{children:[t(Pt,{variant:Gt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:nt.XS})]})})},Cc=({source:e})=>t(bc,{title:Be.KIND,children:t(oe,{children:t(Pt,{variant:Gt.Blue,label:e.id.kind})})}),Sc=({source:o})=>{const{CopyButton:n}=ao();return t(bc,{title:Be.NAME,children:e(oe,{children:[t(Pt,{variant:Gt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:nt.XS})]})})},wc=({source:o})=>{const{isVm:n}=y();return t(xt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(vc,{source:o}),!n&&t(yc,{source:o}),t(Cc,{source:o}),t(Sc,{source:o})]})})},xc=m.div`
|
|
125
250
|
display: flex;
|
|
126
251
|
align-items: center;
|
|
127
252
|
gap: 6px;
|
|
@@ -129,34 +254,36 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
129
254
|
border-radius: 8px;
|
|
130
255
|
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
131
256
|
transition: background-color 0.15s ease;
|
|
132
|
-
|
|
133
|
-
|
|
257
|
+
&:hover {
|
|
258
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
259
|
+
}
|
|
260
|
+
`,kc=m.div`
|
|
134
261
|
display: flex;
|
|
135
262
|
align-items: center;
|
|
136
263
|
justify-content: center;
|
|
137
264
|
flex-shrink: 0;
|
|
138
265
|
width: 18px;
|
|
139
266
|
height: 18px;
|
|
140
|
-
`,
|
|
267
|
+
`,Tc=m.div`
|
|
141
268
|
flex: 1;
|
|
142
269
|
min-width: 0;
|
|
143
270
|
display: flex;
|
|
144
|
-
|
|
271
|
+
`,$c=({chevron:o,onClick:n,label:a,name:i,badges:l,action:r,paddingLeft:s})=>{const c=f();return e(xc,{$clickable:!!n,$paddingLeft:s,onClick:n,children:[o&&t(kc,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:a}),t(Tc,{children:t(Q,{size:te.XS,nowrap:!0,children:i})}),r&&t(Ie,{text:r.tooltip,children:t(ot,{icon:r.icon,size:nt.XS,onClick:r.onClick})}),l.map(({key:e,...o})=>t(Ec,{...o},e))]})},Ec=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===we.Success?si:ci);return t(Fe,{status:e,leftIcon:i,label:n,tooltip:a,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0})},Ic=({overrideProcessNum:e,pod:o,container:n,process:i})=>{const{jumpToProcess:l}=lc(),r=a(()=>Js({overrideProcessNum:e,identifyingAttributes:i.identifyingAttributes}),[e,i.identifyingAttributes]),s=a(()=>{const e=[],t=zt(i.healthStatus,Ei,"health");return t&&e.push(t),e},[]);return t($c,{label:Be.PROCESS,name:r?Be.PID(r):Be.PROCESS_FALLBACK_NAME,paddingLeft:Ys,action:{icon:Li,onClick:()=>l(o,n,i),tooltip:Be.OPEN_IN_POD_TAB},badges:s})},Nc=m.div`
|
|
145
272
|
display: flex;
|
|
146
273
|
flex-direction: column;
|
|
147
274
|
align-self: stretch;
|
|
148
275
|
border-radius: 8px;
|
|
149
276
|
background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
|
|
150
|
-
`,
|
|
277
|
+
`,Ac=({pod:o,container:n})=>{const[i,l]=r(!1),{jumpToContainer:s}=lc(),c=a(()=>{const e=[],t=Xt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:Ei,label:io(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Xt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ii,label:io(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(Nc,{$isExpanded:i,children:[t($c,{chevron:u?i?yi:mi:void 0,onClick:u?()=>l(e=>!e):void 0,label:Be.CONTAINER,name:n.containerName,paddingLeft:Ks+(u?0:24),action:{icon:Li,onClick:()=>s(o,n),tooltip:Be.OPEN_IN_POD_TAB},badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${js}px`,children:d.map((e,a)=>{const i=a+1;return t(Ic,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},Oc=m.div`
|
|
151
278
|
display: flex;
|
|
152
279
|
flex-direction: column;
|
|
153
280
|
align-self: stretch;
|
|
154
281
|
border-radius: 8px;
|
|
155
282
|
background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
|
|
156
283
|
padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
|
|
157
|
-
`,
|
|
284
|
+
`,Dc=({pod:o})=>{const[n,i]=r(!1),{jumpToPod:l}=lc(),s=o.containers??[],c=s.length>0,d=a(()=>{const e=[],t=zt(o.agentInjectedStatus);t&&e.push(t);const n=zt(o.odigosHealthStatus,Ei,"health");n&&e.push(n);const a=zt(o.k8sHealthStatus,Ii,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Oc,{$isExpanded:n,children:[t($c,{chevron:c?n?yi:mi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Be.POD,name:o.podName,paddingLeft:Ws+(c?0:24),action:{icon:Li,onClick:()=>l(o),tooltip:Be.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${Gs}px`,children:s.map(e=>t(Ac,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Rc=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Dc,{pod:e},`pod-${e.podName}`))}):t(Qe,{children:t(me,{title:Be.NO_RUNNING_PODS,subTitle:Be.NO_RUNNING_PODS_SUBTITLE})}),Pc=({source:o})=>t(xt,{bgTint:"1000",richTitle:{title:Be.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(xt,{bgTint:"900",children:[t(Vs,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Rc,{pods:o.pods})]})}),Fc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?lo(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Mt,{...o,width:"calc(100% - 32px)"}):null},Lc="calc(50% - 6px)",_c=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Xt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ot(t):`${Be.ROLLOUT} ${Ot(t)}`,subTitle:a,action:i!==we.Success?{icon:Ni,tooltip:Be.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Xt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ot(t):`${Be.ROLLBACK} ${Ot(t)}`,subTitle:n,action:a!==we.Success?{icon:Ni,tooltip:Be.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?t(xt,{bgTint:"1000",children:e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Mt,{invertColors:!0,slim:!0,width:r?Lc:"100%",...l}),r&&t(Mt,{invertColors:!0,slim:!0,width:Lc,...r})]})}):null},zc=p(null),Bc=m.div`
|
|
158
285
|
position: relative;
|
|
159
|
-
`,
|
|
286
|
+
`,Mc=({children:e})=>{const o=i(null);return t(Bc,{ref:o,children:t(zc.Provider,{value:o,children:e})})},Xc=m.div`
|
|
160
287
|
position: fixed;
|
|
161
288
|
top: ${({$coords:e})=>e.top}px;
|
|
162
289
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -170,14 +297,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
170
297
|
padding: 12px 16px;
|
|
171
298
|
border-radius: 12px;
|
|
172
299
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
173
|
-
`,
|
|
300
|
+
`,Vc=m.div`
|
|
174
301
|
display: flex;
|
|
175
302
|
align-items: flex-end;
|
|
176
303
|
justify-content: space-between;
|
|
177
304
|
gap: 8px;
|
|
178
|
-
`,
|
|
305
|
+
`,Uc=m.div`
|
|
179
306
|
flex: 1;
|
|
180
|
-
`,
|
|
307
|
+
`,Hc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(zc),[y,C]=r(null);return ro(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Ul(e(Xc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(Q,{size:te.XXS,children:c}),t(Q,{size:te.XXXS,color:ee.Secondary,children:d})]}),e(Vc,{children:[t(Uc,{children:p}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(ne,{variant:ie.Secondary,onClick:l,leftIcon:ii,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ae.S,textColor:b.v2.colors.red[500]}),t(ne,{variant:ie.Primary,onClick:a,leftIcon:Ci,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ae.S})]})]}),t("div",{children:t(Se,{status:we.Warning,message:u})})]}),document.body):null},Gc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=$t(l),p=a(()=>{if(!o)return[];const e=so[o].community,t=s===ht.Onprem?so[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[n?t(Fe,{status:we.Info,invertColors:!0,label:Be.OVERIDDEN}):null,e(Mc,{children:[t(Ie,{text:Be.OVERRIDE_OTEL_DISTRO_NAME,children:t(ot,{icon:pi,onClick:b})}),m&&t(Hc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:Be.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:Be.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Be.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Be.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Be.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(tt,{label:Be.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},jc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Dt(),{formData:c,handleFormChange:d,resetFormData:u}=$t(i),p=a(()=>co.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{children:[o?t(Fe,{status:we.Info,invertColors:!0,label:Be.OVERIDDEN}):null,e(Mc,{children:[t(Ie,{text:Be.OVERRIDE_RUNTIME_DETAILS,children:t(ot,{icon:pi,onClick:b})}),m&&t(Hc,{width:"500px",onClose:b,onSave:async()=>{!c.version||uo(c.version)?(g(!0),await n(c),g(!1),b()):s({type:we.Warning,message:Rt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Be.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Be.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Be.OVERRIDE_RUNTIME_DETAILS,subTitle:Be.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Be.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(tt,{label:Be.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(pe,{label:Be.RUNTIME_VERSION,placeholder:Be.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Wc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:i,containersRichTitle:l}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Be.DETECTED_PROCESSES:`${e.id.kind} ${Be.CONTAINERS}`,tooltip:t?.message||(n?Be.DETECTED_PROCESSES_DESCRIPTION:Be.DETECTED_CONTAINERS_DESCRIPTION),badge:Xt(t?.status)===Ht.Loading?{status:Ht.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(xt,{bgTint:"1000",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>e&&t(qc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},Kc=m.div`
|
|
181
308
|
display: flex;
|
|
182
309
|
flex-direction: column;
|
|
183
310
|
align-self: stretch;
|
|
@@ -185,28 +312,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
185
312
|
padding: 8px 12px;
|
|
186
313
|
border-radius: 8px;
|
|
187
314
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
188
|
-
`,
|
|
315
|
+
`,Yc=m.div`
|
|
189
316
|
display: flex;
|
|
190
317
|
align-items: center;
|
|
191
318
|
justify-content: center;
|
|
192
319
|
padding: 8px;
|
|
193
320
|
border-radius: 10px;
|
|
194
321
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
195
|
-
`,
|
|
322
|
+
`,Jc=m.div`
|
|
196
323
|
display: flex;
|
|
197
324
|
flex-direction: column;
|
|
198
325
|
gap: 12px;
|
|
199
326
|
padding: 8px 12px;
|
|
200
327
|
border-radius: 8px;
|
|
201
328
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
202
|
-
`,hc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:Ft(n),version:to(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=r(()=>!i&&!d,[i,d]),m=r(()=>g?Ii:Ee(u.language),[g,u]),b=r(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=r(()=>g?{status:Lt.Loading,label:Oe.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?pe.Success:Lt.Disabled,leftIcon:l?.otelDistroName?ai:ii,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(dc,{children:[e(Z,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(Z,{$gap:8,$alignItems:"center",children:[t(uc,{children:t(m,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(ie,{children:a}),t(It,b?{variant:_t.Blue,label:b}:{variant:_t.Loader,label:Oe.DETECTING_RUNTIME_INFO}),t(rc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(Z,{$gap:8,$alignItems:"center",children:[t(Ie,{...v,textSize:le.XXXS}),t(sc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||g?null:t(pc,{children:e(Z,{$gap:10,$alignItems:"center",children:[t(It,{variant:_t.Pink,label:xt(l.agentEnabledStatus?.reasonEnum)||Oe.NO_AVAILABLE_AGENT}),t(ie,{size:le.XXXS,color:be.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},gc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(Br,{source:o}),t(qr,{source:o}),t(Qr,{source:o,onClickRollout:n,onClickRollback:a}),t(cc,{source:o,onOverride:i}),t(Jr,{source:o})]}),mc=({source:o,fetchK8sManifest:a})=>{const i=f(),[s,r]=l(!0),[c,d]=l(void 0),[u,p]=l(!0),[h,g]=l(void 0);return n(()=>{a(o.id.namespace,o.id.kind,o.id.name).then(d).finally(()=>r(!1)),a(o.id.namespace,oo.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(g).finally(()=>p(!1))},[a,o.id.namespace,o.id.kind,o.id.name]),e(mt,{bgTint:"1000",children:[s?t(no,{size:1}):t(gl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:c}),u?t(no,{size:1}):t(gl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:h})]})};function fc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function bc(e){const t=Math.abs(e);return t>=1e9?`${vc(e/1e9)}s`:t>=1e6?`${vc(e/1e6)}ms`:t>=1e3?`${vc(e/1e3)}μs`:String(Math.round(e))}function vc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function yc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function Cc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Sc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function wc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=yc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(fc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&fc(e,l.nameIndex)===fc(e,t.nameIndex)&&a.add(Cc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Cc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Cc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=fc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:Sc(r,b)}})}function xc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var Tc,kc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Tc||(Tc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(kc||(kc={}));function Ic(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function $c(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Ec(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Nc=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,T]=l(""),[k,I]=l(null),[$,E]=l([]),[N,O]=l(!1),[A,D]=l(Tc.Fit),[R,P]=l(kc.Fit),[F,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*A),8192)),B=Math.max(1,Math.min(Math.floor(S.h*R),8192)),z=$.length>0?$[$.length-1]:null,M=z?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,E([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=r(()=>wc(o,_,B,a,i,{zoomRoot:z,shouldKeepName:s,collapseRecursive:F}),[o,a,i,B,_,z,s,F]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=$c((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*B,V);if(n){const e=Cc(n);I(e);const t=M>0?(100*n.size/M).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";T(`${n.name}\ntotal ${bc(n.size)} (${t}% of view, ${a}% of profile) · self ${bc(n.self)}`)}else I(null),T("")},[V,o.numTicks,B,_,M]),H=c(e=>{U(e)},[U]),j=c(()=>{I(null),T("")},[]),W=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),G=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=$c((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*B,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);E(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,B,_]);g(()=>{const e=v.current;if(!e||_<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,B),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(B*a),e.style.width=`${_}px`,e.style.height=`${B}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,B),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=xc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=Ic(d,s),m=`${r} (${bc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Cc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,B,X,i,m,k,o.numTicks):(l.fillStyle=m.v2.colors.silver[900],l.fillRect(0,0,_,B)))},[X,o.numTicks,k,i,B,_,m]);const J=c(()=>O(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(M/o.numTicks*100))):100,oe=r(()=>function(e,t){const o=yc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,z),[o,z]),ne=null!==oe,ae=$.length>0,se=z?fc(o,z.nameIndex):"",ce=c(()=>E([]),[]),de=c(()=>E(e=>e.slice(0,-1)),[]),ue=c(()=>{oe&&E(e=>[...e,oe])},[oe]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(Z,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:it.S,value:F,onChange:L}),e(Z,{$gap:8,children:[e(Z,{children:[t(Q,{variant:te.Secondary,size:ee.S,label:"Reset zoom",leftIcon:Ai,onClick:ce,disabled:!$.length}),t(Q,{variant:te.Secondary,size:ee.S,iconSize:20,leftIcon:Di,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ae,onClick:de}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ie,{size:le.XXS,color:be.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(Q,{variant:te.Secondary,size:ee.S,iconSize:20,leftIcon:oi,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ne,onClick:ue})]}),e(Z,{children:[t(ye,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(re,{variant:ao.Filled,options:[{value:Tc.Fit,label:"W: Fit"},{value:Tc.X10,label:"10x"}],selected:A,setSelected:D})}),t(ye,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(re,{variant:ao.Filled,options:[{value:kc.Fit,label:"H: Fit"},{value:kc.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(Q,{variant:te.Secondary,size:ee.S,iconSize:24,leftIcon:N?fi:Oi,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(ye,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:A>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:k?"pointer":"default"},onPointerDown:W,onPointerMove:H,onPointerLeave:j,onClick:G})})})}),e(Z,{$justifyContent:"space-between",children:[t(ie,z?{size:le.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${se} • ${bc(M)} samples in view`}:{size:le.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ie,{size:le.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ec(h.totalBytesUsed)} / ${Ec(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var Oc,Ac;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Oc||(Oc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ac||(Ac={}));const Dc=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Rc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Ac.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Ac.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Dc.test(o)))return!1}return!0}const Pc={options:[{id:Ac.FilterOutVoid,label:"Filter out void symbols"},{id:Ac.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Rc(e.cells.find(e=>e.key===Oc.Symbol)?.rawValue?.toString()??"",t)},Fc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Oc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(io.Java)?Pc:void 0,noFilter:!o?.includes(io.Java)},{key:Oc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Oc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Oc.Symbol,rawValue:e.name},{key:Oc.Self,rawValue:bc(e.self)},{key:Oc.Total,rawValue:bc(e.total)}]})),[e]);return t(lo,{variant:so.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ri,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Lc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Lc||(Lc={}));const _c=m(V)`
|
|
329
|
+
`,qc=({onOverride:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),d=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:Ut(n),version:po(n)||void 0}),[n]),p=a(()=>!!s?.otelDistroName,[s]),h=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!d,[l,d]),m=a(()=>g?Oi:_e(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=a(()=>g?{status:Ht.Loading,label:Be.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?we.Success:Ht.Disabled,leftIcon:r?.otelDistroName?si:ci,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),y=e=>o({containerName:i,...p?h:{},...d?u:{},...e});return e(Kc,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Yc,{children:t(m,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(Q,{children:i}),t(Pt,b?{variant:Gt.Blue,label:b}:{variant:Gt.Loader,label:Be.DETECTING_RUNTIME_INFO}),t(jc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(Fe,{...v,textSize:te.XXXS}),t(Gc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Jc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,label:Ot(r.agentEnabledStatus?.reasonEnum)||Be.NO_AVAILABLE_AGENT}),t(Q,{size:te.XXXS,color:ee.Secondary,children:r?.agentEnabledStatus?.message})]})})]})},Zc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>{const{isVm:l}=y();return e(V,{$gap:12,children:[t(wc,{source:o}),t(Fc,{source:o}),!l&&t(_c,{source:o,onClickRollout:n,onClickRollback:a}),!l&&t(Wc,{source:o,onOverride:i}),!l&&t(Pc,{source:o})]})};function Qc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function ed(e){const t=Math.abs(e);return t>=1e9?`${td(e/1e9)}s`:t>=1e6?`${td(e/1e6)}ms`:t>=1e3?`${td(e/1e3)}μs`:String(Math.round(e))}function td(e){return e.toFixed(2).replace(/\.?0+$/,"")}function od(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function nd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function ad(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function id(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=od(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Qc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Qc(e,l.nameIndex)===Qc(e,t.nameIndex)&&a.add(nd(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(nd(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(nd(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Qc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:ad(s,b)}})}function ld(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var rd,sd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(rd||(rd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(sd||(sd={}));function cd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function dd(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function ud(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const pd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[x,k]=r(""),[T,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(rd.Fit),[R,P]=r(sd.Fit),[F,L]=r(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=E.length>0?E[E.length-1]:null,M=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=a(()=>id(o,_,z,s,c,{zoomRoot:B,shouldKeepName:d,collapseRecursive:F}),[o,s,c,z,_,B,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=dd((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=nd(n);$(e);const t=M>0?(100*n.size/M).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${ed(n.size)} (${t}% of view, ${a}% of profile) · self ${ed(n.self)}`)}else $(null),k("")},[V,o.numTicks,z,_,M]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),k("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=dd((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=ld(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=cd(d,r),m=`${s} (${ed(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(nd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,T,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,T,c,z,_,m]);const J=l(()=>A(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(M/o.numTicks*100))):100,Z=a(()=>function(e,t){const o=od(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,B),[o,B]),re=null!==Z,se=E.length>0,ce=B?Qc(o,B.nameIndex):"",de=l(()=>I([]),[]),ue=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{Z&&I(e=>[...e,Z])},[Z]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:gt.S,value:F,onChange:L}),e(oe,{$gap:8,children:[e(oe,{children:[t(ne,{variant:ie.Secondary,size:ae.S,label:"Reset zoom",leftIcon:_i,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:zi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!se,onClick:ue}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:li,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!re,onClick:pe})]}),e(oe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(le,{variant:ho.Filled,options:[{value:rd.Fit,label:"W: Fit"},{value:rd.X10,label:"10x"}],selected:O,setSelected:D})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(le,{variant:ho.Filled,options:[{value:sd.Fit,label:"H: Fit"},{value:sd.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Si:Li,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:j,onPointerMove:H,onPointerLeave:G,onClick:W})})})}),e(oe,{$justifyContent:"space-between",children:[t(Q,B?{size:te.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${ce} • ${ed(M)} samples in view`}:{size:te.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(Q,{size:te.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ud(h.totalBytesUsed)} / ${ud(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var hd,gd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(hd||(hd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(gd||(gd={}));const md=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fd(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(gd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(gd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&md.test(o)))return!1}return!0}const bd={options:[{id:gd.FilterOutVoid,label:"Filter out void symbols"},{id:gd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>fd(e.cells.find(e=>e.key===hd.Symbol)?.rawValue?.toString()??"",t)},vd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:hd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(go.Java)?bd:void 0,noFilter:!o?.includes(go.Java)},{key:hd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:hd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:hd.Symbol,rawValue:e.name},{key:hd.Self,rawValue:ed(e.self)},{key:hd.Total,rawValue:ed(e.total)}]})),[e]);return t(mo,{variant:fo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Bi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var yd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(yd||(yd={}));const Cd=m(V)`
|
|
203
330
|
width: 100%;
|
|
204
331
|
flex: 1;
|
|
205
332
|
border-radius: 16px;
|
|
206
333
|
overflow: hidden;
|
|
207
334
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
208
335
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
209
|
-
`,
|
|
336
|
+
`,Sd=m.div`
|
|
210
337
|
display: flex;
|
|
211
338
|
align-items: center;
|
|
212
339
|
gap: 10px;
|
|
@@ -214,11 +341,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
214
341
|
padding: 12px 12px 8px;
|
|
215
342
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
216
343
|
border-radius: 16px 16px 0 0;
|
|
217
|
-
`,
|
|
344
|
+
`,wd=m(oe)`
|
|
218
345
|
flex-shrink: 0;
|
|
219
346
|
align-items: center;
|
|
220
347
|
gap: 4px;
|
|
221
|
-
`,
|
|
348
|
+
`,xd=m.div`
|
|
222
349
|
flex: 1;
|
|
223
350
|
display: flex;
|
|
224
351
|
align-items: stretch;
|
|
@@ -226,20 +353,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
226
353
|
padding: 16px;
|
|
227
354
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
228
355
|
border-radius: 0 0 16px 16px;
|
|
229
|
-
`,
|
|
356
|
+
`,kd=m(V)`
|
|
230
357
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
231
358
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
232
359
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
233
360
|
gap: 10px;
|
|
234
|
-
`,
|
|
361
|
+
`,Td=m(V)`
|
|
235
362
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
236
363
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
237
364
|
gap: 10px;
|
|
238
|
-
|
|
365
|
+
`,$d=m(oe)`
|
|
239
366
|
width: 100%;
|
|
240
367
|
min-height: 32px;
|
|
241
368
|
flex-shrink: 0;
|
|
242
|
-
`,
|
|
369
|
+
`,Ed=({source:o,fetchProfilingSlots:c,enableProfiling:d,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),g=o.id,[m,b]=r(!0),[v,y]=r(null),[C,S]=r(null),[w,x]=r(0),[k,T]=r(yd.Both),[$,E]=r(""),[I,N]=r({}),A=i(null),O=l(async()=>{try{const e=[c()];m&&e.push(u(g));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[c,u,g]);n(()=>{let e=!1;return(async()=>{await d(g),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[d,O,g]);const D=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=a(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Qc(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),P=a(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=k===yd.Table||k===yd.Both,L=k===yd.Flame||k===yd.Both,_=F&&L,z=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),B=a(()=>function(e,t){if(!t?.includes(go.Java))return;const o=e?.[hd.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>fd(e,o):void 0}(I,z),[I,z]);return!C&&w<2?t(Qe,{$height:"70vh",children:t(at,{withSpinner:!0})}):e(Cd,{$gap:0,$width:"100%",children:[e(Sd,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(wd,{children:t(Q,{size:te.S,weight:500,color:ee.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Kt,{value:$,onChange:E,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(le,{variant:ho.Filled,options:[{value:yd.Table,label:"Top table"},{value:yd.Flame,label:"Flame graph"},{value:yd.Both,label:"Both"}],selected:k,setSelected:T}),t(ne,m?{variant:ie.Secondary,size:ae.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ie.Secondary,size:ae.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(xd,{$gap:F&&L?16:0,children:D?e(s,{children:[F&&e(kd,{$splitWithFlame:_,children:[t($d,{$justifyContent:"flex-end",children:t(ne,{variant:ie.Secondary,size:ae.S,label:"Download snapshot",rightIcon:Xi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(vd,{rows:P,languages:z,filters:I,onFiltersChange:N})]}),L&&e(Td,{$splitWithTable:_,children:[e($d,{$justifyContent:"space-between",children:[t(Fe,{label:D?`Total in view ${ed(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!m&&t(ne,{variant:ie.Secondary,size:ae.S,label:"Refresh",leftIcon:Ni,onClick:O}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:gt.S,value:m,onChange:b})]})]}),t(pd,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:B,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Qe,{children:t(me,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},Id=[to.Deployment,to.StatefulSet,to.DaemonSet,to.DeploymentConfig,to.Rollout,to.Pod];var Nd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Nd||(Nd={}));const Ad=e=>!!e&&Xt(e.status)===we.Error,Od=e=>Ad(e.healthStatus),Dd=e=>Ad(e.odigosHealthStatus)||(e.processes??[]).some(Od),Rd=e=>Ad(e.agentInjectedStatus)||Ad(e.odigosHealthStatus)||(e.containers??[]).some(Dd),Pd=({onClose:o,effectiveConfig:s,sourceId:c,fetchSourceById:d,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Me(),{genericForm:$,loadSource:E,validateFormData:I}=Il(),[N,A]=r(!1),[O,D]=r(!1),[R,P]=r(!1),[F,L]=r(Bs.Overview),[_,z]=r(null),[B,M]=r({openFor:null}),X=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Bs.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Bs.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Js({identifyingAttributes:n.identifyingAttributes});t({tab:Bs.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(qt(c))!==JSON.stringify(qt(_))&&z(null)},[c,_]);const U=i(!1),H=l(async()=>z(await d(c)||null),[c]);n(()=>{if(U.current||(H(),U.current=!0),!N){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,N]),n(()=>{_&&E(_)},[_]);const G=_&&Id.includes(_.id.kind),j=a(()=>{const e=[],o=(_?.pods??[]).some(Rd);return e.push({value:Bs.Overview,label:Be.OVERVIEW}),k||(e.push({value:Bs.Pods,label:Be.PODS,icon:o?e=>t(Ai,{...e,fill:x.v2.colors.red[500]}):void 0}),e.push({value:Bs.PeerSources,label:Be.PEER_SOURCES}),s?.profiling?.enabled&&e.push({value:Bs.Profiling,label:Be.PROFILING}),e.push({value:Bs.Debug,label:Be.DEBUG})),e},[k,s,_?.pods]),W=l(()=>A(!0),[]),K=l(()=>{_&&E(_),A(!1)},[_]),Y=l(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=I();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(c,{...t,otelServiceName:o}),A(!1)},[_,$,I,c,p]),J=l(()=>D(!0),[]),Z=l(async()=>{_&&(await u({[yt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),o())},[_,u,T,o]),Q=l(()=>{M({openFor:Nd.Workload})},[]),ee=l(e=>{L(e),X.clearJumpToTarget()},[X]),oe=l(async()=>{await m(c)},[m,c]),ne=l(async()=>{B.openFor===Nd.Workload?await h([c]):B.openFor===Nd.Pod&&B.podNamespace&&B.podName&&await g(B.podNamespace,B.podName),M({openFor:null})},[B,h,g,c]),ae=a(()=>{const e=[];return N||F===Bs.Overview&&(e.push({id:"edit-source-btn-edit",label:St.EDIT,icon:pi,active:N,onClick:W}),!k&&G&&e.push({id:"edit-source-btn-restart",label:St.RESTART,icon:Vi,onClick:Q}),e.push({id:"edit-source-btn-delete",label:St.DELETE,icon:ii,color:x.v2.colors.red[500],active:O,onClick:J})),e},[F,N,O,k,G,W,Q,J,x]),re=a(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:_.id.name,leftIcon:k?void 0:Ii}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:Ei,textColor:x.v2.colors.silver[200]}),e},[_,x,k]);if(!_)return t(q,{isOpen:!0,children:t(Qe,{$height:"80vh",children:t(at,{withSpinner:!0})})});const se=F===Bs.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(ic,{value:X,children:[t(q,{isOpen:!0,width:se,header:{icon:k?Ui:bo(_.containers)[0],titleBadges:re,onClose:()=>{ee(Bs.Overview),z(null),P(!1),o()},actions:ae},footer:{actions:N?[{"data-id":"edit-source-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:St.SAVE,variant:ie.Primary,onClick:Y}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!N&&j.length>1&&t(le,{options:j,selected:F,setSelected:ee}),(()=>{switch(F){case Bs.Overview:return N?t(Xr,{}):t(Zc,{source:_,onClickRollout:Q,onClickRollback:oe,onOverride:e=>p(c,e)});case Bs.Pods:return t(uc,{source:_,onClickRestartPod:G?(e,t)=>M({openFor:Nd.Pod,podNamespace:e,podName:t}):void 0});case Bs.PeerSources:return t(pc,{source:_,fetchPeerSources:b});case Bs.Profiling:return t(Ed,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case Bs.Debug:return t(fc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(vl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:Z}),t(vl,{target:`${B.openFor?.toLowerCase()??""}`,action:"restart",description:Be.RESTART_POD_DESCRIPTION,isOpen:!!B.openFor,onClose:()=>M({openFor:null}),onApprove:ne,overrideApproveButtonLabel:Be.DELETE_POD_TO_RESTART})]})},Fd=m.div`
|
|
243
370
|
display: flex;
|
|
244
371
|
align-items: center;
|
|
245
372
|
gap: 8px;
|
|
@@ -249,9 +376,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
249
376
|
&:hover {
|
|
250
377
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
251
378
|
}
|
|
252
|
-
`,
|
|
379
|
+
`,Ld=m.div`
|
|
253
380
|
flex: 1;
|
|
254
|
-
`,
|
|
381
|
+
`,_d=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Fd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(Q,{size:te.XS,weight:500,color:n,children:So}),t(ii,{size:16,fill:n})]})};function zd(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(_d,{onClick:l}),r&&t(Se,{status:we.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Ld,{}),t(ne,{"data-id":"sampling-view-edit-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:a}),t(ne,{"data-id":"sampling-view-edit-btn-save",label:yo,variant:ie.Primary,size:ae.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(_d,{onClick:a}),t(Ld,{}),t(ne,{"data-id":"sampling-view-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:i}),t(ne,{"data-id":"sampling-view-btn-edit",label:Co,variant:ie.Primary,size:ae.S,onClick:l})]})}}const Bd={[Al.EditAutoNoisy]:{title:Do,subTitle:Oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Al.EditAutoCostReduction]:{title:Ao,subTitle:No,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Al.EditAutoHighlyRelevant]:{title:Io,subTitle:Eo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Md=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(q,{isOpen:e,width:Po,header:{icon:Hi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(wt,{$padding:"12px",children:t(Wr,{})})}),Xd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Nl(Al.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:we.Warning,message:u.message,action:r?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>r(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:To,variant:ie.Primary,size:ae.S,onClick:h,disabled:!!u}]};return t(Md,{isOpen:e,title:$o[s],subTitle:wo[s],onClose:o,footer:g})},Vd=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=Nl(Al.View),m=s?.rule.name||ko,f=c&&s?xo[s.category]:`${m} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,s.rule.ruleId,s.samplingId)}},[s,c,d,n,i,g]),v=l(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return zd(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,r]);return t(Md,{isOpen:!!s,title:f,subTitle:s?wo[s.category]:"",onClose:e,footer:y})},Ud=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Nl(Al.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(jd,{formType:Al.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Hd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Nl(Al.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(jd,{formType:Al.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Gd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Nl(Al.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(jd,{formType:Al.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},jd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Bd[e];return t(Md,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:vo,variant:ie.Secondary,size:ae.S,onClick:n},{"data-id":i.saveId,label:Ro,variant:ie.Primary,size:ae.S,onClick:a}]}})},Wd=e=>{switch(e.formType){case Al.Create:return t(Ll,{formType:Al.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Xd,{...e})});case Al.View:return t(Ll,{formType:Al.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Vd,{...e})});case Al.EditAutoNoisy:return t(Ll,{formType:Al.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Ud,{...e})});case Al.EditAutoCostReduction:return t(Ll,{formType:Al.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Hd,{...e})});case Al.EditAutoHighlyRelevant:return t(Ll,{formType:Al.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Gd,{...e})})}},Kd=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=ao(),g=!i||a||!c.newToken;return Fo({key:"Enter",active:!g},s),e(oe,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(pe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(oe,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(at,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ne,{variant:ie.Secondary,size:ae.S,leftIcon:Si,onClick:r,disabled:a}),t(ne,{variant:ie.Primary,size:ae.S,leftIcon:Ci,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(Q,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(ot,{icon:pi,onClick:l})]})]})},Yd=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Lt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Lo(e,0)?we.Error:Lo(e,2592e6)?we.Warning:we.Success,[e]),d=a(()=>c===we.Success?Ci:c===we.Warning?Gi:Ai,[c]);return n(()=>{c===we.Success?o():c===we.Error&&i()},[c]),t(Ie,{text:s,children:t(Fe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Jd=m.div`
|
|
255
382
|
display: flex;
|
|
256
383
|
flex-direction: column;
|
|
257
384
|
gap: 12px;
|
|
@@ -259,7 +386,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
259
386
|
border-radius: 12px;
|
|
260
387
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
261
388
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
262
|
-
`,
|
|
389
|
+
`,qd=({children:e})=>{const o=f();return t(Q,{size:te.XXXS,color:o.v2.colors.grey[150],children:e})},Zd=({token:o,updateToken:n})=>{const[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=$t({newToken:""});return t(Ye,{richTitle:{icon:ji,title:"Odigos Pro Token"},children:e(Jd,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(qd,{children:"Issued for"}),t(Q,{size:te.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(qd,{children:"Expiration"}),t(Yd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(oe,{children:e(V,{children:[t(qd,{children:"Token"}),t(Kd,{token:o.token,newToken:u.newToken,isLoading:l,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),s(!1),void p("newToken","")),onSave:()=>(async()=>{s(!0);const e=await n(u.newToken.trim());s(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},Qd=m.div`
|
|
263
390
|
display: flex;
|
|
264
391
|
flex-direction: column;
|
|
265
392
|
align-items: center;
|
|
@@ -268,23 +395,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
268
395
|
padding: 12px 24px;
|
|
269
396
|
border-radius: 8px;
|
|
270
397
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
271
|
-
`,bd=({downloadDiagnose:o})=>{const{progress:n}=st(),{namespaces:a}=et(),[i,s]=l(null),{formData:r,handleFormChange:c,resetFormData:d}=vt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Me,{richTitle:{icon:Mi,title:"Diagnose"},children:i?e(fd,{children:[t(Ye,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[rt.DownloadingDiagnose]?.percentage,percentage:n[rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[rt.DownloadingDiagnose]?.percentage,visualIcon:Fi,startedAt:i}),n[rt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[rt.DownloadingDiagnose].list.map(o=>e(Z,{$gap:4,$alignItems:"center",children:[o.status===pe.Success?t(mi,{size:16}):o.status===pe.Error?t(fi,{size:16}):t(Ye,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ie,{size:le.XXXS,color:be.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(ie,{size:le.XXS,color:be.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(Z,{$gap:8,children:[t(H,{label:"Profiles",value:r.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ie,{size:le.XXXS,color:be.Secondary,children:"Include pprof profiles"})]}),e(Z,{$gap:8,children:[t(H,{label:"Metrics",value:r.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(ie,{size:le.XXXS,color:be.Secondary,children:"Include Prometheus metrics"})]}),e(Z,{$gap:8,children:[t(H,{label:"Source Workloads",value:r.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(ie,{size:le.XXXS,color:be.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(No,{alignX:Ao.Left,alignY:Oo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:r.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(r.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:te.Secondary,disabled:r.includeSourceWorkloads,leftIcon:r.sourceWorkloadNamespaces.length?()=>t(Ie,{label:r.sourceWorkloadNamespaces.length,status:pe.Default}):void 0}}),t(Z,{$justifyContent:"flex-end",children:t(Q,{label:"Download Diagnose",rightIcon:Fi,variant:te.Primary,onClick:async()=>{s(Date.now()),await o(r),s(null),d()},disabled:null!==i})})]})})},vd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[s,r]=l(null);return n(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(Me,{richTitle:{icon:Xi,title:"General Information"},children:t(mt,{cellsPerRow:2,items:[{id:Do(),title:"Odigos Version",label:a},{id:Do(),title:`${o.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:Do(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:Do(),title:"Tier",label:i}]})})},yd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:s})=>e(pt,{isOpen:o,header:{icon:Xi,title:"System Overview",onClose:n},children:[l&&t(vd,{fetchDescribeOdigos:l}),i&&a&&t(md,{token:a,updateToken:i}),s&&t(bd,{downloadDiagnose:s})]}),Cd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:l})=>{const{addDataStreams:s,setSelectedStreamName:r}=Ae(),{requestSubmit:d}=Sl(),u=c(async e=>{l?await l(e):(s([e]),r(e.name)),a()},[l,s,r,a]),p=c(()=>d(u),[d,u]);return $o({key:"Enter",active:n},p),e(o,{children:[t(Ne,{isOpen:n,onClose:a,onCloseEnd:i,title:Oe.NAME_YOUR_STREAM,description:Oe.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:ht.DONE,variant:te.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:a},children:t(ls,{autoFocus:!0})}),t(is,{})]})},Sd=({isOpen:a,onClose:i,onCloseEnd:l,dataStreamName:s,updateDataStream:r})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=Sl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=c(async e=>{await r(s,e),i()},[r,s,i]),m=c(()=>p(g),[p,g]);return $o({key:"Enter",active:a},m),e(o,{children:[t(Ne,{isOpen:a,onClose:i,onCloseEnd:l,title:Oe.RENAME_STREAM(s),description:Oe.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:ht.SAVE,variant:te.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:i},children:t(ls,{autoFocus:!0})}),t(is,{})]})},wd=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),xd=m.div`
|
|
398
|
+
`,eu=({downloadDiagnose:o})=>{const{progress:n}=ft(),{namespaces:a}=ct(),[i,l]=r(null),{formData:s,handleFormChange:c,resetFormData:d}=$t({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ye,{richTitle:{icon:Wi,title:"Diagnose"},children:i?e(Qd,{children:[t(at,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[bt.DownloadingDiagnose]?.percentage,percentage:n[bt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[bt.DownloadingDiagnose]?.percentage,visualIcon:Xi,startedAt:i}),n[bt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[bt.DownloadingDiagnose].list.map(o=>e(oe,{$gap:4,$alignItems:"center",children:[o.status===we.Success?t(Ci,{size:16}):o.status===we.Error?t(Si,{size:16}):t(at,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(Q,{size:te.XXXS,color:ee.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(Q,{size:te.XXS,color:ee.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(oe,{$gap:8,children:[t(H,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(H,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(H,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(_o,{alignX:Bo.Left,alignY:zo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ie.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(Fe,{label:s.sourceWorkloadNamespaces.length,status:we.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(ne,{label:"Download Diagnose",rightIcon:Xi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},tu=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[l,s]=r(null);return n(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ye,{richTitle:{icon:Fi,title:"General Information"},children:t(xt,{cellsPerRow:2,items:[{id:Mo(),title:"Odigos Version",label:a},{id:Mo(),title:`${o.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Mo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Mo(),title:"Tier",label:i}]})})},ou=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Fi,title:"System Overview",onClose:n},children:[l&&t(tu,{fetchDescribeOdigos:l}),i&&a&&t(Zd,{token:a,updateToken:i}),r&&t(eu,{downloadDiagnose:r})]}),nu=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Me(),{requestSubmit:d}=El(),u=l(async e=>{r?await r(e):(s([e]),c(e.name)),a()},[r,s,c,a]),p=l(()=>d(u),[d,u]);return Fo({key:"Enter",active:n},p),e(o,{children:[t(ze,{isOpen:n,onClose:a,onCloseEnd:i,title:Be.NAME_YOUR_STREAM,description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:St.DONE,variant:ie.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:a},children:t(Mr,{autoFocus:!0})}),t(Br,{})]})},au=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=El();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return Fo({key:"Enter",active:a},m),e(o,{children:[t(ze,{isOpen:a,onClose:i,onCloseEnd:r,title:Be.RENAME_STREAM(s),description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:St.SAVE,variant:ie.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:i},children:t(Mr,{autoFocus:!0})}),t(Br,{})]})},iu=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),lu=m.div`
|
|
272
399
|
position: absolute;
|
|
273
400
|
top: 50%;
|
|
274
401
|
left: 50%;
|
|
275
402
|
transform: translate(-50%, -50%);
|
|
276
403
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
277
|
-
`,
|
|
404
|
+
`,ru="onboarding-done",su=()=>{const{currentModal:o,setCurrentModal:n}=Xo(),a=()=>n("");return e(Vo,{isOpen:o===ru,onClose:a,children:[t(iu,{}),t(lu,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(Q,{size:te.L,weight:500,children:"Welcome to"}),t(Sl,{size:260}),t(Q,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ne,{label:"Get Started",rightIcon:ri,onClick:a})]})})]})},cu=m.div`
|
|
278
405
|
display: flex;
|
|
279
406
|
flex-direction: column;
|
|
280
407
|
gap: 8px;
|
|
281
408
|
padding: 4px 8px;
|
|
282
409
|
border-radius: 8px;
|
|
283
410
|
width: calc(100% - 16px);
|
|
284
|
-
|
|
411
|
+
`,du=m.div`
|
|
285
412
|
white-space: pre;
|
|
286
413
|
overflow-x: auto;
|
|
287
|
-
`,
|
|
414
|
+
`,uu=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(cu,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(Q,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Fe,{label:Uo,leftIcon:Ki,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(K,{name:s??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Y.Left,value:i,onChange:l,size:gt.S})]}),t(du,{children:t(S,{parts:r})})]})},pu=m.div`
|
|
288
415
|
position: relative;
|
|
289
416
|
display: flex;
|
|
290
417
|
align-items: center;
|
|
@@ -294,18 +421,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
294
421
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
295
422
|
border-top-left-radius: 18px;
|
|
296
423
|
border-top-right-radius: 18px;
|
|
297
|
-
`,
|
|
424
|
+
`,hu=m.div`
|
|
298
425
|
position: absolute;
|
|
299
426
|
left: 16px;
|
|
300
427
|
top: 50%;
|
|
301
428
|
transform: translateY(-50%);
|
|
302
|
-
`,
|
|
429
|
+
`,gu=m.div`
|
|
303
430
|
height: 16px;
|
|
304
431
|
width: 100%;
|
|
305
432
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
306
433
|
border-top-left-radius: 18px;
|
|
307
434
|
border-top-right-radius: 18px;
|
|
308
|
-
`,
|
|
435
|
+
`,mu=m.div`
|
|
309
436
|
width: ${({$width:e})=>e}px;
|
|
310
437
|
display: flex;
|
|
311
438
|
flex-direction: column;
|
|
@@ -313,7 +440,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
313
440
|
gap: 22px;
|
|
314
441
|
padding: 8px 32px 32px 32px;
|
|
315
442
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
316
|
-
`,
|
|
443
|
+
`,fu=e=>t(Yi,{rotate:90,...e}),bu=({children:o,center:n,onNext:a,nextLabel:i=Ho,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(ne,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:fu,variant:ie.Primary,size:ae.M,onClick:a,loading:l})]}),vu=e=>t(Yi,{rotate:-90,...e}),yu=({title:o,onBack:n})=>{const a=f();return e(pu,{$hasBack:!!n,children:[n&&t(hu,{children:t(ot,{"data-id":"sampling-onboarding-back",icon:vu,size:nt.M,onClick:n})}),t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},Cu=m.div`
|
|
317
444
|
box-sizing: border-box;
|
|
318
445
|
width: ${({$width:e})=>e??"100%"};
|
|
319
446
|
${({$fillHeight:e})=>e&&b`
|
|
@@ -326,16 +453,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
326
453
|
padding: 16px;
|
|
327
454
|
border-radius: 16px;
|
|
328
455
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
329
|
-
`,
|
|
456
|
+
`,Su=({children:e,fillHeight:o,width:n})=>t(Cu,{$fillHeight:o,$width:n,children:e}),wu=m.ul`
|
|
330
457
|
margin: 0;
|
|
331
458
|
padding: 0;
|
|
332
459
|
list-style: disc;
|
|
333
|
-
`,
|
|
460
|
+
`,xu=m.li`
|
|
334
461
|
margin-left: 18px;
|
|
335
462
|
& + & {
|
|
336
463
|
margin-top: 6px;
|
|
337
464
|
}
|
|
338
|
-
`,
|
|
465
|
+
`,ku=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(wu,{children:e.map((e,o)=>t(xu,{style:{color:a},children:t(Q,{size:te.XXS,color:a,children:e})},o))})},Tu=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(Q,{size:te.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(Q,{size:te.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(Q,{size:te.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},$u=({message:e})=>t(Se,{status:we.Default,message:e,fullWidth:!0,smallIcon:!0}),Eu=m.div`
|
|
339
466
|
width: calc(100% - 16px);
|
|
340
467
|
padding: 8px;
|
|
341
468
|
display: flex;
|
|
@@ -343,12 +470,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
343
470
|
gap: 4px;
|
|
344
471
|
border-radius: 16px;
|
|
345
472
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
346
|
-
`,
|
|
473
|
+
`,Iu=m.div`
|
|
347
474
|
display: flex;
|
|
348
475
|
align-items: center;
|
|
349
476
|
gap: 8px;
|
|
350
477
|
padding: 4px 8px 12px 8px;
|
|
351
|
-
`,
|
|
478
|
+
`,Nu=m.div`
|
|
352
479
|
width: calc(100% - 16px);
|
|
353
480
|
display: flex;
|
|
354
481
|
flex-direction: column;
|
|
@@ -356,20 +483,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
356
483
|
padding: 8px;
|
|
357
484
|
border-radius: 12px;
|
|
358
485
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
359
|
-
`,
|
|
486
|
+
`,Au=({children:e})=>{const o=f();return t(Q,{size:te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Ou=m.div`
|
|
360
487
|
white-space: pre-line;
|
|
361
|
-
`,
|
|
488
|
+
`,Du=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(yu,{title:Go,onBack:l}),e(mu,{$width:854,children:[t(Au,{children:jo}),e(V,{$gap:8,$width:"100%",children:[t(Su,{children:t(Ou,{children:t(Q,{size:te.XXS,color:s.v2.colors.silver[200],children:Wo})})}),e(V,{$gap:8,$width:"100%",children:[e(Eu,{children:[t(Iu,{children:t(Q,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Ko})}),t(Nu,{children:t(uu,{name:Jo,recommended:!0,toggleLabel:Yo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t($u,{message:qo})]})]})]}),t(bu,{onNext:r})]})},Ru=e=>t(Yi,{rotate:90,...e}),Pu=({onClose:n})=>{const a=f();return e(o,{children:[t(gu,{}),e(mu,{$width:732,children:[t(Zo,{icon:Hi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Qo}),en.split("\n").map(e=>t(Au,{children:e},e)),e(Su,{children:[t(Q,{size:te.XS,color:a.v2.colors.silver[200],children:tn}),t(ku,{color:a.v2.colors.white[500],items:[on,nn,an]})]})]})]}),t(bu,{center:!0,children:t(ne,{"data-id":"sampling-onboarding-btn-go-to",label:ln,rightIcon:Ru,variant:ie.Primary,size:ae.M,onClick:n})})]})},Fu=e=>t(Yi,{rotate:90,...e}),Lu=m.div`
|
|
362
489
|
display: flex;
|
|
363
490
|
flex-direction: column;
|
|
364
491
|
align-items: center;
|
|
365
492
|
gap: 8px;
|
|
366
493
|
width: 100%;
|
|
367
|
-
`,
|
|
494
|
+
`,_u=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(gu,{}),e(mu,{$width:732,children:[t(Zo,{icon:Hi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Lu,{children:[t(Q,{size:te.M,weight:500,color:i.v2.colors.white[500],children:rn}),t(Au,{children:sn})]}),e(Su,{children:[t(Q,{size:te.XS,color:i.v2.colors.silver[200],children:cn}),t(Tu,{items:[{title:un,description:dn},{title:hn,description:pn},{title:mn,description:gn}]}),t($u,{message:fn})]})]})]}),e(bu,{center:!0,children:[t(ne,{"data-id":"sampling-onboarding-btn-skip",label:bn,variant:ie.Secondary,onClick:n}),t(ne,{"data-id":"sampling-onboarding-btn-start",label:vn,rightIcon:Fu,variant:ie.Primary,onClick:a})]})]})},zu=m.div`
|
|
368
495
|
display: flex;
|
|
369
496
|
align-items: stretch;
|
|
370
497
|
gap: 16px;
|
|
371
498
|
width: 100%;
|
|
372
|
-
`,
|
|
499
|
+
`,Bu=m.div`
|
|
373
500
|
flex: 1;
|
|
374
501
|
display: flex;
|
|
375
502
|
flex-direction: column;
|
|
@@ -389,18 +516,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
389
516
|
background-color: ${t.v2.colors.silver[700]};
|
|
390
517
|
}
|
|
391
518
|
`}
|
|
392
|
-
`,
|
|
519
|
+
`,Mu=m.div`
|
|
393
520
|
display: flex;
|
|
394
521
|
align-items: center;
|
|
395
522
|
gap: 8px;
|
|
396
523
|
padding: 12px 16px;
|
|
397
|
-
`,
|
|
524
|
+
`,Xu=m.div`
|
|
398
525
|
flex: 1;
|
|
399
526
|
padding: 8px;
|
|
400
527
|
display: flex;
|
|
401
528
|
flex-direction: column;
|
|
402
529
|
gap: 8px;
|
|
403
|
-
`,
|
|
530
|
+
`,Vu=m.div`
|
|
404
531
|
flex: 1;
|
|
405
532
|
display: flex;
|
|
406
533
|
flex-direction: column;
|
|
@@ -408,17 +535,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
408
535
|
padding: 12px;
|
|
409
536
|
border-radius: 12px;
|
|
410
537
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
411
|
-
`,
|
|
538
|
+
`,Uu=m.div`
|
|
412
539
|
display: flex;
|
|
413
540
|
justify-content: flex-end;
|
|
414
|
-
`,
|
|
541
|
+
`,Hu=m.div`
|
|
415
542
|
display: flex;
|
|
416
543
|
align-items: center;
|
|
417
544
|
gap: 8px;
|
|
418
545
|
padding: 4px 12px 4px 4px;
|
|
419
546
|
border-radius: 8px;
|
|
420
547
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
421
|
-
`,
|
|
548
|
+
`,Gu=m.div`
|
|
422
549
|
display: flex;
|
|
423
550
|
align-items: center;
|
|
424
551
|
justify-content: center;
|
|
@@ -426,13 +553,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
426
553
|
height: 24px;
|
|
427
554
|
border-radius: 6px;
|
|
428
555
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
429
|
-
`,
|
|
556
|
+
`,ju=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Bu,{$selected:o,onClick:n,children:[e(Mu,{children:[t(ce,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:ue.L}),t(Hi,{size:24,fill:d.v2.colors.white[500]}),t(Q,{size:te.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Xu,{children:[e(Vu,{$selected:o,children:[e(V,{$gap:8,children:[t(Fe,{...l,textSize:te.XXXS}),t(Q,{size:te.XXS,color:u,children:i})]}),r&&r.length>0&&t(ku,{color:u,items:r}),s&&e(Hu,{children:[t(Gu,{children:t(Gi,{size:18,fill:d.v2.colors.yellow[500]})}),t(Q,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Uu,{children:t(ne,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Fn,rightIcon:di,variant:ie.Text,size:ae.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Wu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(yu,{title:yn,onBack:i}),e(mu,{$width:854,children:[t(Au,{children:Cn}),e(zu,{children:[t(ju,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:$n,description:Tn,badgeProps:{label:kn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[wn,xn],warning:Sn,onReadMore:c}),t(ju,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:On,description:An,badgeProps:{label:Nn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[En,In],onReadMore:c}),t(ju,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Pn,description:Rn,badgeProps:{label:Dn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(bu,{onNext:l})]})},Ku=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Bn,bullets:[Ln,_n,zn]},{title:Gn,bullets:[Mn,Xn,Vn,Un,Hn]}],[]);return e(o,{children:[t(yu,{title:jn,onBack:n}),e(mu,{$width:854,children:[t(Au,{children:Wn}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Su,{fillHeight:!0,width:"50%",children:[t(Q,{size:te.XS,color:r.v2.colors.white[500],children:o.title}),t(ku,{items:o.bullets})]},n))}),t($u,{message:Kn})]}),t(bu,{onNext:i,nextLoading:l})]})},Yu=m.div`
|
|
430
557
|
white-space: pre-line;
|
|
431
|
-
`,
|
|
558
|
+
`,Ju=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(yu,{title:Yn,onBack:l}),e(mu,{$width:854,children:[t(Au,{children:Jn}),e(V,{$gap:8,$width:"100%",children:[e(Su,{children:[t(Yu,{children:t(Q,{size:te.XXS,color:c.v2.colors.silver[200],children:qn})}),t($u,{message:Kn})]}),e(Eu,{children:[e(Iu,{children:[t(Q,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Zn}),t(Oi,{size:16,fill:c.v2.colors.silver[200]})]}),t(Nu,{children:t(uu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(bu,{onNext:r,nextLoading:s})]})},qu=m.div`
|
|
432
559
|
white-space: pre-line;
|
|
433
|
-
`,
|
|
560
|
+
`,Zu=m.div`
|
|
434
561
|
width: fit-content;
|
|
435
|
-
`,fu=["50","25","10","1","0.1"],bu=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>fu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(ie,{size:le.XS,color:i.v2.colors.white[500],children:a}),t(mu,{children:t(re,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},vu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Ld,{title:Yn,onBack:s}),e(Dd,{$width:854,children:[t(Gd,{children:Jn}),e(V,{$gap:8,$width:"100%",children:[e(Bd,{children:[t(gu,{children:t(ie,{size:le.XXS,color:u.v2.colors.silver[200],children:qn})}),t(Xd,{items:[Zn,Qn,ea,ta,oa]}),t(Ud,{message:Vn})]}),e(Hd,{children:[e(jd,{children:[t(ie,{size:le.S,weight:500,color:u.v2.colors.white[500],children:na}),t(Ii,{size:16,fill:u.v2.colors.silver[200]})]}),t(Wd,{children:t(Ed,{name:Kn,recommended:!0,toggleLabel:Gn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Wd,{children:t(bu,{value:i,onChange:l,label:aa})})]})]})]}),t(Pd,{onNext:c,nextLoading:d})]})},yu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[g,m]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const T=c(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(r(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let k=null;switch(p){case"welcome":k=t(eu,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":k=t(Yd,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":k=t(du,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":k=t(vu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"drop-list":k=t(hu,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"advanced":k=t(uu,{onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"success":k=t(qd,{onClose:o})}return t(Po,{isOpen:e,onClose:o,children:k})};var Cu,Su;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Cu||(Cu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Su||(Su={}));const wu=[{key:Su.Name,label:"Name"},{key:Su.Type,label:"Type",textAlign:"right"},{key:Su.Status,label:"Status"},{key:Su.OdigosVersion,label:"Odigos Version"},{key:Su.ConnectedSince,label:"Connected Since"},{key:Su.LastActivity,label:"Last Activity"}],xu=(e,t)=>{const o=e.find(e=>e.key===Su.Id)?.rawValue;return t(o?.toString()||"")},Tu=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Su.Status)?.rawValue===pe.Success)(e))return[{id:Do(),label:"Delete Connection",rightIcon:li,onClick:()=>xu(e,a)}];const d=xu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&T(n.odigosVersion,o)}),u=xu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&T(o.odigosVersion,n)}),p=[];return i&&p.push({id:Do(),tooltip:u?Oe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:vi,disabled:!u,onClick:()=>xu(e,i)}),l&&p.push({id:Do(),tooltip:Oe.ADD_DESTINATION,rightIcon:pi,onClick:()=>xu(e,l)}),s&&p.push({id:Do(),tooltip:Oe.ADD_ACTION,rightIcon:ui,onClick:()=>xu(e,s)}),r&&p.push({id:Do(),tooltip:Oe.ADD_INSTRUMENTATION_RULE,rightIcon:bi,onClick:()=>xu(e,r)}),c&&p.push({id:Do(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ci,disabled:!d,onClick:()=>xu(e,c)}),p}},ku=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:m,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:k,createInstrumentationRule:I})=>{const $=f(),{isVm:E}=y(),{formatTimeAgo:N}=Et(),[O,A]=l(!1),[D,R]=l(a||[]),P=c(async()=>{try{A(!0),R(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{D.length||P()},[]);const[F,L]=l(""),[_,B]=l(null),[z,M]=l([]),X=r(()=>_===Cu.BulkConfig?u:_===Cu.BulkSource?g:0,[_,u,g]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===pe.Success,n=T(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===Cu.Delete)return;const e=z.filter(e=>!U.includes(e));e.length&&M(t=>t.filter(t=>!e.includes(t)))},[_,z.length,U.length]);const H=r(()=>D.filter(e=>!F||e.name.toLowerCase().includes(F.toLowerCase())).map(e=>({cells:[{key:Su.Id,rawValue:e.id},{key:Su.Name,rawValue:e.name},{key:Su.Type,rawValue:e.type},{key:Su.Status,rawValue:e.status,component:()=>(e=>{const o=e===pe.Success?"Connection live":"Connection lost",n=e===pe.Success?mi:fi;return t(Ie,{status:e,label:o,leftIcon:n})})(e.status)},{key:Su.OdigosVersion,rawValue:e.odigosVersion},{key:Su.ConnectedSince,rawValue:e.connectedAt?N(e.connectedAt):"-"},{key:Su.LastActivity,rawValue:e.lastSeenAt?N(e.lastSeenAt):"-"}],onClick:e.status!==pe.Success||_?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>M(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>M(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==pe.Success||_===Cu.BulkConfig&&!T(e.odigosVersion,u)||_===Cu.BulkSource&&!T(e.odigosVersion,g)})),[D,z,F,_,u,g]),j=r(()=>{const e=(e,t)=>{M([e]),B(t)};return Tu({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Cu.Delete),onAddSource:!E&&m&&b?t=>e(t,Cu.BulkSource):void 0,onAddDestination:!E&&v&&C&&w?t=>e(t,Cu.BulkDestination):void 0,onAddAction:!E&&k?t=>e(t,Cu.BulkAction):void 0,onAddInstrumentationRule:!E&&I?t=>e(t,Cu.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&p&&h?t=>e(t,Cu.BulkConfig):void 0})},[E,D,u,p,h,g,m,b,v,C,w,k,I]),W=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Do(),type:zt.Button,buttonProps:{variant:te.Primary,size:ee.S,label:"Add Sources",rightIcon:vi,onClick:o}});const r=[n?{id:Cu.BulkDestination,label:Oe.ADD_DESTINATION,icon:pi}:null,a?{id:Cu.BulkAction,label:Oe.ADD_ACTION,icon:ui}:null,i?{id:Cu.BulkInstrumentationRule,label:Oe.ADD_INSTRUMENTATION_RULE,icon:bi}:null,l?{id:Cu.BulkConfig,label:"Manage Configurations",icon:Ci}:null];return r.some(Boolean)&&s.push({id:Do(),type:zt.ButtonDropData,buttonProps:{variant:te.Secondary,size:ee.S,label:"Bulk Operations",onClick:e=>{e===Cu.BulkSource?o?.():e===Cu.BulkDestination?n?.():e===Cu.BulkAction?a?.():e===Cu.BulkInstrumentationRule?i?.():e===Cu.BulkConfig&&l?.()}},dropDataProps:{alignX:Ao.Left,items:r}}),s.push({id:Do(),type:zt.Button,buttonProps:{variant:te.Text,size:ee.S,label:ht.CANCEL,onClick:t}}),s})({onCancel:()=>M([]),onAddSource:!E&&m&&b?()=>B(Cu.BulkSource):void 0,onAddDestination:!E&&v&&C&&w?()=>B(Cu.BulkDestination):void 0,onAddAction:!E&&k?()=>B(Cu.BulkAction):void 0,onAddInstrumentationRule:!E&&I?()=>B(Cu.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&p&&h?()=>B(Cu.BulkConfig):void 0}),[E,p,h,m,b,v,C,w,k,I]);return t(ia,{children:e(Me,{richTitle:{icon:ji,title:Oe.CONNECTIONS,badge:{label:D.length.toString(),status:nt.Unknown}},search:{placeholder:"Search by cluster name",value:F,onChange:e=>L(e),width:"300px"},actions:[{id:Do(),type:zt.Button,buttonProps:{variant:te.Secondary,size:ee.S,leftIcon:Ti,onClick:P,disabled:O}}],children:[t(lo,{variant:so.Pretty,maxHeight:o,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:O,withCheckboxes:!0,columns:wu,rows:H,rowActionsPushRightPosition:_?`calc(${fl} - 24px)`:void 0,getRowActions:j}),_===Cu.BulkConfig&&p&&h&&t(er,{onClose:()=>B(null),connections:V,selectedConnectionIds:z,setSelectedConnectionIds:M,getEffectiveConfig:p,onApply:h}),_===Cu.BulkSource&&m&&b&&t(Al,{selectedConnectionIds:z,children:t(qs,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,getAllClusterSnapshots:m,persistSources:async e=>await(b?.(e))})}),_===Cu.BulkDestination&&v&&C&&S&&w&&x&&t(Dl,{children:t(Os,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,z),createDestination:e=>w(e,z),updateDestination:(e,t)=>x(e,t,z)})}),_===Cu.BulkAction&&k&&t(Rl,{children:t(Cs,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,createAction:e=>k(e,z)})}),_===Cu.BulkInstrumentationRule&&I&&t(Pl,{children:t(As,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,createInstrumentationRule:e=>I(e,z)})}),t(pl,{target:"connection",isOpen:_===Cu.Delete,onClose:()=>{M([]),B(null)},onApprove:async()=>{const e=z[0];e&&(await d(e),await P())}}),t(la,{isOpen:!!z.length&&!_,richTitle:{icon:ai,title:"Selected Clusters",badge:{label:z.length}},actions:W})]})})},Iu=m.div`
|
|
562
|
+
`,Qu=["50","25","10","1","0.1"],ep=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Qu.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(V,{$gap:8,children:[t(Q,{size:te.XS,color:l.v2.colors.white[500],children:i}),t(Zu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},tp=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(yu,{title:ta,onBack:s}),e(mu,{$width:854,children:[t(Au,{children:oa}),e(V,{$gap:8,$width:"100%",children:[e(Su,{children:[t(qu,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:na})}),t(ku,{items:[aa,ia,la,ra,sa]}),t($u,{message:Kn})]}),e(Eu,{children:[e(Iu,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:ca}),t(Oi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Nu,{children:t(uu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Nu,{children:t(ep,{value:l,onChange:r,label:da})})]})]})]}),t(bu,{onNext:c,nextLoading:d})]})},op=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:c,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=r("welcome"),[g,m]=r(!0),[f,b]=r("keep-list"),[v,y]=r(!0),[C,S]=r("25"),[w,x]=r(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=l(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(c(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,c,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(_u,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Du,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(Wu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(tp,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(Ju,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(Ku,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(Pu,{onClose:o})}return t(Vo,{isOpen:e,onClose:o,children:T})};var np,ap;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(np||(np={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ap||(ap={}));const ip=[{key:ap.Name,label:"Name"},{key:ap.Type,label:"Type",textAlign:"right"},{key:ap.Status,label:"Status"},{key:ap.OdigosVersion,label:"Odigos Version"},{key:ap.ConnectedSince,label:"Connected Since"},{key:ap.LastActivity,label:"Last Activity"}],lp=(e,t)=>{const o=e.find(e=>e.key===ap.Id)?.rawValue;return t(o?.toString()||"")},rp=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ap.Status)?.rawValue===we.Success)(e))return[{id:Mo(),label:"Delete Connection",rightIcon:ui,onClick:()=>lp(e,a)}];const d=lp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=lp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Mo(),tooltip:u?Be.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:xi,disabled:!u,onClick:()=>lp(e,i)}),l&&p.push({id:Mo(),tooltip:Be.ADD_DESTINATION,rightIcon:bi,onClick:()=>lp(e,l)}),r&&p.push({id:Mo(),tooltip:Be.ADD_ACTION,rightIcon:fi,onClick:()=>lp(e,r)}),s&&p.push({id:Mo(),tooltip:Be.ADD_INSTRUMENTATION_RULE,rightIcon:wi,onClick:()=>lp(e,s)}),c&&p.push({id:Mo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ti,disabled:!d,onClick:()=>lp(e,c)}),p}},sp=({connections:o,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,getEffectiveConfig:u,applyConfigurations:p,snapshotMinSupportedVersion:h=0,getAllClusterSnapshots:g,persistSources:m,getDestinationCategories:b,getPotentialDestinations:v,testConnection:C,createDestination:S,updateDestination:w,createAction:x,createInstrumentationRule:T})=>{const $=f(),{isVm:E}=y(),{formatTimeAgo:I}=Lt(),[N,A]=r(!1),[O,D]=r(o||[]),R=l(async()=>{try{A(!0),D(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{O.length||R()},[]);const[P,F]=r(""),[L,_]=r(null),[z,B]=r([]),M=a(()=>L===np.BulkConfig?d:L===np.BulkSource?h:0,[L,d,h]),{supportedConnections:X,supportedConnectionIds:V}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===we.Success,n=k(e.odigosVersion,t);return o&&n}))(O,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[O.length,M]);n(()=>{if(!L||L===np.Delete)return;const e=z.filter(e=>!V.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[L,z.length,V.length]);const U=a(()=>O.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:ap.Id,rawValue:e.id},{key:ap.Name,rawValue:e.name},{key:ap.Type,rawValue:e.type},{key:ap.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?Ci:Si;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:ap.OdigosVersion,rawValue:e.odigosVersion},{key:ap.ConnectedSince,rawValue:e.connectedAt?I(e.connectedAt):"-"},{key:ap.LastActivity,rawValue:e.lastSeenAt?I(e.lastSeenAt):"-"}],onClick:e.status!==we.Success||L?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==we.Success||L===np.BulkConfig&&!k(e.odigosVersion,d)||L===np.BulkSource&&!k(e.odigosVersion,h)})),[O,z,P,L,d,h]),H=a(()=>{const e=(e,t)=>{B([e]),_(t)};return rp({connections:O,configMinSupportedVersion:d,snapshotMinSupportedVersion:h,onDelete:t=>e(t,np.Delete),onAddSource:!E&&g&&m?t=>e(t,np.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?t=>e(t,np.BulkDestination):void 0,onAddAction:!E&&x?t=>e(t,np.BulkAction):void 0,onAddInstrumentationRule:!E&&T?t=>e(t,np.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&u&&p?t=>e(t,np.BulkConfig):void 0})},[E,O,d,u,p,h,g,m,b,v,S,x,T]),G=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:"Add Sources",rightIcon:xi,onClick:o}});const s=[n?{id:np.BulkDestination,label:Be.ADD_DESTINATION,icon:bi}:null,a?{id:np.BulkAction,label:Be.ADD_ACTION,icon:fi}:null,i?{id:np.BulkInstrumentationRule,label:Be.ADD_INSTRUMENTATION_RULE,icon:wi}:null,l?{id:np.BulkConfig,label:"Manage Configurations",icon:Ti}:null];return s.some(Boolean)&&r.push({id:Mo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"Bulk Operations",onClick:e=>{e===np.BulkSource?o?.():e===np.BulkDestination?n?.():e===np.BulkAction?a?.():e===np.BulkInstrumentationRule?i?.():e===np.BulkConfig&&l?.()}},dropDataProps:{alignX:Bo.Left,items:s}}),r.push({id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:St.CANCEL,onClick:t}}),r})({onCancel:()=>B([]),onAddSource:!E&&g&&m?()=>_(np.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?()=>_(np.BulkDestination):void 0,onAddAction:!E&&x?()=>_(np.BulkAction):void 0,onAddInstrumentationRule:!E&&T?()=>_(np.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&u&&p?()=>_(np.BulkConfig):void 0}),[E,u,p,g,m,b,v,S,x,T]);return t(ua,{children:e(Ye,{fullHeight:!0,richTitle:{icon:Ji,title:Be.CONNECTIONS,badge:{label:O.length.toString(),status:pt.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>F(e),width:"300px"},actions:[{id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:R,disabled:N}}],children:[t(mo,{variant:fo.Pretty,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:ip,rows:U,rowActionsPushRightPosition:L?`calc(${wl} - 24px)`:void 0,getRowActions:H}),L===np.BulkConfig&&u&&p&&t(Ps,{onClose:()=>_(null),connections:X,selectedConnectionIds:z,setSelectedConnectionIds:B,getEffectiveConfig:u,onApply:p}),L===np.BulkSource&&g&&m&&t(_l,{selectedConnectionIds:z,children:t(Os,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(m?.(e))})}),L===np.BulkDestination&&b&&v&&C&&S&&w&&t(zl,{children:t(ds,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getDestinationCategories:b,getPotentialDestinations:v,testConnection:e=>C(e,z),createDestination:e=>S(e,z),updateDestination:(e,t)=>w(e,t,z)})}),L===np.BulkAction&&x&&t(Bl,{children:t(es,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createAction:e=>x(e,z)})}),L===np.BulkInstrumentationRule&&T&&t(Ml,{children:t(us,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createInstrumentationRule:e=>T(e,z)})}),t(vl,{target:"connection",isOpen:L===np.Delete,onClose:()=>{B([]),_(null)},onApprove:async()=>{const e=z[0];e&&(await c(e),await R())}}),t(pa,{isOpen:!!z.length&&!L,richTitle:{icon:si,title:"Selected Clusters",badge:{label:z.length}},actions:G})]})})},cp=m.div`
|
|
436
563
|
display: flex;
|
|
437
564
|
align-items: center;
|
|
438
565
|
justify-content: space-between;
|
|
@@ -441,26 +568,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
441
568
|
width: calc(100% - 32px);
|
|
442
569
|
border-radius: 16px;
|
|
443
570
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
444
|
-
|
|
571
|
+
`,dp=m.div`
|
|
445
572
|
display: flex;
|
|
446
573
|
align-items: center;
|
|
447
574
|
justify-content: center;
|
|
448
575
|
padding: 8px;
|
|
449
576
|
border-radius: 8px;
|
|
450
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
451
|
-
`,
|
|
577
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
|
|
578
|
+
`,up=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||ut.Namespace,l=i===ut.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(cp,{children:[t(Q,{nowrap:!0,children:l}),t(Fe,{label:i,status:we.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=lt(o.option.type).icon;return e(cp,{children:[e(oe,{$gap:8,children:[a&&t(dp,{children:t(a,{size:24})}),t(Q,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Fe,{status:o.testResult.succeeded?we.Success:we.Error,leftIcon:o.testResult.succeeded?Ci:Si})]},`destination-${n}`)})||[],[l]);return t(bl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Ei,title:Be.SUMMARY,subTitle:Be.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(xi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_SOURCES}),t(Fe,{label:u.length})]}),t(ne,{"data-id":"summary-edit-sources",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:c})]}),list:u.length?u:[t(Qe,{$height:"100%",children:t(me,{icon:xi,title:Be.NO_SOURCES_SELECTED,subTitle:Be.ADD_SOURCE_PROMPT,button:{leftIcon:li,label:Be.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(bi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_DESTINATIONS}),t(Fe,{label:p.length})]}),t(ne,{"data-id":"summary-edit-destinations",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:d})]}),list:p.length?p:[t(Qe,{"data-id":"summary-no-destinations",$height:"100%",children:t(me,{icon:bi,title:Be.NO_DESTINATIONS_SELECTED,subTitle:Be.ADD_DESTINATION_PROMPT,button:{leftIcon:li,label:Be.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},pp=m.div`
|
|
452
579
|
position: relative;
|
|
453
580
|
overflow: hidden;
|
|
454
581
|
width: calc(100vw - ${({$paddingXAxis:e})=>e});
|
|
455
582
|
height: calc(100vh - ${({$paddingYAxis:e})=>e});
|
|
456
583
|
box-sizing: border-box;
|
|
457
|
-
`,
|
|
584
|
+
`,hp=m.svg`
|
|
458
585
|
position: absolute;
|
|
459
586
|
top: 50%;
|
|
460
587
|
left: 50%;
|
|
461
588
|
transform: translate(-50%, -50%);
|
|
462
589
|
z-index: -1;
|
|
463
|
-
`,
|
|
590
|
+
`,gp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],mp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:gp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:gp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:gp}],fp=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/mp[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(pp,{$paddingXAxis:o,$paddingYAxis:i,children:[mp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(hp,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},bp=m.div`
|
|
464
591
|
display: flex;
|
|
465
592
|
flex-direction: column;
|
|
466
593
|
align-items: center;
|
|
@@ -471,7 +598,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
471
598
|
width: 50vw;
|
|
472
599
|
border-radius: 16px;
|
|
473
600
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
474
|
-
`,
|
|
601
|
+
`,vp=m.div`
|
|
475
602
|
display: flex;
|
|
476
603
|
flex-direction: column;
|
|
477
604
|
align-items: center;
|
|
@@ -481,15 +608,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
481
608
|
& * {
|
|
482
609
|
text-align: center;
|
|
483
610
|
}
|
|
484
|
-
`,
|
|
611
|
+
`,yp=({onStart:o})=>t(q,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Qe,{$height:"100%",children:e(bp,{children:[e(vp,{children:[t(Q,{size:te.L,weight:500,children:Be.GET_STARTED_WITH}),t(Sl,{size:260}),t(Q,{size:te.S,weight:400,children:Be.GET_STARTED_DESCRIPTION})]}),t(ne,{"data-id":"onboarding-get-started",label:St.GET_STARTED,rightIcon:ri,size:ae.L,onClick:o})]})})}),Cp=[{step:1,label:Be.INSTALLATION,forceDoneBadge:!0},{step:2,label:Be.SOURCES_SETUP},{step:3,label:Be.DESTINATIONS_SETUP},{step:4,label:Be.SUMMARY}],Sp=m.div`
|
|
485
612
|
display: flex;
|
|
486
613
|
flex-direction: column;
|
|
487
614
|
gap: 32px;
|
|
488
615
|
padding: 64px;
|
|
489
|
-
`,
|
|
616
|
+
`,wp=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:l,getPotentialDestinations:s,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Xo(),[g,m]=r(1),[f,b]=r(!1),[v,y]=r(null),[C,S]=r(null),w=()=>m(e=>e+1),x=()=>m(e=>e-1);return e(fp,{paddingXAxis:o,paddingYAxis:n,children:[e(Sp,{children:[t(Sl,{useInline:!0}),t(ha,{currentStep:g,data:Cp,gap:32})]}),t(_l,{initialInputs:v,children:e(zl,{children:[1===g&&t(yp,{onStart:w}),2===g&&t(Os,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(ds,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:l,getPotentialDestinations:s,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===g&&t(up,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(ru),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},xp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),kp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Tp=m.div`
|
|
490
617
|
position: relative;
|
|
491
618
|
display: inline-flex;
|
|
492
|
-
|
|
619
|
+
`,$p=m.button`
|
|
493
620
|
display: inline-flex;
|
|
494
621
|
align-items: center;
|
|
495
622
|
gap: 8px;
|
|
@@ -502,7 +629,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
502
629
|
&:hover {
|
|
503
630
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
504
631
|
}
|
|
505
|
-
`,
|
|
632
|
+
`,Ep=m.div`
|
|
506
633
|
position: absolute;
|
|
507
634
|
top: calc(100% + 8px);
|
|
508
635
|
right: 0;
|
|
@@ -515,28 +642,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
515
642
|
border-radius: 12px;
|
|
516
643
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
517
644
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
518
|
-
`,
|
|
645
|
+
`,Ip=m.div`
|
|
519
646
|
display: flex;
|
|
520
647
|
flex-direction: column;
|
|
521
648
|
gap: 12px;
|
|
522
649
|
padding: 16px;
|
|
523
650
|
max-height: 60vh;
|
|
524
651
|
overflow-y: auto;
|
|
525
|
-
`,
|
|
652
|
+
`,Np=m.div`
|
|
526
653
|
display: flex;
|
|
527
654
|
align-items: center;
|
|
528
655
|
gap: 8px;
|
|
529
656
|
padding: 12px 16px;
|
|
530
657
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
531
|
-
`,
|
|
658
|
+
`,Ap=m.div`
|
|
532
659
|
display: flex;
|
|
533
660
|
align-items: center;
|
|
534
661
|
gap: 8px;
|
|
535
662
|
margin-left: auto;
|
|
536
|
-
`,
|
|
663
|
+
`,Op=()=>{const o=f(),l=ct(e=>e.sources),s=ct(e=>e.namespaces),{selectedStreamName:c}=Me(),{getItemSS:d,setItemSS:u,removeItemSS:p}=va(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ga(),x=a(()=>ma(l,c),[l,c]);n(()=>{const e=d(fa.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=r({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=r(kp(k)),[I,N]=r(!1);n(()=>{if(!I){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),E(kp(e))}},[I,h,g,m,b,v,y]);const A=i(null);ro(A,()=>N(!1)),Fo({key:"Escape",active:I},()=>N(!1));const O=a(()=>{const e=new Set,t=[];return s.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[s]),D=a(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=a(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Le[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),P=a(()=>ba.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ot(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?vi:yi,z=a(()=>xp(k.languages),[k.languages]);return e(Tp,{ref:A,children:[e($p,{"data-id":"filters-trigger",$isOpen:I,type:"button",onClick:()=>N(e=>!e),children:[t(qi,{size:16,fill:o.v2.colors.white[500]}),t(Q,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Fe,{label:$,status:pt.Unknown,textSize:te.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),I&&e(Ep,{children:[e(Ip,{children:[t(tt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:xp(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(tt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:xp(k.kinds),setValues:e=>L("kinds",D,e)}),t(tt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:z,setValues:e=>L("languages",R,e)}),t(tt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:xp(k.monitors),setValues:e=>L("monitors",P,e)}),t(tt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:xp(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:gt.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Np,{children:[t(ne,{"data-id":"filters-reset",size:ae.S,variant:ie.Text,label:"Reset",onClick:()=>{p(fa.OVERVIEW_FILTERS),S(),T(w()),E(0),N(!1)},textColor:o.v2.colors.red[500]}),e(Ap,{children:[t(ne,{"data-id":"filters-cancel",size:ae.S,variant:ie.Secondary,label:"Cancel",onClick:()=>N(!1)}),t(ne,{"data-id":"filters-apply",size:ae.S,variant:ie.Primary,label:"Apply",onClick:()=>{u(fa.OVERVIEW_FILTERS,k),C(k),E(kp(k)),N(!1)}})]})]})]})]})},Dp="40vw",Rp=m.div`
|
|
537
664
|
position: relative;
|
|
538
|
-
width: ${
|
|
539
|
-
`,
|
|
665
|
+
width: ${Dp};
|
|
666
|
+
`,Pp=m.div`
|
|
540
667
|
position: absolute;
|
|
541
668
|
top: calc(100% + 8px);
|
|
542
669
|
left: 0;
|
|
@@ -545,23 +672,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
545
672
|
flex-direction: column;
|
|
546
673
|
gap: 8px;
|
|
547
674
|
padding: 8px;
|
|
548
|
-
width: calc(${
|
|
675
|
+
width: calc(${Dp} - 16px);
|
|
549
676
|
border-radius: 12px;
|
|
550
677
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
551
678
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
552
|
-
`,
|
|
679
|
+
`,Fp=m.div`
|
|
553
680
|
display: flex;
|
|
554
681
|
align-items: center;
|
|
555
682
|
overflow-x: auto;
|
|
556
|
-
`,
|
|
683
|
+
`,Lp=m.div`
|
|
557
684
|
display: flex;
|
|
558
685
|
flex-direction: column;
|
|
559
686
|
gap: 0;
|
|
560
687
|
max-height: 60vh;
|
|
561
688
|
overflow-y: auto;
|
|
562
|
-
`,
|
|
689
|
+
`,_p=m.div`
|
|
563
690
|
padding: 8px 12px 4px 12px;
|
|
564
|
-
`,
|
|
691
|
+
`,zp=m.div`
|
|
565
692
|
display: flex;
|
|
566
693
|
align-items: center;
|
|
567
694
|
gap: 8px;
|
|
@@ -571,9 +698,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
571
698
|
&:hover {
|
|
572
699
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
573
700
|
}
|
|
574
|
-
`,
|
|
701
|
+
`,Bp=m.div`
|
|
575
702
|
padding: 16px 8px;
|
|
576
|
-
`,
|
|
703
|
+
`,Mp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=ya(),{searchText:c,setSearchText:d}=ga(),{selectedStreamName:u}=Me(),p=ct(e=>e.sources),h=ct(e=>e.destinations),g=ct(e=>e.actions),m=ct(e=>e.instrumentationRules),b=i(null),[v,y]=r(!1),[C,S]=r("all"),w=!o&&(!!c||v),x=()=>{d(""),y(!1),S("all")};ro(b,()=>x()),Fo({key:"Escape",active:w},x);const{categories:k,searchResults:T}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:ut.Source,label:"Sources",count:r.length,entities:[]},{category:ut.Action,label:"Actions",count:s.length,entities:[]},{category:ut.Destination,label:"Destinations",count:c.length,entities:[]},{category:ut.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===ut.InstrumentationRule?l:e.category===ut.Source?r:e.category===ut.Action?s:e.category===ut.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:m,sources:ma(p,u),actions:g,destinations:Nt(h,u),searchText:c,selectedCategory:C}),[m,p,g,h,u,c,C]),$=a(()=>k.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[k]),E=T.some(({entities:e})=>e.length>0);return e(Rp,{ref:b,children:[t(Kt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>y(!0),width:Dp}),w&&e(Pp,{children:[$.length>1&&t(Fp,{children:t(le,{options:$,selected:C,setSelected:S})}),E?t(Lp,{children:T.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Sa(o);return e(s,{children:[t(_p,{children:t(Q,{size:te.XXS,color:ee.Secondary,children:a})}),i.map((a,i)=>e(zp,{onClick:()=>{const e=Ct(a);l(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(Q,{size:te.XS,nowrap:!0,children:Ca(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(Bp,{children:t(me,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Xp=m.div`
|
|
577
704
|
position: relative;
|
|
578
705
|
display: flex;
|
|
579
706
|
align-items: center;
|
|
@@ -584,7 +711,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
584
711
|
box-sizing: border-box;
|
|
585
712
|
border-radius: 16px 16px 0 0;
|
|
586
713
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
587
|
-
`,
|
|
714
|
+
`,Vp=m.div`
|
|
588
715
|
position: absolute;
|
|
589
716
|
bottom: 0;
|
|
590
717
|
left: 0;
|
|
@@ -593,7 +720,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
593
720
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
594
721
|
border-radius: 32px;
|
|
595
722
|
transition: width 0.3s;
|
|
596
|
-
`,
|
|
723
|
+
`,Up=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Xo();return e(Xp,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:wa.S,partiallyChecked:r,value:!!s,onChange:c}),t(Q,{size:te.S,nowrap:!0,children:`${Ot(o)}s`}),t(Fe,{label:n,tooltip:a,status:pt.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(ot,{"data-id":`add-${o}`,icon:li,onClick:()=>u(o)}),t(ot,{"data-id":`refresh-${o}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(Vp,{$percent:d})]})},Hp=m(V)`
|
|
597
724
|
align-items: center !important;
|
|
598
725
|
justify-content: center !important;
|
|
599
726
|
align-self: stretch;
|
|
@@ -608,7 +735,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
608
735
|
&:hover {
|
|
609
736
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
610
737
|
}
|
|
611
|
-
`,
|
|
738
|
+
`,Gp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Xo();return e(Hp,{onClick:()=>a(o),children:[e(oe,{$gap:4,children:[t(li,{size:16}),t(Q,{size:te.S,children:`Add ${Ot(o)}`})]}),t(Q,{size:te.XXS,align:"center",children:n})]})},jp=m.div`
|
|
612
739
|
display: flex;
|
|
613
740
|
align-items: center;
|
|
614
741
|
gap: 12px;
|
|
@@ -623,10 +750,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
623
750
|
&:hover {
|
|
624
751
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
625
752
|
}
|
|
626
|
-
`,
|
|
753
|
+
`,Wp=m(oe)`
|
|
627
754
|
flex: 1;
|
|
628
755
|
min-width: 0;
|
|
629
|
-
`,
|
|
756
|
+
`,Kp=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===ut.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Jt(),{selectedSources:w,setSelectedSources:x}=xa(),k=g,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),E=v&&!h?ka(we.Info,m):l?ka(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(jp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:wa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(eo,{icons:u,icon:d,iconSrc:p}),e(Wp,{$gap:4,children:[t(fe,{size:te.XS,nowrap:!0,children:i}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Fe,{label:c,status:l&&[we.Error,we.Warning].includes(l)?l:pt.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function Yp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ht.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Bt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Jp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Ht.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const qp=m.div`
|
|
630
757
|
position: absolute;
|
|
631
758
|
top: 0;
|
|
632
759
|
left: 0;
|
|
@@ -637,22 +764,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
637
764
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
638
765
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
639
766
|
pointer-events: none;
|
|
640
|
-
`,
|
|
767
|
+
`,Zp=m.div`
|
|
641
768
|
display: flex;
|
|
642
769
|
align-items: center;
|
|
643
770
|
gap: 8px;
|
|
644
771
|
padding: 4px 8px 0;
|
|
645
|
-
`,
|
|
772
|
+
`,Qp=m.div`
|
|
646
773
|
flex: 1;
|
|
647
774
|
height: 1px;
|
|
648
775
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
649
|
-
`,
|
|
776
|
+
`,eh=({namespace:e})=>{const o=f();return t(qp,{children:t(Q,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},th=({namespace:o})=>{const n=f();return e(Zp,{children:[t(Qp,{}),t(Q,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Qp,{})]})},oh={[ut.InstrumentationRule]:Be.NO_DATA_INSTRUMENTATION_RULES,[ut.Source]:Be.NO_DATA_SOURCES,[ut.Action]:Be.NO_DATA_ACTIONS,[ut.Destination]:Be.NO_DATA_DESTINATIONS},nh=m.div`
|
|
650
777
|
display: flex;
|
|
651
778
|
flex-direction: column;
|
|
652
779
|
flex: 1 0 0;
|
|
653
780
|
min-width: 0;
|
|
654
781
|
${({$isVm:e})=>e?"width: 45vw;":""}
|
|
655
|
-
`,
|
|
782
|
+
`,ah=m.div`
|
|
656
783
|
display: flex;
|
|
657
784
|
flex-direction: column;
|
|
658
785
|
align-items: stretch;
|
|
@@ -662,7 +789,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
662
789
|
border-radius: 0 0 16px 16px;
|
|
663
790
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
664
791
|
overflow: hidden;
|
|
665
|
-
`,
|
|
792
|
+
`,ih=m.div`
|
|
666
793
|
position: relative;
|
|
667
794
|
display: flex;
|
|
668
795
|
flex-direction: column;
|
|
@@ -674,16 +801,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
674
801
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
675
802
|
height: ${({$height:e})=>e}px;
|
|
676
803
|
overflow: hidden;
|
|
677
|
-
`,
|
|
804
|
+
`,lh=(e,t,o,n)=>{const a=Ct(e);if(!a)return null;const i=t===ut.Source;let l,r,s=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Bt.Failure:return{status:we.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Bt.Notice:return{status:we.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Bt.Pending:case Bt.Waiting:return{status:void 0,faded:!1,displaySource:Yp(e)};case Bt.Unsupported:case Bt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Jp(e)}}}(e);l=t.status,s=t.faded,r=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=$a(e.conditions);l=t,s=o}const d=Ca(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ut.Source:{u=Qt(e),p=Sa(ut.Source);const t=n?.get(Ea(a));g=no(t);break}case ut.Destination:{const t=lt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(Ea(a));g=no(o),m=!e.disabled;break}case ut.Action:p=Tt(e.type),m=!e.disabled;break;case ut.InstrumentationRule:p=Ft(e.type),m=!e.disabled}return{key:Ea(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:s,tooltip:r,throughput:g,icon:p,icons:u,iconSrc:h,isActive:m,raw:c}}},rh=({entityType:o,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===ut.Source,m=i.length!==s,f=ft(e=>g?e.progress[bt.Instrumenting]?.percentage:void 0),b=ft(e=>g?e.progress[bt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=xa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===ut.Source?c.sources:o===ut.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Ta(o),o.throughput);return e},[c,o]),k=a(()=>i.map(e=>lh(e,o,0,x)).filter(Boolean),[i,o,x,h]),[T,$]=r(""),{elements:E,indexToNamespace:I,multipleNs:N,dividerCount:A}=a(()=>{const e=[],o=[],n=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of k)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(th,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(Kp,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[k,g]);n(()=>{if(g&&I.length&&!T){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==T&&$(t)},[I,T]);if(h&&[ut.InstrumentationRule,ut.Action].includes(o))return null;const D=58*k.length+(N?28:0)+32*A,R=Math.max(0,u-52-16),P=Math.min(R,D)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${s}`:s;return e(nh,{$isVm:h,children:[t(Up,{entityType:o,badge:F,badgeTooltip:m?Be.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(ah,{children:i.length?e(ih,{$height:P,children:[N&&T&&t(eh,{namespace:T}),t(Yt,{gap:4,elements:E,onTopIndexChange:N?O:void 0})]}):d?t(oo,{size:3}):t(Gp,{entityType:o,description:oh[o]??Be.TO_COLLECT_OTEL_DATA})})]})},sh=m.div`
|
|
678
805
|
width: 100%;
|
|
679
|
-
|
|
806
|
+
flex: 1;
|
|
807
|
+
min-height: 0;
|
|
808
|
+
height: 100%;
|
|
680
809
|
display: flex;
|
|
681
810
|
align-items: stretch;
|
|
682
811
|
gap: 16px;
|
|
683
|
-
`,
|
|
812
|
+
`,ch=({metrics:o,refetchSources:n,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r})=>{const s=ga(),{selectedStreamName:c}=Me(),{containerRef:d,containerHeight:u}=Ia(),p=ct(e=>e.sources),h=ct(e=>e.sourcesLoading),g=ct(e=>e.destinations),m=ct(e=>e.destinationsLoading),f=ct(e=>e.actions),b=ct(e=>e.actionsLoading),v=ct(e=>e.instrumentationRules),y=ct(e=>e.instrumentationRulesLoading),C=a(()=>ma(p,c),[p,c]),S=a(()=>Nt(g,c),[g,c]),w=a(()=>Na(C,s),[C,s]),x=a(()=>Aa(S,s),[S,s]),k=a(()=>Oa(f,s),[f,s]);return e(sh,{ref:d,children:[t(rh,{entityType:ut.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:u,refetch:r}),t(rh,{entityType:ut.Source,entities:w,unfilteredCount:C.length,metrics:o,loading:h,maxHeight:u,refetch:n}),t(rh,{entityType:ut.Action,entities:k,unfilteredCount:f.length,loading:b,maxHeight:u,refetch:l}),t(rh,{entityType:ut.Destination,entities:x,unfilteredCount:S.length,metrics:o,loading:m,maxHeight:u,refetch:i})]})},dh=({effectiveConfig:n,fetchNamespacesWithWorkloads:i,persistSources:l,restartWorkloads:r,restartPod:s,recoverFromRollback:c,updateSource:d,fetchSourceById:u,fetchPeerSources:p,enableProfiling:h,fetchProfilingSlots:g,fetchSourceProfiling:m,fetchK8sManifest:f,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,deleteDestination:w,createInstrumentationRule:x,updateInstrumentationRule:k,deleteInstrumentationRule:T,createAction:$,updateAction:E,deleteAction:I,workloads:N})=>{const{currentModal:A,setCurrentModal:O}=Xo(),{drawerType:D,drawerEntityId:R,setDrawerType:P,setDrawerEntityId:F}=Jt(),L=()=>{O(""),P(null),F(null)},_=a(()=>(N??[]).map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[N]),z=a(()=>Array.from(new Set((N??[]).map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[N]);return e(o,{children:[t(su,{}),A===ut.Source&&t(_l,{children:t(Os,{onClose:L,fetchNamespacesWithWorkloads:i,persistSources:l,withOverlay:!0})}),A===ut.Destination&&t(zl,{children:t(ds,{onClose:L,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,withOverlay:!0})}),A===ut.InstrumentationRule&&t(Ml,{sourceOptions:_,namespaceOptions:z,children:t(us,{onClose:L,createInstrumentationRule:x,withOverlay:!0})}),A===ut.Action&&t(Bl,{children:t(es,{onClose:L,createAction:$,withOverlay:!0})}),D===ut.Source&&R&&t(Xl,{children:t(Pd,{onClose:L,effectiveConfig:n,sourceId:R,persistSources:l,restartWorkloads:r,restartPod:s,recoverFromRollback:c,updateSource:d,fetchSourceById:u,fetchPeerSources:p,enableProfiling:h,fetchSourceProfiling:m,fetchProfilingSlots:g,fetchK8sManifest:f})}),D===ut.Destination&&R&&t(zl,{children:t(Ls,{onClose:L,destinationId:R,getDestinationCategories:b,testConnection:y,updateDestination:S,deleteDestination:w})}),D===ut.InstrumentationRule&&R&&t(Ml,{sourceOptions:_,namespaceOptions:z,children:t(zs,{onClose:L,ruleId:R,updateInstrumentationRule:k,deleteInstrumentationRule:T})}),D===ut.Action&&R&&t(Bl,{children:t(Rs,{onClose:L,actionId:R,updateAction:E,deleteAction:I})})]})},uh="multi-source-deselect",ph="multi-source-restart",hh="multi-source-uninstrument",gh="Selected sources",mh="Deselect",fh="Restart",bh="Uninstrument",vh="Rollout Restart Workloads",yh="Are you sure you want to rollout restart these workloads?",Ch="Go Back",Sh="Confirm",wh=({restartWorkloads:i,persistSources:s})=>{const{selectedStreamName:c}=Me(),{selectedSources:d,setSelectedSources:u}=xa(),[p,h]=r(!1),[g,m]=r(!1),f=a(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=l(()=>{u({})},[u]),v=l(()=>h(!1),[]),y=l(()=>m(!1),[]);n(()=>{b()},[c,b]);const C=l(()=>{i(Object.values(d).flat().filter(e=>e.id.kind!==to.StaticPod).map(qt)),b()},[i,d,b]),S=l(()=>{s(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:c}))]))),b()},[s,d,c,b]),w=a(()=>[{id:uh,type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:mh,onClick:b}},{id:ph,type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,label:fh,leftIcon:Vi,onClick:()=>h(!0)}},{id:hh,type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:bh,leftIcon:ii,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(pa,{isOpen:f>0,richTitle:{icon:xi,title:gh,badge:{label:f}},actions:w}),t(ze,{isOpen:p,title:vh,description:yh,onClose:v,denyButton:{label:Ch,variant:ie.Secondary,onClick:v},approveButton:{label:Sh,variant:ie.Primary,onClick:()=>{C(),v()}}}),t(vl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},xh=e=>`Data Stream: ${e}`,kh="Search streams...",Th="No streams match",$h=m.div`
|
|
684
813
|
position: relative;
|
|
685
814
|
display: inline-flex;
|
|
686
|
-
`,
|
|
815
|
+
`,Eh=m.div`
|
|
687
816
|
display: inline-flex;
|
|
688
817
|
align-items: center;
|
|
689
818
|
gap: 6px;
|
|
@@ -694,7 +823,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
694
823
|
&:hover {
|
|
695
824
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
696
825
|
}
|
|
697
|
-
`,
|
|
826
|
+
`,Ih=m.div`
|
|
698
827
|
position: absolute;
|
|
699
828
|
top: calc(100% + 8px);
|
|
700
829
|
left: 0;
|
|
@@ -708,18 +837,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
708
837
|
border-radius: 12px;
|
|
709
838
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
710
839
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
711
|
-
`,
|
|
840
|
+
`,Nh=m.div`
|
|
712
841
|
display: flex;
|
|
713
842
|
align-items: center;
|
|
714
843
|
gap: 8px;
|
|
715
844
|
width: 100%;
|
|
716
|
-
`,
|
|
845
|
+
`,Ah=m.div`
|
|
717
846
|
display: flex;
|
|
718
847
|
flex-direction: column;
|
|
719
848
|
gap: 0;
|
|
720
849
|
max-height: 240px;
|
|
721
850
|
overflow-y: auto;
|
|
722
|
-
`,
|
|
851
|
+
`,Oh=m.div`
|
|
723
852
|
display: flex;
|
|
724
853
|
align-items: center;
|
|
725
854
|
gap: 8px;
|
|
@@ -730,29 +859,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
730
859
|
&:hover {
|
|
731
860
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
732
861
|
}
|
|
733
|
-
`,
|
|
862
|
+
`,Dh=m.div`
|
|
734
863
|
flex: 1;
|
|
735
864
|
min-width: 0;
|
|
736
865
|
overflow: hidden;
|
|
737
866
|
text-overflow: ellipsis;
|
|
738
867
|
white-space: nowrap;
|
|
739
|
-
`,
|
|
868
|
+
`,Rh=m.div`
|
|
740
869
|
display: flex;
|
|
741
870
|
align-items: center;
|
|
742
871
|
gap: 2px;
|
|
743
872
|
flex-shrink: 0;
|
|
744
|
-
`,
|
|
873
|
+
`,Ph=m.div`
|
|
745
874
|
display: flex;
|
|
746
875
|
padding-top: 4px;
|
|
747
876
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
748
|
-
`,
|
|
877
|
+
`,Fh=({updateDataStream:l,deleteDataStream:s,createDataStream:c})=>{const d=f(),{isVm:u}=y(),{clearStore:p}=Da(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Me(),b=i(null),[v,C]=r(!1),[S,w]=r(""),[x,k]=r(""),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(!1),[O,D]=r(""),[R,P]=r(!1);ro(b,()=>C(!1)),n(()=>{v||w("")},[v]);const F=a(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?vi:yi;return u?null:e(o,{children:[e($h,{ref:b,children:[e(Eh,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Zi,{size:24}),t(Q,{size:te.S,weight:500,nowrap:!0,children:xh(g)}),t(Fe,{label:h.length,status:pt.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:d.v2.colors.silver[200]})]}),v&&e(Ih,{children:[t(Nh,{children:t(Kt,{value:S,onChange:w,placeholder:kh,width:"100%"})}),t(Ah,{children:0===F.length?t(Oh,{children:t(Q,{size:te.XS,color:ee.Secondary,children:Th})}):F.map(({name:o})=>{const n=o===Ra;return e(Oh,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(Dh,{children:t(Q,{size:te.XS,nowrap:!0,children:o})}),e(Rh,{children:[t(ot,{"data-id":`stream-edit-${o}`,icon:pi,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(ot,{"data-id":`stream-delete-${o}`,icon:ii,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(Ph,{children:t(ne,{"data-id":"add-stream-trigger",variant:ie.Secondary,size:ae.S,leftIcon:li,label:`${St.NEW} ${Be.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),I(!0)}})})]})]}),N&&t(Vl,{defaultExcludeName:g,children:t(nu,{isOpen:E,onClose:()=>I(!1),onCloseEnd:()=>A(!1),createDataStream:c})}),x&&t(Vl,{children:t(au,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:l})}),t(vl,{target:`${Be.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{O&&await s(O)}})]})},Lh=v`
|
|
749
878
|
0% {
|
|
750
879
|
background-position: 200% 50%;
|
|
751
880
|
}
|
|
752
881
|
100% {
|
|
753
882
|
background-position: 0% 50%;
|
|
754
883
|
}
|
|
755
|
-
`,
|
|
884
|
+
`,_h=m.div`
|
|
756
885
|
display: flex;
|
|
757
886
|
align-items: center;
|
|
758
887
|
justify-content: space-evenly;
|
|
@@ -763,44 +892,44 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
763
892
|
|
|
764
893
|
background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
|
|
765
894
|
background-size: 200% 100%;
|
|
766
|
-
animation: ${
|
|
767
|
-
`,
|
|
895
|
+
animation: ${Lh} 15s linear infinite;
|
|
896
|
+
`,zh=[wi,xi,fi,bi],Bh=({metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l,updateDataStream:r,deleteDataStream:c,createDataStream:d,...u})=>{const p=f();return e(ua,{children:[e(Ye,{fullHeight:!0,customTitle:t(Fh,{updateDataStream:r,deleteDataStream:c,createDataStream:d}),customSearch:t(Mp,{}),filters:t(Op,{}),children:[t(_h,{children:zh.map((o,n)=>e(s,{children:[t(o,{size:24}),n<zh.length-1&&t(mi,{fill:p.v2.colors.white[500]+qe["020"],size:24})]},o.name))}),t(ch,{metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l})]}),t(dh,{...u}),t(wh,{restartWorkloads:u.restartWorkloads,persistSources:u.persistSources})]})};var Mh;!function(e){e.Gateway="gateway",e.Node="node"}(Mh||(Mh={}));const Xh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Xi,size:ae.S,variant:ie.Text,onClick:o,disabled:l}}),n&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(Pa,{icon:Qi,title:"Collectors Pipeline"}),t(Fa,{actions:r})]})},Vh=({pod:o,getExtendedPodInfo:i,onClose:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null);n(()=>{o?i(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=a(()=>[{id:Mo(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Mo(),title:"Status",badge:{status:La(c?.status),label:c?.status??"-"}}],[c]),p=a(()=>c?.containers?.map(e=>({id:Mo(),items:[{id:Mo(),title:"Container",label:e.name??"-"},{id:Mo(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Mo(),title:"Ready",badge:{status:e.ready?we.Success:we.Error,leftIcon:e.ready?si:ci,label:e.ready?"True":"False",invertColors:!0}},{id:Mo(),title:"Started",badge:{status:e.started?we.Success:we.Error,leftIcon:e.started?si:ci,label:e.started?"True":"False",invertColors:!0}},{id:Mo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Mo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Mo(),title:Be.RESTARTS,label:e.restarts.toString()},{id:Mo(),title:"State Reason",label:e.stateReason??"-"},{id:Mo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Mo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(q,{isOpen:!!o,header:{icon:$i,title:"Pod Information",onClose:l},children:c?e(xt,{bgTint:"1000",richTitle:{icon:$i,title:c.name,withCopy:!0},children:[t(xt,{bgTint:"900",cellsPerRow:2,items:u}),e(xt,{bgTint:"900",richTitle:{icon:Fi,title:Be.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(jt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(jt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(jt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(me,{title:"No containers",subTitle:"Pod has no containers"})}),t(Cl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})})})};var Uh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Uh||(Uh={}));const Hh=e=>{const t=[{key:Uh.PodName,label:"Pod Name"},{key:Uh.Status,label:"Status"},{key:Uh.Restarts,label:Be.RESTARTS},{key:Uh.NodeName,label:"Node Name"},{key:Uh.Age,label:"Age"},{key:Uh.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Uh.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Gh=({isLoading:o,pods:n,getExtendedPodInfo:i,withSpanDropRate:l})=>{const s=f(),{formatTimeAgo:c}=Lt(),[d,u]=r(null),p=a(()=>n.map(o=>({onClick:()=>u(o),cells:[{key:Uh.PodName,rawValue:o.name},{key:Uh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Fe,{status:La(e),label:e});var e}},{key:Uh.Restarts,rawValue:o.restartsCount.toString()},{key:Uh.NodeName,rawValue:o.nodeName},{key:Uh.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(Q,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?we.Error:we.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?we.Error:we.Success;return e(oe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Fe,{status:l,label:`Receiver ${i}%`,leftIcon:l===we.Error?el:tl,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Fe,{status:c,label:`Exporter ${s}%`,leftIcon:c===we.Error?el:tl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Uh.Age,rawValue:c(o.creationTimestamp)},{key:Uh.DockerImage,rawValue:o.image}]})),[n,s]);return e(xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:$i,title:"Pods"},children:[t(mo,{variant:fo.Data,isLoading:o,columns:Hh(l),rows:p}),t(Vh,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},jh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(q,{isOpen:e,header:{icon:ol,title:n,onClose:o},children:t(Cl,{yaml:a,defaultOpen:!0})}),Wh=e=>{switch(e){case _a.Healthy:return"All desired replicas are updated, available, and ready";case _a.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case _a.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case _a.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case _a.Down:return"No available replicas";case _a.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Kh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Kh||(Kh={}));const Yh=m.div`
|
|
768
897
|
flex: 0.5;
|
|
769
898
|
padding: 12px;
|
|
770
899
|
border-radius: 12px;
|
|
771
900
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
772
|
-
`,
|
|
901
|
+
`,Jh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case Mh.Gateway:return"Deployment";case Mh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:pt.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Mh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Mh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:we.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:pt.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,s),[n,i,o,s]),h=a(()=>((e,t,o,n)=>{let a=n?we.Info:pt.Unknown,i=n?"Loading":_a.Unknown,l=n?"Fetching data...":Wh(_a.Unknown);switch(e){case Mh.Gateway:a=t?.status?La(t?.status):a,i=t?.status??i,l=t?.status?Wh(t.status):l;break;case Mh.Node:a=o?.status?La(o?.status):a,i=o?.status??i,l=o?.status?Wh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case Mh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Mh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case Mh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Mh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Mh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Mh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:ol,title:u,badge:p},actions:[{id:Mo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Kh.ManifestYaml,label:u,icon:nl},{id:Kh.ConfigMapYaml,label:"ConfigMap",icon:nl}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(za,{...h})}),g.map(e=>t(Yh,{children:t("div",{children:t(Ba,{...e})})},e.title)),m.map(e=>t(Ma,{...e},e.title))]}),t(jh,{isOpen:c===Kh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(jh,{isOpen:c===Kh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},qh=[{value:Mh.Gateway,label:"Gateway"},{value:Mh.Node,label:"Node Collector"}],Zh=({minSupportedVersion:o=0,effectiveConfig:i,getGatewayInfo:s,getGatewayPods:c,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:g}=y(o),[m,f]=r(!1),[b,v]=r(Mh.Gateway),[C,S]=r(null),[w,x]=r([]),[k,T]=r(null),[$,E]=r([]),I=l(async e=>{e?.silent||f(!0);try{switch(b){case Mh.Gateway:S(await s()??null),x(await c()??[]);break;case Mh.Node:T(await d()??null),E(await u()??[])}}catch(e){}e?.silent||f(!1)},[b]),N=l(()=>I(),[I]);n(()=>{I();const e=setInterval(()=>I({silent:!0}),3e3);return()=>clearInterval(e)},[I]);const A=a(()=>b===Mh.Gateway?w:$,[w,$,b]);return e(ua,{children:[t(Xh,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Xa,{children:[e(V,{children:[t(le,{variant:ho.Underline,size:be.L,options:qh,selected:b,setSelected:v}),t(Jh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:m})]}),t(Gh,{isLoading:m,pods:A,getExtendedPodInfo:p,withSpanDropRate:!1===i?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!h&&t(xl,{minSupportedVersion:o,currentVersion:g||""})]})]})},Qh=m.div`
|
|
773
902
|
display: inline-flex;
|
|
774
903
|
align-items: center;
|
|
775
904
|
min-width: 0;
|
|
776
905
|
overflow: hidden;
|
|
777
906
|
white-space: pre;
|
|
778
907
|
text-overflow: ellipsis;
|
|
779
|
-
`,
|
|
908
|
+
`,eg=m.div`
|
|
780
909
|
display: flex;
|
|
781
910
|
flex-direction: column;
|
|
782
911
|
gap: 4px;
|
|
783
912
|
min-width: 0;
|
|
784
913
|
flex: 1;
|
|
785
914
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
786
|
-
`,
|
|
915
|
+
`,tg=m(oe)`
|
|
787
916
|
flex-shrink: 0;
|
|
788
917
|
gap: 6px;
|
|
789
918
|
align-items: center;
|
|
790
919
|
min-height: 22px;
|
|
791
|
-
`;const
|
|
920
|
+
`;const og=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],ng=[{value:"all",label:Ua},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ag=({title:o,items:n,isLoading:i,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[g,m]=r(""),[b,v]=r("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,b,s);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,b,s,g]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(eg,{$disabled:o.disabled,children:[t(Qh,{children:t(S,{parts:o.summary})}),o.name&&t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(tg,{children:[o.disabled&&t(Fe,{label:Va,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Fe,{label:o.typeBadge,textSize:te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),w=a(()=>{const e=e=>t(ui,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Co,leftIcon:pi,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,w]);return t(Ye,{fullHeight:!0,richTitle:{icon:Hi,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:ng,selected:b,setSelected:v}}:{}},children:t(mo,{variant:fo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Ha,subTitle:Wa(g)}:{hideIcon:!0,title:ja,button:{label:Ga,onClick:d}},columns:og,rows:C,getRowActions:x})})},ig=({workloads:o,samplingRules:s,k8sHealthProbesConfig:c,loading:d,docsUrl:u,fetchSamplingRules:p,createNoisyOperationRule:h,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:m,updateHighlyRelevantOperationRule:f,createCostReductionRule:b,updateCostReductionRule:v,deleteSamplingRule:y,updateK8sHealthProbesConfig:C})=>{const S=a(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),k=a(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[X,U]=r(T.Noisy),[H,G]=r(null),[j,W]=r(!1),[K,Y]=r(!1),[J,q]=r(null),[Z,Q]=r(!1),[ee,te]=r(!1),[re,se]=r(!1),[ce,de]=r(!1),ue=i(!1);n(()=>{ue.current||d||(ue.current=!0,0===s.length&&de(!0))},[d,s]);const pe=a(()=>w(c),[c]),he=a(()=>$(s),[s]),ge=a(()=>x(he?.rule??null),[he]),me=a(()=>E(s),[s]),fe=a(()=>I(me?.rule??null),[me]),ve=i(H);ve.current=H,n(()=>{const e=ve.current;if(!e)return;const t=N(s,e);t?G(t):(G(null),W(!1))},[s]);const ye=a(()=>{const e=new Set;return he&&e.add(he.rule.ruleId),me&&e.add(me.rule.ruleId),e},[he,me]),Ce=a(()=>A(s,X,ye),[s,X,ye]),xe=l(()=>Y(!0),[]),ke=l(()=>Y(!1),[]),Te=l(()=>de(!1),[]),$e=l(async e=>{const t=s[0]?.id??"default";switch(L[X]){case"noisy":await h(t,R(e));break;case"highlyRelevant":await m(t,D(e));break;case"costReduction":await b(t,O(e))}Y(!1)},[s,X,h,m,b]),Ee=l(e=>{const t=P(s,e);t&&(W(!1),G(t))},[s]),Ie=l(()=>{G(null),W(!1)},[]),Ne=l((e,t)=>{const o=H;if(o&&o.rule.ruleId===e&&o.samplingId===t)W(!0),G({...o});else for(const o of s){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return W(!0),void G({category:n.category,rule:n.rule,samplingId:t,summary:F(n.category,n.rule)})}},[H,s]),Ae=l(async(e,t,o)=>{const n=H?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await f(o,t,D(e));break;case"costReduction":await v(o,t,O(e))}W(!1)}},[H,g,f,v]),Oe=l((e,t)=>{q({ruleId:e,samplingId:t})},[]),De=l(async()=>{if(!J)return;const{ruleId:e,samplingId:t}=J,o=H?.category||L[X];await y(t,e,o),G(null),W(!1),q(null)},[J,H,X,y]),Re=l(()=>q(null),[]),Pe=l(async(e,t)=>{await C(e,t),Q(!1)},[C]),Fe=l(async e=>{const t=s[0]?.id??"default",o=he;o?await f(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await m(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),te(!1)},[s,he,m,f]),Le=l(async(e,t)=>{const o=s[0]?.id??"default",n=me;n?await v(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await b(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[s,me,b,v]),_e=l(e=>{const t=L[X];let o=null;switch(t){case"noisy":{const n=R(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ka,ruleId:o}:null},[s,X]),Be=l(e=>{const t=H?.category,o=H?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=R(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=D(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=O(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:Ka,ruleId:n}:null},[s,H]),Me=l(e=>{Y(!1);for(const t of s){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return W(!0),void G({category:o.category,rule:o.rule,samplingId:t.id,summary:F(o.category,o.rule)})}},[s]),Ve=a(()=>{const e=[];return u&&e.push({id:Mo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ya,leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Mo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ja,leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:p,loading:d}}),e.push({id:Mo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:qa,rightIcon:li,size:ae.S,variant:ie.Primary,onClick:xe}}),e},[u,p,d,xe]);return e(ua,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Pa,{icon:Hi,title:Qa,subTitle:Za}),t(Fa,{actions:Ve})]}),e(V,{$gap:12,$fullHeight:!0,children:[t(le,{variant:ho.Underline,size:be.L,options:z,selected:X,setSelected:U}),e(oe,{$justifyContent:"space-between",children:[t(Se,{status:we.Default,message:B[X]}),u&&t(ne,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")})]}),X===T.Noisy?t(sl,{title:je,summary:pe,onEdit:()=>Q(!0)}):X===T.HighlyRelevant?t(sl,{title:Xe,summary:ge,onEdit:()=>te(!0)}):X===T.CostReduction?t(sl,{title:He,summary:fe,onEdit:()=>se(!0)}):null,t(ag,{title:M[X],items:Ce,isLoading:d,showTypeFilter:X===T.HighlyRelevant,onRuleClick:Ee,onCreateRule:xe,onEditRule:Ne,onDeleteRule:Oe})]}),t(Wd,{formType:Al.View,data:H,defaultEditMode:j,onClose:Ie,onDelete:Oe,onSaveEdit:Ae,sourceOptions:S,namespaceOptions:k,validateForm:Be,onNavigateToDuplicate:Me}),t(Wd,{formType:Al.Create,isOpen:K,category:L[X],onClose:ke,onSubmit:$e,sourceOptions:S,namespaceOptions:k,validateForm:_e,onNavigateToDuplicate:Me}),t(Wd,{formType:Al.EditAutoNoisy,isOpen:Z,enabled:c?.enabled??!1,keepPercentage:c?.keepPercentage??0,onClose:()=>Q(!1),onSave:Pe}),t(Wd,{formType:Al.EditAutoHighlyRelevant,isOpen:ee,enabled:!!he&&!he.rule.disabled,onClose:()=>te(!1),onSave:Fe}),t(Wd,{formType:Al.EditAutoCostReduction,isOpen:re,enabled:!!me&&!me.rule.disabled,dropPercentage:me?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Le}),t(ze,{title:ni,description:oi,isOpen:!!J,onClose:Re,denyButton:{label:ti,variant:ie.Secondary,onClick:Re},approveButton:{label:ei,variant:ie.Primary,onClick:()=>{De(),Re()}}}),t(op,{isOpen:ce,onClose:Te,k8sHealthProbesConfig:c,samplingId:s[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:C,createHighlyRelevantOperationRule:m,createCostReductionRule:b})]})},lg=m.div`
|
|
792
921
|
display: flex;
|
|
793
922
|
align-items: center;
|
|
794
923
|
justify-content: space-between;
|
|
795
924
|
padding: 0 12px;
|
|
796
|
-
`,
|
|
925
|
+
`,rg=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Reset",leftIcon:ii,size:ae.S,variant:ie.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(lg,{children:[e(oe,{$gap:12,$alignItems:"center",children:[t(Pa,{icon:Ti,title:"Odigos Settings"}),t(tt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(Fa,{actions:h}),t(ze,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ie.Primary,onClick:()=>{c?.(),p(!1)}}})]})},sg=m(oe)`
|
|
797
926
|
flex: 1;
|
|
798
927
|
min-height: 0;
|
|
799
928
|
width: 100%;
|
|
800
929
|
align-self: stretch;
|
|
801
|
-
`,
|
|
930
|
+
`,cg=m(V)`
|
|
802
931
|
flex: 1;
|
|
803
932
|
min-height: 0;
|
|
804
933
|
height: 100%;
|
|
805
934
|
overflow-y: auto;
|
|
806
|
-
|
|
935
|
+
`,dg=e=>"general"===e.name?0:"advanced"===e.name?2:1,ug=({minSupportedVersion:o=0,configYamls:i,configYamlsLoading:l,effectiveConfig:s,effectiveConfigLoading:c,refetch:d,factoryReset:u,onSave:p,saveLoading:h})=>{const{isVersionSupported:g,version:m,isEnterprise:f}=y(o),b=a(()=>{if(!s)return{};const{manifestYAML:e,provenance:t,...o}=s;return o},[s]),{formData:v,handleFormChange:C,getNestedValue:S,getFormDiff:w,isFormDirty:x}=$t(b);n(()=>{"{}"!==JSON.stringify(b)&&"{}"===JSON.stringify(v)&&C(void 0,void 0,b)},[b,v]);const k=a(()=>[...i].sort((e,t)=>dg(e)-dg(t)),[i]),T=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(s?.provenance),[s?.provenance]),$=a(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===It.Dropdown&&e.add(o.helmValuePath);return e},[i]),E=a(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:S("formData",e.helmValuePath)}))),[i,v,S]),[I,N]=r(!1),A=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(w(b,v),$);await(p?.(e)),C(void 0,void 0,{})},O=a(()=>[{id:Mo(),type:Wt.Button,buttonProps:{"data-id":"settings-save",variant:ie.Primary,size:ae.S,label:"Save Changes",leftIcon:Ci,loading:h,onClick:()=>N(!0)}},{id:Mo(),type:Wt.Button,buttonProps:{"data-id":"settings-cancel",variant:ie.Secondary,size:ae.S,label:"Cancel",leftIcon:Si,onClick:()=>C(void 0,void 0,b)}}],[h,w,b,v,C]),D=a(()=>k.map(e=>({id:e.name,label:e.displayName})),[k]),R=a(()=>k.map(e=>e.name),[k]),{selectedSection:P,setSelectedSection:F,setSectionRef:L,setScrollContainerRef:_}=ai({sectionNames:R});return e(ua,{$gap:12,children:[t(rg,{disabled:!g,loading:l||c,tabs:D,selectedTab:P,setSelectedTab:F,onClickReset:u?()=>u().then(()=>d?.()):void 0,onClickRefresh:d?()=>d():void 0}),e(Xa,{children:[!g&&t(xl,{minSupportedVersion:o,currentVersion:m||""}),t(pa,{isOpen:x,richTitle:{icon:Ti,title:"Config Settings"},actions:O}),t(ze,{isOpen:I,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>N(!1),denyButton:{label:"Keep editing",variant:ie.Secondary,onClick:()=>N(!1)},approveButton:{label:"Save changes",variant:ie.Primary,onClick:()=>{A(),N(!1)}}}),e(sg,{$gap:24,$alignItems:"stretch",children:[t(cg,{ref:_,$gap:24,$width:"100%",children:i.length?k.map(o=>t(Ye,{id:o.name,ref:e=>L(o.name,e),richTitle:{icon:Ti,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!f)return null;if(o.renderCondition&&!Ce(o.renderCondition,[],E))return null;const n=st(o.componentProps||"{}",{}),a=T[o.helmValuePath];return e(V,{$gap:4,children:[t(il,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?we.Warning:pt.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||h,value:S("formData",o.helmValuePath),setValue:e=>C(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(Se,{status:we.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):l?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Ye,{richTitle:{icon:Ti,title:"Config Settings"},children:t(me,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(cg,{children:c&&!s?.manifestYAML?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Cl,{title:"Effective Config YAML",yaml:s?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{es as AddActionDrawer,Er as AddActionForm,nu as AddDataStreamModal,ds as AddDestinationDrawer,Ar as AddDestinationForm,us as AddRuleDrawer,zr as AddRuleForm,Os as AddSourceDrawer,sp as CentralConnections,Mr as DataStreamForm,Br as DataStreamMergeWarning,Rs as EditActionDrawer,Ps as EditConfigDrawer,au as EditDataStreamModal,Ls as EditDestinationDrawer,zs as EditRuleDrawer,Pd as EditSourceDrawer,Xr as EditSourceForm,ru as ONBOARDING_DONE_MODAL_ID,wp as Onboarding,su as OnboardingDone,Bh as Overview,Zh as PipelineCollectors,pr as RegexTesterDrawer,op as SamplingOnboardingModal,Wd as SamplingRuleDrawer,Wr as SamplingRuleForm,ig as SamplingRules,ug as Settings,ou as SystemDrawer,qh as TABS};
|