@odigos/ui-kit 0.0.278 → 0.0.279
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 +7 -0
- package/lib/chunks/{helpers-DifX1XM0.js → helpers-B5Wu-Nyu.js} +1 -1
- package/lib/chunks/{index-BxDn2YI2.js → index-Cq-AD5dL.js} +1 -1
- package/lib/chunks/{source-instrument-form-context-HMXzB4jU.js → source-instrument-form-context-Cvd61Lk9.js} +2 -2
- package/lib/chunks/{ui-components-B2sd5xH7.js → ui-components-Do4rJm_Q.js} +207 -207
- package/lib/components.js +1 -1
- package/lib/constants/instrumentation-rules/index.d.ts +19 -1
- package/lib/constants.js +1 -1
- package/lib/containers.js +230 -230
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as E,h as N,j as O,k as $,p as A,l as D,c as R,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as E,h as N,j as O,k as $,p as A,l as D,c as R,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-B5Wu-Nyu.js";import{C as Q,e as ee,g as te,f as ne,h as oe,bx as ie,F as ae,by as le,bz as re,bA as se,bB as ce,bn as de,d as pe,k as ue,I as he,bC as me,o as ge,p as fe,w as be,Y as ve,bD as ye,bE as Ce,ar as Se,bF as xe,bG as we,B as Te,i as ke,j as Ie,x as Ee,a4 as Ne,bo as Oe,b0 as $e,bH as Ae,bI as De,u as Re,N as _e,S as Pe,bJ as Le,bt as Fe,bu as Me,bs as ze,bK as Be,af as Xe,T as Ue,ad as Ve,ae as He,ab as je,aa as Ge,ac as We,a9 as Ke,b7 as Ye,a8 as Je,bL as qe,bM as Ze,bN as Qe,bO as et,bP as tt,W as nt,m as ot,bb as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,bX as ut,Q as ht,bY as mt,bZ as gt,b_ as ft,a$ as bt,br as vt,s as yt,b$ as Ct,c0 as St,b1 as xt,c1 as wt,c2 as Tt,aY as kt,v as It,bv as Et,ba as Nt,q as Ot,c3 as $t,bc as At,c4 as Dt,c5 as Rt,be as _t,c6 as Pt,b3 as Lt,c7 as Ft,l as Mt,y as zt,D as Bt,c8 as Xt,ag as Ut,c9 as Vt,ca as Ht,n as jt,bh as Gt,bm as Wt,z as Kt,cb as Yt,cc as Jt,bl as qt,cd as Zt,a3 as Qt,ce as en,cf as tn,b6 as nn,H as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,cn as un,O as hn,co as mn,cp as gn,A as fn,b2 as bn,a_ as vn,cq as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,cv as Tn,bw as kn,cw as In,cx as En,cy as Nn,cz as On,cA as $n,b as An,cB as Dn,cC as Rn,M as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,cQ as Kn,cR as Yn,cS as Jn,cT as qn,aO as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,d2 as co,d3 as po,d4 as uo,d5 as ho,d6 as mo,ax as go,d7 as fo,d8 as bo,b4 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as Eo,di as No,dj as Oo,dk as $o,dl as Ao,dm as Do,dn as Ro,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ei,e9 as Ni,ea as Oi,eb as $i,ec as Ai,ed as Di,ee as Ri,ef as _i,eg as Pi,eh as Li,ei as Fi,ej as Mi,ek as zi,el as Bi,em as Xi,P as Ui,en as Vi,eo as Hi,ep as ji,eq as Gi,er as Wi,es as Ki,et as Yi,aZ as Ji,eu as qi,$ as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,eG as da,bd as pa,eH as ua,R as ha,a as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Ea,eV as Na,eW as Oa,eX as $a,eY as Aa,eZ as Da,e_ as Ra,e$ as _a,f0 as Pa,f1 as La}from"./chunks/ui-components-Do4rJm_Q.js";import{ChevronRightIcon as Fa,ActionIcon as Ma,TrashIcon as za,PlusIcon as Ba,ArrowRightIcon as Xa,VSquareIcon as Ua,XSquareIcon as Va,BookIcon as Ha,DeleteIcon as ja,EditIcon as Ga,GoLogo as Wa,JavaLogo as Ka,PhpLogo as Ya,DestinationIcon as Ja,ChevronUpIcon as qa,ChevronDownIcon as Za,VIcon as Qa,XIcon as el,InstrumentationRuleIcon as tl,SourceIcon as nl,NamespacesIcon as ol,AzureIcon as il,GoogleCloudPlatformLogo as al,AwsLogo as ll,CloudConnectorIcon as rl,EyeOpenIcon as sl,OdigosLogo as cl,ArrowLeftIcon as dl,ISquareIcon as pl,RefreshIcon as ul,SettingsIcon as hl,PodIcon as ml,K8sLogo as gl,ExclamationCircleIcon as fl,QuestionCircleIcon as bl,InboundIcon as vl,OutboundIcon as yl,UserIcon as Cl,TerminalIcon as Sl,RefreshLeftArrowIcon as xl,MinusIcon as wl,SearchIcon as Tl,ExpandIcon as kl,CopyIcon as Il,DotIcon as El,ArrowDownIcon as Nl,DownloadIcon as Ol,SamplingIcon as $l,ExclamationTriangleIcon as Al,KeyIcon as Dl,DiagnoseIcon as Rl,StarIcon as _l,ArrowIcon as Pl,ConnectionsIcon as Ll,FilterIcon as Fl,DataStreamIcon as Ml,PipelineCollectorIcon as zl,ArrowDownSquareIcon as Bl,ArrowUpSquareIcon as Xl,GatewayIcon as Ul,YamlIcon as Vl,ImageErrorIcon as Hl,LockIcon as jl}from"./icons.js";import{h as Gl,o as Wl,n as Kl,q as Yl,m as Jl,t as ql,s as Zl,S as Ql,w as er,E as tr,x as nr,y as or,v as ir,l as ar,d as lr,O as rr,f as sr,b as cr,A as dr,R as pr,C as ur,e as hr,D as mr}from"./chunks/source-instrument-form-context-Cvd61Lk9.js";import{n as gr,f as fr,k as br,I as vr,l as yr,A as Cr,i as Sr,P as xr,S as wr,R as Tr,g as kr,j as Ir,c as Er,h as Nr,m as Or,W as $r,C as Ar,b as Dr,Y as Rr,O as _r,a as Pr,U as Lr,e as Fr}from"./chunks/index-Cq-AD5dL.js";import{createPortal as Mr}from"react-dom";import{MarkerType as zr,useNodesState as Br,useEdgesState as Xr,Handle as Ur,Position as Vr,getSmoothStepPath as Hr,BaseEdge as jr,EdgeLabelRenderer as Gr,ReactFlowProvider as Wr,ReactFlow as Kr,Background as Yr,Controls as Jr,ControlButton as qr,useReactFlow as Zr}from"@xyflow/react";import Qr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const es=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -11,24 +11,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
11
11
|
&:hover {
|
|
12
12
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,ts=b.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: center;
|
|
18
18
|
padding: 8px;
|
|
19
19
|
border-radius: 8px;
|
|
20
20
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
|
|
21
|
-
`,
|
|
21
|
+
`,ns=b(oe)`
|
|
22
22
|
flex: 1;
|
|
23
23
|
min-width: 0;
|
|
24
|
-
`,
|
|
24
|
+
`,os=b(ae)`
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
|
-
`,
|
|
27
|
+
`,is=b(oe)`
|
|
28
28
|
flex-shrink: 0;
|
|
29
|
-
`,
|
|
29
|
+
`,as=({dataId:n,icon:o,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(es,{"data-id":n||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(ns,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),o&&t(ts,{children:t(o,{size:20})}),e(os,{$gap:4,children:[t(ee,{size:te.XS,nowrap:!0,children:i}),a&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:a})]})]}),(l||c)&&e(is,{$gap:8,children:[c,l&&t(Fa,{size:18})]})]}),ls="other",rs={...se,[ls]:{TITLE:"Other",ICON:Ma}},ss=b(oe)`
|
|
30
30
|
padding: 8px 12px 4px 12px;
|
|
31
|
-
`,
|
|
31
|
+
`,cs=({bucket:n,options:o,selectedType:i,onSelectOption:a})=>{const l=v(),{TITLE:r,ICON:s}=rs[n],c=l.v2.colors.purple[200];return e("div",{"data-id":`action-category-${n}`,children:[e(ss,{$gap:8,children:[t(s,{fill:c}),t(ee,{size:te.XXS,color:c,children:r}),t(ce,{label:o.length})]}),o.map(e=>t(as,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:i===e.type,onClick:()=>a(e)},e.type))]})},ds=[{id:"CREDIT_CARD",label:"Credit card"}],ps=[{id:de.CollectContainerAttributes,label:"Collect container attributes"},{id:de.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:de.CollectWorkloadId,label:"Collect workload ID"},{id:de.CollectClusterId,label:"Collect cluster ID"}],us=[{id:me.Pod,label:me.Pod},{id:me.Namespace,label:me.Namespace},{id:me.Node,label:me.Node}],hs=[{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:us}],ms=[{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:us}],gs=de.ExtractAttribute;var fs;(e=>{e.Preset="preset",e.Regex="regex"})(fs||(fs={}));const bs=[Ce.JSON,Ce.SQL,Ce.ResourcePath],vs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ys=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Cs=b.div`
|
|
32
32
|
width: 100%;
|
|
33
33
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
34
34
|
border-radius: 8px;
|
|
@@ -36,13 +36,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
gap: 8px;
|
|
39
|
-
`,
|
|
39
|
+
`,Ss=b.div`
|
|
40
40
|
flex: 1;
|
|
41
41
|
min-width: 0;
|
|
42
|
-
`,
|
|
42
|
+
`,xs=b.div`
|
|
43
43
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
44
44
|
padding-top: 24px;
|
|
45
|
-
`,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ts=de.UrlTemplatizationRulesGroups,ks=[{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"}],Is={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ds.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:us,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hs,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{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:o[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>xs(i));return a(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ws(r),i||{})||s(xs(i))},[i]),t(he,{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:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,ws(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,cs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:cs.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ts,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(Ne,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ma,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ee,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[Ts]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:za,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[ms],c=n[ms]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=l(null),m=e=>o(ms,{extractions:e});a(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ys,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Ma,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:za,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Ee,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ss,{children:t(Ba,{size:24,fill:r.v2.colors.silver[200]})}),t(Cs,{children:t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ee,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(mr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Es=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Is[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Ns=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=jl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:De.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ee,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Es,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Os=b(oe)`
|
|
45
|
+
`,ws=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Ts=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},ks=de.UrlTemplatizationRulesGroups,Is=[{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"}],Es={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ps.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:hs,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:ms,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{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:o[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>ws(i));return a(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Ts(r),i||{})||s(ws(i))},[i]),t(he,{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:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,Ts(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,ds.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:ds.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[ks]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(ks,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(Ne,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(za,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ee,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Is,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[ks]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:Ba,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[gs],c=n[gs]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(ys)?fs.Regex:fs.Preset)(c)),[u,h]=l(null),m=e=>o(gs,{extractions:e});a(()=>{0===c.length&&m([d===fs.Preset?vs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===fs.Preset?vs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===fs.Preset,y=c.length?c:[b?vs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:fs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:fs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===fs.Preset?vs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(Cs,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:bs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(za,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===fs.Preset?vs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:Ba,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Ss,{children:t(Ee,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(xs,{children:t(Xa,{size:24,fill:r.v2.colors.silver[200]})}),t(Ss,{children:t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ee,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(gr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Ns=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(fr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Es[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Os=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=Gl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Ua,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Va,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:De.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Ha,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ee,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Ns,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},$s=b(oe)`
|
|
46
46
|
position: sticky;
|
|
47
47
|
bottom: 4px;
|
|
48
48
|
align-self: center;
|
|
@@ -53,30 +53,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
53
53
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
54
54
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
55
55
|
z-index: 1;
|
|
56
|
-
`,$s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Gl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Wl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:De.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ee,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(gr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(Os,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ha,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ja,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});$s.displayName="AddDestinationForm";const As=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ds=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Rs=["*"],_s=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ps={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Ls={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:As.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Ds.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ps[Ke.Golang],[Ke.Java]:Ps[Ke.Java],[Ke.Php]:Ps[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ga,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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:d,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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:p,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(Rs)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:_s.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Fs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Ls[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ms=()=>{const n=v(),{isEnterprise:o,isK8s:a}=S(),{selectedOption:l,genericForm:r,sourceOptions:s,namespaceOptions:c}=Kl(),d=i(()=>qe(l?.supportedLanguages),[l?.supportedLanguages]),p=i(()=>{if(l)return l.type===Je.CustomInstrumentation?[]:Ze(l.supportedLanguages)},[l]);if(!r||!l)return t($e,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=r;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:l.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:De.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>l.docsUrl&&window.open(l.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{option:l,formState:u}),!!d.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),a&&t(vr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:s,namespaceOptions:c,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ee,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Fs,{ruleType:l.type,dynamicFields:l.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},zs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Yl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Bs=({autoFocus:n})=>{const{dataStreams:o}=ot(),{genericForm:a,excludeName:l,editingName:r}=Yl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ee,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Xs=()=>{const{selectedStreamName:e}=ot(),{genericForm:n}=Jl();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ee,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vs=b.div`
|
|
56
|
+
`,As=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Wl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Kl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Ua,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Va,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:De.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Ha,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(br,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ee,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(fr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e($s,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ja,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ga,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});As.displayName="AddDestinationForm";const Ds=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Rs=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],_s=["*"],Ps=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ls={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Fs={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:Ds.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Rs.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ls[Ke.Golang],[Ke.Java]:Ls[Ke.Java],[Ke.Php]:Ls[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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:d,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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:p,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ya,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(_s)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:Ps.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Ms=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(fr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Fs[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},zs=()=>{const n=v(),{isEnterprise:o,platformType:a,version:l}=S(),r=qe(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Yl(),u=i(()=>Ze(s?.supportedLanguages),[s?.supportedLanguages]),h=i(()=>{if(s)return s.type===Je.CustomInstrumentation?[]:Qe(s.supportedLanguages)},[s]);if(!c||!s)return t($e,{title:"No active form"});const{formData:m,handleFormChange:g,formErrors:f}=c;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Ua,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Va,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:De.S,selected:m.disabled,setSelected:e=>g("disabled",e),disabled:!o}),t(Te,{leftIcon:Ha,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(vr,{option:s,formState:m}),!!u.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:tt(e),leftIcon:et(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(yr,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ee,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:m.ruleName,onChange:({target:{value:e}})=>g("ruleName",e),errorMessage:f.ruleName,disabled:!o}),t(Ms,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!o}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!o})]})},Bs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Jl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(nt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:ot.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Xs=({autoFocus:n})=>{const{dataStreams:o}=it(),{genericForm:a,excludeName:l,editingName:r}=Jl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ee,{name:"data-stream-name",label:ot.STREAM_NAME,placeholder:ot.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:ot.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:ot.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Us=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=ql();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ee,{name:"sourceName",label:ot.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Vs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Hs=b.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 24px;
|
|
60
|
-
`,
|
|
60
|
+
`,js=b.div`
|
|
61
61
|
display: contents;
|
|
62
62
|
& > * {
|
|
63
63
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
64
64
|
transition: opacity 0.2s ease;
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Gs=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:pt,leftIcon:Ua}:{label:ut,leftIcon:Va,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Ws=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:Ua,label:pt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Va,label:ut,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ks=()=>{const e=Zl();switch(e.formType){case Ql.Create:return t(Ys,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ws,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ql.View:return e.data?e.isEditing?t(Ys,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ws,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Js,{data:e.data,renderAction:()=>t(Gs,{value:!e.data?.rule.disabled})}):null;case Ql.EditAutoNoisy:return t(qs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:dt,sectionTitle:rt,sectionSubTitle:ct,presetLabel:lt,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(Ws,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ql.EditAutoCostReduction:return t(qs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:st,sectionTitle:rt,presetLabel:lt,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(Ws,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ql.EditAutoHighlyRelevant:return t(Hs,{children:t(Cr,{title:e.localEnabled?void 0:at,summary:e.summary,renderAction:()=>t(Ws,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ys=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Hs,{children:[t(wr,{category:n,formState:o,renderAction:r}),e(js,{$faded:!!o.disabled,children:[t(Tr,{category:n,formState:o,onChange:i}),t(yr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(kr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(Ir,{formState:o,onChange:i}),"highlyRelevant"===n&&t(Er,{ruleType:o.ruleType,formState:o,onChange:i}),t(Nr,{category:n,formState:o,onChange:i})]})]}),Js=({data:n,renderAction:o})=>e(Hs,{children:[t(wr,{readOnly:!0,summary:n.summary,renderAction:o}),t(Tr,{readOnly:!0,data:n}),t(yr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(kr,{readOnly:!0,data:n}),t(Nr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Er,{readOnly:!0,rule:n.rule})]}),qs=({enabled:n,summary:o,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e(Hs,{children:[t(Cr,{title:n?void 0:i,summary:o,renderAction:b}),t(js,{$faded:!n,children:e(ht,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Vs,selected:p,setSelected:v})}),S&&t(Sr,{description:r,options:xr,selected:h,onSelect:y,customName:s,customLabel:mt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Zs=({onClose:n,selectedConnectionIds:o,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=Wl(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=Gl(),{options:w,loading:T}=s.useActionTypes(),k=i(()=>w.length?w:gt(c,u),[w,c,u]),I=i(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),E=d(e=>{b.current?.clearErrors(),y(e)},[y]),N=(({isLoading:e,options:n,selectedCategory:o,selectedType:a,onSelectOption:l})=>({width:"40%",list:i(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const i=n.reduce((e,t)=>{const n=t.category&&t.category in rs?t.category:ls;return(e[n]||=[]).push(t),e},{});return Object.keys(rs).filter(e=>i[e]?.length&&(!o||o===e)).map(e=>t(cs,{bucket:e,options:i[e],selectedType:a,onSelectOption:l},e))},[e,n,o,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:E}),O=i(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(ft).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),$=i(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(Os,{},v.type)]:[t(bt,{$height:"100%",children:t($e,{icon:Ma,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(Or,{ref:b,isOpen:!0,withOverlay:r,onClose:n,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!C?.isFormDirty,isFormDirty:C?.isFormDirty,hideDirtyNote:!0,progress:{title:ot.CREATING_ACTION,subTitle:ot.CREATING_ACTION_SUBTITLE},header:{icon:Ma,title:ot.ADD_ACTION,subTitle:ot.ADD_ACTION_DESCRIPTION},connectionIds:o&&a?{value:o,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:O,selected:g,setSelected:f})]}),leftColumn:N,rightColumn:{width:"60%",list:$}})},Qs=({destinationsByCategory:o,filters:a,setFilters:l})=>{const r=i(()=>Object.values(vt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=i(()=>{const e=Object.values(Fe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(yt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},ec=b.div`
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: column;
|
|
69
69
|
padding: 8px;
|
|
70
70
|
border-radius: 16px;
|
|
71
71
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
72
72
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
|
|
73
|
-
`,
|
|
73
|
+
`,tc=b.div`
|
|
74
74
|
display: flex;
|
|
75
75
|
align-items: center;
|
|
76
76
|
justify-content: space-between;
|
|
77
77
|
gap: 12px;
|
|
78
78
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
79
|
-
`,
|
|
79
|
+
`,nc=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(ec,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(tc,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(ee,{size:te.XS,children:n}),o&&t(Ue,{text:o,withIcon:!0}),t(ce,{label:i.length,status:r?Pe.Default:void 0})]}),t(Ct,{icon:s?qa:Za,size:St.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(bt,{$padding:"12px 0",children:t($e,{})})}):null]})},oc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,ic=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(as,{icon:Tt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Qa:el})}),ac=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Kl();return n?.length?t(nc,{title:wt[e].TITLE,tooltip:wt[e].DESCRIPTION,list:n.map((n,o)=>t(ic,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(nc,{purpleColors:!0,title:wt[e].TITLE,tooltip:wt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(ic,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var lc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(lc||(lc={}));const rc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===lc.SELF_HOSTED?o.push(...e.items):e.name===lc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=kt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=It(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[vt.DETECTED]:n,[vt.SELF_HOSTED]:o,[vt.MANAGED]:i}},sc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Wl(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Kl();a(()=>{c&&I(c)},[c]);const E=C||x,N=i(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[vt.ALL]:[],[vt.UNSAVED]:[],[vt.EXISTS]:[],[vt.DETECTED]:[],[vt.SELF_HOSTED]:[],[vt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of N){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=It(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:n[e.name]??e.initialValue})):[]}});$(t=>({...t,[vt.EXISTS]:e}))},[v,N]),a(()=>{(y||S)&&$(e=>({...e,...rc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Be(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),D=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:a})=>{const{unsavedDestinations:l}=Kl();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(ac,{listType:vt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(vt)){if(a.categoryType&&a.categoryType!==e)continue;const l=oc(n[e],o,a);l.length&&i.push(t(ac,{listType:e,destinationOptions:l},e))}return e&&i.push(t(bt,{$height:"100%",children:t(xt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,n,o,a,e])}})({isFetching:E,destinationsByCategory:O,searchText:m,filters:f}),R=(()=>{const{activeForm:e}=Kl();return{width:"60%",list:e?[t(As,{},e.option.type)]:[t(bt,{$height:"100%",children:t($e,{icon:Ja,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Or,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:ot.CREATING_DESTINATION,subTitle:ot.CREATING_DESTINATION_SUBTITLE},header:{icon:Ja,title:ot.ADD_DESTINATIONS,subTitle:ot.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(Qs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:D,rightColumn:R})},cc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=Wl(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Yl(),{options:b,loading:v}=s.useRuleTypes(),y=i(()=>b.length?b:Et,[b]),C=i(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(as,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(zs,{},h.type)]:[t(bt,{$height:"100%",children:t($e,{icon:tl,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(Or,{ref:u,isOpen:!0,withOverlay:a,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!r,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:r?void 0:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:ot.CREATING_INSTRUMENTATION_RULE,subTitle:ot.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:tl,title:ot.ADD_INSTRUMENTATION_RULE,subTitle:ot.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},dc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:ot.FETCHING_NAMESPACES,subTitle:ot.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:ot.SELECT_NAMESPACE,subTitle:ot.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},pc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Nt.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"},uc=e=>e?pc:dc,hc="No matches",mc=e=>(e?"Unselect":"Select")+" all",gc="Selected",fc=b.div``,bc=b.div`
|
|
80
80
|
visibility: hidden;
|
|
81
81
|
|
|
82
82
|
transition: visibility 0s;
|
|
@@ -84,17 +84,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
84
84
|
transition-duration: 0s;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
${
|
|
87
|
+
${fc}:hover & {
|
|
88
88
|
visibility: visible;
|
|
89
89
|
}
|
|
90
|
-
`,
|
|
90
|
+
`,vc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(fc,{children:t(as,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:o,onCheckboxChange:a?r:i,children:a?t(Ue,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(ce,{label:"Enterprise only",status:Pe.Default,textSize:te.XXXS})}):t(bc,{children:t(ce,{label:n,status:Pe.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},yc=b.div``,Cc=b.div`
|
|
91
91
|
display: grid;
|
|
92
92
|
/* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
|
|
93
93
|
grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
|
|
94
94
|
align-items: center;
|
|
95
95
|
column-gap: 12px;
|
|
96
96
|
flex-shrink: 0;
|
|
97
|
-
`,
|
|
97
|
+
`,Sc=b.div`
|
|
98
98
|
display: flex;
|
|
99
99
|
justify-content: flex-end;
|
|
100
100
|
align-items: center;
|
|
@@ -109,17 +109,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
109
109
|
transition: visibility 0s;
|
|
110
110
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
111
111
|
|
|
112
|
-
${
|
|
112
|
+
${yc}:hover & {
|
|
113
113
|
visibility: visible;
|
|
114
114
|
pointer-events: auto;
|
|
115
115
|
}
|
|
116
|
-
`,
|
|
116
|
+
`,xc=b(oe)`
|
|
117
117
|
width: 100%;
|
|
118
118
|
gap: 8px;
|
|
119
119
|
justify-content: flex-end;
|
|
120
120
|
align-items: center;
|
|
121
121
|
min-width: 0;
|
|
122
|
-
`,
|
|
122
|
+
`,wc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Wl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(yc,{children:t(as,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(Cc,{$withAuto:p,children:[p&&t(Sc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Ot.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(xc,{children:[t(ee,{variant:$t.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:gc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},Tc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(wc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,a,l]);return e?t(nc,{title:o,list:c,noBgColor:!0}):c},kc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Wl(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=uc(!u),{selectedStreamName:T}=it(),{progress:k,resetProgress:I}=At(),{isFetching:E,setIsFetching:N,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:D,formDiff:R,isFormDirty:_}=ir();a(()=>{y()},[]);const P=i(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:Dt,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);a(()=>{N(b||x),P&&O(P)},[P,b,x,N,O]);const[L,F]=l(""),[M,z]=l(Nt.Namespace),[B,X]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:o,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=uc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>nr(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...or(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,p]),g=i(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(Tc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==i,filteredCount:n,totalCount:i}},[m,o,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ue,{text:b?ot.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:mc(g)})]}),list:f.length?f:n?[t(bt,{$height:"100%",children:t(xt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(bt,{$height:"100%",children:t($e,c?{icon:ol,title:hc,subTitle:h.noGroupMatchedFilter(c)}:{icon:ol,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:$,handleSourceChange:A,handleSelectAll:D,selectedArea:U,setSelectedArea:V,searchText:M===Nt.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=uc(!d),h=i(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),m=i(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>er(e,r,c)):[],[h,r,c]),g=i(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=i(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:i,selected:a,kind:l,region:r})=>{const s=d&&!p&&tr.has(l);return t(vc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[m,h,l.value.clusterId,o,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Ue,{text:b?ot.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:mc(g)})]}),list:f.length?f:[t(bt,{$height:"100%",children:t($e,h?r?{icon:nl,title:hc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:nl,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:nl,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:D,selectedArea:{value:U},searchText:M===Nt.Source?L:"",searchBy:M,filters:B});return t(Or,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(_t.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(R):void 0,onNext:r?()=>r(R):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(R),header:{icon:nl,title:ot.ADD_SOURCE,subTitle:ot.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Nt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Nt.Namespace},{label:w.itemSegmentLabel,value:Nt.Source}],selected:M,setSelected:z}},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Ot.S,label:gc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:E,progress:{title:ot.CREATING_SOURCES,subTitle:ot.CREATING_SOURCES_SUBTITLE,percentage:k[_t.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Ic={aws:ll,gcp:al,azure:il},Ec={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Nc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Oc=e=>e.provider.toUpperCase(),$c=b.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: column;
|
|
125
125
|
gap: 8px;
|
|
@@ -127,7 +127,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
127
127
|
padding: 8px 12px;
|
|
128
128
|
border-radius: 16px 0 0 16px;
|
|
129
129
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
130
|
-
|
|
130
|
+
`,Ac=b.button`
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: center;
|
|
133
133
|
gap: 12px;
|
|
@@ -143,7 +143,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
143
143
|
&:hover {
|
|
144
144
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
145
145
|
}
|
|
146
|
-
`,
|
|
146
|
+
`,Dc=b.div`
|
|
147
147
|
display: flex;
|
|
148
148
|
align-items: center;
|
|
149
149
|
justify-content: center;
|
|
@@ -152,13 +152,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
152
152
|
border-radius: 8px;
|
|
153
153
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
154
154
|
flex-shrink: 0;
|
|
155
|
-
`,
|
|
155
|
+
`,Rc=b.div`
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: column;
|
|
158
158
|
gap: 2px;
|
|
159
159
|
flex: 1;
|
|
160
160
|
min-width: 0;
|
|
161
|
-
`,
|
|
161
|
+
`,_c=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t($c,{children:n.map(n=>{const l=(e=>Ic[e.provider]??rl)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===Pt.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Ec[t]??Nc(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e(Ac,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Dc,{children:t(l,{size:24})}),e(Rc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Oc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(Fa,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},Pc=b.div`
|
|
162
162
|
display: flex;
|
|
163
163
|
flex-direction: column;
|
|
164
164
|
gap: 8px;
|
|
@@ -168,15 +168,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
168
168
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
169
169
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
170
170
|
cursor: default;
|
|
171
|
-
`,
|
|
171
|
+
`,Lc=b.div`
|
|
172
172
|
display: flex;
|
|
173
173
|
align-items: center;
|
|
174
174
|
gap: 4px;
|
|
175
175
|
width: 100%;
|
|
176
|
-
`,
|
|
176
|
+
`,Fc=b.div`
|
|
177
177
|
flex: 1;
|
|
178
178
|
min-width: 0;
|
|
179
|
-
`,
|
|
179
|
+
`,Mc=b.div`
|
|
180
180
|
width: 100%;
|
|
181
181
|
max-height: 145px;
|
|
182
182
|
overflow: auto;
|
|
@@ -198,39 +198,39 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
198
198
|
transition: background-color 0.2s ease;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
${
|
|
201
|
+
${Pc}:hover & {
|
|
202
202
|
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
${
|
|
205
|
+
${Pc}:hover &::-webkit-scrollbar-thumb {
|
|
206
206
|
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,zc=b.pre`
|
|
209
209
|
margin: 0;
|
|
210
210
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
211
211
|
font-size: 12px;
|
|
212
212
|
line-height: 20px;
|
|
213
213
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
214
214
|
white-space: pre;
|
|
215
|
-
`,
|
|
215
|
+
`,Bc=({policy:n})=>{const o=v(),{CopyButton:i}=Lt();return e(Pc,{children:[e(Lc,{children:[t(sl,{size:16,fill:o.v2.colors.silver[200]}),t(Fc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:ot.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:St.XS})]}),t(Mc,{children:t(zc,{children:n})})]})},Xc="{{permissions}}";var Uc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Uc||(Uc={}));const Vc=[{id:Uc.DiscoveryOnly,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Pt.Discovery]},{id:Uc.DiscoveryInstrumentation,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Pt.Discovery,Pt.Instrumentation]},{id:Uc.Custom,title:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Hc=(e,t)=>e.features?.find(e=>e.key===t),jc=e=>{if(!e)return[];const t=Hc(e,Pt.Discovery),n=Hc(e,Pt.Instrumentation);return t?t.types.map(e=>{const t=n?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},Gc=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},Wc=(e,t,n)=>{const o=t===Uc.Custom?((e,t)=>{if(!e)return[];const n=jc(e),o=Hc(e,Pt.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Gc();return l(e.auth?.permissions),i&&l(o?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,n??{}):((e,t)=>{if(!e)return[];const n=Vc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=Gc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),o})(e,t),i=(e=>(e?.setup?.artifacts??[]).find(e=>"permissions"===e.section&&"policy-preview"===e.id))(e);return i?((e,t)=>{const{template:n,itemTemplate:o,itemSeparator:i}=e,a=n.split("\n"),l=a.findIndex(e=>e.includes(Xc));if(-1===l)return n;const r=a[l],s=r.slice(0,r.indexOf(Xc));return 0===t.permissions.length?a.splice(l,1):a[l]=t.permissions.map(e=>{return s+(t=e,o.split("{{permission}}").join(t));var t}).join(i),a.join("\n")})(i,{permissions:o}):Kc(o)},Kc=e=>{const t={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:e,Resource:"*"}]};return JSON.stringify(t,null,2)},Yc=b.div`
|
|
216
216
|
width: 100%;
|
|
217
217
|
padding: 12px 16px;
|
|
218
218
|
border-radius: 12px;
|
|
219
219
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
220
220
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
221
|
-
`,
|
|
221
|
+
`,Jc=b.div`
|
|
222
222
|
display: grid;
|
|
223
223
|
grid-template-columns: minmax(0, 1fr) 120px 150px;
|
|
224
224
|
align-items: center;
|
|
225
225
|
row-gap: 16px;
|
|
226
226
|
column-gap: 8px;
|
|
227
|
-
`,
|
|
227
|
+
`,qc=b.div`
|
|
228
228
|
display: flex;
|
|
229
229
|
align-items: center;
|
|
230
230
|
min-width: 0;
|
|
231
|
-
`,
|
|
231
|
+
`,Zc=b(qc)`
|
|
232
232
|
justify-content: center;
|
|
233
|
-
`,
|
|
233
|
+
`,Qc={discovery:!1,instrumentation:!1},ed=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=jc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Yc,{children:e(Jc,{children:[t(qc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Zc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Zc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Qc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(qc,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(Zc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Ot.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Zc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Ot.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},td=b.div`
|
|
234
234
|
display: flex;
|
|
235
235
|
flex-direction: column;
|
|
236
236
|
gap: 8px;
|
|
@@ -239,12 +239,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
239
239
|
padding: 8px;
|
|
240
240
|
border-radius: 0 16px 16px 0;
|
|
241
241
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
242
|
-
`,
|
|
242
|
+
`,nd=b.div`
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 8px;
|
|
246
246
|
width: 100%;
|
|
247
|
-
`,
|
|
247
|
+
`,od=b.div`
|
|
248
248
|
display: flex;
|
|
249
249
|
align-items: center;
|
|
250
250
|
gap: 10px;
|
|
@@ -252,7 +252,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
252
252
|
padding: 4px 12px 4px 4px;
|
|
253
253
|
border-radius: 8px;
|
|
254
254
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
255
|
-
`,
|
|
255
|
+
`,id=b.div`
|
|
256
256
|
display: flex;
|
|
257
257
|
align-items: center;
|
|
258
258
|
justify-content: center;
|
|
@@ -261,30 +261,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
261
261
|
border-radius: 6px;
|
|
262
262
|
flex-shrink: 0;
|
|
263
263
|
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
264
|
-
`,
|
|
264
|
+
`,ad=({message:n})=>{const o=v();return e(od,{children:[t(id,{children:t(cl,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:o.v2.colors.purple[300],children:n})]})},ld=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(td,{children:Vc.map(r=>{const s=r.id===o,c=r.id===Uc.Custom,d=s?e(nd,{children:[c&&t(ed,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Bc,{policy:Wc(n,r.id,a)})]}):void 0,p=s?t(ad,{message:c?ot.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:ot.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Ft,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),rd=b.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-direction: column;
|
|
267
267
|
padding: 16px;
|
|
268
|
-
`,
|
|
268
|
+
`,sd=b.div`
|
|
269
269
|
display: flex;
|
|
270
270
|
flex-direction: column;
|
|
271
271
|
gap: 16px;
|
|
272
272
|
padding: 16px;
|
|
273
273
|
border-radius: 16px;
|
|
274
274
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
275
|
-
`,
|
|
275
|
+
`,cd=b.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 4px;
|
|
279
|
-
`,
|
|
279
|
+
`,dd=b.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
align-items: stretch;
|
|
282
282
|
width: 100%;
|
|
283
|
-
`,
|
|
283
|
+
`,pd=b.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex: 0 0 40%;
|
|
286
286
|
min-width: 0;
|
|
287
|
-
`,
|
|
287
|
+
`,ud=()=>{const{providers:n,genericForm:o}=ar(),[r,s]=l(!0),c=i(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]),p=d(e=>{e!==o.formData.provider&&o.handleFormChange(void 0,void 0,{...o.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[o]);return a(()=>{!o.formData.provider&&n.length>0&&p(n[0].provider)},[n,o.formData.provider,p]),a(()=>{o.formData.permission||o.handleFormChange("permission",Uc.DiscoveryInstrumentation)},[o.formData.permission,o]),t(rd,{children:e(sd,{children:[e(cd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(_e,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:ot.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Mt.CLOSE,onClick:()=>s(!1)}}),e(dd,{children:[t(pd,{children:t(_c,{providers:n,selectedProvider:o.formData.provider,onSelect:p})}),t(ld,{provider:c,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},hd=b.div`
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
gap: 16px;
|
|
@@ -292,12 +292,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
292
292
|
padding: 12px;
|
|
293
293
|
border-radius: 8px;
|
|
294
294
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
295
|
-
`,
|
|
295
|
+
`,md=b.div`
|
|
296
296
|
display: flex;
|
|
297
297
|
align-items: center;
|
|
298
298
|
gap: 12px;
|
|
299
299
|
width: 100%;
|
|
300
|
-
`,
|
|
300
|
+
`,gd=b.div`
|
|
301
301
|
display: flex;
|
|
302
302
|
align-items: center;
|
|
303
303
|
justify-content: center;
|
|
@@ -306,59 +306,59 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
306
306
|
height: 24px;
|
|
307
307
|
border-radius: 16px;
|
|
308
308
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
309
|
-
`,
|
|
309
|
+
`,fd=b.div`
|
|
310
310
|
display: flex;
|
|
311
311
|
flex: 1;
|
|
312
312
|
flex-direction: column;
|
|
313
313
|
gap: 2px;
|
|
314
314
|
min-width: 0;
|
|
315
|
-
`,
|
|
315
|
+
`,bd=b.div`
|
|
316
316
|
display: flex;
|
|
317
317
|
flex-direction: column;
|
|
318
318
|
gap: 10px;
|
|
319
319
|
width: 100%;
|
|
320
320
|
padding-left: 32px;
|
|
321
|
-
`,
|
|
321
|
+
`,vd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(hd,{"data-id":n,children:[e(md,{children:[t(gd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:o})}),e(fd,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:i}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:a})]})]}),l&&t(bd,{children:l})]});var yd,Cd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(yd||(yd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(Cd||(Cd={}));const Sd=[{id:yd.AssumeRole,label:ot.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:ot.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:yd.StaticKeys,label:ot.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:ot.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],xd=[{id:Cd.CloudFormation,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:Cd.Terraform,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:Cd.AwsCli,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:Cd.Manual,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],wd={[Cd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[Cd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[Cd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[Cd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Td=(e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a},kd=b.div`
|
|
322
322
|
display: flex;
|
|
323
323
|
flex-direction: column;
|
|
324
324
|
gap: 16px;
|
|
325
325
|
width: 100%;
|
|
326
|
-
`,
|
|
326
|
+
`,Id=b.div`
|
|
327
327
|
display: flex;
|
|
328
328
|
flex-wrap: wrap;
|
|
329
329
|
gap: 24px;
|
|
330
330
|
width: 100%;
|
|
331
|
-
`,
|
|
331
|
+
`,Ed=b.div`
|
|
332
332
|
display: flex;
|
|
333
333
|
flex: 1 1 calc(50% - 12px);
|
|
334
334
|
min-width: 0;
|
|
335
|
-
`,
|
|
335
|
+
`,Nd=b.div`
|
|
336
336
|
display: flex;
|
|
337
337
|
width: 100%;
|
|
338
338
|
max-width: 479px;
|
|
339
|
-
`,
|
|
339
|
+
`,Od=({step:n})=>{const{genericForm:o,providers:a}=ar(),{provider:l,authMethod:r,accountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>Td(d,r),[d,r]);return t(vd,{"data-id":"cloud-connector-enter-arn",step:n,title:ot.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:ot.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(kd,{children:[t(Nd,{children:t(Ee,{name:"cloud-connector-aws-account-id",width:"100%",label:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>o.handleFormChange("accountId",e.target.value)})}),p.length>0&&t(Id,{children:p.map(e=>t(Ed,{children:t(Ee,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?zt.Password:zt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...c,[n]:i});var n,i}})},e.name))})]})})},$d=b.div`
|
|
340
340
|
display: flex;
|
|
341
341
|
align-items: stretch;
|
|
342
342
|
gap: 10px;
|
|
343
343
|
width: 100%;
|
|
344
|
-
|
|
344
|
+
`,Ad=b.div`
|
|
345
345
|
display: flex;
|
|
346
346
|
flex: 2 1 0;
|
|
347
347
|
flex-direction: column;
|
|
348
348
|
gap: 12px;
|
|
349
349
|
min-width: 0;
|
|
350
350
|
padding: 12px 0;
|
|
351
|
-
`,
|
|
351
|
+
`,Dd=b.div`
|
|
352
352
|
display: flex;
|
|
353
353
|
flex-direction: column;
|
|
354
354
|
gap: 8px;
|
|
355
355
|
width: 100%;
|
|
356
|
-
`,
|
|
356
|
+
`,Rd=b.div`
|
|
357
357
|
display: flex;
|
|
358
358
|
align-items: center;
|
|
359
359
|
gap: 12px;
|
|
360
360
|
width: 100%;
|
|
361
|
-
`,
|
|
361
|
+
`,_d=b.div`
|
|
362
362
|
display: flex;
|
|
363
363
|
align-items: center;
|
|
364
364
|
justify-content: center;
|
|
@@ -367,7 +367,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
367
367
|
height: 24px;
|
|
368
368
|
border-radius: 16px;
|
|
369
369
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
370
|
-
`,
|
|
370
|
+
`,Pd=b.div`
|
|
371
371
|
display: flex;
|
|
372
372
|
flex: 3 1 0;
|
|
373
373
|
flex-direction: column;
|
|
@@ -376,42 +376,42 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
376
376
|
border-radius: 12px;
|
|
377
377
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
378
378
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
379
|
-
`,
|
|
379
|
+
`,Ld=b.div`
|
|
380
380
|
display: flex;
|
|
381
381
|
align-items: center;
|
|
382
382
|
justify-content: flex-end;
|
|
383
383
|
width: 100%;
|
|
384
|
-
`,
|
|
384
|
+
`,Fd=b.div`
|
|
385
385
|
flex: 1;
|
|
386
386
|
width: 100%;
|
|
387
387
|
min-height: 200px;
|
|
388
388
|
max-height: 260px;
|
|
389
389
|
overflow: auto;
|
|
390
390
|
padding: 0 12px 12px;
|
|
391
|
-
`,
|
|
391
|
+
`,Md=b.pre`
|
|
392
392
|
margin: 0;
|
|
393
393
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
394
394
|
font-size: 12px;
|
|
395
395
|
line-height: 20px;
|
|
396
396
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
397
397
|
white-space: pre;
|
|
398
|
-
`,
|
|
398
|
+
`,zd=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=Lt(),{description:l,steps:r,code:s}=(e=>wd[e]??wd[Cd.CloudFormation])(o);return t(vd,{"data-id":"cloud-connector-create-role",step:n,title:ot.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e($d,{children:[e(Ad,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Dd,{children:r.map((n,a)=>e(Rd,{children:[t(_d,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${o}-step-${a}`))})]}),e(Pd,{children:[t(Ld,{children:t(a,{value:s,size:St.XS})}),t(Fd,{children:t(Md,{children:s})})]})]})})},Bd=b.div`
|
|
399
399
|
display: flex;
|
|
400
400
|
flex-direction: column;
|
|
401
401
|
padding: 16px;
|
|
402
|
-
`,
|
|
402
|
+
`,Xd=b.div`
|
|
403
403
|
display: flex;
|
|
404
404
|
flex-direction: column;
|
|
405
405
|
gap: 12px;
|
|
406
406
|
padding: 16px 16px 12px;
|
|
407
407
|
border-radius: 16px;
|
|
408
408
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
409
|
-
`,
|
|
409
|
+
`,Ud=b.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: center;
|
|
412
412
|
gap: 8px;
|
|
413
413
|
width: 100%;
|
|
414
|
-
`,
|
|
414
|
+
`,Vd=b.button`
|
|
415
415
|
display: flex;
|
|
416
416
|
align-items: center;
|
|
417
417
|
justify-content: center;
|
|
@@ -428,38 +428,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
428
428
|
&:hover {
|
|
429
429
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
430
430
|
}
|
|
431
|
-
`,
|
|
431
|
+
`,Hd=b.div`
|
|
432
432
|
display: flex;
|
|
433
433
|
flex: 1;
|
|
434
434
|
flex-direction: column;
|
|
435
435
|
gap: 4px;
|
|
436
436
|
min-width: 0;
|
|
437
|
-
`,
|
|
437
|
+
`,jd=b.div`
|
|
438
438
|
display: flex;
|
|
439
439
|
align-items: center;
|
|
440
440
|
gap: 4px;
|
|
441
441
|
padding: 8px 0 8px 2px;
|
|
442
|
-
`,
|
|
442
|
+
`,Gd=b.div`
|
|
443
443
|
display: flex;
|
|
444
444
|
flex-direction: column;
|
|
445
445
|
gap: 16px;
|
|
446
446
|
width: 100%;
|
|
447
|
-
`,
|
|
447
|
+
`,Wd=b.div`
|
|
448
448
|
display: flex;
|
|
449
449
|
flex-wrap: wrap;
|
|
450
450
|
gap: 24px;
|
|
451
451
|
width: 100%;
|
|
452
|
-
`,
|
|
452
|
+
`,Kd=b.div`
|
|
453
453
|
display: flex;
|
|
454
454
|
flex: 1 1 calc(50% - 12px);
|
|
455
455
|
min-width: 0;
|
|
456
|
-
`,
|
|
456
|
+
`,Yd=e=>{switch(e?.provider){case"azure":return{subtitle:"Configure the Azure subscription and the identity Odigos uses to access it.",accountTitle:"Enter Azure subscription",accountDescription:"Paste the subscription ID that contains the resources Odigos should discover.",authDescription:"Use a service principal for local Central, or choose workload identity only when it is configured on the connector pod.",credentialsTitle:"Enter service principal credentials",credentialsDescription:"Create an app in Microsoft Entra ID, grant its service principal the required role on this subscription, then paste its Directory ID, Application ID, and client secret."};case"gcp":return{subtitle:"Configure the Google Cloud project and the identity Odigos uses to access it.",accountTitle:"Enter Google Cloud project",accountDescription:"Paste the project ID that contains the resources Odigos should discover.",authDescription:"Use a service account key for local Central, or choose workload identity only when it is configured on the connector pod.",credentialsTitle:"Enter service account credentials",credentialsDescription:"Grant the service account the required roles on this project, then paste its complete JSON key."};default:return{subtitle:`Configure the ${e?.displayName??"cloud provider"} account and authentication details.`,accountTitle:"Enter account details",accountDescription:"Enter the provider account identifier that contains the resources Odigos should discover.",authDescription:"Choose how the connector authenticates with this provider.",credentialsTitle:"Enter credentials",credentialsDescription:"Enter the credentials required by the selected authentication method."}}},Jd=({field:e,value:n,onChange:o})=>{const i=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:i,label:a,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:a,value:n};return"textarea"===e.componentType||"credentialsJson"===e.name?t(Re,{...l,minHeight:"120px",onChange:e=>o(e.target.value)}):t(Ee,{...l,width:"100%",type:e.secret?zt.Password:zt.Text,onChange:e=>o(e.target.value)})},qd=()=>{const o=v(),{genericForm:i}=ar(),l=i.formData.authMethod,r=i.formData.setupMethod;a(()=>{l||i.handleFormChange("authMethod",yd.AssumeRole)},[l,i]),a(()=>{r||i.handleFormChange("setupMethod",Cd.CloudFormation)},[r,i]);const s=Sd.find(e=>e.id===l)?.note;return e(n,{children:[e(vd,{"data-id":"cloud-connector-auth-method",step:1,title:ot.CLOUD_CONNECTOR_AUTH_TITLE,description:ot.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:De.S,selected:l,setSelected:e=>i.handleFormChange("authMethod",e),options:Sd.map(e=>({value:e.id,label:e.label}))}),s&&e(jd,{children:[t(pl,{size:16,fill:o.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]})]}),t(vd,{"data-id":"cloud-connector-setup-method",step:2,title:ot.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:ot.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:De.S,selected:r,setSelected:e=>i.handleFormChange("setupMethod",e),options:xd.map(e=>({value:e.id,label:e.label}))})}),t(zd,{step:3,setupMethod:r}),t(Od,{step:4})]})},Zd=({provider:o})=>{const l=v(),{genericForm:r}=ar(),{authMethod:s,accountId:c,credentials:d}=r.formData,p=i(()=>Yd(o),[o]),u=o?.connectorFields?.[0],h=i(()=>(e=>e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??"")(o),[o]),m=i(()=>o?.auth?.methods?.find(e=>e.id===s),[o,s]),g=i(()=>Td(o,s),[o,s]);return a(()=>{if(!o)return;const e=o.auth?.methods?.some(e=>e.id===s);e||r.handleFormChange("authMethod",h)},[o,s,h,r]),e(n,{children:[t(vd,{"data-id":"cloud-connector-account",step:1,title:p.accountTitle,description:p.accountDescription,children:u&&t(Ee,{name:`cloud-connector-account-${u.name}`,width:"100%",label:u.displayName||u.name,required:u.required,tooltip:u.tooltip||void 0,helpMessage:u.tooltip||void 0,placeholder:u.displayName||u.name,value:c,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(vd,{"data-id":"cloud-connector-auth-method",step:2,title:ot.CLOUD_CONNECTOR_AUTH_TITLE,description:p.authDescription,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:De.S,selected:s,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(o?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),m?.description&&e(jd,{children:[t(pl,{size:16,fill:l.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:m.description})]})]}),t(vd,{"data-id":"cloud-connector-provider-credentials",step:3,title:p.credentialsTitle,description:p.credentialsDescription,children:g.length>0?t(Gd,{children:t(Wd,{children:g.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(Kd,{style:n?{flex:"1 1 100%"}:void 0,children:t(Jd,{field:e,value:d[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...d,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:"No stored credentials are required for this authentication method."})})]})},Qd=({onBack:n})=>{const{providers:o,genericForm:a}=ar(),l=i(()=>o.find(e=>e.provider===a.formData.provider),[o,a.formData.provider]),r="aws"===l?.provider,s=i(()=>Yd(l),[l]);return t(Bd,{children:e(Xd,{children:[e(Ud,{children:[t(Vd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(dl,{size:24})}),e(Hd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:r?ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE:s.subtitle})]})]}),r?t(qd,{}):t(Zd,{provider:l})]})})},ep=b.div`
|
|
457
457
|
display: flex;
|
|
458
458
|
flex-direction: column;
|
|
459
459
|
flex: 1;
|
|
460
460
|
min-height: 0;
|
|
461
461
|
padding: 16px;
|
|
462
|
-
`,
|
|
462
|
+
`,tp=b.div`
|
|
463
463
|
display: flex;
|
|
464
464
|
flex-direction: column;
|
|
465
465
|
flex: 1;
|
|
@@ -467,13 +467,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
467
467
|
padding: 16px;
|
|
468
468
|
border-radius: 16px;
|
|
469
469
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
470
|
-
`,
|
|
470
|
+
`,np=b.div`
|
|
471
471
|
display: flex;
|
|
472
472
|
flex: 1;
|
|
473
473
|
align-items: center;
|
|
474
474
|
justify-content: center;
|
|
475
475
|
width: 100%;
|
|
476
|
-
`,
|
|
476
|
+
`,op=b.div`
|
|
477
477
|
display: flex;
|
|
478
478
|
flex-direction: column;
|
|
479
479
|
align-items: center;
|
|
@@ -483,7 +483,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
483
483
|
padding: 24px 8px;
|
|
484
484
|
border-radius: 8px;
|
|
485
485
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
486
|
-
`,
|
|
486
|
+
`,ip=b.div`
|
|
487
487
|
display: flex;
|
|
488
488
|
flex-direction: column;
|
|
489
489
|
align-items: center;
|
|
@@ -492,7 +492,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
492
492
|
padding: 16px;
|
|
493
493
|
border-radius: 12px;
|
|
494
494
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
495
|
-
`,
|
|
495
|
+
`,ap=b.div`
|
|
496
496
|
display: flex;
|
|
497
497
|
align-items: center;
|
|
498
498
|
justify-content: center;
|
|
@@ -501,7 +501,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
501
501
|
height: 39px;
|
|
502
502
|
border-radius: 20px;
|
|
503
503
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
504
|
-
`,
|
|
504
|
+
`,lp=b.div`
|
|
505
505
|
display: flex;
|
|
506
506
|
align-items: flex-start;
|
|
507
507
|
gap: 8px;
|
|
@@ -511,7 +511,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
511
511
|
padding: 12px;
|
|
512
512
|
border-radius: 8px;
|
|
513
513
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
514
|
-
`,
|
|
514
|
+
`,rp=b.pre`
|
|
515
515
|
flex: 1;
|
|
516
516
|
min-width: 0;
|
|
517
517
|
margin: 0;
|
|
@@ -521,25 +521,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
521
521
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
522
522
|
white-space: pre-wrap;
|
|
523
523
|
word-break: break-word;
|
|
524
|
-
`,
|
|
524
|
+
`,sp=b.div`
|
|
525
525
|
display: flex;
|
|
526
526
|
flex-direction: column;
|
|
527
527
|
gap: 12px;
|
|
528
528
|
width: 100%;
|
|
529
|
-
`,
|
|
529
|
+
`,cp=b.div`
|
|
530
530
|
display: flex;
|
|
531
531
|
flex-wrap: wrap;
|
|
532
532
|
gap: 24px;
|
|
533
533
|
padding: 0 2px;
|
|
534
|
-
`,
|
|
534
|
+
`,dp=b.div`
|
|
535
535
|
display: flex;
|
|
536
536
|
gap: 6px;
|
|
537
537
|
min-width: 0;
|
|
538
|
-
`,
|
|
538
|
+
`,pp=b.div`
|
|
539
539
|
display: flex;
|
|
540
540
|
flex-direction: column;
|
|
541
541
|
gap: 8px;
|
|
542
|
-
`,
|
|
542
|
+
`,up=b.div`
|
|
543
543
|
display: flex;
|
|
544
544
|
flex-direction: column;
|
|
545
545
|
gap: 6px;
|
|
@@ -547,7 +547,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
547
547
|
border-radius: 12px;
|
|
548
548
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
549
549
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
550
|
-
`,up=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Pt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(Qd,{children:t(ep,{children:n?t(tp,{children:t(np,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(tp,{children:e(op,{children:[t(ip,{children:t(Qa,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(ap,{children:[t(lp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(rp,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Za,fullWidth:!0}),(a.accountId||a.identity)&&e(sp,{children:[a.accountId&&e(cp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(cp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(dp,{children:a.checks.map(n=>e(pp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Za:Qa}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(tp,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var hp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(hp||(hp={}));const mp=hp.SelectProvider,gp=hp.Validate,fp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ir(),[p,u]=l(mp),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===mp,k=p===gp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),E=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>mp?e-1:e)},[]),N=d(()=>{if(x(void 0),p===hp.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<gp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:o,authMethod:i,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!o.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!i)return void x("Please select an authentication method");const m=((e,t,n)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return;const i=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!i(e.name)),l=a(o.fields);if(l)return l;if(!o.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=o.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of o.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>i(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,i,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const o=Hc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Xc.DiscoveryOnly:a=!0;break;case Xc.DiscoveryInstrumentation:a=!0,l=o;break;case Xc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(p,t,n);u(hp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:o.trim(),capabilities:g});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),D=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),R=i(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:cl,onClick:E,disabled:$},[T,I,E,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:pl,onClick:O}:void 0}return p===hp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:N,disabled:$}},[k,g,A,p,O,N,$]),P=i(()=>[R,_].filter(Boolean),[R,_]);return e(zt,{width:Or,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:D,actions:P},children:[p===hp.SelectProvider&&t(pd,{}),p===hp.Config&&t(Zd,{onBack:E}),p===hp.Validate&&t(up,{isTesting:g,error:y,result:b}),t($r,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},bp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Xt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},vp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},yp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c}=S(),{actionsApi:u}=Gl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=jl(),x=p(m);x.current=m,a(()=>{x.current()},[]);const[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(null),O=w&&!!C?.isFormDirty;a(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>g.find(({type:e})=>e===$?.type)??Gt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),D=$?.statuses&&Array.isArray($.statuses)?$.statuses:null;a(()=>{$&&b($,A)},[$,A]);const R=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?N("close"):o()},[O,o]),L=d(()=>{O?N("cancel"):_()},[O,_]),F=d(()=>{const e=E;N(null),"close"===e?(_(),o()):_()},[E,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Ht.SourceScopes),j=H?.name||de.Scopes,G=$.fields?.[j]??null,W=c&&(!!H||void 0!==$.fields?.scopes);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:Yt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:ja,active:w,onClick:R},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:w&&f?t(Ns,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&(D?t(bp,{statuses:D}):t(Kt,{conditions:$.conditions||[]})),t(Wt,{bgTint:"800",cellsPerRow:2,items:vp($,A)})]}),W&&t(vr,{readOnly:!0,scopes:G}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t(Ar,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t($r,{isOpen:null!==E,onClose:()=>N(null),onApprove:F})]})},Cp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Gl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Jt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Nr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(is,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{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=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Sp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},xp=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Gl(),{selectedStreamName:h}=ot(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Wl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,D=i(()=>Qt(m,h),[m,h]),R=i(()=>D?.find(e=>jt(e)===r),[r,D]),_=f?.destinationCategories?.categories??null;a(()=>{R&&_&&C(R,_)},[R,_]);const P=i(()=>R&&_?en(_,R):[],[R,_]),L=d(()=>{R&&I(!0)},[R]),F=d(()=>{R&&_&&(C(R,_),I(!1))},[R,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(R.id,Be(t)),I(!1))}},[R,x,u]),U=d(()=>{R&&N(!0)},[R]),V=d(async()=>{R&&(await u.remove(R.id),o())},[R,u,o]);if(!R)return null;const{icon:H,iconSrc:j}=wt(R.destinationType.type),G=((e,t)=>{const n=[],o=qt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Zt(h,a,i))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(R,P);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:H,iconSrc:j,title:R.name||R.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:ja,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t($s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&t(Kt,{conditions:R.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:Sp(R)})]}),!!G.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Wt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Wt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Ar,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t($r,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},wp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},Tp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=tn(),{isK8s:p}=S(),{instrumentationRulesApi:u}=Gl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Kl();a(()=>{m()},[]);const[C,x]=l(!1),[w,T]=l(!1),[k,I]=l(null),E=C&&!!y?.isFormDirty,{options:N}=u.useRuleTypes(),O=i(()=>N.length?N:It,[N]),$=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),D=i(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);a(()=>{$&&A&&f($,A)},[$,A]);const R=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,c]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{E?I("close"):o()},[E,o]),L=d(()=>{E?I("cancel"):_()},[E,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,c]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U,V.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;return e(n,{children:[t(zt,{isOpen:!0,header:{icon:on($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:ja,active:C,onClick:R},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[p&&t(Kt,{conditions:$.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:wp($,A)})]}),p&&t(vr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===Je.CustomInstrumentation&&!!$.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})}),!!D.length&&t(Wt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:D.map(e=>t(nn,{label:et(e),leftIcon:Qe(e),flex:D.length>1?"0.5":"1"},e))})})})]})})})}),t(Ar,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t($r,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var kp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(kp||(kp={}));const Ip=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=an(),m=ln(!!n),g=i(()=>({title:l,icon:hl,withCopy:!0}),[l]),f=i(()=>{const e=[],t=rn(c);t&&e.push(t);const n=rn(d,sl,"health");n&&e.push(n);const o=rn(p,ml,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:pl,label:Ft.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):nt.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Wt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ep=b.div`
|
|
550
|
+
`,hp=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Lt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(ep,{children:t(tp,{children:n?t(np,{children:t(op,{children:t(xt,{withVisual:!0,withGradient:!0,title:ot.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(np,{children:e(ip,{children:[t(ap,{children:t(el,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:ot.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(lp,{children:[t(rp,{children:p}),t(r,{value:p,size:St.XS})]})]})}):a?e(sp,{children:[t(ce,{status:Pe.Success,label:ot.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Qa,fullWidth:!0}),(a.accountId||a.identity)&&e(cp,{children:[a.accountId&&e(dp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(dp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(pp,{children:a.checks.map(n=>e(up,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Qa:el}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(np,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var mp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(mp||(mp={}));const gp=mp.SelectProvider,fp=mp.Validate,bp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ar(),[p,u]=l(gp),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===gp,k=p===fp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),E=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>gp?e-1:e)},[]),N=d(()=>{if(x(void 0),p===mp.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<fp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:o,authMethod:i,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!o.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!i)return void x("Please select an authentication method");const m=((e,t,n)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return;const i=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!i(e.name)),l=a(o.fields);if(l)return l;if(!o.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=o.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of o.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>i(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,i,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const o=jc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Uc.DiscoveryOnly:a=!0;break;case Uc.DiscoveryInstrumentation:a=!0,l=o;break;case Uc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(p,t,n);u(mp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:o.trim(),capabilities:g});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),D=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),R=i(()=>T?{"data-id":"cloud-connector-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Mt.BACK,variant:Ie.Text,leftIcon:dl,onClick:E,disabled:$},[T,I,E,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Mt.RETRY,variant:Ie.Primary,rightIcon:ul,onClick:O}:void 0}return p===mp.Config?{"data-id":"cloud-connector-verify",label:Mt.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Mt.NEXT,variant:Ie.Primary,onClick:N,disabled:$}},[k,g,A,p,O,N,$]),P=i(()=>[R,_].filter(Boolean),[R,_]);return e(Bt,{width:$r,isOpen:!0,hideOverlay:!$&&!o,header:{icon:rl,title:ot.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:D,actions:P},children:[p===mp.SelectProvider&&t(ud,{}),p===mp.Config&&t(Qd,{onBack:E}),p===mp.Validate&&t(hp,{isTesting:g,error:y,result:b}),t(Ar,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},vp=({statuses:e})=>{const n=i(()=>Xt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Ut(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Vt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},yp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:ot.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:ot.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:ot.NOTES,label:e.notes}),n},Cp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=Wl(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=Gl(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const D=i(()=>g?.find(e=>Gt(e)===r),[r,g]),R=i(()=>b.find(({type:e})=>e===D?.type)??gt(u,h).find(({type:e})=>e===D?.type)??Wt.find(({type:e})=>e===D?.type)??null,[b,D?.type,u,h]),_=D?.statuses&&Array.isArray(D.statuses)?D.statuses:null;a(()=>{D&&C(D,R)},[D,R]);const P=d(()=>{D&&I(!0)},[D]),L=d(()=>{D&&(C(D,R),I(!1))},[D,R,C]),F=d(()=>{A?$("close"):o()},[A,o]),M=d(()=>{A?$("cancel"):L()},[A,L]),z=d(()=>{const e=O;$(null),"close"===e?(L(),o()):L()},[O,L,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(D.id,t),I(!1))}},[D,x,m]),X=d(()=>{D&&N(!0)},[D]),U=d(async()=>{D&&(await m.remove(D.id,D.type),o())},[D,m,o]);if(!D||!R)return null;const V=(H=D,j=R,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=R.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=D.fields?.[W]??null,Y=c&&(!!G||void 0!==D.fields?.scopes);return e(n,{children:[t(Bt,{isOpen:!0,header:{icon:Jt(D.type),title:R.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Mt.EDIT,icon:Ga,active:k,onClick:P},{id:"edit-action-btn-delete",label:Mt.DELETE,icon:za,color:s.v2.colors.red[500],active:E,onClick:X}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-action-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Os,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[c&&(_?t(vp,{statuses:_}):t(Yt,{conditions:D.conditions||[]})),t(Kt,{bgTint:"800",cellsPerRow:2,items:yp(D,R)}),Y&&t(yr,{readOnly:!0,scopes:K}),!!V?.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",cellsPerRow:2,items:V})})]})})})}),t(Dr,{target:"action",isOpen:E,onClose:()=>N(!1),onApprove:U}),t(Ar,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},Sp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Wl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=qt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Or,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:hl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Ot.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(as,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{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=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},xp=e=>{const t=[{id:"type",title:ot.TYPE,label:e.destinationType.displayName},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:ot.MONITORS,label:n}),e.name&&t.push({id:"name",title:ot.NAME,label:e.name}),t},wp=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Wl(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Kl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,D=i(()=>en(m,h),[m,h]),R=i(()=>D?.find(e=>Gt(e)===r),[r,D]),_=f?.destinationCategories?.categories??null;a(()=>{R&&_&&C(R,_)},[R,_]);const P=i(()=>R&&_?tn(_,R):[],[R,_]),L=d(()=>{R&&I(!0)},[R]),F=d(()=>{R&&_&&(C(R,_),I(!1))},[R,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(R.id,Be(t)),I(!1))}},[R,x,u]),U=d(()=>{R&&N(!0)},[R]),V=d(async()=>{R&&(await u.remove(R.id),o())},[R,u,o]);if(!R)return null;const{icon:H,iconSrc:j}=Tt(R.destinationType.type),G=((e,t)=>{const n=[],o=Zt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Qt(h,a,i))return;const{type:g}=It(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===jt.MultiInput){const t=It(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===jt.KeyValuePair){const t=It(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(R,P);return e(n,{children:[t(Bt,{isOpen:!0,header:{icon:H,iconSrc:j,title:R.name||R.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Mt.EDIT,icon:Ga,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Mt.DELETE,icon:za,color:s.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Mt.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})}):k&&y?t(As,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[e(Kt,{bgTint:"900",children:[c&&t(Yt,{conditions:R.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:xp(R)})]}),!!G.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Kt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Kt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Dr,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t(Ar,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},Tp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}];return e.ruleName&&n.push({id:"name",title:ot.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:ot.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:ot.NOTES,label:e.notes}),n},kp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=qe(u,h),{instrumentationRulesApi:g}=Wl(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=Yl();a(()=>{b()},[]);const[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),D=i(()=>A.length?A:Et,[A]),R=i(()=>f?.find(e=>Gt(e)===r),[r,f]),_=i(()=>D.find(({type:e})=>e===R?.type)??null,[D,R?.type]),P=i(()=>Ze(_?.supportedLanguages),[_?.supportedLanguages]);a(()=>{R&&_&&C(R,_)},[R,_]);const L=d(()=>{if(R){if(!R.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:R.ruleId,hideFromHistory:!0});k(!0)}},[R,c]),F=d(()=>{R&&_&&(C(R,_),k(!1))},[R,_,C]),M=d(()=>{$?O("close"):o()},[$,o]),z=d(()=>{$?O("cancel"):F()},[$,F]),B=d(()=>{const e=N;O(null),"close"===e?(F(),o()):F()},[N,F,o]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(R.ruleId,t,R.type),k(!1))}},[R,x,g]),U=d(()=>{if(R){if(!R.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:R.ruleId,hideFromHistory:!0});E(!0)}},[R,c]),V=d(async()=>{R&&(await g.remove(R.ruleId,R.type),o())},[R,g,o]);if(!R||!_)return null;const H=(j=R,G=_,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Bt,{isOpen:!0,header:{icon:an(R.type),title:_.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Mt.EDIT,icon:Ga,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Mt.DELETE,icon:za,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-rule-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(zs,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[p&&t(Yt,{conditions:R.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:Tp(R,_)}),m&&t(yr,{readOnly:!0,scopes:R.sourceScopes??null}),_.type===Je.CustomInstrumentation&&!!R.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H?.length&&t(Kt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",cellsPerRow:2,items:H})}),!!P.length&&t(Kt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:P.map(e=>t(on,{label:tt(e),leftIcon:et(e),flex:P.length>1?"0.5":"1"},e))})})})]})})})}),t(Dr,{target:"instrumentation rule",isOpen:I,onClose:()=>E(!1),onApprove:V}),t(Ar,{isOpen:null!==N,onClose:()=>O(null),onApprove:B})]})};var Ip;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ip||(Ip={}));const Ep=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=ln(),m=rn(!!n),g=i(()=>({title:l,icon:ml,withCopy:!0}),[l]),f=i(()=>{const e=[],t=sn(c);t&&e.push(t);const n=sn(d,cl,"health");n&&e.push(n);const o=sn(p,gl,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:ul,label:Mt.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:ot.NODE,label:r,withCopy:!0},{id:"age",title:ot.AGE,label:s?h(s,{style:"short"}):ot.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Kt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Np=b.div`
|
|
551
551
|
display: flex;
|
|
552
552
|
align-items: center;
|
|
553
553
|
justify-content: space-between;
|
|
@@ -555,7 +555,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
555
555
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
556
556
|
border-radius: 12px;
|
|
557
557
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
558
|
-
`,
|
|
558
|
+
`,Op=({podsOdigosHealthStatus:n,pods:o,noPadding:a})=>{const l=dn(n?.status),r=Ut(n?.name),s=n?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=i(()=>({totalPodsCount:o?.length||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===cn.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===cn.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(Np,{$noPadding:a,children:[t(Vt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Ap,{label:ot.PODS,count:c}),t(Ap,{label:ot.ODIGOS_HEALTHY,icon:cl,count:d,total:c}),t(Ap,{label:ot.KUBERNETES_HEALTHY,icon:gl,count:p,total:c})]})]}):null},$p=b.div`
|
|
559
559
|
display: flex;
|
|
560
560
|
flex-direction: column;
|
|
561
561
|
justify-content: center;
|
|
@@ -566,7 +566,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
566
566
|
width: fit-content;
|
|
567
567
|
border-radius: 8px;
|
|
568
568
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
569
|
-
|
|
569
|
+
`,Ap=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e($p,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:i})]})]})},Dp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===pn.PID)??e.identifyingAttributes?.find(({name:e})=>e===pn.VPID);return t?.value??null};var Rp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Rp||(Rp={}));const _p=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(Rp.IdentifyingAttributes),m=rn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:Rp.IdentifyingAttributes,label:ot.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Rp.InstrumentationLibraries,label:ot.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(fl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);a(()=>{f&&h(f)},[f]);const y=i(()=>{switch(u){case Rp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(zp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case Rp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=i(()=>Dp({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Kt,{bgTint:"800",richTitle:{title:C?`${ot.PROCESS} ${ot.PID(C)}`:ot.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:o?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:o?Pe.Success:Pe.Error,leftIcon:cl,label:o?ot.HEALTHY:ot.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},Pp=b.div`
|
|
570
570
|
display: flex;
|
|
571
571
|
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
572
572
|
gap: 8px;
|
|
@@ -575,23 +575,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
575
575
|
&:hover {
|
|
576
576
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
577
577
|
}
|
|
578
|
-
`,Pp=b(ee)`
|
|
579
|
-
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
580
578
|
`,Lp=b(ee)`
|
|
579
|
+
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
580
|
+
`,Fp=b(ee)`
|
|
581
581
|
flex: 1 1 auto;
|
|
582
582
|
min-width: 0;
|
|
583
|
-
`,
|
|
583
|
+
`,Mp=b(oe)`
|
|
584
584
|
flex: 1 1 auto;
|
|
585
585
|
justify-content: flex-end;
|
|
586
586
|
min-width: 0;
|
|
587
|
-
`,
|
|
587
|
+
`,zp=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Pp,{$withHealthBadge:r,children:[t(Lp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),o&&t(Fp,{size:te.XXS,color:ne.Primary,align:"right",children:o}),(i||r)&&e(Mp,{children:[i&&t(ce,{status:Pe.Info,label:ot.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(oe,{$gap:4,children:[l&&t(Fp,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?ot.HEALTHY:ot.NOT_HEALTHY,leftIcon:cl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Bp=h(null),Xp=({value:e,children:n})=>t(Bp.Provider,{value:e,children:n}),Up=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const a=e??[],l=i(()=>({title:ot.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=i(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Kt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=o?.containerName===e.containerName;return t(Hp,{...e,language:un(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Vp=b.div`
|
|
588
588
|
display: flex;
|
|
589
589
|
flex-direction: column;
|
|
590
590
|
gap: 12px;
|
|
591
591
|
padding: 8px 12px;
|
|
592
592
|
border-radius: 8px;
|
|
593
593
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
594
|
-
`,
|
|
594
|
+
`,Hp=({language:n,containerName:o,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=ln(),C=rn(v),S=i(()=>({title:o,icon:n?hn(n):bl,iconWithWrapper:!0}),[o,n]),x=i(()=>{const e=[],t=sn({status:a?cn.Success:cn.Disabled,reasonEnum:a?ot.INSTRUMENTED_WITH_DISTRO(a):ot.UNINSTRUMENTED,message:""});t&&e.push(t);const n=sn(h,cl,"health");n&&e.push(n);const o=sn(m,gl,"health");return o&&e.push(o),e},[m,h,a]),w=i(()=>{const e=[{id:"runningTime",title:ot.RUNNING_TIME,label:l?y(l,{style:"short"}):ot.NOT_RUNNING,labelTooltip:`${ot.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Ua:Va,label:r?ot.STARTED:ot.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Ua:Va,label:s?ot.READY:ot.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Va,label:ot.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:ot.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c]),T=i(()=>u?Ut(p):"",[u,p]);return t("div",{ref:C,children:e(Kt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Vp,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(on,{variant:mn.Pink,leftIcon:gl,label:T}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&Dp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(_p,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},jp=({podName:e,namespace:n,hasRestarted:o})=>{const a=i(()=>({title:ot.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=i(()=>[{label:ot.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:ot.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:ot.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Kt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(gn,{bgTint:"700",label:e,value:n},e))})},Gp=({source:o,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(Bp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Ip.Pods?l:null,s=o?.pods??[],c=s.length>0,d=i(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=i(()=>({title:ot.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(Op,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Kt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const i=r?.podName===n.podName,l=i&&!r?.containerName;return e(Ep,{...n,namespace:o.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(jp,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Up,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:i?r:null})]},`pod-${n.podName}`)})})]}):t(bt,{$height:"70vh",children:t($e,{title:ot.NO_RUNNING_PODS,subTitle:ot.NO_RUNNING_PODS_SUBTITLE})})})},Wp="user",Kp=({source:n})=>{const o=i(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=Wl(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(bt,r?{$height:"70vh",children:t(xt,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:ot.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(Yp,{icon:vl,title:ot.INBOUND,subTitle:ot.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Yp,{icon:yl,title:ot.OUTBOUND,subTitle:ot.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Yp=({icon:n,title:o,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=i(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Kt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:fn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:ul,onClick:r}}],children:[t(bn,{value:c,onChange:d,width:"100%"}),t(vn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(bt,{$height:"50vh",children:t($e,{icon:n,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(qp,{...e},`${o}-${e.serviceName}`)):[t(bt,{$height:"50vh",children:t($e,{icon:n,title:`No ${o} connections yet`,subTitle:o===ot.INBOUND?ot.NO_INBOUND_CONNECTIONS_DESCRIPTION:ot.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Jp=b.div`
|
|
595
595
|
display: flex;
|
|
596
596
|
align-items: center;
|
|
597
597
|
justify-content: space-between;
|
|
@@ -605,9 +605,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
605
605
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
606
606
|
}
|
|
607
607
|
`}
|
|
608
|
-
`,
|
|
608
|
+
`,qp=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=yn(e=>e.drawerEntityId),{items:r}=Wl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(Cn(s))!==JSON.stringify(Cn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Sn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Wp)return[Cl];const e=s?xn(s):void 0;return e?.length?e:[bl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=yn.getState();e(Tn(Nt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Jp,{onClick:p,$withClick:!!p,children:[e(oe,{$gap:8,children:[t(wn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),o&&t(ce,{status:Pe.Info,label:ot.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:ot.VIRTUAL_TOOLTIP})]})},Zp=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Qp=({source:n})=>{const o=v(),{k8sManifestApi:r}=Wl(),[s,c]=l(!0),[d,p]=l(void 0),[u,h]=l(!0),[m,g]=l(void 0),[f,b]=l(!0),[y,C]=l({});a(()=>{r.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(Zp(e))).finally(()=>c(!1)),r.fetch({namespace:n.id.namespace,kind:kn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Zp(e))).finally(()=>h(!1))},[n.id.namespace,n.id.kind,n.id.name]);const S=i(()=>(n.pods??[]).map(e=>e.podName).join(","),[n.pods]);a(()=>{if(Object.keys(y).length>0)return;const e=S?S.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await r.fetch({namespace:n.id.namespace,kind:kn.Pod,name:e});return[e,Zp(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[y,S,n.id.namespace]);const x=i(()=>[{label:ot.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:ot.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:ot.GET_POD_YAML,value:`kubectl get ${kn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Kt,{bgTint:"1000",children:[t(Kt,{bgTint:"900",richTitle:{icon:Sl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:x.map(({label:e,value:n},o)=>t(gn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(re,{size:1}):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(re,{size:1}):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),n.pods?.map(e=>f?t(re,{size:1},e.podName):t(Rr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},eu=({title:n,children:o})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),tu=({source:n})=>{const o=i(()=>{const[e,t]=En(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(eu,{title:ot.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:o.value}),t(ee,{size:te.XS,variant:$t.Span,children:o.units})]})})},nu=({source:n})=>{const{CopyButton:o}=Lt();return t(eu,{title:ot.NAMESPACE,children:e(oe,{children:[t(on,{variant:mn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:St.XS})]})})},ou=({source:n})=>{const{CopyButton:o}=Lt(),i=n.id.region;return i?t(eu,{title:ot.REGION,children:e(oe,{children:[t(on,{variant:mn.Blue,label:i}),t(o,{value:i,size:St.XS})]})}):null},iu=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(eu,{title:ot.ENABLED,children:t(oe,{children:t(on,{variant:n?mn.Green:mn.Default,label:n?ot.ENABLED:ot.DISABLED})})})},au=({source:e,label:n})=>t(eu,{title:ot.KIND,children:t(oe,{children:t(on,{variant:mn.Blue,label:n||e.id.kind})})}),lu=({source:n})=>{const{CopyButton:o}=Lt();return t(eu,{title:ot.NAME,children:e(oe,{children:[t(on,{variant:mn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:St.XS})]})})},ru=({source:n})=>{const{CopyButton:o}=Lt(),i=n.serviceName||n.id.name;return t(eu,{title:ot.SERVICE_NAME,children:e(oe,{children:[t(on,{variant:mn.Blue,label:i}),t(o,{value:i,size:St.XS})]})})},su=({source:n})=>{const{isK8s:o,isConnector:a}=S(),l=i(()=>In(n.id.kind),[n.id.kind]);return t(Kt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[o&&t(tu,{source:n}),t(iu,{source:n}),a&&t(ou,{source:n}),o&&t(nu,{source:n}),t(au,{source:n,label:l}),t(lu,{source:n}),!o&&t(ru,{source:n})]})})},cu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Kt,{bgTint:"900",children:t(Op,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,du=({source:e})=>{const n=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Nn(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Vt,{...n,width:"100%"}):null},pu=h(null),uu=b.div`
|
|
609
609
|
position: relative;
|
|
610
|
-
`,
|
|
610
|
+
`,hu=({children:e})=>{const n=p(null);return t(uu,{ref:n,children:t(pu.Provider,{value:n,children:e})})},mu=b.div`
|
|
611
611
|
position: fixed;
|
|
612
612
|
top: ${({$coords:e})=>e.top}px;
|
|
613
613
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -621,25 +621,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
621
621
|
padding: 12px 16px;
|
|
622
622
|
border-radius: 12px;
|
|
623
623
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
624
|
-
`,
|
|
624
|
+
`,gu=b.div`
|
|
625
625
|
display: flex;
|
|
626
626
|
align-items: flex-end;
|
|
627
627
|
justify-content: space-between;
|
|
628
628
|
gap: 8px;
|
|
629
|
-
`,
|
|
629
|
+
`,fu=b.div`
|
|
630
630
|
flex: 1;
|
|
631
|
-
`,
|
|
631
|
+
`,bu=({width:n,onClose:o,onSave:i,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(pu),[y,C]=l(null);return On(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Mr(e(mu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(gu,{children:[t(fu,{children:u}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:za,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:i,leftIcon:Qa,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:p})})]}),document.body):null},vu=({language:n,overridden:o,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=i(()=>{if(!n)return[];const e=$n[n].community,t=s===An.Onprem?$n[n].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))},[n,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[o?t(ce,{status:Pe.Info,invertColors:!0,label:ot.OVERIDDEN}):null,e(hu,{children:[t(Ue,{text:ot.OVERRIDE_OTEL_DISTRO_NAME,children:t(Ct,{icon:Ga,onClick:b})}),g&&t(bu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:ot.OVERRIDE_OTEL_DISTRO_NAME,subTitle:ot.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:ot.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(yt,{label:ot.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},yu=({overridden:n,onOverride:o,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=i(()=>Dn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(oe,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:ot.OVERIDDEN}):null,e(hu,{children:[t(Ue,{text:ot.OVERRIDE_RUNTIME_DETAILS,children:t(Ct,{icon:Ga,onClick:b})}),g&&t(bu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Rn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Pe.Warning,message:Ye.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:ot.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:ot.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:ot.OVERRIDE_RUNTIME_DETAILS,subTitle:ot.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:ot.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(yt,{label:ot.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ee,{label:ot.RUNTIME_VERSION,placeholder:ot.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},Cu=b.div`
|
|
632
632
|
display: flex;
|
|
633
633
|
flex-direction: column;
|
|
634
634
|
gap: 10px;
|
|
635
635
|
padding: 10px 12px 10px 20px;
|
|
636
636
|
border-radius: 8px;
|
|
637
637
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
638
|
-
`,
|
|
638
|
+
`,Su=b.div`
|
|
639
639
|
display: flex;
|
|
640
640
|
flex-wrap: wrap;
|
|
641
641
|
gap: 12px 24px;
|
|
642
|
-
`,
|
|
642
|
+
`,xu=({title:n,children:o})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),wu=({processes:n})=>{const o=i(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return o.length?e(ae,{$gap:6,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:`${ot.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(Cu,{children:[t(Su,{children:t(xu,{title:ot.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),o?t(gn,{label:ot.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(gn,{label:ot.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},Tu=b.div`
|
|
643
643
|
display: flex;
|
|
644
644
|
flex-direction: column;
|
|
645
645
|
align-self: stretch;
|
|
@@ -647,14 +647,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
647
647
|
padding: 8px 12px;
|
|
648
648
|
border-radius: 8px;
|
|
649
649
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
650
|
-
`,
|
|
650
|
+
`,ku=b.div`
|
|
651
651
|
display: flex;
|
|
652
652
|
align-items: center;
|
|
653
653
|
justify-content: center;
|
|
654
654
|
padding: 8px;
|
|
655
655
|
border-radius: 10px;
|
|
656
656
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
657
|
-
`,
|
|
657
|
+
`,Iu=e=>{if(!e)return _n.Unknown;const t=e.trim().toLowerCase();return{go:_n.Go,golang:_n.Go,javascript:_n.JavaScript,js:_n.JavaScript,node:_n.JavaScript,nodejs:_n.JavaScript,typescript:_n.JavaScript,python:_n.Python,java:_n.Java,dotnet:_n.DotNet,csharp:_n.CSharp,php:_n.Php,ruby:_n.Ruby,rust:_n.Rust,swift:_n.Swift,elixir:_n.Elixir}[t]??_n.Unknown},Eu=({source:n})=>{const o=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=Wl(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=i(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=i(()=>{const e=Iu(s?.runtimeLanguage);return e!==_n.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??_n.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=i(()=>{const e=Iu(c?.runtimeOverride?.language);return{language:e!==_n.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=i(()=>!!c?.distroOverride?.otelDistroName,[c]),f=i(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=i(()=>{const{language:e,version:t}=m;return e!==_n.Unknown||t?e!==_n.Unknown&&t?`${e} • ${t}`:e!==_n.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=i(()=>y||m.language===_n.Unknown?bl:hn(m.language),[y,m.language]),x=i(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,n=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Pe.Loading,label:Ut(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Pe.Disabled,leftIcon:Va,label:Ut(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Va,label:"Error"}:t?{status:Pe.Success,leftIcon:Ua,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Va,label:ot.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==_n.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Kt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTATION,tooltip:ot.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(Tu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(ku,{children:t(C,{size:24,fill:y||m.language===_n.Unknown?o.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(on,{variant:mn.Loader,label:ot.DETECTING_RUNTIME_INFO}):b?t(on,{variant:mn.Blue,label:b}):null,t(yu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==_n.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==_n.Unknown?u:void 0,version:h}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(vu,{language:m.language!==_n.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(wu,{processes:d}):null]})})}):null},Nu="100%",Ou=b(oe)`
|
|
658
658
|
@media (max-width: 1099px) {
|
|
659
659
|
flex-direction: column;
|
|
660
660
|
|
|
@@ -662,12 +662,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
662
662
|
width: 100%;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
|
|
665
|
+
`,$u=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Ut(e):`${t} ${Ut(e)}`:t,Au=b(oe)`
|
|
666
666
|
width: fit-content;
|
|
667
667
|
padding: 2px 6px;
|
|
668
668
|
border-radius: 8px;
|
|
669
669
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
670
|
-
`,
|
|
670
|
+
`,Du=({overview:n,status:o})=>{const i=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(Au,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:o,d=Ln(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:Pn(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Ru=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},_u=({source:n,onClickRollout:o,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=i(()=>{const{status:e,reasonEnum:i,message:a,actionItems:r}=l||{},s=dn(e);if(!s)return null;const c=$u(i,ot.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:xl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Du,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Ru,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,o]),s=i(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=n.autoRollback?.autoRollbackStatus||{},l=dn(e);if(!l)return null;const r=$u(t,ot.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ul,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:ot.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:ul,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(Ou,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Nu,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":Nu,...s})]}):null},Pu=({source:e})=>{const{isK8s:n}=S(),{containers:o,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${ot.CONTAINERS}`:ot.DETECTED_PROCESSES,tooltip:t?.message||(n?ot.DETECTED_CONTAINERS_DESCRIPTION:ot.DETECTED_PROCESSES_DESCRIPTION),badge:dn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return o.length?t(Kt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(zu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},Lu=b.div`
|
|
671
671
|
display: flex;
|
|
672
672
|
flex-direction: column;
|
|
673
673
|
align-self: stretch;
|
|
@@ -675,26 +675,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
675
675
|
padding: 8px 12px;
|
|
676
676
|
border-radius: 8px;
|
|
677
677
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
678
|
-
`,
|
|
678
|
+
`,Fu=b.div`
|
|
679
679
|
display: flex;
|
|
680
680
|
align-items: center;
|
|
681
681
|
justify-content: center;
|
|
682
682
|
padding: 8px;
|
|
683
683
|
border-radius: 10px;
|
|
684
684
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
685
|
-
`,
|
|
685
|
+
`,Mu=b.div`
|
|
686
686
|
display: flex;
|
|
687
687
|
flex-direction: column;
|
|
688
688
|
gap: 12px;
|
|
689
689
|
padding: 8px 12px;
|
|
690
690
|
border-radius: 8px;
|
|
691
691
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
692
|
-
`,
|
|
692
|
+
`,zu=({sourceId:n,...o})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=v(),{sourcesApi:d}=Wl(),p=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=i(()=>({language:un(o),version:Fn(o)||void 0}),[o]),h=i(()=>!!s?.otelDistroName,[s]),m=i(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=i(()=>!l&&!p,[l,p]),f=i(()=>g?bl:hn(u.language),[g,u]),b=i(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=i(()=>g?{status:Pe.Loading,label:ot.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?Ua:Va,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:a,...h?m:{},...p?u:{},...e}),S=i(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(ot.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(ot.TAIL_SAMPLING),e},[o]);return e(Lu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Fu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(on,b?{variant:mn.Blue,label:b}:{variant:mn.Loader,label:ot.DETECTING_RUNTIME_INFO}),t(yu,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...y,textSize:te.XXXS}),t(vu,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Mu,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(on,{variant:mn.Pink,label:Ut(r.agentEnabledStatus?.reasonEnum)||ot.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Mu,{children:t(oe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:Ua,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},Bu=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a}=S();return e(ae,{$gap:12,children:[t(su,{source:n}),t(du,{source:n}),a&&t(_u,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(Pu,{source:n}),!a&&t(Eu,{source:n}),a&&t(cu,{source:n})]})},Xu=({source:e})=>{const n=e.containers||[];return t(Kt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Kt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ae,{children:n.map((e,n)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t($e,{title:"No libraries found"})},e.containerName)}):t($e,{title:"No containers found"})})},Uu=b(ae)`
|
|
693
693
|
width: 100%;
|
|
694
694
|
max-height: 320px;
|
|
695
695
|
overflow-y: auto;
|
|
696
696
|
gap: 8px;
|
|
697
|
-
`,
|
|
697
|
+
`,Vu=b(oe)`
|
|
698
698
|
width: 100%;
|
|
699
699
|
align-items: center;
|
|
700
700
|
gap: 8px;
|
|
@@ -704,14 +704,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
704
704
|
& > * {
|
|
705
705
|
font-family: monospace !important;
|
|
706
706
|
}
|
|
707
|
-
`,Vu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(tt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Xu,{children:[n.add.map(n=>e(Uu,{children:[t(ce,{leftIcon:za,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Uu,{children:[t(ce,{leftIcon:xl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function Hu(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function ju(e){const t=Math.abs(e);return t>=1e9?`${Gu(e/1e9)}s`:t>=1e6?`${Gu(e/1e6)}ms`:t>=1e3?`${Gu(e/1e3)}μs`:String(Math.round(e))}function Gu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Wu(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Ku(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Yu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Ju(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>Hu(e,t.nameIndex))}function qu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&Hu(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Zu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){i.push(e);break}}return i}function Qu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function eh(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var th,nh;function oh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ih(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function ah(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(th||(th={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(nh||(nh={}));const lh=({flamebearer:n,maxRowPx:o,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[E,N]=l(null),[O,$]=l([]),[A,D]=l(!1),[R,_]=l(th.Fit),[P,L]=l(nh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*R),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Wu(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Ju(e,t,l);if(0===i.length)break;const r=qu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>Yu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Zu(V,X),t=new Set;for(const o of e){const e=Hu(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=i(()=>function(e,t,n,o,i,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Wu(e);let p=l?Zu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Hu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Hu(e,l.nameIndex)===Hu(e,t.nameIndex)&&i.add(Ku(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Ku(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Ku(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=Hu(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Qu(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=ih((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Ku(o);N(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${ju(o.size)} (${t}% of view, ${i}% of profile) · self ${ju(o.self)}`)}else N(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{N(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=ih((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Yu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=eh(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=oh(d,r),g=`${s} (${ju(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Ku(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,E,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,E,r,B,z,y]);const Z=d(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Wu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?Hu(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Nt.S,value:F,onChange:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:wl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:xl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:za,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Fn.Filled,options:[{value:th.Fit,label:"W: Fit"},{value:th.X10,label:"10x"}],selected:R,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Fn.Filled,options:[{value:nh.Fit,label:"H: Fit"},{value:nh.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?Qa:Tl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:R>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${ju(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ah(h.totalBytesUsed)} / ${ah(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},rh=[Rn.Go,Rn.Java],sh="Profiling Symbols";function ch(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Rn.Go:e.includes(" ")||e.includes("(")?Rn.Java:Rn.Go)(e);if(n===Rn.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Rn.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function dh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function ph(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>dh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function uh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function hh(e,t){return e.className===t.className&&e.methodName===t.methodName}function mh(e,t,n,o){const i=ch(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!ph(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>uh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>hh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var gh,fh,bh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(gh||(gh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(fh||(fh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(bh||(bh={}));const vh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function yh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(bh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(bh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&vh.test(n))}const Ch=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Rn.Java),h=i(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:fh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:bh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:bh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===gh.Symbol)?.rawValue?.toString()??"";return!(t.includes(fh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&yh(n,t)}}},[o,u]),g=i(()=>[{key:gh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:gh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:gh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:gh.Symbol,rawValue:e.name},{key:gh.Self,rawValue:ju(e.self)},{key:gh.Total,rawValue:ju(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ma,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:za,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:kl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Mn,{variant:zn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var Sh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(Sh||(Sh={}));const xh=b(ae)`
|
|
707
|
+
`,Hu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(nt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Uu,{children:[n.add.map(n=>e(Vu,{children:[t(ce,{leftIcon:Ba,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Vu,{children:[t(ce,{leftIcon:wl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function ju(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Gu(e){const t=Math.abs(e);return t>=1e9?`${Wu(e/1e9)}s`:t>=1e6?`${Wu(e/1e6)}ms`:t>=1e3?`${Wu(e/1e3)}μs`:String(Math.round(e))}function Wu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ku(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Yu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ju(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function qu(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>ju(e,t.nameIndex))}function Zu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&ju(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Qu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){i.push(e);break}}return i}function eh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function th(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var nh,oh;function ih(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ah(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function lh(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(nh||(nh={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(oh||(oh={}));const rh=({flamebearer:n,maxRowPx:o,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[E,N]=l(null),[O,$]=l([]),[A,D]=l(!1),[R,_]=l(nh.Fit),[P,L]=l(oh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*R),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Ku(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=qu(e,t,l);if(0===i.length)break;const r=Zu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>Ju(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Qu(V,X),t=new Set;for(const o of e){const e=ju(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=i(()=>function(e,t,n,o,i,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Ku(e);let p=l?Qu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(ju(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&ju(e,l.nameIndex)===ju(e,t.nameIndex)&&i.add(Yu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Yu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Yu(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=ju(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:eh(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=ah((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Yu(o);N(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Gu(o.size)} (${t}% of view, ${i}% of profile) · self ${Gu(o.self)}`)}else N(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{N(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=ah((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Ju(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=th(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=ih(d,r),g=`${s} (${Gu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Yu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,E,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,E,r,B,z,y]);const Z=d(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Ku(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?ju(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Ot.S,value:F,onChange:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:Tl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:wl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Ba,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Mn.Filled,options:[{value:nh.Fit,label:"W: Fit"},{value:nh.X10,label:"10x"}],selected:R,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Mn.Filled,options:[{value:oh.Fit,label:"H: Fit"},{value:oh.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?el:kl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:R>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Gu(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${lh(h.totalBytesUsed)} / ${lh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},sh=[_n.Go,_n.Java],ch="Profiling Symbols";function dh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===_n.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function ph(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function uh(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>ph(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function hh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function mh(e,t){return e.className===t.className&&e.methodName===t.methodName}function gh(e,t,n,o){const i=dh(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!uh(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>hh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>mh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var fh,bh,vh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(fh||(fh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(bh||(bh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(vh||(vh={}));const yh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(vh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(vh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&yh.test(n))}const Sh=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=i(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:bh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:vh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:vh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===fh.Symbol)?.rawValue?.toString()??"";return!(t.includes(bh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&Ch(n,t)}}},[o,u]),g=i(()=>[{key:fh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:fh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:fh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:fh.Symbol,rawValue:e.name},{key:fh.Self,rawValue:Gu(e.self)},{key:fh.Total,rawValue:Gu(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:za,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ba,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:Il,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(zn,{variant:Bn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var xh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(xh||(xh={}));const wh=b(ae)`
|
|
708
708
|
width: 100%;
|
|
709
709
|
flex: 1;
|
|
710
710
|
border-radius: 16px;
|
|
711
711
|
overflow: hidden;
|
|
712
712
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
713
713
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
714
|
-
`,
|
|
714
|
+
`,Th=b.div`
|
|
715
715
|
display: flex;
|
|
716
716
|
align-items: center;
|
|
717
717
|
gap: 10px;
|
|
@@ -719,11 +719,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
719
719
|
padding: 12px 12px 8px;
|
|
720
720
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
721
721
|
border-radius: 16px 16px 0 0;
|
|
722
|
-
`,
|
|
722
|
+
`,kh=b(oe)`
|
|
723
723
|
flex-shrink: 0;
|
|
724
724
|
align-items: center;
|
|
725
725
|
gap: 4px;
|
|
726
|
-
`,
|
|
726
|
+
`,Ih=b.div`
|
|
727
727
|
flex: 1;
|
|
728
728
|
display: flex;
|
|
729
729
|
align-items: stretch;
|
|
@@ -731,20 +731,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
731
731
|
padding: 16px;
|
|
732
732
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
733
733
|
border-radius: 0 0 16px 16px;
|
|
734
|
-
`,
|
|
734
|
+
`,Eh=b(ae)`
|
|
735
735
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
736
736
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
737
737
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
738
738
|
gap: 10px;
|
|
739
|
-
`,
|
|
739
|
+
`,Nh=b(ae)`
|
|
740
740
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
741
741
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
742
742
|
gap: 10px;
|
|
743
|
-
`,
|
|
743
|
+
`,Oh=b(oe)`
|
|
744
744
|
width: 100%;
|
|
745
745
|
min-height: 32px;
|
|
746
746
|
flex-shrink: 0;
|
|
747
|
-
|
|
747
|
+
`,$h=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=Wl(),[h,m]=l(!0),[g,f]=l(xh.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,u.enableProfiling?.(c),w(!0))},[u,c]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:E,refetch:N}=u.useSourceProfiling(c,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=i(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}})(O),[O]),A=i(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const i=o[n+1],a=o[n+2],l=ju(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),D=g===xh.Table||g===xh.Both,R=g===xh.Flame||g===xh.Both,_=D&&R,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=i(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=i(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[fh.Symbol]?.filter(Boolean)??[]).filter(e=>e===vh.FilterOutVoid||e===vh.OnlyWithReturnValues);return 0!==n.length?e=>Ch(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:a}=Wl(),{items:r}=o.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=i(()=>(e=>{const t=new Set(e??[]);return sh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=i(()=>((e,t)=>{const n=e.filter(e=>e.type===Je.CustomInstrumentation&&e.ruleName===ch&&uh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>ph(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=i(()=>{const t=new Map;for(const o of n){const n=!!dh(o.name,g),i=gh(o.name,e,g,r),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),l=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=i(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=i(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=i(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):c(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),E=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const n=t.add.map(e=>dh(e,g)).filter(e=>!!e),i=t.remove.map(e=>dh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ke.Golang]??[]],a=[...o[Ke.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!hh(t,e.golang))),e.java&&(a=a.filter(t=>!mh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>hh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>mh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,Je.CustomInstrumentation):await o.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ch,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:n,[Ke.Java]:o}}})(n,e),Je.CustomInstrumentation)})()},[v,g,e,o]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),D=d(()=>m(null),[]),R=d(()=>{h&&(N(h),m(null),E())},[h,N,E]),_=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:i(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:D,openBulkModify:O,resetSelection:E,confirmModify:R}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===xh.Flame?xh.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),ie=d(()=>W(null),[]);return!O&&E?t(bt,{$height:"70vh",children:t(xt,{withSpinner:!0})}):e(wh,{$gap:0,$width:"100%",children:[e(Th,{children:[t(Ue,{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(kh,{children:t(ee,{size:te.S,weight:500,color:ne.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(bn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Mn.Filled,options:[{value:xh.Table,label:"Top table"},{value:xh.Flame,label:"Flame graph"},{value:xh.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(El,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(El,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(Ih,{$gap:D&&R?16:0,children:$?e(r,{children:[D&&e(Eh,{$splitWithFlame:_,children:[e(Oh,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(oe,{$gap:8,children:[e(oe,{children:[t(Nl,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Ha,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(oe,{$gap:8,children:[J&&t(Ue,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:Ol,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(Sh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),R&&e(Nh,{$splitWithTable:_,children:[e(Oh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Gu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:ul,onClick:N}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Ot.S,value:h,onChange:m})]})]}),t(rh,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ie})]})]}):t(bt,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Hu,{pendingModify:X,onClose:U,onConfirm:j}),t(Xn,{isOpen:B>0,richTitle:{icon:tl,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:fn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:fn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:Ga,onClick:V}}]})]})},Ah=b.div`
|
|
748
748
|
position: relative;
|
|
749
749
|
display: flex;
|
|
750
750
|
align-items: center;
|
|
@@ -752,23 +752,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
752
752
|
padding: 8px 16px;
|
|
753
753
|
border-radius: 12px;
|
|
754
754
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
755
|
-
`,
|
|
755
|
+
`,Dh=b.div`
|
|
756
756
|
display: flex;
|
|
757
757
|
flex-direction: column;
|
|
758
758
|
gap: 4px;
|
|
759
759
|
flex: 1;
|
|
760
760
|
min-width: 0;
|
|
761
761
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
762
|
-
`,
|
|
762
|
+
`,Rh=b.div`
|
|
763
763
|
flex-shrink: 0;
|
|
764
764
|
display: flex;
|
|
765
765
|
align-items: center;
|
|
766
766
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
767
|
-
`,
|
|
767
|
+
`,_h=b.div`
|
|
768
768
|
min-width: 0;
|
|
769
769
|
white-space: pre;
|
|
770
770
|
overflow-x: auto;
|
|
771
|
-
`,
|
|
771
|
+
`,Ph=b.div`
|
|
772
772
|
position: absolute;
|
|
773
773
|
top: 50%;
|
|
774
774
|
right: 8px;
|
|
@@ -777,24 +777,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
777
777
|
pointer-events: none;
|
|
778
778
|
transition: opacity 0.15s ease;
|
|
779
779
|
|
|
780
|
-
${
|
|
780
|
+
${Ah}:hover & {
|
|
781
781
|
opacity: 1;
|
|
782
782
|
pointer-events: auto;
|
|
783
783
|
}
|
|
784
|
-
`,
|
|
784
|
+
`,Lh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Ah,{children:[e(Dh,{$disabled:i,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(_h,{children:t(w,{parts:o})})]}),i&&t(Rh,{$reserveJumpSpace:!!a,children:t(ce,{label:Un,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Ph,{children:t(Ue,{text:ot.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:kl,onClick:a})})})]})},Fh=b.div`
|
|
785
785
|
opacity: 0;
|
|
786
786
|
pointer-events: none;
|
|
787
787
|
transition: opacity 0.15s ease;
|
|
788
|
-
`,
|
|
789
|
-
&:hover ${
|
|
788
|
+
`,Mh=b.div`
|
|
789
|
+
&:hover ${Fh} {
|
|
790
790
|
opacity: 1;
|
|
791
791
|
pointer-events: auto;
|
|
792
792
|
}
|
|
793
|
-
`,
|
|
793
|
+
`,zh=b.div`
|
|
794
794
|
display: flex;
|
|
795
795
|
align-items: center;
|
|
796
796
|
padding: 4px 12px;
|
|
797
|
-
`,
|
|
797
|
+
`,Bh=({source:e,onRedirectToSampling:n})=>t(Kt,{bgTint:"1000",richTitle:{title:ot.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Vh,{container:e,onRedirectToSampling:n},e.containerName))});var Xh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Xh||(Xh={}));const Uh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Vh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l(Xh.All),s=yn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=i(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=i(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===Xh.Noisy?d:a===Xh.HighlyRelevant?p:a===Xh.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(Fh,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Vn,rightIcon:Ba,onClick:e=>{e.stopPropagation(),o()}})});return t(Mh,{children:e(Kt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Kt,{bgTint:"800",richTitle:{title:ot.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:ot.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(Lh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(zh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:ot.HEAD_SAMPLING})}),m?e(Kt,{bgTint:"800",richTitle:{title:ot.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Xh.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Xh.Noisy,label:ot.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Xh.HighlyRelevant,label:ot.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Xh.CostReduction,label:ot.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(Lh,{name:e.rule.name,summary:Uh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===Xh.All?`${Xh.Noisy}, ${Xh.HighlyRelevant} and ${Xh.CostReduction}`:a} operations`})})]}):t(zh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:ot.TAIL_SAMPLING})})]})});var b,v,y},Hh=[kn.Deployment,kn.StatefulSet,kn.DaemonSet,kn.DeploymentConfig,kn.Rollout,kn.Pod];var jh;(e=>{e.Workload="Workload",e.Pod="Pod"})(jh||(jh={}));const Gh=e=>!!e&&dn(e.status)===Pe.Error,Wh=e=>Gh(e.healthStatus),Kh=e=>Gh(e.odigosHealthStatus)||(e.processes??[]).some(Wh),Yh=e=>Gh(e.agentInjectedStatus)||Gh(e.odigosHealthStatus)||(e.containers??[]).some(Kh),Jh=({onClose:n,sourceId:o,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=Wl(),{selectedStreamName:g}=it(),{genericForm:f,loadSource:b,validateFormData:y}=ql(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(Ip.Overview),[$,A]=l(null),[D,R]=l({openFor:null}),_=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:Ip.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:Ip.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,o)=>{const i=Dp({identifyingAttributes:o.identifyingAttributes});t({tab:Ip.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),r=d(()=>t(null),[]);return i(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:a,clearJumpToTarget:r}),[e,n,o,a,r])})();a(()=>{_.jumpToTarget&&O(_.jumpToTarget.tab)},[_.jumpToTarget]),a(()=>{$&&JSON.stringify(Cn(o))!==JSON.stringify(Cn($))&&A(null)},[o,$]);const P=p(!1),L=d(async()=>A(await h.fetchById(o)||null),[o,h]);a(()=>{if(P.current||(L(),P.current=!0),!x){const e=setInterval(()=>L(),3e3);return()=>clearInterval(e)}},[L,x]),a(()=>{$&&b($)},[$]);const F=$&&Hh.includes($.id.kind),M=i(()=>{const e=[],n=($?.pods??[]).some(Yh),o=(i=$,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(fl,{...e,fill:s.v2.colors.red[500]});return e.push({value:Ip.Overview,label:ot.OVERVIEW}),c?(e.push({value:Ip.Pods,label:ot.PODS,icon:n?a:void 0}),e.push({value:Ip.Libraries,label:ot.LIBRARIES,icon:o?a:void 0}),e.push({value:Ip.PeerSources,label:ot.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:Ip.Profiling,label:ot.PROFILING}),e.push({value:Ip.Sampling,label:ot.SAMPLING}),e.push({value:Ip.Debug,label:ot.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),B=i(()=>()=>{n(),r()},[n,r]),X=d(()=>{$&&b($),w(!1)},[$]),U=d(async()=>{if(!$||!f)return;const{errorMessage:e,preparedFormData:t}=y();if(e)return;const n=t.otelServiceName!==$.id.name?t.otelServiceName:"";await h.update(o,{...t,otelServiceName:n}),w(!1)},[$,f,y,o,h]),V=!1===$?.markedForInstrumentation?.markedForInstrumentation,H=d(()=>k(!0),[]),j=d(async()=>{if(!$)return;const e=!1===$.markedForInstrumentation?.markedForInstrumentation;await h.persistV2({[Rt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,...$.id.region?{region:$.id.region}:{},selected:e,currentStreamName:g}]}),k(!1),e||n()},[$,h,g,n]),G=d(()=>{R({openFor:jh.Workload})},[]),W=d(e=>{O(e),_.clearJumpToTarget()},[_]),K=d(async()=>{await h.recoverFromRollback(o)},[h,o]),Y=d(()=>R({openFor:null}),[]),J=d(async()=>{D.openFor===jh.Workload?await h.restartWorkloads([o]):D.openFor===jh.Pod&&D.podNamespace&&D.podName&&await h.restartPod(D.podNamespace,D.podName),Y()},[D,h,o,Y]),q=i(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=i(()=>{const e=[];return x||N===Ip.Overview&&(e.push({id:"edit-source-btn-edit",label:Mt.EDIT,icon:Ga,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:ot.ROLLOUT_RESTART,icon:xl,onClick:G}),e.push(V?{id:"edit-source-btn-instrument",label:Mt.INSTRUMENT,icon:Ba,color:s.v2.colors.green[500],active:T,onClick:H}:{id:"edit-source-btn-delete",label:Mt.UNINSTRUMENT,icon:za,color:s.v2.colors.red[500],active:T,onClick:H})),e},[N,x,T,V,c,F,z,G,H,s]),Q=i(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?gl:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:cl,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(Bt,{isOpen:!0,children:t(bt,{$height:"80vh",children:t(xt,{withSpinner:!0})})});const ee=N===Ip.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ne=c?jn($.containers)[0]:Hn(u);return e(Xp,{value:_,children:[t(Bt,{isOpen:!0,width:ee,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(Ip.Overview),A(null),E(!1),n()},actions:Z},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:X},{"data-id":"edit-source-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:U}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!x&&M.length>1&&t(ve,{options:M,selected:N,setSelected:W}),(()=>{switch(N){case Ip.Overview:return x?t(Us,{}):t(Bu,{source:$,onClickRollout:G,onClickRollback:K});case Ip.Pods:return t(Gp,{source:$,onClickRestartPod:F?(e,t)=>R({openFor:jh.Pod,podNamespace:e,podName:t}):void 0});case Ip.Libraries:return t(Xu,{source:$});case Ip.PeerSources:return t(Kp,{source:$});case Ip.Profiling:return t($h,{source:$,onFlameFullscreenChange:E});case Ip.Sampling:return t(Bh,{source:$,onRedirectToSampling:B});case Ip.Debug:return t(Qp,{source:$});default:return null}})()]})})}),t(Dr,{target:"source",action:V?"instrument":"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:j}),t(nt,{isOpen:D.openFor===jh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:Y},approveButton:{label:Mt.CONFIRM,variant:Ie.Primary,onClick:J}}),t(Dr,{target:"pod",action:"restart",description:ot.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===jh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:ot.DELETE_POD_TO_RESTART})]})},qh=b.div`
|
|
798
798
|
display: flex;
|
|
799
799
|
align-items: center;
|
|
800
800
|
gap: 8px;
|
|
@@ -804,9 +804,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
804
804
|
&:hover {
|
|
805
805
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
806
806
|
}
|
|
807
|
-
`,
|
|
807
|
+
`,Zh=b.div`
|
|
808
808
|
flex: 1;
|
|
809
|
-
`,
|
|
809
|
+
`,Qh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(qh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Yn}),t(za,{size:16,fill:o})]})};const em={[Ql.EditAutoNoisy]:{title:co,subTitle:so,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ql.EditAutoCostReduction]:{title:ro,subTitle:lo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ql.EditAutoHighlyRelevant]:{title:ao,subTitle:io,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},tm=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(Bt,{isOpen:e,width:uo,header:{icon:$l,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Ks,{})})}),nm=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Zl(Ql.Create),[b,v]=l(!1);a(()=>{o&&(m(),v(!1))},[o]);const y=d(()=>{v(!1),s(h)},[h,s]),C=d(()=>{if(c){const e=c(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(E(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=i(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(N(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Pe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Gn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Vn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(tm,{isOpen:o,title:Qn[u],subTitle:Jn[u],onClose:r,footer:x}),t(nt,{isOpen:b,title:no,description:to,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:eo,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Vn,variant:Ie.Primary,onClick:y},children:e(ae,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ne.Secondary,children:oo}),t("div",{style:{width:"100%"},children:t(Cr,{summary:S})})]})})]})},om=({onClose:o,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Zl(Ql.View),b=c?.rule.name||Zn,v=p&&c?qn[c.category]:`${b} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void f(e)}l(u,c.rule.ruleId,c.samplingId),m()}},[c,p,u,l,r,f,m]),C=d(()=>{c&&a(c.rule.ruleId,c.samplingId)},[c,a]),S=i(()=>{if(!c)return;const i=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Qh,{onClick:l}),r&&t(_e,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Zh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Gn,variant:Ie.Secondary,size:ke.S,onClick:i}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:Wn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Qh,{onClick:i}),t(Zh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Gn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:Kn,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[c,p,g,m,y,C,h,o,s]);return t(tm,{isOpen:!!c,title:v,subTitle:c?Jn[c.category]:"",onClose:o,footer:S})},im=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Zl(Ql.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(rm,{formType:Ql.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},am=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Zl(Ql.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(rm,{formType:Ql.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},lm=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=Zl(Ql.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(rm,{formType:Ql.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},rm=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=em[e];return t(tm,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:Gn,variant:Ie.Secondary,size:ke.S,onClick:o},{"data-id":a.saveId,label:po,variant:Ie.Primary,size:ke.S,onClick:i}]}})},sm=e=>{switch(e.formType){case Ql.Create:return t(lr,{formType:Ql.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(nm,{...e})});case Ql.View:return t(lr,{formType:Ql.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(om,{...e})});case Ql.EditAutoNoisy:return t(lr,{formType:Ql.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(im,{...e})});case Ql.EditAutoCostReduction:return t(lr,{formType:Ql.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(am,{...e})});case Ql.EditAutoHighlyRelevant:return t(lr,{formType:Ql.EditAutoHighlyRelevant,enabled:e.enabled,children:t(lm,{...e})})}},cm=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Lt(),m=!a||i||!c.newToken;return ho({key:"Enter",active:!m},s),e(oe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ee,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(oe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(xt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:el,onClick:r,disabled:i}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:Qa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(Ct,{icon:Ga,onClick:l})]})]})},dm=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:l}=ln(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>mo(e,0)?Pe.Error:mo(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=i(()=>c===Pe.Success?Qa:c===Pe.Warning?Al:fl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&o()},[c]),t(Ue,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},pm=b.div`
|
|
810
810
|
display: flex;
|
|
811
811
|
flex-direction: column;
|
|
812
812
|
gap: 12px;
|
|
@@ -814,7 +814,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
814
814
|
border-radius: 12px;
|
|
815
815
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
816
816
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
817
|
-
`,
|
|
817
|
+
`,um=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},hm=({token:n})=>{const{tokensApi:o}=Wl(),[i,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=qt({newToken:""});return t(ht,{richTitle:{icon:Dl,title:"Odigos Pro Token"},children:e(pm,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(um,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(um,{children:"Expiration"}),t(dm,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(oe,{children:e(ae,{children:[t(um,{children:"Token"}),t(cm,{token:n.token,newToken:p.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;a(!0);const e=await o.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},mm=b.div`
|
|
818
818
|
display: flex;
|
|
819
819
|
flex-direction: column;
|
|
820
820
|
align-items: center;
|
|
@@ -823,23 +823,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
823
823
|
padding: 12px 24px;
|
|
824
824
|
border-radius: 8px;
|
|
825
825
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
826
|
-
`,mm=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:i}=Gl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Dl,title:"Diagnose"},children:r?e(hm,{children:[t(St,{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:Nl,startedAt:r}),n[Rt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Rt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Za,{size:16}):n.status===Pe.Error?t(Qa,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(oe,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(mo,{alignX:fo.Left,alignY:go.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Nl,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},gm=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Gl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Cl,title:"General Information"},children:t(Wt,{cellsPerRow:2,items:[{id:bo(),title:"Odigos Version",label:n},{id:bo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:bo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:bo(),title:"Tier",label:o}]})})},fm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Gl(),l=a.useTokens().items[0];return e(zt,{isOpen:n,header:{icon:Cl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(gm,{}),a.updateToken&&l&&t(um,{token:l}),i.downloadDiagnose&&t(mm,{})]})},bm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=ot(),{dataStreamsApi:s}=Gl(),{requestSubmit:c}=Yl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return uo({key:"Enter",active:o},u),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},vm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Gl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return uo({key:"Enter",active:o},g),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},ym=({scale:n=1})=>e("svg",{width:742*n,height:533*n,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)"})})]})]}),Cm=b.div`
|
|
826
|
+
`,gm=()=>{const{progress:n}=At(),{describeApi:o,namespacesApi:i}=Wl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ht,{richTitle:{icon:Rl,title:"Diagnose"},children:r?e(mm,{children:[t(xt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[_t.DownloadingDiagnose]?.percentage,percentage:n[_t.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[_t.DownloadingDiagnose]?.percentage,visualIcon:Ol,startedAt:r}),n[_t.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[_t.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Qa,{size:16}):n.status===Pe.Error?t(el,{size:16}):t(xt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(oe,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(go,{alignX:bo.Left,alignY:fo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Ol,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},fm=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Wl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ht,{richTitle:{icon:Sl,title:"General Information"},children:t(Kt,{cellsPerRow:2,items:[{id:vo(),title:"Odigos Version",label:n},{id:vo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:vo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:vo(),title:"Tier",label:o}]})})},bm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Wl(),l=a.useTokens().items[0];return e(Bt,{isOpen:n,header:{icon:Sl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(fm,{}),a.updateToken&&l&&t(hm,{token:l}),i.downloadDiagnose&&t(gm,{})]})},vm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=Wl(),{requestSubmit:c}=Jl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return ho({key:"Enter",active:o},u),e(n,{children:[t(nt,{isOpen:o,onClose:i,onCloseEnd:a,title:ot.NAME_YOUR_STREAM,description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Mt.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Xs,{autoFocus:!0})}),t(Bs,{})]})},ym=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Wl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Jl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return ho({key:"Enter",active:o},g),e(n,{children:[t(nt,{isOpen:o,onClose:i,onCloseEnd:l,title:ot.RENAME_STREAM(r),description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Mt.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Mt.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Xs,{autoFocus:!0})}),t(Bs,{})]})},Cm=({scale:n=1})=>e("svg",{width:742*n,height:533*n,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)"})})]})]}),Sm=b.div`
|
|
827
827
|
position: absolute;
|
|
828
828
|
top: 50%;
|
|
829
829
|
left: 50%;
|
|
830
830
|
transform: translate(-50%, -50%);
|
|
831
831
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
832
|
-
`,
|
|
832
|
+
`,xm=()=>{const{drawerType:n,setDrawerType:o}=yn(),i=n===Co.OnboardingDone,a=()=>o(null);return e(yo,{isOpen:i,onClose:a,children:[t(Cm,{}),t(Sm,{children:e(ae,{$gap:32,$alignItems:"center",children:[e(ae,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(_r,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:Xa,onClick:a})]})})]})},wm=b.div`
|
|
833
833
|
display: flex;
|
|
834
834
|
flex-direction: column;
|
|
835
835
|
gap: 8px;
|
|
836
836
|
padding: 4px 8px;
|
|
837
837
|
border-radius: 8px;
|
|
838
838
|
width: 100%;
|
|
839
|
-
`,
|
|
839
|
+
`,Tm=b.div`
|
|
840
840
|
white-space: pre;
|
|
841
841
|
overflow-x: auto;
|
|
842
|
-
`,
|
|
842
|
+
`,km=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(wm,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(ce,{label:So,leftIcon:_l,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:fe.Left,value:a,onChange:l,size:Ot.S})]}),t(Tm,{children:t(w,{parts:r})})]})},Im=b.div`
|
|
843
843
|
position: relative;
|
|
844
844
|
display: flex;
|
|
845
845
|
align-items: center;
|
|
@@ -849,18 +849,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
849
849
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
850
850
|
border-top-left-radius: 18px;
|
|
851
851
|
border-top-right-radius: 18px;
|
|
852
|
-
`,
|
|
852
|
+
`,Em=b.div`
|
|
853
853
|
position: absolute;
|
|
854
854
|
left: 16px;
|
|
855
855
|
top: 50%;
|
|
856
856
|
transform: translateY(-50%);
|
|
857
|
-
`,
|
|
857
|
+
`,Nm=b.div`
|
|
858
858
|
height: 16px;
|
|
859
859
|
width: 100%;
|
|
860
860
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
861
861
|
border-top-left-radius: 18px;
|
|
862
862
|
border-top-right-radius: 18px;
|
|
863
|
-
`,
|
|
863
|
+
`,Om=b.div`
|
|
864
864
|
width: ${({$width:e})=>e}px;
|
|
865
865
|
display: flex;
|
|
866
866
|
flex-direction: column;
|
|
@@ -868,7 +868,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
868
868
|
gap: 22px;
|
|
869
869
|
padding: 8px 32px 32px 32px;
|
|
870
870
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
871
|
-
|
|
871
|
+
`,$m=e=>t(Pl,{rotate:90,...e}),Am=({children:n,center:o,onNext:i,nextLabel:a=xo,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,i&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:$m,variant:Ie.Primary,size:ke.M,onClick:i,loading:l})]}),Dm=e=>t(Pl,{rotate:-90,...e}),Rm=({title:n,onBack:o})=>{const i=v();return e(Im,{$hasBack:!!o,children:[o&&t(Em,{children:t(Ct,{"data-id":"sampling-onboarding-back",icon:Dm,size:St.M,onClick:o})}),t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},_m=b.div`
|
|
872
872
|
box-sizing: border-box;
|
|
873
873
|
width: ${({$width:e})=>e??"100%"};
|
|
874
874
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -881,16 +881,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
881
881
|
padding: 16px;
|
|
882
882
|
border-radius: 16px;
|
|
883
883
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
884
|
-
`,
|
|
884
|
+
`,Pm=({children:e,fillHeight:n,width:o})=>t(_m,{$fillHeight:n,$width:o,children:e}),Lm=b.ul`
|
|
885
885
|
margin: 0;
|
|
886
886
|
padding: 0;
|
|
887
887
|
list-style: disc;
|
|
888
|
-
`,
|
|
888
|
+
`,Fm=b.li`
|
|
889
889
|
margin-left: 18px;
|
|
890
890
|
& + & {
|
|
891
891
|
margin-top: 6px;
|
|
892
892
|
}
|
|
893
|
-
`,
|
|
893
|
+
`,Mm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(Lm,{children:e.map((e,n)=>t(Fm,{style:{color:i},children:t(ee,{size:te.XXS,color:i,children:e})},n))})},zm=({items:n})=>{const o=v();return t(ae,{$gap:16,children:n.map((n,i)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},Bm=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Xm=b.div`
|
|
894
894
|
width: 100%;
|
|
895
895
|
padding: 8px;
|
|
896
896
|
display: flex;
|
|
@@ -898,12 +898,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
898
898
|
gap: 4px;
|
|
899
899
|
border-radius: 16px;
|
|
900
900
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
901
|
-
`,
|
|
901
|
+
`,Um=b.div`
|
|
902
902
|
display: flex;
|
|
903
903
|
align-items: center;
|
|
904
904
|
gap: 8px;
|
|
905
905
|
padding: 4px 8px 12px 8px;
|
|
906
|
-
`,
|
|
906
|
+
`,Vm=b.div`
|
|
907
907
|
width: 100%;
|
|
908
908
|
display: flex;
|
|
909
909
|
flex-direction: column;
|
|
@@ -911,20 +911,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
911
911
|
padding: 8px;
|
|
912
912
|
border-radius: 12px;
|
|
913
913
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
914
|
-
`,
|
|
914
|
+
`,Hm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},jm=b.div`
|
|
915
915
|
white-space: pre-line;
|
|
916
|
-
`,
|
|
916
|
+
`,Gm=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Rm,{title:wo,onBack:l}),e(Om,{$width:854,children:[t(Hm,{children:To}),e(ae,{$gap:8,$width:"100%",children:[t(Pm,{children:t(jm,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:ko})})}),e(ae,{$gap:8,$width:"100%",children:[e(Xm,{children:[t(Um,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Io})}),t(Vm,{children:t(km,{name:No,recommended:!0,toggleLabel:Eo,enabled:o,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Bm,{message:Oo})]})]})]}),t(Am,{onNext:r})]})},Wm=e=>t(Pl,{rotate:90,...e}),Km=({onClose:o})=>{const i=v();return e(n,{children:[t(Nm,{}),e(Om,{$width:732,children:[t($o,{icon:$l}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],children:Ao}),Do.split("\n").map((e,n)=>t(Hm,{children:e},`subtitle-${n}-${e}`)),e(Pm,{children:[t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:Ro}),t(Mm,{color:i.v2.colors.white[500],items:[_o,Po,Lo]})]})]})]}),t(Am,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Fo,rightIcon:Wm,variant:Ie.Primary,size:ke.M,onClick:o})})]})},Ym=e=>t(Pl,{rotate:90,...e}),Jm=b.div`
|
|
917
917
|
display: flex;
|
|
918
918
|
flex-direction: column;
|
|
919
919
|
align-items: center;
|
|
920
920
|
gap: 8px;
|
|
921
921
|
width: 100%;
|
|
922
|
-
`,
|
|
922
|
+
`,qm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(Nm,{}),e(Om,{$width:732,children:[t($o,{icon:$l}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Jm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Mo}),t(Hm,{children:zo})]}),e(Pm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:Bo}),t(zm,{items:[{title:Uo,description:Xo},{title:Ho,description:Vo},{title:Go,description:jo}]}),t(Bm,{message:Wo})]})]})]}),e(Am,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:Ko,variant:Ie.Secondary,onClick:o}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Yo,rightIcon:Ym,variant:Ie.Primary,onClick:i})]})]})},Zm=b.div`
|
|
923
923
|
display: flex;
|
|
924
924
|
align-items: stretch;
|
|
925
925
|
gap: 16px;
|
|
926
926
|
width: 100%;
|
|
927
|
-
`,
|
|
927
|
+
`,Qm=b.div`
|
|
928
928
|
flex: 1;
|
|
929
929
|
display: flex;
|
|
930
930
|
flex-direction: column;
|
|
@@ -944,18 +944,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
944
944
|
background-color: ${t.v2.colors.silver[700]};
|
|
945
945
|
}
|
|
946
946
|
`}
|
|
947
|
-
`,
|
|
947
|
+
`,eg=b.div`
|
|
948
948
|
display: flex;
|
|
949
949
|
align-items: center;
|
|
950
950
|
gap: 8px;
|
|
951
951
|
padding: 12px 16px;
|
|
952
|
-
`,
|
|
952
|
+
`,tg=b.div`
|
|
953
953
|
flex: 1;
|
|
954
954
|
padding: 8px;
|
|
955
955
|
display: flex;
|
|
956
956
|
flex-direction: column;
|
|
957
957
|
gap: 8px;
|
|
958
|
-
`,
|
|
958
|
+
`,ng=b.div`
|
|
959
959
|
flex: 1;
|
|
960
960
|
display: flex;
|
|
961
961
|
flex-direction: column;
|
|
@@ -963,17 +963,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
963
963
|
padding: 12px;
|
|
964
964
|
border-radius: 12px;
|
|
965
965
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
966
|
-
`,
|
|
966
|
+
`,og=b.div`
|
|
967
967
|
display: flex;
|
|
968
968
|
justify-content: flex-end;
|
|
969
|
-
`,
|
|
969
|
+
`,ig=b.div`
|
|
970
970
|
display: flex;
|
|
971
971
|
align-items: center;
|
|
972
972
|
gap: 8px;
|
|
973
973
|
padding: 4px 12px 4px 4px;
|
|
974
974
|
border-radius: 8px;
|
|
975
975
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
976
|
-
`,
|
|
976
|
+
`,ag=b.div`
|
|
977
977
|
display: flex;
|
|
978
978
|
align-items: center;
|
|
979
979
|
justify-content: center;
|
|
@@ -981,13 +981,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
981
981
|
height: 24px;
|
|
982
982
|
border-radius: 6px;
|
|
983
983
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
984
|
-
`,
|
|
984
|
+
`,lg=({selected:n,onSelect:o,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Qm,{$selected:n,onClick:o,children:[e(eg,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t($l,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(tg,{children:[e(ng,{$selected:n,children:[e(ae,{$gap:8,children:[t(ce,{...l,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:a})]}),r&&r.length>0&&t(Mm,{color:p,items:r}),s&&e(ig,{children:[t(ag,{children:t(Al,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(og,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ui,rightIcon:Ha,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},rg=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Rm,{title:Jo,onBack:a}),e(Om,{$width:854,children:[t(Hm,{children:qo}),e(Zm,{children:[t(lg,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:oi,description:ni,badgeProps:{label:ti,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Qo,ei],warning:Zo,onReadMore:c}),t(lg,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:si,description:ri,badgeProps:{label:li,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ii,ai],onReadMore:c}),t(lg,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:pi,description:di,badgeProps:{label:ci,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Am,{onNext:l})]})},sg=({onBack:o,onNext:a,submitting:l})=>{const r=v(),s=i(()=>[{title:fi,bullets:[hi,mi,gi]},{title:xi,bullets:[bi,vi,yi,Ci,Si]}],[]);return e(n,{children:[t(Rm,{title:wi,onBack:o}),e(Om,{$width:854,children:[t(Hm,{children:Ti}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(Pm,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Mm,{items:n.bullets})]},o))}),t(Bm,{message:ki})]}),t(Am,{onNext:a,nextLoading:l})]})},cg=b.div`
|
|
985
985
|
white-space: pre-line;
|
|
986
|
-
`,
|
|
986
|
+
`,dg=({errorPresetEnabled:o,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=i(()=>D(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Rm,{title:Ii,onBack:l}),e(Om,{$width:854,children:[t(Hm,{children:Ei}),e(ae,{$gap:8,$width:"100%",children:[e(Pm,{children:[t(cg,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ni})}),t(Bm,{message:ki})]}),e(Xm,{children:[e(Um,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Oi}),t(bl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Vm,{children:t(km,{name:Ai,recommended:!0,toggleLabel:$i,enabled:o,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Am,{onNext:r,nextLoading:s})]})},pg=b.div`
|
|
987
987
|
white-space: pre-line;
|
|
988
|
-
`,
|
|
988
|
+
`,ug=b.div`
|
|
989
989
|
width: fit-content;
|
|
990
|
-
`,ug=["50","25","10","1","0.1"],hg=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ug.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(pg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},mg=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>D(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Dm,{title:Ai,onBack:s}),e(Nm,{$width:854,children:[t(Vm,{children:Di}),e(ae,{$gap:8,$width:"100%",children:[e(_m,{children:[t(dg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Ri})}),t(Fm,{items:[_i,Pi,Li,Fi,Mi]}),t(zm,{message:Ti})]}),e(Bm,{children:[e(Xm,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Um,{children:t(Tm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Um,{children:t(hg,{value:l,onChange:r,label:Bi})})]})]})]}),t($m,{onNext:c,nextLoading:d})]})},gg=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=s.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Jm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(jm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(lg,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(mg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(cg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(rg,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Wm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var fg,bg;(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"})(fg||(fg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(bg||(bg={}));const vg=[{id:bg.CloudConnector,label:"Cloud Connector"}];var yg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(yg||(yg={}));const Cg=[{key:yg.Name,label:"Name"},{key:yg.Type,label:"Type"},{key:yg.Status,label:"Status"},{key:yg.OdigosVersion,label:"Odigos Version"},{key:yg.ConnectedSince,label:"Connected Since"},{key:yg.LastActivity,label:"Last Activity"}],Sg=(e,t)=>{const n=e.find(e=>e.key===yg.Id)?.rawValue;return t(n?.toString()||"")},xg={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},wg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},Tg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,E]=l(null),[N,O]=l([]),[$,A]=l(!1),[D,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===bg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===fg.BulkConfig?h:I===fg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=R(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===fg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,N.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:yg.Id,rawValue:e.id},{key:yg.Name,rawValue:e.name},{key:yg.Type,rawValue:e.type,component:()=>t(nn,{variant:wg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:yg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=xg[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:yg.OdigosVersion,rawValue:e.odigosVersion},{key:yg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:yg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:N.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===fg.BulkConfig&&!R(e.odigosVersion,h,e.type)||I===fg.BulkSource&&!R(e.odigosVersion,m,e.type)})),[S,N,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),E(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===yg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>Sg(e,i)}];const d=Sg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&R(d.odigosVersion,n,d.type),u=!!d&&R(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>Sg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>Sg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>Sg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>Sg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>Sg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,fg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,fg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,fg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,fg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,fg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,fg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:fg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:fg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:fg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:fg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===fg.BulkSource?n?.():e===fg.BulkDestination?o?.():e===fg.BulkAction?i?.():e===fg.BulkInstrumentationRule?a?.():e===fg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>E(fg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>E(fg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>E(fg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>E(fg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>E(fg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:vg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:vg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:Cg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===fg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:N,children:t(Cp,{onClose:()=>E(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:O})}),I===fg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:N,children:t(rr,{selectedConnectionIds:N,children:t(Tc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===fg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:N,children:t(sr,{children:t(rc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===fg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:N,children:t(cr,{children:t(qs,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===fg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:N,children:t(dr,{children:t(sc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(fp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:D,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===fg.Delete,onClose:()=>{O([]),E(null)},onApprove:async()=>{const e=N[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!N.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},kg=b.div`
|
|
990
|
+
`,hg=["50","25","10","1","0.1"],mg=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>hg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(ug,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},gg=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>D(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Rm,{title:Di,onBack:s}),e(Om,{$width:854,children:[t(Hm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Pm,{children:[t(pg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:_i})}),t(Mm,{items:[Pi,Li,Fi,Mi,zi]}),t(Bm,{message:ki})]}),e(Xm,{children:[e(Um,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:Bi}),t(bl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Vm,{children:t(km,{name:Ai,recommended:!0,toggleLabel:$i,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Vm,{children:t(mg,{value:l,onChange:r,label:Xi})})]})]})]}),t(Am,{onNext:c,nextLoading:d})]})},fg=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Wl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=s.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(qm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Gm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(rg,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(gg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(dg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(sg,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Km,{onClose:n})}return t(yo,{isOpen:e,onClose:n,children:w})};var bg,vg;(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"})(bg||(bg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(vg||(vg={}));const yg=[{id:vg.CloudConnector,label:"Cloud Connector"}];var Cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Cg||(Cg={}));const Sg=[{key:Cg.Name,label:"Name"},{key:Cg.Type,label:"Type"},{key:Cg.Status,label:"Status"},{key:Cg.OdigosVersion,label:"Odigos Version"},{key:Cg.ConnectedSince,label:"Connected Since"},{key:Cg.LastActivity,label:"Last Activity"}],xg=(e,t)=>{const n=e.find(e=>e.key===Cg.Id)?.rawValue;return t(n?.toString()||"")},wg={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Tg={[Ui.K8s]:mn.Purple,[Ui.Vm]:mn.Blue,[Ui.Connector]:mn.Green,[Ui.AwsEcs]:mn.Yellow},kg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=ln(),{capabilities:b}=Wl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,E]=l(null),[N,O]=l([]),[$,A]=l(!1),[D,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===vg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===bg.BulkConfig?h:I===bg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=R(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===bg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,N.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:Cg.Id,rawValue:e.id},{key:Cg.Name,rawValue:e.name},{key:Cg.Type,rawValue:e.type,component:()=>t(on,{variant:Tg[e.type]??mn.Default,label:Vi(e.type),leftIcon:Hn(e.type)})},{key:Cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Ui.Connector){const n=wg[e.status]??"Pending",o=e.status===Pe.Success?Qa:e.status===Pe.Error?el:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Qa:el;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:Cg.OdigosVersion,rawValue:e.odigosVersion},{key:Cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:Cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:N.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===bg.BulkConfig&&!R(e.odigosVersion,h,e.type)||I===bg.BulkSource&&!R(e.odigosVersion,m,e.type)})),[S,N,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Ui.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),E(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Cg.Status)?.rawValue===Pe.Success)(e))return[{id:vo(),label:"Delete Connection",rightIcon:ja,onClick:()=>xg(e,i)}];const d=xg(e,e=>t.find(t=>t.id===e));if(d?.type!==Ui.K8s)return[];const p=!!d&&R(d.odigosVersion,n,d.type),u=!!d&&R(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:vo(),tooltip:u?ot.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:nl,disabled:!u,onClick:()=>xg(e,a)}),l&&g.push({id:vo(),tooltip:ot.ADD_DESTINATION,rightIcon:Ja,onClick:()=>xg(e,l)}),r&&g.push({id:vo(),tooltip:ot.ADD_ACTION,rightIcon:Ma,onClick:()=>xg(e,r)}),s&&g.push({id:vo(),tooltip:ot.ADD_INSTRUMENTATION_RULE,rightIcon:tl,onClick:()=>xg(e,s)}),c&&g.push({id:vo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:hl,disabled:!p,onClick:()=>xg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,bg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,bg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,bg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,bg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,bg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,bg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:vo(),type:fn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:nl,onClick:n}});const s=[o?{id:bg.BulkDestination,label:ot.ADD_DESTINATION,icon:Ja}:null,i?{id:bg.BulkAction,label:ot.ADD_ACTION,icon:Ma}:null,a?{id:bg.BulkInstrumentationRule,label:ot.ADD_INSTRUMENTATION_RULE,icon:tl}:null,l?{id:bg.BulkConfig,label:"Manage Configurations",icon:hl}:null];return s.some(Boolean)&&r.push({id:vo(),type:fn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===bg.BulkSource?n?.():e===bg.BulkDestination?o?.():e===bg.BulkAction?i?.():e===bg.BulkInstrumentationRule?a?.():e===bg.BulkConfig&&l?.()}},dropDataProps:{alignX:bo.Left,items:s}}),r.push({id:vo(),type:fn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Mt.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>E(bg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>E(bg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>E(bg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>E(bg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>E(bg.BulkConfig):void 0}),[b]),j=i(()=>t(go,{items:yg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Mt.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(T)}:{icon:Ll,title:ot.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Hi,{children:e(ht,{fullHeight:!0,richTitle:{icon:Ll,title:ot.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:fn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:ul,onClick:w,disabled:y}},{id:"connections-create-new",type:fn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Mt.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:bo.Right,items:yg}}],children:[t(zn,{variant:Bn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:Sg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${$r} - 24px)`:void 0,getRowActions:V}),I===bg.BulkConfig&&b.canApplyEffectiveConfig&&t(rr,{connectionIds:N,children:t(Sp,{onClose:()=>E(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:O})}),I===bg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(rr,{connectionIds:N,children:t(sr,{selectedConnectionIds:N,children:t(kc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===bg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(rr,{connectionIds:N,children:t(cr,{children:t(sc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===bg.BulkAction&&b.canCreateAction&&t(rr,{connectionIds:N,children:t(dr,{children:t(Zs,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===bg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(rr,{connectionIds:N,children:t(pr,{children:t(cc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),$&&t(ur,{providers:p,children:t(bp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(Pr,{isOpen:D,onClose:()=>P(!1)}),t(Dr,{target:"connection",isOpen:I===bg.Delete,onClose:()=>{O([]),E(null)},onApprove:async()=>{const e=N[0];e&&(await s(e),await w())}}),t(Xn,{isOpen:!!N.length&&!I,richTitle:{icon:Ua,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},Ig=b.div`
|
|
991
991
|
display: flex;
|
|
992
992
|
align-items: center;
|
|
993
993
|
justify-content: space-between;
|
|
@@ -996,26 +996,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
996
996
|
width: 100%;
|
|
997
997
|
border-radius: 16px;
|
|
998
998
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
999
|
-
`,
|
|
999
|
+
`,Eg=b.div`
|
|
1000
1000
|
display: flex;
|
|
1001
1001
|
align-items: center;
|
|
1002
1002
|
justify-content: center;
|
|
1003
1003
|
padding: 8px;
|
|
1004
1004
|
border-radius: 8px;
|
|
1005
1005
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
|
|
1006
|
-
`,
|
|
1006
|
+
`,Ng=({setStep:n,onSave:o,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=i(()=>Object.values(a||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||Nt.Namespace,l=a===Nt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Ig,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[a]),u=i(()=>l?.map((n,o)=>{const i=Tt(n.option.type).icon;return e(Ig,{children:[e(oe,{$gap:8,children:[i&&t(Eg,{children:t(i,{size:24})}),t(ee,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(ce,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?Qa:el})]},`destination-${o}`)})||[],[l]);return t(Or,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:cl,title:ot.SUMMARY,subTitle:ot.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(nl,{size:24}),t(ee,{nowrap:!0,children:ot.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(bt,{$height:"100%",children:t($e,{icon:nl,title:ot.NO_SOURCES_SELECTED,subTitle:ot.ADD_SOURCE_PROMPT,button:{leftIcon:Ba,label:ot.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(Ja,{size:24}),t(ee,{nowrap:!0,children:ot.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(bt,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:Ja,title:ot.NO_DESTINATIONS_SELECTED,subTitle:ot.ADD_DESTINATION_PROMPT,button:{leftIcon:Ba,label:ot.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Og=b.div`
|
|
1007
1007
|
position: relative;
|
|
1008
1008
|
overflow: hidden;
|
|
1009
1009
|
width: 100vw;
|
|
1010
1010
|
height: 100vh;
|
|
1011
1011
|
box-sizing: border-box;
|
|
1012
|
-
|
|
1012
|
+
`,$g=b.svg`
|
|
1013
1013
|
position: absolute;
|
|
1014
1014
|
top: 50%;
|
|
1015
1015
|
left: 50%;
|
|
1016
1016
|
transform: translate(-50%, -50%);
|
|
1017
1017
|
z-index: -1;
|
|
1018
|
-
|
|
1018
|
+
`,Ag=[{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"}],Dg=[{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:Ag},{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:Ag},{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:Ag}],Rg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=i(()=>s/Dg[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Og,{$paddingXAxis:n,$paddingYAxis:o,children:[Dg.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e($g,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:i,d:a,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:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),r]})},_g=b.div`
|
|
1019
1019
|
display: flex;
|
|
1020
1020
|
flex-direction: column;
|
|
1021
1021
|
align-items: center;
|
|
@@ -1026,7 +1026,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1026
1026
|
width: 50vw;
|
|
1027
1027
|
border-radius: 16px;
|
|
1028
1028
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1029
|
-
`,
|
|
1029
|
+
`,Pg=b.div`
|
|
1030
1030
|
display: flex;
|
|
1031
1031
|
flex-direction: column;
|
|
1032
1032
|
align-items: center;
|
|
@@ -1036,15 +1036,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1036
1036
|
& * {
|
|
1037
1037
|
text-align: center;
|
|
1038
1038
|
}
|
|
1039
|
-
`,
|
|
1039
|
+
`,Lg=({onStart:n})=>t(Bt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(bt,{$height:"100%",children:e(_g,{children:[e(Pg,{children:[t(ee,{size:te.L,weight:500,children:ot.GET_STARTED_WITH}),t(_r,{size:260}),t(ee,{size:te.S,weight:400,children:ot.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Mt.GET_STARTED,rightIcon:Xa,size:ke.L,onClick:n})]})})}),Fg=[{step:1,label:ot.INSTALLATION,forceDoneBadge:!0},{step:2,label:ot.SOURCES_SETUP},{step:3,label:ot.DESTINATIONS_SETUP},{step:4,label:ot.SUMMARY}],Mg=b.div`
|
|
1040
1040
|
display: flex;
|
|
1041
1041
|
flex-direction: column;
|
|
1042
1042
|
gap: 32px;
|
|
1043
1043
|
padding: 64px;
|
|
1044
|
-
`,
|
|
1044
|
+
`,zg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:a}=yn(),{sourcesApi:r,destinationsApi:s}=Wl(),[c,d]=l(1),[p,u]=l(!1),[h,m]=l(null),[g,f]=l(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Rg,{paddingXAxis:n,paddingYAxis:o,children:[e(Mg,{children:[t(_r,{useInline:!0}),t(ji,{currentStep:c,data:Fg,gap:32})]}),t(sr,{initialInputs:h,children:e(cr,{children:[1===c&&t(Lg,{onStart:b}),2===c&&t(kc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(sc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Ng,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};a(Co.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Bg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Xg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Ug=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Vg=b.div`
|
|
1045
1045
|
position: relative;
|
|
1046
1046
|
display: inline-flex;
|
|
1047
|
-
`,
|
|
1047
|
+
`,Hg=b.button`
|
|
1048
1048
|
display: inline-flex;
|
|
1049
1049
|
align-items: center;
|
|
1050
1050
|
gap: 8px;
|
|
@@ -1057,7 +1057,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1057
1057
|
&:hover {
|
|
1058
1058
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1059
1059
|
}
|
|
1060
|
-
`,
|
|
1060
|
+
`,jg=b.div`
|
|
1061
1061
|
position: absolute;
|
|
1062
1062
|
top: calc(100% + 8px);
|
|
1063
1063
|
right: 0;
|
|
@@ -1070,25 +1070,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1070
1070
|
border-radius: 12px;
|
|
1071
1071
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1072
1072
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1073
|
-
`,
|
|
1073
|
+
`,Gg=b.div`
|
|
1074
1074
|
display: flex;
|
|
1075
1075
|
flex-direction: column;
|
|
1076
1076
|
gap: 12px;
|
|
1077
1077
|
padding: 16px;
|
|
1078
1078
|
max-height: 60vh;
|
|
1079
1079
|
overflow-y: auto;
|
|
1080
|
-
`,
|
|
1080
|
+
`,Wg=b.div`
|
|
1081
1081
|
display: flex;
|
|
1082
1082
|
align-items: center;
|
|
1083
1083
|
gap: 8px;
|
|
1084
1084
|
padding: 12px 16px;
|
|
1085
1085
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1086
|
-
`,
|
|
1086
|
+
`,Kg=b.div`
|
|
1087
1087
|
display: flex;
|
|
1088
1088
|
align-items: center;
|
|
1089
1089
|
gap: 8px;
|
|
1090
1090
|
margin-left: auto;
|
|
1091
|
-
`,
|
|
1091
|
+
`,Yg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Wl(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=qi(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N,setAll:O,clearFilters:$,getEmptyState:A}=Gi(),D=i(()=>Wi(u,m),[u,m]);a(()=>{const e=g(Ki.OVERVIEW_FILTERS,A());O(e)},[]);const[R,_]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N}),[P,L]=l(Ug(R)),[F,M]=l(!1),z=p(o);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N};_(e),L(Ug(e))}},[F,y,C,x,w,T,k,I,E,N]),a(()=>{z.current!==o&&(z.current=o,b(Ki.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[o]);const B=p(null);On(B,()=>M(!1)),ho({key:"Escape",active:F},()=>M(!1));const X=i(()=>{const e=new Set,t=[];return h.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[h]),U=i(()=>{const e=new Set,t=[];return D.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:In(o),withCheckbox:!0}))}),t},[D]),V=i(()=>{const e=new Set,t=[];return D.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[D]),H=i(()=>{const e=new Set,t=[];return D.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Yi[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[D]),j=i(()=>Ji.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=i(()=>{const e=new Set,t=[];return D.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:Xg(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[D]),W=i(()=>{const e=new Set,t=[];return D.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Ut(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[D]),K=i(()=>[{id:"enabled",label:ot.ENABLED,withCheckbox:!0},{id:"disabled",label:ot.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));_(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?qa:Za,q=i(()=>Bg(R.languages),[R.languages]);return e(Vg,{ref:B,children:[e(Hg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Fl,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(ce,{label:P,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(jg,{children:[e(Gg,{children:[r&&t(yt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:Bg(R.namespaces),setValues:e=>Y("namespaces",X,e)}),s&&t(yt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Bg(R.regions),setValues:e=>Y("regions",V,e)}),t(yt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Bg(R.kinds),setValues:e=>Y("kinds",U,e)}),t(yt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(yt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Bg(R.monitors),setValues:e=>Y("monitors",j,e)}),t(yt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:Bg(R.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Bg(R.statuses),setValues:e=>Y("statuses",G,e)}),t(yt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Bg(R.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Ot.L,value:!!R.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Wg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(Ki.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(Kg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(Ki.OVERVIEW_FILTERS,R),O(R),L(Ug(R)),M(!1)}})]})]})]})]})},Jg=b.div`
|
|
1092
1092
|
position: relative;
|
|
1093
1093
|
display: flex;
|
|
1094
1094
|
align-items: center;
|
|
@@ -1099,7 +1099,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1099
1099
|
box-sizing: border-box;
|
|
1100
1100
|
border-radius: 16px 16px 0 0;
|
|
1101
1101
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1102
|
-
`,
|
|
1102
|
+
`,qg=b.div`
|
|
1103
1103
|
position: absolute;
|
|
1104
1104
|
bottom: 0;
|
|
1105
1105
|
left: 0;
|
|
@@ -1108,7 +1108,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1108
1108
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1109
1109
|
border-radius: 32px;
|
|
1110
1110
|
transition: width 0.3s;
|
|
1111
|
-
`,
|
|
1111
|
+
`,Zg=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=yn();return e(Jg,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Zi.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:o,tooltip:i,status:Pe.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(Ct,{"data-id":`add-${n}`,icon:Ba,onClick:()=>p(Qi(n))}),t(Ct,{"data-id":`refresh-${n}`,icon:ul,onClick:l,disabled:a})]}),"number"==typeof d&&t(qg,{$percent:d})]})},Qg=b(ae)`
|
|
1112
1112
|
align-items: center !important;
|
|
1113
1113
|
justify-content: center !important;
|
|
1114
1114
|
align-self: stretch;
|
|
@@ -1123,7 +1123,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1123
1123
|
&:hover {
|
|
1124
1124
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1125
1125
|
}
|
|
1126
|
-
`,
|
|
1126
|
+
`,ef=({entityType:n,description:o})=>{const{setDrawerType:i}=yn();return e(Qg,{onClick:()=>i(Qi(n)),children:[e(oe,{$gap:4,children:[t(Ba,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:o})]})},tf=b.div`
|
|
1127
1127
|
display: flex;
|
|
1128
1128
|
align-items: center;
|
|
1129
1129
|
gap: 12px;
|
|
@@ -1138,10 +1138,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1138
1138
|
&:hover {
|
|
1139
1139
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1140
1140
|
}
|
|
1141
|
-
`,
|
|
1141
|
+
`,nf=b(oe)`
|
|
1142
1142
|
flex: 1;
|
|
1143
1143
|
min-width: 0;
|
|
1144
|
-
`,
|
|
1144
|
+
`,of=({entityId:n,entityType:o,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===Nt.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=yn(),{selectedSources:x,setSelectedSources:w}=ea(),T=m,k=f?T.id.namespace:"",I=i(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),E=b&&!h?Ln(Pe.Info,g):l?Ln(l,g):void 0,N=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(tf,{"data-id":N,$faded:y,onClick:()=>{C(Tn(o)),S(n)},children:[f&&t(Q,{size:Zi.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(wn,{icons:p,icon:d,iconSrc:u}),e(nf,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Ue,{text:s||(b&&!h?ot.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||ot.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function af(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:cn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function lf(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Pe.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const rf=b.div`
|
|
1145
1145
|
position: absolute;
|
|
1146
1146
|
top: 0;
|
|
1147
1147
|
left: 0;
|
|
@@ -1152,21 +1152,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1152
1152
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1153
1153
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1154
1154
|
pointer-events: none;
|
|
1155
|
-
`,
|
|
1155
|
+
`,sf=b.div`
|
|
1156
1156
|
display: flex;
|
|
1157
1157
|
align-items: center;
|
|
1158
1158
|
gap: 8px;
|
|
1159
1159
|
padding: 4px 8px 0;
|
|
1160
|
-
`,
|
|
1160
|
+
`,cf=b.div`
|
|
1161
1161
|
flex: 1;
|
|
1162
1162
|
height: 1px;
|
|
1163
1163
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1164
|
-
`,
|
|
1164
|
+
`,df=({namespace:e})=>{const n=v();return t(rf,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},pf=({namespace:n})=>{const o=v();return e(sf,{children:[t(cf,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(cf,{})]})},uf={[Nt.InstrumentationRule]:ot.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:ot.NO_DATA_SOURCES,[Nt.Action]:ot.NO_DATA_ACTIONS,[Nt.Destination]:ot.NO_DATA_DESTINATIONS},hf=b.div`
|
|
1165
1165
|
display: flex;
|
|
1166
1166
|
flex-direction: column;
|
|
1167
1167
|
flex: 1 0 0;
|
|
1168
1168
|
min-width: 0;
|
|
1169
|
-
`,
|
|
1169
|
+
`,mf=b.div`
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
flex-direction: column;
|
|
1172
1172
|
align-items: stretch;
|
|
@@ -1176,7 +1176,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1176
1176
|
border-radius: 0 0 16px 16px;
|
|
1177
1177
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1178
1178
|
overflow: hidden;
|
|
1179
|
-
`,
|
|
1179
|
+
`,gf=b.div`
|
|
1180
1180
|
position: relative;
|
|
1181
1181
|
display: flex;
|
|
1182
1182
|
flex-direction: column;
|
|
@@ -1188,7 +1188,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1188
1188
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1189
1189
|
height: ${({$height:e})=>e}px;
|
|
1190
1190
|
overflow: hidden;
|
|
1191
|
-
`,
|
|
1191
|
+
`,ff=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Nt.Source,m=o.length!==r,g=At(e=>h?e.progress[_t.Instrumenting]?.percentage:void 0),f=At(e=>h?e.progress[_t.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=ea(),C=i(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=i(()=>{if(!s)return;const e=new Map,t=n===Nt.Source?s.sources:n===Nt.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(ta(n),n.throughput);return e},[s,n]),x=i(()=>o.map(e=>((e,t,n)=>{const o=Gt(e);if(!o)return null;const i=t===Nt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case cn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case cn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case cn.Pending:case cn.Waiting:return{status:void 0,faded:!1,displaySource:af(e)};case cn.Unsupported:case cn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:lf(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Nt.Action?na(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=oa(n);a=o,r=i}const c=ia(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Nt.Source:{d=xn(e),p=la(Nt.Source);const t=n?.get(aa(o));h=En(t);const i=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof i&&(m=i);break}case Nt.Destination:{const t=Tt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(aa(o));h=En(i),m=!e.disabled;break}case Nt.Action:p=Jt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=an(e.type),m=!e.disabled}return{key:aa(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[o,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:E,dividerCount:N}=i(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(pf,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(of,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(E?28:0)+32*N,A=Math.max(0,p-52-16),D=Math.min(A,$)+8,R="number"==typeof b?`${b}%`:m?`${o.length}/${r}`:r;return e(hf,{children:[t(Zg,{entityType:n,badge:R,badgeTooltip:m?ot.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(mf,{children:o.length?e(gf,{$height:D,children:[E&&w&&t(df,{namespace:w}),t(vn,{gap:4,elements:k,onTopIndexChange:E?O:void 0})]}):c?t(re,{size:3}):t(ef,{entityType:n,description:uf[n]??ot.TO_COLLECT_OTEL_DATA})})]})},bf=b.div`
|
|
1192
1192
|
width: 100%;
|
|
1193
1193
|
flex: 1;
|
|
1194
1194
|
min-height: 0;
|
|
@@ -1196,10 +1196,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1196
1196
|
display: flex;
|
|
1197
1197
|
align-items: stretch;
|
|
1198
1198
|
gap: 16px;
|
|
1199
|
-
`,
|
|
1199
|
+
`,vf={sources:[],destinations:[]},yf=()=>{const n=Gi(),{selectedStreamName:o}=it(),{containerRef:a,containerHeight:l}=ra(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Wl(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=yn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??vf,w=i(()=>Wi(u,o),[u,o]),T=i(()=>en(m,o),[m,o]),k=i(()=>sa(w,n),[w,n]),I=i(()=>ca(T,n),[T,n]),E=i(()=>da(f,n),[f,n]);return e(bf,{ref:a,children:[t(ff,{entityType:Nt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(ff,{entityType:Nt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(ff,{entityType:Nt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(ff,{entityType:Nt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Cf="40vw",Sf=b.div`
|
|
1200
1200
|
position: relative;
|
|
1201
|
-
width: ${
|
|
1202
|
-
`,
|
|
1201
|
+
width: ${Cf};
|
|
1202
|
+
`,xf=b.div`
|
|
1203
1203
|
position: absolute;
|
|
1204
1204
|
top: calc(100% + 8px);
|
|
1205
1205
|
left: 0;
|
|
@@ -1208,23 +1208,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1208
1208
|
flex-direction: column;
|
|
1209
1209
|
gap: 8px;
|
|
1210
1210
|
padding: 8px;
|
|
1211
|
-
width: calc(${
|
|
1211
|
+
width: calc(${Cf} - 16px);
|
|
1212
1212
|
border-radius: 12px;
|
|
1213
1213
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1214
1214
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1215
|
-
`,
|
|
1215
|
+
`,wf=b.div`
|
|
1216
1216
|
display: flex;
|
|
1217
1217
|
align-items: center;
|
|
1218
1218
|
overflow-x: auto;
|
|
1219
|
-
`,
|
|
1219
|
+
`,Tf=b.div`
|
|
1220
1220
|
display: flex;
|
|
1221
1221
|
flex-direction: column;
|
|
1222
1222
|
gap: 0;
|
|
1223
1223
|
max-height: 60vh;
|
|
1224
1224
|
overflow-y: auto;
|
|
1225
|
-
`,Tf=b.div`
|
|
1226
|
-
padding: 8px 12px 4px 12px;
|
|
1227
1225
|
`,kf=b.div`
|
|
1226
|
+
padding: 8px 12px 4px 12px;
|
|
1227
|
+
`,If=b.div`
|
|
1228
1228
|
display: flex;
|
|
1229
1229
|
align-items: center;
|
|
1230
1230
|
gap: 8px;
|
|
@@ -1234,12 +1234,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1234
1234
|
&:hover {
|
|
1235
1235
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1236
1236
|
}
|
|
1237
|
-
`,
|
|
1237
|
+
`,Ef=b.div`
|
|
1238
1238
|
padding: 16px 8px;
|
|
1239
|
-
`,
|
|
1239
|
+
`,Nf=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Gi(),{setDrawerType:d,setDrawerEntityId:u}=yn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Wl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=l(!1),[k,I]=l("all"),E=!n&&(!!s||w),N=()=>{c(""),T(!1),I("all")};On(x,()=>N()),ho({key:"Escape",active:E},N);const{categories:O,searchResults:$}=i(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:Nt.Source,label:"Sources",count:r.length,entities:[]},{category:Nt.Action,label:"Actions",count:s.length,entities:[]},{category:Nt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Nt.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 p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Nt.InstrumentationRule?l:e.category===Nt.Source?r:e.category===Nt.Action?s:e.category===Nt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Wi(b,a),actions:C,destinations:en(y,a),searchText:s,selectedCategory:k}),[S,b,C,y,a,s,k]),A=i(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),D=$.some(({entities:e})=>e.length>0);return e(Sf,{ref:x,children:[t(bn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:Cf}),E&&e(xf,{children:[A.length>1&&t(wf,{children:t(ve,{options:A,selected:k,setSelected:I})}),D?t(Tf,{children:$.map(({category:n,label:i,entities:a},l)=>{if(!a.length)return null;const s=la(n);return e(r,{children:[t(kf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:i})}),a.map((i,a)=>e(If,{onClick:()=>{const e=Gt(i);e&&(d(Tn(n)),u(e),N())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:ia(i,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(Ef,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Of=({onRedirectToSampling:o})=>{const{sourcesApi:a}=Wl(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=yn(),p=()=>{c(null),d(null)},u=i(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=i(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(xm,{}),r===Co.AddSource&&t(sr,{children:t(kc,{onClose:p,withOverlay:!0})}),r===Co.AddDestination&&t(cr,{children:t(sc,{onClose:p,withOverlay:!0})}),r===Co.AddInstrumentationRule&&t(pr,{sourceOptions:u,namespaceOptions:h,children:t(cc,{onClose:p,withOverlay:!0})}),r===Co.AddAction&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(Zs,{onClose:p,withOverlay:!0})}),r===Co.EditSource&&t(hr,{children:t(Jh,{onClose:p,sourceId:s,onRedirectToSampling:o})}),r===Co.EditDestination&&t(cr,{children:t(wp,{onClose:p,destinationId:s})}),r===Co.EditInstrumentationRule&&t(pr,{sourceOptions:u,namespaceOptions:h,children:t(kp,{onClose:p,ruleId:s})}),r===Co.EditAction&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(Cp,{onClose:p,actionId:s})})]})},$f=b.div`
|
|
1240
1240
|
position: relative;
|
|
1241
1241
|
display: inline-flex;
|
|
1242
|
-
|
|
1242
|
+
`,Af=b.div`
|
|
1243
1243
|
display: inline-flex;
|
|
1244
1244
|
align-items: center;
|
|
1245
1245
|
gap: 6px;
|
|
@@ -1250,7 +1250,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1250
1250
|
&:hover {
|
|
1251
1251
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1252
1252
|
}
|
|
1253
|
-
`,
|
|
1253
|
+
`,Df=b.div`
|
|
1254
1254
|
position: absolute;
|
|
1255
1255
|
top: calc(100% + 8px);
|
|
1256
1256
|
left: 0;
|
|
@@ -1264,18 +1264,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1264
1264
|
border-radius: 12px;
|
|
1265
1265
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1266
1266
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1267
|
-
`,
|
|
1267
|
+
`,Rf=b.div`
|
|
1268
1268
|
display: flex;
|
|
1269
1269
|
align-items: center;
|
|
1270
1270
|
gap: 8px;
|
|
1271
1271
|
width: 100%;
|
|
1272
|
-
`,
|
|
1272
|
+
`,_f=b.div`
|
|
1273
1273
|
display: flex;
|
|
1274
1274
|
flex-direction: column;
|
|
1275
1275
|
gap: 0;
|
|
1276
1276
|
max-height: 240px;
|
|
1277
1277
|
overflow-y: auto;
|
|
1278
|
-
`,
|
|
1278
|
+
`,Pf=b.div`
|
|
1279
1279
|
display: flex;
|
|
1280
1280
|
align-items: center;
|
|
1281
1281
|
gap: 8px;
|
|
@@ -1286,41 +1286,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1286
1286
|
&:hover {
|
|
1287
1287
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1288
1288
|
}
|
|
1289
|
-
`,
|
|
1289
|
+
`,Lf=b.div`
|
|
1290
1290
|
flex: 1;
|
|
1291
1291
|
min-width: 0;
|
|
1292
1292
|
overflow: hidden;
|
|
1293
1293
|
text-overflow: ellipsis;
|
|
1294
1294
|
white-space: nowrap;
|
|
1295
|
-
`,
|
|
1295
|
+
`,Ff=b.div`
|
|
1296
1296
|
display: flex;
|
|
1297
1297
|
align-items: center;
|
|
1298
1298
|
gap: 2px;
|
|
1299
1299
|
flex-shrink: 0;
|
|
1300
|
-
`,
|
|
1300
|
+
`,Mf=b.div`
|
|
1301
1301
|
display: flex;
|
|
1302
1302
|
padding-top: 4px;
|
|
1303
1303
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1304
|
-
`,
|
|
1304
|
+
`,zf=()=>{const o=v(),{isK8s:r}=S(),{clearStore:s}=pa(),{dataStreamsApi:c}=Wl();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=it(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(""),[A,D]=l(!1);On(m,()=>f(!1)),a(()=>{g||y("")},[g]);const R=i(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?qa:Za;return r?e(n,{children:[e($f,{ref:m,children:[e(Af,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Ml,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(Df,{children:[t(Rf,{children:t(bn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(_f,{children:0===R.length?t(Pf,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):R.map(({name:n})=>{const o=n===ua;return e(Pf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(Lf,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Ff,{children:[t(Ct,{"data-id":`stream-edit-${n}`,icon:Ga,size:St.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(Ct,{"data-id":`stream-delete-${n}`,icon:za,size:St.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),D(!0)}})]})]},`stream-${n}`)})}),t(Mf,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:Ba,label:`${Mt.NEW} ${ot.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),N(!0),I(!0)}})})]})]}),E&&t(mr,{defaultExcludeName:u,children:t(vm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(mr,{children:t(ym,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Dr,{target:`${ot.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>D(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var P},Bf=b(ae)`
|
|
1305
1305
|
width: 100%;
|
|
1306
1306
|
max-height: 320px;
|
|
1307
1307
|
overflow-y: auto;
|
|
1308
1308
|
gap: 8px;
|
|
1309
|
-
`,
|
|
1309
|
+
`,Xf=b(oe)`
|
|
1310
1310
|
width: 100%;
|
|
1311
1311
|
align-items: center;
|
|
1312
1312
|
gap: 8px;
|
|
1313
1313
|
padding: 8px 12px;
|
|
1314
1314
|
border-radius: 8px;
|
|
1315
1315
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1316
|
-
`,
|
|
1316
|
+
`,Uf=()=>{const o=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=ea(),{sourcesApi:p}=Wl(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=i(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),E=d(()=>b(!1),[]),N=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const O=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,o=n.get(t)??[];o.push(e),n.set(t,o)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),$=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==kn.StaticPod).map(Cn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),D=d(()=>{O(x,!1),T()},[O,x,T]),R=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),_=S.length>0,P=x.length>0,L=_&&P,F=i(()=>{const e=[{id:"multi-source-deselect",type:fn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:fn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:xl,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:fn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:Ba,onClick:()=>C(!0)}}):_?e.push({id:"multi-source-instrument",type:fn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:Ba,onClick:()=>b(!0)}}):P&&e.push({id:"multi-source-uninstrument",type:fn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:za,onClick:()=>g(!0)}}),e},[T,L,_,P]),M=e=>ia(e,Nt.Source,{extended:!0})||e.id.name;return e(n,{children:[t(Xn,{isOpen:w>0,richTitle:{icon:nl,title:"Selected sources",badge:{label:w}},actions:F}),t(nt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{$(),k()}}}),t(Dr,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:E,onDeny:E,onApprove:A}),t(Dr,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:D}),t(nt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:N,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:N},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{R(),N()}},children:e(Bf,{children:[S.map(n=>e(Xf,{children:[t(ce,{leftIcon:Ba,status:Pe.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Xf,{children:[t(ce,{leftIcon:wl,status:Pe.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Vf=C`
|
|
1317
1317
|
0% {
|
|
1318
1318
|
background-position: 200% 50%;
|
|
1319
1319
|
}
|
|
1320
1320
|
100% {
|
|
1321
1321
|
background-position: 0% 50%;
|
|
1322
1322
|
}
|
|
1323
|
-
`,
|
|
1323
|
+
`,Hf=b.div`
|
|
1324
1324
|
display: flex;
|
|
1325
1325
|
align-items: center;
|
|
1326
1326
|
justify-content: space-evenly;
|
|
@@ -1331,43 +1331,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1331
1331
|
|
|
1332
1332
|
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%)`};
|
|
1333
1333
|
background-size: 200% 100%;
|
|
1334
|
-
animation: ${
|
|
1335
|
-
`,
|
|
1334
|
+
animation: ${Vf} 15s linear infinite;
|
|
1335
|
+
`,jf=[tl,nl,Ma,Ja],Gf=({onRedirectToSampling:n})=>{const o=v();return e(Hi,{children:[e(ht,{fullHeight:!0,customTitle:t(zf,{}),customSearch:t(Nf,{}),filters:t(Yg,{}),children:[t(Hf,{children:jf.map((n,i)=>e(r,{children:[t(n,{size:24}),i<jf.length-1&&t(Fa,{fill:o.v2.colors.white[500]+ie["020"],size:24})]},n.name))}),t(yf,{})]}),t(Of,{onRedirectToSampling:n}),t(Uf,{})]})};var Wf;(e=>{e.Gateway="gateway",e.Node="node"})(Wf||(Wf={}));const Kf=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return n&&e.push({id:vo(),type:fn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Ol,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),o&&e.push({id:vo(),type:fn.Button,buttonProps:{label:"Refresh",leftIcon:ul,size:ke.S,variant:Ie.Text,onClick:o,disabled:l,loading:a}}),e},[n,o,l,a]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ha,{icon:zl,title:"Collectors Pipeline"}),t(ma,{actions:r})]})},Yf=({pod:n,onClose:o})=>{const{formatTimeAgo:a}=ln(),{collectorsApi:l}=Wl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=i(()=>[{id:vo(),title:"Node",label:r?.node??"-",withCopy:!0},{id:vo(),title:"Status",badge:{status:ga(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:vo(),items:[{id:vo(),title:"Container",label:e.name??"-"},{id:vo(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:vo(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Ua:Va,label:e.ready?"True":"False",invertColors:!0}},{id:vo(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Ua:Va,label:e.started?"True":"False",invertColors:!0}},{id:vo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:vo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:vo(),title:ot.RESTARTS,label:e.restarts.toString()},{id:vo(),title:"State Reason",label:e.stateReason??"-"},{id:vo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:vo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Bt,{isOpen:!!n,header:{icon:ml,title:"Pod Information",onClose:o},children:r?e(Kt,{bgTint:"1000",richTitle:{icon:ml,title:r.name,withCopy:!0},children:[t(Kt,{bgTint:"900",cellsPerRow:2,items:s}),e(Kt,{bgTint:"900",richTitle:{icon:Sl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(gn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(gn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(gn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Kt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Kt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(Rr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})})})};var Jf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Jf||(Jf={}));const qf=e=>{const t=[{key:Jf.PodName,label:"Pod Name"},{key:Jf.Status,label:"Status"},{key:Jf.Restarts,label:ot.RESTARTS},{key:Jf.NodeName,label:"Node Name"},{key:Jf.Age,label:"Age"},{key:Jf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Jf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Zf=({isLoading:n,pods:o,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=ln(),[c,d]=l(null),p=i(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Jf.PodName,rawValue:n.name},{key:Jf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:ga(e),label:e});var e}},{key:Jf.Restarts,rawValue:n.restartsCount.toString()},{key:Jf.NodeName,rawValue:n.nodeName},{key:Jf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(ee,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Pe.Error:Pe.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(oe,{$gap:4,children:[t(Ue,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?Bl:Xl,useSecondaryTone:!0,invertColors:!0})}),t(Ue,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?Bl:Xl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Jf.Age,rawValue:s(n.creationTimestamp)},{key:Jf.DockerImage,rawValue:n.image}]})),[o,r]);return e(Kt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:ml,title:"Pods"},children:[t(zn,{variant:Bn.Data,isLoading:n,columns:qf(a),rows:p}),t(Yf,{pod:c,onClose:()=>d(null)})]})},Qf=({isOpen:e,onClose:n,title:o,yaml:i})=>t(Bt,{isOpen:e,header:{icon:Ul,title:o,onClose:n},children:t(Rr,{yaml:i,defaultOpen:!0})}),eb=e=>{switch(e){case fa.Healthy:return"All desired replicas are updated, available, and ready";case fa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case fa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case fa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case fa.Down:return"No available replicas";case fa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var tb;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(tb||(tb={}));const nb=b.div`
|
|
1336
1336
|
flex: 0.5;
|
|
1337
1337
|
padding: 12px;
|
|
1338
1338
|
border-radius: 12px;
|
|
1339
1339
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1340
|
-
`,
|
|
1340
|
+
`,ob=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=ln(),[c,d]=l(null),p=i(()=>(e=>{switch(e){case Wf.Gateway:return"Deployment";case Wf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=i(()=>((e,t,n,o)=>{const i={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Wf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Wf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:ul,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,a,s),[o,a,n,s]),h=i(()=>((e,t,n,o)=>{let i=o?Pe.Info:Pe.Unknown,a=o?"Loading":fa.Unknown,l=o?"Fetching data...":eb(fa.Unknown);switch(e){case Wf.Gateway:i=t?.status?ga(t?.status):i,a=t?.status??a,l=t?.status?eb(t.status):l;break;case Wf.Node:i=n?.status?ga(n?.status):i,a=n?.status??a,l=n?.status?eb(n.status):l}return{status:i,title:a,description:l}})(n,o,a,r),[o,a,n,r]),m=i(()=>((e,t,n)=>{switch(e){case Wf.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 Wf.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,a),[o,a,n]),g=i(()=>((e,t,n,o)=>{switch(e){case Wf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:En(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:En(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:En(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case Wf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:En(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:En(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:En(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,a,r),[o,a,n,r]),f=i(()=>(n===Wf.Gateway?o?.manifestYAML:a?.manifestYAML)??"",[o,a,n]),b=i(()=>(n===Wf.Gateway?o?.configMapYAML:a?.configMapYAML)??"",[o,a,n]);return e(Kt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ul,title:p,badge:u},actions:[{id:vo(),type:fn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:tb.ManifestYaml,label:p,icon:Vl},{id:tb.ConfigMapYaml,label:"ConfigMap",icon:Vl}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(ba,{...h})}),m.map(e=>t(nb,{children:t("div",{children:t(va,{...e})})},e.title)),g.map(e=>t(ya,{...e},e.title))]}),t(Qf,{isOpen:c===tb.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Qf,{isOpen:c===tb.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},ib=[{value:Wf.Gateway,label:"Gateway"},{value:Wf.Node,label:"Node Collector"}],ab=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Wf.Gateway),p=s===Wf.Gateway,u=s===Wf.Node,{collectorsApi:h,configApi:m}=Wl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:E,refetch:N}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||E),$=d(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=i(()=>p?y:I,[y,I,p]);return e(Hi,{children:[t(Kf,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(Ca,{children:[e(ae,{children:[t(ve,{variant:Mn.Underline,size:De.L,options:ib,selected:s,setSelected:c}),t(ob,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Zf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Lr,{minSupportedVersion:r,currentVersion:a||""})]})]})},lb=b.div`
|
|
1341
1341
|
display: inline-flex;
|
|
1342
1342
|
align-items: center;
|
|
1343
1343
|
min-width: 0;
|
|
1344
1344
|
overflow: hidden;
|
|
1345
1345
|
white-space: pre;
|
|
1346
1346
|
text-overflow: ellipsis;
|
|
1347
|
-
`,
|
|
1347
|
+
`,rb=b.div`
|
|
1348
1348
|
display: flex;
|
|
1349
1349
|
flex-direction: column;
|
|
1350
1350
|
gap: 4px;
|
|
1351
1351
|
min-width: 0;
|
|
1352
1352
|
flex: 1;
|
|
1353
1353
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1354
|
-
`,
|
|
1354
|
+
`,sb=b(oe)`
|
|
1355
1355
|
flex-shrink: 0;
|
|
1356
1356
|
gap: 6px;
|
|
1357
1357
|
align-items: center;
|
|
1358
1358
|
min-height: 22px;
|
|
1359
|
-
`,
|
|
1359
|
+
`,cb=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],db=[{value:"all",label:Sa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],pb=({title:n,items:o,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=i(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,f,r);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})})(e,m),e},[o,f,r,m]),C=i(()=>y.map(n=>{const o=n.typeBadge?((e,t)=>{const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}})(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(rb,{$disabled:n.disabled,children:[t(lb,{children:t(w,{parts:n.summary})}),n.name&&t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(sb,{children:[n.disabled&&t(ce,{label:Un,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=i(()=>{const e=e=>t(ja,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:Kn,leftIcon:Ga,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(ht,{fullHeight:!0,richTitle:{icon:$l,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:db,selected:f,setSelected:b}}:{}},children:t(zn,{variant:Bn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:xa,subTitle:ka(m)}:{hideIcon:!0,title:Ta,button:{label:wa,onClick:c}},columns:cb,rows:C,getRowActions:x})})},ub=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:r}=Wl(),{items:s}=r.useSources(),c=i(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=i(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=i(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,E]=l(P.Noisy),[N,O]=l(null),[$,R]=l(!1),[_,Q]=l(!1),[ee,te]=l(null),[ne,ie]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=yn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(E(F[ue.category]),R(!1),O(e))},[h,u,ue,he]);const me=i(()=>A(m),[m]),ge=i(()=>M(u),[u]),fe=i(()=>D(ge?.rule??null),[ge]),be=i(()=>z(u),[u]),ye=i(()=>B(be?.rule??null),[be]),Ce=p(N);Ce.current=N,a(()=>{const e=Ce.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),R(!1))},[u]);const Se=i(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=i(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ee=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ne=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),Oe=d(e=>{const t=G(u,e);t&&(R(!1),O(t))},[u]),$e=d(()=>{O(null),R(!1)},[]),Ae=d((e,t)=>{const n=N;if(n&&n.rule.ruleId===e&&n.samplingId===t)R(!0),O({...n});else for(const n of u){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return R(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[N,u]),Re=d(async(e,t,n)=>{const o=N?.category;if(o){switch(o){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}R(!1)}},[N,b,y,S]),Le=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=N?.category||K[I];await x(t,e,n),O(null),R(!1),te(null)},[ee,N,I,x]),Me=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(async e=>{const t=u[0]?.id??"default",n=ge;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),re(!1)},[u,ge,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",o=be;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[u,be,C,S]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:Ia,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=N?.category,n=N?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:Ia,ruleId:o}:null},[u,N]),He=d(e=>{Q(!1);for(const t of u){const n=[...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(n)return R(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),je=i(()=>{const e=[];return n&&e.push({id:vo(),type:fn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ea,leftIcon:Ha,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:vo(),type:fn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Na,leftIcon:ul,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:vo(),type:fn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Oa,rightIcon:Ba,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Hi,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(ha,{icon:$l,title:Aa,subTitle:$a}),t(ma,{actions:je})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Mn.Underline,size:De.L,options:J,selected:I,setSelected:E}),e(oe,{$justifyContent:"space-between",children:[t(_e,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ha,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(Cr,{title:dt,summary:me,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(Cr,{title:at,summary:fe,onEdit:()=>re(!0)}):I===P.CostReduction?t(Cr,{title:st,summary:ye,onEdit:()=>ce(!0)}):null,t(pb,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:Le})]}),t(sm,{formType:Ql.View,data:N,defaultEditMode:$,onClose:$e,onDelete:Le,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(sm,{formType:Ql.Create,isOpen:_,category:K[I],onClose:Ee,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(sm,{formType:Ql.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(sm,{formType:Ql.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Be}),t(sm,{formType:Ql.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(nt,{title:Pa,description:_a,isOpen:!!ee,onClose:Me,denyButton:{label:Ra,variant:Ie.Secondary,onClick:Me},approveButton:{label:Da,variant:Ie.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},hb=b.div`
|
|
1360
1360
|
padding: 12px;
|
|
1361
1361
|
border-radius: 12px;
|
|
1362
1362
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1363
|
-
`,
|
|
1363
|
+
`,mb=f(({id:e,data:n})=>t(hb,{"data-id":e,children:t($e,{...n})}));var gb,fb;mb.displayName=mb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(gb||(gb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(fb||(fb={}));const bb=(e,t,n)=>{if(n)return{icons:[Cl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[Sn(e)]:t?xn(t):[Hl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:oa(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},vb=e=>!(!e||e.serviceName!==Wp||e.id.namespace||e.id.name||e.id.kind),yb=new Qr,Cb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Sb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},xb={id:{namespace:"",name:"",kind:""},serviceName:Wp,markedForInstrumentation:{markedForInstrumentation:!0}},wb=h(null),Tb=()=>{const e=m(wb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},kb=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:r}=Wl(),{items:s}=r.useSources(),[c,p,u]=Br([]),[h,m,g]=Xr([]),[f,b]=l(0),y=d(()=>b(e=>e+1),[]),[C,S]=l(""),[x,w]=l(null),[T,k]=l(null),I=d(e=>k(t=>t===e?null:e),[]),E=d(()=>k(null),[]),N=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===gb.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);a(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=Sb(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Sb(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=vb(t);n.push({id:i.graphKey,type:gb.MapItem,position:o,data:bb(i,t,a),measured:{width:80,height:80}})}else n.push({id:gb.NoData,type:gb.NoData,position:o,data:{subTitle:ot.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[xb].concat(s)});if(1===i.length&&i[0].id===gb.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:zr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...Cb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Wp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await yb.layout(o),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const n=t.get(e.id);return n?e.type===gb.MapItem&&n.type===gb.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,s,C]);const O=i(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:fb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=i(()=>({nodes:c,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:E}),[c,O,u,g,N,f,x,T,I,E]);return t(wb.Provider,{value:$,children:n})},Ib=b.div`
|
|
1364
1364
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1365
1365
|
border-radius: 8px;
|
|
1366
1366
|
cursor: pointer;
|
|
1367
1367
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1368
|
-
`,Ib=b.div`
|
|
1369
|
-
position: relative;
|
|
1370
1368
|
`,Eb=b.div`
|
|
1369
|
+
position: relative;
|
|
1370
|
+
`,Nb=b.div`
|
|
1371
1371
|
position: absolute;
|
|
1372
1372
|
top: 100%;
|
|
1373
1373
|
left: 50%;
|
|
@@ -1376,7 +1376,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1376
1376
|
align-items: center;
|
|
1377
1377
|
gap: 4px;
|
|
1378
1378
|
margin-top: 4px;
|
|
1379
|
-
`,
|
|
1379
|
+
`,Ob=f(({id:o,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=Tb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:o===Wp,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=i(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Ln(r,c):null;return e(n,{children:[t(Ur,{type:"source",position:Vr.Right,style:{visibility:"hidden"}}),t(Ur,{type:"target",position:Vr.Left,style:{visibility:"hidden"}}),e(Eb,{"data-id":o,children:[t(Ib,{$isSelected:g,$isVirtual:s,children:t(wn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Nb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:o})]})]})]})});Ob.displayName=Ob.name;const $b=b.div`
|
|
1380
1380
|
display: flex;
|
|
1381
1381
|
flex-direction: column;
|
|
1382
1382
|
gap: 12px;
|
|
@@ -1389,10 +1389,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1389
1389
|
top: 16px;
|
|
1390
1390
|
left: 8px;
|
|
1391
1391
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1392
|
-
|
|
1392
|
+
`,Ab=({children:e})=>t($b,{children:e});var Db,Rb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Db||(Db={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Rb||(Rb={}));const _b=b.div`
|
|
1393
1393
|
flex: 1 1 auto;
|
|
1394
1394
|
min-height: 0;
|
|
1395
|
-
`,
|
|
1395
|
+
`,Pb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:a}=Tb(),[r,s]=l(Db.All),c=i(()=>{const e=new Map;for(const t of n)t.type===gb.MapItem&&e.set(t.id,t);return e},[n]),d=i(()=>c.get(o??""),[c,o]),{inbound:p,outbound:u}=i(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Rb.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Rb.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[Db.All,Db.Inbound].includes(r)&&p.length>0,m=[Db.All,Db.Outbound].includes(r)&&u.length>0;return e(Ab,{children:[e(oe,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:dl,onClick:a}),t(wn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Db.All}`,value:Db.All,badge:{label:`${p.length+u.length}`}},{label:`${Db.Inbound}`,value:Db.Inbound,badge:{label:`${p.length}`}},{label:`${Db.Outbound}`,value:Db.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Fb,{halfHeight:m,title:"Inbound",icon:vl,connections:p,mapNodesById:c}),m&&t(Fb,{halfHeight:h,title:"Outbound",icon:yl,connections:u,mapNodesById:c})]})},Lb=b.div`
|
|
1396
1396
|
display: flex;
|
|
1397
1397
|
flex-direction: column;
|
|
1398
1398
|
gap: 8px;
|
|
@@ -1400,17 +1400,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1400
1400
|
border-radius: 12px;
|
|
1401
1401
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1402
1402
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1403
|
-
`,
|
|
1403
|
+
`,Fb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(Lb,{$halfHeight:n,children:[e(oe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:o})]}),t(_b,{children:t(vn,{gap:4,elements:a.map(e=>t(zb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Mb=b.div`
|
|
1404
1404
|
display: flex;
|
|
1405
1405
|
align-items: center;
|
|
1406
1406
|
gap: 8px;
|
|
1407
1407
|
padding: 8px;
|
|
1408
1408
|
border-radius: 8px;
|
|
1409
1409
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1410
|
-
`,
|
|
1410
|
+
`,zb=({connection:n,peerNode:o})=>e(Mb,{children:[o&&t(wn,{icons:o.data.icons}),e(oe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Bb="0;0.5;1",Xb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Hr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(jr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Gr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Bb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Bb,values:`${g};${f};${f}`})]},o)})]})})]})});Xb.displayName=Xb.name;const Ub=b.div`
|
|
1411
1411
|
flex: 1 1 auto;
|
|
1412
1412
|
min-height: 0;
|
|
1413
|
-
`,
|
|
1413
|
+
`,Vb=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:a}=Tb(),[r,s]=l(""),c=i(()=>n.filter(e=>e.type===gb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=i(()=>c.filter(e=>e.data.selected),[c]),u=i(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=i(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||a()},[u,h,o,a]);return c.length?e(Ab,{children:[e(oe,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(bn,{width:"100%",value:r,onChange:s}),e(oe,{$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(ee,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:te.XS,children:h?ot.UNSELECT_ALL:ot.SELECT_ALL})]}),t(Ub,{children:t(vn,{gap:4,elements:u.map(e=>t(jb,{node:e},e.id))})})]}):null},Hb=b.div`
|
|
1414
1414
|
display: flex;
|
|
1415
1415
|
align-items: center;
|
|
1416
1416
|
gap: 8px;
|
|
@@ -1418,7 +1418,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1418
1418
|
border-radius: 8px;
|
|
1419
1419
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1420
1420
|
cursor: pointer;
|
|
1421
|
-
`,
|
|
1421
|
+
`,jb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=Tb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Hb,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(wn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Gb=b.div`
|
|
1422
1422
|
position: relative;
|
|
1423
1423
|
height: 100%;
|
|
1424
1424
|
.react-flow__attribution {
|
|
@@ -1427,7 +1427,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1427
1427
|
* {
|
|
1428
1428
|
transition: none;
|
|
1429
1429
|
}
|
|
1430
|
-
`,
|
|
1430
|
+
`,Wb=b.div`
|
|
1431
1431
|
.react-flow__controls {
|
|
1432
1432
|
display: flex;
|
|
1433
1433
|
align-items: center;
|
|
@@ -1453,33 +1453,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
`,
|
|
1456
|
+
`,Kb={[gb.MapItem]:Ob,[gb.NoData]:mb},Yb={[fb.AnimatedTraffic]:Xb},Jb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},qb=({trigger:e})=>{const{fitView:t}=Zr(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Jb))},[e,t]),null},Zb=({onRefresh:n})=>{const{nodes:o,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Tb(),p=i(()=>{const e=new Set(o.filter(e=>e.type===gb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of a)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return o.filter(e=>e.type!==gb.MapItem||e.data.selected||t.has(e.id))},[o,a]);return e(Kr,{zoomOnScroll:!0,nodes:p,nodeTypes:Kb,edges:a,edgeTypes:Yb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Yr,{}),t(qb,{trigger:l}),t(Wb,{children:t(Jr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Jb,children:t(qr,{onClick:n,children:t(ul,{})})})})]})},Qb=n=>t(Wr,{children:e(Gb,{children:[t(Zb,{...n}),t(Vb,{}),t(Pb,{})]})}),ev=b.div`
|
|
1457
1457
|
width: 100%;
|
|
1458
1458
|
flex: 1;
|
|
1459
1459
|
align-self: stretch;
|
|
1460
1460
|
min-height: 0;
|
|
1461
1461
|
height: 100%;
|
|
1462
1462
|
position: relative;
|
|
1463
|
-
`,
|
|
1463
|
+
`,tv=()=>{const{serviceMapApi:e}=Wl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(kb,{serviceMap:n?.serviceMap??[],children:t(ev,{children:t(Qb,{onRefresh:o})})})},nv=b.div`
|
|
1464
1464
|
display: flex;
|
|
1465
1465
|
align-items: center;
|
|
1466
1466
|
justify-content: space-between;
|
|
1467
1467
|
padding: 0 12px;
|
|
1468
|
-
`,
|
|
1468
|
+
`,ov=b.div`
|
|
1469
1469
|
display: flex;
|
|
1470
1470
|
align-items: center;
|
|
1471
1471
|
gap: 8px;
|
|
1472
|
-
`,
|
|
1472
|
+
`,iv=b.div`
|
|
1473
1473
|
width: 1px;
|
|
1474
1474
|
height: 20px;
|
|
1475
1475
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1476
|
-
`,
|
|
1476
|
+
`,av=({disabled:n,loading:o,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=i(()=>a?[{id:vo(),type:fn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Vl,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=i(()=>{const e=[];return s&&e.push({id:vo(),type:fn.Button,buttonProps:{leftIcon:ul,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:o}}),r&&e.push({id:vo(),type:fn.Button,buttonProps:{leftIcon:za,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,o,r,s,c]),m=u.length>0,g=h.length>0;return e(nv,{children:[t(ha,{icon:hl,title:"Odigos Settings"}),e(ov,{children:[m&&t(ma,{actions:u}),m&&g&&t(iv,{}),g&&t(ma,{actions:h})]}),t(nt,{isOpen:d,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:()=>{r?.(),p(!1)}}})]})},lv=b(ae)`
|
|
1477
1477
|
width: 220px;
|
|
1478
1478
|
flex-shrink: 0;
|
|
1479
1479
|
height: 100%;
|
|
1480
1480
|
gap: 4px;
|
|
1481
1481
|
overflow-y: auto;
|
|
1482
|
-
`,
|
|
1482
|
+
`,rv=({options:e,selected:n,setSelected:o,disabled:i})=>t(lv,{children:e.map(e=>t(as,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),sv=b(ae)`
|
|
1483
1483
|
width: 100%;
|
|
1484
1484
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1485
1485
|
max-width: 844px;
|
|
@@ -1489,25 +1489,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1489
1489
|
gap: 24px;
|
|
1490
1490
|
flex: 1;
|
|
1491
1491
|
min-height: 0;
|
|
1492
|
-
`,
|
|
1492
|
+
`,cv=b(oe)`
|
|
1493
1493
|
flex: 1;
|
|
1494
1494
|
min-height: 0;
|
|
1495
1495
|
width: 100%;
|
|
1496
1496
|
align-self: stretch;
|
|
1497
|
-
`,
|
|
1497
|
+
`,dv=b(ae)`
|
|
1498
1498
|
flex: 1;
|
|
1499
1499
|
min-height: 0;
|
|
1500
1500
|
height: 100%;
|
|
1501
1501
|
max-width: 600px;
|
|
1502
1502
|
overflow-y: auto;
|
|
1503
|
-
`,
|
|
1503
|
+
`,pv=b(oe)`
|
|
1504
1504
|
gap: 8px;
|
|
1505
1505
|
width: 100%;
|
|
1506
1506
|
align-items: center;
|
|
1507
|
-
`,
|
|
1507
|
+
`,uv=b.div`
|
|
1508
1508
|
flex: 1;
|
|
1509
1509
|
min-width: 0;
|
|
1510
|
-
`,
|
|
1510
|
+
`,hv=e=>"general"===e.name?0:"advanced"===e.name?2:1,mv=({minSupportedVersion:o})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(o),{configApi:p}=Wl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=i(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=qt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=i(()=>[...b].sort((e,t)=>hv(e)-hv(t)),[b]),N=i(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=i(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===jt.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=i(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,D]=l(!1),[R,_]=l(!1),P=i(()=>[{id:vo(),type:fn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:Qa,loading:v,onClick:()=>D(!0)}},{id:vo(),type:fn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:el,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=i(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=i(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=La({sectionNames:F});return t(Hi,{$gap:24,children:e(sv,{children:[t(av,{disabled:!r,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(Ca,{children:[!r&&t(Lr,{minSupportedVersion:d,currentVersion:s||""}),t(Xn,{isOpen:I,richTitle:{icon:hl,title:"Config Settings"},actions:P}),t(nt,{isOpen:A,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:()=>D(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>D(!1)},approveButton:{label:"Save changes",variant:Ie.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(k(C,x),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),D(!1)}}}),e(cv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(rv,{options:L,selected:M,setSelected:z,disabled:!r}),t(dv,{ref:X,$gap:24,$width:"100%",children:b.length?E.map(o=>t(ht,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:o.displayName}),children:t(ae,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!c)return null;if(o.renderCondition&&!Qt(o.renderCondition,[],$))return null;const i=It(o.componentProps||"{}",{}),a=N[o.helmValuePath],l=o.componentType===jt.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:o.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(ce,{...s}):null,p=o.description?t(ee,{size:te.XXS,color:ne.Secondary,children:o.description}):null,u=e(ae,{$gap:4,children:[e(oe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Fr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Ot.S},o.helmValuePath),m=o.isHelmOnly?t(Ue,{text:"This field can only be updated via the Helm values.yaml file",children:t(jl,{})}):null;return t(ae,{$gap:8,children:l?e(oe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(oe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(pv,{children:[t(uv,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(ht,{richTitle:{icon:hl,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Bt,{isOpen:R,width:"40vw",minWidth:"480px",header:{icon:Vl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(bt,{$height:"30vh",children:t(xt,{withSpinner:!0})}):t(Rr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},gv=b.div`
|
|
1511
1511
|
position: fixed;
|
|
1512
1512
|
bottom: 12px;
|
|
1513
1513
|
left: 12px;
|
|
@@ -1516,4 +1516,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1516
1516
|
flex-direction: column-reverse;
|
|
1517
1517
|
gap: 6px;
|
|
1518
1518
|
max-width: 600px;
|
|
1519
|
-
`,
|
|
1519
|
+
`,fv=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=nn(),i=e.filter(({dismissed:e})=>!e);return t(gv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(_e,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{Zs as AddActionDrawer,Os as AddActionForm,vm as AddDataStreamModal,sc as AddDestinationDrawer,As as AddDestinationForm,cc as AddRuleDrawer,zs as AddRuleForm,kc as AddSourceDrawer,kg as CentralConnections,mp as CloudConnectorStep,bp as CreateCloudConnectorDrawer,vg as CreateNewType,Xs as DataStreamForm,Bs as DataStreamMergeWarning,Cp as EditActionDrawer,Sp as EditConfigDrawer,ym as EditDataStreamModal,wp as EditDestinationDrawer,kp as EditRuleDrawer,Jh as EditSourceDrawer,Us as EditSourceForm,zg as Onboarding,xm as OnboardingDone,Gf as Overview,ab as PipelineCollectors,gr as RegexTesterDrawer,fg as SamplingOnboardingModal,sm as SamplingRuleDrawer,Ks as SamplingRuleForm,ub as SamplingRules,tv as ServiceMap,mv as Settings,bm as SystemDrawer,ib as TABS,fv as ToastList};
|