@odigos/ui-kit 0.0.281 → 0.0.282
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 +8 -0
- package/lib/chunks/{helpers-BCQhqBdU.js → helpers-CAVGqyMb.js} +1 -1
- package/lib/chunks/index-Cy3rRes8.js +257 -0
- package/lib/chunks/source-instrument-form-context-DSXDMVmM.js +5 -0
- package/lib/chunks/{ui-components-D1sa0AJ8.js → ui-components-Dcg3x769.js} +228 -223
- package/lib/components/segment/index.d.ts +1 -0
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-action-drawer/helpers.d.ts +3 -2
- package/lib/containers/_drawers/edit-rule-drawer/helpers.d.ts +3 -2
- package/lib/containers.js +228 -228
- package/lib/contexts.js +1 -1
- package/lib/functions/build-catalog-fields-data-card/index.d.ts +42 -2
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/render-catalog-field-segments/index.d.ts +8 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/enable-disable-segment/index.d.ts +7 -0
- package/lib/snippets/index.d.ts +1 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +1 -0
- 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/chunks/index-CAqgZyIB.js +0 -257
- package/lib/chunks/source-instrument-form-context-Cng6X7Mt.js +0 -5
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
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMemo as o,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 R,c as D,r as P,S as _,s as L,R as F,t as M,w as z,o as X,x as B,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-CAVGqyMb.js";import{C as Q,e as ee,g as te,f as ne,h as ie,by as oe,F as ae,bz as le,bA as re,bB as se,bC as ce,bo as de,d as pe,k as ue,I as he,bD as me,o as ge,p as fe,w as be,Y as ve,bE as ye,bF as Ce,as as Se,bG as xe,bH as we,B as Te,i as ke,j as Ie,x as Ee,a4 as Ne,bp as Oe,b1 as $e,bI as Ae,u as Re,N as De,S as Pe,bJ as _e,bu as Le,bv as Fe,bt as Me,bK as ze,ag as Xe,T as Be,ae as Ue,af as Ve,ac as He,ab as je,ad as Ge,aa as We,b8 as Ke,a9 as Ye,bL as Je,bM as qe,bN as Ze,bO as Qe,bP as et,W as tt,m as nt,bc as it,bQ as ot,bR as at,bS as lt,bT as rt,bU as st,bV as ct,bW as dt,bX as pt,Q as ut,bY as ht,bZ as mt,b_ as gt,b0 as ft,bs as bt,s as vt,b$ as yt,c0 as Ct,b2 as St,c1 as xt,c2 as wt,aZ as Tt,v as kt,bw as It,bb as Et,q as Nt,c3 as Ot,bd as $t,c4 as At,c5 as Rt,bf as Dt,c6 as Pt,b4 as _t,c7 as Lt,l as Ft,a6 as Mt,y as zt,D as Xt,c8 as Bt,ah as Ut,c9 as Vt,ca as Ht,n as jt,bi as Gt,bn as Wt,z as Kt,cb as Yt,cc as Jt,cd as qt,bm as Zt,ce as Qt,a3 as en,cf as tn,cg as nn,b7 as on,H as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,cn as un,co as hn,cp as mn,O as gn,cq as fn,cr as bn,A as vn,b3 as yn,a$ as Cn,cs as Sn,ct as xn,cu as wn,cv as Tn,cw as kn,cx as In,bx as En,cy as Nn,cz as On,cA as $n,cB as An,cC as Rn,b as Dn,cD as Pn,cE as _n,M as Ln,cF as Fn,cG as Mn,cH as zn,cI as Xn,cJ as Bn,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,cU as Zn,cV as Qn,cW as ei,cX as ti,aP as ni,cY as ii,cZ as oi,c_ as ai,c$ as li,d0 as ri,d1 as si,d2 as ci,d3 as di,d4 as pi,d5 as ui,d6 as hi,d7 as mi,d8 as gi,d9 as fi,da as bi,ay as vi,db as yi,dc as Ci,b5 as Si,dd as xi,de as wi,df as Ti,dg as ki,dh as Ii,di as Ei,dj as Ni,dk as Oi,dl as $i,dm as Ai,dn as Ri,dp as Di,dq as Pi,dr as _i,ds as Li,dt as Fi,du as Mi,dv as zi,dw as Xi,dx as Bi,dy as Ui,dz as Vi,dA as Hi,dB as ji,dC as Gi,dD as Wi,dE as Ki,dF as Yi,dG as Ji,dH as qi,dI as Zi,dJ as Qi,dK as eo,dL as to,dM as no,dN as io,dO as oo,dP as ao,dQ as lo,dR as ro,dS as so,dT as co,dU as po,dV as uo,dW as ho,dX as mo,dY as go,dZ as fo,d_ as bo,d$ as vo,e0 as yo,e1 as Co,e2 as So,e3 as xo,e4 as wo,e5 as To,e6 as ko,e7 as Io,e8 as Eo,e9 as No,ea as Oo,eb as $o,ec as Ao,ed as Ro,ee as Do,ef as Po,eg as _o,eh as Lo,ei as Fo,ej as Mo,ek as zo,el as Xo,em as Bo,en as Uo,eo as Vo,ep as Ho,eq as jo,P as Go,er as Wo,es as Ko,et as Yo,eu as Jo,ev as qo,ew as Zo,ex as Qo,a_ as ea,ey as ta,$ as na,ez as ia,eA as oa,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,eG as da,eH as pa,eI as ua,eJ as ha,eK as ma,be as ga,eL as fa,R as ba,a 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 Ra,e_ as Da,e$ as Pa,f0 as _a,f1 as La,f2 as Fa,f3 as Ma,f4 as za,f5 as Xa}from"./chunks/ui-components-Dcg3x769.js";import{ChevronRightIcon as Ba,ActionIcon as Ua,TrashIcon as Va,PlusIcon as Ha,ArrowRightIcon as ja,BookIcon as Ga,DeleteIcon as Wa,EditIcon as Ka,GoLogo as Ya,JavaLogo as Ja,PhpLogo as qa,VSquareIcon as Za,XSquareIcon as Qa,DestinationIcon as el,ChevronUpIcon as tl,ChevronDownIcon as nl,VIcon as il,XIcon as ol,InstrumentationRuleIcon as al,SourceIcon as ll,NamespacesIcon as rl,AzureIcon as sl,GoogleCloudPlatformLogo as cl,AwsLogo as dl,CloudConnectorIcon as pl,EyeOpenIcon as ul,OdigosLogo as hl,ArrowLeftIcon as ml,ISquareIcon as gl,RefreshIcon as fl,SettingsIcon as bl,PodIcon as vl,K8sLogo as yl,ExclamationCircleIcon as Cl,QuestionCircleIcon as Sl,InboundIcon as xl,OutboundIcon as wl,UserIcon as Tl,TerminalIcon as kl,RefreshLeftArrowIcon as Il,MinusIcon as El,SearchIcon as Nl,ExpandIcon as Ol,CopyIcon as $l,DotIcon as Al,ArrowDownIcon as Rl,DownloadIcon as Dl,SamplingIcon as Pl,ExclamationTriangleIcon as _l,KeyIcon as Ll,DiagnoseIcon as Fl,StarIcon as Ml,ArrowIcon as zl,ConnectionsIcon as Xl,FilterIcon as Bl,DataStreamIcon as Ul,PipelineCollectorIcon as Vl,ArrowDownSquareIcon as Hl,ArrowUpSquareIcon as jl,GatewayIcon as Gl,YamlIcon as Wl,ImageErrorIcon as Kl,LockIcon as Yl}from"./icons.js";import{n as Jl,f as ql,E as Zl,k as Ql,I as er,l as tr,A as nr,i as ir,P as or,S as ar,R as lr,g as rr,j as sr,c as cr,h as dr,m as pr,W as ur,C as hr,b as mr,Y as gr,O as fr,a as br,U as vr,e as yr}from"./chunks/index-Cy3rRes8.js";import{h as Cr,o as Sr,n as xr,q as wr,m as Tr,t as kr,s as Ir,S as Er,w as Nr,E as Or,x as $r,y as Ar,v as Rr,l as Dr,d as Pr,C as _r,O as Lr,f as Fr,b as Mr,R as zr,A as Xr,e as Br,D as Ur}from"./chunks/source-instrument-form-context-DSXDMVmM.js";import{createPortal as Vr}from"react-dom";import{MarkerType as Hr,useNodesState as jr,useEdgesState as Gr,Handle as Wr,Position as Kr,getSmoothStepPath as Yr,BaseEdge as Jr,EdgeLabelRenderer as qr,ReactFlowProvider as Zr,ReactFlow as Qr,Background as es,Controls as ts,ControlButton as ns,useReactFlow as is}from"@xyflow/react";import os 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 as=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
|
+
`,ls=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
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
21
|
-
`,
|
|
20
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+oe["004"]};
|
|
21
|
+
`,rs=b(ie)`
|
|
22
22
|
flex: 1;
|
|
23
23
|
min-width: 0;
|
|
24
|
-
`,
|
|
24
|
+
`,ss=b(ae)`
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
|
-
`,
|
|
27
|
+
`,cs=b(ie)`
|
|
28
28
|
flex-shrink: 0;
|
|
29
|
-
`,
|
|
29
|
+
`,ds=({dataId:n,icon:i,title:o,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(as,{"data-id":n||`list-item-${o}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(rs,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),i&&t(ls,{children:t(i,{size:20})}),e(ss,{$gap:4,children:[t(ee,{size:te.XS,nowrap:!0,children:o}),a&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:a})]})]}),(l||c)&&e(cs,{$gap:8,children:[c,l&&t(Ba,{size:18})]})]}),ps="other",us={...se,[ps]:{TITLE:"Other",ICON:Ua}},hs=b(ie)`
|
|
30
30
|
padding: 8px 12px 4px 12px;
|
|
31
|
-
`,
|
|
31
|
+
`,ms=({bucket:n,options:i,selectedType:o,onSelectOption:a})=>{const l=v(),{TITLE:r,ICON:s}=us[n],c=l.v2.colors.purple[200];return e("div",{"data-id":`action-category-${n}`,children:[e(hs,{$gap:8,children:[t(s,{fill:c}),t(ee,{size:te.XXS,color:c,children:r}),t(ce,{label:i.length})]}),i.map(e=>t(ds,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:o===e.type,onClick:()=>a(e)},e.type))]})},gs=[{id:"CREDIT_CARD",label:"Credit card"}],fs=[{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"}],bs=[{id:me.Pod,label:me.Pod},{id:me.Namespace,label:me.Namespace},{id:me.Node,label:me.Node}],vs=[{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:bs}],ys=[{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:bs}],Cs=de.ExtractAttribute;var Ss;(e=>{e.Preset="preset",e.Regex="regex"})(Ss||(Ss={}));const xs=[Ce.JSON,Ce.SQL,Ce.ResourcePath],ws=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Ts=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ks=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
|
+
`,Is=b.div`
|
|
40
40
|
flex: 1;
|
|
41
41
|
min-width: 0;
|
|
42
|
-
`,
|
|
42
|
+
`,Es=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
|
-
`,Is=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Ns=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Es=de.UrlTemplatizationRulesGroups,Os=[{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"}],$s={[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:ms.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:fs,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:bs,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(()=>Is(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])})(Ns(r),i||{})||s(Is(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,Ns(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,hs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:hs.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[Es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Es,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(Ee,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ua,{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(Ne,{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:Os,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[Es]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:Va,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[vs],c=n[vs]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(xs)?ys.Regex:ys.Preset)(c)),[u,h]=l(null),m=e=>o(vs,{extractions:e});a(()=>{0===c.length&&m([d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ys.Preset,y=c.length?c:[b?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ys.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:ys.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===ys.Preset?Ss():{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(ws,{"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:Cs.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(Ua,{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===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Ts,{children:t(Ne,{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(ks,{children:t(Ha,{size:24,fill:r.v2.colors.silver[200]})}),t(Ts,{children:t(Ne,{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(Ne,{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(Ne,{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(Yl,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},As=({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(Jl,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=$s[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Rs=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=vr();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:ja,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ql,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ne,{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(As,{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(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Ds=b(oe)`
|
|
45
|
+
`,Ns=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Os=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},$s=de.UrlTemplatizationRulesGroups,As=[{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"}],Rs={[Oe.K8sAttributes]:({value:i,setValue:o,formErrors:l})=>(a(()=>{i[de.CollectContainerAttributes]||i[de.CollectReplicaSetAttributes]||i[de.CollectWorkloadId]||i[de.CollectClusterId]||i[de.LabelsAttributes]?.length||i[de.AnnotationsAttributes]?.length||(o(de.CollectContainerAttributes,!0),o(de.CollectReplicaSetAttributes,!0),o(de.CollectWorkloadId,!0),o(de.CollectClusterId,!0),o(de.LabelsAttributes,[]),o(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:fs.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:i[n]||!1,onChange:e=>o(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:vs,values:i[de.LabelsAttributes]||[],setValues:e=>o(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:ys,values:i[de.AnnotationsAttributes]||[],setValues:e=>o(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:i,setValue:o,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:i[de.OverwriteExistingValues]||!1,onChange:e=>o(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:i[de.ClusterAttributes]||[],setValues:e=>o(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:i[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=e[de.Renames],[r,s]=l(()=>Ns(o));return a(()=>{((e,t)=>{const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Os(r),o||{})||s(Ns(o))},[o]),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,Os(t))},errorMessage:i[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:i,formErrors:o})=>(a(()=>{n[de.PiiCategories]?.length||i(de.PiiCategories,gs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:gs.map(({id:e,label:o})=>t(Q,{label:o,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[de.PiiCategories]||[],a=t?[...o,e]:o.filter(t=>t!==e);i(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:o[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:i,setValue:o,formErrors:a})=>{const l=v(),s=i[$s]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o($s,e),d=(e,t)=>c(s.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[s.map((n,i)=>e(r,{children:[t(Ne,{}),e(ae,{$gap:12,children:[e(ie,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${i+1}`}),t(Te,{leftIcon:()=>t(Va,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=i,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ee,{name:`urlGroup-${i}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${i}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:As,values:n.workloadFilters||[],setValues:e=>d(i,{workloadFilters:e})}),t(be,{name:`urlGroup-${i}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[$s]})]},`url-templatization-group-${i}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:Ha,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:i,formErrors:o})=>{const r=v(),s=o[Cs],c=n[Cs]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(Ts)?Ss.Regex:Ss.Preset)(c)),[u,h]=l(null),m=e=>i(Cs,{extractions:e});a(()=>{0===c.length&&m([d===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,i)=>i===e?{...n,...t}:n))},f=()=>{m([...c,d===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===Ss.Preset,y=c.length?c:[b?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:Ss.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:Ss.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===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,i)=>{const o=i===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ks,{"data-id":`extract-row-${i}`,children:[e(ie,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(i):ye.REGEX_ROW_TITLE(i)}),b&&t(ie,{$gap:24,children:xs.map(e=>t(Se,{"data-id":`extract-row-${i}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(i,{dataFormat:e})},`extract-row-${i}-fmt-${e}`))})]}),e(ie,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${i}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(i),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${i}-delete`,leftIcon:()=>t(Va,{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===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(i)}),o&&t(Te,{"data-id":`extract-row-${i}-add`,leftIcon:Ha,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(ie,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Is,{children:t(Ee,{name:`extract-row-${i}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(i,{lookupKey:e.target.value})})}),t(Es,{children:t(ja,{size:24,fill:r.v2.colors.silver[200]})}),t(Is,{children:t(Ee,{name:`extract-row-${i}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(i,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ee,{name:`extract-row-${i}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(i,{regex:e.target.value})}),t(Ee,{name:`extract-row-${i}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(i,{targetAttributeName:e.target.value})})]})]},`extract-row-${i}`)}),t(ue,{errorMessage:s})]}),t(Jl,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Ds=({actionType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(ql,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Rs[e];return c?t(c,{value:n,setValue:i,formErrors:o}):null},Ps=()=>{const{selectedOption:n,genericForm:i,sourceOptions:o,namespaceOptions:a}=Cr();if(!i||!n)return t($e,{title:"No active form"});const{formData:l,handleFormChange:r,formErrors:s}=i;return e(ae,{$gap:24,children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:n.description}),e(ie,{$gap:12,children:[t(Zl,{isEnabled:!l.disabled,setIsEnabled:e=>r("disabled",!e)}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:l.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:s.signals}),t(Ee,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:l.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:s.name}),t(Ds,{actionType:n.type,dynamicFields:n.fields,signals:l.signals||[],value:l.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:s,sourceOptions:o,namespaceOptions:a}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:l.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:s.notes})]})},_s=b(ie)`
|
|
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
|
-
`,Ps=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=yr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Cr(),[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(Xe(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(Pe,{status:_e.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Pe,{status:_e.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:ja,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Re.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ql,{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(Ne,{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(Jl,{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(Ds,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ka,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:Ya,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"})});Ps.displayName="AddDestinationForm";const _s=[{id:Be.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Be.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Be.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ls=[{id:Be.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Be.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Be.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Fs=["*"],Ms=[{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:""}],zs={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Xs={[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={[Be.FilePath]:!0,[Be.Function]:!0,[Be.LineNumber]:!0,[Be.Column]:null,[Be.Namespace]:null,[Be.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Be).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:_s.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:Ls.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]:zs[Ke.Golang],[Ke.Java]:zs[Ke.Java],[Ke.Php]:zs[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ja,{}),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(qa,{}),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(Za,{}),t(pe,{label:"PHP custom probes"})]}),t(Pe,{status:_e.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(Fs)},[]),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:Ms.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},Bs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(Jl,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Xs[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Us=()=>{const n=v(),{isEnterprise:o,platformType:a,version:l}=S(),r=qe(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Sr(),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:ja,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ga,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:m.disabled,setSelected:e=>g("disabled",e),disabled:!o}),t(Te,{leftIcon:Wa,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Zl,{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(Ql,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ne,{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(Bs,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!o})]})},Vs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=xr();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}})},Hs=({autoFocus:n})=>{const{dataStreams:o}=it(),{genericForm:a,excludeName:l,editingName:r}=xr(),{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(Ne,{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(Pe,{status:_e.Warning,message:ot.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=wr();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ne,{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})},Gs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ws=b.div`
|
|
56
|
+
`,Ls=s(({isEdit:n},i)=>{const o=v(),{isK8s:r}=S(),{destinationsApi:s}=Sr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=xr(),[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(ze(p.formData));return y(e),e};return c(i,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(De,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(De,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ie,{$gap:12,children:[r&&t(Zl,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"This connection will monitor:",allowedSignals:Me(d.option.supportedSignals),selectedSignals:Fe(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Le.Logs),metrics:e.includes(Le.Metrics),traces:e.includes(Le.Traces),profiles:e.includes(Le.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(ql,{signals:Fe(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:Wa,variant:Ie.Secondary,textColor:o.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:Ka,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"})});Ls.displayName="AddDestinationForm";const Fs=[{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."}],Ms=[{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."}],zs=["*"],Xs=[{id:Ve.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ve.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ve.DbQuery,label:"Collect DB query",tooltip:""},{id:Ve.Messaging,label:"Collect messaging",tooltip:""}],Bs={[We.Java]:[new je("","")],[We.Golang]:[new He("")],[We.Php]:[new Ge("","")]},Us={[Ye.CodeAttributes]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=o(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);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),i=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",i)};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:Fs.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,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:Ms.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Ye.CustomInstrumentation]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=o(()=>(i?.customInstrumentations?.[We.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),p=o(()=>(i?.customInstrumentations?.[We.Java]||[]).map(e=>new je(e.className,e.methodName)),[i]),u=o(()=>(i?.customInstrumentations?.[We.Php]||[]).map(e=>new Ge(e.className,e.functionName)),[i]);return a(()=>{i?.customInstrumentations||c||l("customInstrumentations",{[We.Golang]:Bs[We.Golang],[We.Java]:Bs[We.Java],[We.Php]:Bs[We.Php]})},[]),e(n,{children:[e(ae,{children:[e(ie,{$gap:8,children:[t(Ya,{}),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[We.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[We.Java]=p,t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(Ja,{}),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[We.Golang]=d,t[We.Java]=e.map(e=>new je(e.className,e.methodName)),t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(qa,{}),t(pe,{label:"PHP custom probes"})]}),t(De,{status:Pe.Warning,message:Ke.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[We.Golang]=d,t[We.Java]=p,t[We.Php]=e.map(e=>new Ge(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:n,formErrors:i,disabled:l})=>{const r=i.headersCollection,s=o(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),c=e=>{const t={[Ue.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(zs)},[]),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})},[Ye.PayloadCollection]:({value:n,setValue:i,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=o(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};i("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:Xs.map(({id:e,label:n,tooltip:o})=>t(Be,{text:o,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),o={[Ve.HttpRequest]:n.includes(Ve.HttpRequest)?{}:null,[Ve.HttpResponse]:n.includes(Ve.HttpResponse)?{}:null,[Ve.DbQuery]:n.includes(Ve.DbQuery)?{}:null,[Ve.Messaging]:n.includes(Ve.Messaging)?{}:null};i("payloadCollection",o)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Ye.UnknownType]:null},Vs=({ruleType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(ql,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Us[e];return r?t(r,{value:n,setValue:i,formErrors:o,disabled:l}):null},Hs=()=>{const n=v(),{isEnterprise:i,platformType:a,version:l}=S(),r=Je(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=wr(),u=o(()=>qe(s?.supportedLanguages),[s?.supportedLanguages]),h=o(()=>{if(s)return s.type===Ye.CustomInstrumentation?[]:Ze(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(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(ie,{$gap:12,children:[t(Zl,{isEnabled:!m.disabled,setIsEnabled:e=>g("disabled",!e),fieldDisabled:!i}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(er,{option:s,formState:m}),!!u.length&&e(ie,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(tr,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!i}),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:!i}),t(Vs,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!i}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!i})]})},js=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:i}=Tr();if(!e)return null;const{existingName:o,editingName:a}=e;return t(tt,{isOpen:!0,onClose:i,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,o),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:i}})},Gs=({autoFocus:n})=>{const{dataStreams:i}=it(),{genericForm:a,excludeName:l,editingName:r}=Tr(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=o(()=>i.find(e=>e.name===p&&e.name!==l),[i,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(De,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Ws=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=kr();if(!n)return t($e,{title:"No active form"});const{formData:i,handleFormChange:o,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:i.otelServiceName,onChange:({target:{value:t}})=>{o("otelServiceName",t),o("currentStreamName",e)},errorMessage:a.otelServiceName})},Ks=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ys=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
|
+
`,qs=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Za}:{label:pt,leftIcon:Qa,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Zs=({value:e,onChange:n})=>{const i=v(),a=o(()=>[{icon:Za,label:dt,value:!0,selectedBgColor:i.v2.colors.green[800]},{icon:Qa,label:pt,value:!1,selectedBgColor:i.v2.colors.silver[500]}],[i]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Qs=()=>{const e=Ir();switch(e.formType){case Er.Create:return t(ec,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Zs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Er.View:return e.data?e.isEditing?t(ec,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Zs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(tc,{data:e.data,renderAction:()=>t(qs,{value:!e.data?.rule.disabled})}):null;case Er.EditAutoNoisy:return t(nc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,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(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Er.EditAutoCostReduction:return t(nc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,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(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Er.EditAutoHighlyRelevant:return t(Ys,{children:t(nr,{title:e.localEnabled?void 0:ot,summary:e.summary,renderAction:()=>t(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ec=({category:n,formData:i,onChange:o,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Ys,{children:[t(ar,{category:n,formState:i,renderAction:r}),e(Js,{$faded:!!i.disabled,children:[t(lr,{category:n,formState:i,onChange:o}),t(tr,{scopes:i.sourceScopes,onChange:e=>o({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(rr,{category:n,formState:i,onChange:o}),"highlyRelevant"===n&&t(sr,{formState:i,onChange:o}),"highlyRelevant"===n&&t(cr,{ruleType:i.ruleType,formState:i,onChange:o}),t(dr,{category:n,formState:i,onChange:o})]})]}),tc=({data:n,renderAction:i})=>e(Ys,{children:[t(ar,{readOnly:!0,summary:n.summary,renderAction:i}),t(lr,{readOnly:!0,data:n}),t(tr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(rr,{readOnly:!0,data:n}),t(dr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(cr,{readOnly:!0,rule:n.rule})]}),nc=({enabled:n,summary:i,inactiveTitle:o,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(Ys,{children:[t(nr,{title:n?void 0:o,summary:i,renderAction:b}),t(Js,{$faded:!n,children:e(ut,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Ks,selected:p,setSelected:v})}),S&&t(ir,{description:r,options:or,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},ic=({onClose:n,selectedConnectionIds:i,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=Sr(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=Cr(),{options:w,loading:T}=s.useActionTypes(),k=o(()=>w.length?w:mt(c,u),[w,c,u]),I=o(()=>(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:i,selectedType:a,onSelectOption:l})=>({width:"40%",list:o(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const o=n.reduce((e,t)=>{const n=t.category&&t.category in us?t.category:ps;return(e[n]||=[]).push(t),e},{});return Object.keys(us).filter(e=>o[e]?.length&&(!i||i===e)).map(e=>t(ms,{bucket:e,options:o[e],selectedType:a,onSelectOption:l},e))},[e,n,i,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:E}),O=o(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),$=o(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(Ps,{},v.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Ua,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(pr,{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:nt.CREATING_ACTION,subTitle:nt.CREATING_ACTION_SUBTITLE},header:{icon:Ua,title:nt.ADD_ACTION,subTitle:nt.ADD_ACTION_DESCRIPTION},connectionIds:i&&a?{value:i,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(ie,{$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:$}})},oc=({destinationsByCategory:i,filters:a,setFilters:l})=>{const r=o(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>i[e.id]?.length),[i]),s=o(()=>{const e=Object.values(Le).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(vt,{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})})]})},ac=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
|
+
`,lc=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
|
+
`,rc=({title:n,tooltip:i,list:o,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(ac,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(lc,{$isOpen:s,children:[e(ie,{$gap:10,children:[t(ee,{size:te.XS,children:n}),i&&t(Be,{text:i,withIcon:!0}),t(ce,{label:o.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?tl:nl,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:o.length?u.toArray(o):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},sc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Me(e.supportedSignals).includes(n.signalType))):e,cc=({option:e,formData:n,testResult:i,isSelected:o,onSelect:a})=>t(ds,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:o,onClick:()=>a(),children:i&&t(ce,{status:i.succeeded?Pe.Success:Pe.Error,leftIcon:i.succeeded?il:ol})}),dc=({listType:e,destinationOptions:n,unsavedDestinations:i})=>{const{activeForm:o,onChangeActiveForm:a}=xr();return n?.length?t(rc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,i)=>t(cc,{option:n,isSelected:o?.listType===e&&"number"!=typeof o?.unsavedIdx&&(null!=n.id&&""!==n.id?o?.option.id===n.id:o?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${i}`))}):i?.length?t(rc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:i.map(({option:n,formData:i,testResult:l},r)=>t(cc,{option:n,formData:i,testResult:l,isSelected:o?.unsavedIdx===r&&o?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var pc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(pc||(pc={}));const uc=(e,t)=>{const n=[],i=[],o=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===pc.SELF_HOSTED?i.push(...e.items):e.name===pc.MANAGED&&o.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const i of e?.destinationCategories?.categories||[]){const e=Tt(i),o=e.items.findIndex(e=>e.type===t.type);if(-1!==o){const i=kt(t.fields,{});Object.keys(i).length&&(e.items[o].fields=e.items[o].fields.map(e=>({...e,initialValue:i[e.name]})),n.push(e.items[o]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:i,[bt.MANAGED]:o}},hc=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Sr(),[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}=xr();a(()=>{c&&I(c)},[c]);const E=C||x,N=o(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of N){const i=n.items.find(t=>t.type===e.destinationType.type);if(i){t=i;break}}const n=kt(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,[bt.EXISTS]:e}))},[v,N]),a(()=>{(y||S)&&$(e=>({...e,...uc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=ze(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),i=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==i[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:i,filters:a})=>{const{unsavedDestinations:l}=xr();return{width:"40%",list:o(()=>{const o=[];l.length&&o.push(t(dc,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(a.categoryType&&a.categoryType!==e)continue;const l=sc(n[e],i,a);l.length&&o.push(t(dc,{listType:e,destinationOptions:l},e))}return e&&o.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),o},[l,n,i,a,e])}})({isFetching:E,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=xr();return{width:"60%",list:e?[t(Ls,{},e.option.type)]:[t(ft,{$height:"100%",children:t($e,{icon:el,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(pr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_DESTINATION,subTitle:nt.CREATING_DESTINATION_SUBTITLE},header:{icon:el,title:nt.ADD_DESTINATIONS,subTitle:nt.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(oc,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},mc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:i,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=Sr(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=wr(),{options:b,loading:v}=s.useRuleTypes(),y=o(()=>b.length?b:It,[b]),C=o(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=o(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(ds,{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=o(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(Hs,{},h.type)]:[t(ft,{$height:"100%",children:t($e,{icon:al,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(pr,{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:nt.CREATING_INSTRUMENTATION_RULE,subTitle:nt.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:al,title:nt.ADD_INSTRUMENTATION_RULE,subTitle:nt.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&i?{value:n,setValue:i}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},gc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:nt.FETCHING_NAMESPACES,subTitle:nt.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:nt.SELECT_NAMESPACE,subTitle:nt.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},fc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.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"},bc=e=>e?fc:gc,vc="No matches",yc=e=>(e?"Unselect":"Select")+" all",Cc="Selected",Sc=b.div``,xc=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
|
+
${Sc}:hover & {
|
|
88
88
|
visibility: visible;
|
|
89
89
|
}
|
|
90
|
-
`,
|
|
90
|
+
`,wc=({workloadName:e,workloadKind:n,isChecked:i,onToggle:o,disabled:a})=>{const l=v(),r=()=>{};return t(Sc,{children:t(ds,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:o,isChecked:i,onCheckboxChange:a?r:o,children:a?t(Be,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(ce,{label:"Enterprise only",status:Pe.Default,textSize:te.XXXS})}):t(xc,{children:t(ce,{label:n,status:Pe.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Tc=b.div``,kc=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
|
+
`,Ic=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
|
+
${Tc}:hover & {
|
|
113
113
|
visibility: visible;
|
|
114
114
|
pointer-events: auto;
|
|
115
115
|
}
|
|
116
|
-
`,
|
|
116
|
+
`,Ec=b(ie)`
|
|
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
|
+
`,Nc=({clusterId:n,namespaceName:i,checkbox:o,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Sr(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:i},auto:e.auto,selected:e.all})};return t(Tc,{children:t(ds,{dataId:`namespace-${i}`,withCarret:!0,title:i,isSelected:r,onClick:s,isPartiallyChecked:o.partial,isChecked:o.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(kc,{$withAuto:p,children:[p&&t(Ic,{$visible:r||a,children:t(Be,{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:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Ec,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:Cc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},Oc=({withCollapse:e,clusterId:n,clusterName:i,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=o(()=>a.map(({name:e,totalWorkloads:o,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(Nc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:o},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:i,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,i,a,l]);return e?t(rc,{title:i,list:c,noBgColor:!0}):c},$c=({onClose:n,onBack:i,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Sr(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=bc(!u),{selectedStreamName:T}=it(),{progress:k,resetProgress:I}=$t(),{isFetching:E,setIsFetching:N,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:P}=Rr();a(()=>{y()},[]);const _=o(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,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),_&&O(_)},[_,b,x,N,O]);const[L,F]=l(""),[M,z]=l(Et.Namespace),[X,B]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:i,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=bc(!u),m=o(()=>i.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>$r(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ar(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[i,c,p]),g=o(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:i}of t)if(e=!0,i!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=o(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:i})=>i.length?t(Oc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:i,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),o=i.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==o,filteredCount:n,totalCount:o}},[m,i,r]);return{width:"60%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Be,{text:b?nt.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:yc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t($e,c?{icon:rl,title:vc,subTitle:h.noGroupMatchedFilter(c)}:{icon:rl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Et.Namespace?L:"",searchBy:M,filters:X}),j=(({formData:n,handleSourceChange:i,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=bc(!d),h=o(()=>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=o(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Nr(e,r,c)):[],[h,r,c]),g=o(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=o(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:o,selected:a,kind:l,region:r})=>{const s=d&&!p&&Or.has(l);return t(wc,{workloadName:o,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>i({clusterId:e,workloadId:{namespace:n,name:o,kind:l,region:r}}),disabled:s},`${e}#${n}#${o}#${l}#${r??""}`)})},[m,h,l.value.clusterId,i,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=o(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Be,{text:b?nt.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:yc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t($e,h?r?{icon:ll,title:vc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:ll,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:ll,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Et.Source?L:"",searchBy:M,filters:X});return t(pr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Dt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:ll,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Et.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Et.Namespace},{label:w.itemSegmentLabel,value:Et.Source}],selected:M,setSelected:z}},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Nt.S,label:Cc,value:X.showOnlySelected,onChange:e=>B(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:E,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Dt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Ac={aws:dl,gcp:cl,azure:sl},Rc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Dc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Pc=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
|
+
`,Lc=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
|
+
`,Fc=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
|
+
`,Mc=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
|
+
`,zc=({providers:n,selectedProvider:i,onSelect:o})=>{const a=v();return n.length?t(_c,{children:n.map(n=>{const l=(e=>Ac[e.provider]??pl)(n),r=n.provider===i,s=(e=>{const t=e.features.find(e=>e.key===Pt.Discovery);if(!t)return"";const n=[],i=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,o=Rc[t]??Dc(t);i.has(o)||(i.add(o),n.push(o))}return n.join(", ")})(n);return e(Lc,{type:"button",$selected:r,onClick:()=>o(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Fc,{children:t(l,{size:24})}),e(Mc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Pc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(Ba,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},Xc=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
|
+
`,Bc=b.div`
|
|
172
172
|
display: flex;
|
|
173
173
|
align-items: center;
|
|
174
174
|
gap: 4px;
|
|
175
175
|
width: 100%;
|
|
176
|
-
`,
|
|
176
|
+
`,Uc=b.div`
|
|
177
177
|
flex: 1;
|
|
178
178
|
min-width: 0;
|
|
179
|
-
`,
|
|
179
|
+
`,Vc=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
|
+
${Xc}:hover & {
|
|
202
202
|
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
${
|
|
205
|
+
${Xc}:hover &::-webkit-scrollbar-thumb {
|
|
206
206
|
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Hc=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
|
+
`,jc=({policy:n})=>{const i=v(),{CopyButton:o}=_t();return e(Xc,{children:[e(Bc,{children:[t(ul,{size:16,fill:i.v2.colors.silver[200]}),t(Uc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:nt.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(o,{value:n,size:Ct.XS})]}),t(Vc,{children:t(Hc,{children:n})})]})},Gc="{{permissions}}",Wc=/\{\{(\w+)\}\}/g,Kc="create-role",Yc=(e,t,n)=>(e?.setup?.artifacts??[]).find(e=>e.section===t&&(!n||e.id===n)),Jc=(e,t)=>(e?.setup?.artifacts??[]).filter(e=>e.section===t),qc=(e,t)=>{const n=new Set,i=[];return Jc(e,t).forEach(e=>{e.variant&&!n.has(e.variant)&&(n.add(e.variant),i.push({id:e.variant,label:e.variantLabel||e.variant}))}),i},Zc=(e,t,n)=>Jc(e,t).find(e=>e.variant===n),Qc=(e,t={})=>{const n=((e,t,n)=>{const i=e.split("\n"),o=i.findIndex(e=>e.includes(Gc));if(-1===o)return e;const a=i[o],l=a.slice(0,a.indexOf(Gc)),r=t.itemTemplate||"{{permission}}",s=t.itemSeparator??"\n";return 0===n.length?i.splice(o,1):i[o]=n.map(e=>{return l+(t=e,r.split("{{permission}}").join(t));var t}).join(s),i.join("\n")})(e.template??"",e,t.permissions??[]);return((e,t)=>e.replace(Wc,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:e))(n,t.vars??{})};var ed;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(ed||(ed={}));const td=[{id:ed.DiscoveryOnly,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Pt.Discovery]},{id:ed.DiscoveryInstrumentation,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Pt.Discovery,Pt.Instrumentation]},{id:ed.Custom,title:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],nd=(e,t)=>e.features?.find(e=>e.key===t),id=e=>{if(!e)return[];const t=nd(e,Pt.Discovery),n=nd(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}}):[]},od=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},ad=(e,t)=>{if(!e)return[];const n=td.find(e=>e.id===t)?.featureKeys??[],{out:i,add:o}=od();return o(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(o(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&o(e.permissions)}))}),i},ld=(e,t)=>{if(!e)return[];const n=id(e),i=nd(e,Pt.Discovery),o=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=od();return l(e.auth?.permissions),o&&l(i?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a},rd=(e,t,n)=>{const i=t===ed.Custom?ld(e,n??{}):ad(e,t),o=Yc(e,"permissions","policy-preview");return o?Qc(o,{permissions:i}):""},sd=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
|
+
`,cd=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
|
+
`,dd=b.div`
|
|
228
228
|
display: flex;
|
|
229
229
|
align-items: center;
|
|
230
230
|
min-width: 0;
|
|
231
|
-
`,
|
|
231
|
+
`,pd=b(dd)`
|
|
232
232
|
justify-content: center;
|
|
233
|
-
`,
|
|
233
|
+
`,ud={discovery:!1,instrumentation:!1},hd=({provider:n,capabilities:o,onCapabilitiesChange:a})=>{const l=id(n),r=(e,t)=>{a({...o,[e]:t})};return l.length?t(sd,{children:e(cd,{children:[t(dd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(pd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(pd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=o[n.typeName]??ud,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(i.Fragment,{children:[t(dd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(pd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(pd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},md=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
|
+
`,gd=b.div`
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 8px;
|
|
246
246
|
width: 100%;
|
|
247
|
-
`,
|
|
247
|
+
`,fd=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
|
+
`,bd=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
|
+
`,vd=({message:n})=>{const i=v();return e(fd,{children:[t(bd,{children:t(hl,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:i.v2.colors.purple[300],children:n})]})},yd=({provider:n,selectedPermission:i,onSelect:o,capabilities:a,onCapabilitiesChange:l})=>t(md,{children:td.map(r=>{const s=r.id===i,c=r.id===ed.Custom,d=s?e(gd,{children:[c&&t(hd,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(jc,{policy:rd(n,r.id,a)})]}):void 0,p=s?t(vd,{message:c?nt.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:nt.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>o(r.id),body:d,footerNote:p},r.id)})}),Cd=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
|
+
`,xd=b.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 4px;
|
|
279
|
-
`,
|
|
279
|
+
`,wd=b.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
align-items: stretch;
|
|
282
282
|
width: 100%;
|
|
283
|
-
`,
|
|
283
|
+
`,Td=b.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex: 0 0 40%;
|
|
286
286
|
min-width: 0;
|
|
287
|
-
`,
|
|
287
|
+
`,kd=()=>{const{providers:n,genericForm:i}=Dr(),[r,s]=l(!0),c=o(()=>n.find(e=>e.provider===i.formData.provider),[n,i.formData.provider]),p=d(e=>{e!==i.formData.provider&&i.handleFormChange(void 0,void 0,{...i.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[i]);return a(()=>{!i.formData.provider&&n.length>0&&p(n[0].provider)},[n,i.formData.provider,p]),a(()=>{i.formData.permission||i.handleFormChange("permission",ed.DiscoveryInstrumentation)},[i.formData.permission,i]),t(Cd,{children:e(Sd,{children:[e(xd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(De,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:nt.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>s(!1)}}),e(wd,{children:[t(Td,{children:t(zc,{providers:n,selectedProvider:i.formData.provider,onSelect:p})}),t(yd,{provider:c,selectedPermission:i.formData.permission,onSelect:e=>i.handleFormChange("permission",e),capabilities:i.formData.customCapabilities,onCapabilitiesChange:e=>i.handleFormChange("customCapabilities",e)})]})]})})},Id=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
|
+
`,Ed=b.div`
|
|
296
296
|
display: flex;
|
|
297
297
|
align-items: center;
|
|
298
298
|
gap: 12px;
|
|
299
299
|
width: 100%;
|
|
300
|
-
`,
|
|
300
|
+
`,Nd=b.div`
|
|
301
301
|
display: flex;
|
|
302
302
|
align-items: center;
|
|
303
303
|
justify-content: center;
|
|
@@ -306,41 +306,41 @@ 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
|
+
`,Od=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
|
+
`,$d=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
|
+
`,Ad=({"data-id":n,step:i,title:o,description:a,children:l})=>e(Id,{"data-id":n,children:[e(Ed,{children:[t(Nd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:i})}),e(Od,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:o}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:a})]})]}),l&&t($d,{children:l})]}),Rd=b.div`
|
|
322
322
|
display: flex;
|
|
323
323
|
align-items: stretch;
|
|
324
324
|
gap: 10px;
|
|
325
325
|
width: 100%;
|
|
326
|
-
`,
|
|
326
|
+
`,Dd=b.div`
|
|
327
327
|
display: flex;
|
|
328
328
|
flex: 2 1 0;
|
|
329
329
|
flex-direction: column;
|
|
330
330
|
gap: 12px;
|
|
331
331
|
min-width: 0;
|
|
332
332
|
padding: 12px 0;
|
|
333
|
-
`,
|
|
333
|
+
`,Pd=b.div`
|
|
334
334
|
display: flex;
|
|
335
335
|
flex-direction: column;
|
|
336
336
|
gap: 8px;
|
|
337
337
|
width: 100%;
|
|
338
|
-
`,
|
|
338
|
+
`,_d=b.div`
|
|
339
339
|
display: flex;
|
|
340
340
|
align-items: center;
|
|
341
341
|
gap: 12px;
|
|
342
342
|
width: 100%;
|
|
343
|
-
`,
|
|
343
|
+
`,Ld=b.div`
|
|
344
344
|
display: flex;
|
|
345
345
|
align-items: center;
|
|
346
346
|
justify-content: center;
|
|
@@ -349,7 +349,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
349
349
|
height: 24px;
|
|
350
350
|
border-radius: 16px;
|
|
351
351
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
352
|
-
`,
|
|
352
|
+
`,Fd=b.div`
|
|
353
353
|
display: flex;
|
|
354
354
|
flex: 3 1 0;
|
|
355
355
|
flex-direction: column;
|
|
@@ -358,42 +358,42 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
358
358
|
border-radius: 12px;
|
|
359
359
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
360
360
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
361
|
-
`,
|
|
361
|
+
`,Md=b.div`
|
|
362
362
|
display: flex;
|
|
363
363
|
align-items: center;
|
|
364
364
|
justify-content: flex-end;
|
|
365
365
|
width: 100%;
|
|
366
|
-
`,
|
|
366
|
+
`,zd=b.div`
|
|
367
367
|
flex: 1;
|
|
368
368
|
width: 100%;
|
|
369
369
|
min-height: 200px;
|
|
370
370
|
max-height: 260px;
|
|
371
371
|
overflow: auto;
|
|
372
372
|
padding: 0 12px 12px;
|
|
373
|
-
`,
|
|
373
|
+
`,Xd=b.pre`
|
|
374
374
|
margin: 0;
|
|
375
375
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
376
376
|
font-size: 12px;
|
|
377
377
|
line-height: 20px;
|
|
378
378
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
379
379
|
white-space: pre;
|
|
380
|
-
`,
|
|
380
|
+
`,Bd=({step:n,artifact:i,code:o})=>{const a=v(),{CopyButton:l}=_t(),r=i.steps??[];return t(Ad,{"data-id":"cloud-connector-create-role",step:n,title:i.title||nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:i.description,children:e(Rd,{children:[r.length>0&&e(Dd,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Pd,{children:r.map((n,o)=>e(_d,{children:[t(Ld,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:a.v2.colors.purple[200],children:o+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${i.id}-step-${o}`))})]}),o&&e(Fd,{children:[t(Md,{children:t(l,{value:o,size:Ct.XS})}),t(zd,{children:t(Xd,{children:o})})]})]})})},Ud=b.div`
|
|
381
381
|
display: flex;
|
|
382
382
|
flex-direction: column;
|
|
383
383
|
padding: 16px;
|
|
384
|
-
`,
|
|
384
|
+
`,Vd=b.div`
|
|
385
385
|
display: flex;
|
|
386
386
|
flex-direction: column;
|
|
387
387
|
gap: 12px;
|
|
388
388
|
padding: 16px 16px 12px;
|
|
389
389
|
border-radius: 16px;
|
|
390
390
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
391
|
-
`,
|
|
391
|
+
`,Hd=b.div`
|
|
392
392
|
display: flex;
|
|
393
393
|
align-items: center;
|
|
394
394
|
gap: 8px;
|
|
395
395
|
width: 100%;
|
|
396
|
-
`,
|
|
396
|
+
`,jd=b.button`
|
|
397
397
|
display: flex;
|
|
398
398
|
align-items: center;
|
|
399
399
|
justify-content: center;
|
|
@@ -410,38 +410,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
410
410
|
&:hover {
|
|
411
411
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
412
412
|
}
|
|
413
|
-
`,
|
|
413
|
+
`,Gd=b.div`
|
|
414
414
|
display: flex;
|
|
415
415
|
flex: 1;
|
|
416
416
|
flex-direction: column;
|
|
417
417
|
gap: 4px;
|
|
418
418
|
min-width: 0;
|
|
419
|
-
`,
|
|
419
|
+
`,Wd=b.div`
|
|
420
420
|
display: flex;
|
|
421
421
|
align-items: center;
|
|
422
422
|
gap: 4px;
|
|
423
423
|
padding: 8px 0 8px 2px;
|
|
424
|
-
`,
|
|
424
|
+
`,Kd=b.div`
|
|
425
425
|
display: flex;
|
|
426
426
|
flex-direction: column;
|
|
427
427
|
gap: 16px;
|
|
428
428
|
width: 100%;
|
|
429
|
-
`,
|
|
429
|
+
`,Yd=b.div`
|
|
430
430
|
display: flex;
|
|
431
431
|
flex-wrap: wrap;
|
|
432
432
|
gap: 24px;
|
|
433
433
|
width: 100%;
|
|
434
|
-
`,
|
|
434
|
+
`,Jd=b.div`
|
|
435
435
|
display: flex;
|
|
436
436
|
flex: 1 1 calc(50% - 12px);
|
|
437
437
|
min-width: 0;
|
|
438
|
-
`,
|
|
438
|
+
`,qd=({field:e,value:n,onChange:i})=>{const o=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:o,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=>i(e.target.value)}):t(Ee,{...l,width:"100%",type:e.secret?zt.Password:zt.Text,onChange:e=>i(e.target.value)})},Zd=({onBack:n})=>{const i=v(),{providers:l,genericForm:r}=Dr(),{provider:s,authMethod:c,setupMethod:d,accountId:p,credentials:u,permission:h,customCapabilities:m}=r.formData,g=o(()=>l.find(e=>e.provider===s),[l,s]),f=g?.connectorFields?.[0],b=o(()=>(e=>{const t=e?.auth?.defaultMethod?.trim();return t&&e?.auth?.methods?.some(e=>e.id===t)?t:e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??""})(g),[g]),y=o(()=>g?.auth?.methods?.find(e=>e.id===c),[g,c]),C=o(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const i=new Map(e?.auth?.methods?.map(e=>[e.id,e])),o=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!o.has(e.name)&&(o.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(i.get(e)?.fields)),l(n.fields),a})(g,c),[g,c]),S=o(()=>qc(g,Kc),[g]),x=S.length>0,w=o(()=>{if(x)return Zc(g,Kc,d)??(e=>{const t=qc(e,Kc);return t[0]?Zc(e,Kc,t[0].id):void 0})(g)},[g,d,x]),T=o(()=>Yc(g,"credentials"),[g]),k=o(()=>{const e=h;return e===ed.Custom?ld(g,m??{}):ad(g,e)},[g,h,m]),I=o(()=>w?Qc(w,{permissions:k,vars:{accountId:p??"",externalId:u.externalId?.trim()||"odigos-connector",projectId:p??"",subscriptionId:p??"",...u}}):"",[w,k,p,u]);a(()=>{if(!g)return;const e=g.auth?.methods?.some(e=>e.id===c);e||r.handleFormChange("authMethod",b)},[g,c,b,r]),a(()=>{x&&(S.some(e=>e.id===d)||r.handleFormChange("setupMethod",S[0].id))},[x,S,d,r]);let E=1;const N=f?E++:0,O=E++,$=x?E++:0,A=x?E++:0,R=E,D=g?.setup?.subtitle||(g?.displayName?`Configure the ${g.displayName} account and authentication details.`:"Configure the account and authentication details."),P=f?`Enter ${f.displayName||f.name}`:"Enter account details",_=f?.tooltip||"Enter the provider account identifier that contains the resources Odigos should discover.",L=T?.title||"Enter credentials",F=T?.description||y?.description||"Enter the credentials required by the selected authentication method.";return t(Ud,{children:e(Vd,{children:[e(Hd,{children:[t(jd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(ml,{size:24})}),e(Gd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:D})]})]}),f&&t(Ad,{"data-id":"cloud-connector-account",step:N,title:P,description:_,children:t(Ee,{name:`cloud-connector-account-${f.name}`,width:"100%",label:f.displayName||f.name,required:f.required,tooltip:f.tooltip||void 0,helpMessage:f.tooltip||void 0,placeholder:f.displayName||f.name,value:p,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(Ad,{"data-id":"cloud-connector-auth-method",step:O,title:nt.CLOUD_CONNECTOR_AUTH_TITLE,description:"Choose how the connector authenticates with this provider.",children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:Mt.S,selected:c,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(g?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),y?.description&&e(Wd,{children:[t(gl,{size:16,fill:i.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:y.description})]})]}),x&&t(Ad,{"data-id":"cloud-connector-setup-method",step:$,title:nt.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:nt.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:Mt.S,selected:d,setSelected:e=>r.handleFormChange("setupMethod",e),options:S.map(e=>({value:e.id,label:e.label}))})}),x&&w&&t(Bd,{step:A,artifact:w,code:I}),t(Ad,{"data-id":"cloud-connector-credentials",step:R,title:L,description:F,children:C.length>0?t(Kd,{children:t(Yd,{children:C.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(Jd,{style:n?{flex:"1 1 100%"}:void 0,children:t(qd,{field:e,value:u[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...u,[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=b.div`
|
|
439
439
|
display: flex;
|
|
440
440
|
flex-direction: column;
|
|
441
441
|
flex: 1;
|
|
442
442
|
min-height: 0;
|
|
443
443
|
padding: 16px;
|
|
444
|
-
`,
|
|
444
|
+
`,ep=b.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
flex-direction: column;
|
|
447
447
|
flex: 1;
|
|
@@ -449,13 +449,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
449
449
|
padding: 16px;
|
|
450
450
|
border-radius: 16px;
|
|
451
451
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
452
|
-
`,
|
|
452
|
+
`,tp=b.div`
|
|
453
453
|
display: flex;
|
|
454
454
|
flex: 1;
|
|
455
455
|
align-items: center;
|
|
456
456
|
justify-content: center;
|
|
457
457
|
width: 100%;
|
|
458
|
-
`,
|
|
458
|
+
`,np=b.div`
|
|
459
459
|
display: flex;
|
|
460
460
|
flex-direction: column;
|
|
461
461
|
align-items: center;
|
|
@@ -465,7 +465,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
465
465
|
padding: 24px 8px;
|
|
466
466
|
border-radius: 8px;
|
|
467
467
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
468
|
-
`,
|
|
468
|
+
`,ip=b.div`
|
|
469
469
|
display: flex;
|
|
470
470
|
flex-direction: column;
|
|
471
471
|
align-items: center;
|
|
@@ -474,7 +474,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
474
474
|
padding: 16px;
|
|
475
475
|
border-radius: 12px;
|
|
476
476
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
477
|
-
`,
|
|
477
|
+
`,op=b.div`
|
|
478
478
|
display: flex;
|
|
479
479
|
align-items: center;
|
|
480
480
|
justify-content: center;
|
|
@@ -483,7 +483,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
483
483
|
height: 39px;
|
|
484
484
|
border-radius: 20px;
|
|
485
485
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
486
|
-
`,
|
|
486
|
+
`,ap=b.div`
|
|
487
487
|
display: flex;
|
|
488
488
|
align-items: flex-start;
|
|
489
489
|
gap: 8px;
|
|
@@ -493,7 +493,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
493
493
|
padding: 12px;
|
|
494
494
|
border-radius: 8px;
|
|
495
495
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
496
|
-
`,
|
|
496
|
+
`,lp=b.pre`
|
|
497
497
|
flex: 1;
|
|
498
498
|
min-width: 0;
|
|
499
499
|
margin: 0;
|
|
@@ -503,25 +503,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
503
503
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
504
504
|
white-space: pre-wrap;
|
|
505
505
|
word-break: break-word;
|
|
506
|
-
`,
|
|
506
|
+
`,rp=b.div`
|
|
507
507
|
display: flex;
|
|
508
508
|
flex-direction: column;
|
|
509
509
|
gap: 12px;
|
|
510
510
|
width: 100%;
|
|
511
|
-
`,
|
|
511
|
+
`,sp=b.div`
|
|
512
512
|
display: flex;
|
|
513
513
|
flex-wrap: wrap;
|
|
514
514
|
gap: 24px;
|
|
515
515
|
padding: 0 2px;
|
|
516
|
-
`,
|
|
516
|
+
`,cp=b.div`
|
|
517
517
|
display: flex;
|
|
518
518
|
gap: 6px;
|
|
519
519
|
min-width: 0;
|
|
520
|
-
`,
|
|
520
|
+
`,dp=b.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-direction: column;
|
|
523
523
|
gap: 8px;
|
|
524
|
-
`,
|
|
524
|
+
`,pp=b.div`
|
|
525
525
|
display: flex;
|
|
526
526
|
flex-direction: column;
|
|
527
527
|
gap: 6px;
|
|
@@ -529,7 +529,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
529
529
|
border-radius: 12px;
|
|
530
530
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
531
531
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
532
|
-
`,dp=({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(qd,{children:t(Zd,{children:n?t(Qd,{children:t(ep,{children:t(xt,{withVisual:!0,withGradient:!0,title:ot.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(Qd,{children:e(tp,{children:[t(np,{children:t(ol,{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(op,{children:[t(ip,{children:p}),t(r,{value:p,size:St.XS})]})]})}):a?e(ap,{children:[t(ce,{status:_e.Success,label:ot.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:nl,fullWidth:!0}),(a.accountId||a.identity)&&e(lp,{children:[a.accountId&&e(rp,{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(rp,{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(sp,{children:a.checks.map(n=>e(cp,{$passed:n.passed,children:[t(ce,{status:n.passed?_e.Success:_e.Error,label:n.displayName,leftIcon:n.passed?nl:ol}),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(Qd,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:ot.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var pp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(pp||(pp={}));const up=pp.SelectProvider,hp=pp.Validate,mp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=Ar(),[p,u]=l(up),[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===up,k=p===hp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>up?e-1:e)},[]),E=d(()=>{if(x(void 0),p===pp.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<hp?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=td(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Zc.DiscoveryOnly:a=!0;break;case Zc.DiscoveryInstrumentation:a=!0,l=o;break;case Zc.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(pp.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),R=i(()=>S?{status:_e.Error,message:S}:void 0,[S]),D=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:hl,onClick:N,disabled:$},[T,I,N,$]),P=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Mt.RETRY,variant:Ie.Primary,rightIcon:gl,onClick:O}:void 0}return p===pp.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:E,disabled:$}},[k,g,A,p,O,E,$]),_=i(()=>[D,P].filter(Boolean),[D,P]);return e(Xt,{width:dr,isOpen:!0,hideOverlay:!$&&!o,header:{icon:dl,title:ot.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:_},children:[p===pp.SelectProvider&&t(wd,{}),p===pp.Config&&t(Jd,{onBack:N}),p===pp.Validate&&t(dp,{isTesting:g,error:y,result:b}),t(pr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},gp=({statuses:e})=>{const n=i(()=>Bt(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},fp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?_e.Unknown:_e.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},bp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=yr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=vr(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const R=i(()=>g?.find(e=>Gt(e)===r),[r,g]),D=i(()=>b.find(({type:e})=>e===R?.type)??gt(u,h).find(({type:e})=>e===R?.type)??Wt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),P=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const _=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,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]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&E(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),o())},[R,m,o]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:Jt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Mt.EDIT,icon:Ya,active:k,onClick:_},{id:"edit-action-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:N,onClick:B}]},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:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Rs,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[c&&(P?t(gp,{statuses:P}):t(Yt,{conditions:R.conditions||[]})),t(Kt,{bgTint:"800",cellsPerRow:2,items:fp(R,D)}),Y&&t(Ql,{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(ur,{target:"action",isOpen:N,onClose:()=>E(!1),onApprove:U}),t(pr,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},vp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=yr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=i(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=qt(y);a(()=>{y&&w(y)},[y]);const T=i(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(cr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:fl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},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:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,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:m.length,status:_e.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${m.length}`,status:_e.Unknown})]})]}),list:m.map(e=>t(ss,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Ot.S},"automatic-rollout-disabled")]}})},yp=e=>{const t=[{id:"type",title:ot.TYPE,label:e.destinationType.displayName},{id:"status",title:ot.STATUS,badge:{status:e.disabled?_e.Unknown:_e.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},Cp=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=yr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Cr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>en(m,h),[m,h]),D=i(()=>R?.find(e=>Gt(e)===r),[r,R]),P=f?.destinationCategories?.categories??null;a(()=>{D&&P&&C(D,P)},[D,P]);const _=i(()=>D&&P?tn(P,D):[],[D,P]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&P&&(C(D,P),I(!1))},[D,P,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),X=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Xe(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=Tt(D.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})(D,_);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Mt.EDIT,icon:Ya,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Mt.DELETE,icon:Ua,color:s.v2.colors.red[500],active:N,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:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(bt,{$height:"50vh",children:t(xt,{withSpinner:!0})}):k&&y?t(Ps,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[e(Kt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:yp(D)})]}),!!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(ur,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(pr,{isOpen:null!==O,onClose:()=>$(null),onApprove:X})]})},Sp=(e,t)=>{const n=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?_e.Unknown:_e.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},xp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=qe(u,h),{instrumentationRulesApi:g}=yr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=Sr();a(()=>{b()},[]);const[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=i(()=>A.length?A:Nt,[A]),D=i(()=>f?.find(e=>Gt(e)===r),[r,f]),P=i(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),_=i(()=>Ze(P?.supportedLanguages),[P?.supportedLanguages]);a(()=>{D&&P&&C(D,P)},[D,P]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:_e.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&P&&(C(D,P),k(!1))},[D,P,C]),M=d(()=>{$?O("close"):o()},[$,o]),z=d(()=>{$?O("cancel"):F()},[$,F]),X=d(()=>{const e=E;O(null),"close"===e?(F(),o()):F()},[E,F,o]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:_e.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});N(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),o())},[D,g,o]);if(!D||!P)return null;const H=(j=D,G=P,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:an(D.type),title:P.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Mt.EDIT,icon:Ya,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Mt.DELETE,icon:Ua,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:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Us,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:Sp(D,P)}),m&&t(Ql,{readOnly:!0,scopes:D.sourceScopes??null}),P.type===Je.CustomInstrumentation&&!!D.customInstrumentations?.[Ke.Php]?.length&&t(Pe,{status:_e.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})}),!!_.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:_.map(e=>t(on,{label:tt(e),leftIcon:et(e),flex:_.length>1?"0.5":"1"},e))})})})]})})})}),t(ur,{target:"instrumentation rule",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(pr,{isOpen:null!==E,onClose:()=>O(null),onApprove:X})]})};var wp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(wp||(wp={}));const Tp=({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(),{platformType:m,version:g}=S(),f=rn(m,g),b=sn(!!n),v=i(()=>({title:l,icon:bl,withCopy:!0}),[l]),y=i(()=>{const e=[],t=cn(c);t&&e.push(t);const n=cn(d,ul,"health");n&&e.push(n);const o=cn(p,vl,"health");return o&&e.push(o),e},[c,d,p]),C=i(()=>o?[{id:`restart-pod-${l}`,icon:gl,label:Mt.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),x=i(()=>[{id:"nodeName",title:ot.NODE,label:r,withCopy:!0},{id:"age",title:ot.AGE,label:s?h(s,{style:"short"}):f?ot.NOT_RUNNING:ot.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:ot.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Kt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},kp=b.div`
|
|
532
|
+
`,up=({isTesting:n,error:i,result:a})=>{const l=v(),{CopyButton:r}=_t(),s=o(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!i&&(!a||a.success)),d=i?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=i||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(ip,{children:[t(op,{children:t(ol,{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:il,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?il:ol}),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:i,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=Dr(),[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:i,authMethod:o,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!i.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!o)return void x("Please select an authentication method");const m=((e,t,n)=>{const i=e?.auth?.methods?.find(e=>e.id===t);if(!i)return;const o=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!o(e.name)),l=a(i.fields);if(l)return l;if(!i.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=i.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of i.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>o(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,o,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const i=id(e),o=[];return i.forEach(e=>{const i=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case ed.DiscoveryOnly:a=!0;break;case ed.DiscoveryInstrumentation:a=!0,l=i;break;case ed.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&o.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),o})(p,t,n);u(hp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:i.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),R=o(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=o(()=>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:ml,onClick:E,disabled:$},[T,I,E,$]),P=o(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:fl,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,$]),_=o(()=>[D,P].filter(Boolean),[D,P]);return e(Xt,{width:ur,isOpen:!0,hideOverlay:!$&&!i,header:{icon:pl,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:_},children:[p===hp.SelectProvider&&t(kd,{}),p===hp.Config&&t(Zd,{onBack:E}),p===hp.Validate&&t(up,{isTesting:g,error:y,result:b}),t(hr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},bp=({statuses:e})=>{const n=o(()=>Bt(e).map(({status:e,type:t,reason:n,message:i})=>({status:e,title:Ut(n||t),subTitle:i??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},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}}],i=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:i}),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:i,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=Sr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=Cr(),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 R=o(()=>g?.find(e=>Gt(e)===r),[r,g]),D=o(()=>b.find(({type:e})=>e===R?.type)??mt(u,h).find(({type:e})=>e===R?.type)??Wt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),P=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const _=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,C]),F=d(()=>{A?$("close"):i()},[A,i]),M=d(()=>{A?$("cancel"):L()},[A,L]),z=d(()=>{const e=O;$(null),"close"===e?(L(),i()):L()},[O,L,i]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&N(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),i())},[R,m,i]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:qt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:Ka,active:k,onClick:_},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:E,onClick:B}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Ps,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[c&&(P?t(bp,{statuses:P}):t(Yt,{conditions:R.conditions||[]})),t(Kt,{bgTint:"800",cellsPerRow:2,items:vp(R,D)}),Y&&t(tr,{readOnly:!0,scopes:K}),!!V.length&&t(Kt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:Jt(V)})]})})})}),t(mr,{target:"action",isOpen:E,onClose:()=>N(!1),onApprove:U}),t(hr,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},Cp=({onClose:n,connections:i,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Sr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=o(()=>i.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[i.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=o(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=Zt(y);a(()=>{y&&w(y)},[y]);const T=o(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(pr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:bl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Nt.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,leftColumn:{width:"35%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:m.length,status:Pe.Unknown})]}),e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${m.length}`,status:Pe.Unknown})]})]}),list:m.map(e=>t(ds,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Nt.S},"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=Fe(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:i,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Sr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=xr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=o(()=>tn(m,h),[m,h]),D=o(()=>R?.find(e=>Gt(e)===r),[r,R]),P=f?.destinationCategories?.categories??null;a(()=>{D&&P&&C(D,P)},[D,P]);const _=o(()=>D&&P?nn(P,D):[],[D,P]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&P&&(C(D,P),I(!1))},[D,P,C]),M=d(()=>{A?$("close"):i()},[A,i]),z=d(()=>{A?$("cancel"):F()},[A,F]),X=d(()=>{const e=O;$(null),"close"===e?(F(),i()):F()},[O,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,ze(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&N(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),i())},[D,u,i]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],i=Qt(e,t),o=i.map(e=>({name:e.key,value:e.value})),a=Fe(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return i.forEach(({key:e,name:i,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&en(h,a,o))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},i)=>{t==s&&l.push({id:`${e}-custom-${i}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:i,label:new Array(10).fill("•").join("")});else{if(p===jt.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:i,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===jt.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:i,items:t.map((t,n)=>{const i=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=i.key?String(i.key):"",label:null!=i.value?String(i.value):""}})})}l.push({id:e,title:i,label:s})}else l.push({id:e,title:i,label:"-"})}),r(),n})(D,_);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:Ka,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Va,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:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Ls,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[e(Kt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:Sp(D)})]}),!!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(mr,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t(hr,{isOpen:null!==O,onClose:()=>$(null),onApprove:X})]})},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:i,ruleId:r})=>{const s=v(),{addNotification:c}=on(),{isK8s:p,platformType:u,version:h}=S(),m=Je(u,h),{instrumentationRulesApi:g}=Sr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=wr();a(()=>{b()},[]);const[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=o(()=>A.length?A:It,[A]),D=o(()=>f?.find(e=>Gt(e)===r),[r,f]),P=o(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),_=o(()=>qe(P?.supportedLanguages),[P?.supportedLanguages]);a(()=>{D&&P&&C(D,P)},[D,P]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&P&&(C(D,P),k(!1))},[D,P,C]),M=d(()=>{$?O("close"):i()},[$,i]),z=d(()=>{$?O("cancel"):F()},[$,F]),X=d(()=>{const e=N;O(null),"close"===e?(F(),i()):F()},[N,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});E(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),i())},[D,g,i]);if(!D||!P)return null;const H=(j=D,G=P,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:ln(D.type),title:P.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:Ka,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Hs,{}):t(ae,{$gap:16,children:e(Kt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Kt,{bgTint:"800",cellsPerRow:2,items:wp(D,P)}),m&&t(tr,{readOnly:!0,scopes:D.sourceScopes??null}),P.type===Ye.CustomInstrumentation&&!!D.customInstrumentations?.[We.Php]?.length&&t(De,{status:Pe.Warning,message:Ke.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H.length&&t(Kt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:Jt(H)}),!!_.length&&t(Kt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Kt,{bgTint:"800",children:t(ie,{$gap:12,$wrap:"wrap",children:_.map(e=>t(an,{label:et(e),leftIcon:Qe(e),flex:_.length>1?"0.5":"1"},e))})})})]})})})}),t(mr,{target:"instrumentation rule",isOpen:I,onClose:()=>E(!1),onApprove:V}),t(hr,{isOpen:null!==N,onClose:()=>O(null),onApprove:X})]})};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:i,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=rn(),{platformType:m,version:g}=S(),f=sn(m,g),b=cn(!!n),v=o(()=>({title:l,icon:vl,withCopy:!0}),[l]),y=o(()=>{const e=[],t=dn(c);t&&e.push(t);const n=dn(d,hl,"health");n&&e.push(n);const i=dn(p,yl,"health");return i&&e.push(i),e},[c,d,p]),C=o(()=>i?[{id:`restart-pod-${l}`,icon:fl,label:Ft.RESTART_POD,onClick:()=>i(a,l)}]:void 0,[i,a,l]),x=o(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):f?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:nt.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Kt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ep=b.div`
|
|
533
533
|
display: flex;
|
|
534
534
|
align-items: center;
|
|
535
535
|
justify-content: space-between;
|
|
@@ -537,7 +537,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
537
537
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
538
538
|
border-radius: 12px;
|
|
539
539
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
540
|
-
`,
|
|
540
|
+
`,Np=({podsOdigosHealthStatus:n,pods:i,noPadding:a})=>{const l=un(n?.status),r=Ut(n?.name),s=n?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=o(()=>({totalPodsCount:i?.length||0,odigosHealthyPodsCount:i?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===pn.Success?1:0),0)||0,k8sHealthyPodsCount:i?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===pn.Success?1:0),0)||0}),[i]);return i?.length&&n&&l?e(Ep,{$noPadding:a,children:[t(Vt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(ie,{$gap:8,children:[t($p,{label:nt.PODS,count:c}),t($p,{label:nt.ODIGOS_HEALTHY,icon:hl,count:d,total:c}),t($p,{label:nt.KUBERNETES_HEALTHY,icon:yl,count:p,total:c})]})]}):null},Op=b.div`
|
|
541
541
|
display: flex;
|
|
542
542
|
flex-direction: column;
|
|
543
543
|
justify-content: center;
|
|
@@ -548,7 +548,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
548
548
|
width: fit-content;
|
|
549
549
|
border-radius: 8px;
|
|
550
550
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
551
|
-
|
|
551
|
+
`,$p=({count:n,total:i,label:o,icon:a})=>{const l=v(),r=void 0===i?void 0:n===i?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Op,{children:[e(ie,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==i&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${i}`})]}),e(ie,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:o})]})]})},Ap=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===hn.PID)??e.identifyingAttributes?.find(({name:e})=>e===hn.VPID);return t?.value??null};var Rp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Rp||(Rp={}));const Dp=({overrideProcessNum:n,healthy:i,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(Rp.IdentifyingAttributes),m=cn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=o(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:Rp.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Rp.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Cl,{...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=o(()=>{switch(u){case Rp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(Mp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case Rp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(Mp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=o(()=>Ap({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Kt,{bgTint:"800",richTitle:{title:C?`${nt.PROCESS} ${nt.PID(C)}`:nt.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:i?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:i?Pe.Success:Pe.Error,leftIcon:hl,label:i?nt.HEALTHY:nt.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`
|
|
552
552
|
display: flex;
|
|
553
553
|
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
554
554
|
gap: 8px;
|
|
@@ -557,23 +557,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
557
557
|
&:hover {
|
|
558
558
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
559
559
|
}
|
|
560
|
-
`,
|
|
560
|
+
`,_p=b(ee)`
|
|
561
561
|
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
562
|
-
`,
|
|
562
|
+
`,Lp=b(ee)`
|
|
563
563
|
flex: 1 1 auto;
|
|
564
564
|
min-width: 0;
|
|
565
|
-
`,
|
|
565
|
+
`,Fp=b(ie)`
|
|
566
566
|
flex: 1 1 auto;
|
|
567
567
|
justify-content: flex-end;
|
|
568
568
|
min-width: 0;
|
|
569
|
-
`,
|
|
569
|
+
`,Mp=({label:n,value:i,isStandardLibrary:o,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Pp,{$withHealthBadge:r,children:[t(_p,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),i&&t(Lp,{size:te.XXS,color:ne.Primary,align:"right",children:i}),(o||r)&&e(Fp,{children:[o&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(ie,{$gap:4,children:[l&&t(Lp,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?nt.HEALTHY:nt.NOT_HEALTHY,leftIcon:hl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},zp=h(null),Xp=({value:e,children:n})=>t(zp.Provider,{value:e,children:n}),Bp=({podContainers:e,sourceContainers:n,jumpToTarget:i})=>{const a=e??[],l=o(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=o(()=>{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=i?.containerName===e.containerName;return t(Vp,{...e,language:mn(r.get(e.containerName)),jumpToTarget:n?i:null},`pod-container-${e.containerName}`)})})})},Up=b.div`
|
|
570
570
|
display: flex;
|
|
571
571
|
flex-direction: column;
|
|
572
572
|
gap: 12px;
|
|
573
573
|
padding: 8px 12px;
|
|
574
574
|
border-radius: 8px;
|
|
575
575
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
576
|
-
`,
|
|
576
|
+
`,Vp=({language:n,containerName:i,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}=rn(),{platformType:C,version:x}=S(),w=sn(C,x),T=cn(v),k=o(()=>({title:i,icon:n?gn(n):Sl,iconWithWrapper:!0}),[i,n]),I=o(()=>{const e=[],t=dn({status:a?pn.Success:pn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=dn(h,hl,"health");n&&e.push(n);const i=dn(m,yl,"health");return i&&e.push(i),e},[m,h,a]),E=o(()=>{const e=[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):w?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:l?`${nt.RUNNING_TIME_TOOLTIP}. (${l})`:w?nt.RUNNING_TIME_TOOLTIP:nt.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Za:Qa,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Za:Qa,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Qa,label:nt.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:nt.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c,w]),N=o(()=>u?Ut(p):"",[u,p]);return t("div",{ref:T,children:e(Kt,{bgTint:"750",richTitle:k,badges:I,items:E,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Up,{children:e(ie,{$gap:10,$alignItems:"center",children:[t(an,{variant:fn.Pink,leftIcon:yl,label:N}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const o=n+1,a=b&&(l=f,r=e,!!l?.processPid&&Ap({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Dp,{...e,overrideProcessNum:o,isJumpToTarget:a},`pod-container-${i}-process-${o}`)})]})})},Hp=({podName:e,namespace:n,hasRestarted:i})=>{const a=o(()=>({title:nt.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=o(()=>[{label:nt.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:nt.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:nt.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${i?" -p":""}`}],[e,n,i]);return t(Kt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(bn,{bgTint:"700",label:e,value:n},e))})},jp=({source:i,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(zp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===kp.Pods?l:null,s=i?.pods??[],c=s.length>0,d=o(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=o(()=>({title:nt.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(Np,{podsOdigosHealthStatus:i.podsOdigosHealthStatus,pods:s}),t(Kt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const o=r?.podName===n.podName,l=o&&!r?.containerName;return e(Ip,{...n,namespace:i.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:o,isJumpToTarget:l,children:[t(Hp,{podName:n.podName,namespace:i.id.namespace,hasRestarted:d}),t(Bp,{podContainers:n.containers,sourceContainers:i.containers,jumpToTarget:o?r:null})]},`pod-${n.podName}`)})})]}):t(ft,{$height:"70vh",children:t($e,{title:nt.NO_RUNNING_PODS,subTitle:nt.NO_RUNNING_PODS_SUBTITLE})})})},Gp="user",Wp=({source:n})=>{const i=o(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=Sr(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:i},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:nt.COULD_NOT_FETCH_PEER_SOURCES})}):e(ie,{$gap:16,$alignItems:"flex-start",children:[t(Kp,{icon:xl,title:nt.INBOUND,subTitle:nt.INBOUND_DESCRIPTION(i),onRefresh:s,items:c?.inbound??[]}),t(Kp,{icon:wl,title:nt.OUTBOUND,subTitle:nt.OUTBOUND_DESCRIPTION(i),onRefresh:s,items:c?.outbound??[]})]})},Kp=({icon:n,title:i,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=o(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Kt,{bgTint:"1000",richTitle:{icon:n,title:i,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:vn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:fl,onClick:r}}],children:[t(yn,{value:c,onChange:d,width:"100%"}),t(Cn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t($e,{icon:n,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Jp,{...e},`${i}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t($e,{icon:n,title:`No ${i} connections yet`,subTitle:i===nt.INBOUND?nt.NO_INBOUND_CONNECTIONS_DESCRIPTION:nt.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Yp=b.div`
|
|
577
577
|
display: flex;
|
|
578
578
|
align-items: center;
|
|
579
579
|
justify-content: space-between;
|
|
@@ -587,9 +587,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
587
587
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
588
588
|
}
|
|
589
589
|
`}
|
|
590
|
-
`,
|
|
590
|
+
`,Jp=({serviceName:n,isVirtual:i,nodeAttributes:a})=>{const l=Sn(e=>e.drawerEntityId),{items:r}=Sr().sourcesApi.useSources(),s=o(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=o(()=>s&&JSON.stringify(xn(s))!==JSON.stringify(xn(l)),[s,l]),d=o(()=>{if(i){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[wn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Gp)return[Tl];const e=s?Tn(s):void 0;return e?.length?e:[Sl]},[i,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Sn.getState();e(In(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Yp,{onClick:p,$withClick:!!p,children:[e(ie,{$gap:8,children:[t(kn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),i&&t(ce,{status:Pe.Info,label:nt.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:nt.VIRTUAL_TOOLTIP})]})},qp=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}},Zp=({source:n})=>{const i=v(),{k8sManifestApi:r}=Sr(),[s,c]=l(!0),[d,u]=l(void 0),[h,m]=l(!0),[g,f]=l(void 0),[b,y]=l(!0),[C,S]=l({}),x=p(r);x.current=r,a(()=>{x.current.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(qp(e))).finally(()=>c(!1)),x.current.fetch({namespace:n.id.namespace,kind:En.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>f(qp(e))).finally(()=>m(!1))},[n.id.namespace,n.id.kind,n.id.name]);const w=o(()=>(n.pods??[]).map(e=>e.podName).join(","),[n.pods]);a(()=>{if(Object.keys(C).length>0)return;const e=w?w.split(","):[];if(0===e.length)return S({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await x.current.fetch({namespace:n.id.namespace,kind:En.Pod,name:e});return[e,qp(t)]})).then(e=>{t||S(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[C,w,n.id.namespace]);const T=o(()=>[{label:nt.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:nt.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:nt.GET_POD_YAML,value:`kubectl get ${En.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:kl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:T.map(({label:e,value:n},i)=>t(bn,{label:e,value:n},`debug-cmd-${i}-${e}`))}),s?t(re,{size:1}):t(gr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),h?t(re,{size:1}):t(gr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g}),n.pods?.map(e=>b?t(re,{size:1},e.podName):t(gr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:C[e.podName]},e.podName))]})},Qp=({title:n,children:i})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),i]}),eu=({source:n})=>{const i=o(()=>{const[e,t]=On(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Qp,{title:nt.THROUGHPUT_LAST_10_SECONDS,children:e(ie,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:i.value}),t(ee,{size:te.XS,variant:Ot.Span,children:i.units})]})})},tu=({source:n})=>{const{CopyButton:i}=_t();return t(Qp,{title:nt.NAMESPACE,children:e(ie,{children:[t(an,{variant:fn.Blue,label:n.id.namespace}),t(i,{value:n.id.namespace,size:Ct.XS})]})})},nu=({source:n})=>{const{CopyButton:i}=_t(),o=n.id.region;return o?t(Qp,{title:nt.REGION,children:e(ie,{children:[t(an,{variant:fn.Blue,label:o}),t(i,{value:o,size:Ct.XS})]})}):null},iu=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Qp,{title:nt.ENABLED,children:t(ie,{children:t(an,{variant:n?fn.Green:fn.Default,label:n?nt.ENABLED:nt.DISABLED})})})},ou=({source:e,label:n})=>t(Qp,{title:nt.KIND,children:t(ie,{children:t(an,{variant:fn.Blue,label:n||e.id.kind})})}),au=({source:n})=>{const{CopyButton:i}=_t();return t(Qp,{title:nt.NAME,children:e(ie,{children:[t(an,{variant:fn.Blue,label:n.id.name}),t(i,{value:n.id.name,size:Ct.XS})]})})},lu=({source:n})=>{const{CopyButton:i}=_t(),o=n.serviceName||n.id.name;return t(Qp,{title:nt.SERVICE_NAME,children:e(ie,{children:[t(an,{variant:fn.Blue,label:o}),t(i,{value:o,size:Ct.XS})]})})},ru=({source:n})=>{const{isK8s:i,isConnector:a}=S(),l=o(()=>Nn(n.id.kind),[n.id.kind]);return t(Kt,{children:e(ie,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[i&&t(eu,{source:n}),t(iu,{source:n}),a&&t(nu,{source:n}),i&&t(tu,{source:n}),t(ou,{source:n,label:l}),t(au,{source:n}),!i&&t(lu,{source:n})]})})},su=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Kt,{bgTint:"900",children:t(Np,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,cu=({source:e})=>{const n=o(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?$n(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Vt,{...n,width:"100%"}):null},du=h(null),pu=b.div`
|
|
591
591
|
position: relative;
|
|
592
|
-
`,
|
|
592
|
+
`,uu=({children:e})=>{const n=p(null);return t(pu,{ref:n,children:t(du.Provider,{value:n,children:e})})},hu=b.div`
|
|
593
593
|
position: fixed;
|
|
594
594
|
top: ${({$coords:e})=>e.top}px;
|
|
595
595
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -603,25 +603,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
603
603
|
padding: 12px 16px;
|
|
604
604
|
border-radius: 12px;
|
|
605
605
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
606
|
-
`,
|
|
606
|
+
`,mu=b.div`
|
|
607
607
|
display: flex;
|
|
608
608
|
align-items: flex-end;
|
|
609
609
|
justify-content: space-between;
|
|
610
610
|
gap: 8px;
|
|
611
|
-
`,
|
|
611
|
+
`,gu=b.div`
|
|
612
612
|
flex: 1;
|
|
613
|
-
`,
|
|
613
|
+
`,fu=({width:n,onClose:i,onSave:o,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(du),[y,C]=l(null);return An(b??{current:null},i),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Vr(e(hu,{$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(mu,{children:[t(gu,{children:u}),e(ie,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Va,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:o,leftIcon:il,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(De,{status:Pe.Warning,message:p})})]}),document.body):null},bu=({language:n,overridden:i,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Zt(r),u=o(()=>{if(!n)return[];const e=Rn[n].community,t=s===Dn.Onprem?Rn[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(ie,{$gap:4,$alignItems:"center",children:[i?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(uu,{children:[t(Be,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:Ka,onClick:b})}),g&&t(fu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},vu=({overridden:n,onOverride:i,defaultValues:a,originalValues:r})=>{const{addNotification:s}=on(),{formData:c,handleFormChange:d,resetFormData:p}=Zt(a),u=o(()=>Pn.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(ie,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(uu,{children:[t(Be,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:Ka,onClick:b})}),g&&t(fu,{width:"500px",onClose:b,onSave:async()=>{!c.version||_n(c.version)?(m(!0),await i(c),m(!1),b()):s({type:Pe.Warning,message:Ke.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ie,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ee,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},yu=b.div`
|
|
614
614
|
display: flex;
|
|
615
615
|
flex-direction: column;
|
|
616
616
|
gap: 10px;
|
|
617
617
|
padding: 10px 12px 10px 20px;
|
|
618
618
|
border-radius: 8px;
|
|
619
619
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
620
|
-
`,
|
|
620
|
+
`,Cu=b.div`
|
|
621
621
|
display: flex;
|
|
622
622
|
flex-wrap: wrap;
|
|
623
623
|
gap: 12px 24px;
|
|
624
|
-
`,
|
|
624
|
+
`,Su=({title:n,children:i})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),i]}),xu=({processes:n})=>{const i=o(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return i.length?e(ae,{$gap:6,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:`${nt.PROCESSES} (${i.length})`}),i.map(n=>{const i=n.exe?.trim()||null,o=n.cmdline?.trim()||null;return e(yu,{children:[t(Cu,{children:t(Su,{title:nt.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),i?t(bn,{label:nt.EXECUTABLE,value:i,bgTint:"900"}):null,o&&o!==i?t(bn,{label:nt.COMMAND,value:o,bgTint:"900"}):null]},n.pid)})]}):null},wu=b.div`
|
|
625
625
|
display: flex;
|
|
626
626
|
flex-direction: column;
|
|
627
627
|
align-self: stretch;
|
|
@@ -629,14 +629,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
629
629
|
padding: 8px 12px;
|
|
630
630
|
border-radius: 8px;
|
|
631
631
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
632
|
-
`,
|
|
632
|
+
`,Tu=b.div`
|
|
633
633
|
display: flex;
|
|
634
634
|
align-items: center;
|
|
635
635
|
justify-content: center;
|
|
636
636
|
padding: 8px;
|
|
637
637
|
border-radius: 10px;
|
|
638
638
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
639
|
-
`,
|
|
639
|
+
`,ku=e=>{if(!e)return Ln.Unknown;const t=e.trim().toLowerCase();return{go:Ln.Go,golang:Ln.Go,javascript:Ln.JavaScript,js:Ln.JavaScript,node:Ln.JavaScript,nodejs:Ln.JavaScript,typescript:Ln.JavaScript,python:Ln.Python,java:Ln.Java,dotnet:Ln.DotNet,csharp:Ln.CSharp,php:Ln.Php,ruby:Ln.Ruby,rust:Ln.Rust,swift:Ln.Swift,elixir:Ln.Elixir}[t]??Ln.Unknown},Iu=({source:n})=>{const i=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=Sr(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=o(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=o(()=>{const e=ku(s?.runtimeLanguage);return e!==Ln.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??Ln.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=o(()=>{const e=ku(c?.runtimeOverride?.language);return{language:e!==Ln.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=o(()=>!!c?.distroOverride?.otelDistroName,[c]),f=o(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=o(()=>{const{language:e,version:t}=m;return e!==Ln.Unknown||t?e!==Ln.Unknown&&t?`${e} • ${t}`:e!==Ln.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=o(()=>y||m.language===Ln.Unknown?Sl:gn(m.language),[y,m.language]),x=o(()=>{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:Qa,label:Ut(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Qa,label:"Error"}:t?{status:Pe.Success,leftIcon:Za,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Qa,label:nt.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==Ln.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Kt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTATION,tooltip:nt.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(wu,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(Tu,{children:t(C,{size:24,fill:y||m.language===Ln.Unknown?i.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(an,{variant:fn.Loader,label:nt.DETECTING_RUNTIME_INFO}):b?t(an,{variant:fn.Blue,label:b}):null,t(vu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Ln.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Ln.Unknown?u:void 0,version:h}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(bu,{language:m.language!==Ln.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(xu,{processes:d}):null]})})}):null},Eu="100%",Nu=b(ie)`
|
|
640
640
|
@media (max-width: 1099px) {
|
|
641
641
|
flex-direction: column;
|
|
642
642
|
|
|
@@ -644,12 +644,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
644
644
|
width: 100%;
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
`,
|
|
647
|
+
`,Ou=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Ut(e):`${t} ${Ut(e)}`:t,$u=b(ie)`
|
|
648
648
|
width: fit-content;
|
|
649
649
|
padding: 2px 6px;
|
|
650
650
|
border-radius: 8px;
|
|
651
651
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
652
|
-
`,
|
|
652
|
+
`,Au=({overview:n,status:i})=>{const o=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($u,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:i,d=Mn(c,o);return e(ie,{$gap:2,children:[t(d,{size:16,fill:Fn(o,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Ru=({changedTime:e})=>{const{formatTimeAgo:n}=rn();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Du=({source:n,onClickRollout:i,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=o(()=>{const{status:e,reasonEnum:o,message:a,actionItems:r}=l||{},s=un(e);if(!s)return null;const c=Ou(o,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Il,onClick:i}]);return{status:s,title:c,subTitle:d,details:t(Au,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Ru,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,i]),s=o(()=>{const{status:e,reasonEnum:t,message:i,actionItems:o}=n.autoRollback?.autoRollbackStatus||{},l=un(e);if(!l)return null;const r=Ou(t,nt.ROLLBACK),s=i,c=(o??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:fl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:fl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(Nu,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Eu,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":Eu,...s})]}):null},Pu=({source:e})=>{const{isK8s:n}=S(),{containers:i,containersRichTitle:a}=o(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${nt.CONTAINERS}`:nt.DETECTED_PROCESSES,tooltip:t?.message||(n?nt.DETECTED_CONTAINERS_DESCRIPTION:nt.DETECTED_PROCESSES_DESCRIPTION),badge:un(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return i.length?t(Kt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:i.map(n=>n&&t(Mu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},_u=b.div`
|
|
653
653
|
display: flex;
|
|
654
654
|
flex-direction: column;
|
|
655
655
|
align-self: stretch;
|
|
@@ -657,26 +657,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
657
657
|
padding: 8px 12px;
|
|
658
658
|
border-radius: 8px;
|
|
659
659
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
660
|
-
`,
|
|
660
|
+
`,Lu=b.div`
|
|
661
661
|
display: flex;
|
|
662
662
|
align-items: center;
|
|
663
663
|
justify-content: center;
|
|
664
664
|
padding: 8px;
|
|
665
665
|
border-radius: 10px;
|
|
666
666
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
667
|
-
`,
|
|
667
|
+
`,Fu=b.div`
|
|
668
668
|
display: flex;
|
|
669
669
|
flex-direction: column;
|
|
670
670
|
gap: 12px;
|
|
671
671
|
padding: 8px 12px;
|
|
672
672
|
border-radius: 8px;
|
|
673
673
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
674
|
-
`,
|
|
674
|
+
`,Mu=({sourceId:n,...i})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=i,c=v(),{sourcesApi:d}=Sr(),p=o(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=o(()=>({language:mn(i),version:zn(i)||void 0}),[i]),h=o(()=>!!s?.otelDistroName,[s]),m=o(()=>({otelDistroName:s?.otelDistroName||i.agentEnabled?.otelDistroName}),[s,i]),g=o(()=>!l&&!p,[l,p]),f=o(()=>g?Sl:gn(u.language),[g,u]),b=o(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=o(()=>g?{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?Za:Qa,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=o(()=>{const e=[];return i.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(i.collectorConfig?.tailSampling?.noisyOperations?.length||i.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||i.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[i]);return e(_u,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(Lu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(an,b?{variant:fn.Blue,label:b}:{variant:fn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(vu,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:i.runtimeInfo?.language,version:i.runtimeInfo?.runtimeVersion||""}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...y,textSize:te.XXXS}),t(bu,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Fu,{children:e(ie,{$gap:10,$alignItems:"center",children:[t(an,{variant:fn.Pink,label:Ut(r.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Fu,{children:t(ie,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:Za,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},zu=({source:n,onClickRollout:i,onClickRollback:a})=>{const{isK8s:l,platformType:r,version:s}=S(),c=o(()=>Xn(r,s)?Bt(Bn(n.conditions)):[],[r,s,n.conditions]);return e(ae,{$gap:12,children:[t(ru,{source:n}),t(cu,{source:n}),l&&t(Du,{source:n,onClickRollout:i,onClickRollback:a}),!!c.length&&t(Yt,{conditions:c,title:nt.INSTRUMENTATION_LIFECYCLE}),l&&t(Pu,{source:n}),!l&&t(Iu,{source:n}),l&&t(su,{source:n})]})},Xu=({source:e})=>{const n=e.containers||[];return t(Kt,{bgTint:"1000",richTitle:{title:nt.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(Mp,{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"})})},Bu=b(ae)`
|
|
675
675
|
width: 100%;
|
|
676
676
|
max-height: 320px;
|
|
677
677
|
overflow-y: auto;
|
|
678
678
|
gap: 8px;
|
|
679
|
-
`,
|
|
679
|
+
`,Uu=b(ie)`
|
|
680
680
|
width: 100%;
|
|
681
681
|
align-items: center;
|
|
682
682
|
gap: 8px;
|
|
@@ -686,14 +686,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
686
686
|
& > * {
|
|
687
687
|
font-family: monospace !important;
|
|
688
688
|
}
|
|
689
|
-
`,Bu=({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(zu,{children:[n.add.map(n=>e(Xu,{children:[t(ce,{leftIcon:Va,status:_e.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(Xu,{children:[t(ce,{leftIcon:Il,status:_e.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 Uu(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 Vu(e){const t=Math.abs(e);return t>=1e9?`${Hu(e/1e9)}s`:t>=1e6?`${Hu(e/1e6)}ms`:t>=1e3?`${Hu(e/1e3)}μs`:String(Math.round(e))}function Hu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function ju(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 Gu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Wu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Ku(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=>Uu(e,t.nameIndex))}function Yu(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&&Uu(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 Ju(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 Zu(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 Qu,eh;function th(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function nh(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 oh(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"})(Qu||(Qu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(eh||(eh={}));const ih=({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(""),[N,E]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,P]=l(Qu.Fit),[_,L]=l(eh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=O.length>0?O[O.length-1]:null,U=B?.size??n.numTicks,V=i(()=>ju(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=Ku(e,t,l);if(0===i.length)break;const r=Yu(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)=>Wu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Ju(V,B),t=new Set;for(const o of e){const e=Uu(n,o.nameIndex);e&&t.add(e)}f([...t])},[B,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??ju(e);let p=l?Ju(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Uu(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&&Uu(e,l.nameIndex)===Uu(e,t.nameIndex)&&i.add(Gu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Gu(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(Gu(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=Uu(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:qu(s,v)}})}(n,z,X,o,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,X,z,B,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||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=nh((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*X,G);if(o){const e=Gu(o);E(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 ${Vu(o.size)} (${t}% of view, ${i}% of profile) · self ${Vu(o.self)}`)}else E(null),I("")},[G,n.numTicks,X,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(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||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=nh((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*X,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&&Wu(a,t)?e.slice(0,-1):[...e,a]})},[G,X,z,m]);g(()=>{const e=S.current;if(!e||z<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,X),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(X*i),e.style.width=`${z}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,X),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}=Zu(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=th(d,r),g=`${s} (${Vu(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(Gu(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,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,X)))},[j,n.numTicks,N,r,X,z,y]);const Z=d(()=>R(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??ju(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,B,V),[n,B,V]),ae=null!==ie,le=O.length>0,re=B?Uu(n,B.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:Nl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Il,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:Va,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:Bn.Filled,options:[{value:Qu.Fit,label:"W: Fit"},{value:Qu.X10,label:"10x"}],selected:D,setSelected:P})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Bn.Filled,options:[{value:eh.Fit,label:"H: Fit"},{value:eh.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?ol:El,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:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Vu(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 · ${oh(h.totalBytesUsed)} / ${oh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ah=[_n.Go,_n.Java],lh="Profiling Symbols";function rh(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 sh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function ch(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>sh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function dh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function ph(e,t){return e.className===t.className&&e.methodName===t.methodName}function uh(e,t,n,o){const i=rh(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!ch(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>dh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>ph(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var hh,mh,gh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(hh||(hh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(mh||(mh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(gh||(gh={}));const fh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function bh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(gh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(gh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&fh.test(n))}const vh=({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:mh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:gh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:gh.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===hh.Symbol)?.rawValue?.toString()??"";return!(t.includes(mh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&bh(n,t)}}},[o,u]),g=i(()=>[{key:hh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:hh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:hh.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:hh.Symbol,rawValue:e.name},{key:hh.Self,rawValue:Vu(e.self)},{key:hh.Total,rawValue:Vu(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:Ua,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Va,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:Ol,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Un,{variant:Vn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var yh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(yh||(yh={}));const Ch=b(ae)`
|
|
689
|
+
`,Vu=({pendingModify:n,onClose:i,onConfirm:o})=>{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:i,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:i},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:o},children:n&&e(Bu,{children:[n.add.map(n=>e(Uu,{children:[t(ce,{leftIcon:Ha,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:El,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 i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const a=i[e],l=i[e+1],r=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),o=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 i=0;i<=t.level;i++){let o;for(const n of e)if(n.level===i&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){o=n;break}if(!o)return n;n.push(o)}return n})(t,n).map(t=>Hu(e,t.nameIndex))}function qu(e,t,n){if(0===n.length)return null;let i=null,o=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&&(i&&(n.offset<i.offset||n.offset+n.size>i.offset+i.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;i=r,o=r}return o}function Zu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.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){o.push(e);break}}return o}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 i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var th,nh;function ih(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function oh(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;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:i,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,R]=l(!1),[D,P]=l(th.Fit),[_,L]=l(nh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=O.length>0?O[O.length-1]:null,U=B?.size??n.numTicks,V=o(()=>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 i=((e,t,n,i,o)=>{const a=[];for(const l of o){const o=Ju(e,t,l);if(0===o.length)break;const r=qu(n,i,o);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return i.length===t.length&&i.every((e,n)=>Yu(e,t[n]))?t:i}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Zu(V,B),t=new Set;for(const i of e){const e=Hu(n,i.nameIndex);e&&t.add(e)}f([...t])},[B,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=o(()=>function(e,t,n,i,o,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),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.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)&&o.add(Ku(l))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Ku(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&o.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=i??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=o.trim(),y=b>8?1:0;return p.map(n=>{const i=n.level-u,o=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=i*b,r=Math.max(b-y,1),s=Hu(e,n.nameIndex);return{...n,x:o,y:l,w:a,h:r,name:s,matchesSearch:Qu(s,v)}})}(n,z,X,i,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,i,r,X,z,B,s,F,V]),G=o(()=>(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||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=oh((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*X,G);if(i){const e=Ku(i);N(e);const t=U>0?(100*i.size/U).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";I(`${i.name}\ntotal ${ju(i.size)} (${t}% of view, ${o}% of profile) · self ${ju(i.self)}`)}else N(null),I("")},[G,n.numTicks,X,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||X<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=oh((e.clientX-i.left)/i.width*z,(e.clientY-i.top)/i.height*X,G);if(!o)return;m?.(o.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(o);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Yu(a,t)?e.slice(0,-1):[...e,a]})},[G,X,z,m]);g(()=>{const e=S.current;if(!e||z<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(z,X),o=Math.min(t,16384/i);e.width=Math.floor(z*o),e.height=Math.floor(X*o),e.style.width=`${z}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,z,X),j?.length?((e,t,n,i,o,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,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,i,o,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(l-1,0));const m=ih(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(o>=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>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,i+l/2),e.fillStyle=h,e.fillText(t,n+v,i+l/2))}}if(l)for(const t of i){if(Ku(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}})(a,z,X,j,r,y,E,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,X)))},[j,n.numTicks,E,r,X,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,oe=o(()=>((e,t,n)=>{const i=n??Wu(e),o=t?.offset??0,a=o+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of i)e.level<l||e.offset<o||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,B,V),[n,B,V]),ae=null!==oe,le=O.length>0,re=B?Hu(n,B.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{oe&&$(e=>[...e,oe])},[oe]);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(ie,{$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(ie,{$gap:8,children:[e(ie,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:Nl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:El,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:Ha,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(ie,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Un.Filled,options:[{value:th.Fit,label:"W: Fit"},{value:th.X10,label:"10x"}],selected:D,setSelected:P})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Un.Filled,options:[{value:nh.Fit,label:"H: Fit"},{value:nh.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?ol:Ol,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{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:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:X||"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(ie,{$justifyContent:"space-between",children:[t(ee,B?{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=[Ln.Go,Ln.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)?Ln.Go:e.includes(" ")||e.includes("(")?Ln.Java:Ln.Go)(e);if(n===Ln.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),i=t.indexOf(".",n+1);if(-1===i)return null;const o=t.slice(0,i),a=t.slice(i+1);if(!o||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(o,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(o,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Ln.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 i=t.split(/\s+/);t=i[i.length-1]??"";const o=t.lastIndexOf(".");if(-1===o)return null;const a=t.slice(0,o),l=t.slice(o+1),r=new je(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:i=[],namespaces:o=[],languages:a=[]}=e,l=!i.length||i.some(e=>dh(e,t.id)),r=!o.length||o.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,i){const o=ch(e,n);if(!o)return[];const a=[];for(const e of i){const n=e.customInstrumentations;if(!n)continue;if(!ph(e.sourceScopes,t,o.language))continue;const i=!!o.golang&&!!n[We.Golang]?.some(e=>uh(e,o.golang)),l=!!o.java&&!!n[We.Java]?.some(e=>hh(e,o.java));(i||l)&&a.push({rule:e,resolved:o})}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:i,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Ln.Java),h=o(()=>{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=o(()=>{const e=[];if(i.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)&&!i.getSymbolState(n).showCheckbox)&&yh(n,t)}}},[i,u]),g=o(()=>[{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=o(()=>h.map(e=>{const t=i.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?i.isSelected(e.name):void 0,onSelect:n?()=>i.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>i.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,i]),b=d(e=>{const t=e.cells[0].rawValue,n=i.getSymbolState(t),o=[];return n.inManagedRule?o.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Va,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>i.onRemove(t)}):o.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ha,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>i.onAdd(t)}),o.push({id:`copy-${t}`,label:"",leftIcon:$l,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),o},[i]);return t(Vn,{variant:Hn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:i.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)`
|
|
690
690
|
width: 100%;
|
|
691
691
|
flex: 1;
|
|
692
692
|
border-radius: 16px;
|
|
693
693
|
overflow: hidden;
|
|
694
694
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
695
695
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
696
|
-
`,
|
|
696
|
+
`,wh=b.div`
|
|
697
697
|
display: flex;
|
|
698
698
|
align-items: center;
|
|
699
699
|
gap: 10px;
|
|
@@ -701,11 +701,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
701
701
|
padding: 12px 12px 8px;
|
|
702
702
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
703
703
|
border-radius: 16px 16px 0 0;
|
|
704
|
-
`,
|
|
704
|
+
`,Th=b(ie)`
|
|
705
705
|
flex-shrink: 0;
|
|
706
706
|
align-items: center;
|
|
707
707
|
gap: 4px;
|
|
708
|
-
`,
|
|
708
|
+
`,kh=b.div`
|
|
709
709
|
flex: 1;
|
|
710
710
|
display: flex;
|
|
711
711
|
align-items: stretch;
|
|
@@ -713,20 +713,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
713
713
|
padding: 16px;
|
|
714
714
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
715
715
|
border-radius: 0 0 16px 16px;
|
|
716
|
-
`,
|
|
716
|
+
`,Ih=b(ae)`
|
|
717
717
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
718
718
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
719
719
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
720
720
|
gap: 10px;
|
|
721
|
-
`,
|
|
721
|
+
`,Eh=b(ae)`
|
|
722
722
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
723
723
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
724
724
|
gap: 10px;
|
|
725
|
-
`,
|
|
725
|
+
`,Nh=b(ie)`
|
|
726
726
|
width: 100%;
|
|
727
727
|
min-height: 32px;
|
|
728
728
|
flex-shrink: 0;
|
|
729
|
-
`,
|
|
729
|
+
`,Oh=({source:n,onFlameFullscreenChange:i})=>{const s=v(),c=n.id,{profilingApi:u}=Sr(),[h,m]=l(!0),[g,f]=l(Sh.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,$=o(()=>(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=o(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],l=Hu(e,i[n+3]);if(!l)continue;const r=t.get(l);(!r||o>r.total)&&t.set(l,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===Sh.Table||g===Sh.Both,D=g===Sh.Flame||g===Sh.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=o(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),M=o(()=>((e,t)=>{if(!t?.includes(Ln.Java))return;const n=(e?.[gh.Symbol]?.filter(Boolean)??[]).filter(e=>e===bh.FilterOutVoid||e===bh.OnlyWithReturnValues);return 0!==n.length?e=>yh(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:i,capabilities:a}=Sr(),{items:r}=i.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=o(()=>(e=>{const t=new Set(e??[]);return rh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=o(()=>((e,t)=>{const n=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===sh&&ph(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>dh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=o(()=>{const t=new Map;for(const i of n){const n=!!ch(i.name,g),o=mh(i.name,e,g,r),a=!!v&&o.some(e=>e.rule.ruleId===v.ruleId),l=o.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===o.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(i.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=o(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=o(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=o(()=>[...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 i=new Set(n);return t?i.delete(e):i.add(e),i}):c(n=>{const i=new Set(n);return t?i.add(e):i.delete(e),i}))},[C]),E=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const n=t.add.map(e=>ch(e,g)).filter(e=>!!e),o=t.remove.map(e=>ch(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const i=e.customInstrumentations??{};let o=[...i[We.Golang]??[]],a=[...i[We.Java]??[]];for(const e of n)e.golang&&(o=o.filter(t=>!uh(t,e.golang))),e.java&&(a=a.filter(t=>!hh(t,e.java)));for(const e of t)e.golang&&!o.some(t=>uh(t,e.golang))&&o.push(e.golang),e.java&&!a.some(t=>hh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:o,[We.Java]:a},isEmpty:0===o.length&&0===a.length}})(v,n,o);t?await i.remove(v.ruleId,Ye.CustomInstrumentation):await i.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),Ye.CustomInstrumentation)}else n.length>0&&await i.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),i=e.map(e=>e.java).filter(e=>!!e),o={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:sh,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:o,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:n,[We.Java]:i}}})(n,e),Ye.CustomInstrumentation)})()},[v,g,e,i]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(N(h),m(null),E())},[h,N,E]),P=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:o(()=>({getSymbolState:P,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:E,confirmModify:D}}({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===Sh.Flame?Sh.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})},[]),oe=d(()=>W(null),[]);return!O&&E?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(xh,{$gap:0,$width:"100%",children:[e(wh,{children:[t(Be,{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(Th,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ie,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(yn,{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:Un.Filled,options:[{value:Sh.Table,label:"Top table"},{value:Sh.Flame,label:"Flame graph"},{value:Sh.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(Al,{...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(Al,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(kh,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e(Ih,{$splitWithFlame:P,children:[e(Nh,{$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(ie,{$gap:8,children:[e(ie,{children:[t(Rl,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ie,{$gap:8,children:[J&&t(Be,{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:Dl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(Ch,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(Eh,{$splitWithTable:P,children:[e(Nh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${ju($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ie,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:fl,onClick:N}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Nt.S,value:h,onChange:m})]})]}),t(lh,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:i,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:oe})]})]}):t(ft,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Vu,{pendingModify:B,onClose:U,onConfirm:j}),t(jn,{isOpen:X>0,richTitle:{icon:al,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:vn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:vn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:Ka,onClick:V}}]})]})},$h=b.div`
|
|
730
730
|
position: relative;
|
|
731
731
|
display: flex;
|
|
732
732
|
align-items: center;
|
|
@@ -734,23 +734,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
734
734
|
padding: 8px 16px;
|
|
735
735
|
border-radius: 12px;
|
|
736
736
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
737
|
-
`,
|
|
737
|
+
`,Ah=b.div`
|
|
738
738
|
display: flex;
|
|
739
739
|
flex-direction: column;
|
|
740
740
|
gap: 4px;
|
|
741
741
|
flex: 1;
|
|
742
742
|
min-width: 0;
|
|
743
743
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
744
|
-
|
|
744
|
+
`,Rh=b.div`
|
|
745
745
|
flex-shrink: 0;
|
|
746
746
|
display: flex;
|
|
747
747
|
align-items: center;
|
|
748
748
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
749
|
-
`,
|
|
749
|
+
`,Dh=b.div`
|
|
750
750
|
min-width: 0;
|
|
751
751
|
white-space: pre;
|
|
752
752
|
overflow-x: auto;
|
|
753
|
-
`,
|
|
753
|
+
`,Ph=b.div`
|
|
754
754
|
position: absolute;
|
|
755
755
|
top: 50%;
|
|
756
756
|
right: 8px;
|
|
@@ -759,24 +759,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
759
759
|
pointer-events: none;
|
|
760
760
|
transition: opacity 0.15s ease;
|
|
761
761
|
|
|
762
|
-
${
|
|
762
|
+
${$h}:hover & {
|
|
763
763
|
opacity: 1;
|
|
764
764
|
pointer-events: auto;
|
|
765
765
|
}
|
|
766
|
-
`,
|
|
766
|
+
`,_h=({name:n,summary:i,disabled:o=!1,onJumpToRule:a})=>{const l=v();return e($h,{children:[e(Ah,{$disabled:o,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(Dh,{children:t(w,{parts:i})})]}),o&&t(Rh,{$reserveJumpSpace:!!a,children:t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Ph,{children:t(Be,{text:nt.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:Ol,onClick:a})})})]})},Lh=b.div`
|
|
767
767
|
opacity: 0;
|
|
768
768
|
pointer-events: none;
|
|
769
769
|
transition: opacity 0.15s ease;
|
|
770
|
-
`,
|
|
771
|
-
&:hover ${
|
|
770
|
+
`,Fh=b.div`
|
|
771
|
+
&:hover ${Lh} {
|
|
772
772
|
opacity: 1;
|
|
773
773
|
pointer-events: auto;
|
|
774
774
|
}
|
|
775
|
-
`,
|
|
775
|
+
`,Mh=b.div`
|
|
776
776
|
display: flex;
|
|
777
777
|
align-items: center;
|
|
778
778
|
padding: 4px 12px;
|
|
779
|
-
`,
|
|
779
|
+
`,zh=({source:e,onRedirectToSampling:n})=>t(Kt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Uh,{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 Bh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Uh=({container:n,onRedirectToSampling:i})=>{const[a,r]=l(Xh.All),s=Sn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=o(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=o(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=o(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=o(()=>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=o(()=>(e,t)=>{s({ruleId:e,category:t}),i()},[i,s]),f=t(Lh,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Wn,rightIcon:Ha,onClick:e=>{e.stopPropagation(),i()}})});return t(Fh,{children:e(Kt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Kt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(_h,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Mh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Kt,{bgTint:"800",richTitle:{title:nt.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:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Xh.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Xh.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(_h,{name:e.rule.name,summary:Bh(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(Mh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},Vh=[En.Deployment,En.StatefulSet,En.DaemonSet,En.DeploymentConfig,En.Rollout,En.Pod];var Hh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Hh||(Hh={}));const jh=e=>!!e&&un(e.status)===Pe.Error,Gh=e=>jh(e.healthStatus),Wh=e=>jh(e.odigosHealthStatus)||(e.processes??[]).some(Gh),Kh=e=>jh(e.agentInjectedStatus)||jh(e.odigosHealthStatus)||(e.containers??[]).some(Wh),Yh=({onClose:n,sourceId:i,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=Sr(),{selectedStreamName:g}=it(),{genericForm:f,loadSource:b,validateFormData:y}=kr(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(kp.Overview),[$,A]=l(null),[R,D]=l({openFor:null}),P=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:kp.Pods,podName:e.podName})},[]),i=d((e,n)=>{t({tab:kp.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,i)=>{const o=Ap({identifyingAttributes:i.identifyingAttributes});t({tab:kp.Pods,podName:e.podName,containerName:n.containerName,processPid:o})},[]),r=d(()=>t(null),[]);return o(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:i,jumpToProcess:a,clearJumpToTarget:r}),[e,n,i,a,r])})();a(()=>{P.jumpToTarget&&O(P.jumpToTarget.tab)},[P.jumpToTarget]),a(()=>{$&&JSON.stringify(xn(i))!==JSON.stringify(xn($))&&A(null)},[i,$]);const _=p(!1),L=d(async()=>A(await h.fetchById(i)||null),[i,h]);a(()=>{if(_.current||(L(),_.current=!0),!x){const e=setInterval(()=>L(),3e3);return()=>clearInterval(e)}},[L,x]),a(()=>{$&&b($)},[$]);const F=$&&Vh.includes($.id.kind),M=o(()=>{const e=[],n=($?.pods??[]).some(Kh),i=(o=$,(o?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var o;const a=e=>t(Cl,{...e,fill:s.v2.colors.red[500]});return e.push({value:kp.Overview,label:nt.OVERVIEW}),c?(e.push({value:kp.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:kp.Libraries,label:nt.LIBRARIES,icon:i?a:void 0}),e.push({value:kp.PeerSources,label:nt.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:kp.Profiling,label:nt.PROFILING}),e.push({value:kp.Sampling,label:nt.SAMPLING}),e.push({value:kp.Debug,label:nt.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),X=o(()=>()=>{n(),r()},[n,r]),B=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(i,{...t,otelServiceName:n}),w(!1)},[$,f,y,i,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(()=>{D({openFor:Hh.Workload})},[]),W=d(e=>{O(e),P.clearJumpToTarget()},[P]),K=d(async()=>{await h.recoverFromRollback(i)},[h,i]),Y=d(()=>D({openFor:null}),[]),J=d(async()=>{R.openFor===Hh.Workload?await h.restartWorkloads([i]):R.openFor===Hh.Pod&&R.podNamespace&&R.podName&&await h.restartPod(R.podNamespace,R.podName),Y()},[R,h,i,Y]),q=o(()=>{const{kind:e,name:t}=i;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[i]),Z=o(()=>{const e=[];return x||N===kp.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:Ka,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:Il,onClick:G}),e.push(V?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:Ha,color:s.v2.colors.green[500],active:T,onClick:H}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Va,color:s.v2.colors.red[500],active:T,onClick:H})),e},[N,x,T,V,c,F,z,G,H,s]),Q=o(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?yl:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:hl,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(Xt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ee=N===kp.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ne=c?Yn($.containers)[0]:Kn(u);return e(Xp,{value:P,children:[t(Xt,{isOpen:!0,width:ee,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(kp.Overview),A(null),E(!1),n()},actions:Z},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Ft.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 kp.Overview:return x?t(Ws,{}):t(zu,{source:$,onClickRollout:G,onClickRollback:K});case kp.Pods:return t(jp,{source:$,onClickRestartPod:F?(e,t)=>D({openFor:Hh.Pod,podNamespace:e,podName:t}):void 0});case kp.Libraries:return t(Xu,{source:$});case kp.PeerSources:return t(Wp,{source:$});case kp.Profiling:return t(Oh,{source:$,onFlameFullscreenChange:E});case kp.Sampling:return t(zh,{source:$,onRedirectToSampling:X});case kp.Debug:return t(Zp,{source:$});default:return null}})()]})})}),t(mr,{target:"source",action:V?"instrument":"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:j}),t(tt,{isOpen:R.openFor===Hh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:Y},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:J}}),t(mr,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:R.openFor===Hh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},Jh=b.div`
|
|
780
780
|
display: flex;
|
|
781
781
|
align-items: center;
|
|
782
782
|
gap: 8px;
|
|
@@ -786,9 +786,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
786
786
|
&:hover {
|
|
787
787
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
788
788
|
}
|
|
789
|
-
`,
|
|
789
|
+
`,qh=b.div`
|
|
790
790
|
flex: 1;
|
|
791
|
-
`,
|
|
791
|
+
`,Zh=({onClick:n})=>{const i=v().v2.colors.red[500];return e(Jh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:i,children:Qn}),t(Va,{size:16,fill:i})]})};const Qh={[Er.EditAutoNoisy]:{title:hi,subTitle:ui,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Er.EditAutoCostReduction]:{title:pi,subTitle:di,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Er.EditAutoHighlyRelevant]:{title:ci,subTitle:si,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},em=({isOpen:e,title:n,subTitle:i,onClose:o,footer:a,renderBody:l})=>t(Xt,{isOpen:e,width:gi,header:{icon:Pl,title:n,subTitle:i,onClose:o},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Qs,{})})}),tm=({isOpen:i,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Ir(Er.Create),[b,v]=l(!1);a(()=>{i&&(m(),v(!1))},[i]);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=o(()=>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:Jn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(em,{isOpen:i,title:ii[u],subTitle:ei[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:li,description:ai,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:oi,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Wn,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:ri}),t("div",{style:{width:"100%"},children:t(nr,{summary:S})})]})})]})},nm=({onClose:i,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Ir(Er.View),b=c?.rule.name||ni,v=p&&c?ti[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=o(()=>{if(!c)return;const o=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(i){if(i.isEditing){const{onCancelEdit:o,onSave:a,onDelete:l,duplicateWarning:r}=i;return{children:e(n,{children:[t(Zh,{onClick:l}),r&&t(De,{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(qh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Jn,variant:Ie.Secondary,size:ke.S,onClick:o}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:qn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:o,onCancel:a,onEdit:l}=i;return{children:e(n,{children:[t(Zh,{onClick:o}),t(qh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Jn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:Zn,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:o}:{isEditing:!1,onDelete:C,onCancel:i,onEdit:h})},[c,p,g,m,y,C,h,i,s]);return t(em,{isOpen:!!c,title:v,subTitle:c?ei[c.category]:"",onClose:i,footer:S})},im=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=Ir(Er.EditAutoNoisy),l=d(()=>i(o,a),[i,o,a]);return t(lm,{formType:Er.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},om=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=Ir(Er.EditAutoCostReduction),l=d(()=>i(o,a),[i,o,a]);return t(lm,{formType:Er.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},am=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o}=Ir(Er.EditAutoHighlyRelevant),a=d(()=>i(o),[i,o]);return t(lm,{formType:Er.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},lm=({formType:e,isOpen:n,onClose:i,onSave:o})=>{const a=Qh[e];return t(em,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:i,footer:{actions:[{"data-id":a.cancelId,label:Jn,variant:Ie.Secondary,size:ke.S,onClick:i},{"data-id":a.saveId,label:mi,variant:Ie.Primary,size:ke.S,onClick:o}]}})},rm=e=>{switch(e.formType){case Er.Create:return t(Pr,{formType:Er.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(tm,{...e})});case Er.View:return t(Pr,{formType:Er.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(nm,{...e})});case Er.EditAutoNoisy:return t(Pr,{formType:Er.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(im,{...e})});case Er.EditAutoCostReduction:return t(Pr,{formType:Er.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(om,{...e})});case Er.EditAutoHighlyRelevant:return t(Pr,{formType:Er.EditAutoHighlyRelevant,enabled:e.enabled,children:t(am,{...e})})}},sm=({token:i,isLoading:o,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||o||!c.newToken;return fi({key:"Enter",active:!m},s),e(ie,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(ie,{$margin:o?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:o?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:ol,onClick:r,disabled:o}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:il,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:i}),t(yt,{icon:Ka,onClick:l})]})]})},cm=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=rn(),r=o(()=>l(e),[e,l]),s=o(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=o(()=>bi(e,0)?Pe.Error:bi(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=o(()=>c===Pe.Success?il:c===Pe.Warning?_l:Cl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&i()},[c]),t(Be,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},dm=b.div`
|
|
792
792
|
display: flex;
|
|
793
793
|
flex-direction: column;
|
|
794
794
|
gap: 12px;
|
|
@@ -796,7 +796,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
796
796
|
border-radius: 12px;
|
|
797
797
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
798
798
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
799
|
-
`,
|
|
799
|
+
`,pm=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},um=({token:n})=>{const{tokensApi:i}=Sr(),[o,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Zt({newToken:""});return t(ut,{richTitle:{icon:Ll,title:"Odigos Pro Token"},children:e(dm,{$isExpired:c,children:[e(ie,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(pm,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(pm,{children:"Expiration"}),t(cm,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(ie,{children:e(ae,{children:[t(pm,{children:"Token"}),t(sm,{token:n.token,newToken:p.newToken,isLoading:o,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!i.updateToken)return;a(!0);const e=await i.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},hm=b.div`
|
|
800
800
|
display: flex;
|
|
801
801
|
flex-direction: column;
|
|
802
802
|
align-items: center;
|
|
@@ -805,23 +805,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
805
805
|
padding: 12px 24px;
|
|
806
806
|
border-radius: 8px;
|
|
807
807
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
808
|
-
`,um=()=>{const{progress:n}=At(),{describeApi:o,namespacesApi:i}=yr(),{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:Ll,title:"Diagnose"},children:r?e(pm,{children:[t(xt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Pt.DownloadingDiagnose]?.percentage,percentage:n[Pt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Pt.DownloadingDiagnose]?.percentage,visualIcon:Rl,startedAt:r}),n[Pt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Pt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===_e.Success?t(nl,{size:16}):n.status===_e.Error?t(ol,{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(vo,{alignX:Co.Left,alignY:yo.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:_e.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Rl,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},hm=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=yr(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ht,{richTitle:{icon:Tl,title:"General Information"},children:t(Kt,{cellsPerRow:2,items:[{id:So(),title:"Odigos Version",label:n},{id:So(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:So(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:So(),title:"Tier",label:o}]})})},mm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=yr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:Tl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(hm,{}),a.updateToken&&l&&t(dm,{token:l}),i.downloadDiagnose&&t(um,{})]})},gm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=yr(),{requestSubmit:c}=xr(),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 fo({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(Hs,{autoFocus:!0})}),t(Vs,{})]})},fm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=yr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=xr();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 fo({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(Hs,{autoFocus:!0})}),t(Vs,{})]})},bm=({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)"})})]})]}),vm=b.div`
|
|
808
|
+
`,mm=()=>{const{progress:n}=$t(),{describeApi:i,namespacesApi:o}=Sr(),{items:a}=o.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Zt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Fl,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[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:Dl,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,i)=>e(ie,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(il,{size:16}):n.status===Pe.Error?t(ol,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${i}-${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(ie,{$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(ie,{$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(ie,{$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(vi,{alignX:Ci.Left,alignY:yi.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(ie,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Dl,variant:Ie.Primary,onClick:async()=>{i.downloadDiagnose&&(s(Date.now()),await i.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},gm=()=>{const{platformType:e,version:n,tier:i}=S(),{describeApi:o}=Sr(),[r,s]=l(null);return a(()=>{o.fetchDescribeOdigos&&o.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:kl,title:"General Information"},children:t(Kt,{cellsPerRow:2,items:[{id:Si(),title:"Odigos Version",label:n},{id:Si(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Si(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Si(),title:"Tier",label:i}]})})},fm=({isOpen:n,onClose:i})=>{const{describeApi:o,tokensApi:a}=Sr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:kl,title:"System Overview",onClose:i},children:[o.fetchDescribeOdigos&&t(gm,{}),a.updateToken&&l&&t(um,{token:l}),o.downloadDiagnose&&t(mm,{})]})},bm=({isOpen:i,onClose:o,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=Sr(),{requestSubmit:c}=Tr(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),o()},[s,l,r,o]),u=d(()=>c(p),[c,p]);return fi({key:"Enter",active:i},u),e(n,{children:[t(tt,{isOpen:i,onClose:o,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:o},children:t(Gs,{autoFocus:!0})}),t(js,{})]})},vm=({isOpen:i,onClose:o,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Sr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Tr();a(()=>{i&&r&&p(r)},[i,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),o()},[s,r,o]),g=d(()=>u(m),[u,m]);return fi({key:"Enter",active:i},g),e(n,{children:[t(tt,{isOpen:i,onClose:o,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:o},children:t(Gs,{autoFocus:!0})}),t(js,{})]})},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`
|
|
809
809
|
position: absolute;
|
|
810
810
|
top: 50%;
|
|
811
811
|
left: 50%;
|
|
812
812
|
transform: translate(-50%, -50%);
|
|
813
813
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
814
|
-
`,
|
|
814
|
+
`,Sm=()=>{const{drawerType:n,setDrawerType:i}=Sn(),o=n===wi.OnboardingDone,a=()=>i(null);return e(xi,{isOpen:o,onClose:a,children:[t(ym,{}),t(Cm,{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(fr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:ja,onClick:a})]})})]})},xm=b.div`
|
|
815
815
|
display: flex;
|
|
816
816
|
flex-direction: column;
|
|
817
817
|
gap: 8px;
|
|
818
818
|
padding: 4px 8px;
|
|
819
819
|
border-radius: 8px;
|
|
820
820
|
width: 100%;
|
|
821
|
-
`,
|
|
821
|
+
`,wm=b.div`
|
|
822
822
|
white-space: pre;
|
|
823
823
|
overflow-x: auto;
|
|
824
|
-
`,
|
|
824
|
+
`,Tm=({name:n,recommended:i,toggleLabel:o,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(xm,{children:[e(ie,{$gap:8,$justifyContent:"space-between",children:[e(ie,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),i&&t(ce,{label:Ti,leftIcon:Ml,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:o,labelAlign:fe.Left,value:a,onChange:l,size:Nt.S})]}),t(wm,{children:t(w,{parts:r})})]})},km=b.div`
|
|
825
825
|
position: relative;
|
|
826
826
|
display: flex;
|
|
827
827
|
align-items: center;
|
|
@@ -831,18 +831,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
831
831
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
832
832
|
border-top-left-radius: 18px;
|
|
833
833
|
border-top-right-radius: 18px;
|
|
834
|
-
`,
|
|
834
|
+
`,Im=b.div`
|
|
835
835
|
position: absolute;
|
|
836
836
|
left: 16px;
|
|
837
837
|
top: 50%;
|
|
838
838
|
transform: translateY(-50%);
|
|
839
|
-
`,
|
|
839
|
+
`,Em=b.div`
|
|
840
840
|
height: 16px;
|
|
841
841
|
width: 100%;
|
|
842
842
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
843
843
|
border-top-left-radius: 18px;
|
|
844
844
|
border-top-right-radius: 18px;
|
|
845
|
-
`,
|
|
845
|
+
`,Nm=b.div`
|
|
846
846
|
width: ${({$width:e})=>e}px;
|
|
847
847
|
display: flex;
|
|
848
848
|
flex-direction: column;
|
|
@@ -850,7 +850,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
850
850
|
gap: 22px;
|
|
851
851
|
padding: 8px 32px 32px 32px;
|
|
852
852
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
853
|
-
`,
|
|
853
|
+
`,Om=e=>t(zl,{rotate:90,...e}),$m=({children:n,center:i,onNext:o,nextLabel:a=ki,nextLoading:l})=>e(ie,{$gap:8,$justifyContent:i?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,o&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Om,variant:Ie.Primary,size:ke.M,onClick:o,loading:l})]}),Am=e=>t(zl,{rotate:-90,...e}),Rm=({title:n,onBack:i})=>{const o=v();return e(km,{$hasBack:!!i,children:[i&&t(Im,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Am,size:Ct.M,onClick:i})}),t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],align:"center",children:n})]})},Dm=b.div`
|
|
854
854
|
box-sizing: border-box;
|
|
855
855
|
width: ${({$width:e})=>e??"100%"};
|
|
856
856
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -863,16 +863,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
863
863
|
padding: 16px;
|
|
864
864
|
border-radius: 16px;
|
|
865
865
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
866
|
-
`,
|
|
866
|
+
`,Pm=({children:e,fillHeight:n,width:i})=>t(Dm,{$fillHeight:n,$width:i,children:e}),_m=b.ul`
|
|
867
867
|
margin: 0;
|
|
868
868
|
padding: 0;
|
|
869
869
|
list-style: disc;
|
|
870
|
-
`,
|
|
870
|
+
`,Lm=b.li`
|
|
871
871
|
margin-left: 18px;
|
|
872
872
|
& + & {
|
|
873
873
|
margin-top: 6px;
|
|
874
874
|
}
|
|
875
|
-
`,
|
|
875
|
+
`,Fm=({items:e,color:n})=>{const i=v(),o=n||i.v2.colors.silver[200];return t(_m,{children:e.map((e,n)=>t(Lm,{style:{color:o},children:t(ee,{size:te.XXS,color:o,children:e})},n))})},Mm=({items:n})=>{const i=v();return t(ae,{$gap:16,children:n.map((n,o)=>e(ie,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:i.v2.colors.silver[200],weight:400,children:[o+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:i.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:n.description})]})]},o))})},zm=({message:e})=>t(De,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Xm=b.div`
|
|
876
876
|
width: 100%;
|
|
877
877
|
padding: 8px;
|
|
878
878
|
display: flex;
|
|
@@ -880,12 +880,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
880
880
|
gap: 4px;
|
|
881
881
|
border-radius: 16px;
|
|
882
882
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
883
|
-
`,
|
|
883
|
+
`,Bm=b.div`
|
|
884
884
|
display: flex;
|
|
885
885
|
align-items: center;
|
|
886
886
|
gap: 8px;
|
|
887
887
|
padding: 4px 8px 12px 8px;
|
|
888
|
-
`,
|
|
888
|
+
`,Um=b.div`
|
|
889
889
|
width: 100%;
|
|
890
890
|
display: flex;
|
|
891
891
|
flex-direction: column;
|
|
@@ -893,20 +893,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
893
893
|
padding: 8px;
|
|
894
894
|
border-radius: 12px;
|
|
895
895
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
896
|
-
`,
|
|
896
|
+
`,Vm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Hm=b.div`
|
|
897
897
|
white-space: pre-line;
|
|
898
|
-
`,
|
|
898
|
+
`,jm=({enabled:i,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=o(()=>A({enabled:i,keepPercentage:0}),[i]);return e(n,{children:[t(Rm,{title:Ii,onBack:l}),e(Nm,{$width:854,children:[t(Vm,{children:Ei}),e(ae,{$gap:8,$width:"100%",children:[t(Pm,{children:t(Hm,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:Ni})})}),e(ae,{$gap:8,$width:"100%",children:[e(Xm,{children:[t(Bm,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Oi})}),t(Um,{children:t(Tm,{name:Ai,recommended:!0,toggleLabel:$i,enabled:i,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(zm,{message:Ri})]})]})]}),t($m,{onNext:r})]})},Gm=e=>t(zl,{rotate:90,...e}),Wm=({onClose:i})=>{const o=v();return e(n,{children:[t(Em,{}),e(Nm,{$width:732,children:[t(Di,{icon:Pl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],children:Pi}),_i.split("\n").map((e,n)=>t(Vm,{children:e},`subtitle-${n}-${e}`)),e(Pm,{children:[t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:Li}),t(Fm,{color:o.v2.colors.white[500],items:[Fi,Mi,zi]})]})]})]}),t($m,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Xi,rightIcon:Gm,variant:Ie.Primary,size:ke.M,onClick:i})})]})},Km=e=>t(zl,{rotate:90,...e}),Ym=b.div`
|
|
899
899
|
display: flex;
|
|
900
900
|
flex-direction: column;
|
|
901
901
|
align-items: center;
|
|
902
902
|
gap: 8px;
|
|
903
903
|
width: 100%;
|
|
904
|
-
`,
|
|
904
|
+
`,Jm=({onSkip:i,onNext:o})=>{const a=v();return e(n,{children:[t(Em,{}),e(Nm,{$width:732,children:[t(Di,{icon:Pl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Ym,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Bi}),t(Vm,{children:Ui})]}),e(Pm,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:Vi}),t(Mm,{items:[{title:ji,description:Hi},{title:Wi,description:Gi},{title:Yi,description:Ki}]}),t(zm,{message:Ji})]})]})]}),e($m,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:qi,variant:Ie.Secondary,onClick:i}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Zi,rightIcon:Km,variant:Ie.Primary,onClick:o})]})]})},qm=b.div`
|
|
905
905
|
display: flex;
|
|
906
906
|
align-items: stretch;
|
|
907
907
|
gap: 16px;
|
|
908
908
|
width: 100%;
|
|
909
|
-
`,
|
|
909
|
+
`,Zm=b.div`
|
|
910
910
|
flex: 1;
|
|
911
911
|
display: flex;
|
|
912
912
|
flex-direction: column;
|
|
@@ -926,18 +926,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
926
926
|
background-color: ${t.v2.colors.silver[700]};
|
|
927
927
|
}
|
|
928
928
|
`}
|
|
929
|
-
`,
|
|
929
|
+
`,Qm=b.div`
|
|
930
930
|
display: flex;
|
|
931
931
|
align-items: center;
|
|
932
932
|
gap: 8px;
|
|
933
933
|
padding: 12px 16px;
|
|
934
|
-
`,
|
|
934
|
+
`,eg=b.div`
|
|
935
935
|
flex: 1;
|
|
936
936
|
padding: 8px;
|
|
937
937
|
display: flex;
|
|
938
938
|
flex-direction: column;
|
|
939
939
|
gap: 8px;
|
|
940
|
-
`,
|
|
940
|
+
`,tg=b.div`
|
|
941
941
|
flex: 1;
|
|
942
942
|
display: flex;
|
|
943
943
|
flex-direction: column;
|
|
@@ -945,17 +945,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
945
945
|
padding: 12px;
|
|
946
946
|
border-radius: 12px;
|
|
947
947
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
948
|
-
`,
|
|
948
|
+
`,ng=b.div`
|
|
949
949
|
display: flex;
|
|
950
950
|
justify-content: flex-end;
|
|
951
|
-
`,
|
|
951
|
+
`,ig=b.div`
|
|
952
952
|
display: flex;
|
|
953
953
|
align-items: center;
|
|
954
954
|
gap: 8px;
|
|
955
955
|
padding: 4px 12px 4px 4px;
|
|
956
956
|
border-radius: 8px;
|
|
957
957
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
958
|
-
`,
|
|
958
|
+
`,og=b.div`
|
|
959
959
|
display: flex;
|
|
960
960
|
align-items: center;
|
|
961
961
|
justify-content: center;
|
|
@@ -963,13 +963,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
963
963
|
height: 24px;
|
|
964
964
|
border-radius: 6px;
|
|
965
965
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
966
|
-
`,
|
|
966
|
+
`,ag=({selected:n,onSelect:i,name:o,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(Zm,{$selected:n,onClick:i,children:[e(Qm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${o}`,value:n,onChange:i,size:we.L}),t(Pl,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:o})]}),e(eg,{children:[e(tg,{$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(Fm,{color:p,items:r}),s&&e(ig,{children:[t(og,{children:t(_l,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(ng,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${o}`,label:fo,rightIcon:Ga,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},lg=({strategy:i,onStrategyChange:o,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Rm,{title:Qi,onBack:a}),e(Nm,{$width:854,children:[t(Vm,{children:eo}),e(qm,{children:[t(ag,{selected:"keep-list"===i,onSelect:()=>o("keep-list"),name:lo,description:ao,badgeProps:{label:oo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[no,io],warning:to,onReadMore:c}),t(ag,{selected:"drop-list"===i,onSelect:()=>o("drop-list"),name:uo,description:po,badgeProps:{label:co,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ro,so],onReadMore:c}),t(ag,{selected:"advanced"===i,onSelect:()=>o("advanced"),name:go,description:mo,badgeProps:{label:ho,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t($m,{onNext:l})]})},rg=({onBack:i,onNext:a,submitting:l})=>{const r=v(),s=o(()=>[{title:Co,bullets:[bo,vo,yo]},{title:Io,bullets:[So,xo,wo,To,ko]}],[]);return e(n,{children:[t(Rm,{title:Eo,onBack:i}),e(Nm,{$width:854,children:[t(Vm,{children:No}),t(ie,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,i)=>e(Pm,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Fm,{items:n.bullets})]},i))}),t(zm,{message:Oo})]}),t($m,{onNext:a,nextLoading:l})]})},sg=b.div`
|
|
967
967
|
white-space: pre-line;
|
|
968
|
-
`,
|
|
968
|
+
`,cg=({errorPresetEnabled:i,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Rm,{title:$o,onBack:l}),e(Nm,{$width:854,children:[t(Vm,{children:Ao}),e(ae,{$gap:8,$width:"100%",children:[e(Pm,{children:[t(sg,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ro})}),t(zm,{message:Oo})]}),e(Xm,{children:[e(Bm,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Do}),t(Sl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Um,{children:t(Tm,{name:_o,recommended:!0,toggleLabel:Po,enabled:i,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t($m,{onNext:r,nextLoading:s})]})},dg=b.div`
|
|
969
969
|
white-space: pre-line;
|
|
970
|
-
`,
|
|
970
|
+
`,pg=b.div`
|
|
971
971
|
width: fit-content;
|
|
972
|
-
`,
|
|
972
|
+
`,ug=["50","25","10","1","0.1"],hg=({value:n,onChange:i,label:a})=>{const l=v(),r=o(()=>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:i})})]})},mg=({errorPresetEnabled:i,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Rm,{title:Lo,onBack:s}),e(Nm,{$width:854,children:[t(Vm,{children:Fo}),e(ae,{$gap:8,$width:"100%",children:[e(Pm,{children:[t(dg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Mo})}),t(Fm,{items:[zo,Xo,Bo,Uo,Vo]}),t(zm,{message:Oo})]}),e(Xm,{children:[e(Bm,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:Ho}),t(Sl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Um,{children:t(Tm,{name:_o,recommended:!0,toggleLabel:Po,enabled:i,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Um,{children:t(hg,{value:l,onChange:r,label:jo})})]})]})]}),t($m,{onNext:c,nextLoading:d})]})},gg=({isOpen:e,onClose:n,k8sHealthProbesConfig:i,samplingId:o,docsUrl:r})=>{const{samplingApi:s}=Sr(),[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(i?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,i?.enabled]);const x=d(async()=>{const e=o??"default",t=[];if(u!==(i?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:i?.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)}},[o,s,u,i?.enabled,i?.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(xi,{isOpen:e,onClose:n,children:w})};var fg,bg;(e=>{e.BulkConfig="bulk-config",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={[Go.K8s]:fn.Purple,[Go.Vm]:fn.Blue,[Go.Connector]:fn.Green,[Go.AwsEcs]:fn.Yellow},Tg=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const m=v(),{formatTimeAgo:g}=rn(),[f,b]=l(!n?.length),[y,C]=l(n||[]),S=d(async()=>{try{b(!0),C(await i()??[])}catch(e){}finally{b(!1)}},[]);a(()=>{y.length||S()},[]);const[x,w]=l(""),[T,k]=l(null),[I,E]=l([]),[N,O]=l(!1),[$,A]=l(!1),R=d(()=>{O(!1),A(!0),S()},[S]),_=d(e=>{e===bg.CloudConnector?O(!0):c?.(e)},[c]),{supportedConnections:L,supportedConnectionIds:F}=o(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,i=D(e.odigosVersion,t,e.type);return n&&i}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),M=o(()=>I.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,I]);a(()=>{if(!T||T===fg.Delete)return;const e=I.filter(e=>!F.includes(e));e.length&&E(t=>t.filter(t=>!e.includes(t)))},[T,I.length,F.length]);const z=o(()=>y.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>({cells:[{key:yg.Id,rawValue:e.id},{key:yg.Name,rawValue:e.name},{key:yg.Type,rawValue:e.type,component:()=>t(an,{variant:wg[e.type]??fn.Default,label:Wo(e.type),leftIcon:Kn(e.type)})},{key:yg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Go.Connector){const n=xg[e.status]??"Pending",i=e.status===Pe.Success?il:e.status===Pe.Error?ol:void 0;return t(ce,{status:e.status,label:n,leftIcon:i})}const n=e.status===Pe.Success?"Connection live":"Connection lost",i=e.status===Pe.Success?il:ol;return t(ce,{status:e.status,label:n,leftIcon:i})})(e)},{key:yg.OdigosVersion,rawValue:e.odigosVersion},{key:yg.ConnectedSince,rawValue:e.connectedAt?g(e.connectedAt):"-"},{key:yg.LastActivity,rawValue:e.lastSeenAt?g(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||T?void 0:()=>r(e),isSelected:I.includes(e.id),onSelect:()=>E(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>E(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==Go.K8s||e.status!==Pe.Success||!D(e.odigosVersion,h,e.type)})),[y,I,x,T,h,g,r]),X=o(()=>z.some(e=>!e.hideCheckbox),[z]),B=o(()=>{const e=(e,t)=>{E([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,onDelete:i,onEditConfiguration:o}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===yg.Status)?.rawValue===Pe.Success)(e))return[{id:Si(),label:"Delete Connection",rightIcon:Wa,onClick:()=>Sg(e,i)}];const a=Sg(e,e=>t.find(t=>t.id===e));if(a?.type!==Go.K8s)return[];const l=!!a&&D(a.odigosVersion,n,a.type),r=P(n,a?.type),s=[];return o&&s.push({id:Si(),tooltip:l?"Edit Configuration":`To use this feature, please upgrade to Odigos v${r} or later.`,rightIcon:bl,disabled:!l,onClick:()=>Sg(e,o)}),s}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,fg.Delete),onEditConfiguration:t=>e(t,fg.BulkConfig)})},[y,h]),U=o(()=>(e=>{const{onCancel:t,onManageConfigurations:n}=e,i=[];return n&&i.push({id:fg.BulkConfig,type:vn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:bl,label:"Manage Configurations",onClick:n}}),i.push({id:Si(),type:vn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),i})({onCancel:()=>E([]),onManageConfigurations:()=>k(fg.BulkConfig)}),[]),V=o(()=>t(vi,{items:vg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>_(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[_]),H=o(()=>x.trim()&&y.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(x)}:{icon:Xl,title:nt.NO_CONNECTIONS,action:V},[x,y.length,V]);return t(Ko,{children:e(ut,{fullHeight:!0,richTitle:{icon:Xl,title:nt.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:x,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:vn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:fl,onClick:S,disabled:f}},{id:"connections-create-new",type:vn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>_(e)},dropDataProps:{alignX:Ci.Right,items:vg}}],children:[t(Vn,{variant:Hn.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:f,withCheckboxes:X,columns:Cg,rows:z,noDataProps:H,rowActionsPushRightPosition:T?`calc(${ur} - 24px)`:void 0,getRowActions:B}),N&&t(_r,{providers:p,children:t(fp,{onClose:()=>O(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:R})}),t(br,{isOpen:$,onClose:()=>A(!1)}),t(jn,{isOpen:!!I.length&&!T,richTitle:{icon:Za,title:"Selected Clusters",badge:{label:I.length}},actions:U}),T===fg.BulkConfig&&t(Lr,{connections:M,children:t(Cp,{onClose:()=>k(null),connections:L,selectedConnectionIds:I,setSelectedConnectionIds:E})}),t(mr,{target:"connection",isOpen:T===fg.Delete,onClose:()=>{E([]),k(null)},onApprove:async()=>{const e=I[0];e&&(await s(e),await S())}})]})})},kg=b.div`
|
|
973
973
|
display: flex;
|
|
974
974
|
align-items: center;
|
|
975
975
|
justify-content: space-between;
|
|
@@ -978,26 +978,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
978
978
|
width: 100%;
|
|
979
979
|
border-radius: 16px;
|
|
980
980
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
981
|
-
`,
|
|
981
|
+
`,Ig=b.div`
|
|
982
982
|
display: flex;
|
|
983
983
|
align-items: center;
|
|
984
984
|
justify-content: center;
|
|
985
985
|
padding: 8px;
|
|
986
986
|
border-radius: 8px;
|
|
987
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
988
|
-
`,
|
|
987
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+oe["004"]};
|
|
988
|
+
`,Eg=({setStep:n,onSave:i,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=o(()=>Object.values(a||{}).flatMap((n,i)=>n.map((n,o)=>{if(!n.selected)return null;const a=n.kind||Et.Namespace,l=a===Et.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(kg,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${i}-${o}`)})).filter(Boolean),[a]),u=o(()=>l?.map((n,i)=>{const o=wt(n.option.type).icon;return e(kg,{children:[e(ie,{$gap:8,children:[o&&t(Ig,{children:t(o,{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?il:ol})]},`destination-${i}`)})||[],[l]);return t(pr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:i,header:{icon:hl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ll,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:Ka,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t($e,{icon:ll,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:Ha,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(el,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:Ka,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:el,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:Ha,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ng=b.div`
|
|
989
989
|
position: relative;
|
|
990
990
|
overflow: hidden;
|
|
991
991
|
width: 100vw;
|
|
992
992
|
height: 100vh;
|
|
993
993
|
box-sizing: border-box;
|
|
994
|
-
`,
|
|
994
|
+
`,Og=b.svg`
|
|
995
995
|
position: absolute;
|
|
996
996
|
top: 50%;
|
|
997
997
|
left: 50%;
|
|
998
998
|
transform: translate(-50%, -50%);
|
|
999
999
|
z-index: -1;
|
|
1000
|
-
|
|
1000
|
+
`,$g=[{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"}],Ag=[{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:$g},{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:$g},{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:$g}],Rg=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=o(()=>s/Ag[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ng,{$paddingXAxis:n,$paddingYAxis:i,children:[Ag.map(({width:n,height:i,pathOpacity:o,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Og,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${i}`,fill:"none",children:[t("path",{opacity:o,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},i)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},i))})})]},c)}),r]})},Dg=b.div`
|
|
1001
1001
|
display: flex;
|
|
1002
1002
|
flex-direction: column;
|
|
1003
1003
|
align-items: center;
|
|
@@ -1008,7 +1008,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1008
1008
|
width: 50vw;
|
|
1009
1009
|
border-radius: 16px;
|
|
1010
1010
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1011
|
-
`,
|
|
1011
|
+
`,Pg=b.div`
|
|
1012
1012
|
display: flex;
|
|
1013
1013
|
flex-direction: column;
|
|
1014
1014
|
align-items: center;
|
|
@@ -1018,15 +1018,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1018
1018
|
& * {
|
|
1019
1019
|
text-align: center;
|
|
1020
1020
|
}
|
|
1021
|
-
`,
|
|
1021
|
+
`,_g=({onStart:n})=>t(Xt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Dg,{children:[e(Pg,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(fr,{size:260}),t(ee,{size:te.S,weight:400,children:nt.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:ja,size:ke.L,onClick:n})]})})}),Lg=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Fg=b.div`
|
|
1022
1022
|
display: flex;
|
|
1023
1023
|
flex-direction: column;
|
|
1024
1024
|
gap: 32px;
|
|
1025
1025
|
padding: 64px;
|
|
1026
|
-
`,
|
|
1026
|
+
`,Mg=({pagePaddingXAxis:n,pagePaddingYAxis:i,onDone:o})=>{const{setDrawerType:a}=Sn(),{sourcesApi:r,destinationsApi:s}=Sr(),[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:i,children:[e(Fg,{children:[t(fr,{useInline:!0}),t(Yo,{currentStep:c,data:Lg,gap:32})]}),t(Fr,{initialInputs:h,children:e(Mr,{children:[1===c&&t(_g,{onStart:b}),2===c&&t($c,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(hc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Eg,{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(wi.OnboardingDone),o()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},zg=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()),Bg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Ug=b.div`
|
|
1027
1027
|
position: relative;
|
|
1028
1028
|
display: inline-flex;
|
|
1029
|
-
`,
|
|
1029
|
+
`,Vg=b.button`
|
|
1030
1030
|
display: inline-flex;
|
|
1031
1031
|
align-items: center;
|
|
1032
1032
|
gap: 8px;
|
|
@@ -1039,7 +1039,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1039
1039
|
&:hover {
|
|
1040
1040
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1041
1041
|
}
|
|
1042
|
-
`,
|
|
1042
|
+
`,Hg=b.div`
|
|
1043
1043
|
position: absolute;
|
|
1044
1044
|
top: calc(100% + 8px);
|
|
1045
1045
|
right: 0;
|
|
@@ -1052,25 +1052,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1052
1052
|
border-radius: 12px;
|
|
1053
1053
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1054
1054
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1055
|
-
`,
|
|
1055
|
+
`,jg=b.div`
|
|
1056
1056
|
display: flex;
|
|
1057
1057
|
flex-direction: column;
|
|
1058
1058
|
gap: 12px;
|
|
1059
1059
|
padding: 16px;
|
|
1060
1060
|
max-height: 60vh;
|
|
1061
1061
|
overflow-y: auto;
|
|
1062
|
-
`,
|
|
1062
|
+
`,Gg=b.div`
|
|
1063
1063
|
display: flex;
|
|
1064
1064
|
align-items: center;
|
|
1065
1065
|
gap: 8px;
|
|
1066
1066
|
padding: 12px 16px;
|
|
1067
1067
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1068
|
-
`,
|
|
1068
|
+
`,Wg=b.div`
|
|
1069
1069
|
display: flex;
|
|
1070
1070
|
align-items: center;
|
|
1071
1071
|
gap: 8px;
|
|
1072
1072
|
margin-left: auto;
|
|
1073
|
-
`,
|
|
1073
|
+
`,Kg=()=>{const n=v(),{platformType:i,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Sr(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=ta(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N,setAll:O,clearFilters:$,getEmptyState:A}=Jo(),R=o(()=>qo(u,m),[u,m]);a(()=>{const e=g(Zo.OVERVIEW_FILTERS,A());O(e)},[]);const[D,P]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N}),[_,L]=l(Bg(D)),[F,M]=l(!1),z=p(i);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N};P(e),L(Bg(e))}},[F,y,C,x,w,T,k,I,E,N]),a(()=>{z.current!==i&&(z.current=i,b(Zo.OVERVIEW_FILTERS),$(),P(A()),L(0),M(!1))},[i]);const X=p(null);An(X,()=>M(!1)),fi({key:"Escape",active:F},()=>M(!1));const B=o(()=>{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=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:i}=n;e.has(i)||(e.add(i),t.push({id:i,label:Nn(i),withCheckbox:!0}))}),t},[R]),V=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const i=n.region?.trim();i&&!e.has(i)&&(e.add(i),t.push({id:i,label:i,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=o(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Qo[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=o(()=>ea.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=o(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const i=n?.state||n?.progressStage;i&&!e.has(i)&&(e.add(i),t.push({id:i,label:Xg(i),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=o(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:i,message:o}=n||{};if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:Ut(i),withCheckbox:!0})}else if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:o,withCheckbox:!0})}}),t},[R]),K=o(()=>[{id:"enabled",label:nt.ENABLED,withCheckbox:!0},{id:"disabled",label:nt.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const i=t.filter(e=>n.includes(e.id));P(t=>{return{...t,[e]:(n=i,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?tl:nl,q=o(()=>zg(D.languages),[D.languages]);return e(Ug,{ref:X,children:[e(Vg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Bl,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(ce,{label:_,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Hg,{children:[e(jg,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:zg(D.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:zg(D.regions),setValues:e=>Y("regions",V,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:zg(D.kinds),setValues:e=>Y("kinds",U,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:zg(D.monitors),setValues:e=>Y("monitors",j,e)}),t(vt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:zg(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:zg(D.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:zg(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Nt.L,value:!!D.onlyErrors,onChange:e=>P(t=>({...t,onlyErrors:e}))})]}),e(Gg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(Zo.OVERVIEW_FILTERS),$(),P(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(Wg,{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(Zo.OVERVIEW_FILTERS,D),O(D),L(Bg(D)),M(!1)}})]})]})]})]})},Yg=b.div`
|
|
1074
1074
|
position: relative;
|
|
1075
1075
|
display: flex;
|
|
1076
1076
|
align-items: center;
|
|
@@ -1081,7 +1081,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1081
1081
|
box-sizing: border-box;
|
|
1082
1082
|
border-radius: 16px 16px 0 0;
|
|
1083
1083
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1084
|
-
`,
|
|
1084
|
+
`,Jg=b.div`
|
|
1085
1085
|
position: absolute;
|
|
1086
1086
|
bottom: 0;
|
|
1087
1087
|
left: 0;
|
|
@@ -1090,7 +1090,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1090
1090
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1091
1091
|
border-radius: 32px;
|
|
1092
1092
|
transition: width 0.3s;
|
|
1093
|
-
`,
|
|
1093
|
+
`,qg=({entityType:n,badge:i,badgeTooltip:o,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Sn();return e(Yg,{children:[e(ie,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:na.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:i,tooltip:o,status:Pe.Unknown,textSize:te.XXXS})]}),e(ie,{children:[t(yt,{"data-id":`add-${n}`,icon:Ha,onClick:()=>p(ia(n))}),t(yt,{"data-id":`refresh-${n}`,icon:fl,onClick:l,disabled:a})]}),"number"==typeof d&&t(Jg,{$percent:d})]})},Zg=b(ae)`
|
|
1094
1094
|
align-items: center !important;
|
|
1095
1095
|
justify-content: center !important;
|
|
1096
1096
|
align-self: stretch;
|
|
@@ -1105,7 +1105,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1105
1105
|
&:hover {
|
|
1106
1106
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1107
1107
|
}
|
|
1108
|
-
`,
|
|
1108
|
+
`,Qg=({entityType:n,description:i})=>{const{setDrawerType:o}=Sn();return e(Zg,{onClick:()=>o(ia(n)),children:[e(ie,{$gap:4,children:[t(Ha,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:i})]})},ef=b.div`
|
|
1109
1109
|
display: flex;
|
|
1110
1110
|
align-items: center;
|
|
1111
1111
|
gap: 12px;
|
|
@@ -1120,10 +1120,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1120
1120
|
&:hover {
|
|
1121
1121
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1122
1122
|
}
|
|
1123
|
-
`,
|
|
1123
|
+
`,tf=b(ie)`
|
|
1124
1124
|
flex: 1;
|
|
1125
1125
|
min-width: 0;
|
|
1126
|
-
`,
|
|
1126
|
+
`,nf=({entityId:n,entityType:i,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=i===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=Sn(),{selectedSources:x,setSelectedSources:w}=oa(),T=m,k=f?T.id.namespace:"",I=o(()=>{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?Mn(Pe.Info,g):l?Mn(l,g):void 0,N=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(ef,{"data-id":N,$faded:y,onClick:()=>{C(In(i)),S(n)},children:[f&&t(Q,{size:na.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(kn,{icons:p,icon:d,iconSrc:u}),e(tf,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(ie,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Be,{text:s||(b&&!h?nt.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||nt.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function of(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:pn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function af(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 lf=b.div`
|
|
1127
1127
|
position: absolute;
|
|
1128
1128
|
top: 0;
|
|
1129
1129
|
left: 0;
|
|
@@ -1134,21 +1134,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1134
1134
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1135
1135
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1136
1136
|
pointer-events: none;
|
|
1137
|
-
`,
|
|
1137
|
+
`,rf=b.div`
|
|
1138
1138
|
display: flex;
|
|
1139
1139
|
align-items: center;
|
|
1140
1140
|
gap: 8px;
|
|
1141
1141
|
padding: 4px 8px 0;
|
|
1142
|
-
`,
|
|
1142
|
+
`,sf=b.div`
|
|
1143
1143
|
flex: 1;
|
|
1144
1144
|
height: 1px;
|
|
1145
1145
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1146
|
-
`,
|
|
1146
|
+
`,cf=({namespace:e})=>{const n=v();return t(lf,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},df=({namespace:n})=>{const i=v();return e(rf,{children:[t(sf,{}),t(ee,{size:te.XXS,nowrap:!0,color:i.v2.colors.grey[300],children:n}),t(sf,{})]})},pf={[Et.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:nt.NO_DATA_SOURCES,[Et.Action]:nt.NO_DATA_ACTIONS,[Et.Destination]:nt.NO_DATA_DESTINATIONS},uf=b.div`
|
|
1147
1147
|
display: flex;
|
|
1148
1148
|
flex-direction: column;
|
|
1149
1149
|
flex: 1 0 0;
|
|
1150
1150
|
min-width: 0;
|
|
1151
|
-
`,
|
|
1151
|
+
`,hf=b.div`
|
|
1152
1152
|
display: flex;
|
|
1153
1153
|
flex-direction: column;
|
|
1154
1154
|
align-items: stretch;
|
|
@@ -1158,7 +1158,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1158
1158
|
border-radius: 0 0 16px 16px;
|
|
1159
1159
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1160
1160
|
overflow: hidden;
|
|
1161
|
-
`,
|
|
1161
|
+
`,mf=b.div`
|
|
1162
1162
|
position: relative;
|
|
1163
1163
|
display: flex;
|
|
1164
1164
|
flex-direction: column;
|
|
@@ -1170,7 +1170,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1170
1170
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1171
1171
|
height: ${({$height:e})=>e}px;
|
|
1172
1172
|
overflow: hidden;
|
|
1173
|
-
`,
|
|
1173
|
+
`,gf=({entityType:n,entities:i,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Et.Source,m=i.length!==r,g=$t(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=$t(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=oa(),C=o(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=o(()=>{if(!s)return;const e=new Map,t=n===Et.Source?s.sources:n===Et.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(aa(n),n.throughput);return e},[s,n]),x=o(()=>i.map(e=>((e,t,n)=>{const i=Gt(e);if(!i)return null;const o=t===Et.Source;let a,l,r=!1,s=e;if(o){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case pn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case pn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case pn.Pending:case pn.Waiting:return{status:void 0,faded:!1,displaySource:of(e)};case pn.Unsupported:case pn.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:af(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Et.Action?la(e):e.conditions,{priorotizedStatus:i,hasDisableds:o}=ra(n);a=i,r=o}const c=sa(e,t,{extended:o,prioritizeDisplayName:!o});let d,p,u,h,m;switch(t){case Et.Source:{d=Tn(e),p=da(Et.Source);const t=n?.get(ca(i));h=On(t);const o=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof o&&(m=o);break}case Et.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const o=n?.get(ca(i));h=On(o),m=!e.disabled;break}case Et.Action:p=qt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:p=ln(e.type),m=!e.disabled}return{key:ca(i),entityId:i,namespace:o?e.id.namespace:void 0,raw:s,itemProps:{entityId:i,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),[i,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:E,dividerCount:N}=o(()=>{const e=[],n=[],i=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let o=0,a="";for(const i of x)h&&i.namespace&&i.namespace!==a&&(""!==a&&(n.push(i.namespace),e.push(t(df,{namespace:i.namespace},`ns-divider-${i.namespace}`)),o+=1),a=i.namespace),n.push(i.namespace||""),e.push(t(nf,{...i.itemProps},i.key));return{elements:e,indexToNamespace:n,multipleNs:i,dividerCount:o}},[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),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${r}`:r;return e(uf,{children:[t(qg,{entityType:n,badge:D,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:C>0&&i?.length!==C,allSelected:C>0&&i?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};i?.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(hf,{children:i.length?e(mf,{$height:R,children:[E&&w&&t(cf,{namespace:w}),t(Cn,{gap:4,elements:k,onTopIndexChange:E?O:void 0})]}):c?t(re,{size:3}):t(Qg,{entityType:n,description:pf[n]??nt.TO_COLLECT_OTEL_DATA})})]})},ff=b.div`
|
|
1174
1174
|
width: 100%;
|
|
1175
1175
|
flex: 1;
|
|
1176
1176
|
min-height: 0;
|
|
@@ -1178,10 +1178,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1178
1178
|
display: flex;
|
|
1179
1179
|
align-items: stretch;
|
|
1180
1180
|
gap: 16px;
|
|
1181
|
-
`,
|
|
1181
|
+
`,bf={sources:[],destinations:[]},vf=()=>{const n=Jo(),{selectedStreamName:i}=it(),{containerRef:a,containerHeight:l}=pa(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Sr(),{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=Sn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??bf,w=o(()=>qo(u,i),[u,i]),T=o(()=>tn(m,i),[m,i]),k=o(()=>ua(w,n),[w,n]),I=o(()=>ha(T,n),[T,n]),E=o(()=>ma(f,n),[f,n]);return e(ff,{ref:a,children:[t(gf,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(gf,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(gf,{entityType:Et.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(gf,{entityType:Et.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},yf="40vw",Cf=b.div`
|
|
1182
1182
|
position: relative;
|
|
1183
|
-
width: ${
|
|
1184
|
-
`,
|
|
1183
|
+
width: ${yf};
|
|
1184
|
+
`,Sf=b.div`
|
|
1185
1185
|
position: absolute;
|
|
1186
1186
|
top: calc(100% + 8px);
|
|
1187
1187
|
left: 0;
|
|
@@ -1190,23 +1190,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1190
1190
|
flex-direction: column;
|
|
1191
1191
|
gap: 8px;
|
|
1192
1192
|
padding: 8px;
|
|
1193
|
-
width: calc(${
|
|
1193
|
+
width: calc(${yf} - 16px);
|
|
1194
1194
|
border-radius: 12px;
|
|
1195
1195
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1196
1196
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1197
|
-
`,
|
|
1197
|
+
`,xf=b.div`
|
|
1198
1198
|
display: flex;
|
|
1199
1199
|
align-items: center;
|
|
1200
1200
|
overflow-x: auto;
|
|
1201
|
-
`,
|
|
1201
|
+
`,wf=b.div`
|
|
1202
1202
|
display: flex;
|
|
1203
1203
|
flex-direction: column;
|
|
1204
1204
|
gap: 0;
|
|
1205
1205
|
max-height: 60vh;
|
|
1206
1206
|
overflow-y: auto;
|
|
1207
|
-
`,
|
|
1207
|
+
`,Tf=b.div`
|
|
1208
1208
|
padding: 8px 12px 4px 12px;
|
|
1209
|
-
`,
|
|
1209
|
+
`,kf=b.div`
|
|
1210
1210
|
display: flex;
|
|
1211
1211
|
align-items: center;
|
|
1212
1212
|
gap: 8px;
|
|
@@ -1216,12 +1216,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1216
1216
|
&:hover {
|
|
1217
1217
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1218
1218
|
}
|
|
1219
|
-
`,
|
|
1219
|
+
`,If=b.div`
|
|
1220
1220
|
padding: 16px 8px;
|
|
1221
|
-
`,
|
|
1221
|
+
`,Ef=({preventPopup:n=!1})=>{const i=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Jo(),{setDrawerType:d,setDrawerEntityId:u}=Sn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Sr(),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")};An(x,()=>N()),fi({key:"Escape",active:E},N);const{categories:O,searchResults:$}=o(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:o,selectedCategory:a})=>{const l=o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e,r=o?t.filter(e=>e.id.name?.toLowerCase().includes(o)||e.serviceName?.toLowerCase().includes(o)||e.id.namespace?.toLowerCase().includes(o)):t,s=o?n.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,c=o?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,d=[{category:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.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===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:qo(b,a),actions:C,destinations:tn(y,a),searchText:s,selectedCategory:k}),[S,b,C,y,a,s,k]),A=o(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),R=$.some(({entities:e})=>e.length>0);return e(Cf,{ref:x,children:[t(yn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:yf}),E&&e(Sf,{children:[A.length>1&&t(xf,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(wf,{children:$.map(({category:n,label:o,entities:a},l)=>{if(!a.length)return null;const s=da(n);return e(r,{children:[t(Tf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:o})}),a.map((o,a)=>e(kf,{onClick:()=>{const e=Gt(o);e&&(d(In(n)),u(e),N())},children:[s&&t(s,{size:16,fill:i.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:sa(o,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(If,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Nf=({onRedirectToSampling:i})=>{const{sourcesApi:a}=Sr(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Sn(),p=()=>{c(null),d(null)},u=o(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=o(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(Sm,{}),r===wi.AddSource&&t(Fr,{children:t($c,{onClose:p,withOverlay:!0})}),r===wi.AddDestination&&t(Mr,{children:t(hc,{onClose:p,withOverlay:!0})}),r===wi.AddInstrumentationRule&&t(zr,{sourceOptions:u,namespaceOptions:h,children:t(mc,{onClose:p,withOverlay:!0})}),r===wi.AddAction&&t(Xr,{sourceOptions:u,namespaceOptions:h,children:t(ic,{onClose:p,withOverlay:!0})}),r===wi.EditSource&&t(Br,{children:t(Yh,{onClose:p,sourceId:s,onRedirectToSampling:i})}),r===wi.EditDestination&&t(Mr,{children:t(xp,{onClose:p,destinationId:s})}),r===wi.EditInstrumentationRule&&t(zr,{sourceOptions:u,namespaceOptions:h,children:t(Tp,{onClose:p,ruleId:s})}),r===wi.EditAction&&t(Xr,{sourceOptions:u,namespaceOptions:h,children:t(yp,{onClose:p,actionId:s})})]})},Of=b.div`
|
|
1222
1222
|
position: relative;
|
|
1223
1223
|
display: inline-flex;
|
|
1224
|
-
|
|
1224
|
+
`,$f=b.div`
|
|
1225
1225
|
display: inline-flex;
|
|
1226
1226
|
align-items: center;
|
|
1227
1227
|
gap: 6px;
|
|
@@ -1232,7 +1232,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1232
1232
|
&:hover {
|
|
1233
1233
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1234
1234
|
}
|
|
1235
|
-
`,
|
|
1235
|
+
`,Af=b.div`
|
|
1236
1236
|
position: absolute;
|
|
1237
1237
|
top: calc(100% + 8px);
|
|
1238
1238
|
left: 0;
|
|
@@ -1246,18 +1246,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1246
1246
|
border-radius: 12px;
|
|
1247
1247
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1248
1248
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1249
|
-
|
|
1249
|
+
`,Rf=b.div`
|
|
1250
1250
|
display: flex;
|
|
1251
1251
|
align-items: center;
|
|
1252
1252
|
gap: 8px;
|
|
1253
1253
|
width: 100%;
|
|
1254
|
-
`,
|
|
1254
|
+
`,Df=b.div`
|
|
1255
1255
|
display: flex;
|
|
1256
1256
|
flex-direction: column;
|
|
1257
1257
|
gap: 0;
|
|
1258
1258
|
max-height: 240px;
|
|
1259
1259
|
overflow-y: auto;
|
|
1260
|
-
`,
|
|
1260
|
+
`,Pf=b.div`
|
|
1261
1261
|
display: flex;
|
|
1262
1262
|
align-items: center;
|
|
1263
1263
|
gap: 8px;
|
|
@@ -1268,41 +1268,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1268
1268
|
&:hover {
|
|
1269
1269
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1270
1270
|
}
|
|
1271
|
-
`,
|
|
1271
|
+
`,_f=b.div`
|
|
1272
1272
|
flex: 1;
|
|
1273
1273
|
min-width: 0;
|
|
1274
1274
|
overflow: hidden;
|
|
1275
1275
|
text-overflow: ellipsis;
|
|
1276
1276
|
white-space: nowrap;
|
|
1277
|
-
`,
|
|
1277
|
+
`,Lf=b.div`
|
|
1278
1278
|
display: flex;
|
|
1279
1279
|
align-items: center;
|
|
1280
1280
|
gap: 2px;
|
|
1281
1281
|
flex-shrink: 0;
|
|
1282
|
-
`,
|
|
1282
|
+
`,Ff=b.div`
|
|
1283
1283
|
display: flex;
|
|
1284
1284
|
padding-top: 4px;
|
|
1285
1285
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1286
|
-
`,
|
|
1286
|
+
`,Mf=()=>{const i=v(),{isK8s:r}=S(),{clearStore:s}=ga(),{dataStreamsApi:c}=Sr();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,R]=l(!1);An(m,()=>f(!1)),a(()=>{g||y("")},[g]);const D=o(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),P=g?tl:nl;return r?e(n,{children:[e(Of,{ref:m,children:[e($f,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Ul,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(_=u,`Data Stream: ${_}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(P,{size:20,fill:i.v2.colors.silver[200]})]}),g&&e(Af,{children:[t(Rf,{children:t(yn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Df,{children:0===D.length?t(Pf,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const i=n===fa;return e(Pf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(_f,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Lf,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:Ka,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!i&&t(yt,{"data-id":`stream-delete-${n}`,icon:Va,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Ff,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:Ha,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),N(!0),I(!0)}})})]})]}),E&&t(Ur,{defaultExcludeName:u,children:t(bm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(Ur,{children:t(vm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(mr,{target:`${nt.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var _},zf=b(ae)`
|
|
1287
1287
|
width: 100%;
|
|
1288
1288
|
max-height: 320px;
|
|
1289
1289
|
overflow-y: auto;
|
|
1290
1290
|
gap: 8px;
|
|
1291
|
-
`,
|
|
1291
|
+
`,Xf=b(ie)`
|
|
1292
1292
|
width: 100%;
|
|
1293
1293
|
align-items: center;
|
|
1294
1294
|
gap: 8px;
|
|
1295
1295
|
padding: 8px 12px;
|
|
1296
1296
|
border-radius: 8px;
|
|
1297
1297
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1298
|
-
`,
|
|
1298
|
+
`,Bf=()=>{const i=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=oa(),{sourcesApi:p}=Sr(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=o(()=>{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,i=n.get(t)??[];i.push(e),n.set(t,i)}),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!==En.StaticPod).map(xn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),R=d(()=>{O(x,!1),T()},[O,x,T]),D=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),P=S.length>0,_=x.length>0,L=P&&_,F=o(()=>{const e=[{id:"multi-source-deselect",type:vn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:vn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:Il,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:vn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:Ha,onClick:()=>C(!0)}}):P?e.push({id:"multi-source-instrument",type:vn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:Ha,onClick:()=>b(!0)}}):_&&e.push({id:"multi-source-uninstrument",type:vn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Va,onClick:()=>g(!0)}}),e},[T,L,P,_]),M=e=>sa(e,Et.Source,{extended:!0})||e.id.name;return e(n,{children:[t(jn,{isOpen:w>0,richTitle:{icon:ll,title:"Selected sources",badge:{label:w}},actions:F}),t(tt,{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(mr,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:E,onDeny:E,onApprove:A}),t(mr,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:R}),t(tt,{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:()=>{D(),N()}},children:e(zf,{children:[S.map(n=>e(Xf,{children:[t(ce,{leftIcon:Ha,status:Pe.Success,useSecondaryTone:!0,textColor:i.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:El,status:Pe.Error,useSecondaryTone:!0,textColor:i.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??""}`))]})})]})},Uf=C`
|
|
1299
1299
|
0% {
|
|
1300
1300
|
background-position: 200% 50%;
|
|
1301
1301
|
}
|
|
1302
1302
|
100% {
|
|
1303
1303
|
background-position: 0% 50%;
|
|
1304
1304
|
}
|
|
1305
|
-
`,
|
|
1305
|
+
`,Vf=b.div`
|
|
1306
1306
|
display: flex;
|
|
1307
1307
|
align-items: center;
|
|
1308
1308
|
justify-content: space-evenly;
|
|
@@ -1313,43 +1313,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1313
1313
|
|
|
1314
1314
|
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%)`};
|
|
1315
1315
|
background-size: 200% 100%;
|
|
1316
|
-
animation: ${
|
|
1317
|
-
`,
|
|
1316
|
+
animation: ${Uf} 15s linear infinite;
|
|
1317
|
+
`,Hf=[al,ll,Ua,el],jf=({onRedirectToSampling:n})=>{const i=v();return e(Ko,{children:[e(ut,{fullHeight:!0,customTitle:t(Mf,{}),customSearch:t(Ef,{}),filters:t(Kg,{}),children:[t(Vf,{children:Hf.map((n,o)=>e(r,{children:[t(n,{size:24}),o<Hf.length-1&&t(Ba,{fill:i.v2.colors.white[500]+oe["020"],size:24})]},n.name))}),t(vf,{})]}),t(Nf,{onRedirectToSampling:n}),t(Bf,{})]})};var Gf;(e=>{e.Gateway="gateway",e.Node="node"})(Gf||(Gf={}));const Wf=({onClickDownloadDiagnose:n,onClickRefresh:i,loading:a,disabled:l})=>{const r=o(()=>{const e=[];return n&&e.push({id:Si(),type:vn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Dl,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),i&&e.push({id:Si(),type:vn.Button,buttonProps:{label:"Refresh",leftIcon:fl,size:ke.S,variant:Ie.Text,onClick:i,disabled:l,loading:a}}),e},[n,i,l,a]);return e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(ba,{icon:Vl,title:"Collectors Pipeline"}),t(va,{actions:r})]})},Kf=({pod:n,onClose:i})=>{const{formatTimeAgo:a}=rn(),{collectorsApi:l}=Sr(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=o(()=>[{id:Si(),title:"Node",label:r?.node??"-",withCopy:!0},{id:Si(),title:"Status",badge:{status:ya(r?.status),label:r?.status??"-"}}],[r]),c=o(()=>r?.containers?.map(e=>({id:Si(),items:[{id:Si(),title:"Container",label:e.name??"-"},{id:Si(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:Si(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Za:Qa,label:e.ready?"True":"False",invertColors:!0}},{id:Si(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Za:Qa,label:e.started?"True":"False",invertColors:!0}},{id:Si(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Si(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Si(),title:nt.RESTARTS,label:e.restarts.toString()},{id:Si(),title:"State Reason",label:e.stateReason??"-"},{id:Si(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Si(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Xt,{isOpen:!!n,header:{icon:vl,title:"Pod Information",onClose:i},children:r?e(Kt,{bgTint:"1000",richTitle:{icon:vl,title:r.name,withCopy:!0},children:[t(Kt,{bgTint:"900",cellsPerRow:2,items:s}),e(Kt,{bgTint:"900",richTitle:{icon:kl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(bn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(bn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(bn,{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(gr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Yf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Yf||(Yf={}));const Jf=e=>{const t=[{key:Yf.PodName,label:"Pod Name"},{key:Yf.Status,label:"Status"},{key:Yf.Restarts,label:nt.RESTARTS},{key:Yf.NodeName,label:"Node Name"},{key:Yf.Age,label:"Age"},{key:Yf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Yf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},qf=({isLoading:n,pods:i,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=rn(),[c,d]=l(null),p=o(()=>i.map(n=>({onClick:()=>d(n),cells:[{key:Yf.PodName,rawValue:n.name},{key:Yf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:ya(e),label:e});var e}},{key:Yf.Restarts,rawValue:n.restartsCount.toString()},{key:Yf.NodeName,rawValue:n.nodeName},{key:Yf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:i}=n;if(!i)return t(ee,{children:"-"});const o=(i?.metricsAcceptedRps??0)+(i?.metricsDroppedRps??0),a=o>0?Math.round((i?.metricsDroppedRps??0)/o*100):0,l=a>0?Pe.Error:Pe.Success,r=(i?.exporterSuccessRps??0)+(i?.exporterFailedRps??0),s=r>0?Math.round((i?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(ie,{$gap:4,children:[t(Be,{text:`Accepted: ${i.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${i.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?Hl:jl,useSecondaryTone:!0,invertColors:!0})}),t(Be,{text:`Success: ${i.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${i.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?Hl:jl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Yf.Age,rawValue:s(n.creationTimestamp)},{key:Yf.DockerImage,rawValue:n.image}]})),[i,r]);return e(Kt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:vl,title:"Pods"},children:[t(Vn,{variant:Hn.Data,isLoading:n,columns:Jf(a),rows:p}),t(Kf,{pod:c,onClose:()=>d(null)})]})},Zf=({isOpen:e,onClose:n,title:i,yaml:o})=>t(Xt,{isOpen:e,header:{icon:Gl,title:i,onClose:n},children:t(gr,{yaml:o,defaultOpen:!0})}),Qf=e=>{switch(e){case Ca.Healthy:return"All desired replicas are updated, available, and ready";case Ca.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ca.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ca.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ca.Down:return"No available replicas";case Ca.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var eb;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(eb||(eb={}));const tb=b.div`
|
|
1318
1318
|
flex: 0.5;
|
|
1319
1319
|
padding: 12px;
|
|
1320
1320
|
border-radius: 12px;
|
|
1321
1321
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1322
|
-
`,
|
|
1322
|
+
`,nb=({selectedTab:n,gatewayInfo:i,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=rn(),[c,d]=l(null),p=o(()=>(e=>{switch(e){case Gf.Gateway:return"Deployment";case Gf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=o(()=>((e,t,n,i)=>{const o={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Gf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Gf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return o}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:fl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${i(l)}`}:o})(n,i,a,s),[i,a,n,s]),h=o(()=>((e,t,n,i)=>{let o=i?Pe.Info:Pe.Unknown,a=i?"Loading":Ca.Unknown,l=i?"Fetching data...":Qf(Ca.Unknown);switch(e){case Gf.Gateway:o=t?.status?ya(t?.status):o,a=t?.status??a,l=t?.status?Qf(t.status):l;break;case Gf.Node:o=n?.status?ya(n?.status):o,a=n?.status??a,l=n?.status?Qf(n.status):l}return{status:o,title:a,description:l}})(n,i,a,r),[i,a,n,r]),m=o(()=>((e,t,n)=>{switch(e){case Gf.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 Gf.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,i,a),[i,a,n]),g=o(()=>((e,t,n,i)=>{switch(e){case Gf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:On(t?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:On(t?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:On(t?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:i}]}];case Gf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:On(n?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:On(n?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:On(n?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:i}]}];default:return[]}})(n,i,a,r),[i,a,n,r]),f=o(()=>(n===Gf.Gateway?i?.manifestYAML:a?.manifestYAML)??"",[i,a,n]),b=o(()=>(n===Gf.Gateway?i?.configMapYAML:a?.configMapYAML)??"",[i,a,n]);return e(Kt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Gl,title:p,badge:u},actions:[{id:Si(),type:vn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:eb.ManifestYaml,label:p,icon:Wl},{id:eb.ConfigMapYaml,label:"ConfigMap",icon:Wl}]}}],children:[e(ie,{$gap:16,children:[t("div",{children:t(Sa,{...h})}),m.map(e=>t(tb,{children:t("div",{children:t(xa,{...e})})},e.title)),g.map(e=>t(wa,{...e},e.title))]}),t(Zf,{isOpen:c===eb.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Zf,{isOpen:c===eb.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},ib=[{value:Gf.Gateway,label:"Gateway"},{value:Gf.Node,label:"Node Collector"}],ob=({minSupportedVersion:n})=>{const{isVersionSupported:i,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Gf.Gateway),p=s===Gf.Gateway,u=s===Gf.Node,{collectorsApi:h,configApi:m}=Sr(),{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=o(()=>p?y:I,[y,I,p]);return e(Ko,{children:[t(Wf,{disabled:!i,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(Ta,{children:[e(ae,{children:[t(ve,{variant:Un.Underline,size:Mt.L,options:ib,selected:s,setSelected:c}),t(nb,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(qf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!i&&t(vr,{minSupportedVersion:r,currentVersion:a||""})]})]})},ab=b.div`
|
|
1323
1323
|
display: inline-flex;
|
|
1324
1324
|
align-items: center;
|
|
1325
1325
|
min-width: 0;
|
|
1326
1326
|
overflow: hidden;
|
|
1327
1327
|
white-space: pre;
|
|
1328
1328
|
text-overflow: ellipsis;
|
|
1329
|
-
`,
|
|
1329
|
+
`,lb=b.div`
|
|
1330
1330
|
display: flex;
|
|
1331
1331
|
flex-direction: column;
|
|
1332
1332
|
gap: 4px;
|
|
1333
1333
|
min-width: 0;
|
|
1334
1334
|
flex: 1;
|
|
1335
1335
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1336
|
-
`,
|
|
1336
|
+
`,rb=b(ie)`
|
|
1337
1337
|
flex-shrink: 0;
|
|
1338
1338
|
gap: 6px;
|
|
1339
1339
|
align-items: center;
|
|
1340
1340
|
min-height: 22px;
|
|
1341
|
-
`,
|
|
1341
|
+
`,sb=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],cb=[{value:"all",label:ka},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],db=({title:n,items:i,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=o(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(i,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),i=e.summary.map(e=>e.text).join("").toLowerCase();return t||i.includes(n)})})(e,m),e},[i,f,r,m]),C=o(()=>y.map(n=>{const i=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(lb,{$disabled:n.disabled,children:[t(ab,{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(rb,{children:[n.disabled&&t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&i&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:i.bg,textColor:i.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=o(()=>{const e=e=>t(Wa,{...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:Zn,leftIcon:Ka,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(ut,{fullHeight:!0,richTitle:{icon:Pl,title:n,badge:{label:i.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:cb,selected:f,setSelected:b}}:{}},children:t(Vn,{variant:Hn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:Ia,subTitle:Oa(m)}:{hideIcon:!0,title:Na,button:{label:Ea,onClick:c}},columns:sb,rows:C,getRowActions:x})})},pb=({docsUrl:n})=>{const{samplingApi:i,sourcesApi:r}=Sr(),{items:s}=r.useSources(),c=o(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=i.useSamplingRules(),f=d((e,t)=>i.createNoisy?.({samplingId:e,rule:t}),[i]),b=d((e,t,n)=>i.updateNoisy?.(t,{samplingId:e,rule:n}),[i]),v=d((e,t)=>i.createHighlyRelevant?.({samplingId:e,rule:t}),[i]),y=d((e,t,n)=>i.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[i]),C=d((e,t)=>i.createCostReduction?.({samplingId:e,rule:t}),[i]),S=d((e,t,n)=>i.updateCostReduction?.(t,{samplingId:e,rule:n}),[i]),x=d((e,t,n)=>"noisy"===n?i.deleteNoisy?.(t,e):"highlyRelevant"===n?i.deleteHighlyRelevant?.(t,e):"costReduction"===n?i.deleteCostReduction?.(t,e):void 0,[i]),w=d((e,t)=>i.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[i]),T=o(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=o(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,E]=l(_.Noisy),[N,O]=l(null),[$,D]=l(!1),[P,Q]=l(!1),[ee,te]=l(null),[ne,oe]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=Sn();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]),D(!1),O(e))},[h,u,ue,he]);const me=o(()=>A(m),[m]),ge=o(()=>M(u),[u]),fe=o(()=>R(ge?.rule??null),[ge]),be=o(()=>z(u),[u]),ye=o(()=>X(be?.rule??null),[be]),Ce=p(N);Ce.current=N,a(()=>{const e=Ce.current;if(!e)return;const t=B(u,e);t?O(t):(O(null),D(!1))},[u]);const Se=o(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=o(()=>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&&(D(!1),O(t))},[u]),$e=d(()=>{O(null),D(!1)},[]),Ae=d((e,t)=>{const n=N;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),O({...n});else for(const n of u){if(n.id!==t)continue;const i=[...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(i)return D(!0),void O({category:i.category,rule:i.rule,samplingId:t,summary:W(i.category,i.rule)})}},[N,u]),Re=d(async(e,t,n)=>{const i=N?.category;if(i){switch(i){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))}D(!1)}},[N,b,y,S]),_e=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Le=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=N?.category||K[I];await x(t,e,n),O(null),D(!1),te(null)},[ee,N,I,x]),Fe=d(()=>te(null),[]),Me=d(async(e,t)=>{await w(e,t),oe(!1)},[w]),ze=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",i=be;i?await S(i.samplingId,i.rule.ruleId,{name:i.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:i.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]),Be=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs});break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}}return n?{message:$a,ruleId:n}:null},[u,I]),Ue=d(e=>{const t=N?.category,n=N?.rule.ruleId;if(!t)return null;let i=null;switch(t){case"noisy":{const o=j(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}case"highlyRelevant":{const o=H(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs},n);break}case"costReduction":{const o=V(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}}return i?{message:$a,ruleId:i}:null},[u,N]),Ve=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 D(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),He=o(()=>{const e=[];return n&&e.push({id:Si(),type:vn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Aa,leftIcon:Ga,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Si(),type:vn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ra,leftIcon:fl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:Si(),type:vn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Da,rightIcon:Ha,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Ko,{children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(ba,{icon:Pl,title:_a,subTitle:Pa}),t(va,{actions:He})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Un.Underline,size:Mt.L,options:J,selected:I,setSelected:E}),e(ie,{$justifyContent:"space-between",children:[t(De,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ga,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===_.Noisy?t(nr,{title:ct,summary:me,onEdit:()=>oe(!0)}):I===_.HighlyRelevant?t(nr,{title:ot,summary:fe,onEdit:()=>re(!0)}):I===_.CostReduction?t(nr,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(db,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===_.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:_e})]}),t(rm,{formType:Er.View,data:N,defaultEditMode:$,onClose:$e,onDelete:_e,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:Ve}),t(rm,{formType:Er.Create,isOpen:P,category:K[I],onClose:Ee,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Be,onNavigateToDuplicate:Ve}),t(rm,{formType:Er.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>oe(!1),onSave:Me}),t(rm,{formType:Er.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:ze}),t(rm,{formType:Er.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:za,description:Ma,isOpen:!!ee,onClose:Fe,denyButton:{label:Fa,variant:Ie.Secondary,onClick:Fe},approveButton:{label:La,variant:Ie.Primary,onClick:()=>{Le(),Fe()}}}),!1]})},ub=b.div`
|
|
1342
1342
|
padding: 12px;
|
|
1343
1343
|
border-radius: 12px;
|
|
1344
1344
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1345
|
-
`,
|
|
1345
|
+
`,hb=f(({id:e,data:n})=>t(ub,{"data-id":e,children:t($e,{...n})}));var mb,gb;hb.displayName=hb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(mb||(mb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(gb||(gb={}));const fb=(e,t,n)=>{if(n)return{icons:[Tl],aggService:e,selected:!0};const i=e.isVirtual,o=i?[wn(e)]:t?Tn(t):[Kl],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:ra(t?.conditions||[]);return{icons:o,status:a,isVirtual:i,aggService:e,selected:!0}},bb=e=>!(!e||e.serviceName!==Gp||e.id.namespace||e.id.name||e.id.kind),vb=new os,yb={"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"},Cb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Sb={id:{namespace:"",name:"",kind:""},serviceName:Gp,markedForInstrumentation:{markedForInstrumentation:!0}},xb=h(null),wb=()=>{const e=m(xb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Tb=({serviceMap:e,children:n})=>{const i=v(),{sourcesApi:r}=Sr(),{items:s}=r.useSources(),[c,p,u]=jr([]),[h,m,g]=Gr([]),[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===mb.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,i=(e,n,i=!1)=>{let o=t.get(e);return o||(o={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,o)),o},o=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=Cb(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Cb(e?.nodeId??"");e.isVirtual&&(n.add(t),o(i(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[o,a]of e)t.has(o)||i(o,a.targetServiceName,n.has(o));const l=[];for(const[e,{serviceName:n,isVirtual:i,attributes:o,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),o=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=e.find(e=>o.serviceName===e.serviceName||o.serviceName===e.id.name),a=bb(t);n.push({id:o.graphKey,type:mb.MapItem,position:i,data:fb(o,t,a),measured:{width:80,height:80}})}else n.push({id:mb.NoData,type:mb.NoData,position:i,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[Sb].concat(s)});if(1===o.length&&o[0].id===mb.NoData)return p(o),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=o.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;o.has(r)&&i.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Hr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return i})({theme:i,nodes:o,aggregatedServiceMap:n});m(a);const l=o.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...yb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Gp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await vb.layout(i),a=new Map;return o.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}})(o,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 o.map(e=>{const n=t.get(e.id);return n?e.type===mb.MapItem&&n.type===mb.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[i,e,s,C]);const O=o(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:gb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=o(()=>({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(xb.Provider,{value:$,children:n})},kb=b.div`
|
|
1346
1346
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1347
1347
|
border-radius: 8px;
|
|
1348
1348
|
cursor: pointer;
|
|
1349
1349
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1350
|
-
`,
|
|
1350
|
+
`,Ib=b.div`
|
|
1351
1351
|
position: relative;
|
|
1352
|
-
`,
|
|
1352
|
+
`,Eb=b.div`
|
|
1353
1353
|
position: absolute;
|
|
1354
1354
|
top: 100%;
|
|
1355
1355
|
left: 50%;
|
|
@@ -1358,7 +1358,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1358
1358
|
align-items: center;
|
|
1359
1359
|
gap: 4px;
|
|
1360
1360
|
margin-top: 4px;
|
|
1361
|
-
`,
|
|
1361
|
+
`,Nb=f(({id:i,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=wb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=o(()=>({isUserSource:i===Gp,isNodeSelected:d===i,isHovered:p===i}),[i,d,p,i]),{isSelected:g,isHighlighted:f}=o(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Mn(r,c):null;return e(n,{children:[t(Wr,{type:"source",position:Kr.Right,style:{visibility:"hidden"}}),t(Wr,{type:"target",position:Kr.Left,style:{visibility:"hidden"}}),e(Ib,{"data-id":i,children:[t(kb,{$isSelected:g,$isVirtual:s,children:t(kn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Eb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:i})]})]})]})});Nb.displayName=Nb.name;const Ob=b.div`
|
|
1362
1362
|
display: flex;
|
|
1363
1363
|
flex-direction: column;
|
|
1364
1364
|
gap: 12px;
|
|
@@ -1371,10 +1371,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1371
1371
|
top: 16px;
|
|
1372
1372
|
left: 8px;
|
|
1373
1373
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1374
|
-
|
|
1374
|
+
`,$b=({children:e})=>t(Ob,{children:e});var Ab,Rb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Ab||(Ab={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Rb||(Rb={}));const Db=b.div`
|
|
1375
1375
|
flex: 1 1 auto;
|
|
1376
1376
|
min-height: 0;
|
|
1377
|
-
`,
|
|
1377
|
+
`,Pb=()=>{const{nodes:n,activeNodeId:i,resetActiveNode:a}=wb(),[r,s]=l(Ab.All),c=o(()=>{const e=new Map;for(const t of n)t.type===mb.MapItem&&e.set(t.id,t);return e},[n]),d=o(()=>c.get(i??""),[c,i]),{inbound:p,outbound:u}=o(()=>{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=[Ab.All,Ab.Inbound].includes(r)&&p.length>0,m=[Ab.All,Ab.Outbound].includes(r)&&u.length>0;return e($b,{children:[e(ie,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:ml,onClick:a}),t(kn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Ab.All}`,value:Ab.All,badge:{label:`${p.length+u.length}`}},{label:`${Ab.Inbound}`,value:Ab.Inbound,badge:{label:`${p.length}`}},{label:`${Ab.Outbound}`,value:Ab.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Lb,{halfHeight:m,title:"Inbound",icon:xl,connections:p,mapNodesById:c}),m&&t(Lb,{halfHeight:h,title:"Outbound",icon:wl,connections:u,mapNodesById:c})]})},_b=b.div`
|
|
1378
1378
|
display: flex;
|
|
1379
1379
|
flex-direction: column;
|
|
1380
1380
|
gap: 8px;
|
|
@@ -1382,17 +1382,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1382
1382
|
border-radius: 12px;
|
|
1383
1383
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1384
1384
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1385
|
-
`,
|
|
1385
|
+
`,Lb=({halfHeight:n,title:i,icon:o,connections:a,mapNodesById:l})=>{const r=v();return e(_b,{$halfHeight:n,children:[e(ie,{children:[t(o,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:i})]}),t(Db,{children:t(Cn,{gap:4,elements:a.map(e=>t(Mb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Fb=b.div`
|
|
1386
1386
|
display: flex;
|
|
1387
1387
|
align-items: center;
|
|
1388
1388
|
gap: 8px;
|
|
1389
1389
|
padding: 8px;
|
|
1390
1390
|
border-radius: 8px;
|
|
1391
1391
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1392
|
-
`,
|
|
1392
|
+
`,Mb=({connection:n,peerNode:i})=>e(Fb,{children:[i&&t(kn,{icons:i.data.icons}),e(ie,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),zb="0;0.5;1",Xb=f(({id:i,sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Yr({sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${i}__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:i,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(qr,{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,i)=>{const o=`-${(.8*i).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:o,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:o,repeatCount:"indefinite",keyTimes:zb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:o,repeatCount:"indefinite",keyTimes:zb,values:`${g};${f};${f}`})]},i)})]})})]})});Xb.displayName=Xb.name;const Bb=b.div`
|
|
1393
1393
|
flex: 1 1 auto;
|
|
1394
1394
|
min-height: 0;
|
|
1395
|
-
`,
|
|
1395
|
+
`,Ub=({})=>{const{nodes:n,setNodesSelected:i,resetActiveNode:a}=wb(),[r,s]=l(""),c=o(()=>n.filter(e=>e.type===mb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=o(()=>c.filter(e=>e.data.selected),[c]),u=o(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=o(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;i(u.map(e=>e.id),e),e||a()},[u,h,i,a]);return c.length?e($b,{children:[e(ie,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(yn,{width:"100%",value:r,onChange:s}),e(ie,{$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?nt.UNSELECT_ALL:nt.SELECT_ALL})]}),t(Bb,{children:t(Cn,{gap:4,elements:u.map(e=>t(Hb,{node:e},e.id))})})]}):null},Vb=b.div`
|
|
1396
1396
|
display: flex;
|
|
1397
1397
|
align-items: center;
|
|
1398
1398
|
gap: 8px;
|
|
@@ -1400,7 +1400,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1400
1400
|
border-radius: 8px;
|
|
1401
1401
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1402
1402
|
cursor: pointer;
|
|
1403
|
-
`,
|
|
1403
|
+
`,Hb=({node:n})=>{const{setNodesSelected:i,activeNodeId:o,resetActiveNode:a}=wb(),l=d(()=>{const e=!n.data.selected,t=o===n.id;i([n.id],e),!e&&t&&a()},[n,o,i,a]);return e(Vb,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(kn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},jb=b.div`
|
|
1404
1404
|
position: relative;
|
|
1405
1405
|
height: 100%;
|
|
1406
1406
|
.react-flow__attribution {
|
|
@@ -1409,7 +1409,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1409
1409
|
* {
|
|
1410
1410
|
transition: none;
|
|
1411
1411
|
}
|
|
1412
|
-
`,
|
|
1412
|
+
`,Gb=b.div`
|
|
1413
1413
|
.react-flow__controls {
|
|
1414
1414
|
display: flex;
|
|
1415
1415
|
align-items: center;
|
|
@@ -1435,33 +1435,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
|
-
`,
|
|
1438
|
+
`,Wb={[mb.MapItem]:Nb,[mb.NoData]:hb},Kb={[gb.AnimatedTraffic]:Xb},Yb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Jb=({trigger:e})=>{const{fitView:t}=is(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Yb))},[e,t]),null},qb=({onRefresh:n})=>{const{nodes:i,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=wb(),p=o(()=>{const e=new Set(i.filter(e=>e.type===mb.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 i.filter(e=>e.type!==mb.MapItem||e.data.selected||t.has(e.id))},[i,a]);return e(Qr,{zoomOnScroll:!0,nodes:p,nodeTypes:Wb,edges:a,edgeTypes:Kb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(es,{}),t(Jb,{trigger:l}),t(Gb,{children:t(ts,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Yb,children:t(ns,{onClick:n,children:t(fl,{})})})})]})},Zb=n=>t(Zr,{children:e(jb,{children:[t(qb,{...n}),t(Ub,{}),t(Pb,{})]})}),Qb=b.div`
|
|
1439
1439
|
width: 100%;
|
|
1440
1440
|
flex: 1;
|
|
1441
1441
|
align-self: stretch;
|
|
1442
1442
|
min-height: 0;
|
|
1443
1443
|
height: 100%;
|
|
1444
1444
|
position: relative;
|
|
1445
|
-
`,
|
|
1445
|
+
`,ev=()=>{const{serviceMapApi:e}=Sr(),{data:n,refetch:i}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Tb,{serviceMap:n?.serviceMap??[],children:t(Qb,{children:t(Zb,{onRefresh:i})})})},tv=b.div`
|
|
1446
1446
|
display: flex;
|
|
1447
1447
|
align-items: center;
|
|
1448
1448
|
justify-content: space-between;
|
|
1449
1449
|
padding: 0 12px;
|
|
1450
|
-
`,
|
|
1450
|
+
`,nv=b.div`
|
|
1451
1451
|
display: flex;
|
|
1452
1452
|
align-items: center;
|
|
1453
1453
|
gap: 8px;
|
|
1454
|
-
`,
|
|
1454
|
+
`,iv=b.div`
|
|
1455
1455
|
width: 1px;
|
|
1456
1456
|
height: 20px;
|
|
1457
1457
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1458
|
-
`,
|
|
1458
|
+
`,ov=({disabled:n,loading:i,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=o(()=>a?[{id:Si(),type:vn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Wl,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=o(()=>{const e=[];return s&&e.push({id:Si(),type:vn.Button,buttonProps:{leftIcon:fl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:i}}),r&&e.push({id:Si(),type:vn.Button,buttonProps:{leftIcon:Va,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,i,r,s,c]),m=u.length>0,g=h.length>0;return e(tv,{children:[t(ba,{icon:bl,title:"Odigos Settings"}),e(nv,{children:[m&&t(va,{actions:u}),m&&g&&t(iv,{}),g&&t(va,{actions:h})]}),t(tt,{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)}}})]})},av=b(ae)`
|
|
1459
1459
|
width: 220px;
|
|
1460
1460
|
flex-shrink: 0;
|
|
1461
1461
|
height: 100%;
|
|
1462
1462
|
gap: 4px;
|
|
1463
1463
|
overflow-y: auto;
|
|
1464
|
-
`,
|
|
1464
|
+
`,lv=({options:e,selected:n,setSelected:i,disabled:o})=>t(av,{children:e.map(e=>t(ds,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:o,onClick:()=>i(e.id)},e.id))}),rv=b(ae)`
|
|
1465
1465
|
width: 100%;
|
|
1466
1466
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1467
1467
|
max-width: 844px;
|
|
@@ -1471,25 +1471,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1471
1471
|
gap: 24px;
|
|
1472
1472
|
flex: 1;
|
|
1473
1473
|
min-height: 0;
|
|
1474
|
-
`,
|
|
1474
|
+
`,sv=b(ie)`
|
|
1475
1475
|
flex: 1;
|
|
1476
1476
|
min-height: 0;
|
|
1477
1477
|
width: 100%;
|
|
1478
1478
|
align-self: stretch;
|
|
1479
|
-
`,
|
|
1479
|
+
`,cv=b(ae)`
|
|
1480
1480
|
flex: 1;
|
|
1481
1481
|
min-height: 0;
|
|
1482
1482
|
height: 100%;
|
|
1483
1483
|
max-width: 600px;
|
|
1484
1484
|
overflow-y: auto;
|
|
1485
|
-
`,
|
|
1485
|
+
`,dv=b(ie)`
|
|
1486
1486
|
gap: 8px;
|
|
1487
1487
|
width: 100%;
|
|
1488
1488
|
align-items: center;
|
|
1489
|
-
`,
|
|
1489
|
+
`,pv=b.div`
|
|
1490
1490
|
flex: 1;
|
|
1491
1491
|
min-width: 0;
|
|
1492
|
-
`,
|
|
1492
|
+
`,uv=e=>"general"===e.name?0:"advanced"===e.name?2:1,hv=({minSupportedVersion:i})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(i),{configApi:p}=Sr(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=o(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Zt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=o(()=>[...b].sort((e,t)=>uv(e)-uv(t)),[b]),N=o(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=o(()=>{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]),$=o(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=l(!1),[D,P]=l(!1),_=o(()=>[{id:Si(),type:vn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:il,loading:v,onClick:()=>R(!0)}},{id:Si(),type:vn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:ol,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=o(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=o(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:X,setScrollContainerRef:B}=Xa({sectionNames:F});return t(Ko,{$gap:24,children:e(rv,{children:[t(ov,{disabled:!r,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(Ta,{children:[!r&&t(vr,{minSupportedVersion:d,currentVersion:s||""}),t(jn,{isOpen:I,richTitle:{icon:bl,title:"Config Settings"},actions:_}),t(tt,{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:()=>R(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>R(!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 i=t[n];i in e&&"object"==typeof e[i]&&null!==e[i]||(e[i]={}),e=e[i]}e[t[t.length-1]]=n},i=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let o=i;for(const e of t){if(null==o||"object"!=typeof o){o=void 0;break}o=o[e]}"string"==typeof o&&n(i,t,o.replaceAll("-","_"))}return i})(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,{})})(),R(!1)}}}),e(sv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(lv,{options:L,selected:M,setSelected:z,disabled:!r}),t(cv,{ref:B,$gap:24,$width:"100%",children:b.length?E.map(i=>t(ut,{id:i.name,bordered:!0,ref:e=>X(i.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:i.displayName}),children:t(ae,{$gap:24,children:i.fields.map(i=>{if(i.isEnterpriseOnly&&!c)return null;if(i.renderCondition&&!en(i.renderCondition,[],$))return null;const o=kt(i.componentProps||"{}",{}),a=N[i.helmValuePath],l=i.componentType===jt.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:i.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=i.description?t(ee,{size:te.XXS,color:ne.Secondary,children:i.description}):null,u=e(ae,{$gap:4,children:[e(ie,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(yr,{componentType:i.componentType,inputType:o.type,name:i.helmValuePath,disabled:i.isHelmOnly||v,value:T("formData",i.helmValuePath),setValue:e=>w(i.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},i.helmValuePath),m=i.isHelmOnly?t(Be,{text:"This field can only be updated via the Helm values.yaml file",children:t(Yl,{})}):null;return t(ae,{$gap:8,children:l?e(ie,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(ie,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(dv,{children:[t(pv,{children:h}),m]})]})},i.helmValuePath)})})},i.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:bl,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Xt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Wl,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(gr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},mv=b.div`
|
|
1493
1493
|
position: fixed;
|
|
1494
1494
|
bottom: 12px;
|
|
1495
1495
|
left: 12px;
|
|
@@ -1498,4 +1498,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1498
1498
|
flex-direction: column-reverse;
|
|
1499
1499
|
gap: 6px;
|
|
1500
1500
|
max-width: 600px;
|
|
1501
|
-
`,
|
|
1501
|
+
`,gv=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=on(),o=e.filter(({dismissed:e})=>!e);return t(mv,{children:o.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=o.length-s;return t(De,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&i(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{ic as AddActionDrawer,Ps as AddActionForm,bm as AddDataStreamModal,hc as AddDestinationDrawer,Ls as AddDestinationForm,mc as AddRuleDrawer,Hs as AddRuleForm,$c as AddSourceDrawer,Tg as CentralConnections,hp as CloudConnectorStep,fp as CreateCloudConnectorDrawer,bg as CreateNewType,Gs as DataStreamForm,js as DataStreamMergeWarning,yp as EditActionDrawer,Cp as EditConfigDrawer,vm as EditDataStreamModal,xp as EditDestinationDrawer,Tp as EditRuleDrawer,Yh as EditSourceDrawer,Ws as EditSourceForm,Mg as Onboarding,Sm as OnboardingDone,jf as Overview,ob as PipelineCollectors,Jl as RegexTesterDrawer,gg as SamplingOnboardingModal,rm as SamplingRuleDrawer,Qs as SamplingRuleForm,pb as SamplingRules,ev as ServiceMap,hv as Settings,fm as SystemDrawer,ib as TABS,gv as ToastList};
|